@opencode-ai/ai 0.0.0-beta-17492

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.
Files changed (194) hide show
  1. package/README.md +392 -0
  2. package/dist/cache-policy.d.ts +2 -0
  3. package/dist/cache-policy.js +121 -0
  4. package/dist/image-client.d.ts +19 -0
  5. package/dist/image-client.js +19 -0
  6. package/dist/image.d.ts +110 -0
  7. package/dist/image.js +102 -0
  8. package/dist/index.d.ts +18 -0
  9. package/dist/index.js +12 -0
  10. package/dist/llm.d.ts +230 -0
  11. package/dist/llm.js +77 -0
  12. package/dist/protocols/anthropic-messages.d.ts +633 -0
  13. package/dist/protocols/anthropic-messages.js +860 -0
  14. package/dist/protocols/bedrock-converse.d.ts +533 -0
  15. package/dist/protocols/bedrock-converse.js +584 -0
  16. package/dist/protocols/bedrock-event-stream.d.ts +9 -0
  17. package/dist/protocols/bedrock-event-stream.js +73 -0
  18. package/dist/protocols/gemini.d.ts +300 -0
  19. package/dist/protocols/gemini.js +512 -0
  20. package/dist/protocols/google-images.d.ts +30 -0
  21. package/dist/protocols/google-images.js +191 -0
  22. package/dist/protocols/index.d.ts +10 -0
  23. package/dist/protocols/index.js +10 -0
  24. package/dist/protocols/open-responses-channel.d.ts +26 -0
  25. package/dist/protocols/open-responses-channel.js +120 -0
  26. package/dist/protocols/open-responses.d.ts +951 -0
  27. package/dist/protocols/open-responses.js +873 -0
  28. package/dist/protocols/openai-chat.d.ts +795 -0
  29. package/dist/protocols/openai-chat.js +718 -0
  30. package/dist/protocols/openai-compatible-chat.d.ts +107 -0
  31. package/dist/protocols/openai-compatible-chat.js +20 -0
  32. package/dist/protocols/openai-compatible-responses.d.ts +96 -0
  33. package/dist/protocols/openai-compatible-responses.js +17 -0
  34. package/dist/protocols/openai-images.d.ts +32 -0
  35. package/dist/protocols/openai-images.js +188 -0
  36. package/dist/protocols/openai-responses-channel.d.ts +12 -0
  37. package/dist/protocols/openai-responses-channel.js +142 -0
  38. package/dist/protocols/openai-responses.d.ts +596 -0
  39. package/dist/protocols/openai-responses.js +208 -0
  40. package/dist/protocols/shared.d.ts +194 -0
  41. package/dist/protocols/shared.js +238 -0
  42. package/dist/protocols/utils/bedrock-auth.d.ts +21 -0
  43. package/dist/protocols/utils/bedrock-auth.js +43 -0
  44. package/dist/protocols/utils/bedrock-cache.d.ts +15 -0
  45. package/dist/protocols/utils/bedrock-cache.js +29 -0
  46. package/dist/protocols/utils/bedrock-media.d.ts +49 -0
  47. package/dist/protocols/utils/bedrock-media.js +70 -0
  48. package/dist/protocols/utils/cache.d.ts +6 -0
  49. package/dist/protocols/utils/cache.js +8 -0
  50. package/dist/protocols/utils/gemini-tool-schema.d.ts +2 -0
  51. package/dist/protocols/utils/gemini-tool-schema.js +103 -0
  52. package/dist/protocols/utils/image-input.d.ts +21 -0
  53. package/dist/protocols/utils/image-input.js +22 -0
  54. package/dist/protocols/utils/lifecycle.d.ts +20 -0
  55. package/dist/protocols/utils/lifecycle.js +68 -0
  56. package/dist/protocols/utils/open-responses-options.d.ts +21 -0
  57. package/dist/protocols/utils/open-responses-options.js +41 -0
  58. package/dist/protocols/utils/openai-image.d.ts +5 -0
  59. package/dist/protocols/utils/openai-image.js +18 -0
  60. package/dist/protocols/utils/openai-options.d.ts +14 -0
  61. package/dist/protocols/utils/openai-options.js +14 -0
  62. package/dist/protocols/utils/tool-schema.d.ts +8 -0
  63. package/dist/protocols/utils/tool-schema.js +81 -0
  64. package/dist/protocols/utils/tool-stream.d.ts +639 -0
  65. package/dist/protocols/utils/tool-stream.js +141 -0
  66. package/dist/protocols/xai-images.d.ts +26 -0
  67. package/dist/protocols/xai-images.js +111 -0
  68. package/dist/protocols/zai-images.d.ts +22 -0
  69. package/dist/protocols/zai-images.js +84 -0
  70. package/dist/protocols.d.ts +1 -0
  71. package/dist/protocols.js +1 -0
  72. package/dist/provider-error.d.ts +14 -0
  73. package/dist/provider-error.js +130 -0
  74. package/dist/provider-package.d.ts +15 -0
  75. package/dist/provider-package.js +1 -0
  76. package/dist/provider.d.ts +23 -0
  77. package/dist/provider.js +2 -0
  78. package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -0
  79. package/dist/providers/amazon-bedrock/mantle/chat.js +1 -0
  80. package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -0
  81. package/dist/providers/amazon-bedrock/mantle/responses.js +1 -0
  82. package/dist/providers/amazon-bedrock/mantle.d.ts +2 -0
  83. package/dist/providers/amazon-bedrock/mantle.js +1 -0
  84. package/dist/providers/amazon-bedrock-mantle.d.ts +247 -0
  85. package/dist/providers/amazon-bedrock-mantle.js +68 -0
  86. package/dist/providers/amazon-bedrock.d.ts +172 -0
  87. package/dist/providers/amazon-bedrock.js +41 -0
  88. package/dist/providers/anthropic-compatible.d.ts +218 -0
  89. package/dist/providers/anthropic-compatible.js +45 -0
  90. package/dist/providers/anthropic.d.ts +216 -0
  91. package/dist/providers/anthropic.js +40 -0
  92. package/dist/providers/azure/chat.d.ts +2 -0
  93. package/dist/providers/azure/chat.js +1 -0
  94. package/dist/providers/azure/responses.d.ts +2 -0
  95. package/dist/providers/azure/responses.js +1 -0
  96. package/dist/providers/azure.d.ts +248 -0
  97. package/dist/providers/azure.js +90 -0
  98. package/dist/providers/cloudflare.d.ts +338 -0
  99. package/dist/providers/cloudflare.js +87 -0
  100. package/dist/providers/google-vertex/chat.d.ts +2 -0
  101. package/dist/providers/google-vertex/chat.js +1 -0
  102. package/dist/providers/google-vertex/gemini.d.ts +2 -0
  103. package/dist/providers/google-vertex/gemini.js +1 -0
  104. package/dist/providers/google-vertex/messages.d.ts +2 -0
  105. package/dist/providers/google-vertex/messages.js +1 -0
  106. package/dist/providers/google-vertex/responses.d.ts +2 -0
  107. package/dist/providers/google-vertex/responses.js +1 -0
  108. package/dist/providers/google-vertex-chat.d.ts +131 -0
  109. package/dist/providers/google-vertex-chat.js +50 -0
  110. package/dist/providers/google-vertex-messages.d.ts +215 -0
  111. package/dist/providers/google-vertex-messages.js +75 -0
  112. package/dist/providers/google-vertex-responses.d.ts +122 -0
  113. package/dist/providers/google-vertex-responses.js +51 -0
  114. package/dist/providers/google-vertex-shared.d.ts +22 -0
  115. package/dist/providers/google-vertex-shared.js +61 -0
  116. package/dist/providers/google-vertex.d.ts +115 -0
  117. package/dist/providers/google-vertex.js +64 -0
  118. package/dist/providers/google.d.ts +112 -0
  119. package/dist/providers/google.js +43 -0
  120. package/dist/providers/index.d.ts +18 -0
  121. package/dist/providers/index.js +18 -0
  122. package/dist/providers/open-responses-options.d.ts +16 -0
  123. package/dist/providers/open-responses-options.js +1 -0
  124. package/dist/providers/openai/chat.d.ts +2 -0
  125. package/dist/providers/openai/chat.js +1 -0
  126. package/dist/providers/openai/responses.d.ts +2 -0
  127. package/dist/providers/openai/responses.js +1 -0
  128. package/dist/providers/openai-compatible/responses.d.ts +1 -0
  129. package/dist/providers/openai-compatible/responses.js +1 -0
  130. package/dist/providers/openai-compatible-profile.d.ts +43 -0
  131. package/dist/providers/openai-compatible-profile.js +12 -0
  132. package/dist/providers/openai-compatible-responses.d.ts +120 -0
  133. package/dist/providers/openai-compatible-responses.js +33 -0
  134. package/dist/providers/openai-compatible.d.ts +167 -0
  135. package/dist/providers/openai-compatible.js +55 -0
  136. package/dist/providers/openai-options.d.ts +21 -0
  137. package/dist/providers/openai-options.js +41 -0
  138. package/dist/providers/openai.d.ts +264 -0
  139. package/dist/providers/openai.js +83 -0
  140. package/dist/providers/openrouter.d.ts +537 -0
  141. package/dist/providers/openrouter.js +117 -0
  142. package/dist/providers/xai.d.ts +249 -0
  143. package/dist/providers/xai.js +79 -0
  144. package/dist/providers/zai.d.ts +24 -0
  145. package/dist/providers/zai.js +21 -0
  146. package/dist/providers.d.ts +1 -0
  147. package/dist/providers.js +1 -0
  148. package/dist/route/auth-options.d.ts +34 -0
  149. package/dist/route/auth-options.js +14 -0
  150. package/dist/route/auth.d.ts +51 -0
  151. package/dist/route/auth.js +89 -0
  152. package/dist/route/client.d.ts +348 -0
  153. package/dist/route/client.js +214 -0
  154. package/dist/route/endpoint.d.ts +28 -0
  155. package/dist/route/endpoint.js +21 -0
  156. package/dist/route/executor.d.ts +23 -0
  157. package/dist/route/executor.js +227 -0
  158. package/dist/route/framing.d.ts +23 -0
  159. package/dist/route/framing.js +4 -0
  160. package/dist/route/index.d.ts +16 -0
  161. package/dist/route/index.js +9 -0
  162. package/dist/route/protocol.d.ts +77 -0
  163. package/dist/route/protocol.js +17 -0
  164. package/dist/route/transport/http.d.ts +34 -0
  165. package/dist/route/transport/http.js +63 -0
  166. package/dist/route/transport/index.d.ts +39 -0
  167. package/dist/route/transport/index.js +4 -0
  168. package/dist/route/transport/websocket-channel.d.ts +56 -0
  169. package/dist/route/transport/websocket-channel.js +1 -0
  170. package/dist/route/transport/websocket.d.ts +55 -0
  171. package/dist/route/transport/websocket.js +326 -0
  172. package/dist/route.d.ts +1 -0
  173. package/dist/route.js +1 -0
  174. package/dist/schema/errors.d.ts +159 -0
  175. package/dist/schema/errors.js +155 -0
  176. package/dist/schema/events.d.ts +4587 -0
  177. package/dist/schema/events.js +492 -0
  178. package/dist/schema/ids.d.ts +30 -0
  179. package/dist/schema/ids.js +19 -0
  180. package/dist/schema/index.d.ts +5 -0
  181. package/dist/schema/index.js +5 -0
  182. package/dist/schema/messages.d.ts +402 -0
  183. package/dist/schema/messages.js +244 -0
  184. package/dist/schema/options.d.ts +159 -0
  185. package/dist/schema/options.js +202 -0
  186. package/dist/testing.d.ts +1493 -0
  187. package/dist/testing.js +88 -0
  188. package/dist/tool-runtime.d.ts +15 -0
  189. package/dist/tool-runtime.js +54 -0
  190. package/dist/tool.d.ts +135 -0
  191. package/dist/tool.js +66 -0
  192. package/dist/utils/record.d.ts +2 -0
  193. package/dist/utils/record.js +2 -0
  194. package/package.json +47 -0
