fix: match shape of the calltoolresult schema (#377)
BREAKING CHANGE: makes the `content` field non-optional
This commit is contained in:
parent
81ff3159f9
commit
a47cbaac4b
1 changed files with 26 additions and 29 deletions
|
|
@ -85,8 +85,8 @@ impl ChatSession {
|
|||
if result.is_error.is_some_and(|b| b) {
|
||||
self.messages
|
||||
.push(Message::user("tool call failed, mcp call error"));
|
||||
} else if let Some(contents) = &result.content {
|
||||
contents.iter().for_each(|content| {
|
||||
} else {
|
||||
result.content.iter().for_each(|content| {
|
||||
if let Some(content_text) = content.as_text() {
|
||||
let json_result = serde_json::from_str::<serde_json::Value>(
|
||||
&content_text.text,
|
||||
|
|
|
|||
Loading…
Reference in a new issue