Skip to content

Commit 7940f4d

Browse files
committed
fixed issues with new deps versions
1 parent 2608d04 commit 7940f4d

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

src/extras/mcp/tool.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use compact_str::CompactString;
55
use rig::completion::ToolDefinition;
66
use rig::tool::{ToolDyn, ToolError};
77
use rig::wasm_compat::WasmBoxedFuture;
8-
use rmcp::model::{CallToolRequestParams, JsonObject, RawContent};
8+
use rmcp::model::{CallToolRequestParams, ContentBlock, JsonObject};
99
use rmcp::service::{Peer, RoleClient};
1010

1111
use crate::agent::tools::check_perm;
@@ -86,8 +86,8 @@ impl ToolDyn for McpTool {
8686
let error_msg = result
8787
.content
8888
.iter()
89-
.filter_map(|c| match &c.raw {
90-
RawContent::Text(t) => Some(t.text.clone()),
89+
.filter_map(|c| match c {
90+
ContentBlock::Text(t) => Some(t.text.clone()),
9191
_ => None,
9292
})
9393
.collect::<Vec<_>>()
@@ -104,18 +104,19 @@ impl ToolDyn for McpTool {
104104

105105
let mut content = String::new();
106106
for item in result.content {
107-
match item.raw {
108-
RawContent::Text(t) => content.push_str(&t.text),
109-
RawContent::Image(img) => {
107+
match item {
108+
ContentBlock::Text(t) => content.push_str(&t.text),
109+
ContentBlock::Image(img) => {
110110
content.push_str(&format!("data:{};base64,{}", img.mime_type, img.data));
111111
}
112-
RawContent::Resource(r) => match r.resource {
112+
ContentBlock::Resource(r) => match &r.resource {
113113
rmcp::model::ResourceContents::TextResourceContents { text, .. } => {
114-
content.push_str(&text);
114+
content.push_str(text);
115115
}
116116
rmcp::model::ResourceContents::BlobResourceContents { blob, .. } => {
117-
content.push_str(&blob);
117+
content.push_str(blob);
118118
}
119+
_ => {}
119120
},
120121
_ => {}
121122
}

0 commit comments

Comments
 (0)