-
Notifications
You must be signed in to change notification settings - Fork 35
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
agent: support any json for function call input #283
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes modify type declarations in the WebSocket interface. Specifically, the Changes
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (2)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@jpvajda here you go -- I don't seem to be able to add you as a reviewer, so just tagging you here. |
Fixes #279
Proposed changes
Agent API - Function call input supports arbitrary JSON, but the current type is a
map[string]string
, which is too limiting to even support the function call example in the documentation:https://developers.deepgram.com/docs/voice-agents-function-calling#server-messages-sent-by-deepgram
This could be addressed by either using
map[string]any
(since a JSON object is required, and primitives are not) or json.RawMessage. I updated the type to the latter because my software passes it around without needing to unmarshal it, which will probably be a common case.I also removed an apparently-unused Output field. In testing function calling, I did not see it populated, and a comment in the code indicated as such. Removing it until such a time as it's populated by the server seems prudent.
Types of changes
What types of changes does your code introduce to the community Go SDK?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.I do not see any tests of function calling, and this change is sufficiently lean that I don't believe it merits building one out.