Skip to content

Commit 8834574

Browse files
plangerlaemmleint
authored andcommitted
fix: fix response content in language model utility
I ran into cases where the getTextOfResponse() appended `false` to the returned string.
1 parent 5fd8eab commit 8834574

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/ai-core/src/common/language-model-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const getTextOfResponse = async (response: LanguageModelResponse): Promis
3939
} else if (isLanguageModelStreamResponse(response)) {
4040
let result = '';
4141
for await (const chunk of response.stream) {
42-
result += (isTextResponsePart(chunk) && chunk.content) ?? '';
42+
result += (isTextResponsePart(chunk) && chunk.content) ? chunk.content : '';
4343
}
4444
return result;
4545
} else if (isLanguageModelParsedResponse(response)) {

0 commit comments

Comments
 (0)