diff --git a/.gitignore b/.gitignore index b4b1d852..1e3eb2f5 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,4 @@ README1.md deploy.sh ecosystem.config.* start.sh +src/mitm/server copy.js diff --git a/open-sse/translator/request/openai-responses.js b/open-sse/translator/request/openai-responses.js index ab919971..8067c8fc 100644 --- a/open-sse/translator/request/openai-responses.js +++ b/open-sse/translator/request/openai-responses.js @@ -228,12 +228,17 @@ export function openaiToOpenAIResponsesRequest(model, body, stream, credentials) } } - // Convert tool results + // Convert tool results - output must be a string for Responses API if (msg.role === "tool") { + const output = typeof msg.content === "string" + ? msg.content + : Array.isArray(msg.content) + ? msg.content.map(c => c.text || JSON.stringify(c)).join("") + : JSON.stringify(msg.content); result.input.push({ type: "function_call_output", call_id: msg.tool_call_id, - output: msg.content + output }); } }