Skip to content

Commit b0e9949

Browse files
committed
site(gordon): get qa ID from stream chunk
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent 4455ac2 commit b0e9949

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

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)