Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion livekit-agents/livekit/agents/llm/async_toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def __init__(
id: str,
tools: list[Tool] | None = None,
on_duplicate_call: DuplicateMode = "confirm",
reply_instructions: str = REPLY_INSTRUCTIONS,
Comment thread
will-mako-ai marked this conversation as resolved.
Outdated
) -> None:
super().__init__(id=id, tools=tools)

Expand All @@ -193,6 +194,9 @@ def __init__(
self._pending_updates: list[_PendingUpdate] = []
self._reply_task: asyncio.Task[None] | None = None

# instructions to use when delivering a reply from tool updates
self._reply_instructions = reply_instructions

async def cancel(self, call_id: str) -> bool:
task = self._running_tasks.get(call_id)
if task is not None:
Expand Down Expand Up @@ -352,7 +356,7 @@ async def _deliver_reply(self, session: AgentSession) -> None:
item.call_id for item in pending_items if item.type == "function_call_output"
]
session.generate_reply(
instructions=REPLY_INSTRUCTIONS.format(pending_call_ids=pending_call_ids),
instructions=self._reply_instructions.format(pending_call_ids=pending_call_ids),
tool_choice="none",
)

Expand Down
Loading