refactor: handle tool content differently for doubao and deepseek models in OpenAIProvider
This commit is contained in:
parent
e5342cd414
commit
48a6c4d017
@ -534,11 +534,23 @@ export default class OpenAIProvider extends BaseProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reqMessages.push({
|
if (
|
||||||
role: 'tool',
|
lastUserMessage?.model?.provider === 'doubao' ||
|
||||||
content: toolResponsContent,
|
lastUserMessage?.model?.name.toLowerCase().includes('deepseek')
|
||||||
tool_call_id: toolCall.id
|
) {
|
||||||
} as ChatCompletionToolMessageParam)
|
console.log('doubao or deepseek only support tool content in text')
|
||||||
|
reqMessages.push({
|
||||||
|
role: 'tool',
|
||||||
|
content: JSON.stringify(toolResponsContent),
|
||||||
|
tool_call_id: toolCall.id
|
||||||
|
} as ChatCompletionToolMessageParam)
|
||||||
|
} else {
|
||||||
|
reqMessages.push({
|
||||||
|
role: 'tool',
|
||||||
|
content: toolResponsContent,
|
||||||
|
tool_call_id: toolCall.id
|
||||||
|
} as ChatCompletionToolMessageParam)
|
||||||
|
}
|
||||||
|
|
||||||
upsertMCPToolResponse(
|
upsertMCPToolResponse(
|
||||||
toolResponses,
|
toolResponses,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user