rhua-chatgpt-web 1.1.5 → 1.1.7
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-EzupCauA.js → api_chain-8rLd0TuD.js} +2 -2
- package/dist/{api_chain-CQbpemiQ.cjs → api_chain-DBmoQA_7.cjs} +1 -1
- package/dist/{combine_docs_chain-CYSCkppE.js → combine_docs_chain-BH4-g2GW.js} +2 -2
- package/dist/{combine_docs_chain-BRxg6UtZ.cjs → combine_docs_chain-DfTwsFo0.cjs} +1 -1
- package/dist/{few_shot-q_TnpUqa.js → few_shot-DJCpSBvt.js} +1 -1
- package/dist/{few_shot-DfTvwnAe.cjs → few_shot-DQaRrbJw.cjs} +1 -1
- package/dist/{index-Z4SoiuPK.js → index-BAXNGSXw.js} +1 -1
- package/dist/{index-CJL6IhdJ.js → index-BDxCvrgc.js} +1 -1
- package/dist/{index-xlf6-zoR.cjs → index-BQO11CzB.cjs} +1 -1
- package/dist/index-B_x2i-jO.js +4 -0
- package/dist/{index-DAVe9cfb.js → index-BaQU1IvP.js} +320 -33
- package/dist/index-C8LQxWL1.js +4 -0
- package/dist/{index-gSOuomS5.js → index-CD6GBfkZ.js} +1 -1
- package/dist/{index-BnjwO3Bw.cjs → index-CFln1NC2.cjs} +1 -1
- package/dist/{index-DWYbc6d-.cjs → index-CUnp2vsA.cjs} +1 -1
- package/dist/{index-DXTOnzOs.js → index-CXpHNR4F.js} +1 -1
- package/dist/index-CYDd-qnF.js +4 -0
- package/dist/{index-DXa2ayFF.cjs → index-CvCPvUjj.cjs} +1 -1
- package/dist/{index-KdW7xIM8.cjs → index-DFYcGKuT.cjs} +31 -31
- package/dist/index-DH4SzrZB.js +4 -0
- package/dist/{index-DZFTEz-j.cjs → index-DRg4CNkS.cjs} +1 -1
- package/dist/{index-BfavGjvq.js → index-Dy-SzFud.js} +2 -2
- package/dist/{index-D__lg2sO.cjs → index-FAGD8ZFV.cjs} +1 -1
- package/dist/{index-BI4EdlAm.js → index-GSRYlXZ2.js} +1 -1
- package/dist/{index-Chp1R4-v.cjs → index-PQbFNXZe.cjs} +1 -1
- package/dist/{index-CtXnaw8Y.cjs → index-VviEQjAE.cjs} +1 -1
- package/dist/{index-CgCXN3R6.js → index-Wbrx5M_5.js} +2 -2
- package/dist/{index-ybRvvKbH.cjs → index-faFDPW0m.cjs} +1 -1
- package/dist/{index-DT9dJ8WJ.cjs → index-jiGOdiuu.cjs} +1 -1
- package/dist/{index-DEbJFy6H.cjs → index-xDEsnKsG.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-CC8FXRVt.cjs → index.es-DUhQYmQQ.cjs} +3 -3
- package/dist/{index.es-BV1sWnV8.js → index.es-Ofj7pWXh.js} +60 -59
- package/dist/index.esm.js +6 -5
- package/dist/{llm_chain-zANp5jfK.js → llm_chain-D_TCnPCU.js} +1 -1
- package/dist/{llm_chain-Bv5-BS50.cjs → llm_chain-uxhdn-1W.cjs} +1 -1
- package/dist/{sequential_chain-Bw8lqqn7.js → sequential_chain-BIzQ7CWb.js} +1 -1
- package/dist/{sequential_chain-_P-m2t1s.cjs → sequential_chain-CMYssdOR.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{vector_db_qa-CSVVrc_O.cjs → vector_db_qa-Bf6oOghB.cjs} +1 -1
- package/dist/{vector_db_qa-CIJfQI3s.js → vector_db_qa-DnXdDGBx.js} +3 -3
- package/package.json +135 -135
- package/dist/index-BcSVqRCu.js +0 -4
- package/dist/index-CjhpPaDq.js +0 -4
- package/dist/index-CvsV56bR.js +0 -4
- package/dist/index-DP9UqkZn.js +0 -4
|
@@ -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-DFYcGKuT.cjs"),t=require("./llm_chain-uxhdn-1W.cjs"),n=require("./combine_docs_chain-DfTwsFo0.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,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-BaQU1IvP.js";
|
|
2
|
+
import { LLMChain } from "./llm_chain-D_TCnPCU.js";
|
|
3
|
+
import { StuffDocumentsChain } from "./combine_docs_chain-BH4-g2GW.js";
|
|
4
4
|
import "zod";
|
|
5
5
|
class BasePromptSelector {
|
|
6
6
|
/**
|
package/package.json
CHANGED
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rhua-chatgpt-web",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "一个基于React和Semi Design的ChatGPT Web界面组件库",
|
|
5
|
-
"main": "dist/index.cjs.js",
|
|
6
|
-
"module": "dist/index.esm.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist",
|
|
10
|
-
"README.md",
|
|
11
|
-
"LICENSE"
|
|
12
|
-
],
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"import": "./dist/index.esm.js",
|
|
16
|
-
"require": "./dist/index.cjs.js",
|
|
17
|
-
"types": "./dist/index.d.ts"
|
|
18
|
-
},
|
|
19
|
-
"./styles": "./dist/style.css"
|
|
20
|
-
},
|
|
21
|
-
"type": "module",
|
|
22
|
-
"scripts": {
|
|
23
|
-
"dev": "vite",
|
|
24
|
-
"build": "vite build && tsc --emitDeclarationOnly --outDir dist",
|
|
25
|
-
"build:lib": "vite build --mode library",
|
|
26
|
-
"preview": "vite preview",
|
|
27
|
-
"tauri": "tauri",
|
|
28
|
-
"prepublishOnly": "npm run build:lib"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
32
|
-
"@douyinfe/semi-icons": "^2.59.0",
|
|
33
|
-
"@douyinfe/semi-icons-lab": "^2.59.0",
|
|
34
|
-
"@douyinfe/semi-illustrations": "^2.59.0",
|
|
35
|
-
"@douyinfe/semi-ui": "^2.59.0",
|
|
36
|
-
"@langchain/community": "^0.2.2",
|
|
37
|
-
"@langchain/core": "^0.2.0",
|
|
38
|
-
"@langchain/openai": "^0.0.33",
|
|
39
|
-
"@semi-bot/semi-theme-xiangshuishidai": "^1.0.0",
|
|
40
|
-
"ai": "^3.1.14",
|
|
41
|
-
"ai-portal-blocknote-editor": "0.0.
|
|
42
|
-
"docx": "^9.5.1",
|
|
43
|
-
"highlight.js": "^11.9.0",
|
|
44
|
-
"html-to-image": "^1.11.11",
|
|
45
|
-
"katex": "^0.16.10",
|
|
46
|
-
"langchain": "^0.2.2",
|
|
47
|
-
"localforage": "^1.10.0",
|
|
48
|
-
"mermaid": "^10.9.1",
|
|
49
|
-
"react-amap": "^1.2.8",
|
|
50
|
-
"react-markdown": "^9.0.1",
|
|
51
|
-
"rehype-highlight": "^7.0.0",
|
|
52
|
-
"rehype-katex": "^7.0.0",
|
|
53
|
-
"remark-breaks": "^4.0.0",
|
|
54
|
-
"remark-gfm": "^4.0.0",
|
|
55
|
-
"remark-math": "^6.0.0",
|
|
56
|
-
"styled-components": "^6.1.11",
|
|
57
|
-
"vue": "^3.4.0",
|
|
58
|
-
"zod": "^3.23.8"
|
|
59
|
-
},
|
|
60
|
-
"peerDependencies": {
|
|
61
|
-
"@douyinfe/semi-icons": "^2.59.0",
|
|
62
|
-
"@douyinfe/semi-icons-lab": "^2.59.0",
|
|
63
|
-
"@douyinfe/semi-illustrations": "^2.59.0",
|
|
64
|
-
"@douyinfe/semi-ui": "^2.59.0",
|
|
65
|
-
"@semi-bot/semi-theme-xiangshuishidai": "^1.0.0",
|
|
66
|
-
"highlight.js": "^11.9.0",
|
|
67
|
-
"katex": "^0.16.10",
|
|
68
|
-
"localforage": "^1.10.0",
|
|
69
|
-
"mermaid": "^10.9.1",
|
|
70
|
-
"react": ">=18.0.0",
|
|
71
|
-
"react-dom": ">=18.0.0",
|
|
72
|
-
"react-router-dom": ">=6.0.0",
|
|
73
|
-
"styled-components": "^6.1.11"
|
|
74
|
-
},
|
|
75
|
-
"peerDependenciesMeta": {
|
|
76
|
-
"react": {
|
|
77
|
-
"optional": false
|
|
78
|
-
},
|
|
79
|
-
"react-dom": {
|
|
80
|
-
"optional": false
|
|
81
|
-
},
|
|
82
|
-
"react-router-dom": {
|
|
83
|
-
"optional": true
|
|
84
|
-
},
|
|
85
|
-
"@douyinfe/semi-ui": {
|
|
86
|
-
"optional": false
|
|
87
|
-
},
|
|
88
|
-
"@douyinfe/semi-icons": {
|
|
89
|
-
"optional": false
|
|
90
|
-
},
|
|
91
|
-
"@douyinfe/semi-icons-lab": {
|
|
92
|
-
"optional": false
|
|
93
|
-
},
|
|
94
|
-
"@douyinfe/semi-illustrations": {
|
|
95
|
-
"optional": false
|
|
96
|
-
},
|
|
97
|
-
"@semi-bot/semi-theme-xiangshuishidai": {
|
|
98
|
-
"optional": false
|
|
99
|
-
},
|
|
100
|
-
"mermaid": {
|
|
101
|
-
"optional": true
|
|
102
|
-
},
|
|
103
|
-
"katex": {
|
|
104
|
-
"optional": true
|
|
105
|
-
},
|
|
106
|
-
"highlight.js": {
|
|
107
|
-
"optional": true
|
|
108
|
-
},
|
|
109
|
-
"localforage": {
|
|
110
|
-
"optional": true
|
|
111
|
-
},
|
|
112
|
-
"styled-components": {
|
|
113
|
-
"optional": true
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
"devDependencies": {
|
|
117
|
-
"@tauri-apps/api": "^1.5.6",
|
|
118
|
-
"@tauri-apps/cli": "^1.5.14",
|
|
119
|
-
"@types/react": "^18.3.3",
|
|
120
|
-
"@types/react-dom": "^18.3.0",
|
|
121
|
-
"@vitejs/plugin-react": "^4.3.0",
|
|
122
|
-
"react": "^18.3.1",
|
|
123
|
-
"react-dom": "^18.3.1",
|
|
124
|
-
"react-router-dom": "^6.23.1",
|
|
125
|
-
"sass": "^1.77.2",
|
|
126
|
-
"terser": "^5.31.0",
|
|
127
|
-
"typescript": "^5.4.5",
|
|
128
|
-
"vite": "^5.2.11"
|
|
129
|
-
},
|
|
130
|
-
"pnpm": {
|
|
131
|
-
"overrides": {
|
|
132
|
-
"@langchain/core": "^0.2.0"
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "rhua-chatgpt-web",
|
|
3
|
+
"version": "1.1.7",
|
|
4
|
+
"description": "一个基于React和Semi Design的ChatGPT Web界面组件库",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.esm.js",
|
|
16
|
+
"require": "./dist/index.cjs.js",
|
|
17
|
+
"types": "./dist/index.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./styles": "./dist/style.css"
|
|
20
|
+
},
|
|
21
|
+
"type": "module",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "vite",
|
|
24
|
+
"build": "vite build && tsc --emitDeclarationOnly --outDir dist",
|
|
25
|
+
"build:lib": "vite build --mode library",
|
|
26
|
+
"preview": "vite preview",
|
|
27
|
+
"tauri": "tauri",
|
|
28
|
+
"prepublishOnly": "npm run build:lib"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
32
|
+
"@douyinfe/semi-icons": "^2.59.0",
|
|
33
|
+
"@douyinfe/semi-icons-lab": "^2.59.0",
|
|
34
|
+
"@douyinfe/semi-illustrations": "^2.59.0",
|
|
35
|
+
"@douyinfe/semi-ui": "^2.59.0",
|
|
36
|
+
"@langchain/community": "^0.2.2",
|
|
37
|
+
"@langchain/core": "^0.2.0",
|
|
38
|
+
"@langchain/openai": "^0.0.33",
|
|
39
|
+
"@semi-bot/semi-theme-xiangshuishidai": "^1.0.0",
|
|
40
|
+
"ai": "^3.1.14",
|
|
41
|
+
"ai-portal-blocknote-editor": "0.0.27",
|
|
42
|
+
"docx": "^9.5.1",
|
|
43
|
+
"highlight.js": "^11.9.0",
|
|
44
|
+
"html-to-image": "^1.11.11",
|
|
45
|
+
"katex": "^0.16.10",
|
|
46
|
+
"langchain": "^0.2.2",
|
|
47
|
+
"localforage": "^1.10.0",
|
|
48
|
+
"mermaid": "^10.9.1",
|
|
49
|
+
"react-amap": "^1.2.8",
|
|
50
|
+
"react-markdown": "^9.0.1",
|
|
51
|
+
"rehype-highlight": "^7.0.0",
|
|
52
|
+
"rehype-katex": "^7.0.0",
|
|
53
|
+
"remark-breaks": "^4.0.0",
|
|
54
|
+
"remark-gfm": "^4.0.0",
|
|
55
|
+
"remark-math": "^6.0.0",
|
|
56
|
+
"styled-components": "^6.1.11",
|
|
57
|
+
"vue": "^3.4.0",
|
|
58
|
+
"zod": "^3.23.8"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@douyinfe/semi-icons": "^2.59.0",
|
|
62
|
+
"@douyinfe/semi-icons-lab": "^2.59.0",
|
|
63
|
+
"@douyinfe/semi-illustrations": "^2.59.0",
|
|
64
|
+
"@douyinfe/semi-ui": "^2.59.0",
|
|
65
|
+
"@semi-bot/semi-theme-xiangshuishidai": "^1.0.0",
|
|
66
|
+
"highlight.js": "^11.9.0",
|
|
67
|
+
"katex": "^0.16.10",
|
|
68
|
+
"localforage": "^1.10.0",
|
|
69
|
+
"mermaid": "^10.9.1",
|
|
70
|
+
"react": ">=18.0.0",
|
|
71
|
+
"react-dom": ">=18.0.0",
|
|
72
|
+
"react-router-dom": ">=6.0.0",
|
|
73
|
+
"styled-components": "^6.1.11"
|
|
74
|
+
},
|
|
75
|
+
"peerDependenciesMeta": {
|
|
76
|
+
"react": {
|
|
77
|
+
"optional": false
|
|
78
|
+
},
|
|
79
|
+
"react-dom": {
|
|
80
|
+
"optional": false
|
|
81
|
+
},
|
|
82
|
+
"react-router-dom": {
|
|
83
|
+
"optional": true
|
|
84
|
+
},
|
|
85
|
+
"@douyinfe/semi-ui": {
|
|
86
|
+
"optional": false
|
|
87
|
+
},
|
|
88
|
+
"@douyinfe/semi-icons": {
|
|
89
|
+
"optional": false
|
|
90
|
+
},
|
|
91
|
+
"@douyinfe/semi-icons-lab": {
|
|
92
|
+
"optional": false
|
|
93
|
+
},
|
|
94
|
+
"@douyinfe/semi-illustrations": {
|
|
95
|
+
"optional": false
|
|
96
|
+
},
|
|
97
|
+
"@semi-bot/semi-theme-xiangshuishidai": {
|
|
98
|
+
"optional": false
|
|
99
|
+
},
|
|
100
|
+
"mermaid": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"katex": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"highlight.js": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"localforage": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"styled-components": {
|
|
113
|
+
"optional": true
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"devDependencies": {
|
|
117
|
+
"@tauri-apps/api": "^1.5.6",
|
|
118
|
+
"@tauri-apps/cli": "^1.5.14",
|
|
119
|
+
"@types/react": "^18.3.3",
|
|
120
|
+
"@types/react-dom": "^18.3.0",
|
|
121
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
122
|
+
"react": "^18.3.1",
|
|
123
|
+
"react-dom": "^18.3.1",
|
|
124
|
+
"react-router-dom": "^6.23.1",
|
|
125
|
+
"sass": "^1.77.2",
|
|
126
|
+
"terser": "^5.31.0",
|
|
127
|
+
"typescript": "^5.4.5",
|
|
128
|
+
"vite": "^5.2.11"
|
|
129
|
+
},
|
|
130
|
+
"pnpm": {
|
|
131
|
+
"overrides": {
|
|
132
|
+
"@langchain/core": "^0.2.0"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
package/dist/index-BcSVqRCu.js
DELETED
package/dist/index-CjhpPaDq.js
DELETED
package/dist/index-CvsV56bR.js
DELETED
package/dist/index-DP9UqkZn.js
DELETED