Create integration page for environment simulation - #2174
Open
zyantw wants to merge 6 commits into
Open
Conversation
This was referenced Aug 25, 2026
zyantw
marked this pull request as ready for review
August 25, 2026 19:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-pythonGitHub repository:Factory Interface & Entry Points
src/google/adk/tools/environment_simulation/environment_simulation_factory.pyEnvironmentSimulationFactory(Line 33)create_callback(config: EnvironmentSimulationConfig): Returns an asynchronous callbackCallable[[BaseTool, Dict[str, Any], Any], Awaitable[Optional[Dict[str, Any]]]]suitable forbefore_tool_callback(Lines 37–58).create_plugin(config: EnvironmentSimulationConfig): Returns an instance ofEnvironmentSimulationPluginfor registration withApp(plugins=[...])(Lines 61–74).Configuration Objects & Validation Logic
src/google/adk/tools/environment_simulation/environment_simulation_config.pyInjectedError(Lines 42–53):injected_http_error_code: interror_message: strInjectionConfig(Lines 56–81):injection_probability: float = 1.0match_args: Optional[Dict[str, Any]] = Noneinjected_latency_seconds: float = Field(default=0.0, le=120.0)random_seed: Optional[int] = Noneinjected_error: Optional[InjectedError] = Noneinjected_response: Optional[Dict[str, Any]] = Noneinjected_errororinjected_responseis provided.MockStrategy(Lines 84–94):MOCK_STRATEGY_UNSPECIFIED = 0MOCK_STRATEGY_TOOL_SPEC = 1(Standard LLM-powered schema mock)MOCK_STRATEGY_TRACING = 2(Deprecated, historical replay)ToolSimulationConfig(Lines 97–123):tool_name: strinjection_configs: List[InjectionConfig] = Field(default_factory=list)mock_strategy_type: MockStrategy = MockStrategy.MOCK_STRATEGY_UNSPECIFIEDinjection_configsis empty,mock_strategy_typecannot beMOCK_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 toThinkingConfig(10240))tracing: Optional[str] = Noneenvironment_data: Optional[str] = Nonetool_simulation_configsis non-empty and contains uniquetool_nameentries.Plugin Execution Lifecycle
src/google/adk/tools/environment_simulation/environment_simulation_plugin.pyEnvironmentSimulationPlugin(BasePlugin)(Line 31)async def before_tool_callback(self, tool: BaseTool, tool_args: dict[str, Any], tool_context: ToolContext) -> Optional[Dict[str, Any]](Lines 39–43).Simulation Engine & Connection Analysis
src/google/adk/tools/environment_simulation/environment_simulation_engine.pysrc/google/adk/tools/environment_simulation/tool_connection_analyzer.pysrc/google/adk/tools/environment_simulation/tool_connection_map.pyToolConnectionAnalyzer.StatefulParameterinstances (creating_tools,consuming_tools).