Commit d0449c99 by Q.A.zh

support reasoning field

parent ae8b09d4
...@@ -229,7 +229,7 @@ export const useApiRequest = ( ...@@ -229,7 +229,7 @@ export const useApiRequest = (
if (data.choices?.[0]) { if (data.choices?.[0]) {
const choice = data.choices[0]; const choice = data.choices[0];
let content = choice.message?.content || ''; let content = choice.message?.content || '';
let reasoningContent = choice.message?.reasoning_content || ''; let reasoningContent = choice.message?.reasoning_content || choice.message?.reasoning || '';
const processed = processThinkTags(content, reasoningContent); const processed = processThinkTags(content, reasoningContent);
...@@ -333,6 +333,9 @@ export const useApiRequest = ( ...@@ -333,6 +333,9 @@ export const useApiRequest = (
if (delta.reasoning_content) { if (delta.reasoning_content) {
streamMessageUpdate(delta.reasoning_content, 'reasoning'); streamMessageUpdate(delta.reasoning_content, 'reasoning');
} }
if (delta.reasoning) {
streamMessageUpdate(delta.reasoning, 'reasoning');
}
if (delta.content) { if (delta.content) {
streamMessageUpdate(delta.content, 'content'); streamMessageUpdate(delta.content, 'content');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment