feat: allow o1 streaming

This commit is contained in:
ZhuangYumin 2025-02-26 09:25:31 +08:00 committed by 亢奋猫
parent bfeca0b383
commit d4848faa5a

View File

@ -197,12 +197,7 @@ export default class OpenAIProvider extends BaseProvider {
userMessages.push(await this.getMessageParam(message, model)) userMessages.push(await this.getMessageParam(message, model))
} }
const isOpenAIo1 = this.isOpenAIo1(model)
const isSupportStreamOutput = () => { const isSupportStreamOutput = () => {
if (isOpenAIo1) {
return false
}
return streamOutput return streamOutput
} }
@ -332,15 +327,10 @@ export default class OpenAIProvider extends BaseProvider {
] ]
: [{ role: 'user', content: assistant.prompt }] : [{ role: 'user', content: assistant.prompt }]
const isOpenAIo1 = this.isOpenAIo1(model)
const isSupportedStreamOutput = () => { const isSupportedStreamOutput = () => {
if (!onResponse) { if (!onResponse) {
return false return false
} }
if (isOpenAIo1) {
return false
}
return true return true
} }