Skip to content

Create integration page for environment simulation - #2174

Open
zyantw wants to merge 6 commits into
mainfrom
zyantw-patch-11
Open

Create integration page for environment simulation#2174
zyantw wants to merge 6 commits into
mainfrom
zyantw-patch-11

Conversation

@zyantw

@zyantw zyantw commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Staged: shared link in internal tracker
Logo link: https://www.flaticon.com/free-icon/simulation_5376499

Agent's PR: #1257 and #1259

--

Technical Code Verification & Citations (google/adk-python)

All module names, class definitions, method signatures, parameter names, default values, and validation behaviors were verified against the google/adk-python GitHub repository:

Factory Interface & Entry Points

  • Source File: src/google/adk/tools/environment_simulation/environment_simulation_factory.py
  • Class: EnvironmentSimulationFactory (Line 33)
  • Methods:
    • create_callback(config: EnvironmentSimulationConfig): Returns an asynchronous callback Callable[[BaseTool, Dict[str, Any], Any], Awaitable[Optional[Dict[str, Any]]]] suitable for before_tool_callback (Lines 37–58).
    • create_plugin(config: EnvironmentSimulationConfig): Returns an instance of EnvironmentSimulationPlugin for registration with App(plugins=[...]) (Lines 61–74).

Configuration Objects & Validation Logic

  • Source File: src/google/adk/tools/environment_simulation/environment_simulation_config.py
  • Classes:
    • InjectedError (Lines 42–53):
      • injected_http_error_code: int
      • error_message: str
    • InjectionConfig (Lines 56–81):
      • injection_probability: float = 1.0
      • match_args: Optional[Dict[str, Any]] = None
      • injected_latency_seconds: float = Field(default=0.0, le=120.0)
      • random_seed: Optional[int] = None
      • injected_error: Optional[InjectedError] = None
      • injected_response: Optional[Dict[str, Any]] = None
      • Validator (Lines 72–80): Enforces that exactly one of injected_error or injected_response is provided.
    • MockStrategy (Lines 84–94):
      • MOCK_STRATEGY_UNSPECIFIED = 0
      • MOCK_STRATEGY_TOOL_SPEC = 1 (Standard LLM-powered schema mock)
      • MOCK_STRATEGY_TRACING = 2 (Deprecated, historical replay)
    • ToolSimulationConfig (Lines 97–123):
      • tool_name: str
      • injection_configs: List[InjectionConfig] = Field(default_factory=list)
      • mock_strategy_type: MockStrategy = MockStrategy.MOCK_STRATEGY_UNSPECIFIED
      • Validator (Lines 111–122): Enforces that if injection_configs is empty, mock_strategy_type cannot be MOCK_STRATEGY_UNSPECIFIED.
    • EnvironmentSimulationConfig (Lines 126–170):
      • tool_simulation_configs: List[ToolSimulationConfig]
      • simulation_model: str = "gemini-2.5-flash"
      • simulation_model_configuration: genai_types.GenerateContentConfig (defaults to ThinkingConfig(10240))
      • tracing: Optional[str] = None
      • environment_data: Optional[str] = None
      • Validator (Lines 157–170): Enforces that tool_simulation_configs is non-empty and contains unique tool_name entries.

Plugin Execution Lifecycle

Simulation Engine & Connection Analysis

@zyantw zyantw self-assigned this Aug 25, 2026
@zyantw
zyantw requested a review from joefernandez August 27, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant