@nocobase/plugin-ai-gigachat 2.0.3 → 2.0.5
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/client/index.js +1 -1
- package/dist/externalVersion.js +5 -5
- package/dist/node_modules/gigachat/package.json +1 -1
- package/dist/node_modules/langchain-gigachat/package.json +1 -1
- package/dist/server/llm-providers/gigachat.d.ts +6 -1
- package/dist/server/llm-providers/gigachat.js +31 -3
- package/package.json +5 -2
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nocobase/plugin-ai/client"),require("@nocobase/client"),require("@nocobase/utils/client"),require("antd"),require("@nocobase/plugin-workflow/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-ai-gigachat",["react","@nocobase/plugin-ai/client","@nocobase/client","@nocobase/utils/client","antd","@nocobase/plugin-workflow/client"],t):"object"==typeof exports?exports["@nocobase/plugin-ai-gigachat"]=t(require("react"),require("@nocobase/plugin-ai/client"),require("@nocobase/client"),require("@nocobase/utils/client"),require("antd"),require("@nocobase/plugin-workflow/client")):e["@nocobase/plugin-ai-gigachat"]=t(e.react,e["@nocobase/plugin-ai/client"],e["@nocobase/client"],e["@nocobase/utils/client"],e.antd,e["@nocobase/plugin-workflow/client"])}(self,function(e,t,n,o,r,i){return function(){"use strict";var a={772:function(e){e.exports=n},645:function(e){e.exports=t},433:function(e){e.exports=i},584:function(e){e.exports=o},721:function(e){e.exports=r},156:function(t){t.exports=e}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return a[e](n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return!function(){u.r(l),u.d(l,{PluginAIGigaChatClient:function(){return
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nocobase/plugin-ai/client"),require("@nocobase/client"),require("@nocobase/utils/client"),require("antd"),require("@nocobase/plugin-workflow/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-ai-gigachat",["react","@nocobase/plugin-ai/client","@nocobase/client","@nocobase/utils/client","antd","@nocobase/plugin-workflow/client"],t):"object"==typeof exports?exports["@nocobase/plugin-ai-gigachat"]=t(require("react"),require("@nocobase/plugin-ai/client"),require("@nocobase/client"),require("@nocobase/utils/client"),require("antd"),require("@nocobase/plugin-workflow/client")):e["@nocobase/plugin-ai-gigachat"]=t(e.react,e["@nocobase/plugin-ai/client"],e["@nocobase/client"],e["@nocobase/utils/client"],e.antd,e["@nocobase/plugin-workflow/client"])}(self,function(e,t,n,o,r,i){return function(){"use strict";var a={772:function(e){e.exports=n},645:function(e){e.exports=t},433:function(e){e.exports=i},584:function(e){e.exports=o},721:function(e){e.exports=r},156:function(t){t.exports=e}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return a[e](n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return!function(){u.r(l),u.d(l,{PluginAIGigaChatClient:function(){return P},default:function(){return I}});var e=u(772),t=u(156),n=u.n(t),o=u(584),r=JSON.parse('{"u2":"@nocobase/plugin-ai-gigachat"}'),i=r.u2,a=u(721),c=u(433),p=u(645),s=function(){var t,c=(t=(0,e.useApp)(),function(e){return t.i18n.t(e,{ns:[r.u2,"client"]})});return n().createElement("div",{style:{marginBottom:24}},n().createElement(a.Collapse,{bordered:!1,size:"small",items:[{key:"options",label:c("Options"),forceRender:!0,children:n().createElement(e.SchemaComponent,{schema:{type:"void",name:"deepseek",properties:{frequencyPenalty:{title:(0,o.tval)("Frequency penalty",{ns:i}),description:(0,o.tval)("Frequency penalty description",{ns:i}),type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:0,"x-component-props":{step:.1,min:-2,max:2}},maxCompletionTokens:{title:(0,o.tval)("Max completion tokens",{ns:i}),description:(0,o.tval)("Max completion tokens description",{ns:i}),type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:-1},presencePenalty:{title:(0,o.tval)("Presence penalty",{ns:i}),description:(0,o.tval)("Presence penalty description",{ns:i}),type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:0,"x-component-props":{step:.1,min:-2,max:2}},temperature:{title:(0,o.tval)("Temperature",{ns:i}),description:(0,o.tval)("Temperature description",{ns:i}),type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:.7,"x-component-props":{step:.1,min:0,max:1}},topP:{title:(0,o.tval)("Top P",{ns:i}),description:(0,o.tval)("Top P description",{ns:i}),type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:1,"x-component-props":{step:.5,min:0,max:1}},responseFormat:{title:(0,o.tval)("Response format",{ns:i}),description:(0,o.tval)("Response format description",{ns:i}),type:"string","x-decorator":"FormItem","x-component":"Select",enum:[{label:c("Text"),value:"text"},{label:c("JSON"),value:"json_object"}],default:"text"},timeout:{title:(0,o.tval)("Timeout (ms)",{ns:i}),type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:6e4},maxRetries:{title:(0,o.tval)("Max retries",{ns:i}),type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:1}}}})}]}))},f={components:{ProviderSettingsForm:function(){return n().createElement(e.SchemaComponent,{schema:{type:"void",properties:{apiKey:{title:(0,o.tval)("Authorization key",{ns:i}),type:"string",required:!0,"x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"},scope:{title:(0,o.tval)("Scope",{ns:i}),type:"string",required:!0,"x-decorator":"FormItem","x-component":"Select","x-component-props":{options:[{label:"GIGACHAT_API_PERS",value:"GIGACHAT_API_PERS"},{label:"GIGACHAT_API_B2B",value:"GIGACHAT_API_B2B"},{label:"GIGACHAT_API_CORP",value:"GIGACHAT_API_CORP"}]}},authURL:{title:(0,o.tval)("Auth URL",{ns:i}),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"},enableSSL:{title:(0,o.tval)("Verify certificates",{ns:i}),type:"string","x-decorator":"FormItem","x-component":"Checkbox",default:!0}}}})},ModelSettingsForm:function(){return n().createElement(e.SchemaComponent,{components:{Options:s,WorkflowVariableRawTextArea:c.WorkflowVariableRawTextArea,ModelSelect:p.ModelSelect,Chat:p.Chat},schema:{type:"void",properties:{model:{title:(0,o.tval)("Model",{ns:i}),type:"string",required:!0,"x-decorator":"FormItem","x-component":"ModelSelect"},options:{type:"void","x-component":"Options"},chat:{type:"void","x-component":"Chat"}}}})}}};function m(e,t,n,o,r,i,a){try{var c=e[i](a),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(o,r)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var i=e.apply(t,n);function a(e){m(i,o,r,a,c,"next",e)}function c(e){m(i,o,r,a,c,"throw",e)}a(void 0)})}}function b(e,t,n){return(b=h()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&v(r,n.prototype),r}).apply(null,arguments)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return b(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)})(e)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function g(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&u[0]?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,o=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){a.label=u[1];break}if(6===u[0]&&a.label<r[1]){a.label=r[1],r=u;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(u);break}r[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],o=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var P=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=y(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,h()?Reflect.construct(e,t||[],y(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&v(n,e),t=[{key:"afterAdd",value:function(){return d(function(){return g(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return d(function(){return g(this,function(e){return[2]})})()}},{key:"load",value:function(){var e=this;return d(function(){return g(this,function(t){return e.aiPlugin.aiManager.registerLLMProvider("gigachat",f),[2]})})()}},{key:"aiPlugin",get:function(){return this.app.pm.get("ai")}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(x(e.Plugin)),I=P}(),l}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.0.
|
|
12
|
-
"@nocobase/plugin-ai": "2.0.
|
|
13
|
-
"@nocobase/server": "2.0.
|
|
11
|
+
"@nocobase/client": "2.0.5",
|
|
12
|
+
"@nocobase/plugin-ai": "2.0.5",
|
|
13
|
+
"@nocobase/server": "2.0.5",
|
|
14
14
|
"react": "18.2.0",
|
|
15
|
-
"@nocobase/utils": "2.0.
|
|
15
|
+
"@nocobase/utils": "2.0.5",
|
|
16
16
|
"antd": "5.24.2",
|
|
17
|
-
"@nocobase/plugin-workflow": "2.0.
|
|
17
|
+
"@nocobase/plugin-workflow": "2.0.5"
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"gigachat","version":"0.0.15","description":"The official TypeScript library for the GigaChat API","types":"./index.d.ts","main":"./index.js","type":"commonjs","repository":"github:ai-forever/gigachat-js","scripts":{"format":"prettier --write --cache --cache-strategy metadata . !dist","lint":"./scripts/lint","fix":"./scripts/format","build":"./scripts/build"},"private":false,"keywords":[],"author":"","license":"ISC","dependencies":{"axios":"^1.8.2","uuid":"^11.0.3"},"imports":{"gigachat":".","gigachat/*":"./src/*"},"exports":{".":{"require":{"types":"./index.d.ts","default":"./index.js"},"types":"./index.d.mts","default":"./index.mjs"},"./*.mjs":{"types":"./*.d.ts","default":"./*.mjs"},"./*.js":{"types":"./*.d.ts","default":"./*.js"},"./interfaces/*":{"types":"./interfaces/*.d.ts","require":"./interfaces/*.js","default":"./interfaces/*.mjs"},"./interfaces":{"types":"./interfaces/index.d.ts","require":"./interfaces/index.js","default":"./interfaces/index.mjs"},"./*":{"types":"./*.d.ts","require":"./*.js","default":"./*.mjs"}},"_lastModified":"2026-02-
|
|
1
|
+
{"name":"gigachat","version":"0.0.15","description":"The official TypeScript library for the GigaChat API","types":"./index.d.ts","main":"./index.js","type":"commonjs","repository":"github:ai-forever/gigachat-js","scripts":{"format":"prettier --write --cache --cache-strategy metadata . !dist","lint":"./scripts/lint","fix":"./scripts/format","build":"./scripts/build"},"private":false,"keywords":[],"author":"","license":"ISC","dependencies":{"axios":"^1.8.2","uuid":"^11.0.3"},"imports":{"gigachat":".","gigachat/*":"./src/*"},"exports":{".":{"require":{"types":"./index.d.ts","default":"./index.js"},"types":"./index.d.mts","default":"./index.mjs"},"./*.mjs":{"types":"./*.d.ts","default":"./*.mjs"},"./*.js":{"types":"./*.d.ts","default":"./*.js"},"./interfaces/*":{"types":"./interfaces/*.d.ts","require":"./interfaces/*.js","default":"./interfaces/*.mjs"},"./interfaces":{"types":"./interfaces/index.d.ts","require":"./interfaces/index.js","default":"./interfaces/index.mjs"},"./*":{"types":"./*.d.ts","require":"./*.js","default":"./*.mjs"}},"_lastModified":"2026-02-25T16:53:07.029Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"langchain-gigachat","version":"0.0.14","description":"GigaChat integration for LangChain.js","type":"module","engines":{"node":">=18"},"main":"./index.js","types":"./index.d.ts","repository":{"type":"git","url":"https://github.com/ai-forever/langchainjs/tree/main/libs/langchain-gigachat"},"packageManager":"yarn@3.4.1","homepage":"https://github.com/ai-forever/langchainjs/tree/main/libs/langchain-gigachat","scripts":{"build":"yarn turbo:command build:internal --filter=langchain-gigachat","build:internal":"yarn lc_build --create-entrypoints --pre --tree-shaking","lint:eslint":"NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/","lint:dpdm":"dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts","lint":"yarn lint:eslint && yarn lint:dpdm","lint:fix":"yarn lint:eslint --fix && yarn lint:dpdm","clean":"rm -rf .turbo dist/","prepack":"yarn build","test":"NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%","test:watch":"NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts","test:single":"NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000","test:int":"NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%","format":"prettier --config .prettierrc --write \"src\"","format:check":"prettier --config .prettierrc --check \"src\""},"author":"Mikelarg","license":"MIT","keywords":["llm","ai","gpt3","chain","prompt","prompt engineering","gigachat","machine learning","ml","embeddings","vectorstores"],"dependencies":{"gigachat":"^0.0.15","uuid":"^11.0.5","zod":"^3.23.8","zod-to-json-schema":"^3.23.5"},"peerDependencies":{"@langchain/core":">=0.2.21 <0.4.0"},"devDependencies":{"@jest/globals":"^29.5.0","@langchain/core":"workspace:*","@langchain/scripts":">=0.1.0 <0.2.0","@swc/core":"^1.3.90","@swc/jest":"^0.2.29","@tsconfig/recommended":"^1.0.3","@typescript-eslint/eslint-plugin":"^6.12.0","@typescript-eslint/parser":"^6.12.0","dotenv":"^16.3.1","dpdm":"^3.12.0","eslint":"^8.33.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.6.0","eslint-plugin-import":"^2.27.5","eslint-plugin-no-instanceof":"^1.0.1","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-environment-node":"^29.6.4","prettier":"^2.8.3","release-it":"^15.10.1","rollup":"4.22.4","ts-jest":"^29.1.0","turbo":"^2.3.2","typescript":"<5.2.0"},"publishConfig":{"access":"public"},"exports":{"./chat_models":{"types":{"import":"./chat_models.d.ts","require":"./chat_models.d.cts","default":"./chat_models.d.ts"},"import":"./chat_models.js","require":"./chat_models.cjs"},"./embeddings":{"types":{"import":"./embeddings.d.ts","require":"./embeddings.d.cts","default":"./embeddings.d.ts"},"import":"./embeddings.js","require":"./embeddings.cjs"},".":{"types":{"import":"./index.d.ts","require":"./index.d.cts","default":"./index.d.ts"},"import":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"files":["dist/","chat_models.cjs","chat_models.js","chat_models.d.ts","chat_models.d.cts","embeddings.cjs","embeddings.js","embeddings.d.ts","embeddings.d.cts","index.cjs","index.js","index.d.ts","index.d.cts"],"_lastModified":"2026-02-
|
|
1
|
+
{"name":"langchain-gigachat","version":"0.0.14","description":"GigaChat integration for LangChain.js","type":"module","engines":{"node":">=18"},"main":"./index.js","types":"./index.d.ts","repository":{"type":"git","url":"https://github.com/ai-forever/langchainjs/tree/main/libs/langchain-gigachat"},"packageManager":"yarn@3.4.1","homepage":"https://github.com/ai-forever/langchainjs/tree/main/libs/langchain-gigachat","scripts":{"build":"yarn turbo:command build:internal --filter=langchain-gigachat","build:internal":"yarn lc_build --create-entrypoints --pre --tree-shaking","lint:eslint":"NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/","lint:dpdm":"dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts","lint":"yarn lint:eslint && yarn lint:dpdm","lint:fix":"yarn lint:eslint --fix && yarn lint:dpdm","clean":"rm -rf .turbo dist/","prepack":"yarn build","test":"NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%","test:watch":"NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts","test:single":"NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000","test:int":"NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%","format":"prettier --config .prettierrc --write \"src\"","format:check":"prettier --config .prettierrc --check \"src\""},"author":"Mikelarg","license":"MIT","keywords":["llm","ai","gpt3","chain","prompt","prompt engineering","gigachat","machine learning","ml","embeddings","vectorstores"],"dependencies":{"gigachat":"^0.0.15","uuid":"^11.0.5","zod":"^3.23.8","zod-to-json-schema":"^3.23.5"},"peerDependencies":{"@langchain/core":">=0.2.21 <0.4.0"},"devDependencies":{"@jest/globals":"^29.5.0","@langchain/core":"workspace:*","@langchain/scripts":">=0.1.0 <0.2.0","@swc/core":"^1.3.90","@swc/jest":"^0.2.29","@tsconfig/recommended":"^1.0.3","@typescript-eslint/eslint-plugin":"^6.12.0","@typescript-eslint/parser":"^6.12.0","dotenv":"^16.3.1","dpdm":"^3.12.0","eslint":"^8.33.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.6.0","eslint-plugin-import":"^2.27.5","eslint-plugin-no-instanceof":"^1.0.1","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-environment-node":"^29.6.4","prettier":"^2.8.3","release-it":"^15.10.1","rollup":"4.22.4","ts-jest":"^29.1.0","turbo":"^2.3.2","typescript":"<5.2.0"},"publishConfig":{"access":"public"},"exports":{"./chat_models":{"types":{"import":"./chat_models.d.ts","require":"./chat_models.d.cts","default":"./chat_models.d.ts"},"import":"./chat_models.js","require":"./chat_models.cjs"},"./embeddings":{"types":{"import":"./embeddings.d.ts","require":"./embeddings.d.cts","default":"./embeddings.d.ts"},"import":"./embeddings.js","require":"./embeddings.cjs"},".":{"types":{"import":"./index.d.ts","require":"./index.d.cts","default":"./index.d.ts"},"import":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"files":["dist/","chat_models.cjs","chat_models.js","chat_models.d.ts","chat_models.d.cts","embeddings.cjs","embeddings.js","embeddings.d.ts","embeddings.d.cts","index.cjs","index.js","index.d.ts","index.d.cts"],"_lastModified":"2026-02-25T16:53:10.530Z"}
|
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { GigaChat as GigaChatModel } from 'langchain-gigachat';
|
|
10
10
|
import { LLMProvider, LLMProviderMeta } from '@nocobase/plugin-ai';
|
|
11
|
+
declare class GigaChatModelInternal extends GigaChatModel {
|
|
12
|
+
bindTools(tools: any, kwargs: any): import("@langchain/core/dist/runnables/base").Runnable<import("@langchain/core/dist/language_models/base").BaseLanguageModelInput, import("@langchain/core/dist/messages/ai").AIMessageChunk<import("@langchain/core/dist/messages/message").MessageStructure<import("@langchain/core/dist/messages/message").MessageToolSet>>, import("langchain-gigachat").GigaChatCallOptions>;
|
|
13
|
+
}
|
|
11
14
|
export declare class GigaChatProvider extends LLMProvider {
|
|
12
|
-
createModel():
|
|
15
|
+
createModel(): GigaChatModelInternal;
|
|
13
16
|
listModels(): Promise<{
|
|
14
17
|
models?: {
|
|
15
18
|
id: string;
|
|
@@ -20,5 +23,7 @@ export declare class GigaChatProvider extends LLMProvider {
|
|
|
20
23
|
get baseURL(): string;
|
|
21
24
|
get authURL(): string;
|
|
22
25
|
private isUrlEmpty;
|
|
26
|
+
parseResponseError(err: any): any;
|
|
23
27
|
}
|
|
24
28
|
export declare const gigaChatProviderOptions: LLMProviderMeta;
|
|
29
|
+
export {};
|
|
@@ -44,16 +44,31 @@ var import_node_https = require("node:https");
|
|
|
44
44
|
var import_gigachat = __toESM(require("gigachat"));
|
|
45
45
|
var import_langchain_gigachat = require("langchain-gigachat");
|
|
46
46
|
var import_plugin_ai = require("@nocobase/plugin-ai");
|
|
47
|
+
class GigaChatModelInternal extends import_langchain_gigachat.GigaChat {
|
|
48
|
+
bindTools(tools, kwargs) {
|
|
49
|
+
return this.withConfig({
|
|
50
|
+
tools: tools == null ? void 0 : tools.map((t) => {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
return {
|
|
53
|
+
name: t.name,
|
|
54
|
+
description: t.description,
|
|
55
|
+
parameters: ((_b = (_a = t.schema).toJSONSchema) == null ? void 0 : _b.call(_a)) ?? t.schema
|
|
56
|
+
};
|
|
57
|
+
}),
|
|
58
|
+
...kwargs
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
47
62
|
class GigaChatProvider extends import_plugin_ai.LLMProvider {
|
|
48
63
|
createModel() {
|
|
49
|
-
const { credentials, baseURL, authURL, scope, enableSSL } = this.serviceOptions || {};
|
|
64
|
+
const { apiKey: credentials, baseURL, authURL, scope, enableSSL } = this.serviceOptions || {};
|
|
50
65
|
const { responseFormat } = this.modelOptions || {};
|
|
51
66
|
const baseUrl = this.isUrlEmpty(baseURL) ? this.baseURL : baseURL;
|
|
52
67
|
const authUrl = this.isUrlEmpty(authURL) ? this.authURL : authURL;
|
|
53
68
|
const httpsAgent = new import_node_https.Agent({
|
|
54
69
|
rejectUnauthorized: enableSSL ?? false
|
|
55
70
|
});
|
|
56
|
-
return new
|
|
71
|
+
return new GigaChatModelInternal({
|
|
57
72
|
credentials,
|
|
58
73
|
baseUrl,
|
|
59
74
|
authUrl,
|
|
@@ -69,7 +84,13 @@ class GigaChatProvider extends import_plugin_ai.LLMProvider {
|
|
|
69
84
|
}
|
|
70
85
|
async listModels() {
|
|
71
86
|
try {
|
|
72
|
-
const {
|
|
87
|
+
const {
|
|
88
|
+
apiKey: credentials,
|
|
89
|
+
baseURL,
|
|
90
|
+
authURL,
|
|
91
|
+
scope,
|
|
92
|
+
enableSSL
|
|
93
|
+
} = this.serviceOptions || {};
|
|
73
94
|
const baseUrl = this.isUrlEmpty(baseURL) ? this.baseURL : baseURL;
|
|
74
95
|
const authUrl = this.isUrlEmpty(authURL) ? this.authURL : authURL;
|
|
75
96
|
const httpsAgent = new import_node_https.Agent({
|
|
@@ -97,6 +118,13 @@ class GigaChatProvider extends import_plugin_ai.LLMProvider {
|
|
|
97
118
|
isUrlEmpty(baseURL) {
|
|
98
119
|
return !baseURL || baseURL === null || baseURL.trim().length === 0;
|
|
99
120
|
}
|
|
121
|
+
parseResponseError(err) {
|
|
122
|
+
var _a, _b;
|
|
123
|
+
if ((err == null ? void 0 : err.name) === "AuthenticationError" || (err == null ? void 0 : err.name) === "ResponseError") {
|
|
124
|
+
return `GigaChat service error: ${(_a = err.response) == null ? void 0 : _a.status} ${(_b = err.response) == null ? void 0 : _b.statusText}`;
|
|
125
|
+
}
|
|
126
|
+
return (err == null ? void 0 : err.message) ?? "Unexpected LLM service error";
|
|
127
|
+
}
|
|
100
128
|
}
|
|
101
129
|
const gigaChatProviderOptions = {
|
|
102
130
|
title: "GigaChat",
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "AI LLM:GigaChat",
|
|
5
5
|
"description": "Support integration with GigaChat LLM service.",
|
|
6
6
|
"description.zh-CN": "支持接入 GigaChat LLM 服务。",
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.5",
|
|
8
8
|
"main": "dist/server/index.js",
|
|
9
9
|
"nocobase": {
|
|
10
10
|
"supportedVersions": [
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"langchain-gigachat": "^0.0.14"
|
|
23
23
|
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"AI"
|
|
26
|
+
],
|
|
24
27
|
"license": "Apache-2.0",
|
|
25
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "9073a2c814ed9a703a6adb0dd3da34eb0d0b7e9b"
|
|
26
29
|
}
|