Skip to content

feat: add new utility functions for CallToolResultContentItem #46

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

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

hashemix
Copy link
Member

@hashemix hashemix commented Mar 11, 2025

📌 Summary

Added new utility functions for CallToolResultContentItem type, for easier conversion of call tool results into contents:

Example:

// get the content type
println!("{}",content.content_type())

// try to convert to TextContent
let text_content : TextContent = content.as_text_content().unwrap();

// try to convert to ImageContent
let image_content : ImageContent = content.as_image_content().unwrap();

// try to convert to EmbeddedResource
let embedded_resource : EmbeddedResource = content.as_embedded_resource().unwrap();

AudioContent (draft version of schema)

// try to convert to AudioContent
let audio_content : AudioContent = content.as_audio_content().unwrap();

@hashemix hashemix self-assigned this Mar 11, 2025
@hashemix hashemix merged commit 1fe212c into main Mar 11, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant