@zyraxon-ai/llm 19.0.5 → 19.0.6

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 (218) hide show
  1. package/README.md +131 -131
  2. package/dist/cache-policy.js +1 -0
  3. package/dist/cache-policy.js.map +1 -1
  4. package/dist/index.js +1 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/llm.js +1 -0
  7. package/dist/llm.js.map +1 -1
  8. package/dist/protocols/anthropic-messages.js +1 -0
  9. package/dist/protocols/anthropic-messages.js.map +1 -1
  10. package/dist/protocols/bedrock-converse.js +1 -0
  11. package/dist/protocols/bedrock-converse.js.map +1 -1
  12. package/dist/protocols/bedrock-event-stream.js +1 -0
  13. package/dist/protocols/bedrock-event-stream.js.map +1 -1
  14. package/dist/protocols/gemini.js +1 -0
  15. package/dist/protocols/gemini.js.map +1 -1
  16. package/dist/protocols/index.js +1 -0
  17. package/dist/protocols/index.js.map +1 -1
  18. package/dist/protocols/openai-chat.js +1 -0
  19. package/dist/protocols/openai-chat.js.map +1 -1
  20. package/dist/protocols/openai-compatible-chat.js +1 -0
  21. package/dist/protocols/openai-compatible-chat.js.map +1 -1
  22. package/dist/protocols/openai-responses.js +1 -0
  23. package/dist/protocols/openai-responses.js.map +1 -1
  24. package/dist/protocols/shared.js +1 -0
  25. package/dist/protocols/shared.js.map +1 -1
  26. package/dist/protocols/utils/bedrock-auth.js +1 -0
  27. package/dist/protocols/utils/bedrock-auth.js.map +1 -1
  28. package/dist/protocols/utils/bedrock-cache.js +1 -0
  29. package/dist/protocols/utils/bedrock-cache.js.map +1 -1
  30. package/dist/protocols/utils/bedrock-media.js +1 -0
  31. package/dist/protocols/utils/bedrock-media.js.map +1 -1
  32. package/dist/protocols/utils/cache.js +1 -3
  33. package/dist/protocols/utils/cache.js.map +1 -1
  34. package/dist/protocols/utils/gemini-tool-schema.js +1 -0
  35. package/dist/protocols/utils/gemini-tool-schema.js.map +1 -1
  36. package/dist/protocols/utils/lifecycle.js +1 -0
  37. package/dist/protocols/utils/lifecycle.js.map +1 -1
  38. package/dist/protocols/utils/openai-options.js +1 -0
  39. package/dist/protocols/utils/openai-options.js.map +1 -1
  40. package/dist/protocols/utils/tool-schema.js +1 -0
  41. package/dist/protocols/utils/tool-schema.js.map +1 -1
  42. package/dist/protocols/utils/tool-stream.js +1 -0
  43. package/dist/protocols/utils/tool-stream.js.map +1 -1
  44. package/dist/provider-error.js +1 -0
  45. package/dist/provider-error.js.map +1 -1
  46. package/dist/provider.js +1 -0
  47. package/dist/provider.js.map +1 -1
  48. package/dist/providers/amazon-bedrock.js +1 -0
  49. package/dist/providers/amazon-bedrock.js.map +1 -1
  50. package/dist/providers/anthropic.js +1 -0
  51. package/dist/providers/anthropic.js.map +1 -1
  52. package/dist/providers/azure.js +1 -0
  53. package/dist/providers/azure.js.map +1 -1
  54. package/dist/providers/cloudflare.js +1 -0
  55. package/dist/providers/cloudflare.js.map +1 -1
  56. package/dist/providers/github-copilot.js +1 -0
  57. package/dist/providers/github-copilot.js.map +1 -1
  58. package/dist/providers/google.js +1 -0
  59. package/dist/providers/google.js.map +1 -1
  60. package/dist/providers/index.js +1 -0
  61. package/dist/providers/index.js.map +1 -1
  62. package/dist/providers/openai-compatible-profile.js +1 -0
  63. package/dist/providers/openai-compatible-profile.js.map +1 -1
  64. package/dist/providers/openai-compatible.js +1 -0
  65. package/dist/providers/openai-compatible.js.map +1 -1
  66. package/dist/providers/openai-options.js +1 -0
  67. package/dist/providers/openai-options.js.map +1 -1
  68. package/dist/providers/openai.js +1 -0
  69. package/dist/providers/openai.js.map +1 -1
  70. package/dist/providers/openrouter.js +1 -0
  71. package/dist/providers/openrouter.js.map +1 -1
  72. package/dist/providers/xai.js +1 -0
  73. package/dist/providers/xai.js.map +1 -1
  74. package/dist/route/auth-options.js +1 -0
  75. package/dist/route/auth-options.js.map +1 -1
  76. package/dist/route/auth.js +1 -0
  77. package/dist/route/auth.js.map +1 -1
  78. package/dist/route/client.js +1 -0
  79. package/dist/route/client.js.map +1 -1
  80. package/dist/route/endpoint.js +1 -0
  81. package/dist/route/endpoint.js.map +1 -1
  82. package/dist/route/executor.js +1 -0
  83. package/dist/route/executor.js.map +1 -1
  84. package/dist/route/framing.js +1 -0
  85. package/dist/route/framing.js.map +1 -1
  86. package/dist/route/index.js +1 -0
  87. package/dist/route/index.js.map +1 -1
  88. package/dist/route/protocol.js +1 -0
  89. package/dist/route/protocol.js.map +1 -1
  90. package/dist/route/transport/http.js +1 -0
  91. package/dist/route/transport/http.js.map +1 -1
  92. package/dist/route/transport/index.js +1 -0
  93. package/dist/route/transport/index.js.map +1 -1
  94. package/dist/route/transport/websocket.js +1 -0
  95. package/dist/route/transport/websocket.js.map +1 -1
  96. package/dist/schema/errors.js +1 -0
  97. package/dist/schema/errors.js.map +1 -1
  98. package/dist/schema/events.js +1 -0
  99. package/dist/schema/events.js.map +1 -1
  100. package/dist/schema/ids.js +1 -0
  101. package/dist/schema/ids.js.map +1 -1
  102. package/dist/schema/index.js +1 -0
  103. package/dist/schema/index.js.map +1 -1
  104. package/dist/schema/messages.js +1 -0
  105. package/dist/schema/messages.js.map +1 -1
  106. package/dist/schema/options.js +1 -0
  107. package/dist/schema/options.js.map +1 -1
  108. package/dist/tool-runtime.js +1 -0
  109. package/dist/tool-runtime.js.map +1 -1
  110. package/dist/tool.js +1 -0
  111. package/dist/tool.js.map +1 -1
  112. package/dist/utils/record.js +1 -0
  113. package/dist/utils/record.js.map +1 -1
  114. package/package.json +107 -21
  115. package/dist/cache-policy.d.ts +0 -3
  116. package/dist/cache-policy.d.ts.map +0 -1
  117. package/dist/index.d.ts +0 -13
  118. package/dist/index.d.ts.map +0 -1
  119. package/dist/llm.d.ts +0 -205
  120. package/dist/llm.d.ts.map +0 -1
  121. package/dist/protocols/anthropic-messages.d.ts +0 -340
  122. package/dist/protocols/anthropic-messages.d.ts.map +0 -1
  123. package/dist/protocols/bedrock-converse.d.ts +0 -472
  124. package/dist/protocols/bedrock-converse.d.ts.map +0 -1
  125. package/dist/protocols/bedrock-event-stream.d.ts +0 -10
  126. package/dist/protocols/bedrock-event-stream.d.ts.map +0 -1
  127. package/dist/protocols/gemini.d.ts +0 -165
  128. package/dist/protocols/gemini.d.ts.map +0 -1
  129. package/dist/protocols/index.d.ts +0 -7
  130. package/dist/protocols/index.d.ts.map +0 -1
  131. package/dist/protocols/openai-chat.d.ts +0 -297
  132. package/dist/protocols/openai-chat.d.ts.map +0 -1
  133. package/dist/protocols/openai-compatible-chat.d.ts +0 -12
  134. package/dist/protocols/openai-compatible-chat.d.ts.map +0 -1
  135. package/dist/protocols/openai-responses.d.ts +0 -615
  136. package/dist/protocols/openai-responses.d.ts.map +0 -1
  137. package/dist/protocols/shared.d.ts +0 -193
  138. package/dist/protocols/shared.d.ts.map +0 -1
  139. package/dist/protocols/utils/bedrock-auth.d.ts +0 -19
  140. package/dist/protocols/utils/bedrock-auth.d.ts.map +0 -1
  141. package/dist/protocols/utils/bedrock-cache.d.ts +0 -16
  142. package/dist/protocols/utils/bedrock-cache.d.ts.map +0 -1
  143. package/dist/protocols/utils/bedrock-media.d.ts +0 -50
  144. package/dist/protocols/utils/bedrock-media.d.ts.map +0 -1
  145. package/dist/protocols/utils/cache.d.ts +0 -7
  146. package/dist/protocols/utils/cache.d.ts.map +0 -1
  147. package/dist/protocols/utils/gemini-tool-schema.d.ts +0 -3
  148. package/dist/protocols/utils/gemini-tool-schema.d.ts.map +0 -1
  149. package/dist/protocols/utils/lifecycle.d.ts +0 -20
  150. package/dist/protocols/utils/lifecycle.d.ts.map +0 -1
  151. package/dist/protocols/utils/openai-options.d.ts +0 -23
  152. package/dist/protocols/utils/openai-options.d.ts.map +0 -1
  153. package/dist/protocols/utils/tool-schema.d.ts +0 -8
  154. package/dist/protocols/utils/tool-schema.d.ts.map +0 -1
  155. package/dist/protocols/utils/tool-stream.d.ts +0 -156
  156. package/dist/protocols/utils/tool-stream.d.ts.map +0 -1
  157. package/dist/provider-error.d.ts +0 -3
  158. package/dist/provider-error.d.ts.map +0 -1
  159. package/dist/provider.d.ts +0 -24
  160. package/dist/provider.d.ts.map +0 -1
  161. package/dist/providers/amazon-bedrock.d.ts +0 -142
  162. package/dist/providers/amazon-bedrock.d.ts.map +0 -1
  163. package/dist/providers/anthropic.d.ts +0 -24
  164. package/dist/providers/anthropic.d.ts.map +0 -1
  165. package/dist/providers/azure.d.ts +0 -36
  166. package/dist/providers/azure.d.ts.map +0 -1
  167. package/dist/providers/cloudflare.d.ts +0 -47
  168. package/dist/providers/cloudflare.d.ts.map +0 -1
  169. package/dist/providers/github-copilot.d.ts +0 -30
  170. package/dist/providers/github-copilot.d.ts.map +0 -1
  171. package/dist/providers/google.d.ts +0 -24
  172. package/dist/providers/google.d.ts.map +0 -1
  173. package/dist/providers/index.d.ts +0 -12
  174. package/dist/providers/index.d.ts.map +0 -1
  175. package/dist/providers/openai-compatible-profile.d.ts +0 -44
  176. package/dist/providers/openai-compatible-profile.d.ts.map +0 -1
  177. package/dist/providers/openai-compatible.d.ts +0 -62
  178. package/dist/providers/openai-compatible.d.ts.map +0 -1
  179. package/dist/providers/openai-options.d.ts +0 -31
  180. package/dist/providers/openai-options.d.ts.map +0 -1
  181. package/dist/providers/openai.d.ts +0 -116
  182. package/dist/providers/openai.d.ts.map +0 -1
  183. package/dist/providers/openrouter.d.ts +0 -199
  184. package/dist/providers/openrouter.d.ts.map +0 -1
  185. package/dist/providers/xai.d.ts +0 -32
  186. package/dist/providers/xai.d.ts.map +0 -1
  187. package/dist/route/auth-options.d.ts +0 -35
  188. package/dist/route/auth-options.d.ts.map +0 -1
  189. package/dist/route/client.d.ts +0 -306
  190. package/dist/route/client.d.ts.map +0 -1
  191. package/dist/route/executor.d.ts +0 -13
  192. package/dist/route/executor.d.ts.map +0 -1
  193. package/dist/route/index.d.ts +0 -17
  194. package/dist/route/index.d.ts.map +0 -1
  195. package/dist/route/protocol.d.ts +0 -77
  196. package/dist/route/protocol.d.ts.map +0 -1
  197. package/dist/route/transport/http.d.ts +0 -34
  198. package/dist/route/transport/http.d.ts.map +0 -1
  199. package/dist/route/transport/index.d.ts +0 -28
  200. package/dist/route/transport/index.d.ts.map +0 -1
  201. package/dist/route/transport/websocket.d.ts +0 -57
  202. package/dist/route/transport/websocket.d.ts.map +0 -1
  203. package/dist/schema/errors.d.ts +0 -166
  204. package/dist/schema/errors.d.ts.map +0 -1
  205. package/dist/schema/events.d.ts +0 -3821
  206. package/dist/schema/events.d.ts.map +0 -1
  207. package/dist/schema/ids.d.ts +0 -31
  208. package/dist/schema/ids.d.ts.map +0 -1
  209. package/dist/schema/index.d.ts +0 -6
  210. package/dist/schema/index.d.ts.map +0 -1
  211. package/dist/schema/messages.d.ts +0 -294
  212. package/dist/schema/messages.d.ts.map +0 -1
  213. package/dist/schema/options.d.ts +0 -144
  214. package/dist/schema/options.d.ts.map +0 -1
  215. package/dist/tool-runtime.d.ts +0 -16
  216. package/dist/tool-runtime.d.ts.map +0 -1
  217. package/dist/utils/record.d.ts +0 -3
  218. package/dist/utils/record.d.ts.map +0 -1
