Skip to content

Commit 2d78ffc

Browse files
committed
site(gordon): get qa ID from stream chunk
Signed-off-by: David Karlsson <[email protected]>
1 parent 39571c3 commit 2d78ffc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

layouts/partials/gordon-chat.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,6 @@
163163
throw new Error(`HTTP ${response.status}: ${response.statusText}`)
164164
}
165165
166-
// Capture question_answer_id from response headers
167-
const questionAnswerId = response.headers.get('DOCKER-AI-QUESTION-ANSWER-ID')
168-
if (questionAnswerId) {
169-
this.messages[responseIndex].questionAnswerId = questionAnswerId
170-
}
171-
172166
const reader = response.body.getReader()
173167
const decoder = new TextDecoder()
174168
@@ -198,6 +192,12 @@
198192
continue
199193
}
200194
195+
// Capture question_answer_id for feedback
196+
if (parsed.question_answer_id) {
197+
this.messages[responseIndex].questionAnswerId = parsed.question_answer_id
198+
continue
199+
}
200+
201201
if (parsed.choices && parsed.choices[0]?.delta?.content) {
202202
const content = parsed.choices[0].delta.content
203203
this.messages[responseIndex].content += content

0 commit comments

Comments
 (0)