@robota-sdk/agent-provider-openai 3.1.2 → 3.2.2
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @robota-sdk/agent-provider-openai
|
|
2
2
|
|
|
3
|
+
## 3.2.2
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 8d05c9b: Allow compatible SDK dependencies to update independently.
|
|
7
|
+
- Updated dependencies [8d05c9b]
|
|
8
|
+
- @robota-sdk/agent-provider-openai-compatible@3.2.2
|
|
9
|
+
|
|
10
|
+
## 3.2.1
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- @robota-sdk/agent-core@3.2.1
|
|
14
|
+
- @robota-sdk/agent-provider-openai-compatible@3.2.1
|
|
15
|
+
|
|
16
|
+
## 3.2.0
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [ffaf7d5]
|
|
20
|
+
- @robota-sdk/agent-core@3.2.0
|
|
21
|
+
- @robota-sdk/agent-provider-openai-compatible@3.2.0
|
|
22
|
+
|
|
3
23
|
## 3.1.2
|
|
4
24
|
### Patch Changes
|
|
5
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robota-sdk/agent-provider-openai",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "OpenAI provider implementation for Robota SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"openai": "^6.0.0",
|
|
66
|
-
"@robota-sdk/agent-
|
|
67
|
-
"@robota-sdk/agent-
|
|
66
|
+
"@robota-sdk/agent-core": "^3.2.1",
|
|
67
|
+
"@robota-sdk/agent-provider-openai-compatible": "^3.2.2"
|
|
68
68
|
},
|
|
69
69
|
"volta": {
|
|
70
70
|
"extends": "../../package.json"
|
|
@@ -82,7 +82,6 @@
|
|
|
82
82
|
"build:js": "pnpm run build",
|
|
83
83
|
"build:types": "pnpm run build",
|
|
84
84
|
"typecheck": "tsgo --noEmit && tsgo -p tsconfig.examples.json --noEmit",
|
|
85
|
-
"scenario:verify": "pnpm typecheck",
|
|
86
85
|
"scenario:verify:tool-schema-projection": "pnpm exec tsx --conditions=source examples/verify-tool-schema-projection.ts",
|
|
87
86
|
"test": "vitest run --passWithNoTests",
|
|
88
87
|
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
loadVercelAiGatewayModelEffortConfig,
|
|
5
|
-
resolveVercelAiGatewayModelEffortConfig,
|
|
6
|
-
VERCEL_AI_GATEWAY_BASE_URL,
|
|
7
|
-
VERCEL_AI_GATEWAY_MODEL,
|
|
8
|
-
} from './model-effort-verification-config';
|
|
9
|
-
|
|
10
|
-
describe('resolveVercelAiGatewayModelEffortConfig', () => {
|
|
11
|
-
it('uses the Gateway credential while selecting the model itself', () => {
|
|
12
|
-
expect(resolveVercelAiGatewayModelEffortConfig({ AI_GATEWAY_API_KEY: 'test-key' })).toEqual({
|
|
13
|
-
apiKey: 'test-key',
|
|
14
|
-
baseURL: VERCEL_AI_GATEWAY_BASE_URL,
|
|
15
|
-
model: VERCEL_AI_GATEWAY_MODEL,
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('rejects a missing Gateway credential without accepting a user-supplied model', () => {
|
|
20
|
-
expect(() => resolveVercelAiGatewayModelEffortConfig({})).toThrow(
|
|
21
|
-
'AI_GATEWAY_API_KEY is required',
|
|
22
|
-
);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('loads the ignored environment file before resolving the Gateway credential', () => {
|
|
26
|
-
const environment: Record<string, string | undefined> = {};
|
|
27
|
-
const loadEnvironmentFile = vi.fn(() => {
|
|
28
|
-
environment.AI_GATEWAY_API_KEY = 'test-key';
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
expect(
|
|
32
|
-
loadVercelAiGatewayModelEffortConfig(
|
|
33
|
-
environment,
|
|
34
|
-
'/workspace/.env.local',
|
|
35
|
-
() => true,
|
|
36
|
-
loadEnvironmentFile,
|
|
37
|
-
),
|
|
38
|
-
).toMatchObject({
|
|
39
|
-
apiKey: 'test-key',
|
|
40
|
-
baseURL: VERCEL_AI_GATEWAY_BASE_URL,
|
|
41
|
-
model: VERCEL_AI_GATEWAY_MODEL,
|
|
42
|
-
});
|
|
43
|
-
expect(loadEnvironmentFile).toHaveBeenCalledWith('/workspace/.env.local');
|
|
44
|
-
});
|
|
45
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
|
-
|
|
3
|
-
export const VERCEL_AI_GATEWAY_BASE_URL = 'https://ai-gateway.vercel.sh/v1';
|
|
4
|
-
export const VERCEL_AI_GATEWAY_MODEL = 'openai/gpt-5';
|
|
5
|
-
|
|
6
|
-
export interface IVercelAiGatewayModelEffortConfig {
|
|
7
|
-
apiKey: string;
|
|
8
|
-
baseURL: string;
|
|
9
|
-
model: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function resolveVercelAiGatewayModelEffortConfig(
|
|
13
|
-
environment: Readonly<Record<string, string | undefined>>,
|
|
14
|
-
): IVercelAiGatewayModelEffortConfig {
|
|
15
|
-
const apiKey = environment.AI_GATEWAY_API_KEY;
|
|
16
|
-
if (apiKey === undefined || apiKey.length === 0) {
|
|
17
|
-
throw new Error('AI_GATEWAY_API_KEY is required');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
apiKey,
|
|
22
|
-
baseURL: VERCEL_AI_GATEWAY_BASE_URL,
|
|
23
|
-
model: VERCEL_AI_GATEWAY_MODEL,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function loadVercelAiGatewayModelEffortConfig(
|
|
28
|
-
environment: Record<string, string | undefined>,
|
|
29
|
-
environmentFilePath: string,
|
|
30
|
-
environmentFileExists: (path: string) => boolean = existsSync,
|
|
31
|
-
loadEnvironmentFile: (path: string) => void = process.loadEnvFile,
|
|
32
|
-
): IVercelAiGatewayModelEffortConfig {
|
|
33
|
-
if (environmentFileExists(environmentFilePath)) loadEnvironmentFile(environmentFilePath);
|
|
34
|
-
return resolveVercelAiGatewayModelEffortConfig(environment);
|
|
35
|
-
}
|