mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-12-25 14:37:45 -06:00
add toolset base class and allow llm agent to accept toolset as tools
PiperOrigin-RevId: 756605470
This commit is contained in:
committed by
Copybara-Service
parent
8963300518
commit
4d7298e4f2
@@ -29,6 +29,7 @@ from ...agents.base_agent import BaseAgent
|
||||
from ...agents.callback_context import CallbackContext
|
||||
from ...agents.invocation_context import InvocationContext
|
||||
from ...agents.live_request_queue import LiveRequestQueue
|
||||
from ...agents.readonly_context import ReadonlyContext
|
||||
from ...agents.run_config import StreamingMode
|
||||
from ...agents.transcription_entry import TranscriptionEntry
|
||||
from ...events.event import Event
|
||||
@@ -296,7 +297,9 @@ class BaseLlmFlow(ABC):
|
||||
yield event
|
||||
|
||||
# Run processors for tools.
|
||||
for tool in agent.canonical_tools:
|
||||
for tool in await agent.canonical_tools(
|
||||
ReadonlyContext(invocation_context)
|
||||
):
|
||||
tool_context = ToolContext(invocation_context)
|
||||
await tool.process_llm_request(
|
||||
tool_context=tool_context, llm_request=llm_request
|
||||
|
||||
Reference in New Issue
Block a user