Merge pull request #4618 from LLukas22/Capture-completion-while-streaming
Capture `result.content` while streaming from chat LLM
This commit is contained in:
commit
8ee83eb87c
1 changed files with 1 additions and 0 deletions
|
|
@ -821,6 +821,7 @@ export abstract class BaseLLM implements ILLM {
|
|||
for await (const chunk of stream) {
|
||||
const result = fromChatCompletionChunk(chunk);
|
||||
if (result) {
|
||||
completion += result.content;
|
||||
yield result;
|
||||
}
|
||||
if (!citations && (chunk as any).citations && Array.isArray((chunk as any).citations)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue