We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fe7be6 commit 582a011Copy full SHA for 582a011
packages/search/src/lib/approaches/chat-read-retrieve-read.ts
@@ -107,14 +107,14 @@ export class ChatReadRetrieveRead extends ApproachBase implements ChatApproach {
107
{
108
index: 0,
109
delta: {
110
- content: chunk.choices[0].delta.content ?? '',
+ content: chunk.choices[0]?.delta.content ?? '',
111
role: 'assistant' as const,
112
context: {
113
data_points: id === 0 ? { text: dataPoints } : undefined,
114
thoughts: id === 0 ? thoughts : undefined,
115
},
116
117
- finish_reason: chunk.choices[0].finish_reason,
+ finish_reason: chunk.choices[0]?.finish_reason,
118
119
],
120
object: 'chat.completion.chunk' as const,
0 commit comments