File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
packages/langbase/src/pipes Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -109,24 +109,10 @@ export class Pipe {
109109 } ) ;
110110 }
111111
112- async streamText ( options : StreamOptions ) : Promise < GenerateStreamResponse > {
113- return this . request . post < GenerateStreamResponse > ( {
114- endpoint : '/beta/generate' ,
112+ async streamText ( options : StreamOptions ) : Promise < StreamResponse > {
113+ return this . request . post < StreamResponse > ( {
114+ endpoint : options . chat ? '/beta/chat' : '/beta/generate' ,
115115 body : { ...options , stream : true } ,
116- stream : true , // TODO: @ahmadbilaldev - why we need to add here as well?
117116 } ) ;
118117 }
119118}
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- } ;
You can’t perform that action at this time.
0 commit comments