@opencode-ai/ai 0.0.0-dev-18262 → 0.0.0-dev-18266
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/dist/protocols/open-responses.d.ts +0 -2
- package/dist/protocols/open-responses.js +19 -24
- package/dist/protocols/openai-responses.js +0 -17
- package/dist/providers/deepinfra.d.ts +228 -0
- package/dist/providers/deepinfra.js +38 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.js +1 -0
- package/package.json +3 -3
|
@@ -550,7 +550,6 @@ export declare const Event: Schema.StructWithRest<Schema.Struct<{
|
|
|
550
550
|
readonly headers: Schema.optional<Schema.Unknown>;
|
|
551
551
|
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
552
552
|
export type Event = Schema.Schema.Type<typeof Event>;
|
|
553
|
-
export type ItemKind = "message" | "reasoning" | "function-call" | "hosted-tool";
|
|
554
553
|
export interface Extension {
|
|
555
554
|
readonly id: string;
|
|
556
555
|
readonly name: string;
|
|
@@ -560,7 +559,6 @@ export interface Extension {
|
|
|
560
559
|
readonly request: LLMRequest;
|
|
561
560
|
}) => MediaInput | undefined;
|
|
562
561
|
readonly lowerHostedToolItem?: (item: unknown) => ExtendedHostedToolItem | undefined;
|
|
563
|
-
readonly acceptsItemID?: (kind: ItemKind, id: string) => boolean;
|
|
564
562
|
}
|
|
565
563
|
export interface ParserState {
|
|
566
564
|
readonly id: string;
|
|
@@ -281,41 +281,36 @@ export const lowerToolChoice = (protocolName, toolChoice) => ProviderShared.matc
|
|
|
281
281
|
required: () => "required",
|
|
282
282
|
tool: (toolName) => ({ type: "function", name: toolName }),
|
|
283
283
|
});
|
|
284
|
-
//
|
|
285
|
-
//
|
|
286
|
-
// resending; anything else is treated as absent so the item is resent without
|
|
287
|
-
// an id (or skipped, for items that cannot be expressed without one).
|
|
288
|
-
const ITEM_ID_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
|
|
284
|
+
// Server-issued item ids need a nonempty prefix and suffix, but the prefix is
|
|
285
|
+
// provider-defined and does not necessarily identify the item's semantic type.
|
|
289
286
|
const itemID = (providerMetadata, providerMetadataKey) => {
|
|
290
287
|
const metadata = providerMetadata?.[providerMetadataKey];
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
: undefined;
|
|
288
|
+
if (!ProviderShared.isRecord(metadata) || typeof metadata.itemId !== "string")
|
|
289
|
+
return undefined;
|
|
290
|
+
const separator = metadata.itemId.indexOf("_");
|
|
291
|
+
return separator > 0 && separator < metadata.itemId.length - 1 ? metadata.itemId : undefined;
|
|
296
292
|
};
|
|
297
|
-
const
|
|
298
|
-
const lowerToolCall = (part, providerMetadataKey, extension) => {
|
|
293
|
+
const lowerToolCall = (part, providerMetadataKey) => {
|
|
299
294
|
const id = itemID(part.providerMetadata, providerMetadataKey);
|
|
300
295
|
return {
|
|
301
296
|
type: "function_call",
|
|
302
|
-
...(
|
|
297
|
+
...(id === undefined ? {} : { id }),
|
|
303
298
|
call_id: part.id,
|
|
304
299
|
name: part.name,
|
|
305
300
|
arguments: ProviderShared.encodeJson(part.input),
|
|
306
301
|
};
|
|
307
302
|
};
|
|
308
|
-
const lowerReasoning = (part, providerMetadataKey
|
|
303
|
+
const lowerReasoning = (part, providerMetadataKey) => {
|
|
309
304
|
const metadata = part.providerMetadata?.[providerMetadataKey];
|
|
310
|
-
|
|
311
|
-
if (!ProviderShared.isRecord(metadata) || !acceptsItemID(extension, "reasoning", id))
|
|
305
|
+
if (!ProviderShared.isRecord(metadata))
|
|
312
306
|
return undefined;
|
|
307
|
+
const id = itemID(part.providerMetadata, providerMetadataKey);
|
|
313
308
|
const encryptedContent = typeof metadata.reasoningEncryptedContent === "string" || metadata.reasoningEncryptedContent === null
|
|
314
309
|
? metadata.reasoningEncryptedContent
|
|
315
310
|
: undefined;
|
|
316
311
|
return {
|
|
317
312
|
type: "reasoning",
|
|
318
|
-
id,
|
|
313
|
+
...(id === undefined ? {} : { id }),
|
|
319
314
|
summary: part.text.length > 0 ? [{ type: "summary_text", text: part.text }] : [],
|
|
320
315
|
encrypted_content: encryptedContent,
|
|
321
316
|
};
|
|
@@ -400,8 +395,7 @@ const lowerMessages = Effect.fn("OpenResponses.lowerMessages")(function* (reques
|
|
|
400
395
|
return;
|
|
401
396
|
const groups = content.reduce((groups, part) => {
|
|
402
397
|
const metadata = part.providerMetadata?.[providerMetadataKey];
|
|
403
|
-
const
|
|
404
|
-
const id = acceptsItemID(extension, "message", rawID) ? rawID : undefined;
|
|
398
|
+
const id = itemID(part.providerMetadata, providerMetadataKey);
|
|
405
399
|
const phase = ProviderShared.isRecord(metadata) ? messagePhase(metadata.phase) : undefined;
|
|
406
400
|
const group = groups.at(-1);
|
|
407
401
|
if (group && group.id === id && group.phase === phase)
|
|
@@ -426,17 +420,18 @@ const lowerMessages = Effect.fn("OpenResponses.lowerMessages")(function* (reques
|
|
|
426
420
|
}
|
|
427
421
|
if (part.type === "reasoning") {
|
|
428
422
|
flushText();
|
|
429
|
-
const reasoning = lowerReasoning(part, providerMetadataKey
|
|
423
|
+
const reasoning = lowerReasoning(part, providerMetadataKey);
|
|
430
424
|
if (!reasoning)
|
|
431
425
|
continue;
|
|
432
|
-
const existing = reasoningItems[reasoning.id];
|
|
426
|
+
const existing = reasoning.id === undefined ? undefined : reasoningItems[reasoning.id];
|
|
433
427
|
if (existing) {
|
|
434
428
|
existing.summary.push(...reasoning.summary);
|
|
435
429
|
if (typeof reasoning.encrypted_content === "string")
|
|
436
430
|
existing.encrypted_content = reasoning.encrypted_content;
|
|
437
431
|
continue;
|
|
438
432
|
}
|
|
439
|
-
|
|
433
|
+
if (reasoning.id !== undefined)
|
|
434
|
+
reasoningItems[reasoning.id] = reasoning;
|
|
440
435
|
input.push(reasoning);
|
|
441
436
|
continue;
|
|
442
437
|
}
|
|
@@ -444,7 +439,7 @@ const lowerMessages = Effect.fn("OpenResponses.lowerMessages")(function* (reques
|
|
|
444
439
|
flushText();
|
|
445
440
|
if (part.providerExecuted === true)
|
|
446
441
|
continue;
|
|
447
|
-
input.push(lowerToolCall(part, providerMetadataKey
|
|
442
|
+
input.push(lowerToolCall(part, providerMetadataKey));
|
|
448
443
|
continue;
|
|
449
444
|
}
|
|
450
445
|
if (part.type === "tool-result" && part.providerExecuted === true) {
|
|
@@ -455,7 +450,7 @@ const lowerMessages = Effect.fn("OpenResponses.lowerMessages")(function* (reques
|
|
|
455
450
|
: Schema.is(HostedToolItem)(part.result.value)
|
|
456
451
|
? part.result.value
|
|
457
452
|
: extension.lowerHostedToolItem?.(part.result.value);
|
|
458
|
-
if (
|
|
453
|
+
if (id !== undefined && hosted?.id === id) {
|
|
459
454
|
if (!hostedToolItems.has(id)) {
|
|
460
455
|
input.push(hosted);
|
|
461
456
|
hostedToolItems.add(id);
|
|
@@ -68,27 +68,10 @@ const OpenAIResponsesBody = Schema.Struct({
|
|
|
68
68
|
...OpenAIResponsesCoreFields,
|
|
69
69
|
stream: Schema.Literal(true),
|
|
70
70
|
});
|
|
71
|
-
// Replayed items are paired with stored server state by id, so a foreign or
|
|
72
|
-
// synthetic token can fail request validation even when `call_id` pairing is
|
|
73
|
-
// intact. Only resend ids in each item kind's own grammar; hosted tool
|
|
74
|
-
// items keep generic validation because every hosted tool mints its own
|
|
75
|
-
// prefix. The same allowlist approach codex uses before resending history
|
|
76
|
-
// (codex-rs core/src/client.rs, `prepare_response_items_for_request`).
|
|
77
|
-
const ITEM_ID_PREFIXES = {
|
|
78
|
-
message: ["msg_"],
|
|
79
|
-
reasoning: ["rs_"],
|
|
80
|
-
"function-call": ["fc_"],
|
|
81
|
-
// Every hosted tool mints its own id prefix, so items keep generic validation.
|
|
82
|
-
"hosted-tool": [],
|
|
83
|
-
};
|
|
84
71
|
const extension = {
|
|
85
72
|
id: ADAPTER,
|
|
86
73
|
name: NAME,
|
|
87
74
|
lowerHostedToolItem: (item) => (Schema.is(OpenAIResponsesHostedToolItem)(item) ? item : undefined),
|
|
88
|
-
acceptsItemID: (kind, id) => {
|
|
89
|
-
const prefixes = ITEM_ID_PREFIXES[kind];
|
|
90
|
-
return prefixes.length === 0 || prefixes.some((prefix) => id.startsWith(prefix));
|
|
91
|
-
},
|
|
92
75
|
};
|
|
93
76
|
const nativeImageToolInput = (tool) => {
|
|
94
77
|
const native = tool.native?.openai;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import type { ProviderPackage } from "../provider-package.js";
|
|
2
|
+
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
3
|
+
import 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: import("../route/client.js").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 store?: boolean | undefined;
|
|
106
|
+
readonly stream_options?: {
|
|
107
|
+
readonly include_usage: boolean;
|
|
108
|
+
} | undefined;
|
|
109
|
+
readonly prompt_cache_key?: string | undefined;
|
|
110
|
+
readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
|
|
111
|
+
readonly tool_stream?: boolean | undefined;
|
|
112
|
+
readonly frequency_penalty?: number | undefined;
|
|
113
|
+
readonly presence_penalty?: number | undefined;
|
|
114
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>;
|
|
115
|
+
export declare const routes: import("../route/client.js").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 store?: boolean | undefined;
|
|
205
|
+
readonly stream_options?: {
|
|
206
|
+
readonly include_usage: boolean;
|
|
207
|
+
} | undefined;
|
|
208
|
+
readonly prompt_cache_key?: string | undefined;
|
|
209
|
+
readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
|
|
210
|
+
readonly tool_stream?: boolean | undefined;
|
|
211
|
+
readonly frequency_penalty?: number | undefined;
|
|
212
|
+
readonly presence_penalty?: number | undefined;
|
|
213
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>[];
|
|
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>;
|
|
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>;
|
|
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>;
|
|
225
|
+
configure: /*elided*/ any;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { OpenAICompatibleChat } from "../protocols/openai-compatible-chat.js";
|
|
2
|
+
import { AuthOptions } from "../route/auth-options.js";
|
|
3
|
+
import { ProviderID } from "../schema/index.js";
|
|
4
|
+
import { profiles } from "./openai-compatible-profile.js";
|
|
5
|
+
export const id = ProviderID.make("deepinfra");
|
|
6
|
+
export const route = OpenAICompatibleChat.route.with({
|
|
7
|
+
id: "deepinfra-chat",
|
|
8
|
+
provider: id,
|
|
9
|
+
endpoint: { baseURL: profiles.deepinfra.baseURL },
|
|
10
|
+
});
|
|
11
|
+
export const routes = [route];
|
|
12
|
+
export const configure = (input = {}) => {
|
|
13
|
+
const { apiKey: _apiKey, auth: _auth, baseURL, ...defaults } = input;
|
|
14
|
+
const root = baseURL?.replace(/\/+$/, "");
|
|
15
|
+
const configured = route.with({
|
|
16
|
+
...defaults,
|
|
17
|
+
endpoint: {
|
|
18
|
+
baseURL: root === undefined ? profiles.deepinfra.baseURL : root.endsWith("/openai") ? root : `${root}/openai`,
|
|
19
|
+
},
|
|
20
|
+
auth: AuthOptions.bearer(input, "DEEPINFRA_API_KEY"),
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
id,
|
|
24
|
+
model: (modelID) => configured.model({
|
|
25
|
+
id: modelID,
|
|
26
|
+
compatibility: { maxTokensField: "max_tokens", reasoningField: "reasoning_content", supportsStore: false },
|
|
27
|
+
}),
|
|
28
|
+
configure,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export const provider = configure();
|
|
32
|
+
export const model = (modelID, settings) => configure({
|
|
33
|
+
apiKey: settings.apiKey,
|
|
34
|
+
baseURL: settings.baseURL,
|
|
35
|
+
headers: settings.headers === undefined ? undefined : { ...settings.headers },
|
|
36
|
+
http: settings.body === undefined ? undefined : { body: { ...settings.body } },
|
|
37
|
+
providerOptions: settings.providerOptions,
|
|
38
|
+
}).model(modelID);
|
|
@@ -6,6 +6,7 @@ export * as Azure from "./azure.js";
|
|
|
6
6
|
export * as Cerebras from "./cerebras.js";
|
|
7
7
|
export * as Cloudflare from "./cloudflare.js";
|
|
8
8
|
export { CloudflareAIGateway, CloudflareWorkersAI } from "./cloudflare.js";
|
|
9
|
+
export * as DeepInfra from "./deepinfra.js";
|
|
9
10
|
export * as Google from "./google.js";
|
|
10
11
|
export * as GoogleVertex from "./google-vertex.js";
|
|
11
12
|
export * as GoogleVertexChat from "./google-vertex-chat.js";
|
package/dist/providers/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * as Azure from "./azure.js";
|
|
|
6
6
|
export * as Cerebras from "./cerebras.js";
|
|
7
7
|
export * as Cloudflare from "./cloudflare.js";
|
|
8
8
|
export { CloudflareAIGateway, CloudflareWorkersAI } from "./cloudflare.js";
|
|
9
|
+
export * as DeepInfra from "./deepinfra.js";
|
|
9
10
|
export * as Google from "./google.js";
|
|
10
11
|
export * as GoogleVertex from "./google-vertex.js";
|
|
11
12
|
export * as GoogleVertexChat from "./google-vertex-chat.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-18266",
|
|
4
4
|
"name": "@opencode-ai/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
32
32
|
"@effect/platform-node": "4.0.0-rc.111",
|
|
33
|
-
"@opencode-ai/http-recorder": "0.0.0-dev-
|
|
33
|
+
"@opencode-ai/http-recorder": "0.0.0-dev-18266",
|
|
34
34
|
"@tsconfig/bun": "1.0.9",
|
|
35
35
|
"@types/bun": "1.3.13",
|
|
36
36
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@smithy/eventstream-codec": "4.2.14",
|
|
41
41
|
"@smithy/util-utf8": "4.2.2",
|
|
42
|
-
"@opencode-ai/schema": "0.0.0-dev-
|
|
42
|
+
"@opencode-ai/schema": "0.0.0-dev-18266",
|
|
43
43
|
"aws4fetch": "1.0.20",
|
|
44
44
|
"effect": "4.0.0-rc.111",
|
|
45
45
|
"google-auth-library": "10.5.0"
|