run_config.go

Overview

The run_config.go file defines configuration types that control the runtime behavior of an agent within the system. Specifically, it introduces the StreamingMode type to specify how agent execution outputs are streamed, and the RunConfig struct which encapsulates runtime options such as streaming mode and input blob artifact saving. This configuration is essential for tailoring the execution characteristics of agents that interact with large language models and other runtime components.

Types and Constants

StreamingMode (type)

StreamingMode is a string-based enumeration that defines the mode of streaming for agent execution outputs. It determines how responses generated by the agent are delivered during runtime.

StreamingMode Constants

RunConfig (struct)

RunConfig is a configuration struct used to control the runtime behavior of an agent. It allows fine-tuning of agent execution parameters related to output streaming and artifact management.

Fields

Field Name

Type

Description

StreamingMode

StreamingMode

Specifies the streaming mode for the agent execution. Determines how output is streamed.

SaveInputBlobsAsArtifacts

bool

If true, any parts of the user input that are binary blobs (e.g., images, files) are saved as artifacts by the ADK runner.

Usage Example

config := RunConfig{
    StreamingMode: StreamingModeSSE,
    SaveInputBlobsAsArtifacts: true,
}

In this example, the agent will stream LLM responses using SSE and save any input blobs as artifacts.

Implementation Details

Interactions with Other System Components

Mermaid Class Diagram

classDiagram
class RunConfig {
+StreamingMode: StreamingMode
+SaveInputBlobsAsArtifacts: bool
}
class StreamingMode {
<<enumeration>>
+StreamingModeNone
+StreamingModeSSE
}
RunConfig --> StreamingMode