mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix(sse): preserve custom tool output images (#7540)
* fix(sse): preserve custom tool output images * docs: add changelog for custom tool images --------- Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9544fb6353
commit
b5134f0b18
1
changelog.d/fixes/7540-custom-tool-output-images.md
Normal file
1
changelog.d/fixes/7540-custom-tool-output-images.md
Normal file
@@ -0,0 +1 @@
|
||||
- **fix(sse):** preserve `input_image` parts in array-valued Codex `custom_tool_call_output` payloads instead of rewriting them to invalid `output_text` parts ([#7540](https://github.com/diegosouzapw/OmniRoute/pull/7540)) - thanks @loulanyue
|
||||
@@ -194,3 +194,19 @@ test("normalizes function_call_output image output parts to input_image", () =>
|
||||
});
|
||||
assert.equal(JSON.stringify(result).includes('"type":"image_url"'), false);
|
||||
});
|
||||
|
||||
test("preserves custom_tool_call_output input content parts", () => {
|
||||
const items = [
|
||||
{
|
||||
type: "custom_tool_call_output",
|
||||
call_id: "call_2",
|
||||
output: [
|
||||
{ type: "input_text", text: "image tool output" },
|
||||
{ type: "input_image", image_url: "data:image/png;base64,AAAA" },
|
||||
],
|
||||
},
|
||||
];
|
||||
const result = sanitizeResponsesInputItems(items) as Array<Record<string, unknown>>;
|
||||
assert.deepEqual(result[0], items[0]);
|
||||
assert.equal(JSON.stringify(result).includes('"type":"output_text"'), false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user