-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix silent generation on invalid AI functions #4374
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?
Conversation
| "speech_id": speech_handle.id, | ||
| }, | ||
| ) | ||
| _tool_completed( |
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.
currently xai is calling these tools even though they are supposed to be executed on the server side, I'll raise with them.. but just to note that this will likely break the xai tools
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.
which tool did you test? XSearch or WebSearch?
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.
for example, web + x search request:
14:32:53.218 WARNI… livekit.agents unknown AI function `web_search_with_snippets` {"function": "web_search_with_snippets", "speech_id": "speech_c7ce525a9080", "room": "mock_room"}
14:32:53.221 WARNI… livekit.agents unknown AI function `x_keyword_search` {"function": "x_keyword_search", "speech_id": "speech_c7ce525a9080", "room": "mock_room"}
14:32:53.223 WARNI… livekit.agents unknown AI function `x_semantic_search` {"function": "x_semantic_search", "speech_id": "speech_c7ce525a9080", "room": "mock_room"}
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.
- x_semantic_search
- x_keyword_search
- x_user_search
- x_thread_fetch
- web_search_with_snippets
- browse_page
here is full list
| make_tool_output( | ||
| fnc_call=fnc_call, | ||
| output=None, | ||
| exception=RuntimeError(f"unknown AI function `{fnc_call.name}`"), |
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.
Maybe we should expose the list of available functions back to the LLM to help with the next step (optionally)?
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.
It should already have it in context?
based on #4352
avoid failing silently when the LLM hallucinates