Skip to content
1 change: 1 addition & 0 deletions crates/lingua/src/processing/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ fn assistant_content_to_stream_delta(content: &AssistantContent) -> UniversalStr
name: Some(tool_name.clone()),
arguments: Some(arguments.to_string()),
}),
..Default::default()
});
}
AssistantContentPart::File { .. }
Expand Down
2 changes: 2 additions & 0 deletions crates/lingua/src/providers/anthropic/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,7 @@ impl ProviderAdapter for AnthropicAdapter {
name: part.name,
arguments: Some(arguments),
}),
..Default::default()
}],
..Default::default()
})
Expand Down Expand Up @@ -1115,6 +1116,7 @@ impl ProviderAdapter for AnthropicAdapter {
name: Some(name.to_string()),
arguments: Some(String::new()),
}),
..Default::default()
}],
..Default::default()
})),
Expand Down
1 change: 1 addition & 0 deletions crates/lingua/src/providers/bedrock/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ impl ProviderAdapter for BedrockAdapter {
name: Some(tool_use.name),
arguments: Some(String::new()),
}),
..Default::default()
}],
..Default::default()
})),
Expand Down
1 change: 1 addition & 0 deletions crates/lingua/src/providers/google/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ impl ProviderAdapter for GoogleAdapter {
.as_ref()
.map(|args| Value::Object(args.clone()).to_string()),
}),
..Default::default()
}
})
})
Expand Down
4 changes: 4 additions & 0 deletions crates/lingua/src/providers/openai/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,8 @@ fn chat_stream_delta_from_universal(mut delta: Value) -> Value {
for tool_call in tool_calls {
if let Some(tool_call) = tool_call.as_object_mut() {
tool_call.remove("custom_tool_call");
tool_call.remove("item_id");
tool_call.remove("sequence_number");
}
}
}
Expand Down Expand Up @@ -953,6 +955,8 @@ mod tests {
"id": "call_1",
"type": "function",
"custom_tool_call": true,
"item_id": "ctc_1",
"sequence_number": 8,
"function": {
"name": "exec",
"arguments": ""
Expand Down
Loading
Loading