diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..c4c2cd9 Binary files /dev/null and b/.DS_Store differ diff --git a/examples/.DS_Store b/examples/.DS_Store new file mode 100644 index 0000000..c359f2d Binary files /dev/null and b/examples/.DS_Store differ diff --git a/examples/data/.DS_Store b/examples/data/.DS_Store new file mode 100644 index 0000000..631ddba Binary files /dev/null and b/examples/data/.DS_Store differ diff --git a/src/models.tsx b/src/models.tsx index 5465e8d..8752015 100644 --- a/src/models.tsx +++ b/src/models.tsx @@ -33,7 +33,7 @@ export interface VectorSearchSettings { export interface KGSearchSettings { use_kg_search: boolean; - agent_generation_config?: GenerationConfig; + agent_generation_config?: Record; } export interface Document { @@ -70,9 +70,9 @@ export interface R2RSearchRequest { export interface R2RRAGRequest { query: string; - vector_search_settings: VectorSearchSettings; - kg_search_settings: KGSearchSettings; - rag_generation_config?: GenerationConfig; + vector_search_settings: Record; + kg_search_settings: Record; + rag_generation_config?: Record; } export interface R2RDeleteRequest { diff --git a/src/r2rClient.ts b/src/r2rClient.ts index ca541ba..24346ec 100644 --- a/src/r2rClient.ts +++ b/src/r2rClient.ts @@ -263,8 +263,8 @@ export class r2rClient { search_limit?: number; do_hybrid_search?: boolean; use_kg_search?: boolean; - kg_generation_config?: Partial; - rag_generation_config?: Partial; + kg_generation_config?: Record; + rag_generation_config?: Record; // Updated to Record }): Promise { const { query, @@ -277,14 +277,14 @@ export class r2rClient { rag_generation_config = {}, } = params; - const vector_search_settings: VectorSearchSettings = { + const vector_search_settings: Record = { use_vector_search, search_filters, search_limit, do_hybrid_search, }; - const kg_search_settings: KGSearchSettings = { + const kg_search_settings: Record = { use_kg_search, agent_generation_config: { ...DEFAULT_GENERATION_CONFIG, @@ -302,7 +302,7 @@ export class r2rClient { }, }; - if (rag_generation_config.stream) { + if (rag_generation_config && rag_generation_config.stream) { return this.streamRag(request); } else { const response = await this.axiosInstance.post("/rag", request);