@opencode/ai 0.0.0-beta-19275

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 (252) hide show
  1. package/README.md +682 -0
  2. package/dist/cache-policy.d.ts +2 -0
  3. package/dist/cache-policy.js +129 -0
  4. package/dist/image-client.d.ts +19 -0
  5. package/dist/image-client.js +28 -0
  6. package/dist/image.d.ts +110 -0
  7. package/dist/image.js +103 -0
  8. package/dist/index.d.ts +18 -0
  9. package/dist/index.js +12 -0
  10. package/dist/llm.d.ts +252 -0
  11. package/dist/llm.js +74 -0
  12. package/dist/protocols/anthropic-messages.d.ts +957 -0
  13. package/dist/protocols/anthropic-messages.js +1414 -0
  14. package/dist/protocols/bedrock-converse.d.ts +499 -0
  15. package/dist/protocols/bedrock-converse.js +643 -0
  16. package/dist/protocols/bedrock-event-stream.d.ts +9 -0
  17. package/dist/protocols/bedrock-event-stream.js +97 -0
  18. package/dist/protocols/gemini.d.ts +285 -0
  19. package/dist/protocols/gemini.js +671 -0
  20. package/dist/protocols/google-images.d.ts +30 -0
  21. package/dist/protocols/google-images.js +181 -0
  22. package/dist/protocols/index.d.ts +12 -0
  23. package/dist/protocols/index.js +12 -0
  24. package/dist/protocols/meta-images.d.ts +26 -0
  25. package/dist/protocols/meta-images.js +89 -0
  26. package/dist/protocols/meta-messages.d.ts +350 -0
  27. package/dist/protocols/meta-messages.js +41 -0
  28. package/dist/protocols/meta-responses.d.ts +473 -0
  29. package/dist/protocols/meta-responses.js +173 -0
  30. package/dist/protocols/mistral-chat.d.ts +540 -0
  31. package/dist/protocols/mistral-chat.js +624 -0
  32. package/dist/protocols/open-responses-channel.d.ts +23 -0
  33. package/dist/protocols/open-responses-channel.js +141 -0
  34. package/dist/protocols/open-responses-continuation.d.ts +12 -0
  35. package/dist/protocols/open-responses-continuation.js +161 -0
  36. package/dist/protocols/open-responses.d.ts +1583 -0
  37. package/dist/protocols/open-responses.js +1206 -0
  38. package/dist/protocols/openai-chat.d.ts +860 -0
  39. package/dist/protocols/openai-chat.js +966 -0
  40. package/dist/protocols/openai-compatible-chat.d.ts +109 -0
  41. package/dist/protocols/openai-compatible-chat.js +19 -0
  42. package/dist/protocols/openai-compatible-responses.d.ts +172 -0
  43. package/dist/protocols/openai-compatible-responses.js +18 -0
  44. package/dist/protocols/openai-images.d.ts +32 -0
  45. package/dist/protocols/openai-images.js +183 -0
  46. package/dist/protocols/openai-responses.d.ts +1389 -0
  47. package/dist/protocols/openai-responses.js +260 -0
  48. package/dist/protocols/shared.d.ts +193 -0
  49. package/dist/protocols/shared.js +290 -0
  50. package/dist/protocols/utils/bedrock-auth.d.ts +60 -0
  51. package/dist/protocols/utils/bedrock-auth.js +85 -0
  52. package/dist/protocols/utils/bedrock-cache.d.ts +19 -0
  53. package/dist/protocols/utils/bedrock-cache.js +49 -0
  54. package/dist/protocols/utils/bedrock-media.d.ts +55 -0
  55. package/dist/protocols/utils/bedrock-media.js +73 -0
  56. package/dist/protocols/utils/cache.d.ts +6 -0
  57. package/dist/protocols/utils/cache.js +5 -0
  58. package/dist/protocols/utils/gemini-tool-schema.d.ts +2 -0
  59. package/dist/protocols/utils/gemini-tool-schema.js +103 -0
  60. package/dist/protocols/utils/image-input.d.ts +21 -0
  61. package/dist/protocols/utils/image-input.js +20 -0
  62. package/dist/protocols/utils/lifecycle.d.ts +24 -0
  63. package/dist/protocols/utils/lifecycle.js +72 -0
  64. package/dist/protocols/utils/meta-image.d.ts +2 -0
  65. package/dist/protocols/utils/meta-image.js +13 -0
  66. package/dist/protocols/utils/open-responses-options.d.ts +56 -0
  67. package/dist/protocols/utils/open-responses-options.js +61 -0
  68. package/dist/protocols/utils/openai-image.d.ts +5 -0
  69. package/dist/protocols/utils/openai-image.js +18 -0
  70. package/dist/protocols/utils/openai-options.d.ts +16 -0
  71. package/dist/protocols/utils/openai-options.js +14 -0
  72. package/dist/protocols/utils/partial-json-options.d.ts +62 -0
  73. package/dist/protocols/utils/partial-json-options.js +52 -0
  74. package/dist/protocols/utils/partial-json.d.ts +8 -0
  75. package/dist/protocols/utils/partial-json.js +279 -0
  76. package/dist/protocols/utils/responses-checkpoint.d.ts +4 -0
  77. package/dist/protocols/utils/responses-checkpoint.js +107 -0
  78. package/dist/protocols/utils/responses-compaction.d.ts +4 -0
  79. package/dist/protocols/utils/responses-compaction.js +129 -0
  80. package/dist/protocols/utils/responses-hosted-tools.d.ts +26 -0
  81. package/dist/protocols/utils/responses-hosted-tools.js +32 -0
  82. package/dist/protocols/utils/tool-schema.d.ts +8 -0
  83. package/dist/protocols/utils/tool-schema.js +54 -0
  84. package/dist/protocols/utils/tool-stream.d.ts +710 -0
  85. package/dist/protocols/utils/tool-stream.js +155 -0
  86. package/dist/protocols/xai-images.d.ts +26 -0
  87. package/dist/protocols/xai-images.js +106 -0
  88. package/dist/protocols/xai-responses.d.ts +250 -0
  89. package/dist/protocols/xai-responses.js +81 -0
  90. package/dist/protocols/zai-images.d.ts +22 -0
  91. package/dist/protocols/zai-images.js +79 -0
  92. package/dist/protocols.d.ts +1 -0
  93. package/dist/protocols.js +1 -0
  94. package/dist/provider-error.d.ts +15 -0
  95. package/dist/provider-error.js +125 -0
  96. package/dist/provider-package.d.ts +11 -0
  97. package/dist/provider-package.js +1 -0
  98. package/dist/provider.d.ts +23 -0
  99. package/dist/provider.js +2 -0
  100. package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -0
  101. package/dist/providers/amazon-bedrock/mantle/chat.js +1 -0
  102. package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -0
  103. package/dist/providers/amazon-bedrock/mantle/responses.js +1 -0
  104. package/dist/providers/amazon-bedrock/mantle.d.ts +2 -0
  105. package/dist/providers/amazon-bedrock/mantle.js +1 -0
  106. package/dist/providers/amazon-bedrock-mantle.d.ts +371 -0
  107. package/dist/providers/amazon-bedrock-mantle.js +76 -0
  108. package/dist/providers/amazon-bedrock.d.ts +173 -0
  109. package/dist/providers/amazon-bedrock.js +41 -0
  110. package/dist/providers/anthropic-compatible.d.ts +304 -0
  111. package/dist/providers/anthropic-compatible.js +44 -0
  112. package/dist/providers/anthropic.d.ts +302 -0
  113. package/dist/providers/anthropic.js +39 -0
  114. package/dist/providers/azure/chat.d.ts +2 -0
  115. package/dist/providers/azure/chat.js +1 -0
  116. package/dist/providers/azure/responses.d.ts +2 -0
  117. package/dist/providers/azure/responses.js +1 -0
  118. package/dist/providers/azure.d.ts +599 -0
  119. package/dist/providers/azure.js +115 -0
  120. package/dist/providers/baseten.d.ts +229 -0
  121. package/dist/providers/baseten.js +38 -0
  122. package/dist/providers/cerebras.d.ts +228 -0
  123. package/dist/providers/cerebras.js +40 -0
  124. package/dist/providers/cloudflare-ai-gateway.d.ts +238 -0
  125. package/dist/providers/cloudflare-ai-gateway.js +59 -0
  126. package/dist/providers/cloudflare-workers-ai.d.ts +232 -0
  127. package/dist/providers/cloudflare-workers-ai.js +45 -0
  128. package/dist/providers/deepinfra.d.ts +228 -0
  129. package/dist/providers/deepinfra.js +43 -0
  130. package/dist/providers/deepseek.d.ts +229 -0
  131. package/dist/providers/deepseek.js +41 -0
  132. package/dist/providers/fireworks.d.ts +229 -0
  133. package/dist/providers/fireworks.js +38 -0
  134. package/dist/providers/google-vertex/chat.d.ts +2 -0
  135. package/dist/providers/google-vertex/chat.js +1 -0
  136. package/dist/providers/google-vertex/gemini.d.ts +2 -0
  137. package/dist/providers/google-vertex/gemini.js +1 -0
  138. package/dist/providers/google-vertex/messages.d.ts +2 -0
  139. package/dist/providers/google-vertex/messages.js +1 -0
  140. package/dist/providers/google-vertex/responses.d.ts +2 -0
  141. package/dist/providers/google-vertex/responses.js +1 -0
  142. package/dist/providers/google-vertex-chat.d.ts +133 -0
  143. package/dist/providers/google-vertex-chat.js +55 -0
  144. package/dist/providers/google-vertex-messages.d.ts +301 -0
  145. package/dist/providers/google-vertex-messages.js +75 -0
  146. package/dist/providers/google-vertex-responses.d.ts +198 -0
  147. package/dist/providers/google-vertex-responses.js +56 -0
  148. package/dist/providers/google-vertex-shared.d.ts +22 -0
  149. package/dist/providers/google-vertex-shared.js +61 -0
  150. package/dist/providers/google-vertex.d.ts +120 -0
  151. package/dist/providers/google-vertex.js +92 -0
  152. package/dist/providers/google.d.ts +115 -0
  153. package/dist/providers/google.js +42 -0
  154. package/dist/providers/groq.d.ts +315 -0
  155. package/dist/providers/groq.js +81 -0
  156. package/dist/providers/index.d.ts +28 -0
  157. package/dist/providers/index.js +28 -0
  158. package/dist/providers/meta/chat.d.ts +2 -0
  159. package/dist/providers/meta/chat.js +1 -0
  160. package/dist/providers/meta/messages.d.ts +2 -0
  161. package/dist/providers/meta/messages.js +1 -0
  162. package/dist/providers/meta/responses.d.ts +2 -0
  163. package/dist/providers/meta/responses.js +1 -0
  164. package/dist/providers/meta.d.ts +631 -0
  165. package/dist/providers/meta.js +113 -0
  166. package/dist/providers/minimax/chat.d.ts +4 -0
  167. package/dist/providers/minimax/chat.js +8 -0
  168. package/dist/providers/minimax/messages.d.ts +1 -0
  169. package/dist/providers/minimax/messages.js +1 -0
  170. package/dist/providers/minimax/responses.d.ts +4 -0
  171. package/dist/providers/minimax/responses.js +8 -0
  172. package/dist/providers/minimax.d.ts +593 -0
  173. package/dist/providers/minimax.js +89 -0
  174. package/dist/providers/mistral.d.ts +208 -0
  175. package/dist/providers/mistral.js +28 -0
  176. package/dist/providers/open-responses-options.d.ts +6 -0
  177. package/dist/providers/open-responses-options.js +1 -0
  178. package/dist/providers/openai/chat.d.ts +2 -0
  179. package/dist/providers/openai/chat.js +1 -0
  180. package/dist/providers/openai/responses.d.ts +2 -0
  181. package/dist/providers/openai/responses.js +1 -0
  182. package/dist/providers/openai-compatible/responses.d.ts +1 -0
  183. package/dist/providers/openai-compatible/responses.js +1 -0
  184. package/dist/providers/openai-compatible-responses.d.ts +196 -0
  185. package/dist/providers/openai-compatible-responses.js +32 -0
  186. package/dist/providers/openai-compatible.d.ts +131 -0
  187. package/dist/providers/openai-compatible.js +33 -0
  188. package/dist/providers/openai-options.d.ts +26 -0
  189. package/dist/providers/openai-options.js +41 -0
  190. package/dist/providers/openai.d.ts +405 -0
  191. package/dist/providers/openai.js +82 -0
  192. package/dist/providers/openrouter.d.ts +564 -0
  193. package/dist/providers/openrouter.js +114 -0
  194. package/dist/providers/togetherai.d.ts +228 -0
  195. package/dist/providers/togetherai.js +40 -0
  196. package/dist/providers/xai.d.ts +164 -0
  197. package/dist/providers/xai.js +84 -0
  198. package/dist/providers/zai.d.ts +24 -0
  199. package/dist/providers/zai.js +21 -0
  200. package/dist/providers.d.ts +1 -0
  201. package/dist/providers.js +1 -0
  202. package/dist/route/auth-options.d.ts +34 -0
  203. package/dist/route/auth-options.js +14 -0
  204. package/dist/route/auth.d.ts +51 -0
  205. package/dist/route/auth.js +87 -0
  206. package/dist/route/client.d.ts +430 -0
  207. package/dist/route/client.js +304 -0
  208. package/dist/route/endpoint.d.ts +28 -0
  209. package/dist/route/endpoint.js +21 -0
  210. package/dist/route/executor.d.ts +27 -0
  211. package/dist/route/executor.js +183 -0
  212. package/dist/route/framing.d.ts +29 -0
  213. package/dist/route/framing.js +14 -0
  214. package/dist/route/index.d.ts +16 -0
  215. package/dist/route/index.js +9 -0
  216. package/dist/route/protocol.d.ts +76 -0
  217. package/dist/route/protocol.js +16 -0
  218. package/dist/route/transport/http.d.ts +34 -0
  219. package/dist/route/transport/http.js +68 -0
  220. package/dist/route/transport/index.d.ts +41 -0
  221. package/dist/route/transport/index.js +4 -0
  222. package/dist/route/transport/websocket-channel.d.ts +57 -0
  223. package/dist/route/transport/websocket-channel.js +1 -0
  224. package/dist/route/transport/websocket.d.ts +56 -0
  225. package/dist/route/transport/websocket.js +366 -0
  226. package/dist/route.d.ts +1 -0
  227. package/dist/route.js +1 -0
  228. package/dist/schema/errors.d.ts +158 -0
  229. package/dist/schema/errors.js +120 -0
  230. package/dist/schema/events.d.ts +8123 -0
  231. package/dist/schema/events.js +550 -0
  232. package/dist/schema/ids.d.ts +17 -0
  233. package/dist/schema/ids.js +10 -0
  234. package/dist/schema/index.d.ts +5 -0
  235. package/dist/schema/index.js +5 -0
  236. package/dist/schema/messages.d.ts +646 -0
  237. package/dist/schema/messages.js +301 -0
  238. package/dist/schema/options.d.ts +157 -0
  239. package/dist/schema/options.js +187 -0
  240. package/dist/testing.d.ts +1693 -0
  241. package/dist/testing.js +129 -0
  242. package/dist/tool-history.d.ts +2 -0
  243. package/dist/tool-history.js +84 -0
  244. package/dist/tool-runtime.d.ts +15 -0
  245. package/dist/tool-runtime.js +62 -0
  246. package/dist/tool.d.ts +136 -0
  247. package/dist/tool.js +66 -0
  248. package/dist/utils/record.d.ts +2 -0
  249. package/dist/utils/record.js +2 -0
  250. package/dist/utils/sanitize.d.ts +1 -0
  251. package/dist/utils/sanitize.js +12 -0
  252. package/package.json +48 -0
