Skip to content

Commit

Permalink
fix(answerStream): handle end of stream
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Gauthier authored and Danny Gauthier committed Aug 13, 2024
1 parent 87ef80c commit 7f353c3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/headless/src/api/knowledge/stream-answer-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const updateCacheWithEvent = (
}
break;
case 'genqa.endOfStreamType':
if (parsedPayload.answerGenerated) {
if (draft.answer?.length || parsedPayload.answerGenerated) {
handleEndOfStream(draft, parsedPayload);
}
break;
Expand Down Expand Up @@ -236,9 +236,7 @@ const constructAnswerQueryParams = (state: StateNeededByAnswerAPI) => {
q,
pipelineRuleParameters: {
mlGenerativeQuestionAnswering: {
responseFormat: {
answerStyle: state.generatedAnswer.responseFormat.answerStyle,
},
responseFormat: state.generatedAnswer.responseFormat,
citationsFieldToInclude,
},
},
Expand Down

0 comments on commit 7f353c3

Please sign in to comment.