@@ -100,23 +100,40 @@ export class QueryAgent {
100100 */
101101 stream (
102102 query : string ,
103- options : QueryAgentStreamOptions & { includeProgress : false ; includeFinalState : false }
103+ options : QueryAgentStreamOptions & {
104+ includeProgress : false ;
105+ includeFinalState : false ;
106+ }
104107 ) : AsyncGenerator < StreamedTokens > ;
105108 stream (
106109 query : string ,
107- options : QueryAgentStreamOptions & { includeProgress : false ; includeFinalState ?: true }
110+ options : QueryAgentStreamOptions & {
111+ includeProgress : false ;
112+ includeFinalState ?: true ;
113+ }
108114 ) : AsyncGenerator < StreamedTokens | QueryAgentResponse > ;
109115 stream (
110116 query : string ,
111- options : QueryAgentStreamOptions & { includeProgress ?: true ; includeFinalState : false }
117+ options : QueryAgentStreamOptions & {
118+ includeProgress ?: true ;
119+ includeFinalState : false ;
120+ }
112121 ) : AsyncGenerator < ProgressMessage | StreamedTokens > ;
113122 stream (
114123 query : string ,
115- options ?: QueryAgentStreamOptions & { includeProgress ?: true ; includeFinalState ?: true }
124+ options ?: QueryAgentStreamOptions & {
125+ includeProgress ?: true ;
126+ includeFinalState ?: true ;
127+ }
116128 ) : AsyncGenerator < ProgressMessage | StreamedTokens | QueryAgentResponse > ;
117129 async * stream (
118130 query : string ,
119- { collections, context, includeProgress, includeFinalState } : QueryAgentStreamOptions = { }
131+ {
132+ collections,
133+ context,
134+ includeProgress,
135+ includeFinalState,
136+ } : QueryAgentStreamOptions = { }
120137 ) : AsyncGenerator < ProgressMessage | StreamedTokens | QueryAgentResponse > {
121138 const targetCollections = collections ?? this . collections ;
122139
@@ -152,10 +169,10 @@ export class QueryAgent {
152169 for await ( const event of sseStream ) {
153170 if ( event . event === "error" ) {
154171 await handleError ( event . data ) ;
155- }
172+ }
156173
157174 let output : ProgressMessage | StreamedTokens | QueryAgentResponse ;
158- if ( event . event === "progress_message" ) {
175+ if ( event . eevent === "progress_message" ) {
159176 output = mapProgressMessageFromSSE ( event ) ;
160177 } else if ( event . event === "streamed_tokens" ) {
161178 output = mapStreamedTokensFromSSE ( event ) ;
0 commit comments