rhua-chatgpt-web 1.0.98 → 1.0.99

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.
Files changed (46) hide show
  1. package/dist/{api_chain-wgmc7e6E.js → api_chain-C2BsZcfa.js} +2 -2
  2. package/dist/{api_chain-CB8GWGIU.cjs → api_chain-D2AEAwf2.cjs} +1 -1
  3. package/dist/{combine_docs_chain-DgONM3Mw.cjs → combine_docs_chain-BwUcmS0t.cjs} +1 -1
  4. package/dist/{combine_docs_chain-C4dphi5e.js → combine_docs_chain-D0ygQAil.js} +2 -2
  5. package/dist/{few_shot-CAlLA7_Y.js → few_shot-CHQMukLV.js} +1 -1
  6. package/dist/{few_shot-D1R-zNl7.cjs → few_shot-CQMLIcvu.cjs} +1 -1
  7. package/dist/{index-Bg5840_w.js → index-3uuVdHPW.js} +1 -1
  8. package/dist/{index-cTMOFBXD.cjs → index-5hC-EuRW.cjs} +1 -1
  9. package/dist/{index-DrDcayhM.js → index-B4HXYy58.js} +1 -1
  10. package/dist/index-BMeyd5Mb.js +4 -0
  11. package/dist/index-CE38VgAV.js +4 -0
  12. package/dist/{index-Cd_gRf5s.cjs → index-CUTMmRLO.cjs} +1 -1
  13. package/dist/{index-Dt6MdEi3.cjs → index-CUbh3CUk.cjs} +1 -1
  14. package/dist/{index-DMb9FQJU.cjs → index-CvkY01OP.cjs} +1 -1
  15. package/dist/{index-D6StpCel.cjs → index-D1EyeOGY.cjs} +1 -1
  16. package/dist/{index-CjSvTRsR.cjs → index-D3WYQbg9.cjs} +1 -1
  17. package/dist/index-D5IEaWdP.js +4 -0
  18. package/dist/{index-BN7_2Vpx.js → index-D9geeS71.js} +2 -2
  19. package/dist/{index-CymPiKxB.js → index-DDNOIr8O.js} +1 -1
  20. package/dist/{index-CfwXktuP.cjs → index-DDtVKZHe.cjs} +1 -1
  21. package/dist/{index-BekrpxaM.cjs → index-DKj4xxCF.cjs} +1 -1
  22. package/dist/{index-BbYqG4Lp.js → index-DPo7N7-F.js} +72 -154
  23. package/dist/index-Da-yc0Sn.js +4 -0
  24. package/dist/{index-CI8OM2Jz.js → index-Ddt8e4jQ.js} +1 -1
  25. package/dist/{index-r3AjaSlS.cjs → index-DiJKM8e3.cjs} +1 -1
  26. package/dist/{index-DWSafnCg.cjs → index-DkwjGulR.cjs} +1 -1
  27. package/dist/{index-C1T2elxu.js → index-DlDIFIcy.js} +1 -1
  28. package/dist/{index-D8gIJjM_.cjs → index-NFb6Ikqb.cjs} +1 -1
  29. package/dist/{index-Bg42RK-4.js → index-vJhPvv3A.js} +2 -2
  30. package/dist/{index-CjmBLRKu.cjs → index-xQlqRtFE.cjs} +3 -3
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/{index.es-CtypdcdJ.cjs → index.es-B9waF7p1.cjs} +2 -2
  33. package/dist/{index.es-67G0dUQ8.js → index.es-muo7iWsn.js} +11 -11
  34. package/dist/index.esm.js +1 -1
  35. package/dist/{llm_chain-RoYoMcLp.cjs → llm_chain-BVEQefX9.cjs} +1 -1
  36. package/dist/{llm_chain-AXaQuXMt.js → llm_chain-FiDBkCHX.js} +1 -1
  37. package/dist/{sequential_chain-DVxvWiQQ.js → sequential_chain-C89zWQZZ.js} +1 -1
  38. package/dist/{sequential_chain-9yzJVjdz.cjs → sequential_chain-hcM_0OeZ.cjs} +1 -1
  39. package/dist/style.css +1 -1
  40. package/dist/{vector_db_qa-Ca-yXUO_.js → vector_db_qa-Cxtn-hGw.js} +3 -3
  41. package/dist/{vector_db_qa-4lYMS_5X.cjs → vector_db_qa-DpnOTF2e.cjs} +1 -1
  42. package/package.json +1 -1
  43. package/dist/index-ASKx-pn3.js +0 -4
  44. package/dist/index-B-yz5nX2.js +0 -4
  45. package/dist/index-Ctbtl5KP.js +0 -4
  46. package/dist/index-Cuzto2LI.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-BbYqG4Lp.js";
2
- import { LLMChain } from "./llm_chain-AXaQuXMt.js";
3
- import { StuffDocumentsChain } from "./combine_docs_chain-C4dphi5e.js";
1
+ import { P as PromptTemplate, C as ChatPromptTemplate, m as SystemMessagePromptTemplate, H as HumanMessagePromptTemplate, i as BaseChain } from "./index-DPo7N7-F.js";
2
+ import { LLMChain } from "./llm_chain-FiDBkCHX.js";
3
+ import { StuffDocumentsChain } from "./combine_docs_chain-D0ygQAil.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-CjmBLRKu.cjs"),t=require("./llm_chain-RoYoMcLp.cjs"),n=require("./combine_docs_chain-DgONM3Mw.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-xQlqRtFE.cjs"),t=require("./llm_chain-BVEQefX9.cjs"),n=require("./combine_docs_chain-BwUcmS0t.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rhua-chatgpt-web",
3
- "version": "1.0.98",
3
+ "version": "1.0.99",
4
4
  "description": "一个基于React和Semi Design的ChatGPT Web界面组件库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,4 +0,0 @@
1
- import { r } from "./index-BbYqG4Lp.js";
2
- export {
3
- r as default
4
- };
@@ -1,4 +0,0 @@
1
- import { u } from "./index-BbYqG4Lp.js";
2
- export {
3
- u as unified
4
- };
@@ -1,4 +0,0 @@
1
- import { f } from "./index-BbYqG4Lp.js";
2
- export {
3
- f as fromDom
4
- };
@@ -1,4 +0,0 @@
1
- import { a } from "./index-BbYqG4Lp.js";
2
- export {
3
- a as default
4
- };