M96820
commited on
Commit
·
733953f
1
Parent(s):
ea8d6f6
fix: recording stops when choice taken and Sarah behavior better
Browse files
client/src/pages/game/App.jsx
CHANGED
@@ -160,6 +160,7 @@ function App() {
|
|
160 |
// End the ElevenLabs conversation
|
161 |
await conversation.endSession();
|
162 |
setIsConversationMode(false);
|
|
|
163 |
// Handle the choice and generate next story part
|
164 |
await handleChoice(parseInt(decision));
|
165 |
}
|
@@ -191,7 +192,7 @@ function App() {
|
|
191 |
const currentChoiceIds = currentChoices.map(choice => choice.id).join(',');
|
192 |
await conversation.startSession({
|
193 |
agentId: AGENT_ID,
|
194 |
-
initialContext: `This is the current
|
195 |
});
|
196 |
console.log('ElevenLabs WebSocket connected');
|
197 |
} catch (error) {
|
|
|
160 |
// End the ElevenLabs conversation
|
161 |
await conversation.endSession();
|
162 |
setIsConversationMode(false);
|
163 |
+
setIsRecording(false);
|
164 |
// Handle the choice and generate next story part
|
165 |
await handleChoice(parseInt(decision));
|
166 |
}
|
|
|
192 |
const currentChoiceIds = currentChoices.map(choice => choice.id).join(',');
|
193 |
await conversation.startSession({
|
194 |
agentId: AGENT_ID,
|
195 |
+
initialContext: `This is the current situation : ${storySegments[storySegments.length - 1].text}. Those are the possible actions, ${currentChoices.map((choice, index) => `decision ${index + 1} : ${choice.text}`).join(', ')}.`
|
196 |
});
|
197 |
console.log('ElevenLabs WebSocket connected');
|
198 |
} catch (error) {
|