@theia/ai-openai 1.67.0-next.13 → 1.67.0-next.56

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 (55) hide show
  1. package/README.md +1 -0
  2. package/package.json +6 -6
  3. package/src/common/openai-preferences.ts +4 -10
  4. package/lib/browser/openai-frontend-application-contribution.d.ts +0 -18
  5. package/lib/browser/openai-frontend-application-contribution.d.ts.map +0 -1
  6. package/lib/browser/openai-frontend-application-contribution.js +0 -163
  7. package/lib/browser/openai-frontend-application-contribution.js.map +0 -1
  8. package/lib/browser/openai-frontend-module.d.ts +0 -4
  9. package/lib/browser/openai-frontend-module.d.ts.map +0 -1
  10. package/lib/browser/openai-frontend-module.js +0 -33
  11. package/lib/browser/openai-frontend-module.js.map +0 -1
  12. package/lib/common/index.d.ts +0 -2
  13. package/lib/common/index.d.ts.map +0 -1
  14. package/lib/common/index.js +0 -20
  15. package/lib/common/index.js.map +0 -1
  16. package/lib/common/openai-language-models-manager.d.ts +0 -63
  17. package/lib/common/openai-language-models-manager.d.ts.map +0 -1
  18. package/lib/common/openai-language-models-manager.js +0 -22
  19. package/lib/common/openai-language-models-manager.js.map +0 -1
  20. package/lib/common/openai-preferences.d.ts +0 -7
  21. package/lib/common/openai-preferences.d.ts.map +0 -1
  22. package/lib/common/openai-preferences.js +0 -147
  23. package/lib/common/openai-preferences.js.map +0 -1
  24. package/lib/node/openai-backend-module.d.ts +0 -5
  25. package/lib/node/openai-backend-module.d.ts.map +0 -1
  26. package/lib/node/openai-backend-module.js +0 -40
  27. package/lib/node/openai-backend-module.js.map +0 -1
  28. package/lib/node/openai-language-model.d.ts +0 -80
  29. package/lib/node/openai-language-model.d.ts.map +0 -1
  30. package/lib/node/openai-language-model.js +0 -324
  31. package/lib/node/openai-language-model.js.map +0 -1
  32. package/lib/node/openai-language-models-manager-impl.d.ts +0 -22
  33. package/lib/node/openai-language-models-manager-impl.d.ts.map +0 -1
  34. package/lib/node/openai-language-models-manager-impl.js +0 -162
  35. package/lib/node/openai-language-models-manager-impl.js.map +0 -1
  36. package/lib/node/openai-model-utils.spec.d.ts +0 -2
  37. package/lib/node/openai-model-utils.spec.d.ts.map +0 -1
  38. package/lib/node/openai-model-utils.spec.js +0 -467
  39. package/lib/node/openai-model-utils.spec.js.map +0 -1
  40. package/lib/node/openai-request-api-context.d.ts +0 -4
  41. package/lib/node/openai-request-api-context.d.ts.map +0 -1
  42. package/lib/node/openai-request-api-context.js +0 -18
  43. package/lib/node/openai-request-api-context.js.map +0 -1
  44. package/lib/node/openai-response-api-utils.d.ts +0 -45
  45. package/lib/node/openai-response-api-utils.d.ts.map +0 -1
  46. package/lib/node/openai-response-api-utils.js +0 -724
  47. package/lib/node/openai-response-api-utils.js.map +0 -1
  48. package/lib/node/openai-streaming-iterator.d.ts +0 -24
  49. package/lib/node/openai-streaming-iterator.d.ts.map +0 -1
  50. package/lib/node/openai-streaming-iterator.js +0 -176
  51. package/lib/node/openai-streaming-iterator.js.map +0 -1
  52. package/lib/node/openai-streaming-iterator.spec.d.ts +0 -2
  53. package/lib/node/openai-streaming-iterator.spec.d.ts.map +0 -1
  54. package/lib/node/openai-streaming-iterator.spec.js +0 -207
  55. package/lib/node/openai-streaming-iterator.spec.js.map +0 -1