@@ -1,472 +0,0 @@
1
- import { Schema } from "effect";
2
- import { Route } from "../route/client";
3
- import { Protocol } from "../route/protocol";
4
- import { BedrockAuth } from "./utils/bedrock-auth";
5
- import { Lifecycle } from "./utils/lifecycle";
6
- import { ToolStream } from "./utils/tool-stream";
7
- export type { Credentials as BedrockCredentials } from "./utils/bedrock-auth";
8
- declare const BedrockConverseBody: Schema.Struct<{
9
- modelId: Schema.String;
10
- messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
11
- readonly role: Schema.Literal<"user">;
12
- readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
13
- readonly text: Schema.String;
14
- }>, Schema.Struct<{
15
- readonly image: Schema.Struct<{
16
- readonly format: Schema.Literals<readonly ["png", "jpeg", "gif", "webp"]>;
17
- readonly source: Schema.Struct<{
18
- readonly bytes: Schema.String;
19
- }>;
20
- }>;
21
- }>, Schema.Struct<{
22
- readonly document: Schema.Struct<{
23
- readonly format: Schema.Literals<readonly ["pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md"]>;
24
- readonly name: Schema.String;
25
- readonly source: Schema.Struct<{
26
- readonly bytes: Schema.String;
27
- }>;
28
- }>;
29
- }>, Schema.Struct<{
30
- readonly toolResult: Schema.Struct<{
31
- readonly toolUseId: Schema.String;
32
- readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
33
- readonly text: Schema.String;
34
- }>, Schema.Struct<{
35
- readonly json: Schema.Unknown;
36
- }>, Schema.Struct<{
37
- readonly image: Schema.Struct<{
38
- readonly format: Schema.Literals<readonly ["png", "jpeg", "gif", "webp"]>;
39
- readonly source: Schema.Struct<{
40
- readonly bytes: Schema.String;
41
- }>;
42
- }>;
43
- }>]>>;
44
- readonly status: Schema.optional<Schema.Literals<readonly ["success", "error"]>>;
45
- }>;
46
- }>, Schema.Struct<{
47
- readonly cachePoint: Schema.Struct<{
48
- readonly type: Schema.tag<"default">;
49
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
50
- }>;
51
- }>]>>;
52
- }>, Schema.Struct<{
53
- readonly role: Schema.Literal<"assistant">;
54
- readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
55
- readonly text: Schema.String;
56
- }>, Schema.Struct<{
57
- readonly reasoningContent: Schema.Struct<{
58
- readonly reasoningText: Schema.optional<Schema.Struct<{
59
- readonly text: Schema.String;
60
- readonly signature: Schema.optional<Schema.String>;
61
- }>>;
62
- }>;
63
- }>, Schema.Struct<{
64
- readonly toolUse: Schema.Struct<{
65
- readonly toolUseId: Schema.String;
66
- readonly name: Schema.String;
67
- readonly input: Schema.Unknown;
68
- }>;
69
- }>, Schema.Struct<{
70
- readonly cachePoint: Schema.Struct<{
71
- readonly type: Schema.tag<"default">;
72
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
73
- }>;
74
- }>]>>;
75
- }>]>>;
76
- system: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
77
- readonly text: Schema.String;
78
- }>, Schema.Struct<{
79
- readonly cachePoint: Schema.Struct<{
80
- readonly type: Schema.tag<"default">;
81
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
82
- }>;
83
- }>]>>>;
84
- inferenceConfig: Schema.optional<Schema.Struct<{
85
- readonly maxTokens: Schema.optional<Schema.Number>;
86
- readonly temperature: Schema.optional<Schema.Number>;
87
- readonly topP: Schema.optional<Schema.Number>;
88
- readonly stopSequences: Schema.optional<Schema.$Array<Schema.String>>;
89
- }>>;
90
- toolConfig: Schema.optional<Schema.Struct<{
91
- readonly tools: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
92
- readonly toolSpec: Schema.Struct<{
93
- readonly name: Schema.String;
94
- readonly description: Schema.String;
95
- readonly inputSchema: Schema.Struct<{
96
- readonly json: Schema.$Record<Schema.String, Schema.Unknown>;
97
- }>;
98
- }>;
99
- }>, Schema.Struct<{
100
- readonly cachePoint: Schema.Struct<{
101
- readonly type: Schema.tag<"default">;
102
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
103
- }>;
104
- }>]>>;
105
- readonly toolChoice: Schema.optional<Schema.Union<readonly [Schema.Struct<{
106
- readonly auto: Schema.Struct<{}>;
107
- }>, Schema.Struct<{
108
- readonly any: Schema.Struct<{}>;
109
- }>, Schema.Struct<{
110
- readonly tool: Schema.Struct<{
111
- readonly name: Schema.String;
112
- }>;
113
- }>]>>;
114
- }>>;
115
- additionalModelRequestFields: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
116
- }>;
117
- export type BedrockConverseBody = Schema.Schema.Type<typeof BedrockConverseBody>;
118
- /**
119
- * The Bedrock Converse protocol — request body construction, body schema, and
120
- * the streaming-event state machine.
121
- */
122
- export declare const protocol: Protocol<{
123
- readonly modelId: string;
124
- readonly messages: readonly ({
125
- readonly role: "user";
126
- readonly content: readonly ({
127
- readonly cachePoint: {
128
- readonly type: "default";
129
- readonly ttl?: "1h" | "5m";
130
- };
131
- } | {
132
- readonly image: {
133
- readonly format: "png" | "jpeg" | "gif" | "webp";
134
- readonly source: {
135
- readonly bytes: string;
136
- };
137
- };
138
- } | {
139
- readonly document: {
140
- readonly format: "pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md";
141
- readonly name: string;
142
- readonly source: {
143
- readonly bytes: string;
144
- };
145
- };
146
- } | {
147
- readonly text: string;
148
- } | {
149
- readonly toolResult: {
150
- readonly toolUseId: string;
151
- readonly content: readonly ({
152
- readonly image: {
153
- readonly format: "png" | "jpeg" | "gif" | "webp";
154
- readonly source: {
155
- readonly bytes: string;
156
- };
157
- };
158
- } | {
159
- readonly text: string;
160
- } | {
161
- readonly json: unknown;
162
- })[];
163
- readonly status?: "error" | "success";
164
- };
165
- })[];
166
- } | {
167
- readonly role: "assistant";
168
- readonly content: readonly ({
169
- readonly cachePoint: {
170
- readonly type: "default";
171
- readonly ttl?: "1h" | "5m";
172
- };
173
- } | {
174
- readonly text: string;
175
- } | {
176
- readonly reasoningContent: {
177
- readonly reasoningText?: {
178
- readonly text: string;
179
- readonly signature?: string;
180
- };
181
- };
182
- } | {
183
- readonly toolUse: {
184
- readonly toolUseId: string;
185
- readonly name: string;
186
- readonly input: unknown;
187
- };
188
- })[];
189
- })[];
190
- readonly system?: readonly ({
191
- readonly cachePoint: {
192
- readonly type: "default";
193
- readonly ttl?: "1h" | "5m";
194
- };
195
- } | {
196
- readonly text: string;
197
- })[];
198
- readonly inferenceConfig?: {
199
- readonly maxTokens?: number;
200
- readonly temperature?: number;
201
- readonly topP?: number;
202
- readonly stopSequences?: readonly string[];
203
- };
204
- readonly toolConfig?: {
205
- readonly tools: readonly ({
206
- readonly cachePoint: {
207
- readonly type: "default";
208
- readonly ttl?: "1h" | "5m";
209
- };
210
- } | {
211
- readonly toolSpec: {
212
- readonly name: string;
213
- readonly description: string;
214
- readonly inputSchema: {
215
- readonly json: {
216
- readonly [x: string]: unknown;
217
- };
218
- };
219
- };
220
- })[];
221
- readonly toolChoice?: {
222
- readonly auto: {};
223
- } | {
224
- readonly any: {};
225
- } | {
226
- readonly tool: {
227
- readonly name: string;
228
- };
229
- };
230
- };
231
- readonly additionalModelRequestFields?: {
232
- readonly [x: string]: unknown;
233
- };
234
- }, {
235
- readonly messageStart?: {
236
- readonly role: string;
237
- };
238
- readonly contentBlockStart?: {
239
- readonly contentBlockIndex: number;
240
- readonly start?: {
241
- readonly toolUse?: {
242
- readonly toolUseId: string;
243
- readonly name: string;
244
- };
245
- };
246
- };
247
- readonly contentBlockDelta?: {
248
- readonly contentBlockIndex: number;
249
- readonly delta?: {
250
- readonly text?: string;
251
- readonly toolUse?: {
252
- readonly input: string;
253
- };
254
- readonly reasoningContent?: {
255
- readonly text?: string;
256
- readonly signature?: string;
257
- };
258
- };
259
- };
260
- readonly contentBlockStop?: {
261
- readonly contentBlockIndex: number;
262
- };
263
- readonly messageStop?: {
264
- readonly stopReason: string;
265
- readonly additionalModelResponseFields?: unknown;
266
- };
267
- readonly metadata?: {
268
- readonly usage?: {
269
- readonly inputTokens?: number;
270
- readonly outputTokens?: number;
271
- readonly totalTokens?: number;
272
- readonly cacheReadInputTokens?: number;
273
- readonly cacheWriteInputTokens?: number;
274
- };
275
- readonly metrics?: unknown;
276
- };
277
- readonly internalServerException?: {
278
- readonly message: string;
279
- };
280
- readonly modelStreamErrorException?: {
281
- readonly message: string;
282
- };
283
- readonly validationException?: {
284
- readonly message: string;
285
- };
286
- readonly throttlingException?: {
287
- readonly message: string;
288
- };
289
- readonly serviceUnavailableException?: {
290
- readonly message: string;
291
- };
292
- }, {
293
- readonly messageStart?: {
294
- readonly role: string;
295
- };
296
- readonly contentBlockStart?: {
297
- readonly contentBlockIndex: number;
298
- readonly start?: {
299
- readonly toolUse?: {
300
- readonly toolUseId: string;
301
- readonly name: string;
302
- };
303
- };
304
- };
305
- readonly contentBlockDelta?: {
306
- readonly contentBlockIndex: number;
307
- readonly delta?: {
308
- readonly text?: string;
309
- readonly toolUse?: {
310
- readonly input: string;
311
- };
312
- readonly reasoningContent?: {
313
- readonly text?: string;
314
- readonly signature?: string;
315
- };
316
- };
317
- };
318
- readonly contentBlockStop?: {
319
- readonly contentBlockIndex: number;
320
- };
321
- readonly messageStop?: {
322
- readonly stopReason: string;
323
- readonly additionalModelResponseFields?: unknown;
324
- };
325
- readonly metadata?: {
326
- readonly usage?: {
327
- readonly inputTokens?: number;
328
- readonly outputTokens?: number;
329
- readonly totalTokens?: number;
330
- readonly cacheReadInputTokens?: number;
331
- readonly cacheWriteInputTokens?: number;
332
- };
333
- readonly metrics?: unknown;
334
- };
335
- readonly internalServerException?: {
336
- readonly message: string;
337
- };
338
- readonly modelStreamErrorException?: {
339
- readonly message: string;
340
- };
341
- readonly validationException?: {
342
- readonly message: string;
343
- };
344
- readonly throttlingException?: {
345
- readonly message: string;
346
- };
347
- readonly serviceUnavailableException?: {
348
- readonly message: string;
349
- };
350
- }, {
351
- tools: Partial<Record<number, ToolStream.PendingTool>>;
352
- pendingFinish: any;
353
- hasToolCalls: boolean;
354
- lifecycle: Lifecycle.State;
355
- reasoningSignatures: {};
356
- }>;
357
- export declare const route: Route<{
358
- readonly modelId: string;
359
- readonly messages: readonly ({
360
- readonly role: "user";
361
- readonly content: readonly ({
362
- readonly cachePoint: {
363
- readonly type: "default";
364
- readonly ttl?: "1h" | "5m";
365
- };
366
- } | {
367
- readonly image: {
368
- readonly format: "png" | "jpeg" | "gif" | "webp";
369
- readonly source: {
370
- readonly bytes: string;
371
- };
372
- };
373
- } | {
374
- readonly document: {
375
- readonly format: "pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md";
376
- readonly name: string;
377
- readonly source: {
378
- readonly bytes: string;
379
- };
380
- };
381
- } | {
382
- readonly text: string;
383
- } | {
384
- readonly toolResult: {
385
- readonly toolUseId: string;
386
- readonly content: readonly ({
387
- readonly image: {
388
- readonly format: "png" | "jpeg" | "gif" | "webp";
389
- readonly source: {
390
- readonly bytes: string;
391
- };
392
- };
393
- } | {
394
- readonly text: string;
395
- } | {
396
- readonly json: unknown;
397
- })[];
398
- readonly status?: "error" | "success";
399
- };
400
- })[];
401
- } | {
402
- readonly role: "assistant";
403
- readonly content: readonly ({
404
- readonly cachePoint: {
405
- readonly type: "default";
406
- readonly ttl?: "1h" | "5m";
407
- };
408
- } | {
409
- readonly text: string;
410
- } | {
411
- readonly reasoningContent: {
412
- readonly reasoningText?: {
413
- readonly text: string;
414
- readonly signature?: string;
415
- };
416
- };
417
- } | {
418
- readonly toolUse: {
419
- readonly toolUseId: string;
420
- readonly name: string;
421
- readonly input: unknown;
422
- };
423
- })[];
424
- })[];
425
- readonly system?: readonly ({
426
- readonly cachePoint: {
427
- readonly type: "default";
428
- readonly ttl?: "1h" | "5m";
429
- };
430
- } | {
431
- readonly text: string;
432
- })[];
433
- readonly inferenceConfig?: {
434
- readonly maxTokens?: number;
435
- readonly temperature?: number;
436
- readonly topP?: number;
437
- readonly stopSequences?: readonly string[];
438
- };
439
- readonly toolConfig?: {
440
- readonly tools: readonly ({
441
- readonly cachePoint: {
442
- readonly type: "default";
443
- readonly ttl?: "1h" | "5m";
444
- };
445
- } | {
446
- readonly toolSpec: {
447
- readonly name: string;
448
- readonly description: string;
449
- readonly inputSchema: {
450
- readonly json: {
451
- readonly [x: string]: unknown;
452
- };
453
- };
454
- };
455
- })[];
456
- readonly toolChoice?: {
457
- readonly auto: {};
458
- } | {
459
- readonly any: {};
460
- } | {
461
- readonly tool: {
462
- readonly name: string;
463
- };
464
- };
465
- };
466
- readonly additionalModelRequestFields?: {
467
- readonly [x: string]: unknown;
468
- };
469
- }, import("../route/transport/http").HttpPrepared<object>>;
470
- export declare const sigV4Auth: (credentials: BedrockAuth.Credentials | undefined) => import("..").Auth;
471
- export * as BedrockConverse from "./bedrock-converse";
472
- //# sourceMappingURL=bedrock-converse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bedrock-converse.d.ts","sourceRoot":"","sources":["../../src/protocols/bedrock-converse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAkB5C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAIhD,YAAY,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AA+G7E,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAmC,CAAA;AAC5D,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAA;AA2ehF;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBnB,CAAA;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAYhB,CAAA;AAEF,eAAO,MAAM,SAAS,yEAAoB,CAAA;AAE1C,OAAO,KAAK,eAAe,MAAM,oBAAoB,CAAA"}
@@ -1,10 +0,0 @@
1
- import type { Framing } from "../route/framing";
2
- /**
3
- * AWS event-stream framing for Bedrock Converse. Each frame is decoded by
4
- * `@smithy/eventstream-codec` (length + header + payload + CRC) and rewrapped
5
- * under its `:event-type` header so the chunk schema can match the JSON
6
- * payload directly.
7
- */
8
- export declare const framing: (route: string) => Framing<object>;
9
- export * as BedrockEventStream from "./bedrock-event-stream";
10
- //# sourceMappingURL=bedrock-event-stream.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bedrock-event-stream.d.ts","sourceRoot":"","sources":["../../src/protocols/bedrock-event-stream.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAwE/C;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,KAAG,OAAO,CAAC,MAAM,CAGpD,CAAA;AAEF,OAAO,KAAK,kBAAkB,MAAM,wBAAwB,CAAA"}
@@ -1,165 +0,0 @@
1
- import { Schema } from "effect";
2
- import { Route } from "../route/client";
3
- import { Protocol } from "../route/protocol";
4
- import { Lifecycle } from "./utils/lifecycle";
5
- export declare const DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
6
- declare const GeminiBody: Schema.Struct<{
7
- contents: Schema.$Array<Schema.Struct<{
8
- readonly role: Schema.Literals<readonly ["user", "model"]>;
9
- readonly parts: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
10
- readonly text: Schema.String;
11
- readonly thought: Schema.optional<Schema.Boolean>;
12
- readonly thoughtSignature: Schema.optional<Schema.String>;
13
- }>, Schema.Struct<{
14
- readonly inlineData: Schema.Struct<{
15
- readonly mimeType: Schema.String;
16
- readonly data: Schema.String;
17
- }>;
18
- }>, Schema.Struct<{
19
- readonly functionCall: Schema.Struct<{
20
- readonly name: Schema.String;
21
- readonly args: Schema.Unknown;
22
- }>;
23
- readonly thoughtSignature: Schema.optional<Schema.String>;
24
- }>, Schema.Struct<{
25
- readonly functionResponse: Schema.Struct<{
26
- readonly name: Schema.String;
27
- readonly response: Schema.Unknown;
28
- }>;
29
- }>]>>;
30
- }>>;
31
- systemInstruction: Schema.optional<Schema.Struct<{
32
- readonly parts: Schema.$Array<Schema.Struct<{
33
- readonly text: Schema.String;
34
- }>>;
35
- }>>;
36
- tools: Schema.optional<Schema.$Array<Schema.Struct<{
37
- readonly functionDeclarations: Schema.$Array<Schema.Struct<{
38
- readonly name: Schema.String;
39
- readonly description: Schema.String;
40
- readonly parameters: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
41
- }>>;
42
- }>>>;
43
- toolConfig: Schema.optional<Schema.Struct<{
44
- readonly functionCallingConfig: Schema.Struct<{
45
- readonly mode: Schema.Literals<readonly ["AUTO", "NONE", "ANY"]>;
46
- readonly allowedFunctionNames: Schema.optional<Schema.$Array<Schema.String>>;
47
- }>;
48
- }>>;
49
- generationConfig: Schema.optional<Schema.Struct<{
50
- readonly maxOutputTokens: Schema.optional<Schema.Number>;
51
- readonly temperature: Schema.optional<Schema.Number>;
52
- readonly topP: Schema.optional<Schema.Number>;
53
- readonly topK: Schema.optional<Schema.Number>;
54
- readonly stopSequences: Schema.optional<Schema.$Array<Schema.String>>;
55
- readonly thinkingConfig: Schema.optional<Schema.Struct<{
56
- readonly thinkingBudget: Schema.optional<Schema.Number>;
57
- readonly includeThoughts: Schema.optional<Schema.Boolean>;
58
- }>>;
59
- }>>;
60
- }>;
61
- export type GeminiBody = Schema.Schema.Type<typeof GeminiBody>;
62
- /**
63
- * The Gemini protocol — request body construction, body schema, and the
64
- * streaming-event state machine. Used by Google AI Studio Gemini and (once
65
- * registered) Vertex Gemini.
66
- */
67
- export declare const protocol: Protocol<{
68
- readonly contents: readonly {
69
- readonly role: "user" | "model";
70
- readonly parts: readonly ({
71
- readonly text: string;
72
- readonly thought?: boolean;
73
- readonly thoughtSignature?: string;
74
- } | {
75
- readonly inlineData: {
76
- readonly mimeType: string;
77
- readonly data: string;
78
- };
79
- } | {
80
- readonly functionCall: {
81
- readonly name: string;
82
- readonly args: unknown;
83
- };
84
- readonly thoughtSignature?: string;
85
- } | {
86
- readonly functionResponse: {
87
- readonly name: string;
88
- readonly response: unknown;
89
- };
90
- })[];
91
- }[];
92
- readonly systemInstruction?: {
93
- readonly parts: readonly {
94
- readonly text: string;
95
- }[];
96
- };
97
- readonly tools?: readonly {
98
- readonly functionDeclarations: readonly {
99
- readonly name: string;
100
- readonly description: string;
101
- readonly parameters?: {
102
- readonly [x: string]: unknown;
103
- };
104
- }[];
105
- }[];
106
- readonly toolConfig?: {
107
- readonly functionCallingConfig: {
108
- readonly mode: "AUTO" | "NONE" | "ANY";
109
- readonly allowedFunctionNames?: readonly string[];
110
- };
111
- };
112
- readonly generationConfig?: {
113
- readonly maxOutputTokens?: number;
114
- readonly temperature?: number;
115
- readonly topP?: number;
116
- readonly topK?: number;
117
- readonly stopSequences?: readonly string[];
118
- readonly thinkingConfig?: {
119
- readonly thinkingBudget?: number;
120
- readonly includeThoughts?: boolean;
121
- };
122
- };
123
- }, string, {
124
- readonly candidates?: readonly {
125
- readonly content?: {
126
- readonly role: "user" | "model";
127
- readonly parts: readonly ({
128
- readonly text: string;
129
- readonly thought?: boolean;
130
- readonly thoughtSignature?: string;
131
- } | {
132
- readonly inlineData: {
133
- readonly mimeType: string;
134
- readonly data: string;
135
- };
136
- } | {
137
- readonly functionCall: {
138
- readonly name: string;
139
- readonly args: unknown;
140
- };
141
- readonly thoughtSignature?: string;
142
- } | {
143
- readonly functionResponse: {
144
- readonly name: string;
145
- readonly response: unknown;
146
- };
147
- })[];
148
- };
149
- readonly finishReason?: string;
150
- }[];
151
- readonly usageMetadata?: {
152
- readonly cachedContentTokenCount?: number;
153
- readonly thoughtsTokenCount?: number;
154
- readonly promptTokenCount?: number;
155
- readonly candidatesTokenCount?: number;
156
- readonly totalTokenCount?: number;
157
- };
158
- }, {
159
- hasToolCalls: boolean;
160
- nextToolCallId: number;
161
- lifecycle: Lifecycle.State;
162
- }>;
163
- export declare const route: Route<unknown, import("../route/transport/http").HttpPrepared<string>>;
164
- export * as Gemini from "./gemini";
165
- //# sourceMappingURL=gemini.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../src/protocols/gemini.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAIvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAgB5C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAK7C,eAAO,MAAM,gBAAgB,qDAAqD,CAAA;AAwFlF,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAkC,CAAA;AAClD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAA;AA6W9D;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYnB,CAAA;AAEF,eAAO,MAAM,KAAK,wEAUhB,CAAA;AAEF,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA"}
@@ -1,7 +0,0 @@
1
- export * as AnthropicMessages from "./anthropic-messages";
2
- export * as BedrockConverse from "./bedrock-converse";
3
- export * as Gemini from "./gemini";
4
- export * as OpenAIChat from "./openai-chat";
5
- export * as OpenAICompatibleChat from "./openai-compatible-chat";
6
- export * as OpenAIResponses from "./openai-responses";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocols/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,eAAe,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,oBAAoB,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,eAAe,MAAM,oBAAoB,CAAA"}