Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Catch up to R2R dev
Browse files Browse the repository at this point in the history
  • Loading branch information
NolanTrem committed Jul 9, 2024
1 parent 621b335 commit 8724b8c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added examples/.DS_Store
Binary file not shown.
Binary file added examples/data/.DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions src/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface VectorSearchSettings {

export interface KGSearchSettings {
use_kg_search: boolean;
agent_generation_config?: GenerationConfig;
agent_generation_config?: Record<string, any>;
}

export interface Document {
Expand Down Expand Up @@ -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<string, any>;
kg_search_settings: Record<string, any>;
rag_generation_config?: Record<string, any>;
}

export interface R2RDeleteRequest {
Expand Down
10 changes: 5 additions & 5 deletions src/r2rClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ export class r2rClient {
search_limit?: number;
do_hybrid_search?: boolean;
use_kg_search?: boolean;
kg_generation_config?: Partial<GenerationConfig>;
rag_generation_config?: Partial<GenerationConfig>;
kg_generation_config?: Record<string, any>;
rag_generation_config?: Record<string, any>; // Updated to Record<string, any>
}): Promise<any> {
const {
query,
Expand All @@ -277,14 +277,14 @@ export class r2rClient {
rag_generation_config = {},
} = params;

const vector_search_settings: VectorSearchSettings = {
const vector_search_settings: Record<string, any> = {
use_vector_search,
search_filters,
search_limit,
do_hybrid_search,
};

const kg_search_settings: KGSearchSettings = {
const kg_search_settings: Record<string, any> = {
use_kg_search,
agent_generation_config: {
...DEFAULT_GENERATION_CONFIG,
Expand All @@ -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);
Expand Down

0 comments on commit 8724b8c

Please sign in to comment.