Sync vs async execution in adk-fluent — when to use each method and where they work.
| Method | Script | Jupyter | FastAPI | adk web |
|---|---|---|---|---|
| .ask() | ✓ | ✗RuntimeError | ✗RuntimeError | ✗ |
| .ask_async() | ✓*asyncio.run() | ✓ | ✓ | ✓ |
| .stream() | ✗ | ✓ | ✓ | ✓ |
| .events() | ✗ | ✓ | ✓ | ✓ |
| .map() | ✓ | ✗RuntimeError | ✗RuntimeError | ✗ |
| .map_async() | ✓*asyncio.run() | ✓ | ✓ | ✓ |
SYNC methods (.ask(), .map()) call asyncio.run() internally.
If you are already inside an async event loop (Jupyter, FastAPI, adk web),
they will raise RuntimeError: This event loop is already running.
Use the ASYNC variants (.ask_async(), .map_async()) instead.