Parcourir la source

feat(speaking): send custom systemPrompt + greeting on session create

jimmylee il y a 1 mois
Parent
commit
8caac2ee8f

+ 6 - 0
src/views/Editor/EnglishSpeaking/preview/TopicDiscussionPreview.vue

@@ -353,6 +353,12 @@ async function startDialogue() {
       userId: isStudentRuntime.value ? runtimeUserId.value : null,
       mode: isVideoSceneMode.value ? 'video_scene' : 'normal',
       selectedVideo: selectedVideo.value ?? undefined,
+      systemPrompt: isVideoSceneMode.value
+        ? speakingStore.config.videoScene.systemPrompt
+        : speakingStore.config.nonVideoScene.systemPrompt,
+      greeting: isVideoSceneMode.value
+        ? speakingStore.config.videoScene.greeting
+        : speakingStore.config.nonVideoScene.greeting,
     })
     preparedSession.value = {
       sessionId: info.sessionId,

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

@@ -256,6 +256,8 @@ export class RealDialogueAPI implements DialogueAPI {
               description: config.selectedVideo.description,
             }
           : null,
+        ...(config.systemPrompt ? { systemPrompt: config.systemPrompt } : {}),
+        ...(config.greeting ? { greeting: config.greeting } : {}),
       }),
     })
     if (!res.ok) {