rhua-chatgpt-web 1.0.99 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{api_chain-C2BsZcfa.js → api_chain-BhV6_Pmq.js} +2 -2
- package/dist/{api_chain-D2AEAwf2.cjs → api_chain-DVLnAgiW.cjs} +1 -1
- package/dist/{combine_docs_chain-D0ygQAil.js → combine_docs_chain-B9QorZsY.js} +2 -2
- package/dist/{combine_docs_chain-BwUcmS0t.cjs → combine_docs_chain-D8mHPBmd.cjs} +1 -1
- package/dist/{few_shot-CHQMukLV.js → few_shot-CFSdacSl.js} +1 -1
- package/dist/{few_shot-CQMLIcvu.cjs → few_shot-bRG5F-EG.cjs} +1 -1
- package/dist/{index-D1EyeOGY.cjs → index-9eExIDsS.cjs} +1 -1
- package/dist/{index-DiJKM8e3.cjs → index-B1Wlx-OU.cjs} +1 -1
- package/dist/{index-Ddt8e4jQ.js → index-B4QG5JFW.js} +1 -1
- package/dist/{index-CUbh3CUk.cjs → index-B9enJf5m.cjs} +1 -1
- package/dist/index-BDLTve4Z.js +4 -0
- package/dist/{index-DKj4xxCF.cjs → index-BKYMy9rL.cjs} +1 -1
- package/dist/{index-DkwjGulR.cjs → index-BUvzgpbD.cjs} +1 -1
- package/dist/{index-3uuVdHPW.js → index-B_Zc2AO-.js} +1 -1
- package/dist/{index-DDtVKZHe.cjs → index-Bm3Y9HAz.cjs} +1 -1
- package/dist/{index-D3WYQbg9.cjs → index-BmJffSUR.cjs} +1 -1
- package/dist/{index-NFb6Ikqb.cjs → index-BwGX7L-I.cjs} +1 -1
- package/dist/{index-DlDIFIcy.js → index-BxehhQJ1.js} +1 -1
- package/dist/{index-D9geeS71.js → index-Bz6sXppL.js} +2 -2
- package/dist/{index-DPo7N7-F.js → index-C0mX7ZGP.js} +138 -14
- package/dist/{index-vJhPvv3A.js → index-CM5Ei0Fe.js} +2 -2
- package/dist/{index-B4HXYy58.js → index-CR8ZslxC.js} +1 -1
- package/dist/{index-CvkY01OP.cjs → index-CiJIlOWe.cjs} +1 -1
- package/dist/{index-CUTMmRLO.cjs → index-Dg40JuSw.cjs} +1 -1
- package/dist/{index-xQlqRtFE.cjs → index-DmZ6JkXr.cjs} +2 -2
- package/dist/{index-5hC-EuRW.cjs → index-DrzloHWR.cjs} +1 -1
- package/dist/index-NaKA8k_1.js +4 -0
- package/dist/index-m3hI35_N.js +4 -0
- package/dist/{index-DDNOIr8O.js → index-szMPQlBb.js} +1 -1
- package/dist/index-x-JUDIDN.js +4 -0
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-B9waF7p1.cjs → index.es-B2V8NsVE.cjs} +2 -2
- package/dist/{index.es-muo7iWsn.js → index.es-lGV9_rDo.js} +11 -11
- package/dist/index.esm.js +1 -1
- package/dist/{llm_chain-FiDBkCHX.js → llm_chain-1pCOifVt.js} +1 -1
- package/dist/{llm_chain-BVEQefX9.cjs → llm_chain-D4IZ67iH.cjs} +1 -1
- package/dist/{sequential_chain-C89zWQZZ.js → sequential_chain-B9oXR3Bd.js} +1 -1
- package/dist/{sequential_chain-hcM_0OeZ.cjs → sequential_chain-DlVTyzea.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{vector_db_qa-Cxtn-hGw.js → vector_db_qa-BrELsB11.js} +3 -3
- package/dist/{vector_db_qa-DpnOTF2e.cjs → vector_db_qa-CYd9aCx5.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-BMeyd5Mb.js +0 -4
- package/dist/index-CE38VgAV.js +0 -4
- package/dist/index-D5IEaWdP.js +0 -4
- package/dist/index-Da-yc0Sn.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as PromptTemplate, C as ChatPromptTemplate, m as SystemMessagePromptTemplate, H as HumanMessagePromptTemplate, i as BaseChain } from "./index-
|
|
2
|
-
import { LLMChain } from "./llm_chain-
|
|
3
|
-
import { StuffDocumentsChain } from "./combine_docs_chain-
|
|
1
|
+
import { P as PromptTemplate, C as ChatPromptTemplate, m as SystemMessagePromptTemplate, H as HumanMessagePromptTemplate, i as BaseChain } from "./index-C0mX7ZGP.js";
|
|
2
|
+
import { LLMChain } from "./llm_chain-1pCOifVt.js";
|
|
3
|
+
import { StuffDocumentsChain } from "./combine_docs_chain-B9QorZsY.js";
|
|
4
4
|
import "zod";
|
|
5
5
|
class BasePromptSelector {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DmZ6JkXr.cjs"),t=require("./llm_chain-D4IZ67iH.cjs"),n=require("./combine_docs_chain-D8mHPBmd.cjs");require("zod");class o{async getPromptAsync(e,t){return this.getPrompt(e).partial((null==t?void 0:t.partialVariables)??{})}}class r extends o{constructor(e,t=[]){super(),Object.defineProperty(this,"defaultPrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"conditionals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.defaultPrompt=e,this.conditionals=t}getPrompt(e){for(const[t,n]of this.conditionals)if(t(e))return n;return this.defaultPrompt}}const i=new e.PromptTemplate({template:"Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer.\n\n{context}\n\nQuestion: {question}\nHelpful Answer:",inputVariables:["context","question"]}),s=[e.SystemMessagePromptTemplate.fromTemplate("Use the following pieces of context to answer the users question. \nIf you don't know the answer, just say that you don't know, don't try to make up an answer.\n----------------\n{context}"),e.HumanMessagePromptTemplate.fromTemplate("{question}")],a=new r(i,[[function(e){return"base_chat_model"===e._modelType()},e.ChatPromptTemplate.fromMessages(s)]]);class c extends e.BaseChain{static lc_name(){return"VectorDBQAChain"}get inputKeys(){return[this.inputKey]}get outputKeys(){return this.combineDocumentsChain.outputKeys.concat(this.returnSourceDocuments?["sourceDocuments"]:[])}constructor(e){super(e),Object.defineProperty(this,"k",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"query"}),Object.defineProperty(this,"vectorstore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"combineDocumentsChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"returnSourceDocuments",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.vectorstore=e.vectorstore,this.combineDocumentsChain=e.combineDocumentsChain,this.inputKey=e.inputKey??this.inputKey,this.k=e.k??this.k,this.returnSourceDocuments=e.returnSourceDocuments??this.returnSourceDocuments}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Question key ${this.inputKey} not found.`);const n=e[this.inputKey],o=await this.vectorstore.similaritySearch(n,this.k,e.filter,null==t?void 0:t.getChild("vectorstore")),r={question:n,input_documents:o},i=await this.combineDocumentsChain.call(r,null==t?void 0:t.getChild("combine_documents"));return this.returnSourceDocuments?{...i,sourceDocuments:o}:i}_chainType(){return"vector_db_qa"}static async deserialize(t,n){if(!("vectorstore"in n))throw new Error("Need to pass in a vectorstore to deserialize VectorDBQAChain");const{vectorstore:o}=n;if(!t.combine_documents_chain)throw new Error("VectorDBQAChain must have combine_documents_chain in serialized data");return new c({combineDocumentsChain:await e.BaseChain.deserialize(t.combine_documents_chain),k:t.k,vectorstore:o})}serialize(){return{_type:this._chainType(),combine_documents_chain:this.combineDocumentsChain.serialize(),k:this.k}}static fromLLM(e,o,r){const i=function(e,o={}){const{prompt:r=a.getPrompt(e),verbose:i}=o,s=new t.LLMChain({prompt:r,llm:e,verbose:i});return new n.StuffDocumentsChain({llmChain:s,verbose:i})}(e);return new this({vectorstore:o,combineDocumentsChain:i,...r})}}exports.VectorDBQAChain=c;
|
package/package.json
CHANGED
package/dist/index-BMeyd5Mb.js
DELETED
package/dist/index-CE38VgAV.js
DELETED
package/dist/index-D5IEaWdP.js
DELETED
package/dist/index-Da-yc0Sn.js
DELETED