@@ -0,0 +1,229 @@
1
+ import type { ProviderPackage } from "../provider-package.js";
2
+ import { type ProviderAuthOption } from "../route/auth-options.js";
3
+ import { Route, type RouteDefaultsInput } from "../route/client.js";
4
+ import { type ModelID } from "../schema/index.js";
5
+ import type { OpenAIProviderOptionsInput } from "./openai-options.js";
6
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
7
+ export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
8
+ readonly baseURL?: string;
9
+ readonly providerOptions?: OpenAIProviderOptionsInput;
10
+ };
11
+ export interface Settings extends ProviderPackage.Settings {
12
+ readonly apiKey?: string;
13
+ readonly baseURL?: string;
14
+ readonly providerOptions?: OpenAIProviderOptionsInput;
15
+ }
16
+ export declare const route: Route<{
17
+ readonly model: string;
18
+ readonly messages: readonly ({
19
+ readonly role: "system";
20
+ readonly content: string | readonly ({
21
+ readonly type: "text";
22
+ readonly text: string;
23
+ readonly cache_control?: {
24
+ readonly type: "ephemeral";
25
+ readonly ttl?: string | undefined;
26
+ } | undefined;
27
+ } | {
28
+ readonly type: "image_url";
29
+ readonly image_url: {
30
+ readonly url: string;
31
+ };
32
+ })[];
33
+ } | {
34
+ readonly role: "user";
35
+ readonly content: string | readonly ({
36
+ readonly type: "text";
37
+ readonly text: string;
38
+ readonly cache_control?: {
39
+ readonly type: "ephemeral";
40
+ readonly ttl?: string | undefined;
41
+ } | undefined;
42
+ } | {
43
+ readonly type: "image_url";
44
+ readonly image_url: {
45
+ readonly url: string;
46
+ };
47
+ })[];
48
+ } | {
49
+ readonly [x: string]: unknown;
50
+ readonly content: string | null;
51
+ readonly role: "assistant";
52
+ readonly reasoning?: string | undefined;
53
+ readonly reasoning_content?: string | undefined;
54
+ readonly reasoning_text?: string | undefined;
55
+ readonly cache_control?: {
56
+ readonly type: "ephemeral";
57
+ readonly ttl?: string | undefined;
58
+ } | undefined;
59
+ readonly tool_calls?: readonly {
60
+ readonly id: string;
61
+ readonly type: "function";
62
+ readonly function: {
63
+ readonly name: string;
64
+ readonly arguments: string;
65
+ };
66
+ }[] | undefined;
67
+ readonly reasoning_details?: unknown;
68
+ } | {
69
+ readonly content: string;
70
+ readonly role: "tool";
71
+ readonly tool_call_id: string;
72
+ readonly cache_control?: {
73
+ readonly type: "ephemeral";
74
+ readonly ttl?: string | undefined;
75
+ } | undefined;
76
+ })[];
77
+ readonly stream: true;
78
+ readonly max_completion_tokens?: number | undefined;
79
+ readonly max_tokens?: number | undefined;
80
+ readonly tools?: readonly {
81
+ readonly function: {
82
+ readonly description: string;
83
+ readonly name: string;
84
+ readonly parameters: {
85
+ readonly [x: string]: unknown;
86
+ };
87
+ readonly strict?: boolean | undefined;
88
+ };
89
+ readonly type: "function";
90
+ readonly cache_control?: {
91
+ readonly type: "ephemeral";
92
+ readonly ttl?: string | undefined;
93
+ } | undefined;
94
+ }[] | undefined;
95
+ readonly stop?: readonly string[] | undefined;
96
+ readonly temperature?: number | undefined;
97
+ readonly seed?: number | undefined;
98
+ readonly tool_choice?: "required" | "auto" | "none" | {
99
+ readonly type: "function";
100
+ readonly function: {
101
+ readonly name: string;
102
+ };
103
+ } | undefined;
104
+ readonly top_p?: number | undefined;
105
+ readonly frequency_penalty?: number | undefined;
106
+ readonly presence_penalty?: number | undefined;
107
+ readonly prompt_cache_key?: string | undefined;
108
+ readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
109
+ readonly store?: boolean | undefined;
110
+ readonly stream_options?: {
111
+ readonly include_usage: boolean;
112
+ } | undefined;
113
+ readonly tool_stream?: boolean | undefined;
114
+ }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
115
+ export declare const routes: Route<{
116
+ readonly model: string;
117
+ readonly messages: readonly ({
118
+ readonly role: "system";
119
+ readonly content: string | readonly ({
120
+ readonly type: "text";
121
+ readonly text: string;
122
+ readonly cache_control?: {
123
+ readonly type: "ephemeral";
124
+ readonly ttl?: string | undefined;
125
+ } | undefined;
126
+ } | {
127
+ readonly type: "image_url";
128
+ readonly image_url: {
129
+ readonly url: string;
130
+ };
131
+ })[];
132
+ } | {
133
+ readonly role: "user";
134
+ readonly content: string | readonly ({
135
+ readonly type: "text";
136
+ readonly text: string;
137
+ readonly cache_control?: {
138
+ readonly type: "ephemeral";
139
+ readonly ttl?: string | undefined;
140
+ } | undefined;
141
+ } | {
142
+ readonly type: "image_url";
143
+ readonly image_url: {
144
+ readonly url: string;
145
+ };
146
+ })[];
147
+ } | {
148
+ readonly [x: string]: unknown;
149
+ readonly content: string | null;
150
+ readonly role: "assistant";
151
+ readonly reasoning?: string | undefined;
152
+ readonly reasoning_content?: string | undefined;
153
+ readonly reasoning_text?: string | undefined;
154
+ readonly cache_control?: {
155
+ readonly type: "ephemeral";
156
+ readonly ttl?: string | undefined;
157
+ } | undefined;
158
+ readonly tool_calls?: readonly {
159
+ readonly id: string;
160
+ readonly type: "function";
161
+ readonly function: {
162
+ readonly name: string;
163
+ readonly arguments: string;
164
+ };
165
+ }[] | undefined;
166
+ readonly reasoning_details?: unknown;
167
+ } | {
168
+ readonly content: string;
169
+ readonly role: "tool";
170
+ readonly tool_call_id: string;
171
+ readonly cache_control?: {
172
+ readonly type: "ephemeral";
173
+ readonly ttl?: string | undefined;
174
+ } | undefined;
175
+ })[];
176
+ readonly stream: true;
177
+ readonly max_completion_tokens?: number | undefined;
178
+ readonly max_tokens?: number | undefined;
179
+ readonly tools?: readonly {
180
+ readonly function: {
181
+ readonly description: string;
182
+ readonly name: string;
183
+ readonly parameters: {
184
+ readonly [x: string]: unknown;
185
+ };
186
+ readonly strict?: boolean | undefined;
187
+ };
188
+ readonly type: "function";
189
+ readonly cache_control?: {
190
+ readonly type: "ephemeral";
191
+ readonly ttl?: string | undefined;
192
+ } | undefined;
193
+ }[] | undefined;
194
+ readonly stop?: readonly string[] | undefined;
195
+ readonly temperature?: number | undefined;
196
+ readonly seed?: number | undefined;
197
+ readonly tool_choice?: "required" | "auto" | "none" | {
198
+ readonly type: "function";
199
+ readonly function: {
200
+ readonly name: string;
201
+ };
202
+ } | undefined;
203
+ readonly top_p?: number | undefined;
204
+ readonly frequency_penalty?: number | undefined;
205
+ readonly presence_penalty?: number | undefined;
206
+ readonly prompt_cache_key?: string | undefined;
207
+ readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
208
+ readonly store?: boolean | undefined;
209
+ readonly stream_options?: {
210
+ readonly include_usage: boolean;
211
+ } | undefined;
212
+ readonly tool_stream?: boolean | undefined;
213
+ }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
214
+ export declare const configure: (input?: LanguageModelOptions) => {
215
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
216
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
217
+ configure: (input?: LanguageModelOptions) => /*elided*/ any;
218
+ };
219
+ export declare const provider: {
220
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
221
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
222
+ configure: (input?: LanguageModelOptions) => {
223
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
224
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
225
+ configure: /*elided*/ any;
226
+ };
227
+ };
228
+ export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
229
+ export * as Fireworks from "./fireworks.js";
@@ -0,0 +1,38 @@
1
+ import { OpenAIChat } from "../protocols/openai-chat.js";
2
+ import { AuthOptions } from "../route/auth-options.js";
3
+ import { Route } from "../route/client.js";
4
+ import { Endpoint } from "../route/endpoint.js";
5
+ import { ProviderID } from "../schema/index.js";
6
+ export const id = ProviderID.make("fireworks");
7
+ const baseURL = "https://api.fireworks.ai/inference/v1";
8
+ export const route = Route.make({
9
+ id: "fireworks-chat",
10
+ provider: id,
11
+ providerMetadataKey: "fireworks",
12
+ protocol: OpenAIChat.protocol,
13
+ endpoint: Endpoint.path("/chat/completions", { baseURL }),
14
+ framing: OpenAIChat.framing,
15
+ });
16
+ export const routes = [route];
17
+ export const configure = (input = {}) => {
18
+ const { apiKey: _apiKey, auth: _auth, baseURL: endpoint, ...defaults } = input;
19
+ const configured = route.with({
20
+ ...defaults,
21
+ endpoint: { baseURL: endpoint ?? baseURL },
22
+ auth: AuthOptions.bearer(input, "FIREWORKS_API_KEY"),
23
+ });
24
+ return {
25
+ id,
26
+ model: (modelID) => configured.model({ id: modelID }),
27
+ configure,
28
+ };
29
+ };
30
+ export const provider = configure();
31
+ export const model = (modelID, settings) => configure({
32
+ apiKey: settings.apiKey,
33
+ baseURL: settings.baseURL,
34
+ headers: settings.headers === undefined ? undefined : { ...settings.headers },
35
+ http: settings.body === undefined ? undefined : { body: { ...settings.body } },
36
+ providerOptions: settings.providerOptions,
37
+ }).model(modelID);
38
+ export * as Fireworks from "./fireworks.js";
@@ -0,0 +1,2 @@
1
+ export { model } from "../google-vertex-chat.js";
2
+ export type { Settings } from "../google-vertex-chat.js";
@@ -0,0 +1 @@
1
+ export { model } from "../google-vertex-chat.js";
@@ -0,0 +1,2 @@
1
+ export { model } from "../google-vertex.js";
2
+ export type { Settings } from "../google-vertex.js";
@@ -0,0 +1 @@
1
+ export { model } from "../google-vertex.js";
@@ -0,0 +1,2 @@
1
+ export { model } from "../google-vertex-messages.js";
2
+ export type { Settings } from "../google-vertex-messages.js";
@@ -0,0 +1 @@
1
+ export { model } from "../google-vertex-messages.js";
@@ -0,0 +1,2 @@
1
+ export { model } from "../google-vertex-responses.js";
2
+ export type { Settings } from "../google-vertex-responses.js";
@@ -0,0 +1 @@
1
+ export { model } from "../google-vertex-responses.js";
@@ -0,0 +1,133 @@
1
+ import type { ProviderPackage } from "../provider-package.js";
2
+ import { Route, type RouteDefaultsInput } from "../route/client.js";
3
+ import { type ModelID } from "../schema/index.js";
4
+ import { GoogleVertexShared } from "./google-vertex-shared.js";
5
+ import type { OpenAIProviderOptionsInput } from "./openai-options.js";
6
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
7
+ export type Config = RouteDefaultsInput & GoogleVertexShared.OAuthOptions & {
8
+ readonly baseURL?: string;
9
+ readonly location?: string;
10
+ readonly project?: string;
11
+ readonly providerOptions?: OpenAIProviderOptionsInput;
12
+ };
13
+ export interface Settings extends ProviderPackage.Settings {
14
+ readonly accessToken?: string;
15
+ readonly apiKey?: never;
16
+ readonly baseURL?: string;
17
+ readonly location?: string;
18
+ readonly project?: string;
19
+ readonly providerOptions?: OpenAIProviderOptionsInput;
20
+ }
21
+ export declare const routes: Route<{
22
+ readonly model: string;
23
+ readonly messages: readonly ({
24
+ readonly role: "system";
25
+ readonly content: string | readonly ({
26
+ readonly type: "text";
27
+ readonly text: string;
28
+ readonly cache_control?: {
29
+ readonly type: "ephemeral";
30
+ readonly ttl?: string | undefined;
31
+ } | undefined;
32
+ } | {
33
+ readonly type: "image_url";
34
+ readonly image_url: {
35
+ readonly url: string;
36
+ };
37
+ })[];
38
+ } | {
39
+ readonly role: "user";
40
+ readonly content: string | readonly ({
41
+ readonly type: "text";
42
+ readonly text: string;
43
+ readonly cache_control?: {
44
+ readonly type: "ephemeral";
45
+ readonly ttl?: string | undefined;
46
+ } | undefined;
47
+ } | {
48
+ readonly type: "image_url";
49
+ readonly image_url: {
50
+ readonly url: string;
51
+ };
52
+ })[];
53
+ } | {
54
+ readonly [x: string]: unknown;
55
+ readonly content: string | null;
56
+ readonly role: "assistant";
57
+ readonly reasoning?: string | undefined;
58
+ readonly reasoning_content?: string | undefined;
59
+ readonly reasoning_text?: string | undefined;
60
+ readonly cache_control?: {
61
+ readonly type: "ephemeral";
62
+ readonly ttl?: string | undefined;
63
+ } | undefined;
64
+ readonly tool_calls?: readonly {
65
+ readonly id: string;
66
+ readonly type: "function";
67
+ readonly function: {
68
+ readonly name: string;
69
+ readonly arguments: string;
70
+ };
71
+ }[] | undefined;
72
+ readonly reasoning_details?: unknown;
73
+ } | {
74
+ readonly content: string;
75
+ readonly role: "tool";
76
+ readonly tool_call_id: string;
77
+ readonly cache_control?: {
78
+ readonly type: "ephemeral";
79
+ readonly ttl?: string | undefined;
80
+ } | undefined;
81
+ })[];
82
+ readonly stream: true;
83
+ readonly max_completion_tokens?: number | undefined;
84
+ readonly max_tokens?: number | undefined;
85
+ readonly tools?: readonly {
86
+ readonly function: {
87
+ readonly description: string;
88
+ readonly name: string;
89
+ readonly parameters: {
90
+ readonly [x: string]: unknown;
91
+ };
92
+ readonly strict?: boolean | undefined;
93
+ };
94
+ readonly type: "function";
95
+ readonly cache_control?: {
96
+ readonly type: "ephemeral";
97
+ readonly ttl?: string | undefined;
98
+ } | undefined;
99
+ }[] | undefined;
100
+ readonly stop?: readonly string[] | undefined;
101
+ readonly temperature?: number | undefined;
102
+ readonly seed?: number | undefined;
103
+ readonly tool_choice?: "required" | "auto" | "none" | {
104
+ readonly type: "function";
105
+ readonly function: {
106
+ readonly name: string;
107
+ };
108
+ } | undefined;
109
+ readonly top_p?: number | undefined;
110
+ readonly frequency_penalty?: number | undefined;
111
+ readonly presence_penalty?: number | undefined;
112
+ readonly prompt_cache_key?: string | undefined;
113
+ readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
114
+ readonly store?: boolean | undefined;
115
+ readonly stream_options?: {
116
+ readonly include_usage: boolean;
117
+ } | undefined;
118
+ readonly tool_stream?: boolean | undefined;
119
+ }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
120
+ export declare const configure: (input?: Config) => {
121
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
122
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
123
+ configure: (input?: Config) => /*elided*/ any;
124
+ };
125
+ export declare const provider: {
126
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
127
+ configure: (input?: Config) => {
128
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
129
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
130
+ configure: /*elided*/ any;
131
+ };
132
+ };
133
+ export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
@@ -0,0 +1,55 @@
1
+ import { OpenAIChat } from "../protocols/openai-chat.js";
2
+ import { Route } from "../route/client.js";
3
+ import { Endpoint } from "../route/endpoint.js";
4
+ import { ProviderID } from "../schema/index.js";
5
+ import { GoogleVertexShared } from "./google-vertex-shared.js";
6
+ export const id = ProviderID.make("google-vertex");
7
+ const route = Route.make({
8
+ id: "google-vertex-chat",
9
+ provider: id,
10
+ providerMetadataKey: "vertex",
11
+ protocol: OpenAIChat.protocol,
12
+ endpoint: Endpoint.path("/chat/completions"),
13
+ framing: OpenAIChat.framing,
14
+ });
15
+ export const routes = [route];
16
+ const configuredRoute = (input) => {
17
+ if ("apiKey" in input && input.apiKey !== undefined)
18
+ throw new Error("Google Vertex Chat does not support API keys");
19
+ const { accessToken: _accessToken, auth: _auth, baseURL, location: inputLocation, project: inputProject, ...rest } = input;
20
+ const location = GoogleVertexShared.location(inputLocation, "global");
21
+ const project = GoogleVertexShared.project(inputProject);
22
+ return route.with({
23
+ ...rest,
24
+ endpoint: {
25
+ baseURL: baseURL ??
26
+ `https://aiplatform.googleapis.com/v1/projects/${GoogleVertexShared.requireProject(project)}/locations/${location}/endpoints/openapi`,
27
+ },
28
+ auth: GoogleVertexShared.oauth(input, project),
29
+ });
30
+ };
31
+ export const configure = (input = {}) => {
32
+ const route = configuredRoute(input);
33
+ return {
34
+ id,
35
+ model: (modelID) => route.model({ id: modelID }),
36
+ configure,
37
+ };
38
+ };
39
+ export const provider = {
40
+ id,
41
+ configure,
42
+ };
43
+ export const model = (modelID, settings) => {
44
+ if (settings.apiKey !== undefined)
45
+ throw new Error("Google Vertex Chat does not support API keys");
46
+ return configure({
47
+ accessToken: settings.accessToken,
48
+ baseURL: settings.baseURL,
49
+ headers: settings.headers === undefined ? undefined : { ...settings.headers },
50
+ http: settings.body === undefined ? undefined : { body: { ...settings.body } },
51
+ location: settings.location,
52
+ project: settings.project,
53
+ providerOptions: settings.providerOptions,
54
+ }).model(modelID);
55
+ };