mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
feat: add GitLab Duo and CodeBuddy support, update observability settings
This commit is contained in:
@@ -139,7 +139,7 @@ export function openaiResponsesToOpenAIRequest(model, body, stream, credentials)
|
||||
function: {
|
||||
name,
|
||||
description: String(tool.description || ""),
|
||||
parameters: tool.parameters,
|
||||
parameters: normalizeToolParameters(tool.parameters),
|
||||
strict: tool.strict
|
||||
}
|
||||
};
|
||||
@@ -158,6 +158,15 @@ export function openaiResponsesToOpenAIRequest(model, body, stream, credentials)
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure object schema always has properties field (required by Codex Responses API)
|
||||
*/
|
||||
function normalizeToolParameters(params) {
|
||||
if (!params) return { type: "object", properties: {} };
|
||||
if (params.type === "object" && !params.properties) return { ...params, properties: {} };
|
||||
return params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert OpenAI Chat Completions to OpenAI Responses API format
|
||||
*/
|
||||
@@ -226,7 +235,7 @@ export function openaiToOpenAIResponsesRequest(model, body, stream, credentials)
|
||||
result.input.push({
|
||||
type: "function_call",
|
||||
call_id: clampCallId(tc.id),
|
||||
name: tc.function?.name || "",
|
||||
name: tc.function?.name || "_unknown",
|
||||
arguments: tc.function?.arguments || "{}"
|
||||
});
|
||||
}
|
||||
@@ -260,7 +269,7 @@ export function openaiToOpenAIResponsesRequest(model, body, stream, credentials)
|
||||
type: "function",
|
||||
name: tool.function.name,
|
||||
description: String(tool.function.description || ""),
|
||||
parameters: tool.function.parameters,
|
||||
parameters: normalizeToolParameters(tool.function.parameters),
|
||||
strict: tool.function.strict
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user