@@ -103,7 +103,7 @@ export class QueryAgent {
103
103
*/
104
104
async ask (
105
105
query : string ,
106
- { collections, context } : QueryAgentRunOptions = { } ,
106
+ { collections } : QueryAgentAskOptions = { } ,
107
107
) : Promise < QueryAgentResponse > {
108
108
const targetCollections = collections ?? this . collections ;
109
109
if ( ! targetCollections ) {
@@ -126,7 +126,6 @@ export class QueryAgent {
126
126
query,
127
127
collections : mapCollections ( targetCollections ) ,
128
128
system_prompt : this . systemPrompt ,
129
- previous_response : context ? mapApiResponse ( context ) : undefined ,
130
129
} ) ,
131
130
} ) ;
132
131
@@ -245,28 +244,28 @@ export class QueryAgent {
245
244
*/
246
245
askStream (
247
246
query : string ,
248
- options : QueryAgentStreamOptions & {
247
+ options : QueryAgentAskStreamOptions & {
249
248
includeProgress : false ;
250
249
includeFinalState : false ;
251
250
} ,
252
251
) : AsyncGenerator < StreamedTokens > ;
253
252
askStream (
254
253
query : string ,
255
- options : QueryAgentStreamOptions & {
254
+ options : QueryAgentAskStreamOptions & {
256
255
includeProgress : false ;
257
256
includeFinalState ?: true ;
258
257
} ,
259
258
) : AsyncGenerator < StreamedTokens | QueryAgentResponse > ;
260
259
askStream (
261
260
query : string ,
262
- options : QueryAgentStreamOptions & {
261
+ options : QueryAgentAskStreamOptions & {
263
262
includeProgress ?: true ;
264
263
includeFinalState : false ;
265
264
} ,
266
265
) : AsyncGenerator < ProgressMessage | StreamedTokens > ;
267
266
askStream (
268
267
query : string ,
269
- options ?: QueryAgentStreamOptions & {
268
+ options ?: QueryAgentAskStreamOptions & {
270
269
includeProgress ?: true ;
271
270
includeFinalState ?: true ;
272
271
} ,
@@ -275,10 +274,9 @@ export class QueryAgent {
275
274
query : string ,
276
275
{
277
276
collections,
278
- context,
279
277
includeProgress,
280
278
includeFinalState,
281
- } : QueryAgentStreamOptions = { } ,
279
+ } : QueryAgentAskStreamOptions = { } ,
282
280
) : AsyncGenerator < ProgressMessage | StreamedTokens | QueryAgentResponse > {
283
281
const targetCollections = collections ?? this . collections ;
284
282
@@ -304,7 +302,6 @@ export class QueryAgent {
304
302
query,
305
303
collections : mapCollections ( targetCollections ) ,
306
304
system_prompt : this . systemPrompt ,
307
- previous_response : context ? mapApiResponse ( context ) : undefined ,
308
305
include_progress : includeProgress ?? true ,
309
306
include_final_state : includeFinalState ?? true ,
310
307
} ) ,
@@ -369,6 +366,12 @@ export type QueryAgentRunOptions = {
369
366
context ?: QueryAgentResponse ;
370
367
} ;
371
368
369
+ /** Options for the QueryAgent ask. */
370
+ export type QueryAgentAskOptions = {
371
+ /** List of collections to query. Will override any collections if passed in the constructor. */
372
+ collections ?: ( string | QueryAgentCollectionConfig ) [ ] ;
373
+ } ;
374
+
372
375
/** Options for the QueryAgent stream. */
373
376
export type QueryAgentStreamOptions = {
374
377
/** List of collections to query. Will override any collections if passed in the constructor. */
@@ -381,6 +384,16 @@ export type QueryAgentStreamOptions = {
381
384
includeFinalState ?: boolean ;
382
385
} ;
383
386
387
+ /** Options for the QueryAgent askStream. */
388
+ export type QueryAgentAskStreamOptions = {
389
+ /** List of collections to query. Will override any collections if passed in the constructor. */
390
+ collections ?: ( string | QueryAgentCollectionConfig ) [ ] ;
391
+ /** Include progress messages in the stream. */
392
+ includeProgress ?: boolean ;
393
+ /** Include final state in the stream. */
394
+ includeFinalState ?: boolean ;
395
+ } ;
396
+
384
397
/** Options for the QueryAgent search-only run. */
385
398
export type QueryAgentSearchOnlyOptions = {
386
399
/** The maximum number of results to return. */
0 commit comments