@@ -0,0 +1,951 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { HttpTransport } from "../route/transport/index.js";
3
+ import { Protocol } from "../route/protocol.js";
4
+ import { AIError, LLMEvent, Usage, type LLMRequest, type MediaPart, type ProviderMetadata, type ToolDefinition } from "../schema/index.js";
5
+ import { ProviderShared } from "./shared.js";
6
+ import { Lifecycle } from "./utils/lifecycle.js";
7
+ import { ToolStream } from "./utils/tool-stream.js";
8
+ export declare const PATH = "/responses";
9
+ declare const MediaInput: Schema.Union<readonly [Schema.Struct<{
10
+ readonly type: Schema.tag<"input_image">;
11
+ readonly image_url: Schema.String;
12
+ }>, Schema.Struct<{
13
+ readonly type: Schema.tag<"input_file">;
14
+ readonly filename: Schema.String;
15
+ readonly file_data: Schema.String;
16
+ readonly mime_type: Schema.optional<Schema.String>;
17
+ }>]>;
18
+ export type MediaInput = Schema.Schema.Type<typeof MediaInput>;
19
+ export declare const MessagePhase: Schema.Literals<readonly ["commentary", "final_answer"]>;
20
+ type MessagePhase = Schema.Schema.Type<typeof MessagePhase>;
21
+ export declare const InputItem: Schema.Union<readonly [Schema.Struct<{
22
+ readonly role: Schema.tag<"system">;
23
+ readonly content: Schema.String;
24
+ }>, Schema.Struct<{
25
+ readonly role: Schema.tag<"user">;
26
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
27
+ readonly type: Schema.tag<"input_text">;
28
+ readonly text: Schema.String;
29
+ }>, Schema.Union<readonly [Schema.Struct<{
30
+ readonly type: Schema.tag<"input_image">;
31
+ readonly image_url: Schema.String;
32
+ }>, Schema.Struct<{
33
+ readonly type: Schema.tag<"input_file">;
34
+ readonly filename: Schema.String;
35
+ readonly file_data: Schema.String;
36
+ readonly mime_type: Schema.optional<Schema.String>;
37
+ }>]>]>>;
38
+ }>, Schema.Struct<{
39
+ readonly role: Schema.tag<"assistant">;
40
+ readonly content: Schema.$Array<Schema.Struct<{
41
+ readonly type: Schema.tag<"output_text">;
42
+ readonly text: Schema.String;
43
+ }>>;
44
+ readonly phase: Schema.optionalKey<Schema.Literals<readonly ["commentary", "final_answer"]>>;
45
+ }>, Schema.Struct<{
46
+ readonly type: Schema.tag<"reasoning">;
47
+ readonly id: Schema.optionalKey<Schema.String>;
48
+ readonly summary: Schema.$Array<Schema.Struct<{
49
+ readonly type: Schema.tag<"summary_text">;
50
+ readonly text: Schema.String;
51
+ }>>;
52
+ readonly encrypted_content: Schema.optional<Schema.NullOr<Schema.String>>;
53
+ }>, Schema.Struct<{
54
+ readonly type: Schema.tag<"item_reference">;
55
+ readonly id: Schema.String;
56
+ }>, Schema.Struct<{
57
+ readonly type: Schema.tag<"function_call">;
58
+ readonly call_id: Schema.String;
59
+ readonly name: Schema.String;
60
+ readonly arguments: Schema.String;
61
+ }>, Schema.Struct<{
62
+ readonly type: Schema.tag<"function_call_output">;
63
+ readonly call_id: Schema.String;
64
+ readonly output: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
65
+ readonly type: Schema.tag<"input_text">;
66
+ readonly text: Schema.String;
67
+ }>, Schema.Struct<{
68
+ readonly type: Schema.tag<"input_image">;
69
+ readonly image_url: Schema.String;
70
+ }>, Schema.Struct<{
71
+ readonly type: Schema.tag<"input_file">;
72
+ readonly filename: Schema.String;
73
+ readonly file_data: Schema.String;
74
+ readonly mime_type: Schema.optional<Schema.String>;
75
+ }>]>>]>;
76
+ }>]>;
77
+ type OpenResponsesInputItem = Schema.Schema.Type<typeof InputItem>;
78
+ type LoweredInputItem = OpenResponsesInputItem | {
79
+ readonly role: "assistant";
80
+ readonly content: ReadonlyArray<{
81
+ readonly type: "output_text";
82
+ readonly text: string;
83
+ }>;
84
+ readonly phase?: MessagePhase | null;
85
+ };
86
+ export declare const Tool: Schema.Struct<{
87
+ readonly type: Schema.tag<"function">;
88
+ readonly name: Schema.String;
89
+ readonly description: Schema.String;
90
+ readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
91
+ readonly strict: Schema.optional<Schema.Boolean>;
92
+ }>;
93
+ export declare const ToolChoice: Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
94
+ readonly type: Schema.tag<"function">;
95
+ readonly name: Schema.String;
96
+ }>]>;
97
+ export declare const coreFields: {
98
+ model: Schema.String;
99
+ input: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
100
+ readonly role: Schema.tag<"system">;
101
+ readonly content: Schema.String;
102
+ }>, Schema.Struct<{
103
+ readonly role: Schema.tag<"user">;
104
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
105
+ readonly type: Schema.tag<"input_text">;
106
+ readonly text: Schema.String;
107
+ }>, Schema.Union<readonly [Schema.Struct<{
108
+ readonly type: Schema.tag<"input_image">;
109
+ readonly image_url: Schema.String;
110
+ }>, Schema.Struct<{
111
+ readonly type: Schema.tag<"input_file">;
112
+ readonly filename: Schema.String;
113
+ readonly file_data: Schema.String;
114
+ readonly mime_type: Schema.optional<Schema.String>;
115
+ }>]>]>>;
116
+ }>, Schema.Struct<{
117
+ readonly role: Schema.tag<"assistant">;
118
+ readonly content: Schema.$Array<Schema.Struct<{
119
+ readonly type: Schema.tag<"output_text">;
120
+ readonly text: Schema.String;
121
+ }>>;
122
+ readonly phase: Schema.optionalKey<Schema.Literals<readonly ["commentary", "final_answer"]>>;
123
+ }>, Schema.Struct<{
124
+ readonly type: Schema.tag<"reasoning">;
125
+ readonly id: Schema.optionalKey<Schema.String>;
126
+ readonly summary: Schema.$Array<Schema.Struct<{
127
+ readonly type: Schema.tag<"summary_text">;
128
+ readonly text: Schema.String;
129
+ }>>;
130
+ readonly encrypted_content: Schema.optional<Schema.NullOr<Schema.String>>;
131
+ }>, Schema.Struct<{
132
+ readonly type: Schema.tag<"item_reference">;
133
+ readonly id: Schema.String;
134
+ }>, Schema.Struct<{
135
+ readonly type: Schema.tag<"function_call">;
136
+ readonly call_id: Schema.String;
137
+ readonly name: Schema.String;
138
+ readonly arguments: Schema.String;
139
+ }>, Schema.Struct<{
140
+ readonly type: Schema.tag<"function_call_output">;
141
+ readonly call_id: Schema.String;
142
+ readonly output: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
143
+ readonly type: Schema.tag<"input_text">;
144
+ readonly text: Schema.String;
145
+ }>, Schema.Struct<{
146
+ readonly type: Schema.tag<"input_image">;
147
+ readonly image_url: Schema.String;
148
+ }>, Schema.Struct<{
149
+ readonly type: Schema.tag<"input_file">;
150
+ readonly filename: Schema.String;
151
+ readonly file_data: Schema.String;
152
+ readonly mime_type: Schema.optional<Schema.String>;
153
+ }>]>>]>;
154
+ }>]>>;
155
+ instructions: Schema.optional<Schema.String>;
156
+ tools: Schema.optional<Schema.$Array<Schema.Struct<{
157
+ readonly type: Schema.tag<"function">;
158
+ readonly name: Schema.String;
159
+ readonly description: Schema.String;
160
+ readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
161
+ readonly strict: Schema.optional<Schema.Boolean>;
162
+ }>>>;
163
+ tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
164
+ readonly type: Schema.tag<"function">;
165
+ readonly name: Schema.String;
166
+ }>]>>;
167
+ store: Schema.optional<Schema.Boolean>;
168
+ service_tier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
169
+ prompt_cache_key: Schema.optional<Schema.String>;
170
+ include: Schema.optional<Schema.$Array<Schema.Literals<readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"]>>>;
171
+ reasoning: Schema.optional<Schema.Struct<{
172
+ readonly effort: Schema.optional<Schema.String>;
173
+ readonly summary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
174
+ }>>;
175
+ text: Schema.optional<Schema.Struct<{
176
+ readonly verbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
177
+ }>>;
178
+ max_output_tokens: Schema.optional<Schema.Number>;
179
+ temperature: Schema.optional<Schema.Number>;
180
+ top_p: Schema.optional<Schema.Number>;
181
+ };
182
+ declare const OpenResponsesBody: Schema.Struct<{
183
+ readonly stream: Schema.Literal<true>;
184
+ readonly model: Schema.String;
185
+ readonly input: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
186
+ readonly role: Schema.tag<"system">;
187
+ readonly content: Schema.String;
188
+ }>, Schema.Struct<{
189
+ readonly role: Schema.tag<"user">;
190
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
191
+ readonly type: Schema.tag<"input_text">;
192
+ readonly text: Schema.String;
193
+ }>, Schema.Union<readonly [Schema.Struct<{
194
+ readonly type: Schema.tag<"input_image">;
195
+ readonly image_url: Schema.String;
196
+ }>, Schema.Struct<{
197
+ readonly type: Schema.tag<"input_file">;
198
+ readonly filename: Schema.String;
199
+ readonly file_data: Schema.String;
200
+ readonly mime_type: Schema.optional<Schema.String>;
201
+ }>]>]>>;
202
+ }>, Schema.Struct<{
203
+ readonly role: Schema.tag<"assistant">;
204
+ readonly content: Schema.$Array<Schema.Struct<{
205
+ readonly type: Schema.tag<"output_text">;
206
+ readonly text: Schema.String;
207
+ }>>;
208
+ readonly phase: Schema.optionalKey<Schema.Literals<readonly ["commentary", "final_answer"]>>;
209
+ }>, Schema.Struct<{
210
+ readonly type: Schema.tag<"reasoning">;
211
+ readonly id: Schema.optionalKey<Schema.String>;
212
+ readonly summary: Schema.$Array<Schema.Struct<{
213
+ readonly type: Schema.tag<"summary_text">;
214
+ readonly text: Schema.String;
215
+ }>>;
216
+ readonly encrypted_content: Schema.optional<Schema.NullOr<Schema.String>>;
217
+ }>, Schema.Struct<{
218
+ readonly type: Schema.tag<"item_reference">;
219
+ readonly id: Schema.String;
220
+ }>, Schema.Struct<{
221
+ readonly type: Schema.tag<"function_call">;
222
+ readonly call_id: Schema.String;
223
+ readonly name: Schema.String;
224
+ readonly arguments: Schema.String;
225
+ }>, Schema.Struct<{
226
+ readonly type: Schema.tag<"function_call_output">;
227
+ readonly call_id: Schema.String;
228
+ readonly output: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
229
+ readonly type: Schema.tag<"input_text">;
230
+ readonly text: Schema.String;
231
+ }>, Schema.Struct<{
232
+ readonly type: Schema.tag<"input_image">;
233
+ readonly image_url: Schema.String;
234
+ }>, Schema.Struct<{
235
+ readonly type: Schema.tag<"input_file">;
236
+ readonly filename: Schema.String;
237
+ readonly file_data: Schema.String;
238
+ readonly mime_type: Schema.optional<Schema.String>;
239
+ }>]>>]>;
240
+ }>]>>;
241
+ readonly instructions: Schema.optional<Schema.String>;
242
+ readonly tools: Schema.optional<Schema.$Array<Schema.Struct<{
243
+ readonly type: Schema.tag<"function">;
244
+ readonly name: Schema.String;
245
+ readonly description: Schema.String;
246
+ readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
247
+ readonly strict: Schema.optional<Schema.Boolean>;
248
+ }>>>;
249
+ readonly tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
250
+ readonly type: Schema.tag<"function">;
251
+ readonly name: Schema.String;
252
+ }>]>>;
253
+ readonly store: Schema.optional<Schema.Boolean>;
254
+ readonly service_tier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
255
+ readonly prompt_cache_key: Schema.optional<Schema.String>;
256
+ readonly include: Schema.optional<Schema.$Array<Schema.Literals<readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"]>>>;
257
+ readonly reasoning: Schema.optional<Schema.Struct<{
258
+ readonly effort: Schema.optional<Schema.String>;
259
+ readonly summary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
260
+ }>>;
261
+ readonly text: Schema.optional<Schema.Struct<{
262
+ readonly verbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
263
+ }>>;
264
+ readonly max_output_tokens: Schema.optional<Schema.Number>;
265
+ readonly temperature: Schema.optional<Schema.Number>;
266
+ readonly top_p: Schema.optional<Schema.Number>;
267
+ }>;
268
+ export type OpenResponsesBody = Schema.Schema.Type<typeof OpenResponsesBody>;
269
+ export declare const StreamItem: Schema.StructWithRest<Schema.Struct<{
270
+ readonly type: Schema.String;
271
+ readonly id: Schema.optional<Schema.String>;
272
+ readonly call_id: Schema.optional<Schema.String>;
273
+ readonly name: Schema.optional<Schema.String>;
274
+ readonly arguments: Schema.optional<Schema.String>;
275
+ readonly encrypted_content: Schema.optional<Schema.NullOr<Schema.String>>;
276
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
277
+ export type StreamItem = Schema.Schema.Type<typeof StreamItem>;
278
+ export declare const WebSocketErrorEvent: Schema.StructWithRest<Schema.Struct<{
279
+ readonly type: Schema.tag<"error">;
280
+ readonly status: Schema.optional<Schema.Number>;
281
+ readonly status_code: Schema.optional<Schema.Number>;
282
+ readonly code: Schema.optional<Schema.NullOr<Schema.String>>;
283
+ readonly message: Schema.optional<Schema.String>;
284
+ readonly param: Schema.optional<Schema.NullOr<Schema.String>>;
285
+ readonly error: Schema.optional<Schema.NullOr<Schema.Struct<{
286
+ readonly type: Schema.optional<Schema.NullOr<Schema.String>>;
287
+ readonly code: Schema.optional<Schema.NullOr<Schema.String>>;
288
+ readonly message: Schema.optional<Schema.NullOr<Schema.String>>;
289
+ readonly param: Schema.optional<Schema.NullOr<Schema.String>>;
290
+ }>>>;
291
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>>;
292
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
293
+ export declare const decodeKnownErrorEvent: (event: Event) => Effect.Effect<{
294
+ readonly [x: string]: unknown;
295
+ readonly type: "error";
296
+ readonly error?: {
297
+ readonly type?: string | null | undefined;
298
+ readonly code?: string | null | undefined;
299
+ readonly message?: string | null | undefined;
300
+ readonly param?: string | null | undefined;
301
+ } | null | undefined;
302
+ readonly status?: number | undefined;
303
+ readonly code?: string | null | undefined;
304
+ readonly message?: string | undefined;
305
+ readonly headers?: {
306
+ readonly [x: string]: string | number | boolean;
307
+ } | undefined;
308
+ readonly param?: string | null | undefined;
309
+ readonly status_code?: number | undefined;
310
+ }, Schema.SchemaError, never>;
311
+ export declare const Event: Schema.StructWithRest<Schema.Struct<{
312
+ readonly type: Schema.String;
313
+ readonly delta: Schema.optional<Schema.String>;
314
+ readonly text: Schema.optional<Schema.String>;
315
+ readonly item_id: Schema.optional<Schema.String>;
316
+ readonly summary_index: Schema.optional<Schema.Number>;
317
+ readonly item: Schema.optional<Schema.StructWithRest<Schema.Struct<{
318
+ readonly type: Schema.String;
319
+ readonly id: Schema.optional<Schema.String>;
320
+ readonly call_id: Schema.optional<Schema.String>;
321
+ readonly name: Schema.optional<Schema.String>;
322
+ readonly arguments: Schema.optional<Schema.String>;
323
+ readonly encrypted_content: Schema.optional<Schema.NullOr<Schema.String>>;
324
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
325
+ readonly response: Schema.optional<Schema.StructWithRest<Schema.Struct<{
326
+ readonly id: Schema.optional<Schema.String>;
327
+ readonly service_tier: Schema.optional<Schema.NullOr<Schema.String>>;
328
+ readonly incomplete_details: Schema.optional<Schema.NullOr<Schema.Struct<{
329
+ readonly reason: Schema.optional<Schema.String>;
330
+ }>>>;
331
+ readonly usage: Schema.optional<Schema.NullOr<Schema.Struct<{
332
+ readonly input_tokens: Schema.optional<Schema.Number>;
333
+ readonly input_tokens_details: Schema.optional<Schema.NullOr<Schema.Struct<{
334
+ readonly cached_tokens: Schema.optional<Schema.Number>;
335
+ readonly cache_write_tokens: Schema.optional<Schema.Number>;
336
+ }>>>;
337
+ readonly output_tokens: Schema.optional<Schema.Number>;
338
+ readonly output_tokens_details: Schema.optional<Schema.NullOr<Schema.Struct<{
339
+ readonly reasoning_tokens: Schema.optional<Schema.Number>;
340
+ }>>>;
341
+ readonly total_tokens: Schema.optional<Schema.Number>;
342
+ }>>>;
343
+ readonly error: Schema.optional<Schema.NullOr<Schema.Struct<{
344
+ readonly type: Schema.optional<Schema.NullOr<Schema.String>>;
345
+ readonly code: Schema.optional<Schema.NullOr<Schema.String>>;
346
+ readonly message: Schema.optional<Schema.NullOr<Schema.String>>;
347
+ readonly param: Schema.optional<Schema.NullOr<Schema.String>>;
348
+ }>>>;
349
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
350
+ readonly code: Schema.optional<Schema.NullOr<Schema.String>>;
351
+ readonly message: Schema.optional<Schema.String>;
352
+ readonly param: Schema.optional<Schema.NullOr<Schema.String>>;
353
+ readonly error: Schema.optional<Schema.NullOr<Schema.Struct<{
354
+ readonly type: Schema.optional<Schema.NullOr<Schema.String>>;
355
+ readonly code: Schema.optional<Schema.NullOr<Schema.String>>;
356
+ readonly message: Schema.optional<Schema.NullOr<Schema.String>>;
357
+ readonly param: Schema.optional<Schema.NullOr<Schema.String>>;
358
+ }>>>;
359
+ readonly status: Schema.optional<Schema.Unknown>;
360
+ readonly status_code: Schema.optional<Schema.Unknown>;
361
+ readonly headers: Schema.optional<Schema.Unknown>;
362
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
363
+ export type Event = Schema.Schema.Type<typeof Event>;
364
+ export interface Extension {
365
+ readonly id: string;
366
+ readonly name: string;
367
+ readonly lowerMedia?: (input: {
368
+ readonly part: MediaPart;
369
+ readonly media: ProviderShared.ValidatedMedia;
370
+ readonly request: LLMRequest;
371
+ }) => MediaInput | undefined;
372
+ readonly messagePhase?: (value: unknown) => MessagePhase | null | undefined;
373
+ }
374
+ export interface ParserState {
375
+ readonly id: string;
376
+ readonly name: string;
377
+ readonly providerMetadataKey: string;
378
+ readonly tools: ToolStream.State<string>;
379
+ readonly hasFunctionCall: boolean;
380
+ readonly lifecycle: Lifecycle.State;
381
+ readonly messageItems: ReadonlySet<string>;
382
+ readonly messagePhase: (value: unknown) => MessagePhase | null | undefined;
383
+ readonly messagePhases: Readonly<Record<string, MessagePhase | null>>;
384
+ readonly reasoningItems: Readonly<Record<string, ReasoningStreamItem>>;
385
+ readonly store: boolean | undefined;
386
+ }
387
+ type ReasoningSummaryStatus = "active" | "can-conclude" | "concluded";
388
+ interface ReasoningStreamItem {
389
+ readonly encryptedContent: string | null | undefined;
390
+ readonly summaryParts: Readonly<Record<number, ReasoningSummaryStatus>>;
391
+ }
392
+ export declare const lowerTool: (protocolName: string, tool: ToolDefinition, inputSchema: {
393
+ readonly [x: string]: unknown;
394
+ }) => Effect.Effect<{
395
+ type: "function";
396
+ name: string;
397
+ description: string;
398
+ parameters: {
399
+ readonly [x: string]: unknown;
400
+ };
401
+ strict: boolean;
402
+ }, AIError, never>;
403
+ export declare const lowerToolChoice: (protocolName: string, toolChoice: NonNullable<LLMRequest["toolChoice"]>) => Effect.Effect<"required" | "none" | "auto" | {
404
+ type: "function";
405
+ name: string;
406
+ }, AIError, never>;
407
+ export declare const fromRequestWithExtension: (request: LLMRequest, extension: Extension) => Effect.Effect<{
408
+ service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
409
+ text?: {
410
+ verbosity: "low" | "medium" | "high";
411
+ } | undefined;
412
+ reasoning?: {
413
+ effort: string | undefined;
414
+ summary: "auto" | "concise" | "detailed" | undefined;
415
+ } | undefined;
416
+ include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
417
+ prompt_cache_key?: string | undefined;
418
+ store?: boolean | undefined;
419
+ instructions?: string | undefined;
420
+ model: string & import("effect/Brand").Brand<"AI.ModelID">;
421
+ input: LoweredInputItem[];
422
+ tools: {
423
+ type: "function";
424
+ name: string;
425
+ description: string;
426
+ parameters: {
427
+ readonly [x: string]: unknown;
428
+ };
429
+ strict: boolean;
430
+ }[] | undefined;
431
+ tool_choice: "required" | "none" | "auto" | {
432
+ type: "function";
433
+ name: string;
434
+ } | undefined;
435
+ stream: true;
436
+ max_output_tokens: number | undefined;
437
+ temperature: number | undefined;
438
+ top_p: number | undefined;
439
+ }, AIError, never>;
440
+ export declare const fromRequest: (request: LLMRequest) => Effect.Effect<{
441
+ readonly input: readonly ({
442
+ readonly type: "reasoning";
443
+ readonly summary: readonly {
444
+ readonly type: "summary_text";
445
+ readonly text: string;
446
+ }[];
447
+ readonly id?: string | undefined;
448
+ readonly encrypted_content?: string | null | undefined;
449
+ } | {
450
+ readonly type: "item_reference";
451
+ readonly id: string;
452
+ } | {
453
+ readonly role: "system";
454
+ readonly content: string;
455
+ } | {
456
+ readonly role: "user";
457
+ readonly content: readonly ({
458
+ readonly type: "input_image";
459
+ readonly image_url: string;
460
+ } | {
461
+ readonly type: "input_file";
462
+ readonly filename: string;
463
+ readonly file_data: string;
464
+ readonly mime_type?: string | undefined;
465
+ } | {
466
+ readonly type: "input_text";
467
+ readonly text: string;
468
+ })[];
469
+ } | {
470
+ readonly content: readonly {
471
+ readonly type: "output_text";
472
+ readonly text: string;
473
+ }[];
474
+ readonly role: "assistant";
475
+ readonly phase?: "commentary" | "final_answer" | undefined;
476
+ } | {
477
+ readonly type: "function_call";
478
+ readonly call_id: string;
479
+ readonly name: string;
480
+ readonly arguments: string;
481
+ } | {
482
+ readonly type: "function_call_output";
483
+ readonly call_id: string;
484
+ readonly output: string | readonly ({
485
+ readonly type: "input_image";
486
+ readonly image_url: string;
487
+ } | {
488
+ readonly type: "input_file";
489
+ readonly filename: string;
490
+ readonly file_data: string;
491
+ readonly mime_type?: string | undefined;
492
+ } | {
493
+ readonly type: "input_text";
494
+ readonly text: string;
495
+ })[];
496
+ })[];
497
+ readonly model: string;
498
+ readonly stream: true;
499
+ readonly instructions?: string | undefined;
500
+ readonly reasoning?: {
501
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
502
+ readonly effort?: string | undefined;
503
+ } | undefined;
504
+ readonly tools?: readonly {
505
+ readonly type: "function";
506
+ readonly description: string;
507
+ readonly name: string;
508
+ readonly parameters: {
509
+ readonly [x: string]: unknown;
510
+ };
511
+ readonly strict?: boolean | undefined;
512
+ }[] | undefined;
513
+ readonly text?: {
514
+ readonly verbosity?: "low" | "medium" | "high" | undefined;
515
+ } | undefined;
516
+ readonly temperature?: number | undefined;
517
+ readonly tool_choice?: "required" | "none" | "auto" | {
518
+ readonly type: "function";
519
+ readonly name: string;
520
+ } | undefined;
521
+ readonly top_p?: number | undefined;
522
+ readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
523
+ readonly store?: boolean | undefined;
524
+ readonly prompt_cache_key?: string | undefined;
525
+ readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
526
+ readonly max_output_tokens?: number | undefined;
527
+ }, AIError, never>;
528
+ export declare const providerMetadata: (state: ParserState, metadata: Record<string, unknown>) => ProviderMetadata;
529
+ export type StepResult = readonly [ParserState, ReadonlyArray<LLMEvent>];
530
+ export declare const terminal: (event: Event) => boolean;
531
+ export declare const onReasoningDelta: (state: ParserState, event: Event, itemID: string) => StepResult;
532
+ export declare const onReasoningDone: (state: ParserState, _event: Event) => StepResult;
533
+ export declare const providerFailure: (id: string, event: Event, fallback: string) => AIError;
534
+ export declare const step: (state: ParserState, event: Event) => AIError | Effect.Effect<StepResult, never, never> | Effect.Effect<[ParserState, readonly ({
535
+ readonly type: "step-start";
536
+ readonly index: number;
537
+ } | {
538
+ readonly id: string;
539
+ readonly type: "text-start";
540
+ readonly providerMetadata?: {
541
+ readonly [x: string]: {
542
+ readonly [x: string]: unknown;
543
+ };
544
+ } | undefined;
545
+ } | {
546
+ readonly id: string;
547
+ readonly type: "text-delta";
548
+ readonly text: string;
549
+ readonly providerMetadata?: {
550
+ readonly [x: string]: {
551
+ readonly [x: string]: unknown;
552
+ };
553
+ } | undefined;
554
+ } | {
555
+ readonly id: string;
556
+ readonly type: "text-end";
557
+ readonly providerMetadata?: {
558
+ readonly [x: string]: {
559
+ readonly [x: string]: unknown;
560
+ };
561
+ } | undefined;
562
+ } | {
563
+ readonly id: string;
564
+ readonly type: "reasoning-start";
565
+ readonly providerMetadata?: {
566
+ readonly [x: string]: {
567
+ readonly [x: string]: unknown;
568
+ };
569
+ } | undefined;
570
+ } | {
571
+ readonly id: string;
572
+ readonly type: "reasoning-delta";
573
+ readonly text: string;
574
+ readonly providerMetadata?: {
575
+ readonly [x: string]: {
576
+ readonly [x: string]: unknown;
577
+ };
578
+ } | undefined;
579
+ } | {
580
+ readonly id: string;
581
+ readonly type: "reasoning-end";
582
+ readonly providerMetadata?: {
583
+ readonly [x: string]: {
584
+ readonly [x: string]: unknown;
585
+ };
586
+ } | undefined;
587
+ } | {
588
+ readonly id: string;
589
+ readonly type: "tool-input-start";
590
+ readonly name: string;
591
+ readonly providerMetadata?: {
592
+ readonly [x: string]: {
593
+ readonly [x: string]: unknown;
594
+ };
595
+ } | undefined;
596
+ readonly providerExecuted?: boolean | undefined;
597
+ } | {
598
+ readonly type: "tool-input-delta";
599
+ readonly id: string;
600
+ readonly name: string;
601
+ readonly text: string;
602
+ } | {
603
+ readonly id: string;
604
+ readonly type: "tool-input-end";
605
+ readonly name: string;
606
+ readonly providerMetadata?: {
607
+ readonly [x: string]: {
608
+ readonly [x: string]: unknown;
609
+ };
610
+ } | undefined;
611
+ } | {
612
+ readonly type: "tool-input-error";
613
+ readonly id: string;
614
+ readonly name: string;
615
+ readonly raw: string;
616
+ } | {
617
+ readonly id: string;
618
+ readonly type: "tool-call";
619
+ readonly name: string;
620
+ readonly input: unknown;
621
+ readonly providerMetadata?: {
622
+ readonly [x: string]: {
623
+ readonly [x: string]: unknown;
624
+ };
625
+ } | undefined;
626
+ readonly providerExecuted?: boolean | undefined;
627
+ } | {
628
+ readonly id: string;
629
+ readonly type: "tool-result";
630
+ readonly name: string;
631
+ readonly result: {
632
+ readonly type: "json";
633
+ readonly value: unknown;
634
+ } | {
635
+ readonly type: "text";
636
+ readonly value: unknown;
637
+ } | {
638
+ readonly type: "error";
639
+ readonly value: unknown;
640
+ } | {
641
+ readonly type: "content";
642
+ readonly value: readonly ({
643
+ readonly type: "text";
644
+ readonly text: string;
645
+ } | {
646
+ readonly type: "file";
647
+ readonly uri: string;
648
+ readonly mime: string;
649
+ readonly name?: string | undefined;
650
+ })[];
651
+ };
652
+ readonly output?: {
653
+ readonly structured: unknown;
654
+ readonly content: readonly ({
655
+ readonly type: "text";
656
+ readonly text: string;
657
+ } | {
658
+ readonly type: "file";
659
+ readonly uri: string;
660
+ readonly mime: string;
661
+ readonly name?: string | undefined;
662
+ })[];
663
+ } | undefined;
664
+ readonly providerMetadata?: {
665
+ readonly [x: string]: {
666
+ readonly [x: string]: unknown;
667
+ };
668
+ } | undefined;
669
+ readonly providerExecuted?: boolean | undefined;
670
+ } | {
671
+ readonly id: string;
672
+ readonly type: "tool-error";
673
+ readonly name: string;
674
+ readonly message: string;
675
+ readonly error?: unknown;
676
+ readonly providerMetadata?: {
677
+ readonly [x: string]: {
678
+ readonly [x: string]: unknown;
679
+ };
680
+ } | undefined;
681
+ } | {
682
+ readonly type: "step-finish";
683
+ readonly reason: {
684
+ readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
685
+ readonly raw?: string | undefined;
686
+ };
687
+ readonly index: number;
688
+ readonly providerMetadata?: {
689
+ readonly [x: string]: {
690
+ readonly [x: string]: unknown;
691
+ };
692
+ } | undefined;
693
+ readonly usage?: Usage | undefined;
694
+ } | {
695
+ readonly type: "finish";
696
+ readonly reason: {
697
+ readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
698
+ readonly raw?: string | undefined;
699
+ };
700
+ readonly providerMetadata?: {
701
+ readonly [x: string]: {
702
+ readonly [x: string]: unknown;
703
+ };
704
+ } | undefined;
705
+ readonly usage?: Usage | undefined;
706
+ } | {
707
+ readonly type: "provider-error";
708
+ readonly message: string;
709
+ readonly providerMetadata?: {
710
+ readonly [x: string]: {
711
+ readonly [x: string]: unknown;
712
+ };
713
+ } | undefined;
714
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
715
+ })[]], AIError, never>;
716
+ /**
717
+ * The provider-neutral Open Responses protocol. Provider-specific Responses
718
+ * implementations compose this baseline with their own tools and event variants.
719
+ */
720
+ export declare const initial: (request: LLMRequest, extension?: Extension) => ParserState;
721
+ export declare const protocol: Protocol<{
722
+ readonly input: readonly ({
723
+ readonly type: "reasoning";
724
+ readonly summary: readonly {
725
+ readonly type: "summary_text";
726
+ readonly text: string;
727
+ }[];
728
+ readonly id?: string | undefined;
729
+ readonly encrypted_content?: string | null | undefined;
730
+ } | {
731
+ readonly type: "item_reference";
732
+ readonly id: string;
733
+ } | {
734
+ readonly role: "system";
735
+ readonly content: string;
736
+ } | {
737
+ readonly role: "user";
738
+ readonly content: readonly ({
739
+ readonly type: "input_image";
740
+ readonly image_url: string;
741
+ } | {
742
+ readonly type: "input_file";
743
+ readonly filename: string;
744
+ readonly file_data: string;
745
+ readonly mime_type?: string | undefined;
746
+ } | {
747
+ readonly type: "input_text";
748
+ readonly text: string;
749
+ })[];
750
+ } | {
751
+ readonly content: readonly {
752
+ readonly type: "output_text";
753
+ readonly text: string;
754
+ }[];
755
+ readonly role: "assistant";
756
+ readonly phase?: "commentary" | "final_answer" | undefined;
757
+ } | {
758
+ readonly type: "function_call";
759
+ readonly call_id: string;
760
+ readonly name: string;
761
+ readonly arguments: string;
762
+ } | {
763
+ readonly type: "function_call_output";
764
+ readonly call_id: string;
765
+ readonly output: string | readonly ({
766
+ readonly type: "input_image";
767
+ readonly image_url: string;
768
+ } | {
769
+ readonly type: "input_file";
770
+ readonly filename: string;
771
+ readonly file_data: string;
772
+ readonly mime_type?: string | undefined;
773
+ } | {
774
+ readonly type: "input_text";
775
+ readonly text: string;
776
+ })[];
777
+ })[];
778
+ readonly model: string;
779
+ readonly stream: true;
780
+ readonly instructions?: string | undefined;
781
+ readonly reasoning?: {
782
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
783
+ readonly effort?: string | undefined;
784
+ } | undefined;
785
+ readonly tools?: readonly {
786
+ readonly type: "function";
787
+ readonly description: string;
788
+ readonly name: string;
789
+ readonly parameters: {
790
+ readonly [x: string]: unknown;
791
+ };
792
+ readonly strict?: boolean | undefined;
793
+ }[] | undefined;
794
+ readonly text?: {
795
+ readonly verbosity?: "low" | "medium" | "high" | undefined;
796
+ } | undefined;
797
+ readonly temperature?: number | undefined;
798
+ readonly tool_choice?: "required" | "none" | "auto" | {
799
+ readonly type: "function";
800
+ readonly name: string;
801
+ } | undefined;
802
+ readonly top_p?: number | undefined;
803
+ readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
804
+ readonly store?: boolean | undefined;
805
+ readonly prompt_cache_key?: string | undefined;
806
+ readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
807
+ readonly max_output_tokens?: number | undefined;
808
+ }, string, {
809
+ readonly [x: string]: unknown;
810
+ readonly type: string;
811
+ readonly error?: {
812
+ readonly type?: string | null | undefined;
813
+ readonly code?: string | null | undefined;
814
+ readonly message?: string | null | undefined;
815
+ readonly param?: string | null | undefined;
816
+ } | null | undefined;
817
+ readonly status?: unknown;
818
+ readonly code?: string | null | undefined;
819
+ readonly message?: string | undefined;
820
+ readonly headers?: unknown;
821
+ readonly text?: string | undefined;
822
+ readonly item?: {
823
+ readonly [x: string]: unknown;
824
+ readonly type: string;
825
+ readonly id?: string | undefined;
826
+ readonly name?: string | undefined;
827
+ readonly arguments?: string | undefined;
828
+ readonly encrypted_content?: string | null | undefined;
829
+ readonly call_id?: string | undefined;
830
+ } | undefined;
831
+ readonly delta?: string | undefined;
832
+ readonly response?: {
833
+ readonly [x: string]: unknown;
834
+ readonly error?: {
835
+ readonly type?: string | null | undefined;
836
+ readonly code?: string | null | undefined;
837
+ readonly message?: string | null | undefined;
838
+ readonly param?: string | null | undefined;
839
+ } | null | undefined;
840
+ readonly id?: string | undefined;
841
+ readonly usage?: {
842
+ readonly input_tokens?: number | undefined;
843
+ readonly output_tokens?: number | undefined;
844
+ readonly output_tokens_details?: {
845
+ readonly reasoning_tokens?: number | undefined;
846
+ } | null | undefined;
847
+ readonly total_tokens?: number | undefined;
848
+ readonly input_tokens_details?: {
849
+ readonly cached_tokens?: number | undefined;
850
+ readonly cache_write_tokens?: number | undefined;
851
+ } | null | undefined;
852
+ } | null | undefined;
853
+ readonly service_tier?: string | null | undefined;
854
+ readonly incomplete_details?: {
855
+ readonly reason?: string | undefined;
856
+ } | null | undefined;
857
+ } | undefined;
858
+ readonly param?: string | null | undefined;
859
+ readonly status_code?: unknown;
860
+ readonly item_id?: string | undefined;
861
+ readonly summary_index?: number | undefined;
862
+ }, ParserState>;
863
+ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
864
+ readonly input: readonly ({
865
+ readonly type: "reasoning";
866
+ readonly summary: readonly {
867
+ readonly type: "summary_text";
868
+ readonly text: string;
869
+ }[];
870
+ readonly id?: string | undefined;
871
+ readonly encrypted_content?: string | null | undefined;
872
+ } | {
873
+ readonly type: "item_reference";
874
+ readonly id: string;
875
+ } | {
876
+ readonly role: "system";
877
+ readonly content: string;
878
+ } | {
879
+ readonly role: "user";
880
+ readonly content: readonly ({
881
+ readonly type: "input_image";
882
+ readonly image_url: string;
883
+ } | {
884
+ readonly type: "input_file";
885
+ readonly filename: string;
886
+ readonly file_data: string;
887
+ readonly mime_type?: string | undefined;
888
+ } | {
889
+ readonly type: "input_text";
890
+ readonly text: string;
891
+ })[];
892
+ } | {
893
+ readonly content: readonly {
894
+ readonly type: "output_text";
895
+ readonly text: string;
896
+ }[];
897
+ readonly role: "assistant";
898
+ readonly phase?: "commentary" | "final_answer" | undefined;
899
+ } | {
900
+ readonly type: "function_call";
901
+ readonly call_id: string;
902
+ readonly name: string;
903
+ readonly arguments: string;
904
+ } | {
905
+ readonly type: "function_call_output";
906
+ readonly call_id: string;
907
+ readonly output: string | readonly ({
908
+ readonly type: "input_image";
909
+ readonly image_url: string;
910
+ } | {
911
+ readonly type: "input_file";
912
+ readonly filename: string;
913
+ readonly file_data: string;
914
+ readonly mime_type?: string | undefined;
915
+ } | {
916
+ readonly type: "input_text";
917
+ readonly text: string;
918
+ })[];
919
+ })[];
920
+ readonly model: string;
921
+ readonly stream: true;
922
+ readonly instructions?: string | undefined;
923
+ readonly reasoning?: {
924
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
925
+ readonly effort?: string | undefined;
926
+ } | undefined;
927
+ readonly tools?: readonly {
928
+ readonly type: "function";
929
+ readonly description: string;
930
+ readonly name: string;
931
+ readonly parameters: {
932
+ readonly [x: string]: unknown;
933
+ };
934
+ readonly strict?: boolean | undefined;
935
+ }[] | undefined;
936
+ readonly text?: {
937
+ readonly verbosity?: "low" | "medium" | "high" | undefined;
938
+ } | undefined;
939
+ readonly temperature?: number | undefined;
940
+ readonly tool_choice?: "required" | "none" | "auto" | {
941
+ readonly type: "function";
942
+ readonly name: string;
943
+ } | undefined;
944
+ readonly top_p?: number | undefined;
945
+ readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
946
+ readonly store?: boolean | undefined;
947
+ readonly prompt_cache_key?: string | undefined;
948
+ readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
949
+ readonly max_output_tokens?: number | undefined;
950
+ }, string>;
951
+ export * as OpenResponses from "./open-responses.js";