You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tools=[adk_tools.preload_memory_tool.PreloadMemoryTool()] # Add memory tools here
220
212
)
221
213
222
-
# Register the agent
223
-
registry = AgentRegistry.get_instance()
224
-
registry.set_default_agent(my_agent)
225
-
226
-
# Create middleware WITHOUT tools parameter - THIS IS CORRECT
214
+
# Create middleware with direct agent embedding
227
215
adk_agent = ADKAgent(
216
+
adk_agent=my_agent,
228
217
app_name="my_app",
229
218
user_id="user123",
230
219
memory_service=shared_memory_service # Memory service enables automatic session memory
231
220
)
232
221
```
233
222
234
-
**⚠️ Important**: The `tools` parameter belongs to the ADK agent (like `Agent` or `LlmAgent`), **not** to the `ADKAgent` middleware. The middleware automatically handles any tools defined on the registered agents.
223
+
**⚠️ Important**: The `tools` parameter belongs to the ADK agent (like `Agent` or `LlmAgent`), **not** to the `ADKAgent` middleware. The middleware automatically handles any tools defined on the embedded agents.
235
224
236
225
### Memory Testing Configuration
237
226
@@ -377,7 +366,7 @@ toolset = ClientProxyToolset(
377
366
### Tool Configuration
378
367
379
368
```python
380
-
from adk_middleware import ADKAgent, AgentRegistry
369
+
from adk_middleware import ADKAgent
381
370
from google.adk.agents import LlmAgent
382
371
from ag_ui.core import RunAgentInput, UserMessage, Tool
383
372
@@ -431,11 +420,9 @@ agent = LlmAgent(
431
420
Use calculate for math operations and get_weather for weather information."""
432
421
)
433
422
434
-
registry = AgentRegistry.get_instance()
435
-
registry.set_default_agent(agent)
436
-
437
423
# 3. Create middleware with hybrid execution configuration
438
424
adk_agent = ADKAgent(
425
+
adk_agent=agent,
439
426
user_id="user123",
440
427
tool_timeout_seconds=60, # Timeout for blocking tools only
0 commit comments