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

Function main

contributing/samples/plugin/plugin_basic/main.py:39–60  ·  view source on GitHub ↗

Main entry point for the agent.

()

Source from the content-addressed store, hash-verified

37
38
39async def main():
40 """Main entry point for the agent."""
41 prompt = 'hello world'
42 runner = InMemoryRunner(
43 agent=root_agent,
44 app_name='test_app_with_plugin',
45 # [Step 2] Add your plugin here. You can add multiple plugins.
46 plugins=[CountInvocationPlugin()],
47 )
48 session = await runner.session_service.create_session(
49 user_id='user',
50 app_name='test_app_with_plugin',
51 )
52
53 async for event in runner.run_async(
54 user_id='user',
55 session_id=session.id,
56 new_message=types.Content(
57 role='user', parts=[types.Part.from_text(text=prompt)]
58 ),
59 ):
60 print(f'** Got event from {event.author}')
61
62
63if __name__ == '__main__':

Callers 1

main.pyFile · 0.70

Calls 4

run_asyncMethod · 0.95
InMemoryRunnerClass · 0.90
create_sessionMethod · 0.45

Tested by

no test coverage detected