@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,533 @@
1
+ import { Schema } from "effect";
2
+ import { Route } from "../route/client.js";
3
+ import { Protocol } from "../route/protocol.js";
4
+ import { Usage, type FinishReasonDetails } from "../schema/index.js";
5
+ import { BedrockAuth } from "./utils/bedrock-auth.js";
6
+ import { Lifecycle } from "./utils/lifecycle.js";
7
+ import { ToolStream } from "./utils/tool-stream.js";
8
+ export type { Credentials as BedrockCredentials } from "./utils/bedrock-auth.js";
9
+ declare const BedrockConverseBody: Schema.Struct<{
10
+ modelId: Schema.String;
11
+ messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
12
+ readonly role: Schema.Literal<"user">;
13
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
14
+ readonly text: Schema.String;
15
+ }>, Schema.Struct<{
16
+ readonly image: Schema.Struct<{
17
+ readonly format: Schema.Literals<readonly ["png", "jpeg", "gif", "webp"]>;
18
+ readonly source: Schema.Struct<{
19
+ readonly bytes: Schema.String;
20
+ }>;
21
+ }>;
22
+ }>, Schema.Struct<{
23
+ readonly document: Schema.Struct<{
24
+ readonly format: Schema.Literals<readonly ["pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md"]>;
25
+ readonly name: Schema.String;
26
+ readonly source: Schema.Struct<{
27
+ readonly bytes: Schema.String;
28
+ }>;
29
+ }>;
30
+ }>, Schema.Struct<{
31
+ readonly toolResult: Schema.Struct<{
32
+ readonly toolUseId: Schema.String;
33
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
34
+ readonly text: Schema.String;
35
+ }>, Schema.Struct<{
36
+ readonly json: Schema.Unknown;
37
+ }>, Schema.Struct<{
38
+ readonly image: Schema.Struct<{
39
+ readonly format: Schema.Literals<readonly ["png", "jpeg", "gif", "webp"]>;
40
+ readonly source: Schema.Struct<{
41
+ readonly bytes: Schema.String;
42
+ }>;
43
+ }>;
44
+ }>, Schema.Struct<{
45
+ readonly document: Schema.Struct<{
46
+ readonly format: Schema.Literals<readonly ["pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md"]>;
47
+ readonly name: Schema.String;
48
+ readonly source: Schema.Struct<{
49
+ readonly bytes: Schema.String;
50
+ }>;
51
+ }>;
52
+ }>]>>;
53
+ readonly status: Schema.optional<Schema.Literals<readonly ["success", "error"]>>;
54
+ }>;
55
+ }>, Schema.Struct<{
56
+ readonly cachePoint: Schema.Struct<{
57
+ readonly type: Schema.tag<"default">;
58
+ readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
59
+ }>;
60
+ }>]>>;
61
+ }>, Schema.Struct<{
62
+ readonly role: Schema.Literal<"assistant">;
63
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
64
+ readonly text: Schema.String;
65
+ }>, Schema.Struct<{
66
+ readonly reasoningContent: Schema.Union<readonly [Schema.Struct<{
67
+ readonly reasoningText: Schema.Struct<{
68
+ readonly text: Schema.String;
69
+ readonly signature: Schema.optional<Schema.String>;
70
+ }>;
71
+ }>, Schema.Struct<{
72
+ readonly redactedContent: Schema.String;
73
+ }>]>;
74
+ }>, Schema.Struct<{
75
+ readonly toolUse: Schema.Struct<{
76
+ readonly toolUseId: Schema.String;
77
+ readonly name: Schema.String;
78
+ readonly input: Schema.Unknown;
79
+ }>;
80
+ }>, Schema.Struct<{
81
+ readonly cachePoint: Schema.Struct<{
82
+ readonly type: Schema.tag<"default">;
83
+ readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
84
+ }>;
85
+ }>]>>;
86
+ }>]>>;
87
+ system: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
88
+ readonly text: Schema.String;
89
+ }>, Schema.Struct<{
90
+ readonly cachePoint: Schema.Struct<{
91
+ readonly type: Schema.tag<"default">;
92
+ readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
93
+ }>;
94
+ }>]>>>;
95
+ inferenceConfig: Schema.optional<Schema.Struct<{
96
+ readonly maxTokens: Schema.optional<Schema.Number>;
97
+ readonly temperature: Schema.optional<Schema.Number>;
98
+ readonly topP: Schema.optional<Schema.Number>;
99
+ readonly stopSequences: Schema.optional<Schema.$Array<Schema.String>>;
100
+ }>>;
101
+ toolConfig: Schema.optional<Schema.Struct<{
102
+ readonly tools: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
103
+ readonly toolSpec: Schema.Struct<{
104
+ readonly name: Schema.String;
105
+ readonly description: Schema.String;
106
+ readonly inputSchema: Schema.Struct<{
107
+ readonly json: Schema.$Record<Schema.String, Schema.Unknown>;
108
+ }>;
109
+ }>;
110
+ }>, Schema.Struct<{
111
+ readonly cachePoint: Schema.Struct<{
112
+ readonly type: Schema.tag<"default">;
113
+ readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
114
+ }>;
115
+ }>]>>;
116
+ readonly toolChoice: Schema.optional<Schema.Union<readonly [Schema.Struct<{
117
+ readonly auto: Schema.Struct<{}>;
118
+ }>, Schema.Struct<{
119
+ readonly any: Schema.Struct<{}>;
120
+ }>, Schema.Struct<{
121
+ readonly tool: Schema.Struct<{
122
+ readonly name: Schema.String;
123
+ }>;
124
+ }>]>>;
125
+ }>>;
126
+ additionalModelRequestFields: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
127
+ }>;
128
+ export type BedrockConverseBody = Schema.Schema.Type<typeof BedrockConverseBody>;
129
+ interface ParserState {
130
+ readonly tools: ToolStream.State<number>;
131
+ readonly pendingFinish: {
132
+ readonly reason: FinishReasonDetails;
133
+ readonly usage?: Usage;
134
+ } | undefined;
135
+ readonly hasToolCalls: boolean;
136
+ readonly lifecycle: Lifecycle.State;
137
+ readonly reasoningSignatures: Readonly<Record<number, string>>;
138
+ }
139
+ /**
140
+ * The Bedrock Converse protocol — request body construction, body schema, and
141
+ * the streaming-event state machine.
142
+ */
143
+ export declare const protocol: Protocol<{
144
+ readonly messages: readonly ({
145
+ readonly role: "user";
146
+ readonly content: readonly ({
147
+ readonly cachePoint: {
148
+ readonly type: "default";
149
+ readonly ttl?: "1h" | "5m" | undefined;
150
+ };
151
+ } | {
152
+ readonly image: {
153
+ readonly format: "png" | "jpeg" | "gif" | "webp";
154
+ readonly source: {
155
+ readonly bytes: string;
156
+ };
157
+ };
158
+ } | {
159
+ readonly document: {
160
+ readonly format: "pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md";
161
+ readonly name: string;
162
+ readonly source: {
163
+ readonly bytes: string;
164
+ };
165
+ };
166
+ } | {
167
+ readonly text: string;
168
+ } | {
169
+ readonly toolResult: {
170
+ readonly content: readonly ({
171
+ readonly image: {
172
+ readonly format: "png" | "jpeg" | "gif" | "webp";
173
+ readonly source: {
174
+ readonly bytes: string;
175
+ };
176
+ };
177
+ } | {
178
+ readonly document: {
179
+ readonly format: "pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md";
180
+ readonly name: string;
181
+ readonly source: {
182
+ readonly bytes: string;
183
+ };
184
+ };
185
+ } | {
186
+ readonly text: string;
187
+ } | {
188
+ readonly json: unknown;
189
+ })[];
190
+ readonly toolUseId: string;
191
+ readonly status?: "error" | "success" | undefined;
192
+ };
193
+ })[];
194
+ } | {
195
+ readonly role: "assistant";
196
+ readonly content: readonly ({
197
+ readonly cachePoint: {
198
+ readonly type: "default";
199
+ readonly ttl?: "1h" | "5m" | undefined;
200
+ };
201
+ } | {
202
+ readonly text: string;
203
+ } | {
204
+ readonly toolUse: {
205
+ readonly toolUseId: string;
206
+ readonly name: string;
207
+ readonly input: unknown;
208
+ };
209
+ } | {
210
+ readonly reasoningContent: {
211
+ readonly reasoningText: {
212
+ readonly text: string;
213
+ readonly signature?: string | undefined;
214
+ };
215
+ } | {
216
+ readonly redactedContent: string;
217
+ };
218
+ })[];
219
+ })[];
220
+ readonly modelId: string;
221
+ readonly system?: readonly ({
222
+ readonly cachePoint: {
223
+ readonly type: "default";
224
+ readonly ttl?: "1h" | "5m" | undefined;
225
+ };
226
+ } | {
227
+ readonly text: string;
228
+ })[] | undefined;
229
+ readonly inferenceConfig?: {
230
+ readonly maxTokens?: number | undefined;
231
+ readonly temperature?: number | undefined;
232
+ readonly topP?: number | undefined;
233
+ readonly stopSequences?: readonly string[] | undefined;
234
+ } | undefined;
235
+ readonly toolConfig?: {
236
+ readonly tools: readonly ({
237
+ readonly cachePoint: {
238
+ readonly type: "default";
239
+ readonly ttl?: "1h" | "5m" | undefined;
240
+ };
241
+ } | {
242
+ readonly toolSpec: {
243
+ readonly name: string;
244
+ readonly description: string;
245
+ readonly inputSchema: {
246
+ readonly json: {
247
+ readonly [x: string]: unknown;
248
+ };
249
+ };
250
+ };
251
+ })[];
252
+ readonly toolChoice?: {
253
+ readonly auto: {};
254
+ } | {
255
+ readonly any: {};
256
+ } | {
257
+ readonly tool: {
258
+ readonly name: string;
259
+ };
260
+ } | undefined;
261
+ } | undefined;
262
+ readonly additionalModelRequestFields?: {
263
+ readonly [x: string]: unknown;
264
+ } | undefined;
265
+ }, {
266
+ readonly metadata?: {
267
+ readonly usage?: {
268
+ readonly inputTokens?: number | undefined;
269
+ readonly outputTokens?: number | undefined;
270
+ readonly cacheReadInputTokens?: number | undefined;
271
+ readonly cacheWriteInputTokens?: number | undefined;
272
+ readonly totalTokens?: number | undefined;
273
+ } | undefined;
274
+ readonly metrics?: unknown;
275
+ } | undefined;
276
+ readonly messageStart?: {
277
+ readonly role: string;
278
+ } | undefined;
279
+ readonly contentBlockStart?: {
280
+ readonly contentBlockIndex: number;
281
+ readonly start?: {
282
+ readonly toolUse?: {
283
+ readonly toolUseId: string;
284
+ readonly name: string;
285
+ } | undefined;
286
+ } | undefined;
287
+ } | undefined;
288
+ readonly contentBlockDelta?: {
289
+ readonly contentBlockIndex: number;
290
+ readonly delta?: {
291
+ readonly text?: string | undefined;
292
+ readonly toolUse?: {
293
+ readonly input: string;
294
+ } | undefined;
295
+ readonly reasoningContent?: {
296
+ readonly data?: string | undefined;
297
+ readonly text?: string | undefined;
298
+ readonly signature?: string | undefined;
299
+ readonly redactedContent?: string | undefined;
300
+ } | undefined;
301
+ } | undefined;
302
+ } | undefined;
303
+ readonly contentBlockStop?: {
304
+ readonly contentBlockIndex: number;
305
+ } | undefined;
306
+ readonly messageStop?: {
307
+ readonly stopReason: string;
308
+ readonly additionalModelResponseFields?: unknown;
309
+ } | undefined;
310
+ readonly internalServerException?: {
311
+ readonly message?: string | undefined;
312
+ readonly originalMessage?: string | undefined;
313
+ readonly originalStatusCode?: number | undefined;
314
+ } | undefined;
315
+ readonly modelStreamErrorException?: {
316
+ readonly message?: string | undefined;
317
+ readonly originalMessage?: string | undefined;
318
+ readonly originalStatusCode?: number | undefined;
319
+ } | undefined;
320
+ readonly validationException?: {
321
+ readonly message?: string | undefined;
322
+ readonly originalMessage?: string | undefined;
323
+ readonly originalStatusCode?: number | undefined;
324
+ } | undefined;
325
+ readonly throttlingException?: {
326
+ readonly message?: string | undefined;
327
+ readonly originalMessage?: string | undefined;
328
+ readonly originalStatusCode?: number | undefined;
329
+ } | undefined;
330
+ readonly serviceUnavailableException?: {
331
+ readonly message?: string | undefined;
332
+ readonly originalMessage?: string | undefined;
333
+ readonly originalStatusCode?: number | undefined;
334
+ } | undefined;
335
+ }, {
336
+ readonly metadata?: {
337
+ readonly usage?: {
338
+ readonly inputTokens?: number | undefined;
339
+ readonly outputTokens?: number | undefined;
340
+ readonly cacheReadInputTokens?: number | undefined;
341
+ readonly cacheWriteInputTokens?: number | undefined;
342
+ readonly totalTokens?: number | undefined;
343
+ } | undefined;
344
+ readonly metrics?: unknown;
345
+ } | undefined;
346
+ readonly messageStart?: {
347
+ readonly role: string;
348
+ } | undefined;
349
+ readonly contentBlockStart?: {
350
+ readonly contentBlockIndex: number;
351
+ readonly start?: {
352
+ readonly toolUse?: {
353
+ readonly toolUseId: string;
354
+ readonly name: string;
355
+ } | undefined;
356
+ } | undefined;
357
+ } | undefined;
358
+ readonly contentBlockDelta?: {
359
+ readonly contentBlockIndex: number;
360
+ readonly delta?: {
361
+ readonly text?: string | undefined;
362
+ readonly toolUse?: {
363
+ readonly input: string;
364
+ } | undefined;
365
+ readonly reasoningContent?: {
366
+ readonly data?: string | undefined;
367
+ readonly text?: string | undefined;
368
+ readonly signature?: string | undefined;
369
+ readonly redactedContent?: string | undefined;
370
+ } | undefined;
371
+ } | undefined;
372
+ } | undefined;
373
+ readonly contentBlockStop?: {
374
+ readonly contentBlockIndex: number;
375
+ } | undefined;
376
+ readonly messageStop?: {
377
+ readonly stopReason: string;
378
+ readonly additionalModelResponseFields?: unknown;
379
+ } | undefined;
380
+ readonly internalServerException?: {
381
+ readonly message?: string | undefined;
382
+ readonly originalMessage?: string | undefined;
383
+ readonly originalStatusCode?: number | undefined;
384
+ } | undefined;
385
+ readonly modelStreamErrorException?: {
386
+ readonly message?: string | undefined;
387
+ readonly originalMessage?: string | undefined;
388
+ readonly originalStatusCode?: number | undefined;
389
+ } | undefined;
390
+ readonly validationException?: {
391
+ readonly message?: string | undefined;
392
+ readonly originalMessage?: string | undefined;
393
+ readonly originalStatusCode?: number | undefined;
394
+ } | undefined;
395
+ readonly throttlingException?: {
396
+ readonly message?: string | undefined;
397
+ readonly originalMessage?: string | undefined;
398
+ readonly originalStatusCode?: number | undefined;
399
+ } | undefined;
400
+ readonly serviceUnavailableException?: {
401
+ readonly message?: string | undefined;
402
+ readonly originalMessage?: string | undefined;
403
+ readonly originalStatusCode?: number | undefined;
404
+ } | undefined;
405
+ }, ParserState>;
406
+ export declare const route: Route<{
407
+ readonly messages: readonly ({
408
+ readonly role: "user";
409
+ readonly content: readonly ({
410
+ readonly cachePoint: {
411
+ readonly type: "default";
412
+ readonly ttl?: "1h" | "5m" | undefined;
413
+ };
414
+ } | {
415
+ readonly image: {
416
+ readonly format: "png" | "jpeg" | "gif" | "webp";
417
+ readonly source: {
418
+ readonly bytes: string;
419
+ };
420
+ };
421
+ } | {
422
+ readonly document: {
423
+ readonly format: "pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md";
424
+ readonly name: string;
425
+ readonly source: {
426
+ readonly bytes: string;
427
+ };
428
+ };
429
+ } | {
430
+ readonly text: string;
431
+ } | {
432
+ readonly toolResult: {
433
+ readonly content: readonly ({
434
+ readonly image: {
435
+ readonly format: "png" | "jpeg" | "gif" | "webp";
436
+ readonly source: {
437
+ readonly bytes: string;
438
+ };
439
+ };
440
+ } | {
441
+ readonly document: {
442
+ readonly format: "pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md";
443
+ readonly name: string;
444
+ readonly source: {
445
+ readonly bytes: string;
446
+ };
447
+ };
448
+ } | {
449
+ readonly text: string;
450
+ } | {
451
+ readonly json: unknown;
452
+ })[];
453
+ readonly toolUseId: string;
454
+ readonly status?: "error" | "success" | undefined;
455
+ };
456
+ })[];
457
+ } | {
458
+ readonly role: "assistant";
459
+ readonly content: readonly ({
460
+ readonly cachePoint: {
461
+ readonly type: "default";
462
+ readonly ttl?: "1h" | "5m" | undefined;
463
+ };
464
+ } | {
465
+ readonly text: string;
466
+ } | {
467
+ readonly toolUse: {
468
+ readonly toolUseId: string;
469
+ readonly name: string;
470
+ readonly input: unknown;
471
+ };
472
+ } | {
473
+ readonly reasoningContent: {
474
+ readonly reasoningText: {
475
+ readonly text: string;
476
+ readonly signature?: string | undefined;
477
+ };
478
+ } | {
479
+ readonly redactedContent: string;
480
+ };
481
+ })[];
482
+ })[];
483
+ readonly modelId: string;
484
+ readonly system?: readonly ({
485
+ readonly cachePoint: {
486
+ readonly type: "default";
487
+ readonly ttl?: "1h" | "5m" | undefined;
488
+ };
489
+ } | {
490
+ readonly text: string;
491
+ })[] | undefined;
492
+ readonly inferenceConfig?: {
493
+ readonly maxTokens?: number | undefined;
494
+ readonly temperature?: number | undefined;
495
+ readonly topP?: number | undefined;
496
+ readonly stopSequences?: readonly string[] | undefined;
497
+ } | undefined;
498
+ readonly toolConfig?: {
499
+ readonly tools: readonly ({
500
+ readonly cachePoint: {
501
+ readonly type: "default";
502
+ readonly ttl?: "1h" | "5m" | undefined;
503
+ };
504
+ } | {
505
+ readonly toolSpec: {
506
+ readonly name: string;
507
+ readonly description: string;
508
+ readonly inputSchema: {
509
+ readonly json: {
510
+ readonly [x: string]: unknown;
511
+ };
512
+ };
513
+ };
514
+ })[];
515
+ readonly toolChoice?: {
516
+ readonly auto: {};
517
+ } | {
518
+ readonly any: {};
519
+ } | {
520
+ readonly tool: {
521
+ readonly name: string;
522
+ };
523
+ } | undefined;
524
+ } | undefined;
525
+ readonly additionalModelRequestFields?: {
526
+ readonly [x: string]: unknown;
527
+ } | undefined;
528
+ }, import("../route/transport/http.js").HttpPrepared<object>>;
529
+ export declare const sigV4Auth: (credentials: BedrockAuth.Credentials | undefined, options?: {
530
+ readonly service?: string;
531
+ readonly name?: string;
532
+ }) => import("../route.js").AuthShape;
533
+ export * as BedrockConverse from "./bedrock-converse.js";