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