feat: add more workflow executor (#7231)

This commit is contained in:
darkskygit
2024-06-25 10:54:16 +00:00
parent 532a628989
commit cffaf815e1
23 changed files with 946 additions and 324 deletions
+5 -3
View File
@@ -29,6 +29,7 @@ import {
signUp,
} from './utils';
import {
array2sse,
chatWithImages,
chatWithText,
chatWithTextStream,
@@ -37,6 +38,7 @@ import {
createCopilotSession,
getHistories,
MockCopilotTestProvider,
sse2array,
textToEventStream,
} from './utils/copilot';
@@ -227,9 +229,9 @@ test('should be able to chat with api', async t => {
const ret3 = await chatWithImages(app, token, sessionId, messageId);
t.is(
ret3,
array2sse(sse2array(ret3).filter(e => e.event !== 'event')),
textToEventStream(
['https://example.com/test.jpg', 'generate text to text stream'],
['https://example.com/test.jpg', 'hello '],
messageId,
'attachment'
),
@@ -258,7 +260,7 @@ test('should be able to chat with api by workflow', async t => {
);
const ret = await chatWithWorkflow(app, token, sessionId, messageId);
t.is(
ret,
array2sse(sse2array(ret).filter(e => e.event !== 'event')),
textToEventStream(['generate text to text stream'], messageId),
'should be able to chat with workflow'
);