-
Notifications
You must be signed in to change notification settings - Fork 348
fix(voice): answer every tool call #2289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@livekit/agents': patch | ||
| '@livekit/agents-plugin-google': patch | ||
| '@livekit/agents-plugin-phonic': patch | ||
| --- | ||
|
|
||
| Answer every completed tool call, including interrupted, silent, and invalid calls, and keep realtime providers quiet when supported. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,6 +188,8 @@ export type FunctionToolsExecutedEvent = { | |
| functionCalls: FunctionCall[]; | ||
| functionCallOutputs: FunctionCallOutput[]; | ||
| createdAt: number; | ||
| readonly hasToolReply: boolean; | ||
| cancelToolReply(): void; | ||
| }; | ||
|
|
||
| export const createFunctionToolsExecutedEvent = ({ | ||
|
|
@@ -204,6 +206,12 @@ export const createFunctionToolsExecutedEvent = ({ | |
| functionCalls, | ||
| functionCallOutputs, | ||
| createdAt, | ||
| get hasToolReply() { | ||
| return functionCallOutputs.some((output) => output.replyRequired); | ||
| }, | ||
| cancelToolReply() { | ||
| for (const output of functionCallOutputs) output.replyRequired = false; | ||
| }, | ||
|
Comment on lines
+209
to
+214
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Session report now contains an extra field and a non-serializable callback for tool-execution events The tool-execution event is copied field-by-field into the uploaded report ( New getter/method on FunctionToolsExecutedEvent leak into the wire format
Defining the two members as non-enumerable, or excluding them in Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| }; | ||
| }; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Newly added public event members and helper function are undocumented
The two new members added to the tool-execution event and the new interrupted-output helper carry no documentation comments (
hasToolReply/cancelToolReplyatagents/src/voice/events.ts:191-192), which the repository's contribution rules require for every new method or interface member.Impact: The public API documentation generated for the framework is missing entries for the newly exposed members.
Repository rule
CONTRIBUTING.mdstates: "If writing new methods/interfaces/enums/classes, document them. This project uses TypeDoc for automatic API documentation generation, and every new addition has to be properly documented."Undocumented additions in this PR:
FunctionToolsExecutedEvent.hasToolReplyandFunctionToolsExecutedEvent.cancelToolReply()(agents/src/voice/events.ts:191-192)interruptedToolOutput()helper (agents/src/voice/generation.ts:495)FunctionCallOutput.replyRequired(agents/src/llm/chat_context.ts:560-561) does have a doc comment and is fine.Was this helpful? React with 👍 or 👎 to provide feedback.