Class RequestConfig

java.lang.Object
uno.anahata.asi.agi.event.BasicPropertyChangeSource
uno.anahata.asi.agi.provider.RequestConfig
All Implemented Interfaces:
PropertyChangeSource, Rebindable

public class RequestConfig extends BasicPropertyChangeSource
The definitive, model-agnostic configuration object for a single API request. It holds both the static behavioral parameters and provides live, just-in-time access to dynamic request data like tools and system instructions via its reference to the parent Agi.
Author:
anahata-gemini-pro-2.5
  • Field Details

    • agi

      private Agi agi
      The parent Agi session this configuration belongs to.
    • temperature

      private Float temperature
      The temperature for the request.
    • maxOutputTokens

      private Integer maxOutputTokens
      The maximum number of output tokens.
    • topK

      private Integer topK
      The top K parameter.
    • topP

      private Float topP
      The top P parameter.
    • candidateCount

      private Integer candidateCount
      The number of response variations to generate.
    • thinkingLevel

      private ThinkingLevel thinkingLevel
      The level of thinking tokens that the model should generate.
    • responseModalities

      private List<ResponseModality> responseModalities
      The list of response modalities requested for this specific request.
    • enabledServerTools

      private List<ServerTool> enabledServerTools
      The list of server-side tools enabled for this specific request.
    • includePruned

      private boolean includePruned
      If true, the adapter should include pruned messages and parts in the API request. For debugging.
    • injectInbandMetadata

      private boolean injectInbandMetadata
      If true, in-band metadata headers are injected into the prompt for history pruning purposes.
    • useNativeSchemas

      private boolean useNativeSchemas
      Whether to use the native provider Schema objects for tool parameters and responses, or to use our custom, purified JSON schemas. Defaults to false (using custom schemas).
    • systemInstructionsTokenCount

      private int systemInstructionsTokenCount
      The total token count of the system instructions as reported by the provider.
    • systemInstructionsRawJson

      private String systemInstructionsRawJson
      The raw JSON representation of the system instructions.
  • Constructor Details

    • RequestConfig

      public RequestConfig(Agi agi)
      Constructs a new request configuration for the specified Agi.
      Parameters:
      agi - The parent session.
  • Method Details

    • setInjectInbandMetadata

      public void setInjectInbandMetadata(boolean injectInbandMetadata)
      Sets whether in-band metadata headers should be injected into the prompt and fires a property change event.
      Parameters:
      injectInbandMetadata - true to enable in-band metadata injection.
    • getSystemInstructions

      public List<String> getSystemInstructions()
      Gets the system instructions for this request, assembled just-in-time by the ContextManager.
      Returns:
      A list of TextParts representing the system instructions.
    • getLocalTools

      public List<? extends AbstractTool> getLocalTools()
      Gets the tools for this request, determined just-in-time based on the agi's configuration (local vs. server-side).
      Returns:
      A list of AbstractTools, or null if server-side tools are active.
    • isServerToolsEnabled

      public boolean isServerToolsEnabled()
      Checks if server-side tools (like Google Search) are enabled for this request.
      Returns:
      true if server tools are enabled.