@theia/ai-anthropic 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.
- package/README.md +1 -0
- package/package.json +4 -4
- package/src/browser/anthropic-frontend-application-contribution.ts +4 -1
- package/src/common/anthropic-preferences.ts +1 -2
- package/lib/browser/anthropic-frontend-application-contribution.d.ts +0 -15
- package/lib/browser/anthropic-frontend-application-contribution.d.ts.map +0 -1
- package/lib/browser/anthropic-frontend-application-contribution.js +0 -118
- package/lib/browser/anthropic-frontend-application-contribution.js.map +0 -1
- package/lib/browser/anthropic-frontend-module.d.ts +0 -4
- package/lib/browser/anthropic-frontend-module.d.ts.map +0 -1
- package/lib/browser/anthropic-frontend-module.js +0 -33
- package/lib/browser/anthropic-frontend-module.js.map +0 -1
- package/lib/common/anthropic-language-models-manager.d.ts +0 -40
- package/lib/common/anthropic-language-models-manager.d.ts.map +0 -1
- package/lib/common/anthropic-language-models-manager.js +0 -21
- package/lib/common/anthropic-language-models-manager.js.map +0 -1
- package/lib/common/anthropic-preferences.d.ts +0 -5
- package/lib/common/anthropic-preferences.d.ts.map +0 -1
- package/lib/common/anthropic-preferences.js +0 -43
- package/lib/common/anthropic-preferences.js.map +0 -1
- package/lib/common/index.d.ts +0 -2
- package/lib/common/index.d.ts.map +0 -1
- package/lib/common/index.js +0 -20
- package/lib/common/index.js.map +0 -1
- package/lib/node/anthropic-backend-module.d.ts +0 -4
- package/lib/node/anthropic-backend-module.d.ts.map +0 -1
- package/lib/node/anthropic-backend-module.js +0 -34
- package/lib/node/anthropic-backend-module.js.map +0 -1
- package/lib/node/anthropic-language-model.d.ts +0 -36
- package/lib/node/anthropic-language-model.d.ts.map +0 -1
- package/lib/node/anthropic-language-model.js +0 -386
- package/lib/node/anthropic-language-model.js.map +0 -1
- package/lib/node/anthropic-language-model.spec.d.ts +0 -2
- package/lib/node/anthropic-language-model.spec.d.ts.map +0 -1
- package/lib/node/anthropic-language-model.spec.js +0 -124
- package/lib/node/anthropic-language-model.spec.js.map +0 -1
- package/lib/node/anthropic-language-models-manager-impl.d.ts +0 -18
- package/lib/node/anthropic-language-models-manager-impl.d.ts.map +0 -1
- package/lib/node/anthropic-language-models-manager-impl.js +0 -112
- package/lib/node/anthropic-language-models-manager-impl.js.map +0 -1
- package/lib/package.spec.d.ts +0 -1
- package/lib/package.spec.d.ts.map +0 -1
- package/lib/package.spec.js +0 -26
- package/lib/package.spec.js.map +0 -1
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Alternatively the API key can also be handed in via the `ANTHROPIC_API_KEY` envi
|
|
|
18
18
|
|
|
19
19
|
## Additional Information
|
|
20
20
|
|
|
21
|
+
- [API documentation for `@theia/ai-anthropic`](https://eclipse-theia.github.io/theia/docs/next/modules/_theia_ai-anthropic.html)
|
|
21
22
|
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
22
23
|
- [Theia - Website](https://theia-ide.org/)
|
|
23
24
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/ai-anthropic",
|
|
3
|
-
"version": "1.67.0-next.
|
|
3
|
+
"version": "1.67.0-next.56+d8f18cc386c",
|
|
4
4
|
"description": "Theia - Anthropic Integration",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@anthropic-ai/sdk": "^0.65.0",
|
|
7
|
-
"@theia/ai-core": "1.67.0-next.
|
|
8
|
-
"@theia/core": "1.67.0-next.
|
|
7
|
+
"@theia/ai-core": "1.67.0-next.56+d8f18cc386c",
|
|
8
|
+
"@theia/core": "1.67.0-next.56+d8f18cc386c",
|
|
9
9
|
"undici": "^7.16.0"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"nyc": {
|
|
48
48
|
"extends": "../../configs/nyc.json"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "d8f18cc386c45a736cd193d42eab02c8f64c6b10"
|
|
51
51
|
}
|
|
@@ -30,7 +30,10 @@ const DEFAULT_MODEL_MAX_TOKENS: Record<string, number> = {
|
|
|
30
30
|
'claude-3-5-sonnet-latest': 8192,
|
|
31
31
|
'claude-3-7-sonnet-latest': 64000,
|
|
32
32
|
'claude-opus-4-20250514': 32000,
|
|
33
|
-
'claude-sonnet-4-20250514': 64000
|
|
33
|
+
'claude-sonnet-4-20250514': 64000,
|
|
34
|
+
'claude-sonnet-4-5': 64000,
|
|
35
|
+
'claude-sonnet-4-0': 64000,
|
|
36
|
+
'claude-opus-4-1': 32000
|
|
34
37
|
};
|
|
35
38
|
|
|
36
39
|
@injectable()
|
|
@@ -33,8 +33,7 @@ export const AnthropicPreferencesSchema: PreferenceSchema = {
|
|
|
33
33
|
type: 'array',
|
|
34
34
|
description: nls.localize('theia/ai/anthropic/models/description', 'Official Anthropic models to use'),
|
|
35
35
|
title: AI_CORE_PREFERENCES_TITLE,
|
|
36
|
-
default: ['claude-
|
|
37
|
-
'claude-sonnet-4-20250514'],
|
|
36
|
+
default: ['claude-sonnet-4-5', 'claude-sonnet-4-0', 'claude-3-7-sonnet-latest', 'claude-opus-4-1'],
|
|
38
37
|
items: {
|
|
39
38
|
type: 'string'
|
|
40
39
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
2
|
-
import { AnthropicLanguageModelsManager, AnthropicModelDescription } from '../common';
|
|
3
|
-
import { AICorePreferences } from '@theia/ai-core/lib/common/ai-core-preferences';
|
|
4
|
-
import { PreferenceService } from '@theia/core';
|
|
5
|
-
export declare class AnthropicFrontendApplicationContribution implements FrontendApplicationContribution {
|
|
6
|
-
protected preferenceService: PreferenceService;
|
|
7
|
-
protected manager: AnthropicLanguageModelsManager;
|
|
8
|
-
protected aiCorePreferences: AICorePreferences;
|
|
9
|
-
protected prevModels: string[];
|
|
10
|
-
onStart(): void;
|
|
11
|
-
protected handleModelChanges(newModels: string[]): void;
|
|
12
|
-
protected updateAllModels(): void;
|
|
13
|
-
protected createAnthropicModelDescription(modelId: string): AnthropicModelDescription;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=anthropic-frontend-application-contribution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-frontend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/anthropic-frontend-application-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEtF,OAAO,EAAE,iBAAiB,EAA+B,MAAM,+CAA+C,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAchD,qBACa,wCAAyC,YAAW,+BAA+B;IAG5F,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAG/C,SAAS,CAAC,OAAO,EAAE,8BAA8B,CAAC;IAGlD,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,CAAM;IAEpC,OAAO,IAAI,IAAI;IA+Bf,SAAS,CAAC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAYvD,SAAS,CAAC,eAAe,IAAI,IAAI;IAKjC,SAAS,CAAC,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB;CAuBxF"}
|
|
@@ -1,118 +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.AnthropicFrontendApplicationContribution = 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 anthropic_preferences_1 = require("../common/anthropic-preferences");
|
|
23
|
-
const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
|
|
24
|
-
const core_1 = require("@theia/core");
|
|
25
|
-
const ANTHROPIC_PROVIDER_ID = 'anthropic';
|
|
26
|
-
// Model-specific maxTokens values
|
|
27
|
-
const DEFAULT_MODEL_MAX_TOKENS = {
|
|
28
|
-
'claude-3-opus-latest': 4096,
|
|
29
|
-
'claude-3-5-haiku-latest': 8192,
|
|
30
|
-
'claude-3-5-sonnet-latest': 8192,
|
|
31
|
-
'claude-3-7-sonnet-latest': 64000,
|
|
32
|
-
'claude-opus-4-20250514': 32000,
|
|
33
|
-
'claude-sonnet-4-20250514': 64000
|
|
34
|
-
};
|
|
35
|
-
let AnthropicFrontendApplicationContribution = class AnthropicFrontendApplicationContribution {
|
|
36
|
-
constructor() {
|
|
37
|
-
this.prevModels = [];
|
|
38
|
-
}
|
|
39
|
-
onStart() {
|
|
40
|
-
this.preferenceService.ready.then(() => {
|
|
41
|
-
const apiKey = this.preferenceService.get(anthropic_preferences_1.API_KEY_PREF, undefined);
|
|
42
|
-
this.manager.setApiKey(apiKey);
|
|
43
|
-
const proxyUri = this.preferenceService.get('http.proxy', undefined);
|
|
44
|
-
this.manager.setProxyUrl(proxyUri);
|
|
45
|
-
const models = this.preferenceService.get(anthropic_preferences_1.MODELS_PREF, []);
|
|
46
|
-
this.manager.createOrUpdateLanguageModels(...models.map(modelId => this.createAnthropicModelDescription(modelId)));
|
|
47
|
-
this.prevModels = [...models];
|
|
48
|
-
this.preferenceService.onPreferenceChanged(event => {
|
|
49
|
-
if (event.preferenceName === anthropic_preferences_1.API_KEY_PREF) {
|
|
50
|
-
this.manager.setApiKey(event.newValue);
|
|
51
|
-
this.updateAllModels();
|
|
52
|
-
}
|
|
53
|
-
else if (event.preferenceName === anthropic_preferences_1.MODELS_PREF) {
|
|
54
|
-
this.handleModelChanges(event.newValue);
|
|
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 => `${ANTHROPIC_PROVIDER_ID}/${model}`));
|
|
73
|
-
this.manager.createOrUpdateLanguageModels(...modelsToAdd.map(modelId => this.createAnthropicModelDescription(modelId)));
|
|
74
|
-
this.prevModels = newModels;
|
|
75
|
-
}
|
|
76
|
-
updateAllModels() {
|
|
77
|
-
const models = this.preferenceService.get(anthropic_preferences_1.MODELS_PREF, []);
|
|
78
|
-
this.manager.createOrUpdateLanguageModels(...models.map(modelId => this.createAnthropicModelDescription(modelId)));
|
|
79
|
-
}
|
|
80
|
-
createAnthropicModelDescription(modelId) {
|
|
81
|
-
var _a;
|
|
82
|
-
const id = `${ANTHROPIC_PROVIDER_ID}/${modelId}`;
|
|
83
|
-
const maxTokens = DEFAULT_MODEL_MAX_TOKENS[modelId];
|
|
84
|
-
const maxRetries = (_a = this.aiCorePreferences.get(ai_core_preferences_1.PREFERENCE_NAME_MAX_RETRIES)) !== null && _a !== void 0 ? _a : 3;
|
|
85
|
-
const description = {
|
|
86
|
-
id: id,
|
|
87
|
-
model: modelId,
|
|
88
|
-
apiKey: true,
|
|
89
|
-
enableStreaming: true,
|
|
90
|
-
useCaching: true,
|
|
91
|
-
maxRetries: maxRetries
|
|
92
|
-
};
|
|
93
|
-
if (maxTokens !== undefined) {
|
|
94
|
-
description.maxTokens = maxTokens;
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
description.maxTokens = 64000;
|
|
98
|
-
}
|
|
99
|
-
return description;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
exports.AnthropicFrontendApplicationContribution = AnthropicFrontendApplicationContribution;
|
|
103
|
-
tslib_1.__decorate([
|
|
104
|
-
(0, inversify_1.inject)(core_1.PreferenceService),
|
|
105
|
-
tslib_1.__metadata("design:type", Object)
|
|
106
|
-
], AnthropicFrontendApplicationContribution.prototype, "preferenceService", void 0);
|
|
107
|
-
tslib_1.__decorate([
|
|
108
|
-
(0, inversify_1.inject)(common_1.AnthropicLanguageModelsManager),
|
|
109
|
-
tslib_1.__metadata("design:type", Object)
|
|
110
|
-
], AnthropicFrontendApplicationContribution.prototype, "manager", void 0);
|
|
111
|
-
tslib_1.__decorate([
|
|
112
|
-
(0, inversify_1.inject)(ai_core_preferences_1.AICorePreferences),
|
|
113
|
-
tslib_1.__metadata("design:type", Object)
|
|
114
|
-
], AnthropicFrontendApplicationContribution.prototype, "aiCorePreferences", void 0);
|
|
115
|
-
exports.AnthropicFrontendApplicationContribution = AnthropicFrontendApplicationContribution = tslib_1.__decorate([
|
|
116
|
-
(0, inversify_1.injectable)()
|
|
117
|
-
], AnthropicFrontendApplicationContribution);
|
|
118
|
-
//# sourceMappingURL=anthropic-frontend-application-contribution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/anthropic-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,sCAAsF;AACtF,2EAA4E;AAC5E,uFAA+G;AAC/G,sCAAgD;AAEhD,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAE1C,kCAAkC;AAClC,MAAM,wBAAwB,GAA2B;IACrD,sBAAsB,EAAE,IAAI;IAC5B,yBAAyB,EAAE,IAAI;IAC/B,0BAA0B,EAAE,IAAI;IAChC,0BAA0B,EAAE,KAAK;IACjC,wBAAwB,EAAE,KAAK;IAC/B,0BAA0B,EAAE,KAAK;CACpC,CAAC;AAGK,IAAM,wCAAwC,GAA9C,MAAM,wCAAwC;IAA9C;QAWO,eAAU,GAAa,EAAE,CAAC;IAyExC,CAAC;IAvEG,OAAO;QACH,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YACnC,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAS,oCAAY,EAAE,SAAS,CAAC,CAAC;YAC3E,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAE/B,MAAM,QAAQ,GAAG,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AM,UAAU,GAAG,MAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,iDAA2B,CAAC,mCAAI,CAAC,CAAC;QAEhF,MAAM,WAAW,GAA8B;YAC3C,EAAE,EAAE,EAAE;YACN,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,IAAI;YACZ,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,UAAU;SACzB,CAAC;QAEF,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC1B,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC;QACtC,CAAC;aAAM,CAAC;YACJ,WAAW,CAAC,SAAS,GAAG,KAAK,CAAC;QAClC,CAAC;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;CAEJ,CAAA;AApFY,4FAAwC;AAGvC;IADT,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;mFACqB;AAGrC;IADT,IAAA,kBAAM,EAAC,uCAA8B,CAAC;;yEACW;AAGxC;IADT,IAAA,kBAAM,EAAC,uCAAiB,CAAC;;mFACqB;mDATtC,wCAAwC;IADpD,IAAA,sBAAU,GAAE;GACA,wCAAwC,CAoFpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/anthropic-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 anthropic_preferences_1 = require("../common/anthropic-preferences");
|
|
20
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
21
|
-
const anthropic_frontend_application_contribution_1 = require("./anthropic-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: anthropic_preferences_1.AnthropicPreferencesSchema });
|
|
26
|
-
bind(anthropic_frontend_application_contribution_1.AnthropicFrontendApplicationContribution).toSelf().inSingletonScope();
|
|
27
|
-
bind(browser_1.FrontendApplicationContribution).toService(anthropic_frontend_application_contribution_1.AnthropicFrontendApplicationContribution);
|
|
28
|
-
bind(common_1.AnthropicLanguageModelsManager).toDynamicValue(ctx => {
|
|
29
|
-
const provider = ctx.container.get(browser_1.RemoteConnectionProvider);
|
|
30
|
-
return provider.createProxy(common_1.ANTHROPIC_LANGUAGE_MODELS_MANAGER_PATH);
|
|
31
|
-
}).inSingletonScope();
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=anthropic-frontend-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-frontend-module.js","sourceRoot":"","sources":["../../src/browser/anthropic-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,2EAA6E;AAC7E,qDAA+H;AAC/H,+GAAyG;AACzG,sCAAmG;AACnG,sCAAqD;AAErD,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,6BAAsB,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,kDAA0B,EAAE,CAAC,CAAC;IACrF,IAAI,CAAC,sFAAwC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC3E,IAAI,CAAC,yCAA+B,CAAC,CAAC,SAAS,CAAC,sFAAwC,CAAC,CAAC;IAC1F,IAAI,CAAC,uCAA8B,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACtD,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAA4B,kCAAwB,CAAC,CAAC;QACxF,OAAO,QAAQ,CAAC,WAAW,CAAiC,+CAAsC,CAAC,CAAC;IACxG,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export declare const ANTHROPIC_LANGUAGE_MODELS_MANAGER_PATH = "/services/anthropic/language-model-manager";
|
|
2
|
-
export declare const AnthropicLanguageModelsManager: unique symbol;
|
|
3
|
-
export interface AnthropicModelDescription {
|
|
4
|
-
/**
|
|
5
|
-
* The identifier of the model which will be shown in the UI.
|
|
6
|
-
*/
|
|
7
|
-
id: string;
|
|
8
|
-
/**
|
|
9
|
-
* The model ID as used by the Anthropic API.
|
|
10
|
-
*/
|
|
11
|
-
model: string;
|
|
12
|
-
/**
|
|
13
|
-
* The key for the model. If 'true' is provided the global Anthropic API key will be used.
|
|
14
|
-
*/
|
|
15
|
-
apiKey: string | true | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Indicate whether the streaming API shall be used.
|
|
18
|
-
*/
|
|
19
|
-
enableStreaming: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Indicate whether the model supports prompt caching.
|
|
22
|
-
*/
|
|
23
|
-
useCaching: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Maximum number of tokens to generate. Default is 4096.
|
|
26
|
-
*/
|
|
27
|
-
maxTokens?: number;
|
|
28
|
-
/**
|
|
29
|
-
* Maximum number of retry attempts when a request fails. Default is 3.
|
|
30
|
-
*/
|
|
31
|
-
maxRetries: number;
|
|
32
|
-
}
|
|
33
|
-
export interface AnthropicLanguageModelsManager {
|
|
34
|
-
apiKey: string | undefined;
|
|
35
|
-
setApiKey(key: string | undefined): void;
|
|
36
|
-
setProxyUrl(proxyUrl: string | undefined): void;
|
|
37
|
-
createOrUpdateLanguageModels(...models: AnthropicModelDescription[]): Promise<void>;
|
|
38
|
-
removeLanguageModels(...modelIds: string[]): void;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=anthropic-language-models-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-language-models-manager.d.ts","sourceRoot":"","sources":["../../src/common/anthropic-language-models-manager.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,sCAAsC,+CAA+C,CAAC;AACnG,eAAO,MAAM,8BAA8B,eAA2C,CAAC;AACvF,MAAM,WAAW,yBAAyB;IACtC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CAEtB;AACD,MAAM,WAAW,8BAA8B;IAC3C,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACzC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAChD,4BAA4B,CAAC,GAAG,MAAM,EAAE,yBAAyB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpF,oBAAoB,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;CACpD"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AnthropicLanguageModelsManager = exports.ANTHROPIC_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.ANTHROPIC_LANGUAGE_MODELS_MANAGER_PATH = '/services/anthropic/language-model-manager';
|
|
20
|
-
exports.AnthropicLanguageModelsManager = Symbol('AnthropicLanguageModelsManager');
|
|
21
|
-
//# sourceMappingURL=anthropic-language-models-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-language-models-manager.js","sourceRoot":"","sources":["../../src/common/anthropic-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,sCAAsC,GAAG,4CAA4C,CAAC;AACtF,QAAA,8BAA8B,GAAG,MAAM,CAAC,gCAAgC,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { PreferenceSchema } from '@theia/core';
|
|
2
|
-
export declare const API_KEY_PREF = "ai-features.anthropic.AnthropicApiKey";
|
|
3
|
-
export declare const MODELS_PREF = "ai-features.anthropic.AnthropicModels";
|
|
4
|
-
export declare const AnthropicPreferencesSchema: PreferenceSchema;
|
|
5
|
-
//# sourceMappingURL=anthropic-preferences.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-preferences.d.ts","sourceRoot":"","sources":["../../src/common/anthropic-preferences.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAO,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,YAAY,0CAA0C,CAAC;AACpE,eAAO,MAAM,WAAW,0CAA0C,CAAC;AAEnE,eAAO,MAAM,0BAA0B,EAAE,gBAoBxC,CAAC"}
|
|
@@ -1,43 +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.AnthropicPreferencesSchema = 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.anthropic.AnthropicApiKey';
|
|
22
|
-
exports.MODELS_PREF = 'ai-features.anthropic.AnthropicModels';
|
|
23
|
-
exports.AnthropicPreferencesSchema = {
|
|
24
|
-
properties: {
|
|
25
|
-
[exports.API_KEY_PREF]: {
|
|
26
|
-
type: 'string',
|
|
27
|
-
markdownDescription: core_1.nls.localize('theia/ai/anthropic/apiKey/description', 'Enter an API Key of your official Anthropic Account. **Please note:** By using this preference the Anthropic API key will be stored in clear text\
|
|
28
|
-
on the machine running Theia. Use the environment variable `ANTHROPIC_API_KEY` to set the key securely.'),
|
|
29
|
-
title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
|
|
30
|
-
},
|
|
31
|
-
[exports.MODELS_PREF]: {
|
|
32
|
-
type: 'array',
|
|
33
|
-
description: core_1.nls.localize('theia/ai/anthropic/models/description', 'Official Anthropic models to use'),
|
|
34
|
-
title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
|
|
35
|
-
default: ['claude-3-7-sonnet-latest', 'claude-3-5-sonnet-latest', 'claude-3-5-haiku-latest', 'claude-3-opus-latest', 'claude-opus-4-20250514',
|
|
36
|
-
'claude-sonnet-4-20250514'],
|
|
37
|
-
items: {
|
|
38
|
-
type: 'string'
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=anthropic-preferences.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-preferences.js","sourceRoot":"","sources":["../../src/common/anthropic-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,uCAAuC,CAAC;AACvD,QAAA,WAAW,GAAG,uCAAuC,CAAC;AAEtD,QAAA,0BAA0B,GAAqB;IACxD,UAAU,EAAE;QACR,CAAC,oBAAY,CAAC,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,uCAAuC,EACrE;oHACoG,CAAC;YACzG,KAAK,EAAE,+CAAyB;SACnC;QACD,CAAC,mBAAW,CAAC,EAAE;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,uCAAuC,EAAE,kCAAkC,CAAC;YACtG,KAAK,EAAE,+CAAyB;YAChC,OAAO,EAAE,CAAC,0BAA0B,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,wBAAwB;gBACzI,0BAA0B,CAAC;YAC/B,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB;SACJ;KACJ;CACJ,CAAC"}
|
package/lib/common/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAeA,cAAc,qCAAqC,CAAC"}
|
package/lib/common/index.js
DELETED
|
@@ -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("./anthropic-language-models-manager"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/lib/common/index.js.map
DELETED
|
@@ -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,8EAAoD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/anthropic-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAgB/D,wBAGG"}
|
|
@@ -1,34 +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 anthropic_language_models_manager_1 = require("../common/anthropic-language-models-manager");
|
|
20
|
-
const core_1 = require("@theia/core");
|
|
21
|
-
const anthropic_language_models_manager_impl_1 = require("./anthropic-language-models-manager-impl");
|
|
22
|
-
const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
|
|
23
|
-
const anthropic_preferences_1 = require("../common/anthropic-preferences");
|
|
24
|
-
// We use a connection module to handle AI services separately for each frontend.
|
|
25
|
-
const anthropicConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService, bindFrontendService }) => {
|
|
26
|
-
bind(anthropic_language_models_manager_impl_1.AnthropicLanguageModelsManagerImpl).toSelf().inSingletonScope();
|
|
27
|
-
bind(anthropic_language_models_manager_1.AnthropicLanguageModelsManager).toService(anthropic_language_models_manager_impl_1.AnthropicLanguageModelsManagerImpl);
|
|
28
|
-
bind(core_1.ConnectionHandler).toDynamicValue(ctx => new core_1.RpcConnectionHandler(anthropic_language_models_manager_1.ANTHROPIC_LANGUAGE_MODELS_MANAGER_PATH, () => ctx.container.get(anthropic_language_models_manager_1.AnthropicLanguageModelsManager))).inSingletonScope();
|
|
29
|
-
});
|
|
30
|
-
exports.default = new inversify_1.ContainerModule(bind => {
|
|
31
|
-
bind(core_1.PreferenceContribution).toConstantValue({ schema: anthropic_preferences_1.AnthropicPreferencesSchema });
|
|
32
|
-
bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(anthropicConnectionModule);
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=anthropic-backend-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-backend-module.js","sourceRoot":"","sources":["../../src/node/anthropic-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,mGAAqI;AACrI,sCAA8F;AAC9F,qGAA8F;AAC9F,4GAAuG;AACvG,2EAA6E;AAE7E,iFAAiF;AACjF,MAAM,yBAAyB,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,EAAE,EAAE;IACrH,IAAI,CAAC,2EAAkC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACrE,IAAI,CAAC,kEAA8B,CAAC,CAAC,SAAS,CAAC,2EAAkC,CAAC,CAAC;IACnF,IAAI,CAAC,wBAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACzC,IAAI,2BAAoB,CAAC,0EAAsC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,kEAA8B,CAAC,CAAC,CAC5H,CAAC,gBAAgB,EAAE,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,6BAAsB,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,kDAA0B,EAAE,CAAC,CAAC;IACrF,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAC/E,CAAC,CAAC,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { LanguageModel, LanguageModelRequest, LanguageModelResponse, LanguageModelStreamResponse, LanguageModelTextResponse, TokenUsageService, UserRequest, LanguageModelStatus } from '@theia/ai-core';
|
|
2
|
-
import { CancellationToken } from '@theia/core';
|
|
3
|
-
import { Anthropic } from '@anthropic-ai/sdk';
|
|
4
|
-
export declare const DEFAULT_MAX_TOKENS = 4096;
|
|
5
|
-
/**
|
|
6
|
-
* If possible adds a cache control to the last message in the conversation.
|
|
7
|
-
* This is used to enable incremental caching of the conversation.
|
|
8
|
-
* @param messages The messages to process
|
|
9
|
-
* @returns A new messages array with the last message adapted to include cache control. If no cache control can be added, the original messages are returned.
|
|
10
|
-
* In any case, the original messages are not modified
|
|
11
|
-
*/
|
|
12
|
-
export declare function addCacheControlToLastMessage(messages: Anthropic.Messages.MessageParam[]): Anthropic.Messages.MessageParam[];
|
|
13
|
-
export declare const AnthropicModelIdentifier: unique symbol;
|
|
14
|
-
/**
|
|
15
|
-
* Implements the Anthropic language model integration for Theia
|
|
16
|
-
*/
|
|
17
|
-
export declare class AnthropicModel implements LanguageModel {
|
|
18
|
-
readonly id: string;
|
|
19
|
-
model: string;
|
|
20
|
-
status: LanguageModelStatus;
|
|
21
|
-
enableStreaming: boolean;
|
|
22
|
-
useCaching: boolean;
|
|
23
|
-
apiKey: () => string | undefined;
|
|
24
|
-
maxTokens: number;
|
|
25
|
-
maxRetries: number;
|
|
26
|
-
protected readonly tokenUsageService?: TokenUsageService | undefined;
|
|
27
|
-
protected proxy?: string | undefined;
|
|
28
|
-
constructor(id: string, model: string, status: LanguageModelStatus, enableStreaming: boolean, useCaching: boolean, apiKey: () => string | undefined, maxTokens?: number, maxRetries?: number, tokenUsageService?: TokenUsageService | undefined, proxy?: string | undefined);
|
|
29
|
-
protected getSettings(request: LanguageModelRequest): Readonly<Record<string, unknown>>;
|
|
30
|
-
request(request: UserRequest, cancellationToken?: CancellationToken): Promise<LanguageModelResponse>;
|
|
31
|
-
protected handleStreamingRequest(anthropic: Anthropic, request: UserRequest, cancellationToken?: CancellationToken, toolMessages?: readonly Anthropic.Messages.MessageParam[]): Promise<LanguageModelStreamResponse>;
|
|
32
|
-
protected createTools(request: LanguageModelRequest): Anthropic.Messages.Tool[] | undefined;
|
|
33
|
-
protected handleNonStreamingRequest(anthropic: Anthropic, request: UserRequest): Promise<LanguageModelTextResponse>;
|
|
34
|
-
protected initializeAnthropic(): Anthropic;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=anthropic-language-model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-language-model.d.ts","sourceRoot":"","sources":["../../src/node/anthropic-language-model.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,aAAa,EACb,oBAAoB,EAEpB,qBAAqB,EACrB,2BAA2B,EAE3B,yBAAyB,EACzB,iBAAiB,EAEjB,WAAW,EAIX,mBAAmB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAW,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,eAAO,MAAM,kBA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