mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
fix(core/client): switch tool type to 'web_search' to avoid 400 Unsupported tool error\n\nThe Responses API rejects 'web_search_preview' with 400 (Unsupported tool type).\nUse the supported 'web_search' tool id. Update test payload generator accordingly.
This commit is contained in:
@@ -192,7 +192,7 @@ impl ModelClient {
|
||||
if map.get("type").and_then(|v| v.as_str()) == Some("web_search") {
|
||||
map.insert(
|
||||
"type".to_string(),
|
||||
serde_json::Value::String("web_search_preview".to_string()),
|
||||
serde_json::Value::String("web_search".to_string()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,10 +124,10 @@ function makePayload(kind, model, stream, store, variant) {
|
||||
tools = [ { type: 'web_search' } ];
|
||||
if (kind === 'chatgpt') {
|
||||
// Match Codex behavior: convert to preview tool for ChatGPT backend
|
||||
tools = [ { type: 'web_search_preview' } ];
|
||||
tools = [ { type: 'web_search' } ];
|
||||
}
|
||||
} else if (variant === 'tools-web-search-preview') {
|
||||
tools = [ { type: 'web_search_preview' } ];
|
||||
tools = [ { type: 'web_search' } ];
|
||||
}
|
||||
let text = undefined;
|
||||
if (variant === 'json-schema') {
|
||||
|
||||
Reference in New Issue
Block a user