@effect/ai-openai 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/Generated.d.ts +1 -1
- package/dist/Generated.js +1 -1
- package/dist/OpenAiClient.d.ts +19 -12
- package/dist/OpenAiClient.d.ts.map +1 -1
- package/dist/OpenAiClient.js +11 -9
- package/dist/OpenAiClient.js.map +1 -1
- package/dist/OpenAiClientGenerated.d.ts +5 -5
- package/dist/OpenAiClientGenerated.js +5 -5
- package/dist/OpenAiConfig.d.ts +43 -8
- package/dist/OpenAiConfig.d.ts.map +1 -1
- package/dist/OpenAiConfig.js +28 -4
- package/dist/OpenAiConfig.js.map +1 -1
- package/dist/OpenAiEmbeddingModel.d.ts +13 -9
- package/dist/OpenAiEmbeddingModel.d.ts.map +1 -1
- package/dist/OpenAiEmbeddingModel.js +8 -6
- package/dist/OpenAiEmbeddingModel.js.map +1 -1
- package/dist/OpenAiError.d.ts +124 -3
- package/dist/OpenAiError.d.ts.map +1 -1
- package/dist/OpenAiError.js +1 -1
- package/dist/OpenAiLanguageModel.d.ts +208 -9
- package/dist/OpenAiLanguageModel.d.ts.map +1 -1
- package/dist/OpenAiLanguageModel.js +9 -7
- package/dist/OpenAiLanguageModel.js.map +1 -1
- package/dist/OpenAiSchema.d.ts +143 -35
- package/dist/OpenAiSchema.d.ts.map +1 -1
- package/dist/OpenAiSchema.js +72 -18
- package/dist/OpenAiSchema.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/OpenAiTool.d.ts +11 -11
- package/dist/OpenAiTool.js +10 -10
- package/dist/index.d.ts +27 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -11
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/Generated.ts +1 -1
- package/src/OpenAiClient.ts +20 -13
- package/src/OpenAiClientGenerated.ts +6 -6
- package/src/OpenAiConfig.ts +43 -8
- package/src/OpenAiEmbeddingModel.ts +15 -11
- package/src/OpenAiError.ts +124 -3
- package/src/OpenAiLanguageModel.ts +211 -12
- package/src/OpenAiSchema.ts +144 -36
- package/src/OpenAiTelemetry.ts +18 -15
- package/src/OpenAiTool.ts +11 -11
- package/src/index.ts +27 -11
package/dist/OpenAiSchema.d.ts
CHANGED
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
import * as Schema from "effect/Schema";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Schema for optional `include` values on OpenAI Responses requests.
|
|
4
|
+
*
|
|
5
|
+
* **Details**
|
|
6
|
+
* These values request additional response fields such as image URLs, encrypted reasoning content, output logprobs, code interpreter outputs, or web search sources.
|
|
7
|
+
*
|
|
8
|
+
* @category schemas
|
|
9
|
+
* @since 4.0.0
|
|
4
10
|
*/
|
|
5
11
|
export declare const IncludeEnum: Schema.Literals<readonly ["message.input_image.image_url", "reasoning.encrypted_content", "message.output_text.logprobs", "code_interpreter_call.outputs", "web_search_call.action.sources"]>;
|
|
6
12
|
/**
|
|
7
|
-
*
|
|
13
|
+
* Type of optional `include` values accepted by OpenAI Responses requests.
|
|
14
|
+
*
|
|
15
|
+
* @category models
|
|
16
|
+
* @since 4.0.0
|
|
8
17
|
*/
|
|
9
18
|
export type IncludeEnum = typeof IncludeEnum.Type;
|
|
10
19
|
/**
|
|
11
|
-
*
|
|
20
|
+
* Schema for lifecycle statuses shared by messages, reasoning items, and tool calls.
|
|
21
|
+
*
|
|
22
|
+
* @category schemas
|
|
23
|
+
* @since 4.0.0
|
|
12
24
|
*/
|
|
13
25
|
export declare const MessageStatus: Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>;
|
|
14
26
|
/**
|
|
15
|
-
*
|
|
27
|
+
* Lifecycle status shared by messages, reasoning items, and tool calls.
|
|
28
|
+
*
|
|
29
|
+
* @category models
|
|
30
|
+
* @since 4.0.0
|
|
16
31
|
*/
|
|
17
32
|
export type MessageStatus = typeof MessageStatus.Type;
|
|
18
33
|
/**
|
|
19
|
-
*
|
|
34
|
+
* Schema for content blocks accepted in OpenAI Responses input messages.
|
|
35
|
+
*
|
|
36
|
+
* @category schemas
|
|
37
|
+
* @since 4.0.0
|
|
20
38
|
*/
|
|
21
39
|
export declare const InputContent: Schema.Union<readonly [Schema.Struct<{
|
|
22
40
|
readonly type: Schema.Literal<"input_text">;
|
|
@@ -34,22 +52,34 @@ export declare const InputContent: Schema.Union<readonly [Schema.Struct<{
|
|
|
34
52
|
readonly file_data: Schema.optionalKey<Schema.String>;
|
|
35
53
|
}>]>;
|
|
36
54
|
/**
|
|
37
|
-
*
|
|
55
|
+
* Content block accepted in OpenAI Responses input messages.
|
|
56
|
+
*
|
|
57
|
+
* @category models
|
|
58
|
+
* @since 4.0.0
|
|
38
59
|
*/
|
|
39
60
|
export type InputContent = typeof InputContent.Type;
|
|
40
61
|
/**
|
|
41
|
-
*
|
|
62
|
+
* Schema for a text block containing a model-provided reasoning summary.
|
|
63
|
+
*
|
|
64
|
+
* @category schemas
|
|
65
|
+
* @since 4.0.0
|
|
42
66
|
*/
|
|
43
67
|
export declare const SummaryTextContent: Schema.Struct<{
|
|
44
68
|
readonly type: Schema.Literal<"summary_text">;
|
|
45
69
|
readonly text: Schema.String;
|
|
46
70
|
}>;
|
|
47
71
|
/**
|
|
48
|
-
*
|
|
72
|
+
* Text content block used for model-provided reasoning summaries.
|
|
73
|
+
*
|
|
74
|
+
* @category models
|
|
75
|
+
* @since 4.0.0
|
|
49
76
|
*/
|
|
50
77
|
export type SummaryTextContent = typeof SummaryTextContent.Type;
|
|
51
78
|
/**
|
|
52
|
-
*
|
|
79
|
+
* Schema for citation and file-path annotations attached to output text content.
|
|
80
|
+
*
|
|
81
|
+
* @category schemas
|
|
82
|
+
* @since 4.0.0
|
|
53
83
|
*/
|
|
54
84
|
export declare const Annotation: Schema.Union<readonly [Schema.Struct<{
|
|
55
85
|
readonly type: Schema.Literal<"file_citation">;
|
|
@@ -75,11 +105,17 @@ export declare const Annotation: Schema.Union<readonly [Schema.Struct<{
|
|
|
75
105
|
readonly index: Schema.Number;
|
|
76
106
|
}>]>;
|
|
77
107
|
/**
|
|
78
|
-
*
|
|
108
|
+
* Citation or file-path annotation attached to output text content.
|
|
109
|
+
*
|
|
110
|
+
* @category models
|
|
111
|
+
* @since 4.0.0
|
|
79
112
|
*/
|
|
80
113
|
export type Annotation = typeof Annotation.Type;
|
|
81
114
|
/**
|
|
82
|
-
*
|
|
115
|
+
* Schema for a reasoning output item containing encrypted content, summaries, and optional reasoning text.
|
|
116
|
+
*
|
|
117
|
+
* @category schemas
|
|
118
|
+
* @since 4.0.0
|
|
83
119
|
*/
|
|
84
120
|
export declare const ReasoningItem: Schema.Struct<{
|
|
85
121
|
readonly type: Schema.Literal<"reasoning">;
|
|
@@ -96,11 +132,17 @@ export declare const ReasoningItem: Schema.Struct<{
|
|
|
96
132
|
readonly status: Schema.optionalKey<Schema.Literals<readonly ["in_progress", "completed", "incomplete"]>>;
|
|
97
133
|
}>;
|
|
98
134
|
/**
|
|
99
|
-
*
|
|
135
|
+
* Reasoning output item containing encrypted content, summaries, and optional reasoning text.
|
|
136
|
+
*
|
|
137
|
+
* @category models
|
|
138
|
+
* @since 4.0.0
|
|
100
139
|
*/
|
|
101
140
|
export type ReasoningItem = typeof ReasoningItem.Type;
|
|
102
141
|
/**
|
|
103
|
-
*
|
|
142
|
+
* Schema for item shapes accepted by an OpenAI Responses request `input` field.
|
|
143
|
+
*
|
|
144
|
+
* @category schemas
|
|
145
|
+
* @since 4.0.0
|
|
104
146
|
*/
|
|
105
147
|
export declare const InputItem: Schema.Union<readonly [Schema.Struct<{
|
|
106
148
|
readonly type: Schema.optionalKey<Schema.Literal<"message">>;
|
|
@@ -263,11 +305,17 @@ export declare const InputItem: Schema.Union<readonly [Schema.Struct<{
|
|
|
263
305
|
readonly approve: Schema.Boolean;
|
|
264
306
|
}>]>;
|
|
265
307
|
/**
|
|
266
|
-
*
|
|
308
|
+
* Item shape accepted by an OpenAI Responses request `input` field.
|
|
309
|
+
*
|
|
310
|
+
* @category models
|
|
311
|
+
* @since 4.0.0
|
|
267
312
|
*/
|
|
268
313
|
export type InputItem = typeof InputItem.Type;
|
|
269
314
|
/**
|
|
270
|
-
*
|
|
315
|
+
* Schema for tool definitions that can be supplied to an OpenAI Responses request.
|
|
316
|
+
*
|
|
317
|
+
* @category schemas
|
|
318
|
+
* @since 4.0.0
|
|
271
319
|
*/
|
|
272
320
|
export declare const Tool: Schema.Union<readonly [Schema.Struct<{
|
|
273
321
|
readonly type: Schema.Literal<"function">;
|
|
@@ -284,11 +332,17 @@ export declare const Tool: Schema.Union<readonly [Schema.Struct<{
|
|
|
284
332
|
readonly type: Schema.Literals<readonly ["apply_patch", "code_interpreter", "file_search", "image_generation", "local_shell", "mcp", "shell", "web_search", "web_search_preview"]>;
|
|
285
333
|
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>;
|
|
286
334
|
/**
|
|
287
|
-
*
|
|
335
|
+
* Tool definition that can be supplied to an OpenAI Responses request.
|
|
336
|
+
*
|
|
337
|
+
* @category models
|
|
338
|
+
* @since 4.0.0
|
|
288
339
|
*/
|
|
289
340
|
export type Tool = typeof Tool.Type;
|
|
290
341
|
/**
|
|
291
|
-
*
|
|
342
|
+
* Schema for selecting whether and which tools the model may call in a Responses request.
|
|
343
|
+
*
|
|
344
|
+
* @category schemas
|
|
345
|
+
* @since 4.0.0
|
|
292
346
|
*/
|
|
293
347
|
export declare const ToolChoice: Schema.Union<readonly [Schema.Literals<readonly ["none", "auto", "required"]>, Schema.Struct<{
|
|
294
348
|
readonly type: Schema.Literal<"allowed_tools">;
|
|
@@ -304,11 +358,17 @@ export declare const ToolChoice: Schema.Union<readonly [Schema.Literals<readonly
|
|
|
304
358
|
readonly type: Schema.Literals<readonly ["apply_patch", "code_interpreter", "file_search", "image_generation", "local_shell", "mcp", "shell", "web_search", "web_search_preview"]>;
|
|
305
359
|
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>;
|
|
306
360
|
/**
|
|
307
|
-
*
|
|
361
|
+
* Tool selection mode or named tool choice for a Responses request.
|
|
362
|
+
*
|
|
363
|
+
* @category models
|
|
364
|
+
* @since 4.0.0
|
|
308
365
|
*/
|
|
309
366
|
export type ToolChoice = typeof ToolChoice.Type;
|
|
310
367
|
/**
|
|
311
|
-
*
|
|
368
|
+
* Schema for text output format configuration, including plain text, JSON object, and JSON Schema responses.
|
|
369
|
+
*
|
|
370
|
+
* @category schemas
|
|
371
|
+
* @since 4.0.0
|
|
312
372
|
*/
|
|
313
373
|
export declare const TextResponseFormatConfiguration: Schema.Union<readonly [Schema.Struct<{
|
|
314
374
|
readonly type: Schema.Literal<"text">;
|
|
@@ -322,11 +382,17 @@ export declare const TextResponseFormatConfiguration: Schema.Union<readonly [Sch
|
|
|
322
382
|
readonly type: Schema.Literal<"json_object">;
|
|
323
383
|
}>]>;
|
|
324
384
|
/**
|
|
325
|
-
*
|
|
385
|
+
* Text output format configuration for plain text, JSON object, or JSON Schema responses.
|
|
386
|
+
*
|
|
387
|
+
* @category models
|
|
388
|
+
* @since 4.0.0
|
|
326
389
|
*/
|
|
327
390
|
export type TextResponseFormatConfiguration = typeof TextResponseFormatConfiguration.Type;
|
|
328
391
|
/**
|
|
329
|
-
*
|
|
392
|
+
* Schema for request options used to create an OpenAI Responses API response.
|
|
393
|
+
*
|
|
394
|
+
* @category schemas
|
|
395
|
+
* @since 4.0.0
|
|
330
396
|
*/
|
|
331
397
|
export declare const CreateResponse: Schema.Struct<{
|
|
332
398
|
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
@@ -556,11 +622,17 @@ export declare const CreateResponse: Schema.Struct<{
|
|
|
556
622
|
readonly seed: Schema.optional<Schema.Number>;
|
|
557
623
|
}>;
|
|
558
624
|
/**
|
|
559
|
-
*
|
|
625
|
+
* Request options used to create an OpenAI Responses API response.
|
|
626
|
+
*
|
|
627
|
+
* @category models
|
|
628
|
+
* @since 4.0.0
|
|
560
629
|
*/
|
|
561
630
|
export type CreateResponse = typeof CreateResponse.Type;
|
|
562
631
|
/**
|
|
563
|
-
*
|
|
632
|
+
* Schema for token accounting reported on OpenAI Responses API response objects.
|
|
633
|
+
*
|
|
634
|
+
* @category schemas
|
|
635
|
+
* @since 4.0.0
|
|
564
636
|
*/
|
|
565
637
|
export declare const ResponseUsage: Schema.StructWithRest<Schema.Struct<{
|
|
566
638
|
readonly input_tokens: Schema.Number;
|
|
@@ -570,11 +642,17 @@ export declare const ResponseUsage: Schema.StructWithRest<Schema.Struct<{
|
|
|
570
642
|
readonly output_tokens_details: Schema.optionalKey<Schema.Unknown>;
|
|
571
643
|
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
572
644
|
/**
|
|
573
|
-
*
|
|
645
|
+
* Token accounting reported on OpenAI Responses API response objects.
|
|
646
|
+
*
|
|
647
|
+
* @category models
|
|
648
|
+
* @since 4.0.0
|
|
574
649
|
*/
|
|
575
650
|
export type ResponseUsage = typeof ResponseUsage.Type;
|
|
576
651
|
/**
|
|
577
|
-
*
|
|
652
|
+
* Schema for an OpenAI Responses API response object.
|
|
653
|
+
*
|
|
654
|
+
* @category schemas
|
|
655
|
+
* @since 4.0.0
|
|
578
656
|
*/
|
|
579
657
|
export declare const Response: Schema.Struct<{
|
|
580
658
|
readonly id: Schema.String;
|
|
@@ -745,18 +823,27 @@ export declare const Response: Schema.Struct<{
|
|
|
745
823
|
readonly service_tier: Schema.optionalKey<Schema.String>;
|
|
746
824
|
}>;
|
|
747
825
|
/**
|
|
748
|
-
*
|
|
826
|
+
* OpenAI Responses API response object.
|
|
827
|
+
*
|
|
828
|
+
* @category models
|
|
829
|
+
* @since 4.0.0
|
|
749
830
|
*/
|
|
750
831
|
export type Response = typeof Response.Type;
|
|
751
832
|
/**
|
|
752
|
-
*
|
|
833
|
+
* Fallback event shape for future or provider-specific response stream events.
|
|
834
|
+
*
|
|
835
|
+
* @category models
|
|
836
|
+
* @since 4.0.0
|
|
753
837
|
*/
|
|
754
838
|
export type UnknownResponseStreamEvent = {
|
|
755
839
|
readonly type: string;
|
|
756
840
|
readonly [key: string]: unknown;
|
|
757
841
|
};
|
|
758
842
|
/**
|
|
759
|
-
*
|
|
843
|
+
* Schema for server-sent event shapes emitted by OpenAI Responses API streams.
|
|
844
|
+
*
|
|
845
|
+
* @category schemas
|
|
846
|
+
* @since 4.0.0
|
|
760
847
|
*/
|
|
761
848
|
export declare const ResponseStreamEvent: Schema.Union<readonly [Schema.Struct<{
|
|
762
849
|
readonly type: Schema.Literal<"response.created">;
|
|
@@ -1868,11 +1955,17 @@ export declare const ResponseStreamEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1868
1955
|
readonly status: Schema.optionalKey<Schema.Number>;
|
|
1869
1956
|
}>, Schema.declare<UnknownResponseStreamEvent, UnknownResponseStreamEvent>]>;
|
|
1870
1957
|
/**
|
|
1871
|
-
*
|
|
1958
|
+
* Server-sent event shape emitted by OpenAI Responses API streams.
|
|
1959
|
+
*
|
|
1960
|
+
* @category models
|
|
1961
|
+
* @since 4.0.0
|
|
1872
1962
|
*/
|
|
1873
1963
|
export type ResponseStreamEvent = typeof ResponseStreamEvent.Type;
|
|
1874
1964
|
/**
|
|
1875
|
-
*
|
|
1965
|
+
* Schema for one embedding item returned by the OpenAI embeddings API.
|
|
1966
|
+
*
|
|
1967
|
+
* @category schemas
|
|
1968
|
+
* @since 4.0.0
|
|
1876
1969
|
*/
|
|
1877
1970
|
export declare const Embedding: Schema.Struct<{
|
|
1878
1971
|
readonly embedding: Schema.Union<readonly [Schema.$Array<Schema.Number>, Schema.String]>;
|
|
@@ -1880,11 +1973,17 @@ export declare const Embedding: Schema.Struct<{
|
|
|
1880
1973
|
readonly object: Schema.optionalKey<Schema.String>;
|
|
1881
1974
|
}>;
|
|
1882
1975
|
/**
|
|
1883
|
-
*
|
|
1976
|
+
* One embedding item returned by the OpenAI embeddings API.
|
|
1977
|
+
*
|
|
1978
|
+
* @category models
|
|
1979
|
+
* @since 4.0.0
|
|
1884
1980
|
*/
|
|
1885
1981
|
export type Embedding = typeof Embedding.Type;
|
|
1886
1982
|
/**
|
|
1887
|
-
*
|
|
1983
|
+
* Schema for the request payload sent to the OpenAI embeddings endpoint.
|
|
1984
|
+
*
|
|
1985
|
+
* @category schemas
|
|
1986
|
+
* @since 4.0.0
|
|
1888
1987
|
*/
|
|
1889
1988
|
export declare const CreateEmbeddingRequest: Schema.Struct<{
|
|
1890
1989
|
readonly input: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.String>, Schema.$Array<Schema.Number>, Schema.$Array<Schema.$Array<Schema.Number>>]>;
|
|
@@ -1894,11 +1993,17 @@ export declare const CreateEmbeddingRequest: Schema.Struct<{
|
|
|
1894
1993
|
readonly user: Schema.optionalKey<Schema.String>;
|
|
1895
1994
|
}>;
|
|
1896
1995
|
/**
|
|
1897
|
-
*
|
|
1996
|
+
* Request payload sent to the OpenAI embeddings endpoint.
|
|
1997
|
+
*
|
|
1998
|
+
* @category models
|
|
1999
|
+
* @since 4.0.0
|
|
1898
2000
|
*/
|
|
1899
2001
|
export type CreateEmbeddingRequest = typeof CreateEmbeddingRequest.Type;
|
|
1900
2002
|
/**
|
|
1901
|
-
*
|
|
2003
|
+
* Schema for a successful response payload returned by the OpenAI embeddings endpoint.
|
|
2004
|
+
*
|
|
2005
|
+
* @category schemas
|
|
2006
|
+
* @since 4.0.0
|
|
1902
2007
|
*/
|
|
1903
2008
|
export declare const CreateEmbeddingResponse: Schema.Struct<{
|
|
1904
2009
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
@@ -1914,7 +2019,10 @@ export declare const CreateEmbeddingResponse: Schema.Struct<{
|
|
|
1914
2019
|
}>>;
|
|
1915
2020
|
}>;
|
|
1916
2021
|
/**
|
|
1917
|
-
*
|
|
2022
|
+
* Successful response payload returned by the OpenAI embeddings endpoint.
|
|
2023
|
+
*
|
|
2024
|
+
* @category models
|
|
2025
|
+
* @since 4.0.0
|
|
1918
2026
|
*/
|
|
1919
2027
|
export type CreateEmbeddingResponse = typeof CreateEmbeddingResponse.Type;
|
|
1920
2028
|
//# sourceMappingURL=OpenAiSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAiSchema.d.ts","sourceRoot":"","sources":["../src/OpenAiSchema.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAUvC
|
|
1
|
+
{"version":3,"file":"OpenAiSchema.d.ts","sourceRoot":"","sources":["../src/OpenAiSchema.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAUvC;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,+LAMtB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,sEAA8D,CAAA;AAExF;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAA;AAsBrD;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;IAIvB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;EAG7B,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAA;AAqD/D;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;IAKrB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AA6B/C;;;;;GAK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AAM,uBAAuB;;;;;;;;;;;;EAUlC,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAC,IAAI,CAAA"}
|
package/dist/OpenAiSchema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Minimal local OpenAI schemas used by the handwritten Responses client path.
|
|
3
3
|
*
|
|
4
|
-
* @since
|
|
4
|
+
* @since 4.0.0
|
|
5
5
|
*/
|
|
6
6
|
import * as Predicate from "effect/Predicate";
|
|
7
7
|
import * as Schema from "effect/Schema";
|
|
@@ -10,11 +10,20 @@ const JsonObject = /*#__PURE__*/Schema.Record(Schema.String, Schema.Unknown);
|
|
|
10
10
|
const MessageRole = /*#__PURE__*/Schema.Literals(["system", "developer", "user", "assistant"]);
|
|
11
11
|
const ImageDetail = /*#__PURE__*/Schema.Literals(["low", "high", "auto"]);
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Schema for optional `include` values on OpenAI Responses requests.
|
|
14
|
+
*
|
|
15
|
+
* **Details**
|
|
16
|
+
* These values request additional response fields such as image URLs, encrypted reasoning content, output logprobs, code interpreter outputs, or web search sources.
|
|
17
|
+
*
|
|
18
|
+
* @category schemas
|
|
19
|
+
* @since 4.0.0
|
|
14
20
|
*/
|
|
15
21
|
export const IncludeEnum = /*#__PURE__*/Schema.Literals(["message.input_image.image_url", "reasoning.encrypted_content", "message.output_text.logprobs", "code_interpreter_call.outputs", "web_search_call.action.sources"]);
|
|
16
22
|
/**
|
|
17
|
-
*
|
|
23
|
+
* Schema for lifecycle statuses shared by messages, reasoning items, and tool calls.
|
|
24
|
+
*
|
|
25
|
+
* @category schemas
|
|
26
|
+
* @since 4.0.0
|
|
18
27
|
*/
|
|
19
28
|
export const MessageStatus = /*#__PURE__*/Schema.Literals(["in_progress", "completed", "incomplete"]);
|
|
20
29
|
const InputTextContent = /*#__PURE__*/Schema.Struct({
|
|
@@ -35,11 +44,17 @@ const InputFileContent = /*#__PURE__*/Schema.Struct({
|
|
|
35
44
|
file_data: /*#__PURE__*/Schema.optionalKey(Schema.String)
|
|
36
45
|
});
|
|
37
46
|
/**
|
|
38
|
-
*
|
|
47
|
+
* Schema for content blocks accepted in OpenAI Responses input messages.
|
|
48
|
+
*
|
|
49
|
+
* @category schemas
|
|
50
|
+
* @since 4.0.0
|
|
39
51
|
*/
|
|
40
52
|
export const InputContent = /*#__PURE__*/Schema.Union([InputTextContent, InputImageContent, InputFileContent]);
|
|
41
53
|
/**
|
|
42
|
-
*
|
|
54
|
+
* Schema for a text block containing a model-provided reasoning summary.
|
|
55
|
+
*
|
|
56
|
+
* @category schemas
|
|
57
|
+
* @since 4.0.0
|
|
43
58
|
*/
|
|
44
59
|
export const SummaryTextContent = /*#__PURE__*/Schema.Struct({
|
|
45
60
|
type: /*#__PURE__*/Schema.Literal("summary_text"),
|
|
@@ -89,7 +104,10 @@ const FilePathAnnotation = /*#__PURE__*/Schema.Struct({
|
|
|
89
104
|
index: Schema.Number
|
|
90
105
|
});
|
|
91
106
|
/**
|
|
92
|
-
*
|
|
107
|
+
* Schema for citation and file-path annotations attached to output text content.
|
|
108
|
+
*
|
|
109
|
+
* @category schemas
|
|
110
|
+
* @since 4.0.0
|
|
93
111
|
*/
|
|
94
112
|
export const Annotation = /*#__PURE__*/Schema.Union([FileCitationAnnotation, UrlCitationAnnotation, ContainerFileCitationAnnotation, FilePathAnnotation]);
|
|
95
113
|
const OutputTextContent = /*#__PURE__*/Schema.Struct({
|
|
@@ -107,7 +125,10 @@ const OutputMessage = /*#__PURE__*/Schema.Struct({
|
|
|
107
125
|
status: MessageStatus
|
|
108
126
|
});
|
|
109
127
|
/**
|
|
110
|
-
*
|
|
128
|
+
* Schema for a reasoning output item containing encrypted content, summaries, and optional reasoning text.
|
|
129
|
+
*
|
|
130
|
+
* @category schemas
|
|
131
|
+
* @since 4.0.0
|
|
111
132
|
*/
|
|
112
133
|
export const ReasoningItem = /*#__PURE__*/Schema.Struct({
|
|
113
134
|
type: /*#__PURE__*/Schema.Literal("reasoning"),
|
|
@@ -183,7 +204,10 @@ const RequestMessageItem = /*#__PURE__*/Schema.Struct({
|
|
|
183
204
|
content: /*#__PURE__*/Schema.Union([Schema.String, /*#__PURE__*/Schema.Array(InputContent)])
|
|
184
205
|
});
|
|
185
206
|
/**
|
|
186
|
-
*
|
|
207
|
+
* Schema for item shapes accepted by an OpenAI Responses request `input` field.
|
|
208
|
+
*
|
|
209
|
+
* @category schemas
|
|
210
|
+
* @since 4.0.0
|
|
187
211
|
*/
|
|
188
212
|
export const InputItem = /*#__PURE__*/Schema.Union([RequestMessageItem, OutputMessage, FunctionCall, FunctionCallOutput, ReasoningItem, ItemReference, LocalShellCall, LocalShellCallOutput, ShellCall, ShellCallOutput, ApplyPatchCallOutput, McpApprovalResponse]);
|
|
189
213
|
const FunctionTool = /*#__PURE__*/Schema.Struct({
|
|
@@ -203,11 +227,17 @@ const ProviderDefinedTool = /*#__PURE__*/Schema.StructWithRest(/*#__PURE__*/Sche
|
|
|
203
227
|
type: /*#__PURE__*/Schema.Literals(["apply_patch", "code_interpreter", "file_search", "image_generation", "local_shell", "mcp", "shell", "web_search", "web_search_preview"])
|
|
204
228
|
}), [UnknownRecord]);
|
|
205
229
|
/**
|
|
206
|
-
*
|
|
230
|
+
* Schema for tool definitions that can be supplied to an OpenAI Responses request.
|
|
231
|
+
*
|
|
232
|
+
* @category schemas
|
|
233
|
+
* @since 4.0.0
|
|
207
234
|
*/
|
|
208
235
|
export const Tool = /*#__PURE__*/Schema.Union([FunctionTool, CustomTool, ProviderDefinedTool]);
|
|
209
236
|
/**
|
|
210
|
-
*
|
|
237
|
+
* Schema for selecting whether and which tools the model may call in a Responses request.
|
|
238
|
+
*
|
|
239
|
+
* @category schemas
|
|
240
|
+
* @since 4.0.0
|
|
211
241
|
*/
|
|
212
242
|
export const ToolChoice = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Literals(["none", "auto", "required"]), /*#__PURE__*/Schema.Struct({
|
|
213
243
|
type: /*#__PURE__*/Schema.Literal("allowed_tools"),
|
|
@@ -223,7 +253,10 @@ export const ToolChoice = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Literal
|
|
|
223
253
|
type: /*#__PURE__*/Schema.Literals(["apply_patch", "code_interpreter", "file_search", "image_generation", "local_shell", "mcp", "shell", "web_search", "web_search_preview"])
|
|
224
254
|
}), [UnknownRecord])]);
|
|
225
255
|
/**
|
|
226
|
-
*
|
|
256
|
+
* Schema for text output format configuration, including plain text, JSON object, and JSON Schema responses.
|
|
257
|
+
*
|
|
258
|
+
* @category schemas
|
|
259
|
+
* @since 4.0.0
|
|
227
260
|
*/
|
|
228
261
|
export const TextResponseFormatConfiguration = /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Struct({
|
|
229
262
|
type: /*#__PURE__*/Schema.Literal("text")
|
|
@@ -237,7 +270,10 @@ export const TextResponseFormatConfiguration = /*#__PURE__*/Schema.Union([/*#__P
|
|
|
237
270
|
type: /*#__PURE__*/Schema.Literal("json_object")
|
|
238
271
|
})]);
|
|
239
272
|
/**
|
|
240
|
-
*
|
|
273
|
+
* Schema for request options used to create an OpenAI Responses API response.
|
|
274
|
+
*
|
|
275
|
+
* @category schemas
|
|
276
|
+
* @since 4.0.0
|
|
241
277
|
*/
|
|
242
278
|
export const CreateResponse = /*#__PURE__*/Schema.Struct({
|
|
243
279
|
metadata: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.String)),
|
|
@@ -273,7 +309,10 @@ export const CreateResponse = /*#__PURE__*/Schema.Struct({
|
|
|
273
309
|
seed: /*#__PURE__*/Schema.optional(Schema.Number)
|
|
274
310
|
});
|
|
275
311
|
/**
|
|
276
|
-
*
|
|
312
|
+
* Schema for token accounting reported on OpenAI Responses API response objects.
|
|
313
|
+
*
|
|
314
|
+
* @category schemas
|
|
315
|
+
* @since 4.0.0
|
|
277
316
|
*/
|
|
278
317
|
export const ResponseUsage = /*#__PURE__*/Schema.StructWithRest(/*#__PURE__*/Schema.Struct({
|
|
279
318
|
input_tokens: Schema.Number,
|
|
@@ -349,7 +388,10 @@ const WebSearchCall = /*#__PURE__*/Schema.Struct({
|
|
|
349
388
|
});
|
|
350
389
|
const OutputItem = /*#__PURE__*/Schema.Union([ApplyPatchCall, CodeInterpreterCall, ComputerCall, FileSearchCall, FunctionCall, ImageGenerationCall, LocalShellCall, McpCall, McpListTools, McpApprovalRequest, OutputMessage, ReasoningItem, ShellCall, WebSearchCall]);
|
|
351
390
|
/**
|
|
352
|
-
*
|
|
391
|
+
* Schema for an OpenAI Responses API response object.
|
|
392
|
+
*
|
|
393
|
+
* @category schemas
|
|
394
|
+
* @since 4.0.0
|
|
353
395
|
*/
|
|
354
396
|
export const Response = /*#__PURE__*/Schema.Struct({
|
|
355
397
|
id: Schema.String,
|
|
@@ -500,11 +542,17 @@ const UnknownResponseStreamEvent = /*#__PURE__*/Schema.declare(value => Predicat
|
|
|
500
542
|
description: "Fallback for unknown future stream events"
|
|
501
543
|
});
|
|
502
544
|
/**
|
|
503
|
-
*
|
|
545
|
+
* Schema for server-sent event shapes emitted by OpenAI Responses API streams.
|
|
546
|
+
*
|
|
547
|
+
* @category schemas
|
|
548
|
+
* @since 4.0.0
|
|
504
549
|
*/
|
|
505
550
|
export const ResponseStreamEvent = /*#__PURE__*/Schema.Union([ResponseCreatedEvent, ResponseCompletedEvent, ResponseIncompleteEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextAnnotationAddedEvent, ResponseReasoningSummaryPartAddedEvent, ResponseReasoningSummaryPartDoneEvent, ResponseReasoningSummaryTextDeltaEvent, ResponseFunctionCallArgumentsDeltaEvent, ResponseFunctionCallArgumentsDoneEvent, ResponseCodeInterpreterCallCodeDeltaEvent, ResponseCodeInterpreterCallCodeDoneEvent, ResponseApplyPatchCallOperationDiffDeltaEvent, ResponseApplyPatchCallOperationDiffDoneEvent, ResponseImageGenerationCallPartialImageEvent, ResponseErrorEvent, UnknownResponseStreamEvent]);
|
|
506
551
|
/**
|
|
507
|
-
*
|
|
552
|
+
* Schema for one embedding item returned by the OpenAI embeddings API.
|
|
553
|
+
*
|
|
554
|
+
* @category schemas
|
|
555
|
+
* @since 4.0.0
|
|
508
556
|
*/
|
|
509
557
|
export const Embedding = /*#__PURE__*/Schema.Struct({
|
|
510
558
|
embedding: /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Array(Schema.Number), Schema.String]),
|
|
@@ -512,7 +560,10 @@ export const Embedding = /*#__PURE__*/Schema.Struct({
|
|
|
512
560
|
object: /*#__PURE__*/Schema.optionalKey(Schema.String)
|
|
513
561
|
});
|
|
514
562
|
/**
|
|
515
|
-
*
|
|
563
|
+
* Schema for the request payload sent to the OpenAI embeddings endpoint.
|
|
564
|
+
*
|
|
565
|
+
* @category schemas
|
|
566
|
+
* @since 4.0.0
|
|
516
567
|
*/
|
|
517
568
|
export const CreateEmbeddingRequest = /*#__PURE__*/Schema.Struct({
|
|
518
569
|
input: /*#__PURE__*/Schema.Union([Schema.String, /*#__PURE__*/Schema.Array(Schema.String), /*#__PURE__*/Schema.Array(Schema.Number), /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Array(Schema.Number))]),
|
|
@@ -522,7 +573,10 @@ export const CreateEmbeddingRequest = /*#__PURE__*/Schema.Struct({
|
|
|
522
573
|
user: /*#__PURE__*/Schema.optionalKey(Schema.String)
|
|
523
574
|
});
|
|
524
575
|
/**
|
|
525
|
-
*
|
|
576
|
+
* Schema for a successful response payload returned by the OpenAI embeddings endpoint.
|
|
577
|
+
*
|
|
578
|
+
* @category schemas
|
|
579
|
+
* @since 4.0.0
|
|
526
580
|
*/
|
|
527
581
|
export const CreateEmbeddingResponse = /*#__PURE__*/Schema.Struct({
|
|
528
582
|
data: /*#__PURE__*/Schema.Array(Embedding),
|