From 8724b8cb16d6d8be0532096d0f5f1a60c23081f3 Mon Sep 17 00:00:00 2001 From: NolanTrem <34580718+NolanTrem@users.noreply.github.com> Date: Tue, 9 Jul 2024 12:41:38 -0700 Subject: [PATCH] Catch up to R2R dev --- .DS_Store | Bin 0 -> 6148 bytes examples/.DS_Store | Bin 0 -> 6148 bytes examples/data/.DS_Store | Bin 0 -> 6148 bytes src/models.tsx | 8 ++++---- src/r2rClient.ts | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 .DS_Store create mode 100644 examples/.DS_Store create mode 100644 examples/data/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c4c2cd941e4a436a36923cb1ddfbcffca3d5b78a GIT binary patch literal 6148 zcmeHK%We}f6unLYowPIx5=aOMX(YC3NCK)rY(hvEU9f2oEC7X>ObF9X#!)6Apr}&z zz%TF%?D-J>g%zA@yVXn{Vn-|FE7`}7du-3~YfMCDA7z^8o))?1wSh1Wb zDFKCQBcTZ;)TQoWwBl_GtO8bn%ccPD-6HQ;?A$)~?)m8af3@IEH z6i~?Chf&7w`;wo7Hb0U_LmE-U?PvYPoxl0}vt(q(@xvcQVKS-Jeu`YaaOLWjv*qkK zZ#wVgtTXW@)1>8%Uvcial#zdy_WT!Nf7UJEcq-$G7smauB7{L7F0WsPaUf?cIgNuv zaXY%gDLTb&`SyIiw_k5m-1@`&`==Fm{-{x_xDSv%Ejl;v-g|u1J&A^~{KAsp2*eqv zY}eo!d_`hKi4UD|9LacqI_8z=*yvxS9!ZMn9TXl=73IsSeTIK}Hm<>2Vn+Iy#i2?~ z*Q)(%iFX~d;-R+_!~?MRz>+GjdgW1M=PSpf&GwvaVFORCpKq!4Q$o)%!Z6e4C$&sTfDD!zrF a40SFifK7u7jVOWH9|0wUjjRIyRDnNudG~Yx literal 0 HcmV?d00001 diff --git a/examples/.DS_Store b/examples/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c359f2d1aafef9e8696f0e90a212d566a612c863 GIT binary patch literal 6148 zcmeHK!EVz)5S>j!>nI@QP^5~JC9WYPZi|YzxM?|Xtt&VH3O0_YTi08~4mm`T`~mb^ zxbq?W4!qgjMx=#n)uI_|_U+Ejti5lo-5nxQ!)ZDo>JX6!Wo)!i{6)B*^@cQ@r3q9# z#+zJ!PI8@~%>#WLL z!TN@`;kCVw(TSc#Ra{NWVLW-ytz)h8~{UZUJxw0{`_Uo@A^C2FBXfI_xS1aS4X3>{JhZL zEcpt5rjbVuuiz4u<&3^YlOor}7ueYUA)U~eay*(wG@$_6qf;ucG4vh2e=>xoh%g`w z2m|+k0k<=H?R)U8@`=KLFmSsJ@c!UK8AFG)MYDCFFew0#uaQPjH&=h4&jw)Vu(k*b zMA=ZF4OK41P%d*&HXQw-^RF%1a8l;Y7{|R?xeP_Q#6$VUom6O1N?|}4SY=?%HamR& zzy5drzZxVhVL%x8uNY9x!{~5`DY>)t#^m^{^`W1jEbLcXT!x@xj$-)oQM?5;0=v%@ VVCb;62n$3m0)_@Dgn?US;5WydW2yiE literal 0 HcmV?d00001 diff --git a/examples/data/.DS_Store b/examples/data/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..631ddba114988baf95ae81d2a532028ba4dca439 GIT binary patch literal 6148 zcmeHK%}(1u5S|SwI6@UUv{Kd6N?ZdCp{=NTF#!%-F@i%|r8Z7m3)hQmhag3f`~c-y zxbq;q4$RCh2rF=HqiRN){bpxp?A>oy`vU-~KZ-X1+5q685;j^`JR#IhIwK9|X(B5A z#t`!T)SN`AiDsh3F^>$;+%3WnFpxqF_4%Vkv5mTZ%fj8S#YW@e%+2+6be1MX+3nt_ z#zOPO;*z)IEqmXBUuGPXVL2-LVg7|`hsLDQy&XnJ$#6VqzuGZb87A2<=Y%94V#wFy zB#X_sZ$?>MaBg55yq4D*wBJr9Yn#0f9lf#D>rFd)@~PMD==Yl+r_+}AdiCAsgTZO~ zJ2QW{-=J`Xvb=P750_}vMs*(KS!%MM=%<_&$RUIRPMM<&61L7^9ZI->^3i%HzOGOo z^MzFrVL%uV2Ih_dw; } 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);