File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -138,18 +138,15 @@ export async function* processStreamWithTags(
138138 processor . onTagEnd ( toolName , parsedParams )
139139 }
140140
141- function * extractToolsFromBufferAndProcess (
142- forceFlush = true ,
143- ) : Generator < StreamChunk > {
141+ function extractToolsFromBufferAndProcess ( forceFlush = false ) {
144142 const matches = extractToolCalls ( )
145143 matches . forEach ( processToolCallContents )
146144 if ( forceFlush ) {
147- const chunk : StreamChunk = {
145+ onResponseChunk ( {
148146 type : 'text' ,
149147 text : buffer ,
150- }
151- yield chunk
152- onResponseChunk ( chunk )
148+ } )
149+ buffer = ''
153150 }
154151 }
155152
@@ -171,7 +168,7 @@ export async function* processStreamWithTags(
171168 }
172169 autocompleted = true
173170 }
174- yield * extractToolsFromBufferAndProcess ( true )
171+ extractToolsFromBufferAndProcess ( true )
175172 }
176173
177174 if ( chunk ) {
You can’t perform that action at this time.
0 commit comments