In the provider compatibility layer for Gemini (and other providers requiring ), fully support the flow, round-trip, and placeholder fallback of thought_signature.

This commit is contained in:
sunmanbitch
2026-06-04 21:13:55 +08:00
parent 4619375c14
commit b119afcaca
11 changed files with 193 additions and 43 deletions

View File

@@ -38,6 +38,7 @@ fn create_sample_request(message_count: usize) -> MessageRequest {
id: format!("call_{}", i),
name: "read_file".to_string(),
input: json!({"path": format!("/tmp/file{}", i)}),
thought_signature: None,
},
],
}),
@@ -57,6 +58,7 @@ fn create_sample_request(message_count: usize) -> MessageRequest {
id: format!("call_{}", i),
name: "write_file".to_string(),
input: json!({"path": format!("/tmp/out{}", i), "content": "data"}),
thought_signature: None,
}],
}),
}
@@ -105,11 +107,13 @@ fn bench_translate_message(c: &mut Criterion) {
id: "call_1".to_string(),
name: "read_file".to_string(),
input: json!({"path": "/tmp/test"}),
thought_signature: None,
},
InputContentBlock::ToolUse {
id: "call_2".to_string(),
name: "write_file".to_string(),
input: json!({"path": "/tmp/out", "content": "data"}),
thought_signature: None,
},
],
};