mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 05:00:16 +00:00
fix(ai): omit empty OpenAI Responses thinking blocks on replay
This commit is contained in:
parent
87d71380e2
commit
8fc2b76827
1 changed files with 1 additions and 0 deletions
|
|
@ -173,6 +173,7 @@ export function convertResponsesMessages<TApi extends Api>(
|
||||||
|
|
||||||
for (const block of msg.content) {
|
for (const block of msg.content) {
|
||||||
if (block.type === "thinking") {
|
if (block.type === "thinking") {
|
||||||
|
if (block.thinking.trim().length === 0) continue;
|
||||||
if (block.thinkingSignature) {
|
if (block.thinkingSignature) {
|
||||||
const reasoningItem = JSON.parse(block.thinkingSignature) as ResponseReasoningItem;
|
const reasoningItem = JSON.parse(block.thinkingSignature) as ResponseReasoningItem;
|
||||||
output.push(reasoningItem);
|
output.push(reasoningItem);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue