mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 03:10:08 +08:00
fix: non-streaming reasoning_content (#6308)
* fix: non-streaming reasoning_content * fix: streamline reasoning handling in OpenAIProvider
This commit is contained in:
parent
cc9b301fd4
commit
bc188d6724
@ -550,12 +550,16 @@ export default class OpenAIProvider extends BaseOpenAIProvider {
|
||||
// Separate onChunk calls for text and usage/metrics
|
||||
let content = ''
|
||||
stream.choices.forEach((choice) => {
|
||||
const reasoning = choice.message.reasoning || choice.message.reasoning_content
|
||||
// reasoning
|
||||
if (choice.message.reasoning) {
|
||||
onChunk({ type: ChunkType.THINKING_DELTA, text: choice.message.reasoning })
|
||||
if (reasoning) {
|
||||
onChunk({
|
||||
type: ChunkType.THINKING_DELTA,
|
||||
text: reasoning
|
||||
})
|
||||
onChunk({
|
||||
type: ChunkType.THINKING_COMPLETE,
|
||||
text: choice.message.reasoning,
|
||||
text: reasoning,
|
||||
thinking_millsec: new Date().getTime() - start_time_millsec
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user