We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d00a840 commit 7e28637Copy full SHA for 7e28637
packages/langbase/src/pipes/pipes.ts
@@ -117,3 +117,16 @@ export class Pipe {
117
});
118
}
119
120
+
121
+/**
122
+ * Print stream to standard output (console).
123
+ * @param stream The stream to print
124
+ */
125
+export const printStreamToStdout = async (
126
+ stream: StreamText,
127
+): Promise<void> => {
128
+ for await (const chunk of stream) {
129
+ const textPart = chunk.choices[0]?.delta?.content || '';
130
+ process.stdout.write(textPart);
131
+ }
132
+};
0 commit comments