@theia/ai-huggingface 1.57.1 → 1.58.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.
@@ -1 +1 @@
1
- {"version":3,"file":"huggingface-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/huggingface-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAK/D,eAAO,MAAM,uBAAuB,eAAoC,CAAC;;AAEzE,wBAMG"}
1
+ {"version":3,"file":"huggingface-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/huggingface-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAM/D,eAAO,MAAM,uBAAuB,eAAoC,CAAC;;AAWzE,wBAEG"}
@@ -19,11 +19,16 @@ exports.HuggingFaceModelFactory = void 0;
19
19
  const inversify_1 = require("@theia/core/shared/inversify");
20
20
  const huggingface_language_models_manager_1 = require("../common/huggingface-language-models-manager");
21
21
  const core_1 = require("@theia/core");
22
+ const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
22
23
  const huggingface_language_models_manager_impl_1 = require("./huggingface-language-models-manager-impl");
23
24
  exports.HuggingFaceModelFactory = Symbol('HuggingFaceModelFactory');
24
- exports.default = new inversify_1.ContainerModule(bind => {
25
+ // We use a connection module to handle AI services separately for each frontend.
26
+ const huggingfaceConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService, bindFrontendService }) => {
25
27
  bind(huggingface_language_models_manager_impl_1.HuggingFaceLanguageModelsManagerImpl).toSelf().inSingletonScope();
26
28
  bind(huggingface_language_models_manager_1.HuggingFaceLanguageModelsManager).toService(huggingface_language_models_manager_impl_1.HuggingFaceLanguageModelsManagerImpl);
27
29
  bind(core_1.ConnectionHandler).toDynamicValue(ctx => new core_1.RpcConnectionHandler(huggingface_language_models_manager_1.HUGGINGFACE_LANGUAGE_MODELS_MANAGER_PATH, () => ctx.container.get(huggingface_language_models_manager_1.HuggingFaceLanguageModelsManager))).inSingletonScope();
28
30
  });
31
+ exports.default = new inversify_1.ContainerModule(bind => {
32
+ bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(huggingfaceConnectionModule);
33
+ });
29
34
  //# sourceMappingURL=huggingface-backend-module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"huggingface-backend-module.js","sourceRoot":"","sources":["../../src/node/huggingface-backend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,4DAA+D;AAC/D,uGAA2I;AAC3I,sCAAsE;AACtE,yGAAkG;AAErF,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAEzE,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,+EAAoC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACvE,IAAI,CAAC,sEAAgC,CAAC,CAAC,SAAS,CAAC,+EAAoC,CAAC,CAAC;IACvF,IAAI,CAAC,wBAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACzC,IAAI,2BAAoB,CAAC,8EAAwC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,sEAAgC,CAAC,CAAC,CAChI,CAAC,gBAAgB,EAAE,CAAC;AACzB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"huggingface-backend-module.js","sourceRoot":"","sources":["../../src/node/huggingface-backend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,4DAA+D;AAC/D,uGAA2I;AAC3I,sCAAsE;AACtE,4GAAuG;AACvG,yGAAkG;AAErF,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAEzE,iFAAiF;AACjF,MAAM,2BAA2B,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,EAAE,EAAE;IACvH,IAAI,CAAC,+EAAoC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACvE,IAAI,CAAC,sEAAgC,CAAC,CAAC,SAAS,CAAC,+EAAoC,CAAC,CAAC;IACvF,IAAI,CAAC,wBAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACzC,IAAI,2BAAoB,CAAC,8EAAwC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,sEAAgC,CAAC,CAAC,CAChI,CAAC,gBAAgB,EAAE,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,2BAA2B,CAAC,CAAC;AACjF,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@theia/ai-huggingface",
3
- "version": "1.57.1",
3
+ "version": "1.58.1",
4
4
  "description": "Theia - Hugging Face Integration",
5
5
  "dependencies": {
6
6
  "@huggingface/inference": "^2.0.0",
7
- "@theia/ai-core": "1.57.1",
8
- "@theia/core": "1.57.1"
7
+ "@theia/ai-core": "1.58.1",
8
+ "@theia/core": "1.58.1"
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public"
@@ -41,10 +41,10 @@
41
41
  "watch": "theiaext watch"
42
42
  },
43
43
  "devDependencies": {
44
- "@theia/ext-scripts": "1.57.1"
44
+ "@theia/ext-scripts": "1.58.1"
45
45
  },
46
46
  "nyc": {
47
47
  "extends": "../../configs/nyc.json"
48
48
  },
49
- "gitHead": "6e84ac8d37bbeb45f999894e80cb92a761c1ee1e"
49
+ "gitHead": "39f65022e1a40b95e4c1972d6cd3c7bf896187ce"
50
50
  }
@@ -17,14 +17,20 @@
17
17
  import { ContainerModule } from '@theia/core/shared/inversify';
18
18
  import { HUGGINGFACE_LANGUAGE_MODELS_MANAGER_PATH, HuggingFaceLanguageModelsManager } from '../common/huggingface-language-models-manager';
19
19
  import { ConnectionHandler, RpcConnectionHandler } from '@theia/core';
20
+ import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
20
21
  import { HuggingFaceLanguageModelsManagerImpl } from './huggingface-language-models-manager-impl';
21
22
 
22
23
  export const HuggingFaceModelFactory = Symbol('HuggingFaceModelFactory');
23
24
 
24
- export default new ContainerModule(bind => {
25
+ // We use a connection module to handle AI services separately for each frontend.
26
+ const huggingfaceConnectionModule = ConnectionContainerModule.create(({ bind, bindBackendService, bindFrontendService }) => {
25
27
  bind(HuggingFaceLanguageModelsManagerImpl).toSelf().inSingletonScope();
26
28
  bind(HuggingFaceLanguageModelsManager).toService(HuggingFaceLanguageModelsManagerImpl);
27
29
  bind(ConnectionHandler).toDynamicValue(ctx =>
28
30
  new RpcConnectionHandler(HUGGINGFACE_LANGUAGE_MODELS_MANAGER_PATH, () => ctx.container.get(HuggingFaceLanguageModelsManager))
29
31
  ).inSingletonScope();
30
32
  });
33
+
34
+ export default new ContainerModule(bind => {
35
+ bind(ConnectionContainerModule).toConstantValue(huggingfaceConnectionModule);
36
+ });