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

Function create_server_app

tests/unittests/a2a/integration/server.py:76–101  ·  view source on GitHub ↗

Creates an A2A FastAPI application with a mocked runner. Args: run_async_fn: A generator function that takes **kwargs and yields Event objects. config: Optional executor configuration. task_store: Optional task store instance. Defaults to InMemoryTaskStore. Returns: A Fas

(
    run_async_fn=None,
    config: A2aAgentExecutorConfig | None = None,
    task_store=None,
)

Source from the content-addressed store, hash-verified

74
75
76def create_server_app(
77 run_async_fn=None,
78 config: A2aAgentExecutorConfig | None = None,
79 task_store=None,
80):
81 """Creates an A2A FastAPI application with a mocked runner.
82
83 Args:
84 run_async_fn: A generator function that takes **kwargs and yields Event
85 objects.
86 config: Optional executor configuration.
87 task_store: Optional task store instance. Defaults to InMemoryTaskStore.
88
89 Returns:
90 A FastAPI application instance.
91 """
92 runner = FakeRunner(run_async_fn)
93 executor = A2aAgentExecutor(runner=runner, config=config)
94 if task_store is None:
95 task_store = InMemoryTaskStore()
96 handler = DefaultRequestHandler(
97 agent_executor=executor, task_store=task_store
98 )
99
100 app = A2AFastAPIApplication(agent_card=agent_card, http_handler=handler)
101 return app.build()

Calls 3

A2aAgentExecutorClass · 0.90
FakeRunnerClass · 0.85
buildMethod · 0.45