-
Notifications
You must be signed in to change notification settings - Fork 649
Support audio content type in tools/call and prompts/get #250
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
Conversation
""" WalkthroughThis change introduces support for handling audio content in the MCP client and related data structures. It adds a new Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
client/inprocess_test.go
(4 hunks)mcp/prompts.go
(1 hunks)mcp/tools.go
(1 hunks)mcp/types.go
(2 hunks)mcp/utils.go
(4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
mcp/prompts.go (1)
mcp/types.go (1)
Content
(684-686)
mcp/tools.go (1)
mcp/types.go (1)
Content
(684-686)
client/inprocess_test.go (2)
mcp/types.go (4)
AudioContent
(714-721)AudioContent
(723-723)Content
(684-686)Params
(118-118)mcp/prompts.go (2)
Role
(68-68)RoleUser
(71-71)
🔇 Additional comments (11)
mcp/prompts.go (1)
81-81
: Documentation update looks good.The comment has been updated to include
AudioContent
as a valid content type alongside the existing types in thePromptMessage
struct. This aligns well with the implementation of the new audio content type in the MCP protocol.mcp/tools.go (1)
36-36
: Documentation update looks good.The comment has been properly updated to include
AudioContent
as a valid content type alongside the existing types in theCallToolResult
struct. This change is consistent with the audio content support being added to the MCP protocol.client/inprocess_test.go (5)
39-43
: Audio content implementation in test tool looks good.Adding
AudioContent
to the test tool's response appropriately tests the newly added audio content type support. The structure includes all required fields for audio content.
85-92
: Adding audio content to test prompt messages is appropriate.Good implementation of audio content in the prompt message with the user role. This properly tests the bidirectional support for audio content in the protocol.
208-209
: Test assertion updated correctly.The assertion has been properly updated to expect 2 content items (text and audio) in the tool call response.
375-377
: Adding required arguments to the GetPrompt request is appropriate.Adding argument data to match the prompt's expected arguments is necessary for the test to work properly with the implementation.
384-385
: Test assertion updated correctly.The assertion has been properly updated to expect 2 messages in the prompt response (one from assistant with text content and one from user with audio content).
mcp/types.go (2)
659-659
: Documentation update for SamplingMessage looks good.The comment has been updated to include
AudioContent
as a valid content type for theSamplingMessage
struct, which is consistent with the changes in the rest of the codebase.
712-724
: AudioContent implementation looks good.The
AudioContent
struct is well-implemented with appropriate fields:
Type
field to identify it as "audio"Data
field for base64-encoded audio contentMIMEType
field for the audio format specificationisContent()
method implementation to satisfy theContent
interfaceThis implementation follows the same pattern as the existing
TextContent
andImageContent
types, maintaining consistency in the codebase.mcp/utils.go (2)
216-223
: Looks good!The implementation of
NewAudioContent
correctly follows the established pattern for content creation functions in this file.
456-463
: Looks good!The implementation of audio content parsing in the
ParseContent
function correctly follows the pattern used for other content types.
b7f2605
to
ea87396
Compare
details in #243
Summary by CodeRabbit