@l10nmonster/helpers-anthropic 3.0.0-alpha.5 → 3.0.0-alpha.6
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/.releaserc.json +31 -0
- package/CHANGELOG.md +6 -0
- package/anthropicAgent.js +3 -3
- package/package.json +1 -1
package/.releaserc.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": [
|
|
3
|
+
"main",
|
|
4
|
+
{
|
|
5
|
+
"name": "next",
|
|
6
|
+
"prerelease": "alpha"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "beta",
|
|
10
|
+
"prerelease": "beta"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"tagFormat": "@l10nmonster/helpers-anthropic@${version}",
|
|
14
|
+
"plugins": [
|
|
15
|
+
"@semantic-release/commit-analyzer",
|
|
16
|
+
"@semantic-release/release-notes-generator",
|
|
17
|
+
{
|
|
18
|
+
"path": "@semantic-release/changelog",
|
|
19
|
+
"changelogFile": "CHANGELOG.md"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "@semantic-release/npm",
|
|
23
|
+
"npmPublish": true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "@semantic-release/git",
|
|
27
|
+
"assets": ["CHANGELOG.md", "package.json"],
|
|
28
|
+
"message": "chore(release): @l10nmonster/helpers-anthropic@${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
package/CHANGELOG.md
ADDED
package/anthropicAgent.js
CHANGED
|
@@ -2,7 +2,7 @@ import { AnthropicVertex } from '@anthropic-ai/vertex-sdk';
|
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
3
|
import { GoogleAuth } from 'google-auth-library';
|
|
4
4
|
|
|
5
|
-
import { logInfo,
|
|
5
|
+
import { logInfo, logWarn, providers, styleString } from '../core/index.js';
|
|
6
6
|
|
|
7
7
|
const TRANSLATION_TOOL = {
|
|
8
8
|
name: 'provide_translations',
|
|
@@ -30,7 +30,7 @@ const TRANSLATION_TOOL = {
|
|
|
30
30
|
/**
|
|
31
31
|
* @typedef {object} AnthropicAgentOptions
|
|
32
32
|
* @extends LLMTranslationProviderOptions
|
|
33
|
-
* @property {string} [apiKey] - The Anthropic API key (if using direct API).
|
|
33
|
+
* @property {Promise<string>|string} [apiKey] - The Anthropic API key (if using direct API).
|
|
34
34
|
* @property {string} [vertexProject] - The VertexAI project ID.
|
|
35
35
|
* @property {string} [vertexLocation] - The VertexAI datacenter location.
|
|
36
36
|
* @property {number} [maxTokens] - Maximum number of output tokens (32000 by default)
|
|
@@ -69,7 +69,7 @@ export class AnthropicAgent extends providers.LLMTranslationProvider {
|
|
|
69
69
|
if (this.#apiKey) {
|
|
70
70
|
// Direct Anthropic API
|
|
71
71
|
this.#client = new Anthropic({
|
|
72
|
-
apiKey: this.#apiKey,
|
|
72
|
+
apiKey: await this.#apiKey,
|
|
73
73
|
maxRetries: this.#maxRetries,
|
|
74
74
|
timeout: 15 * 60000, // 15 minutes
|
|
75
75
|
});
|