Skip to content

Commit

Permalink
Introduce transcript newlines in the place of any function calls/resp…
Browse files Browse the repository at this point in the history
…onses
  • Loading branch information
petersalas committed Nov 16, 2023
1 parent c5501a1 commit 52c8549
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/voice/src/app/agent/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,10 @@ export class ChatRequest {

if (!this.done) {
const currentTurn = isStartConversationRequest ? value.turns.at(-1) : value;
const currentMessage = currentTurn.messages
.filter((m: any) => m.kind === 'text')
.map((m: any) => m.content)
.join(' ');

// Map non-text fragments to empty strings so that they don't appear in the transcript,
// but still introduce newlines to make clear that any earlier content is complete.
const currentMessage = currentTurn.messages.map((m: any) => (m.kind === 'text' ? m.content : '')).join('\n');
if (currentMessage === this.outMessage) {
continue;
}
Expand Down

0 comments on commit 52c8549

Please sign in to comment.