File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ export class QueryAgent {
118118 headers : requestHeaders ,
119119 body : JSON . stringify ( {
120120 headers : connectionHeaders ,
121- query,
121+ query : typeof query === "string" ? query : { messages : query } ,
122122 collections : mapCollections ( targetCollections ) ,
123123 system_prompt : this . systemPrompt ,
124124 } ) ,
@@ -294,7 +294,7 @@ export class QueryAgent {
294294 } ,
295295 body : JSON . stringify ( {
296296 headers,
297- query,
297+ query : typeof query === "string" ? query : { messages : query } ,
298298 collections : mapCollections ( targetCollections ) ,
299299 system_prompt : this . systemPrompt ,
300300 include_progress : includeProgress ?? true ,
@@ -368,11 +368,7 @@ export type QueryAgentOptions = {
368368 agentsHost ?: string ;
369369} ;
370370
371- export type QueryAgentQuery = string | ConversationContext ;
372-
373- export type ConversationContext = {
374- messages : ChatMessage [ ] ;
375- } ;
371+ export type QueryAgentQuery = string | ChatMessage [ ] ;
376372
377373export type ChatMessage = {
378374 role : "user" | "assistant" ;
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ export class QueryAgentSearcher {
4545 ) {
4646 const base = {
4747 headers : connectionHeaders ,
48- original_query : this . query ,
48+ original_query :
49+ typeof this . query === "string" ? this . query : { messages : this . query } ,
4950 collections : mapCollections ( this . collections ) ,
5051 limit,
5152 offset,
You can’t perform that action at this time.
0 commit comments