@stratix/ai-openai 0.7.5 → 0.8.0
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/dist/OpenAIProvider.d.ts +57 -39
- package/dist/OpenAIProvider.d.ts.map +1 -1
- package/dist/OpenAIProvider.js +46 -62
- package/dist/OpenAIProvider.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/OpenAIProvider.d.ts
CHANGED
|
@@ -1,79 +1,97 @@
|
|
|
1
1
|
import type { LLMProvider, ChatParams, ChatResponse, ChatChunk, EmbeddingParams, EmbeddingResponse } from '@stratix/core';
|
|
2
2
|
import type { TokenUsage } from '@stratix/core';
|
|
3
|
+
/**
|
|
4
|
+
* Model configuration with optional pricing information
|
|
5
|
+
*/
|
|
6
|
+
export interface ModelConfig {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly pricing?: {
|
|
9
|
+
readonly input: number;
|
|
10
|
+
readonly output: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Configuration for OpenAIProvider
|
|
15
|
+
*/
|
|
16
|
+
export interface OpenAIConfig {
|
|
17
|
+
readonly apiKey: string;
|
|
18
|
+
readonly organization?: string;
|
|
19
|
+
readonly baseURL?: string;
|
|
20
|
+
readonly models: ModelConfig[];
|
|
21
|
+
}
|
|
3
22
|
/**
|
|
4
23
|
* OpenAI provider implementation for Stratix AI Agents.
|
|
5
24
|
*
|
|
25
|
+
* Requires explicit model configuration - no defaults provided.
|
|
6
26
|
* Supports GPT-4, GPT-3.5, and embeddings models with function calling and streaming.
|
|
7
27
|
*
|
|
8
|
-
* @example
|
|
28
|
+
* @example Using predefined model constants
|
|
9
29
|
* ```typescript
|
|
30
|
+
* import { OpenAIProvider, OPENAI_MODELS } from '@stratix/ai-openai';
|
|
31
|
+
*
|
|
10
32
|
* const provider = new OpenAIProvider({
|
|
11
33
|
* apiKey: process.env.OPENAI_API_KEY!,
|
|
12
|
-
* organization: 'org-123'
|
|
34
|
+
* organization: 'org-123',
|
|
35
|
+
* models: [
|
|
36
|
+
* { name: gpt-5.2, pricing: { input: 1.75, output: 14.0 } },
|
|
37
|
+
* { name: gpt-5.1, pricing: { input: 1.25, output: 10.0 } }
|
|
38
|
+
* ]
|
|
13
39
|
* });
|
|
14
40
|
*
|
|
15
41
|
* const response = await provider.chat({
|
|
16
|
-
* model: 'gpt-
|
|
17
|
-
* messages: [
|
|
18
|
-
* { role: 'user', content: 'Hello!', timestamp: new Date() }
|
|
19
|
-
* ],
|
|
20
|
-
* temperature: 0.7
|
|
42
|
+
* model: 'gpt-4o',
|
|
43
|
+
* messages: [{ role: 'user', content: 'Hello!', timestamp: new Date() }]
|
|
21
44
|
* });
|
|
22
45
|
* ```
|
|
23
46
|
*
|
|
24
|
-
* @example
|
|
47
|
+
* @example Custom models with updated pricing
|
|
25
48
|
* ```typescript
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* }
|
|
30
|
-
*
|
|
31
|
-
*
|
|
49
|
+
* const provider = new OpenAIProvider({
|
|
50
|
+
* apiKey: process.env.OPENAI_API_KEY!,
|
|
51
|
+
* models: [
|
|
52
|
+
* { name: 'gpt-4o', pricing: { input: 6.0, output: 22.0 } },
|
|
53
|
+
* { name: 'gpt-5', pricing: { input: 50.0, output: 150.0 } }
|
|
54
|
+
* ]
|
|
55
|
+
* });
|
|
32
56
|
* ```
|
|
33
57
|
*
|
|
34
|
-
* @example
|
|
58
|
+
* @example Without pricing (calculateCost returns 0)
|
|
35
59
|
* ```typescript
|
|
36
|
-
* const
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* name: '
|
|
41
|
-
*
|
|
42
|
-
* parameters: {
|
|
43
|
-
* type: 'object',
|
|
44
|
-
* properties: { city: { type: 'string' } }
|
|
45
|
-
* }
|
|
46
|
-
* }]
|
|
60
|
+
* const provider = new OpenAIProvider({
|
|
61
|
+
* apiKey: process.env.OPENAI_API_KEY!,
|
|
62
|
+
* models: [
|
|
63
|
+
* { name: 'gpt-4o' },
|
|
64
|
+
* { name: 'gpt-4o-mini' }
|
|
65
|
+
* ]
|
|
47
66
|
* });
|
|
48
67
|
* ```
|
|
49
68
|
*
|
|
50
|
-
* @example
|
|
69
|
+
* @example Streaming
|
|
51
70
|
* ```typescript
|
|
52
|
-
* const
|
|
53
|
-
* model: '
|
|
54
|
-
*
|
|
55
|
-
* })
|
|
56
|
-
*
|
|
71
|
+
* for await (const chunk of provider.streamChat({
|
|
72
|
+
* model: 'gpt-4o',
|
|
73
|
+
* messages: [{ role: 'user', content: 'Write a story', timestamp: new Date() }]
|
|
74
|
+
* })) {
|
|
75
|
+
* process.stdout.write(chunk.content);
|
|
76
|
+
* }
|
|
57
77
|
* ```
|
|
58
78
|
*/
|
|
59
79
|
export declare class OpenAIProvider implements LLMProvider {
|
|
60
80
|
readonly name = "openai";
|
|
61
81
|
readonly models: string[];
|
|
62
82
|
private client;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
organization?: string;
|
|
66
|
-
baseURL?: string;
|
|
67
|
-
});
|
|
83
|
+
private pricing;
|
|
84
|
+
constructor(config: OpenAIConfig);
|
|
68
85
|
chat(params: ChatParams): Promise<ChatResponse>;
|
|
69
86
|
streamChat(params: ChatParams): AsyncIterable<ChatChunk>;
|
|
70
87
|
embeddings(params: EmbeddingParams): Promise<EmbeddingResponse>;
|
|
71
88
|
/**
|
|
72
|
-
* Calculates the cost of a chat completion based on token usage
|
|
89
|
+
* Calculates the cost of a chat completion based on token usage.
|
|
90
|
+
* Returns 0 if no pricing information is available for the model.
|
|
73
91
|
*
|
|
74
92
|
* @param model - The model used
|
|
75
93
|
* @param usage - Token usage information
|
|
76
|
-
* @returns Cost in USD
|
|
94
|
+
* @returns Cost in USD, or 0 if pricing not configured
|
|
77
95
|
*/
|
|
78
96
|
calculateCost(model: string, usage: TokenUsage): number;
|
|
79
97
|
private convertMessages;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAIProvider.d.ts","sourceRoot":"","sources":["../src/OpenAIProvider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,EACT,eAAe,EACf,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAgB,UAAU,EAAY,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"OpenAIProvider.d.ts","sourceRoot":"","sources":["../src/OpenAIProvider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,EACT,eAAe,EACf,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAgB,UAAU,EAAY,MAAM,eAAe,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,qBAAa,cAAe,YAAW,WAAW;IAChD,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAE1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAiD;gBAEpD,MAAM,EAAE,YAAY;IAmB1B,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;IAuC9C,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC;IAuBzD,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAoBrE;;;;;;;OAOG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM;IAYvD,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,qBAAqB;IA2B7B,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,eAAe;CAgBxB"}
|
package/dist/OpenAIProvider.js
CHANGED
|
@@ -1,90 +1,74 @@
|
|
|
1
1
|
import OpenAI from 'openai';
|
|
2
|
-
/**
|
|
3
|
-
* Pricing per 1M tokens for OpenAI models (as of January 2025)
|
|
4
|
-
* Source: https://openai.com/api/pricing/
|
|
5
|
-
* Update these values as pricing changes
|
|
6
|
-
*/
|
|
7
|
-
const MODEL_PRICING = {
|
|
8
|
-
'gpt-4o': { input: 5.0, output: 20.0 },
|
|
9
|
-
'gpt-4o-mini': { input: 0.6, output: 2.4 },
|
|
10
|
-
'gpt-4': { input: 30.0, output: 60.0 },
|
|
11
|
-
'gpt-4-turbo': { input: 10.0, output: 30.0 },
|
|
12
|
-
'gpt-4-turbo-preview': { input: 10.0, output: 30.0 },
|
|
13
|
-
'gpt-3.5-turbo': { input: 0.5, output: 1.5 },
|
|
14
|
-
'gpt-3.5-turbo-16k': { input: 3.0, output: 4.0 },
|
|
15
|
-
'text-embedding-3-small': { input: 0.02, output: 0 },
|
|
16
|
-
'text-embedding-3-large': { input: 0.13, output: 0 },
|
|
17
|
-
'text-embedding-ada-002': { input: 0.1, output: 0 },
|
|
18
|
-
};
|
|
19
2
|
/**
|
|
20
3
|
* OpenAI provider implementation for Stratix AI Agents.
|
|
21
4
|
*
|
|
5
|
+
* Requires explicit model configuration - no defaults provided.
|
|
22
6
|
* Supports GPT-4, GPT-3.5, and embeddings models with function calling and streaming.
|
|
23
7
|
*
|
|
24
|
-
* @example
|
|
8
|
+
* @example Using predefined model constants
|
|
25
9
|
* ```typescript
|
|
10
|
+
* import { OpenAIProvider, OPENAI_MODELS } from '@stratix/ai-openai';
|
|
11
|
+
*
|
|
26
12
|
* const provider = new OpenAIProvider({
|
|
27
13
|
* apiKey: process.env.OPENAI_API_KEY!,
|
|
28
|
-
* organization: 'org-123'
|
|
14
|
+
* organization: 'org-123',
|
|
15
|
+
* models: [
|
|
16
|
+
* { name: gpt-5.2, pricing: { input: 1.75, output: 14.0 } },
|
|
17
|
+
* { name: gpt-5.1, pricing: { input: 1.25, output: 10.0 } }
|
|
18
|
+
* ]
|
|
29
19
|
* });
|
|
30
20
|
*
|
|
31
21
|
* const response = await provider.chat({
|
|
32
|
-
* model: 'gpt-
|
|
33
|
-
* messages: [
|
|
34
|
-
* { role: 'user', content: 'Hello!', timestamp: new Date() }
|
|
35
|
-
* ],
|
|
36
|
-
* temperature: 0.7
|
|
22
|
+
* model: 'gpt-4o',
|
|
23
|
+
* messages: [{ role: 'user', content: 'Hello!', timestamp: new Date() }]
|
|
37
24
|
* });
|
|
38
25
|
* ```
|
|
39
26
|
*
|
|
40
|
-
* @example
|
|
27
|
+
* @example Custom models with updated pricing
|
|
41
28
|
* ```typescript
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* }
|
|
46
|
-
*
|
|
47
|
-
*
|
|
29
|
+
* const provider = new OpenAIProvider({
|
|
30
|
+
* apiKey: process.env.OPENAI_API_KEY!,
|
|
31
|
+
* models: [
|
|
32
|
+
* { name: 'gpt-4o', pricing: { input: 6.0, output: 22.0 } },
|
|
33
|
+
* { name: 'gpt-5', pricing: { input: 50.0, output: 150.0 } }
|
|
34
|
+
* ]
|
|
35
|
+
* });
|
|
48
36
|
* ```
|
|
49
37
|
*
|
|
50
|
-
* @example
|
|
38
|
+
* @example Without pricing (calculateCost returns 0)
|
|
51
39
|
* ```typescript
|
|
52
|
-
* const
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* name: '
|
|
57
|
-
*
|
|
58
|
-
* parameters: {
|
|
59
|
-
* type: 'object',
|
|
60
|
-
* properties: { city: { type: 'string' } }
|
|
61
|
-
* }
|
|
62
|
-
* }]
|
|
40
|
+
* const provider = new OpenAIProvider({
|
|
41
|
+
* apiKey: process.env.OPENAI_API_KEY!,
|
|
42
|
+
* models: [
|
|
43
|
+
* { name: 'gpt-4o' },
|
|
44
|
+
* { name: 'gpt-4o-mini' }
|
|
45
|
+
* ]
|
|
63
46
|
* });
|
|
64
47
|
* ```
|
|
65
48
|
*
|
|
66
|
-
* @example
|
|
49
|
+
* @example Streaming
|
|
67
50
|
* ```typescript
|
|
68
|
-
* const
|
|
69
|
-
* model: '
|
|
70
|
-
*
|
|
71
|
-
* })
|
|
72
|
-
*
|
|
51
|
+
* for await (const chunk of provider.streamChat({
|
|
52
|
+
* model: 'gpt-4o',
|
|
53
|
+
* messages: [{ role: 'user', content: 'Write a story', timestamp: new Date() }]
|
|
54
|
+
* })) {
|
|
55
|
+
* process.stdout.write(chunk.content);
|
|
56
|
+
* }
|
|
73
57
|
* ```
|
|
74
58
|
*/
|
|
75
59
|
export class OpenAIProvider {
|
|
76
60
|
name = 'openai';
|
|
77
|
-
models
|
|
78
|
-
'gpt-4o',
|
|
79
|
-
'gpt-4o-mini',
|
|
80
|
-
'gpt-4',
|
|
81
|
-
'gpt-4-turbo',
|
|
82
|
-
'gpt-4-turbo-preview',
|
|
83
|
-
'gpt-3.5-turbo',
|
|
84
|
-
'gpt-3.5-turbo-16k',
|
|
85
|
-
];
|
|
61
|
+
models;
|
|
86
62
|
client;
|
|
63
|
+
pricing;
|
|
87
64
|
constructor(config) {
|
|
65
|
+
if (!config.models || config.models.length === 0) {
|
|
66
|
+
throw new Error('OpenAIProvider requires at least one model to be configured');
|
|
67
|
+
}
|
|
68
|
+
this.models = config.models.map((m) => m.name);
|
|
69
|
+
this.pricing = new Map(config.models
|
|
70
|
+
.filter((m) => m.pricing !== undefined)
|
|
71
|
+
.map((m) => [m.name, m.pricing]));
|
|
88
72
|
this.client = new OpenAI({
|
|
89
73
|
apiKey: config.apiKey,
|
|
90
74
|
organization: config.organization,
|
|
@@ -161,16 +145,16 @@ export class OpenAIProvider {
|
|
|
161
145
|
};
|
|
162
146
|
}
|
|
163
147
|
/**
|
|
164
|
-
* Calculates the cost of a chat completion based on token usage
|
|
148
|
+
* Calculates the cost of a chat completion based on token usage.
|
|
149
|
+
* Returns 0 if no pricing information is available for the model.
|
|
165
150
|
*
|
|
166
151
|
* @param model - The model used
|
|
167
152
|
* @param usage - Token usage information
|
|
168
|
-
* @returns Cost in USD
|
|
153
|
+
* @returns Cost in USD, or 0 if pricing not configured
|
|
169
154
|
*/
|
|
170
155
|
calculateCost(model, usage) {
|
|
171
|
-
const pricing =
|
|
156
|
+
const pricing = this.pricing.get(model);
|
|
172
157
|
if (!pricing) {
|
|
173
|
-
console.warn(`No pricing information for model: ${model}`);
|
|
174
158
|
return 0;
|
|
175
159
|
}
|
|
176
160
|
const inputCost = (usage.promptTokens / 1_000_000) * pricing.input;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAIProvider.js","sourceRoot":"","sources":["../src/OpenAIProvider.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"OpenAIProvider.js","sourceRoot":"","sources":["../src/OpenAIProvider.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAgC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,OAAO,cAAc;IAChB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AAC;YAEF,OAAO;gBACL,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE;oBACX,IAAI,EAAE,iBAAiB;oBACvB,MAAM,EAAE,yBAAyB;oBACjC,MAAM,EAAE,IAAI;iBACb;aACF,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAEO,gBAAgB,CACtB,SAAkE;QAElE,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC5B,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI;YACtB,mEAAmE;YACnE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;SAC7C,CAAC,CAAC,CAAC;IACN,CAAC;IAEO,eAAe,CACrB,MAAiC;QAEjC,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,MAAM;gBACT,OAAO,MAAM,CAAC;YAChB,KAAK,QAAQ;gBACX,OAAO,QAAQ,CAAC;YAClB,KAAK,YAAY;gBACf,OAAO,YAAY,CAAC;YACtB,KAAK,gBAAgB;gBACnB,OAAO,gBAAgB,CAAC;YAC1B;gBACE,OAAO,MAAM,CAAC;QAClB,CAAC;IACH,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stratix/ai-openai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Stratix AI Agents - OpenAI Provider",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"openai": "^4.75.0",
|
|
43
|
-
"@stratix/core": "^0.
|
|
43
|
+
"@stratix/core": "^0.8.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^20.0.0",
|