feat: Update Chat SDK to support streaming responses (#17006)

Co-authored-by: Eugene Molodkin <eugene@n8n.io>
This commit is contained in:
Benjamin Schroth
2025-07-10 12:25:29 +02:00
committed by GitHub
parent b9e7b719c0
commit 3edadb5a75
26 changed files with 1670 additions and 37 deletions

View File

@@ -487,10 +487,10 @@ describe('toolsAgentExecute', () => {
const result = await toolsAgentExecute.call(mockContext);
expect(mockContext.sendChunk).toHaveBeenCalledWith('begin');
expect(mockContext.sendChunk).toHaveBeenCalledWith('item', 'Hello ');
expect(mockContext.sendChunk).toHaveBeenCalledWith('item', 'world!');
expect(mockContext.sendChunk).toHaveBeenCalledWith('end');
expect(mockContext.sendChunk).toHaveBeenCalledWith('begin', 0);
expect(mockContext.sendChunk).toHaveBeenCalledWith('item', 0, 'Hello ');
expect(mockContext.sendChunk).toHaveBeenCalledWith('item', 0, 'world!');
expect(mockContext.sendChunk).toHaveBeenCalledWith('end', 0);
expect(mockExecutor.streamEvents).toHaveBeenCalledTimes(1);
expect(result[0]).toHaveLength(1);
expect(result[0][0].json.output).toBe('Hello world!');