MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / mergeStreamAsync

Function mergeStreamAsync

packages/web/src/ee/features/chat/agent.ts:35–42  ·  view source on GitHub ↗
(stream: StreamTextResult<any, any>, writer: UIMessageStreamWriter<SBChatMessage>, options: UIMessageStreamOptions<SBChatMessage> = {})

Source from the content-addressed store, hash-verified

33
34// eslint-disable-next-line @typescript-eslint/no-explicit-any
35const mergeStreamAsync = async (stream: StreamTextResult<any, any>, writer: UIMessageStreamWriter<SBChatMessage>, options: UIMessageStreamOptions<SBChatMessage> = {}) => {
36 await new Promise<void>((resolve) => writer.merge(stream.toUIMessageStream({
37 ...options,
38 onFinish: async () => {
39 resolve();
40 }
41 })));
42}
43
44interface CreateMessageStreamResponseProps {
45 chatId: string;

Callers 1

createMessageStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected