Explorar el Código

Merge pull request #2207 from QAbot-zh/reasoning

support reasoning field for playground
Seefs hace 3 meses
padre
commit
fd38abd562
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      web/src/hooks/playground/useApiRequest.jsx

+ 4 - 1
web/src/hooks/playground/useApiRequest.jsx

@@ -229,7 +229,7 @@ export const useApiRequest = (
         if (data.choices?.[0]) {
           const choice = data.choices[0];
           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);
 
@@ -333,6 +333,9 @@ export const useApiRequest = (
             if (delta.reasoning_content) {
               streamMessageUpdate(delta.reasoning_content, 'reasoning');
             }
+            if (delta.reasoning) {
+              streamMessageUpdate(delta.reasoning, 'reasoning');
+            }
             if (delta.content) {
               streamMessageUpdate(delta.content, 'content');
             }