@effect/ai-openai-compat 4.0.0-beta.66 → 4.0.0-beta.68
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/OpenAiClient.d.ts +181 -42
- package/dist/OpenAiClient.d.ts.map +1 -1
- package/dist/OpenAiClient.js +42 -6
- package/dist/OpenAiClient.js.map +1 -1
- package/dist/OpenAiConfig.d.ts +56 -8
- package/dist/OpenAiConfig.d.ts.map +1 -1
- package/dist/OpenAiConfig.js +35 -4
- package/dist/OpenAiConfig.js.map +1 -1
- package/dist/OpenAiEmbeddingModel.d.ts +14 -9
- package/dist/OpenAiEmbeddingModel.d.ts.map +1 -1
- package/dist/OpenAiEmbeddingModel.js +9 -6
- package/dist/OpenAiEmbeddingModel.js.map +1 -1
- package/dist/OpenAiError.d.ts +85 -3
- package/dist/OpenAiError.d.ts.map +1 -1
- package/dist/OpenAiError.js +14 -1
- package/dist/OpenAiLanguageModel.d.ts +209 -12
- package/dist/OpenAiLanguageModel.d.ts.map +1 -1
- package/dist/OpenAiLanguageModel.js +9 -7
- package/dist/OpenAiLanguageModel.js.map +1 -1
- package/dist/OpenAiTelemetry.d.ts +17 -14
- package/dist/OpenAiTelemetry.d.ts.map +1 -1
- package/dist/OpenAiTelemetry.js +3 -3
- package/dist/OpenAiTelemetry.js.map +1 -1
- package/dist/index.d.ts +63 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -7
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/OpenAiClient.ts +205 -43
- package/src/OpenAiConfig.ts +56 -8
- package/src/OpenAiEmbeddingModel.ts +16 -11
- package/src/OpenAiError.ts +85 -3
- package/src/OpenAiLanguageModel.ts +212 -15
- package/src/OpenAiTelemetry.ts +18 -15
- package/src/index.ts +63 -7
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides a LanguageModel implementation for OpenAI's chat completions API,
|
|
5
5
|
* supporting text generation, structured output, tool calling, and streaming.
|
|
6
6
|
*
|
|
7
|
-
* @since
|
|
7
|
+
* @since 4.0.0
|
|
8
8
|
*/
|
|
9
9
|
import * as Context from "effect/Context";
|
|
10
10
|
import * as Effect from "effect/Effect";
|
|
@@ -63,13 +63,22 @@ declare const Config_base: Context.ServiceClass<Config, "@effect/ai-openai-compa
|
|
|
63
63
|
/**
|
|
64
64
|
* Service definition for OpenAI language model configuration.
|
|
65
65
|
*
|
|
66
|
-
* @since 1.0.0
|
|
67
66
|
* @category context
|
|
67
|
+
* @since 4.0.0
|
|
68
68
|
*/
|
|
69
69
|
export declare class Config extends Config_base {
|
|
70
70
|
}
|
|
71
71
|
declare module "effect/unstable/ai/Prompt" {
|
|
72
|
+
/**
|
|
73
|
+
* OpenAI-compatible options for file prompt parts.
|
|
74
|
+
*
|
|
75
|
+
* @category request
|
|
76
|
+
* @since 4.0.0
|
|
77
|
+
*/
|
|
72
78
|
interface FilePartOptions extends ProviderOptions {
|
|
79
|
+
/**
|
|
80
|
+
* Provider-specific file options for OpenAI-compatible APIs.
|
|
81
|
+
*/
|
|
73
82
|
readonly openai?: {
|
|
74
83
|
/**
|
|
75
84
|
* The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
|
|
@@ -77,7 +86,16 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
77
86
|
readonly imageDetail?: ImageDetail | null;
|
|
78
87
|
} | null;
|
|
79
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* OpenAI-compatible options for reasoning prompt parts.
|
|
91
|
+
*
|
|
92
|
+
* @category request
|
|
93
|
+
* @since 4.0.0
|
|
94
|
+
*/
|
|
80
95
|
interface ReasoningPartOptions extends ProviderOptions {
|
|
96
|
+
/**
|
|
97
|
+
* Provider-specific reasoning options for OpenAI-compatible APIs.
|
|
98
|
+
*/
|
|
81
99
|
readonly openai?: {
|
|
82
100
|
/**
|
|
83
101
|
* The ID of the item to reference.
|
|
@@ -91,38 +109,65 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
91
109
|
readonly encryptedContent?: string | null;
|
|
92
110
|
} | null;
|
|
93
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* OpenAI-compatible options for assistant tool-call prompt parts.
|
|
114
|
+
*
|
|
115
|
+
* @category request
|
|
116
|
+
* @since 4.0.0
|
|
117
|
+
*/
|
|
94
118
|
interface ToolCallPartOptions extends ProviderOptions {
|
|
119
|
+
/**
|
|
120
|
+
* Provider-specific tool-call options for OpenAI-compatible APIs.
|
|
121
|
+
*/
|
|
95
122
|
readonly openai?: {
|
|
96
123
|
/**
|
|
97
124
|
* The ID of the item to reference.
|
|
98
125
|
*/
|
|
99
126
|
readonly itemId?: string | null;
|
|
100
127
|
/**
|
|
101
|
-
* The status
|
|
128
|
+
* The status to send for the tool-call item.
|
|
102
129
|
*/
|
|
103
130
|
readonly status?: MessageStatus | null;
|
|
104
131
|
} | null;
|
|
105
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* OpenAI-compatible options for tool-result prompt parts.
|
|
135
|
+
*
|
|
136
|
+
* @category request
|
|
137
|
+
* @since 4.0.0
|
|
138
|
+
*/
|
|
106
139
|
interface ToolResultPartOptions extends ProviderOptions {
|
|
140
|
+
/**
|
|
141
|
+
* Provider-specific tool-result options for OpenAI-compatible APIs.
|
|
142
|
+
*/
|
|
107
143
|
readonly openai?: {
|
|
108
144
|
/**
|
|
109
145
|
* The ID of the item to reference.
|
|
110
146
|
*/
|
|
111
147
|
readonly itemId?: string | null;
|
|
112
148
|
/**
|
|
113
|
-
* The status
|
|
149
|
+
* The status to send for the tool-result item.
|
|
114
150
|
*/
|
|
115
151
|
readonly status?: MessageStatus | null;
|
|
116
152
|
} | null;
|
|
117
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* OpenAI-compatible options for text prompt parts.
|
|
156
|
+
*
|
|
157
|
+
* @category request
|
|
158
|
+
* @since 4.0.0
|
|
159
|
+
*/
|
|
118
160
|
interface TextPartOptions extends ProviderOptions {
|
|
161
|
+
/**
|
|
162
|
+
* Provider-specific text options for OpenAI-compatible APIs.
|
|
163
|
+
*/
|
|
119
164
|
readonly openai?: {
|
|
120
165
|
/**
|
|
121
166
|
* The ID of the item to reference.
|
|
122
167
|
*/
|
|
123
168
|
readonly itemId?: string | null;
|
|
124
169
|
/**
|
|
125
|
-
* The status
|
|
170
|
+
* The status to send for the text item.
|
|
126
171
|
*/
|
|
127
172
|
readonly status?: MessageStatus | null;
|
|
128
173
|
/**
|
|
@@ -133,8 +178,20 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
133
178
|
}
|
|
134
179
|
}
|
|
135
180
|
declare module "effect/unstable/ai/Response" {
|
|
181
|
+
/**
|
|
182
|
+
* OpenAI-compatible metadata attached to a complete text response part.
|
|
183
|
+
*
|
|
184
|
+
* @category response
|
|
185
|
+
* @since 4.0.0
|
|
186
|
+
*/
|
|
136
187
|
interface TextPartMetadata extends ProviderMetadata {
|
|
188
|
+
/**
|
|
189
|
+
* Provider-specific metadata returned for the text part.
|
|
190
|
+
*/
|
|
137
191
|
readonly openai?: {
|
|
192
|
+
/**
|
|
193
|
+
* The OpenAI item ID associated with the text part.
|
|
194
|
+
*/
|
|
138
195
|
readonly itemId?: string | null;
|
|
139
196
|
/**
|
|
140
197
|
* If the model emits a refusal content part, the refusal explanation
|
|
@@ -143,7 +200,7 @@ declare module "effect/unstable/ai/Response" {
|
|
|
143
200
|
*/
|
|
144
201
|
readonly refusal?: string | null;
|
|
145
202
|
/**
|
|
146
|
-
* The status
|
|
203
|
+
* The status returned for the text item.
|
|
147
204
|
*/
|
|
148
205
|
readonly status?: MessageStatus | null;
|
|
149
206
|
/**
|
|
@@ -152,47 +209,155 @@ declare module "effect/unstable/ai/Response" {
|
|
|
152
209
|
readonly annotations?: ReadonlyArray<Annotation> | null;
|
|
153
210
|
};
|
|
154
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* OpenAI-compatible metadata emitted when a streamed text part starts.
|
|
214
|
+
*
|
|
215
|
+
* @category response
|
|
216
|
+
* @since 4.0.0
|
|
217
|
+
*/
|
|
155
218
|
interface TextStartPartMetadata extends ProviderMetadata {
|
|
219
|
+
/**
|
|
220
|
+
* Provider-specific metadata returned for the streamed text start.
|
|
221
|
+
*/
|
|
156
222
|
readonly openai?: {
|
|
223
|
+
/**
|
|
224
|
+
* The OpenAI item ID associated with the streamed text part.
|
|
225
|
+
*/
|
|
157
226
|
readonly itemId?: string | null;
|
|
158
227
|
} | null;
|
|
159
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* OpenAI-compatible metadata emitted when a streamed text part ends.
|
|
231
|
+
*
|
|
232
|
+
* @category response
|
|
233
|
+
* @since 4.0.0
|
|
234
|
+
*/
|
|
160
235
|
interface TextEndPartMetadata extends ProviderMetadata {
|
|
236
|
+
/**
|
|
237
|
+
* Provider-specific metadata returned for the streamed text end.
|
|
238
|
+
*/
|
|
161
239
|
readonly openai?: {
|
|
240
|
+
/**
|
|
241
|
+
* The OpenAI item ID associated with the streamed text part.
|
|
242
|
+
*/
|
|
162
243
|
readonly itemId?: string | null;
|
|
244
|
+
/**
|
|
245
|
+
* The annotations collected for the completed streamed text part.
|
|
246
|
+
*/
|
|
163
247
|
readonly annotations?: ReadonlyArray<Annotation> | null;
|
|
164
248
|
} | null;
|
|
165
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* OpenAI-compatible metadata attached to a complete reasoning response part.
|
|
252
|
+
*
|
|
253
|
+
* @category response
|
|
254
|
+
* @since 4.0.0
|
|
255
|
+
*/
|
|
166
256
|
interface ReasoningPartMetadata extends ProviderMetadata {
|
|
257
|
+
/**
|
|
258
|
+
* Provider-specific metadata returned for the reasoning part.
|
|
259
|
+
*/
|
|
167
260
|
readonly openai?: {
|
|
261
|
+
/**
|
|
262
|
+
* The OpenAI item ID associated with the reasoning part.
|
|
263
|
+
*/
|
|
168
264
|
readonly itemId?: string | null;
|
|
265
|
+
/**
|
|
266
|
+
* Encrypted reasoning content that can be sent back in later requests.
|
|
267
|
+
*/
|
|
169
268
|
readonly encryptedContent?: string | null;
|
|
170
269
|
} | null;
|
|
171
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* OpenAI-compatible metadata emitted when a streamed reasoning part starts.
|
|
273
|
+
*
|
|
274
|
+
* @category response
|
|
275
|
+
* @since 4.0.0
|
|
276
|
+
*/
|
|
172
277
|
interface ReasoningStartPartMetadata extends ProviderMetadata {
|
|
278
|
+
/**
|
|
279
|
+
* Provider-specific metadata returned for the streamed reasoning start.
|
|
280
|
+
*/
|
|
173
281
|
readonly openai?: {
|
|
282
|
+
/**
|
|
283
|
+
* The OpenAI item ID associated with the reasoning part.
|
|
284
|
+
*/
|
|
174
285
|
readonly itemId?: string | null;
|
|
286
|
+
/**
|
|
287
|
+
* Encrypted reasoning content that can be sent back in later requests.
|
|
288
|
+
*/
|
|
175
289
|
readonly encryptedContent?: string | null;
|
|
176
290
|
} | null;
|
|
177
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* OpenAI-compatible metadata emitted for a streamed reasoning delta.
|
|
294
|
+
*
|
|
295
|
+
* @category response
|
|
296
|
+
* @since 4.0.0
|
|
297
|
+
*/
|
|
178
298
|
interface ReasoningDeltaPartMetadata extends ProviderMetadata {
|
|
299
|
+
/**
|
|
300
|
+
* Provider-specific metadata returned for the streamed reasoning delta.
|
|
301
|
+
*/
|
|
179
302
|
readonly openai?: {
|
|
303
|
+
/**
|
|
304
|
+
* The OpenAI item ID associated with the reasoning part.
|
|
305
|
+
*/
|
|
180
306
|
readonly itemId?: string | null;
|
|
181
307
|
} | null;
|
|
182
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* OpenAI-compatible metadata emitted when a streamed reasoning part ends.
|
|
311
|
+
*
|
|
312
|
+
* @category response
|
|
313
|
+
* @since 4.0.0
|
|
314
|
+
*/
|
|
183
315
|
interface ReasoningEndPartMetadata extends ProviderMetadata {
|
|
316
|
+
/**
|
|
317
|
+
* Provider-specific metadata returned for the streamed reasoning end.
|
|
318
|
+
*/
|
|
184
319
|
readonly openai?: {
|
|
320
|
+
/**
|
|
321
|
+
* The OpenAI item ID associated with the reasoning part.
|
|
322
|
+
*/
|
|
185
323
|
readonly itemId?: string | null;
|
|
324
|
+
/**
|
|
325
|
+
* Encrypted reasoning content that can be sent back in later requests.
|
|
326
|
+
*/
|
|
186
327
|
readonly encryptedContent?: string;
|
|
187
328
|
} | null;
|
|
188
329
|
}
|
|
330
|
+
/**
|
|
331
|
+
* OpenAI-compatible metadata attached to tool-call response parts.
|
|
332
|
+
*
|
|
333
|
+
* @category response
|
|
334
|
+
* @since 4.0.0
|
|
335
|
+
*/
|
|
189
336
|
interface ToolCallPartMetadata extends ProviderMetadata {
|
|
337
|
+
/**
|
|
338
|
+
* Provider-specific metadata returned for the tool call.
|
|
339
|
+
*/
|
|
190
340
|
readonly openai?: {
|
|
341
|
+
/**
|
|
342
|
+
* The OpenAI item ID associated with the tool call.
|
|
343
|
+
*/
|
|
191
344
|
readonly itemId?: string | null;
|
|
192
345
|
} | null;
|
|
193
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* OpenAI-compatible metadata attached to document source citations.
|
|
349
|
+
*
|
|
350
|
+
* @category response
|
|
351
|
+
* @since 4.0.0
|
|
352
|
+
*/
|
|
194
353
|
interface DocumentSourcePartMetadata extends ProviderMetadata {
|
|
354
|
+
/**
|
|
355
|
+
* Provider-specific citation metadata for OpenAI-compatible APIs.
|
|
356
|
+
*/
|
|
195
357
|
readonly openai?: {
|
|
358
|
+
/**
|
|
359
|
+
* Identifies a citation to an uploaded file.
|
|
360
|
+
*/
|
|
196
361
|
readonly type: "file_citation";
|
|
197
362
|
/**
|
|
198
363
|
* The index of the file in the list of files.
|
|
@@ -203,6 +368,9 @@ declare module "effect/unstable/ai/Response" {
|
|
|
203
368
|
*/
|
|
204
369
|
readonly fileId: string;
|
|
205
370
|
} | {
|
|
371
|
+
/**
|
|
372
|
+
* Identifies a citation to a generated file path.
|
|
373
|
+
*/
|
|
206
374
|
readonly type: "file_path";
|
|
207
375
|
/**
|
|
208
376
|
* The index of the file in the list of files.
|
|
@@ -213,6 +381,9 @@ declare module "effect/unstable/ai/Response" {
|
|
|
213
381
|
*/
|
|
214
382
|
readonly fileId: string;
|
|
215
383
|
} | {
|
|
384
|
+
/**
|
|
385
|
+
* Identifies a citation to a file inside a container.
|
|
386
|
+
*/
|
|
216
387
|
readonly type: "container_file_citation";
|
|
217
388
|
/**
|
|
218
389
|
* The ID of the file.
|
|
@@ -224,8 +395,20 @@ declare module "effect/unstable/ai/Response" {
|
|
|
224
395
|
readonly containerId: string;
|
|
225
396
|
} | null;
|
|
226
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* OpenAI-compatible metadata attached to URL source citations.
|
|
400
|
+
*
|
|
401
|
+
* @category response
|
|
402
|
+
* @since 4.0.0
|
|
403
|
+
*/
|
|
227
404
|
interface UrlSourcePartMetadata extends ProviderMetadata {
|
|
405
|
+
/**
|
|
406
|
+
* Provider-specific URL citation metadata for OpenAI-compatible APIs.
|
|
407
|
+
*/
|
|
228
408
|
readonly openai?: {
|
|
409
|
+
/**
|
|
410
|
+
* Identifies a citation to a URL.
|
|
411
|
+
*/
|
|
229
412
|
readonly type: "url_citation";
|
|
230
413
|
/**
|
|
231
414
|
* The index of the first character of the URL citation in the message.
|
|
@@ -237,22 +420,36 @@ declare module "effect/unstable/ai/Response" {
|
|
|
237
420
|
readonly endIndex: number;
|
|
238
421
|
} | null;
|
|
239
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* OpenAI-compatible metadata attached to finish response parts.
|
|
425
|
+
*
|
|
426
|
+
* @category response
|
|
427
|
+
* @since 4.0.0
|
|
428
|
+
*/
|
|
240
429
|
interface FinishPartMetadata extends ProviderMetadata {
|
|
430
|
+
/**
|
|
431
|
+
* Provider-specific metadata returned when generation finishes.
|
|
432
|
+
*/
|
|
241
433
|
readonly openai?: {
|
|
434
|
+
/**
|
|
435
|
+
* The service tier reported by the OpenAI-compatible provider.
|
|
436
|
+
*/
|
|
242
437
|
readonly serviceTier?: "default" | "auto" | "flex" | "scale" | "priority" | null;
|
|
243
438
|
} | null;
|
|
244
439
|
}
|
|
245
440
|
}
|
|
246
441
|
/**
|
|
247
|
-
*
|
|
442
|
+
* Creates an AI model descriptor for an OpenAI-compatible language model.
|
|
443
|
+
*
|
|
248
444
|
* @category constructors
|
|
445
|
+
* @since 4.0.0
|
|
249
446
|
*/
|
|
250
447
|
export declare const model: (model: string, config?: Omit<typeof Config.Service, "model">) => AiModel.Model<"openai", LanguageModel.LanguageModel, OpenAiClient>;
|
|
251
448
|
/**
|
|
252
449
|
* Creates an OpenAI language model service.
|
|
253
450
|
*
|
|
254
|
-
* @since 1.0.0
|
|
255
451
|
* @category constructors
|
|
452
|
+
* @since 4.0.0
|
|
256
453
|
*/
|
|
257
454
|
export declare const make: (args_0: {
|
|
258
455
|
readonly model: string;
|
|
@@ -261,8 +458,8 @@ export declare const make: (args_0: {
|
|
|
261
458
|
/**
|
|
262
459
|
* Creates a layer for the OpenAI language model.
|
|
263
460
|
*
|
|
264
|
-
* @since 1.0.0
|
|
265
461
|
* @category layers
|
|
462
|
+
* @since 4.0.0
|
|
266
463
|
*/
|
|
267
464
|
export declare const layer: (options: {
|
|
268
465
|
readonly model: string;
|
|
@@ -271,22 +468,22 @@ export declare const layer: (options: {
|
|
|
271
468
|
/**
|
|
272
469
|
* Provides config overrides for OpenAI language model operations.
|
|
273
470
|
*
|
|
274
|
-
* @since 1.0.0
|
|
275
471
|
* @category configuration
|
|
472
|
+
* @since 4.0.0
|
|
276
473
|
*/
|
|
277
474
|
export declare const withConfigOverride: {
|
|
278
475
|
/**
|
|
279
476
|
* Provides config overrides for OpenAI language model operations.
|
|
280
477
|
*
|
|
281
|
-
* @since 1.0.0
|
|
282
478
|
* @category configuration
|
|
479
|
+
* @since 4.0.0
|
|
283
480
|
*/
|
|
284
481
|
(overrides: typeof Config.Service): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Config>>;
|
|
285
482
|
/**
|
|
286
483
|
* Provides config overrides for OpenAI language model operations.
|
|
287
484
|
*
|
|
288
|
-
* @since 1.0.0
|
|
289
485
|
* @category configuration
|
|
486
|
+
* @since 4.0.0
|
|
290
487
|
*/
|
|
291
488
|
<A, E, R>(self: Effect.Effect<A, E, R>, overrides: typeof Config.Service): Effect.Effect<A, E, Exclude<R, Config>>;
|
|
292
489
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAiLanguageModel.d.ts","sourceRoot":"","sources":["../src/OpenAiLanguageModel.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAEzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAUrC,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAA;AACjE,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAA;AAQnD,OAAO,EACL,KAAK,UAAU,EAMf,KAAK,WAAW,EAGhB,KAAK,aAAa,EAClB,YAAY,EAKb,MAAM,mBAAmB,CAAA;AAG1B;;GAEG;AACH,KAAK,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAkCpB;QACd;;;;;;WAMG;QACH,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAA;KAC3D,GAAG,SAAS;IACb;;;;OAIG;;gCACyB,OAAO,GAAG,SAAS;;AA3CrD;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,WAyC8B;CAAG;AAM7D,OAAO,QAAQ,2BAA2B,CAAC;IACzC,UAAiB,eAAgB,SAAQ,eAAe;QACtD,QAAQ,CAAC,MAAM,CAAC,EAAE;YAChB;;eAEG;YACH,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,I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,EAAE,aAAa,CAAC,aAAa,EAAE,YAAY,CACX,CAAA;AAazD;;;;;GAKG;AACH,eAAO,MAAM,IAAI;oBACC,MAAM;sBACJ,IAAI,CAAC,OAAO,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAAS;+DAyFlE,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;CACnE,KAAG,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE,KAAK,EAAE,YAAY,CACN,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE;IAC/B;;;;;OAKG;IACH,CAAC,SAAS,EAAE,OAAO,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;IACtH;;;;;OAKG;IACH,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;CAwBhH,CAAA"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides a LanguageModel implementation for OpenAI's chat completions API,
|
|
5
5
|
* supporting text generation, structured output, tool calling, and streaming.
|
|
6
6
|
*
|
|
7
|
-
* @since
|
|
7
|
+
* @since 4.0.0
|
|
8
8
|
*/
|
|
9
9
|
import * as Context from "effect/Context";
|
|
10
10
|
import * as DateTime from "effect/DateTime";
|
|
@@ -31,16 +31,18 @@ import { addGenAIAnnotations } from "./OpenAiTelemetry.js";
|
|
|
31
31
|
/**
|
|
32
32
|
* Service definition for OpenAI language model configuration.
|
|
33
33
|
*
|
|
34
|
-
* @since 1.0.0
|
|
35
34
|
* @category context
|
|
35
|
+
* @since 4.0.0
|
|
36
36
|
*/
|
|
37
37
|
export class Config extends /*#__PURE__*/Context.Service()("@effect/ai-openai-compat/OpenAiLanguageModel/Config") {}
|
|
38
38
|
// =============================================================================
|
|
39
39
|
// Language Model
|
|
40
40
|
// =============================================================================
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Creates an AI model descriptor for an OpenAI-compatible language model.
|
|
43
|
+
*
|
|
43
44
|
* @category constructors
|
|
45
|
+
* @since 4.0.0
|
|
44
46
|
*/
|
|
45
47
|
export const model = (model, config) => AiModel.make("openai", model, layer({
|
|
46
48
|
model,
|
|
@@ -48,7 +50,7 @@ export const model = (model, config) => AiModel.make("openai", model, layer({
|
|
|
48
50
|
}));
|
|
49
51
|
// TODO
|
|
50
52
|
// /**
|
|
51
|
-
// * @since
|
|
53
|
+
// * @since 4.0.0
|
|
52
54
|
// * @category constructors
|
|
53
55
|
// */
|
|
54
56
|
// export const modelWithTokenizer = (
|
|
@@ -59,8 +61,8 @@ export const model = (model, config) => AiModel.make("openai", model, layer({
|
|
|
59
61
|
/**
|
|
60
62
|
* Creates an OpenAI language model service.
|
|
61
63
|
*
|
|
62
|
-
* @since 1.0.0
|
|
63
64
|
* @category constructors
|
|
65
|
+
* @since 4.0.0
|
|
64
66
|
*/
|
|
65
67
|
export const make = /*#__PURE__*/Effect.fnUntraced(function* ({
|
|
66
68
|
model,
|
|
@@ -166,15 +168,15 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* ({
|
|
|
166
168
|
/**
|
|
167
169
|
* Creates a layer for the OpenAI language model.
|
|
168
170
|
*
|
|
169
|
-
* @since 1.0.0
|
|
170
171
|
* @category layers
|
|
172
|
+
* @since 4.0.0
|
|
171
173
|
*/
|
|
172
174
|
export const layer = options => Layer.effect(LanguageModel.LanguageModel, make(options));
|
|
173
175
|
/**
|
|
174
176
|
* Provides config overrides for OpenAI language model operations.
|
|
175
177
|
*
|
|
176
|
-
* @since 1.0.0
|
|
177
178
|
* @category configuration
|
|
179
|
+
* @since 4.0.0
|
|
178
180
|
*/
|
|
179
181
|
export const withConfigOverride = /*#__PURE__*/dual(2, (self, overrides) => Effect.flatMap(Effect.serviceOption(Config), config => Effect.provideService(self, Config, {
|
|
180
182
|
...(config._tag === "Some" ? config.value : {}),
|