package/README.md CHANGED
@@ -92,6 +92,7 @@ path and without the `api-version` parameter, e.g. _`https://<my_prefix>.openai.
92
92
 
93
93
  ## Additional Information
94
94
 
95
+ - [API documentation for `@theia/ai-openai`](https://eclipse-theia.github.io/theia/docs/next/modules/_theia_ai-openai.html)
95
96
  - [Theia - GitHub](https://github.com/eclipse-theia/theia)
96
97
  - [Theia - Website](https://theia-ide.org/)
97
98
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@theia/ai-openai",
3
- "version": "1.67.0-next.13+c409d5d18",
3
+ "version": "1.67.0-next.56+d8f18cc386c",
4
4
  "description": "Theia - OpenAI Integration",
5
5
  "dependencies": {
6
- "@theia/ai-core": "1.67.0-next.13+c409d5d18",
7
- "@theia/core": "1.67.0-next.13+c409d5d18",
8
- "@theia/filesystem": "1.67.0-next.13+c409d5d18",
9
- "@theia/workspace": "1.67.0-next.13+c409d5d18",
6
+ "@theia/ai-core": "1.67.0-next.56+d8f18cc386c",
7
+ "@theia/core": "1.67.0-next.56+d8f18cc386c",
8
+ "@theia/filesystem": "1.67.0-next.56+d8f18cc386c",
9
+ "@theia/workspace": "1.67.0-next.56+d8f18cc386c",
10
10
  "openai": "^6.3.0",
11
11
  "tslib": "^2.6.2",
12
12
  "undici": "^7.16.0"
@@ -50,5 +50,5 @@
50
50
  "nyc": {
51
51
  "extends": "../../configs/nyc.json"
52
52
  },
53
- "gitHead": "c409d5d18d8c4f5a722f87b37ea9d6fd5af47ea8"
53
+ "gitHead": "d8f18cc386c45a736cd193d42eab02c8f64c6b10"
54
54
  }
@@ -36,18 +36,12 @@ on the machine running Theia. Use the environment variable `OPENAI_API_KEY` to s
36
36
  description: nls.localize('theia/ai/openai/models/description', 'Official OpenAI models to use'),
37
37
  title: AI_CORE_PREFERENCES_TITLE,
38
38
  default: [
39
- 'gpt-4o',
40
- 'gpt-4.1',
41
- 'gpt-4.1-nano',
42
- 'gpt-4.1-mini',
43
- 'gpt-4o-mini',
44
- 'o3',
45
- 'o3-mini',
46
- 'o4-mini',
47
- 'o4-mini-high',
39
+ 'gpt-5.1',
48
40
  'gpt-5',
49
41
  'gpt-5-mini',
50
- 'gpt-5-nano'
42
+ 'gpt-4.1',
43
+ 'gpt-4.1-mini',
44
+ 'gpt-4o'
51
45
  ],
52
46
  items: {
53
47
  type: 'string'
@@ -1,18 +0,0 @@
1
- import { FrontendApplicationContribution } from '@theia/core/lib/browser';
2
- import { OpenAiLanguageModelsManager, OpenAiModelDescription } from '../common';
3
- import { AICorePreferences } from '@theia/ai-core/lib/common/ai-core-preferences';
4
- import { PreferenceService } from '@theia/core';
5
- export declare class OpenAiFrontendApplicationContribution implements FrontendApplicationContribution {
6
- protected preferenceService: PreferenceService;
7
- protected manager: OpenAiLanguageModelsManager;
8
- protected aiCorePreferences: AICorePreferences;
9
- protected prevModels: string[];
10
- protected prevCustomModels: Partial<OpenAiModelDescription>[];
11
- onStart(): void;
12
- protected handleModelChanges(newModels: string[]): void;
13
- protected handleCustomModelChanges(newCustomModels: Partial<OpenAiModelDescription>[]): void;
14
- protected updateAllModels(): void;
15
- protected createOpenAIModelDescription(modelId: string): OpenAiModelDescription;
16
- protected createCustomModelDescriptionsFromPreferences(preferences: Partial<OpenAiModelDescription>[]): OpenAiModelDescription[];
17
- }
18
- //# sourceMappingURL=openai-frontend-application-contribution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openai-frontend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/openai-frontend-application-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAsB,MAAM,WAAW,CAAC;AAEpG,OAAO,EAAE,iBAAiB,EAA+B,MAAM,+CAA+C,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,qBACa,qCAAsC,YAAW,+BAA+B;IAGzF,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAG/C,SAAS,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAG/C,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,CAAM;IACpC,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC,sBAAsB,CAAC,EAAE,CAAM;IAEnE,OAAO,IAAI,IAAI;IAuCf,SAAS,CAAC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAYvD,SAAS,CAAC,wBAAwB,CAAC,eAAe,EAAE,OAAO,CAAC,sBAAsB,CAAC,EAAE,GAAG,IAAI;IAuB5F,SAAS,CAAC,eAAe,IAAI,IAAI;IAQjC,SAAS,CAAC,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB;IAiB/E,SAAS,CAAC,4CAA4C,CAClD,WAAW,EAAE,OAAO,CAAC,sBAAsB,CAAC,EAAE,GAC/C,sBAAsB,EAAE;CAyB9B"}
@@ -1,163 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2024 EclipseSource GmbH.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.OpenAiFrontendApplicationContribution = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const common_1 = require("../common");
22
- const openai_preferences_1 = require("../common/openai-preferences");
23
- const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
24
- const core_1 = require("@theia/core");
25
- let OpenAiFrontendApplicationContribution = class OpenAiFrontendApplicationContribution {
26
- constructor() {
27
- this.prevModels = [];
28
- this.prevCustomModels = [];
29
- }
30
- onStart() {
31
- this.preferenceService.ready.then(() => {
32
- const apiKey = this.preferenceService.get(openai_preferences_1.API_KEY_PREF, undefined);
33
- this.manager.setApiKey(apiKey);
34
- const proxyUri = this.preferenceService.get('http.proxy', undefined);
35
- this.manager.setProxyUrl(proxyUri);
36
- const models = this.preferenceService.get(openai_preferences_1.MODELS_PREF, []);
37
- this.manager.createOrUpdateLanguageModels(...models.map(modelId => this.createOpenAIModelDescription(modelId)));
38
- this.prevModels = [...models];
39
- const customModels = this.preferenceService.get(openai_preferences_1.CUSTOM_ENDPOINTS_PREF, []);
40
- this.manager.createOrUpdateLanguageModels(...this.createCustomModelDescriptionsFromPreferences(customModels));
41
- this.prevCustomModels = [...customModels];
42
- this.preferenceService.onPreferenceChanged(event => {
43
- if (event.preferenceName === openai_preferences_1.API_KEY_PREF) {
44
- this.manager.setApiKey(event.newValue);
45
- this.updateAllModels();
46
- }
47
- else if (event.preferenceName === openai_preferences_1.MODELS_PREF) {
48
- this.handleModelChanges(event.newValue);
49
- }
50
- else if (event.preferenceName === openai_preferences_1.CUSTOM_ENDPOINTS_PREF) {
51
- this.handleCustomModelChanges(event.newValue);
52
- }
53
- else if (event.preferenceName === openai_preferences_1.USE_RESPONSE_API_PREF) {
54
- this.updateAllModels();
55
- }
56
- else if (event.preferenceName === 'http.proxy') {
57
- this.manager.setProxyUrl(event.newValue);
58
- }
59
- });
60
- this.aiCorePreferences.onPreferenceChanged(event => {
61
- if (event.preferenceName === ai_core_preferences_1.PREFERENCE_NAME_MAX_RETRIES) {
62
- this.updateAllModels();
63
- }
64
- });
65
- });
66
- }
67
- handleModelChanges(newModels) {
68
- const oldModels = new Set(this.prevModels);
69
- const updatedModels = new Set(newModels);
70
- const modelsToRemove = [...oldModels].filter(model => !updatedModels.has(model));
71
- const modelsToAdd = [...updatedModels].filter(model => !oldModels.has(model));
72
- this.manager.removeLanguageModels(...modelsToRemove.map(model => `openai/${model}`));
73
- this.manager.createOrUpdateLanguageModels(...modelsToAdd.map(modelId => this.createOpenAIModelDescription(modelId)));
74
- this.prevModels = newModels;
75
- }
76
- handleCustomModelChanges(newCustomModels) {
77
- const oldModels = this.createCustomModelDescriptionsFromPreferences(this.prevCustomModels);
78
- const newModels = this.createCustomModelDescriptionsFromPreferences(newCustomModels);
79
- const modelsToRemove = oldModels.filter(model => !newModels.some(newModel => newModel.id === model.id));
80
- const modelsToAddOrUpdate = newModels.filter(newModel => !oldModels.some(model => model.id === newModel.id &&
81
- model.model === newModel.model &&
82
- model.url === newModel.url &&
83
- model.deployment === newModel.deployment &&
84
- model.apiKey === newModel.apiKey &&
85
- model.apiVersion === newModel.apiVersion &&
86
- model.developerMessageSettings === newModel.developerMessageSettings &&
87
- model.supportsStructuredOutput === newModel.supportsStructuredOutput &&
88
- model.enableStreaming === newModel.enableStreaming &&
89
- model.useResponseApi === newModel.useResponseApi));
90
- this.manager.removeLanguageModels(...modelsToRemove.map(model => model.id));
91
- this.manager.createOrUpdateLanguageModels(...modelsToAddOrUpdate);
92
- this.prevCustomModels = [...newCustomModels];
93
- }
94
- updateAllModels() {
95
- const models = this.preferenceService.get(openai_preferences_1.MODELS_PREF, []);
96
- this.manager.createOrUpdateLanguageModels(...models.map(modelId => this.createOpenAIModelDescription(modelId)));
97
- const customModels = this.preferenceService.get(openai_preferences_1.CUSTOM_ENDPOINTS_PREF, []);
98
- this.manager.createOrUpdateLanguageModels(...this.createCustomModelDescriptionsFromPreferences(customModels));
99
- }
100
- createOpenAIModelDescription(modelId) {
101
- var _a;
102
- const id = `${common_1.OPENAI_PROVIDER_ID}/${modelId}`;
103
- const maxRetries = (_a = this.aiCorePreferences.get(ai_core_preferences_1.PREFERENCE_NAME_MAX_RETRIES)) !== null && _a !== void 0 ? _a : 3;
104
- const useResponseApi = this.preferenceService.get(openai_preferences_1.USE_RESPONSE_API_PREF, false);
105
- return {
106
- id: id,
107
- model: modelId,
108
- apiKey: true,
109
- apiVersion: true,
110
- developerMessageSettings: openAIModelsNotSupportingDeveloperMessages.includes(modelId) ? 'user' : 'developer',
111
- enableStreaming: !openAIModelsWithDisabledStreaming.includes(modelId),
112
- supportsStructuredOutput: !openAIModelsWithoutStructuredOutput.includes(modelId),
113
- maxRetries: maxRetries,
114
- useResponseApi: useResponseApi
115
- };
116
- }
117
- createCustomModelDescriptionsFromPreferences(preferences) {
118
- var _a;
119
- const maxRetries = (_a = this.aiCorePreferences.get(ai_core_preferences_1.PREFERENCE_NAME_MAX_RETRIES)) !== null && _a !== void 0 ? _a : 3;
120
- return preferences.reduce((acc, pref) => {
121
- var _a, _b, _c, _d, _e;
122
- if (!pref.model || !pref.url || typeof pref.model !== 'string' || typeof pref.url !== 'string') {
123
- return acc;
124
- }
125
- return [
126
- ...acc,
127
- {
128
- id: pref.id && typeof pref.id === 'string' ? pref.id : pref.model,
129
- model: pref.model,
130
- url: pref.url,
131
- deployment: typeof pref.deployment === 'string' && pref.deployment ? pref.deployment : undefined,
132
- apiKey: typeof pref.apiKey === 'string' || pref.apiKey === true ? pref.apiKey : undefined,
133
- apiVersion: typeof pref.apiVersion === 'string' || pref.apiVersion === true ? pref.apiVersion : undefined,
134
- developerMessageSettings: (_a = pref.developerMessageSettings) !== null && _a !== void 0 ? _a : 'developer',
135
- supportsStructuredOutput: (_b = pref.supportsStructuredOutput) !== null && _b !== void 0 ? _b : true,
136
- enableStreaming: (_c = pref.enableStreaming) !== null && _c !== void 0 ? _c : true,
137
- maxRetries: (_d = pref.maxRetries) !== null && _d !== void 0 ? _d : maxRetries,
138
- useResponseApi: (_e = pref.useResponseApi) !== null && _e !== void 0 ? _e : false
139
- }
140
- ];
141
- }, []);
142
- }
143
- };
144
- exports.OpenAiFrontendApplicationContribution = OpenAiFrontendApplicationContribution;
145
- tslib_1.__decorate([
146
- (0, inversify_1.inject)(core_1.PreferenceService),
147
- tslib_1.__metadata("design:type", Object)
148
- ], OpenAiFrontendApplicationContribution.prototype, "preferenceService", void 0);
149
- tslib_1.__decorate([
150
- (0, inversify_1.inject)(common_1.OpenAiLanguageModelsManager),
151
- tslib_1.__metadata("design:type", Object)
152
- ], OpenAiFrontendApplicationContribution.prototype, "manager", void 0);
153
- tslib_1.__decorate([
154
- (0, inversify_1.inject)(ai_core_preferences_1.AICorePreferences),
155
- tslib_1.__metadata("design:type", Object)
156
- ], OpenAiFrontendApplicationContribution.prototype, "aiCorePreferences", void 0);
157
- exports.OpenAiFrontendApplicationContribution = OpenAiFrontendApplicationContribution = tslib_1.__decorate([
158
- (0, inversify_1.injectable)()
159
- ], OpenAiFrontendApplicationContribution);
160
- const openAIModelsWithDisabledStreaming = [];
161
- const openAIModelsNotSupportingDeveloperMessages = ['o1-preview', 'o1-mini'];
162
- const openAIModelsWithoutStructuredOutput = ['o1-preview', 'gpt-4-turbo', 'gpt-4', 'gpt-3.5-turbo', 'o1-mini', 'gpt-4o-2024-05-13'];
163
- //# sourceMappingURL=openai-frontend-application-contribution.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openai-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/openai-frontend-application-contribution.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;;;;AAGhF,4DAAkE;AAClE,sCAAoG;AACpG,qEAAuH;AACvH,uFAA+G;AAC/G,sCAAgD;AAGzC,IAAM,qCAAqC,GAA3C,MAAM,qCAAqC;IAA3C;QAWO,eAAU,GAAa,EAAE,CAAC;QAC1B,qBAAgB,GAAsC,EAAE,CAAC;IAgIvE,CAAC;IA9HG,OAAO;QACH,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YACnC,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAS,iCAAY,EAAE,SAAS,CAAC,CAAC;YAC3E,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAE/B,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAS,YAAY,EAAE,SAAS,CAAC,CAAC;YAC7E,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAEnC,MAAM,M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,UAAU,EAAE,MAAA,IAAI,CAAC,UAAU,mCAAI,UAAU;oBACzC,cAAc,EAAE,MAAA,IAAI,CAAC,cAAc,mCAAI,KAAK;iBAC/C;aACJ,CAAC;QACN,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,CAAC;CACJ,CAAA;AA5IY,sFAAqC;AAGpC;IADT,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;gFACqB;AAGrC;IADT,IAAA,kBAAM,EAAC,oCAA2B,CAAC;;sEACW;AAGrC;IADT,IAAA,kBAAM,EAAC,uCAAiB,CAAC;;gFACqB;gDATtC,qCAAqC;IADjD,IAAA,sBAAU,GAAE;GACA,qCAAqC,CA4IjD;AAED,MAAM,iCAAiC,GAAa,EAAE,CAAC;AACvD,MAAM,0CAA0C,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAC7E,MAAM,mCAAmC,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- declare const _default: ContainerModule;
3
- export default _default;
4
- //# sourceMappingURL=openai-frontend-module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openai-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/openai-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAO/D,wBAQG"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2024 EclipseSource GmbH.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const inversify_1 = require("@theia/core/shared/inversify");
19
- const openai_preferences_1 = require("../common/openai-preferences");
20
- const browser_1 = require("@theia/core/lib/browser");
21
- const openai_frontend_application_contribution_1 = require("./openai-frontend-application-contribution");
22
- const common_1 = require("../common");
23
- const core_1 = require("@theia/core");
24
- exports.default = new inversify_1.ContainerModule(bind => {
25
- bind(core_1.PreferenceContribution).toConstantValue({ schema: openai_preferences_1.OpenAiPreferencesSchema });
26
- bind(openai_frontend_application_contribution_1.OpenAiFrontendApplicationContribution).toSelf().inSingletonScope();
27
- bind(browser_1.FrontendApplicationContribution).toService(openai_frontend_application_contribution_1.OpenAiFrontendApplicationContribution);
28
- bind(common_1.OpenAiLanguageModelsManager).toDynamicValue(ctx => {
29
- const provider = ctx.container.get(browser_1.RemoteConnectionProvider);
30
- return provider.createProxy(common_1.OPENAI_LANGUAGE_MODELS_MANAGER_PATH);
31
- }).inSingletonScope();
32
- });
33
- //# sourceMappingURL=openai-frontend-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openai-frontend-module.js","sourceRoot":"","sources":["../../src/browser/openai-frontend-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,qEAAuE;AACvE,qDAA+H;AAC/H,yGAAmG;AACnG,sCAA6F;AAC7F,sCAAqD;AAErD,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,6BAAsB,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,4CAAuB,EAAE,CAAC,CAAC;IAClF,IAAI,CAAC,gFAAqC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACxE,IAAI,CAAC,yCAA+B,CAAC,CAAC,SAAS,CAAC,gFAAqC,CAAC,CAAC;IACvF,IAAI,CAAC,oCAA2B,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACnD,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAA4B,kCAAwB,CAAC,CAAC;QACxF,OAAO,QAAQ,CAAC,WAAW,CAA8B,4CAAmC,CAAC,CAAC;IAClG,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './openai-language-models-manager';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAeA,cAAc,kCAAkC,CAAC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- // *****************************************************************************
5
- // Copyright (C) 2024 EclipseSource GmbH.
6
- //
7
- // This program and the accompanying materials are made available under the
8
- // terms of the Eclipse Public License v. 2.0 which is available at
9
- // http://www.eclipse.org/legal/epl-2.0.
10
- //
11
- // This Source Code may also be made available under the following Secondary
12
- // Licenses when the conditions for such availability set forth in the Eclipse
13
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
- // with the GNU Classpath Exception which is available at
15
- // https://www.gnu.org/software/classpath/license.html.
16
- //
17
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
18
- // *****************************************************************************
19
- tslib_1.__exportStar(require("./openai-language-models-manager"), exports);
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.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;AAChF,2EAAiD"}
@@ -1,63 +0,0 @@
1
- export declare const OPENAI_LANGUAGE_MODELS_MANAGER_PATH = "/services/open-ai/language-model-manager";
2
- export declare const OpenAiLanguageModelsManager: unique symbol;
3
- export declare const OPENAI_PROVIDER_ID = "openai";
4
- export interface OpenAiModelDescription {
5
- /**
6
- * The identifier of the model which will be shown in the UI.
7
- */
8
- id: string;
9
- /**
10
- * The model ID as used by the OpenAI API.
11
- */
12
- model: string;
13
- /**
14
- * The OpenAI API compatible endpoint where the model is hosted. If not provided the default OpenAI endpoint will be used.
15
- */
16
- url?: string;
17
- /**
18
- * The key for the model. If 'true' is provided the global OpenAI API key will be used.
19
- */
20
- apiKey: string | true | undefined;
21
- /**
22
- * The version for the api. If 'true' is provided the global OpenAI version will be used.
23
- */
24
- apiVersion: string | true | undefined;
25
- /**
26
- * Optional deployment name for Azure OpenAI.
27
- */
28
- deployment?: string;
29
- /**
30
- * Indicate whether the streaming API shall be used.
31
- */
32
- enableStreaming: boolean;
33
- /**
34
- * Property to configure the developer message of the model. Setting this property to 'user', 'system', or 'developer' will use that string as the role for the system message.
35
- * Setting it to 'mergeWithFollowingUserMessage' will prefix the following user message with the system message or convert the system message to user if the following message
36
- * is not a user message. 'skip' will remove the system message altogether.
37
- * Defaults to 'developer'.
38
- */
39
- developerMessageSettings?: 'user' | 'system' | 'developer' | 'mergeWithFollowingUserMessage' | 'skip';
40
- /**
41
- * Flag to configure whether the OpenAPI model supports structured output. Default is `true`.
42
- */
43
- supportsStructuredOutput: boolean;
44
- /**
45
- * Maximum number of retry attempts when a request fails. Default is 3.
46
- */
47
- maxRetries: number;
48
- /**
49
- * Flag to configure whether to use the newer OpenAI Response API instead of the Chat Completion API.
50
- * For official OpenAI models, this defaults to `true`. For custom providers, users must explicitly enable it.
51
- * Default is `false` for custom models.
52
- */
53
- useResponseApi?: boolean;
54
- }
55
- export interface OpenAiLanguageModelsManager {
56
- apiKey: string | undefined;
57
- setApiKey(key: string | undefined): void;
58
- setApiVersion(version: string | undefined): void;
59
- setProxyUrl(proxyUrl: string | undefined): void;
60
- createOrUpdateLanguageModels(...models: OpenAiModelDescription[]): Promise<void>;
61
- removeLanguageModels(...modelIds: string[]): void;
62
- }
63
- //# sourceMappingURL=openai-language-models-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openai-language-models-manager.d.ts","sourceRoot":"","sources":["../../src/common/openai-language-models-manager.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,mCAAmC,6CAA6C,CAAC;AAC9F,eAAO,MAAM,2BAA2B,eAAwC,CAAC;AAEjF,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAE3C,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,+BAA+B,GAAG,MAAM,CAAC;IACtG;;OAEG;IACH,wBAAwB,EAAE,OAAO,CAAC;IAClC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,2BAA2B;IACxC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACzC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACjD,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAChD,4BAA4B,CAAC,GAAG,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjF,oBAAoB,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;CACpD"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OPENAI_PROVIDER_ID = exports.OpenAiLanguageModelsManager = exports.OPENAI_LANGUAGE_MODELS_MANAGER_PATH = void 0;
4
- // *****************************************************************************
5
- // Copyright (C) 2024 EclipseSource GmbH.
6
- //
7
- // This program and the accompanying materials are made available under the
8
- // terms of the Eclipse Public License v. 2.0 which is available at
9
- // http://www.eclipse.org/legal/epl-2.0.
10
- //
11
- // This Source Code may also be made available under the following Secondary
12
- // Licenses when the conditions for such availability set forth in the Eclipse
13
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
- // with the GNU Classpath Exception which is available at
15
- // https://www.gnu.org/software/classpath/license.html.
16
- //
17
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
18
- // *****************************************************************************
19
- exports.OPENAI_LANGUAGE_MODELS_MANAGER_PATH = '/services/open-ai/language-model-manager';
20
- exports.OpenAiLanguageModelsManager = Symbol('OpenAiLanguageModelsManager');
21
- exports.OPENAI_PROVIDER_ID = 'openai';
22
- //# sourceMappingURL=openai-language-models-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openai-language-models-manager.js","sourceRoot":"","sources":["../../src/common/openai-language-models-manager.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;AACnE,QAAA,mCAAmC,GAAG,0CAA0C,CAAC;AACjF,QAAA,2BAA2B,GAAG,MAAM,CAAC,6BAA6B,CAAC,CAAC;AAEpE,QAAA,kBAAkB,GAAG,QAAQ,CAAC"}
@@ -1,7 +0,0 @@
1
- import { PreferenceSchema } from '@theia/core';
2
- export declare const API_KEY_PREF = "ai-features.openAiOfficial.openAiApiKey";
3
- export declare const MODELS_PREF = "ai-features.openAiOfficial.officialOpenAiModels";
4
- export declare const USE_RESPONSE_API_PREF = "ai-features.openAiOfficial.useResponseApi";
5
- export declare const CUSTOM_ENDPOINTS_PREF = "ai-features.openAiCustom.customOpenAiModels";
6
- export declare const OpenAiPreferencesSchema: PreferenceSchema;
7
- //# sourceMappingURL=openai-preferences.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openai-preferences.d.ts","sourceRoot":"","sources":["../../src/common/openai-preferences.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAO,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,YAAY,4CAA4C,CAAC;AACtE,eAAO,MAAM,WAAW,oDAAoD,CAAC;AAC7E,eAAO,MAAM,qBAAqB,8CAA8C,CAAC;AACjF,eAAO,MAAM,qBAAqB,gDAAgD,CAAC;AAEnF,eAAO,MAAM,uBAAuB,EAAE,gBAmIrC,CAAC"}
@@ -1,147 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2024 EclipseSource GmbH.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.OpenAiPreferencesSchema = exports.CUSTOM_ENDPOINTS_PREF = exports.USE_RESPONSE_API_PREF = exports.MODELS_PREF = exports.API_KEY_PREF = void 0;
19
- const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
20
- const core_1 = require("@theia/core");
21
- exports.API_KEY_PREF = 'ai-features.openAiOfficial.openAiApiKey';
22
- exports.MODELS_PREF = 'ai-features.openAiOfficial.officialOpenAiModels';
23
- exports.USE_RESPONSE_API_PREF = 'ai-features.openAiOfficial.useResponseApi';
24
- exports.CUSTOM_ENDPOINTS_PREF = 'ai-features.openAiCustom.customOpenAiModels';
25
- exports.OpenAiPreferencesSchema = {
26
- properties: {
27
- [exports.API_KEY_PREF]: {
28
- type: 'string',
29
- markdownDescription: core_1.nls.localize('theia/ai/openai/apiKey/mdDescription', 'Enter an API Key of your official OpenAI Account. **Please note:** By using this preference the Open AI API key will be stored in clear text \
30
- on the machine running Theia. Use the environment variable `OPENAI_API_KEY` to set the key securely.'),
31
- title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
32
- },
33
- [exports.MODELS_PREF]: {
34
- type: 'array',
35
- description: core_1.nls.localize('theia/ai/openai/models/description', 'Official OpenAI models to use'),
36
- title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
37
- default: [
38
- 'gpt-4o',
39
- 'gpt-4.1',
40
- 'gpt-4.1-nano',
41
- 'gpt-4.1-mini',
42
- 'gpt-4o-mini',
43
- 'o3',
44
- 'o3-mini',
45
- 'o4-mini',
46
- 'o4-mini-high',
47
- 'gpt-5',
48
- 'gpt-5-mini',
49
- 'gpt-5-nano'
50
- ],
51
- items: {
52
- type: 'string'
53
- }
54
- },
55
- [exports.USE_RESPONSE_API_PREF]: {
56
- type: 'boolean',
57
- default: false,
58
- title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
59
- markdownDescription: core_1.nls.localize('theia/ai/openai/useResponseApi/mdDescription', 'Use the newer OpenAI Response API instead of the Chat Completion API for official OpenAI models.\
60
- \
61
- This setting only applies to official OpenAI models - custom providers must configure this individually.\
62
- \
63
- Note that for the response API, tool call definitions must satisfy Open AI\'s [strict schema definition](https://platform.openai.com/docs/guides/function-calling#strict-mode).\
64
- Best effort is made to convert non-conformant schemas, but errors are still possible.')
65
- },
66
- [exports.CUSTOM_ENDPOINTS_PREF]: {
67
- type: 'array',
68
- title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
69
- markdownDescription: core_1.nls.localize('theia/ai/openai/customEndpoints/mdDescription', 'Integrate custom models compatible with the OpenAI API, for example via `vllm`. The required attributes are `model` and `url`.\
70
- \n\
71
- Optionally, you can\
72
- \n\
73
- - specify a unique `id` to identify the custom model in the UI. If none is given `model` will be used as `id`.\
74
- \n\
75
- - provide an `apiKey` to access the API served at the given url. Use `true` to indicate the use of the global OpenAI API key.\
76
- \n\
77
- - provide an `apiVersion` to access the API served at the given url in Azure. Use `true` to indicate the use of the global OpenAI API version.\
78
- \n\
79
- - provide a `deployment` name for your Azure deployment.\
80
- \n\
81
- - set `developerMessageSettings` to one of `user`, `system`, `developer`, `mergeWithFollowingUserMessage`, or `skip` to control how the developer message is\
82
- included (where `user`, `system`, and `developer` will be used as a role, `mergeWithFollowingUserMessage` will prefix the following user message with the system\
83
- message or convert the system message to user message if the next message is not a user message. `skip` will just remove the system message).\
84
- Defaulting to `developer`.\
85
- \n\
86
- - specify `supportsStructuredOutput: false` to indicate that structured output shall not be used.\
87
- \n\
88
- - specify `enableStreaming: false` to indicate that streaming shall not be used.\
89
- \n\
90
- - specify `useResponseApi: true` to use the newer OpenAI Response API instead of the Chat Completion API (requires compatible endpoint).\
91
- \n\
92
- Refer to [our documentation](https://theia-ide.org/docs/user_ai/#openai-compatible-models-eg-via-vllm) for more information.'),
93
- default: [],
94
- items: {
95
- type: 'object',
96
- properties: {
97
- model: {
98
- type: 'string',
99
- title: core_1.nls.localize('theia/ai/openai/customEndpoints/modelId/title', 'Model ID')
100
- },
101
- url: {
102
- type: 'string',
103
- title: core_1.nls.localize('theia/ai/openai/customEndpoints/url/title', 'The Open AI API compatible endpoint where the model is hosted')
104
- },
105
- id: {
106
- type: 'string',
107
- title: core_1.nls.localize('theia/ai/openai/customEndpoints/id/title', 'A unique identifier which is used in the UI to identify the custom model'),
108
- },
109
- apiKey: {
110
- type: ['string', 'boolean'],
111
- title: core_1.nls.localize('theia/ai/openai/customEndpoints/apiKey/title', 'Either the key to access the API served at the given url or `true` to use the global OpenAI API key'),
112
- },
113
- apiVersion: {
114
- type: ['string', 'boolean'],
115
- title: core_1.nls.localize('theia/ai/openai/customEndpoints/apiVersion/title', 'Either the version to access the API served at the given url in Azure or `true` to use the global OpenAI API version'),
116
- },
117
- deployment: {
118
- type: 'string',
119
- title: core_1.nls.localize('theia/ai/openai/customEndpoints/deployment/title', 'The deployment name to access the API served at the given url in Azure'),
120
- },
121
- developerMessageSettings: {
122
- type: 'string',
123
- enum: ['user', 'system', 'developer', 'mergeWithFollowingUserMessage', 'skip'],
124
- default: 'developer',
125
- title: core_1.nls.localize('theia/ai/openai/customEndpoints/developerMessageSettings/title', 'Controls the handling of system messages: `user`, `system`, and `developer` will be used as a role, `mergeWithFollowingUserMessage` will prefix\
126
- the following user message with the system message or convert the system message to user message if the next message is not a user message.\
127
- `skip` will just remove the system message), defaulting to `developer`.')
128
- },
129
- supportsStructuredOutput: {
130
- type: 'boolean',
131
- title: core_1.nls.localize('theia/ai/openai/customEndpoints/supportsStructuredOutput/title', 'Indicates whether the model supports structured output. `true` by default.'),
132
- },
133
- enableStreaming: {
134
- type: 'boolean',
135
- title: core_1.nls.localize('theia/ai/openai/customEndpoints/enableStreaming/title', 'Indicates whether the streaming API shall be used. `true` by default.'),
136
- },
137
- useResponseApi: {
138
- type: 'boolean',
139
- title: core_1.nls.localize('theia/ai/openai/customEndpoints/useResponseApi/title', 'Use the newer OpenAI Response API instead of the Chat Completion API. `false` by default for custom providers.'
140
- + 'Note: Will automatically fall back to Chat Completions API when tools are used.'),
141
- }
142
- }
143
- }
144
- }
145
- }
146
- };
147
- //# sourceMappingURL=openai-preferences.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openai-preferences.js","sourceRoot":"","sources":["../../src/common/openai-preferences.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,uFAA0F;AAC1F,sCAAoD;AAEvC,QAAA,YAAY,GAAG,yCAAyC,CAAC;AACzD,QAAA,WAAW,GAAG,iDAAiD,CAAC;AAChE,QAAA,qBAAqB,GAAG,2CAA2C,CAAC;AACpE,QAAA,qBAAqB,GAAG,6CAA6C,CAAC;AAEtE,QAAA,uBAAuB,GAAqB;IACrD,UAAU,EAAE;QACR,CAAC,oBAAY,CAAC,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,sCAAsC,EACpE;qGACqF,CAAC;YAC1F,KAAK,EAAE,+CAAyB;SACnC;QACD,CAAC,mBAAW,CAAC,EAAE;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,o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9D,qGAAqG,CAAC;qBAC7G;oBACD,UAAU,EAAE;wBACR,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;wBAC3B,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,kDAAkD,EAClE,sHAAsH,CAAC;qBAC9H;oBACD,UAAU,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,kDAAkD,EAClE,wEAAwE,CAAC;qBAChF;oBACD,wBAAwB,EAAE;wBACtB,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE,MAAM,CAAC;wBAC9E,OAAO,EAAE,WAAW;wBACpB,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,gEAAgE,EAChF;;iGAEqE,CAAC;qBAC7E;oBACD,wBAAwB,EAAE;wBACtB,IAAI,EAAE,SAAS;wBACf,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,gEAAgE,EAChF,4EAA4E,CAAC;qBACpF;oBACD,eAAe,EAAE;wBACb,IAAI,EAAE,SAAS;wBACf,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,uDAAuD,EACvE,uEAAuE,CAAC;qBAC/E;oBACD,cAAc,EAAE;wBACZ,IAAI,EAAE,SAAS;wBACf,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,sDAAsD,EACtE,gHAAgH;8BAC9G,iFAAiF,CAAC;qBAC3F;iBACJ;aACJ;SACJ;KACJ;CACJ,CAAC"}
@@ -1,5 +0,0 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- export declare const OpenAiModelFactory: unique symbol;
3
- declare const _default: ContainerModule;
4
- export default _default;
5
- //# sourceMappingURL=openai-backend-module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openai-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/openai-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAS/D,eAAO,MAAM,kBAAkB,eAA+B,CAAC;;AAW/D,wBAKG"}