Class LlmRequest

java.lang.Object
com.google.adk.JsonBaseModel
com.google.adk.models.LlmRequest

public abstract class LlmRequest extends JsonBaseModel
Represents a request to be sent to the LLM.
  • Constructor Details

    • LlmRequest

      public LlmRequest()
  • Method Details

    • model

      public abstract Optional<String> model()
      Returns the name of the LLM model to be used. If not set, the default model of the LLM class will be used.
      Returns:
      An optional string representing the model name.
    • contents

      public abstract List<com.google.genai.types.Content> contents()
      Returns the list of content sent to the LLM.
      Returns:
      A list of Content objects.
    • config

      public abstract Optional<com.google.genai.types.GenerateContentConfig> config()
      Returns the configuration for content generation.
      Returns:
      An optional GenerateContentConfig object containing the generation settings.
    • liveConnectConfig

      public abstract com.google.genai.types.LiveConnectConfig liveConnectConfig()
      Returns the configuration for live connections. Populated using the RunConfig in the InvocationContext.
      Returns:
      An optional LiveConnectConfig object containing the live connection settings.
    • tools

      public abstract Map<String,BaseTool> tools()
      Returns a map of tools available to the LLM.
      Returns:
      A map where keys are tool names and values are BaseTool instances.
    • getFirstSystemInstruction

      public Optional<String> getFirstSystemInstruction()
      returns the first system instruction text from the request if present.
    • getSystemInstructions

      public com.google.common.collect.ImmutableList<String> getSystemInstructions()
      Returns all system instruction texts from the request as an immutable list.
    • builder

      public static LlmRequest.Builder builder()
    • toBuilder

      public abstract LlmRequest.Builder toBuilder()