Просмотр исходного кода

feat(speaking): thread mode + selectedVideo into createSession; parse image SSE event

jimmylee 1 месяц назад
Родитель
Сommit
9dfcbe2225
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      src/views/Editor/EnglishSpeaking/services/llmService.ts

+ 8 - 0
src/views/Editor/EnglishSpeaking/services/llmService.ts

@@ -59,6 +59,12 @@ async function* parseSSEStream(reader: ReadableStreamDefaultReader<Uint8Array>):
               yield { type: 'token', text: parsed.content ?? parsed.text }
             } else if (eventType === 'done') {
               yield { type: 'done', isComplete: parsed.isComplete }
+            } else if (eventType === 'image') {
+              yield {
+                type: 'image',
+                url: parsed.url,
+                round: parsed.round,
+              }
             } else if (eventType === 'error') {
               yield { type: 'error', message: parsed.message }
             }
@@ -242,6 +248,8 @@ export class RealDialogueAPI implements DialogueAPI {
         roleId: config.roleId,
         configId: config.configId ?? null,
         userId: config.userId ?? null,
+        mode: config.mode ?? 'normal',
+        selectedVideo: config.selectedVideo ?? null,
       }),
     })
     if (!res.ok) {