MCPcopy Index your code
hub / github.com/google/adk-python / MockLiveAgent

Class MockLiveAgent

tests/unittests/test_runners.py:72–87  ·  view source on GitHub ↗

Mock live agent for unit testing.

Source from the content-addressed store, hash-verified

70
71
72class MockLiveAgent(BaseAgent):
73 """Mock live agent for unit testing."""
74
75 def __init__(self, name: str):
76 super().__init__(name=name, sub_agents=[])
77
78 async def _run_live_impl(
79 self, invocation_context: InvocationContext
80 ) -> AsyncGenerator[Event, None]:
81 yield Event(
82 invocation_id=invocation_context.invocation_id,
83 author=self.name,
84 content=types.Content(
85 role="model", parts=[types.Part(text="live hello")]
86 ),
87 )
88
89
90class MockLlmAgent(LlmAgent):

Calls

no outgoing calls