@opencode/ai 0.0.0-dev-149 → 0.0.0-dev-150
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/provider-package.d.ts +2 -0
- package/dist/providers/alibaba.d.ts +3 -3
- package/dist/providers/amazon-bedrock-mantle.d.ts +4 -4
- package/dist/providers/amazon-bedrock-mantle.js +1 -1
- package/dist/providers/amazon-bedrock.d.ts +1 -1
- package/dist/providers/amazon-bedrock.js +1 -1
- package/dist/providers/anthropic-compatible.d.ts +1 -1
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/azure.d.ts +4 -5
- package/dist/providers/baseten.d.ts +4 -4
- package/dist/providers/baseten.js +1 -1
- package/dist/providers/cerebras.d.ts +3 -3
- package/dist/providers/cerebras.js +1 -1
- package/dist/providers/cloudflare-ai-gateway.d.ts +3 -3
- package/dist/providers/cloudflare-workers-ai.d.ts +3 -3
- package/dist/providers/cohere/chat.d.ts +1 -1
- package/dist/providers/cohere/chat.js +1 -1
- package/dist/providers/cohere.d.ts +3 -3
- package/dist/providers/cohere.js +1 -1
- package/dist/providers/deepinfra.d.ts +3 -3
- package/dist/providers/deepinfra.js +1 -1
- package/dist/providers/deepseek.d.ts +3 -3
- package/dist/providers/deepseek.js +1 -1
- package/dist/providers/digitalocean.d.ts +5 -5
- package/dist/providers/digitalocean.js +1 -1
- package/dist/providers/fireworks.d.ts +3 -3
- package/dist/providers/fireworks.js +1 -1
- package/dist/providers/google/interactions.d.ts +1 -1
- package/dist/providers/google/interactions.js +1 -1
- package/dist/providers/google-vertex-chat.d.ts +1 -1
- package/dist/providers/google-vertex-chat.js +1 -1
- package/dist/providers/google-vertex-interactions.d.ts +1 -1
- package/dist/providers/google-vertex-interactions.js +1 -1
- package/dist/providers/google-vertex-messages.d.ts +1 -1
- package/dist/providers/google-vertex-messages.js +1 -1
- package/dist/providers/google-vertex-mistral.d.ts +1 -1
- package/dist/providers/google-vertex-mistral.js +1 -1
- package/dist/providers/google-vertex-responses.d.ts +1 -1
- package/dist/providers/google-vertex-responses.js +1 -1
- package/dist/providers/google-vertex.d.ts +2 -2
- package/dist/providers/google-vertex.js +1 -1
- package/dist/providers/google.d.ts +2 -2
- package/dist/providers/google.js +1 -1
- package/dist/providers/groq.d.ts +3 -3
- package/dist/providers/groq.js +1 -1
- package/dist/providers/meta.d.ts +5 -5
- package/dist/providers/meta.js +1 -1
- package/dist/providers/minimax/chat.d.ts +1 -1
- package/dist/providers/minimax/chat.js +1 -1
- package/dist/providers/minimax/responses.d.ts +1 -1
- package/dist/providers/minimax/responses.js +1 -1
- package/dist/providers/minimax.d.ts +1 -1
- package/dist/providers/minimax.js +1 -1
- package/dist/providers/mistral.d.ts +3 -3
- package/dist/providers/mistral.js +1 -1
- package/dist/providers/moonshot/messages.d.ts +1 -1
- package/dist/providers/moonshot/messages.js +1 -1
- package/dist/providers/moonshot/responses.d.ts +1 -1
- package/dist/providers/moonshot/responses.js +1 -1
- package/dist/providers/moonshot.d.ts +1 -1
- package/dist/providers/moonshot.js +1 -1
- package/dist/providers/openai-compatible-responses.d.ts +1 -1
- package/dist/providers/openai-compatible.d.ts +3 -3
- package/dist/providers/openai.d.ts +4 -4
- package/dist/providers/openai.js +1 -1
- package/dist/providers/opencode.d.ts +3 -3
- package/dist/providers/opencode.js +1 -1
- package/dist/providers/openrouter.d.ts +5 -5
- package/dist/providers/openrouter.js +1 -1
- package/dist/providers/togetherai.d.ts +3 -3
- package/dist/providers/togetherai.js +1 -1
- package/dist/providers/typesafe-ai.d.ts +3 -3
- package/dist/providers/typesafe-ai.js +1 -1
- package/dist/providers/venice.d.ts +1 -1
- package/dist/providers/venice.js +1 -1
- package/dist/providers/vercel-ai-gateway.d.ts +8 -8
- package/dist/providers/vercel-ai-gateway.js +1 -1
- package/dist/providers/xai.d.ts +4 -4
- package/dist/providers/xai.js +1 -1
- package/dist/providers/zai-coding-plan/messages.d.ts +1 -1
- package/dist/providers/zai-coding-plan/messages.js +1 -1
- package/dist/providers/zai-coding-plan/responses.d.ts +1 -1
- package/dist/providers/zai-coding-plan/responses.js +1 -1
- package/dist/providers/zai-coding-plan.d.ts +1 -1
- package/dist/providers/zai-coding-plan.js +1 -1
- package/dist/providers/zai.d.ts +2 -2
- package/dist/providers/zai.js +1 -1
- package/package.json +3 -3
|
@@ -12,4 +12,6 @@ export interface Settings extends Readonly<Record<string, unknown>> {
|
|
|
12
12
|
export interface Definition<ProviderSettings extends Settings = Settings, Options extends ProviderOptions = ProviderOptions, Compact extends CompactionOperations | undefined = CompactionOperations | undefined> {
|
|
13
13
|
readonly model: (modelID: string, settings: ProviderSettings) => LanguageModel<Options, Compact>;
|
|
14
14
|
}
|
|
15
|
+
/** A provider's `model` export. Settings are optional when every key is optional. */
|
|
16
|
+
export type Model<ProviderSettings extends Settings = Settings, Options extends ProviderOptions = ProviderOptions, Compact extends CompactionOperations | undefined = CompactionOperations | undefined> = (modelID: string, ...settings: {} extends ProviderSettings ? [settings?: ProviderSettings] : [settings: ProviderSettings]) => LanguageModel<Options, Compact>;
|
|
15
17
|
export * as ProviderPackage from "./provider-package.js";
|
|
@@ -733,9 +733,9 @@ export declare const provider: {
|
|
|
733
733
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
734
734
|
configure: typeof configure;
|
|
735
735
|
};
|
|
736
|
-
export declare const model: ProviderPackage.
|
|
737
|
-
export declare const messagesModel: ProviderPackage.
|
|
738
|
-
export declare const responsesModel: ProviderPackage.
|
|
736
|
+
export declare const model: ProviderPackage.Model<Settings, ChatOptionsInput>;
|
|
737
|
+
export declare const messagesModel: ProviderPackage.Model<Settings<MessagesOptionsInput>, MessagesOptionsInput>;
|
|
738
|
+
export declare const responsesModel: ProviderPackage.Model<Settings<ResponsesOptionsInput>, ResponsesOptionsInput>;
|
|
739
739
|
export declare const imageModel: (id: string, settings: Settings) => import("../image.js").ImageModel<import("./alibaba.js").AlibabaImageOptions>;
|
|
740
740
|
export declare const webSearch: () => ToolDefinition;
|
|
741
741
|
export declare const webExtractor: () => ToolDefinition;
|
|
@@ -676,7 +676,7 @@ export declare const provider: {
|
|
|
676
676
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
677
677
|
configure: typeof configure;
|
|
678
678
|
};
|
|
679
|
-
export declare const chatModel: ProviderPackage.
|
|
680
|
-
export declare const messagesModel: ProviderPackage.
|
|
681
|
-
export declare const responsesModel: ProviderPackage.
|
|
682
|
-
export declare const model:
|
|
679
|
+
export declare const chatModel: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
680
|
+
export declare const messagesModel: ProviderPackage.Model<MessagesSettings, AnthropicMessages.ProviderOptionsInput>;
|
|
681
|
+
export declare const responsesModel: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
682
|
+
export declare const model: ProviderPackage.Model<Settings<import("./openai-options.js").OpenAIOptionsInput>, import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
@@ -87,7 +87,7 @@ export const configure = (input = {}) => {
|
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
89
|
export const provider = configure();
|
|
90
|
-
const fromSettings = ({ apiKey, auth, baseURL, body, credentials, headers, profile, region, topP, ...providerOptions }) => configure({
|
|
90
|
+
const fromSettings = ({ apiKey, auth, baseURL, body, credentials, headers, profile, region, topP, ...providerOptions } = {}) => configure({
|
|
91
91
|
apiKey,
|
|
92
92
|
auth,
|
|
93
93
|
baseURL,
|
|
@@ -189,4 +189,4 @@ export declare const provider: {
|
|
|
189
189
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<BedrockConverse.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
190
190
|
configure: typeof configure;
|
|
191
191
|
};
|
|
192
|
-
export declare const model: ProviderPackage.
|
|
192
|
+
export declare const model: ProviderPackage.Model<Settings, BedrockConverse.OptionsInput>;
|
|
@@ -28,7 +28,7 @@ export const configure = (input = {}) => {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
export const provider = configure();
|
|
31
|
-
export const model = (modelID, { apiKey, auth, baseURL, credentials, profile, region, topP, headers, body, ...providerOptions }) => configure({
|
|
31
|
+
export const model = (modelID, { apiKey, auth, baseURL, credentials, profile, region, topP, headers, body, ...providerOptions } = {}) => configure({
|
|
32
32
|
apiKey,
|
|
33
33
|
auth,
|
|
34
34
|
baseURL,
|
|
@@ -339,5 +339,5 @@ export declare const provider: {
|
|
|
339
339
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
340
340
|
configure: typeof configure;
|
|
341
341
|
};
|
|
342
|
-
export declare const model: ProviderPackage.
|
|
342
|
+
export declare const model: ProviderPackage.Model<Settings, AnthropicMessages.ProviderOptionsInput>;
|
|
343
343
|
export * as AnthropicCompatible from "./anthropic-compatible.js";
|
|
@@ -338,4 +338,4 @@ export declare const provider: {
|
|
|
338
338
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
339
339
|
configure: typeof configure;
|
|
340
340
|
};
|
|
341
|
-
export declare const model: ProviderPackage.
|
|
341
|
+
export declare const model: ProviderPackage.Model<Settings, AnthropicMessages.ProviderOptionsInput>;
|
|
@@ -26,7 +26,7 @@ export const configure = (input = {}) => {
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
export const provider = configure();
|
|
29
|
-
export const model = (modelID, { apiKey, authToken, baseURL, body, headers, ...providerOptions }) => {
|
|
29
|
+
export const model = (modelID, { apiKey, authToken, baseURL, body, headers, ...providerOptions } = {}) => {
|
|
30
30
|
if (apiKey !== undefined && authToken !== undefined)
|
|
31
31
|
throw new ProviderConfigurationError({
|
|
32
32
|
provider: id,
|
|
@@ -8,13 +8,12 @@ type AzureURL = AtLeastOne<{
|
|
|
8
8
|
readonly resourceName: string;
|
|
9
9
|
readonly baseURL: string;
|
|
10
10
|
}>;
|
|
11
|
-
export type
|
|
11
|
+
export type Config = AzureURL & RouteDefaultsInput & ProviderAuthOption<"optional"> & {
|
|
12
12
|
readonly apiVersion?: string;
|
|
13
13
|
readonly queryParams?: Record<string, string>;
|
|
14
14
|
readonly useDeploymentBasedUrls?: boolean;
|
|
15
15
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
16
16
|
};
|
|
17
|
-
export type Config = LanguageModelOptions;
|
|
18
17
|
export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & AzureURL & {
|
|
19
18
|
readonly apiKey?: string;
|
|
20
19
|
readonly apiVersion?: string;
|
|
@@ -609,10 +608,10 @@ export declare const provider: {
|
|
|
609
608
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
610
609
|
configure: typeof configure;
|
|
611
610
|
};
|
|
612
|
-
export declare const responsesModel: ProviderPackage.
|
|
613
|
-
export declare const chatModel: ProviderPackage.
|
|
611
|
+
export declare const responsesModel: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput, typeof responsesRoute.compact>;
|
|
612
|
+
export declare const chatModel: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
614
613
|
export declare const imageModel: (modelID: string, settings: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
615
|
-
export declare const model:
|
|
614
|
+
export declare const model: ProviderPackage.Model<Settings, import("./openai-options.js").OpenAIOptionsInput, {
|
|
616
615
|
endpoint: import("../route/client.js").CompactOperation;
|
|
617
616
|
}>;
|
|
618
617
|
export {};
|
|
@@ -4,7 +4,7 @@ import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
|
4
4
|
import { type ModelID, type ProviderOptions } from "../schema/index.js";
|
|
5
5
|
import type { OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
6
6
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
|
-
export type
|
|
7
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
8
8
|
readonly baseURL?: string;
|
|
9
9
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
10
10
|
};
|
|
@@ -302,7 +302,7 @@ export declare const routes: Route<{
|
|
|
302
302
|
readonly seed?: number | undefined;
|
|
303
303
|
readonly stop?: readonly string[] | undefined;
|
|
304
304
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
305
|
-
export declare const configure: (input?:
|
|
305
|
+
export declare const configure: (input?: Config) => {
|
|
306
306
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
307
307
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
308
308
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<BasetenDecisionOptions>;
|
|
@@ -315,6 +315,6 @@ export declare const provider: {
|
|
|
315
315
|
configure: typeof configure;
|
|
316
316
|
};
|
|
317
317
|
export declare const decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<BasetenDecisionOptions>;
|
|
318
|
-
export declare const model: ProviderPackage.
|
|
319
|
-
export declare const decisionModel: (modelID: string, settings
|
|
318
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
319
|
+
export declare const decisionModel: (modelID: string, settings?: Settings) => import("../decision.js").DecisionModel<BasetenDecisionOptions>;
|
|
320
320
|
export * as Baseten from "./baseten.js";
|
|
@@ -59,7 +59,7 @@ export const decisionModel = (modelID, settings) => {
|
|
|
59
59
|
const input = config(settings);
|
|
60
60
|
return configure(input).decision(modelID, input.providerOptions);
|
|
61
61
|
};
|
|
62
|
-
function config({ apiKey, baseURL, body, headers, ...providerOptions }) {
|
|
62
|
+
function config({ apiKey, baseURL, body, headers, ...providerOptions } = {}) {
|
|
63
63
|
return {
|
|
64
64
|
apiKey,
|
|
65
65
|
baseURL,
|
|
@@ -4,7 +4,7 @@ import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
|
4
4
|
import { type ModelID } from "../schema/index.js";
|
|
5
5
|
import type { OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
6
6
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
|
-
export type
|
|
7
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
8
8
|
readonly baseURL?: string;
|
|
9
9
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
10
10
|
};
|
|
@@ -298,7 +298,7 @@ export declare const routes: Route<{
|
|
|
298
298
|
readonly seed?: number | undefined;
|
|
299
299
|
readonly stop?: readonly string[] | undefined;
|
|
300
300
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
301
|
-
export declare const configure: (input?:
|
|
301
|
+
export declare const configure: (input?: Config) => {
|
|
302
302
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
303
303
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
304
304
|
configure: typeof configure;
|
|
@@ -308,4 +308,4 @@ export declare const provider: {
|
|
|
308
308
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
309
309
|
configure: typeof configure;
|
|
310
310
|
};
|
|
311
|
-
export declare const model: ProviderPackage.
|
|
311
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
@@ -35,7 +35,7 @@ export const configure = (input = {}) => {
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
export const provider = configure();
|
|
38
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
38
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => configure({
|
|
39
39
|
apiKey,
|
|
40
40
|
baseURL,
|
|
41
41
|
headers,
|
|
@@ -18,7 +18,7 @@ type GatewayOptions = {
|
|
|
18
18
|
readonly skipCache?: boolean;
|
|
19
19
|
readonly collectLog?: boolean;
|
|
20
20
|
};
|
|
21
|
-
export type
|
|
21
|
+
export type Config = GatewayURL & GatewayOptions & Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
22
22
|
readonly gatewayApiKey?: string | Redacted.Redacted | Config.Config<string | Redacted.Redacted>;
|
|
23
23
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
24
24
|
};
|
|
@@ -1361,7 +1361,7 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1361
1361
|
endpoint: import("../route/client.js").CompactOperation;
|
|
1362
1362
|
trigger: import("../route/client.js").TriggerCompactOperation;
|
|
1363
1363
|
}>)[];
|
|
1364
|
-
export declare const configure: (input:
|
|
1364
|
+
export declare const configure: (input: Config) => {
|
|
1365
1365
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1366
1366
|
model: (value: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, {
|
|
1367
1367
|
endpoint: import("../route/client.js").CompactOperation;
|
|
@@ -1374,6 +1374,6 @@ export declare const provider: {
|
|
|
1374
1374
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1375
1375
|
configure: typeof configure;
|
|
1376
1376
|
};
|
|
1377
|
-
export declare const model: ProviderPackage.
|
|
1377
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
1378
1378
|
export declare const decisionModel: (modelID: string, settings: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
1379
1379
|
export * as CloudflareAIGateway from "./cloudflare-ai-gateway.js";
|
|
@@ -9,7 +9,7 @@ type WorkersAIURL = AtLeastOne<{
|
|
|
9
9
|
readonly accountId: string;
|
|
10
10
|
readonly baseURL: string;
|
|
11
11
|
}>;
|
|
12
|
-
export type
|
|
12
|
+
export type Config = WorkersAIURL & Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
13
13
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
14
14
|
};
|
|
15
15
|
export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & WorkersAIURL & {
|
|
@@ -305,7 +305,7 @@ export declare const routes: Route<{
|
|
|
305
305
|
readonly seed?: number | undefined;
|
|
306
306
|
readonly stop?: readonly string[] | undefined;
|
|
307
307
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
308
|
-
export declare const configure: (input:
|
|
308
|
+
export declare const configure: (input: Config) => {
|
|
309
309
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
310
310
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
311
311
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
@@ -321,7 +321,7 @@ export declare const provider: {
|
|
|
321
321
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
322
322
|
configure: typeof configure;
|
|
323
323
|
};
|
|
324
|
-
export declare const model: ProviderPackage.
|
|
324
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
325
325
|
export declare const imageModel: (modelID: string, settings: Settings) => import("../image.js").ImageModel<import("./cloudflare-workers-ai.js").CloudflareWorkersAIImageOptions>;
|
|
326
326
|
export declare const decisionModel: (modelID: string, settings: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
327
327
|
export * as CloudflareWorkersAI from "./cloudflare-workers-ai.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../../provider-package.js";
|
|
2
2
|
import { Cohere } from "../cohere.js";
|
|
3
3
|
export type Settings = Cohere.Settings<Cohere.ChatOptionsInput>;
|
|
4
|
-
export declare const model: ProviderPackage.
|
|
4
|
+
export declare const model: ProviderPackage.Model<Settings, Cohere.ChatOptionsInput>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cohere } from "../cohere.js";
|
|
2
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => Cohere.configure({
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => Cohere.configure({
|
|
3
3
|
apiKey,
|
|
4
4
|
baseURL,
|
|
5
5
|
headers,
|
|
@@ -8,7 +8,7 @@ export type ChatOptionsInput = {
|
|
|
8
8
|
readonly reasoningEffort?: OpenString<"none" | "high">;
|
|
9
9
|
};
|
|
10
10
|
export type ProviderOptions = CohereChat.ProviderOptionsInput & ChatOptionsInput;
|
|
11
|
-
export type
|
|
11
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
12
12
|
readonly baseURL?: string;
|
|
13
13
|
readonly providerOptions?: ProviderOptions;
|
|
14
14
|
};
|
|
@@ -405,7 +405,7 @@ export declare const routes: (Route<{
|
|
|
405
405
|
readonly seed?: number | undefined;
|
|
406
406
|
readonly stop?: readonly string[] | undefined;
|
|
407
407
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>)[];
|
|
408
|
-
export declare const configure: (input?:
|
|
408
|
+
export declare const configure: (input?: Config) => {
|
|
409
409
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
410
410
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
411
411
|
readonly thinking?: {
|
|
@@ -427,5 +427,5 @@ export declare const provider: {
|
|
|
427
427
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
428
428
|
configure: typeof configure;
|
|
429
429
|
};
|
|
430
|
-
export declare const model: ProviderPackage.
|
|
430
|
+
export declare const model: ProviderPackage.Model<Settings, CohereChat.ProviderOptionsInput>;
|
|
431
431
|
export * as Cohere from "./cohere.js";
|
package/dist/providers/cohere.js
CHANGED
|
@@ -36,7 +36,7 @@ export const configure = (input = {}) => {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
export const provider = configure();
|
|
39
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
39
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => configure({
|
|
40
40
|
apiKey,
|
|
41
41
|
baseURL,
|
|
42
42
|
headers,
|
|
@@ -4,7 +4,7 @@ import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
|
4
4
|
import { type ModelID } from "../schema/index.js";
|
|
5
5
|
import type { OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
6
6
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
|
-
export type
|
|
7
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
8
8
|
readonly baseURL?: string;
|
|
9
9
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
10
10
|
};
|
|
@@ -298,7 +298,7 @@ export declare const routes: Route<{
|
|
|
298
298
|
readonly seed?: number | undefined;
|
|
299
299
|
readonly stop?: readonly string[] | undefined;
|
|
300
300
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
301
|
-
export declare const configure: (input?:
|
|
301
|
+
export declare const configure: (input?: Config) => {
|
|
302
302
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
303
303
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
304
304
|
configure: typeof configure;
|
|
@@ -308,4 +308,4 @@ export declare const provider: {
|
|
|
308
308
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
309
309
|
configure: typeof configure;
|
|
310
310
|
};
|
|
311
|
-
export declare const model: ProviderPackage.
|
|
311
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
@@ -38,7 +38,7 @@ export const configure = (input = {}) => {
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
export const provider = configure();
|
|
41
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
41
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => configure({
|
|
42
42
|
apiKey,
|
|
43
43
|
baseURL,
|
|
44
44
|
headers,
|
|
@@ -4,7 +4,7 @@ import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
|
4
4
|
import { type ModelID } from "../schema/index.js";
|
|
5
5
|
import type { OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
6
6
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
|
-
export type
|
|
7
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
8
8
|
readonly baseURL?: string;
|
|
9
9
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
10
10
|
};
|
|
@@ -298,7 +298,7 @@ export declare const routes: Route<{
|
|
|
298
298
|
readonly seed?: number | undefined;
|
|
299
299
|
readonly stop?: readonly string[] | undefined;
|
|
300
300
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
301
|
-
export declare const configure: (input?:
|
|
301
|
+
export declare const configure: (input?: Config) => {
|
|
302
302
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
303
303
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
304
304
|
configure: typeof configure;
|
|
@@ -308,5 +308,5 @@ export declare const provider: {
|
|
|
308
308
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
309
309
|
configure: typeof configure;
|
|
310
310
|
};
|
|
311
|
-
export declare const model: ProviderPackage.
|
|
311
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
312
312
|
export * as DeepSeek from "./deepseek.js";
|
|
@@ -31,7 +31,7 @@ export const configure = (input = {}) => {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
export const provider = configure();
|
|
34
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
34
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => configure({
|
|
35
35
|
apiKey,
|
|
36
36
|
baseURL,
|
|
37
37
|
headers,
|
|
@@ -6,7 +6,7 @@ import { Protocol } from "../route/protocol.js";
|
|
|
6
6
|
import { type ModelID, type ProviderOptions } from "../schema/index.js";
|
|
7
7
|
import type { OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
8
8
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
9
|
-
export type
|
|
9
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
10
10
|
readonly baseURL?: string;
|
|
11
11
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
12
12
|
};
|
|
@@ -514,7 +514,7 @@ export declare const routes: Route<{
|
|
|
514
514
|
readonly seed?: number | undefined;
|
|
515
515
|
readonly stop?: readonly string[] | undefined;
|
|
516
516
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
517
|
-
export declare const configure: (input?:
|
|
517
|
+
export declare const configure: (input?: Config) => {
|
|
518
518
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
519
519
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
520
520
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
@@ -530,7 +530,7 @@ export declare const provider: {
|
|
|
530
530
|
};
|
|
531
531
|
export declare const decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
532
532
|
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
533
|
-
export declare const model: ProviderPackage.
|
|
534
|
-
export declare const imageModel: (modelID: string, settings
|
|
535
|
-
export declare const decisionModel: (modelID: string, settings
|
|
533
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
534
|
+
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
535
|
+
export declare const decisionModel: (modelID: string, settings?: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
536
536
|
export * as DigitalOcean from "./digitalocean.js";
|
|
@@ -72,7 +72,7 @@ export const decisionModel = (modelID, settings) => {
|
|
|
72
72
|
const input = config(settings);
|
|
73
73
|
return configure(input).decision(modelID, input.providerOptions);
|
|
74
74
|
};
|
|
75
|
-
function config({ apiKey, baseURL, body, headers, ...providerOptions }) {
|
|
75
|
+
function config({ apiKey, baseURL, body, headers, ...providerOptions } = {}) {
|
|
76
76
|
return {
|
|
77
77
|
apiKey,
|
|
78
78
|
baseURL,
|
|
@@ -4,7 +4,7 @@ import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
|
4
4
|
import { type ModelID } from "../schema/index.js";
|
|
5
5
|
import type { OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
6
6
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
|
-
export type
|
|
7
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
8
8
|
readonly baseURL?: string;
|
|
9
9
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
10
10
|
};
|
|
@@ -298,7 +298,7 @@ export declare const routes: Route<{
|
|
|
298
298
|
readonly seed?: number | undefined;
|
|
299
299
|
readonly stop?: readonly string[] | undefined;
|
|
300
300
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
301
|
-
export declare const configure: (input?:
|
|
301
|
+
export declare const configure: (input?: Config) => {
|
|
302
302
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
303
303
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
304
304
|
configure: typeof configure;
|
|
@@ -308,5 +308,5 @@ export declare const provider: {
|
|
|
308
308
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
309
309
|
configure: typeof configure;
|
|
310
310
|
};
|
|
311
|
-
export declare const model: ProviderPackage.
|
|
311
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
312
312
|
export * as Fireworks from "./fireworks.js";
|
|
@@ -28,7 +28,7 @@ export const configure = (input = {}) => {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
export const provider = configure();
|
|
31
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
31
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => configure({
|
|
32
32
|
apiKey,
|
|
33
33
|
baseURL,
|
|
34
34
|
headers,
|
|
@@ -4,4 +4,4 @@ export type Settings = ProviderPackage.Settings & GoogleInteractions.ProviderOpt
|
|
|
4
4
|
readonly apiKey?: string;
|
|
5
5
|
readonly baseURL?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const model: ProviderPackage.
|
|
7
|
+
export declare const model: ProviderPackage.Model<Settings, GoogleInteractions.ProviderOptionsInput>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { configure } from "../google.js";
|
|
2
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => configure({
|
|
3
3
|
apiKey,
|
|
4
4
|
baseURL,
|
|
5
5
|
headers,
|
|
@@ -169,4 +169,4 @@ export declare const provider: {
|
|
|
169
169
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
170
170
|
configure: typeof configure;
|
|
171
171
|
};
|
|
172
|
-
export declare const model: ProviderPackage.
|
|
172
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
@@ -40,7 +40,7 @@ export const provider = {
|
|
|
40
40
|
id,
|
|
41
41
|
configure,
|
|
42
42
|
};
|
|
43
|
-
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions }) => {
|
|
43
|
+
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions } = {}) => {
|
|
44
44
|
if (apiKey !== undefined)
|
|
45
45
|
throw new ProviderConfigurationError({ provider: id, message: "Google Vertex Chat does not support API keys" });
|
|
46
46
|
return configure({
|
|
@@ -99,4 +99,4 @@ export declare const provider: {
|
|
|
99
99
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
100
100
|
configure: typeof configure;
|
|
101
101
|
};
|
|
102
|
-
export declare const model: ProviderPackage.
|
|
102
|
+
export declare const model: ProviderPackage.Model<Settings, GoogleInteractions.ProviderOptionsInput>;
|
|
@@ -46,7 +46,7 @@ export const provider = {
|
|
|
46
46
|
id,
|
|
47
47
|
configure,
|
|
48
48
|
};
|
|
49
|
-
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions }) => {
|
|
49
|
+
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions } = {}) => {
|
|
50
50
|
if (apiKey !== undefined && accessToken !== undefined)
|
|
51
51
|
throw new ProviderConfigurationError({
|
|
52
52
|
provider: id,
|
|
@@ -337,4 +337,4 @@ export declare const provider: {
|
|
|
337
337
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
338
338
|
configure: typeof configure;
|
|
339
339
|
};
|
|
340
|
-
export declare const model: ProviderPackage.
|
|
340
|
+
export declare const model: ProviderPackage.Model<Settings, AnthropicMessages.ProviderOptionsInput>;
|
|
@@ -61,7 +61,7 @@ export const provider = {
|
|
|
61
61
|
id,
|
|
62
62
|
configure,
|
|
63
63
|
};
|
|
64
|
-
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions }) => {
|
|
64
|
+
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions } = {}) => {
|
|
65
65
|
if (apiKey !== undefined)
|
|
66
66
|
throw new ProviderConfigurationError({ provider: id, message: "Google Vertex Messages does not support API keys" });
|
|
67
67
|
return configure({
|
|
@@ -117,4 +117,4 @@ export declare const provider: {
|
|
|
117
117
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
118
118
|
configure: typeof configure;
|
|
119
119
|
};
|
|
120
|
-
export declare const model: ProviderPackage.
|
|
120
|
+
export declare const model: ProviderPackage.Model<Settings, MistralChat.ProviderOptionsInput>;
|
|
@@ -54,7 +54,7 @@ export const provider = {
|
|
|
54
54
|
id,
|
|
55
55
|
configure,
|
|
56
56
|
};
|
|
57
|
-
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions }) => {
|
|
57
|
+
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions } = {}) => {
|
|
58
58
|
if (apiKey !== undefined)
|
|
59
59
|
throw new ProviderConfigurationError({ provider: id, message: "Google Vertex Mistral does not support API keys" });
|
|
60
60
|
return configure({
|
|
@@ -207,4 +207,4 @@ export declare const provider: {
|
|
|
207
207
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
208
208
|
configure: typeof configure;
|
|
209
209
|
};
|
|
210
|
-
export declare const model: ProviderPackage.
|
|
210
|
+
export declare const model: ProviderPackage.Model<Settings, OpenResponsesProviderOptionsInput>;
|
|
@@ -41,7 +41,7 @@ export const provider = {
|
|
|
41
41
|
id,
|
|
42
42
|
configure,
|
|
43
43
|
};
|
|
44
|
-
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions }) => {
|
|
44
|
+
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions } = {}) => {
|
|
45
45
|
if (apiKey !== undefined)
|
|
46
46
|
throw new ProviderConfigurationError({ provider: id, message: "Google Vertex Responses does not support API keys" });
|
|
47
47
|
return configure({
|
|
@@ -121,5 +121,5 @@ export declare const provider: {
|
|
|
121
121
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
122
122
|
configure: typeof configure;
|
|
123
123
|
};
|
|
124
|
-
export declare const model: ProviderPackage.
|
|
125
|
-
export declare const imageModel: (modelID: string, settings
|
|
124
|
+
export declare const model: ProviderPackage.Model<Settings, GeminiProviderOptionsInput>;
|
|
125
|
+
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
@@ -88,7 +88,7 @@ export const imageModel = (modelID, settings) => {
|
|
|
88
88
|
const input = config(settings);
|
|
89
89
|
return configure(input).image(modelID, input.providerOptions);
|
|
90
90
|
};
|
|
91
|
-
function config({ accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions }) {
|
|
91
|
+
function config({ accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions } = {}) {
|
|
92
92
|
if (apiKey !== undefined && accessToken !== undefined)
|
|
93
93
|
throw new ProviderConfigurationError({
|
|
94
94
|
provider: id,
|
|
@@ -199,8 +199,8 @@ export declare const provider: {
|
|
|
199
199
|
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/google-transcription.js").GoogleTranscriptionOptions>;
|
|
200
200
|
configure: typeof configure;
|
|
201
201
|
};
|
|
202
|
-
export declare const model: ProviderPackage.
|
|
203
|
-
export declare const imageModel: (modelID: string, settings
|
|
202
|
+
export declare const model: ProviderPackage.Model<Settings, Gemini.ProviderOptionsInput>;
|
|
203
|
+
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
204
204
|
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
205
205
|
export declare const interactions: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
206
206
|
readonly previousInteractionId?: string | undefined;
|
package/dist/providers/google.js
CHANGED
|
@@ -44,7 +44,7 @@ export const imageModel = (modelID, settings) => {
|
|
|
44
44
|
const input = config(settings);
|
|
45
45
|
return configure(input).image(modelID, input.providerOptions);
|
|
46
46
|
};
|
|
47
|
-
function config({ apiKey, baseURL, body, headers, ...providerOptions }) {
|
|
47
|
+
function config({ apiKey, baseURL, body, headers, ...providerOptions } = {}) {
|
|
48
48
|
return {
|
|
49
49
|
apiKey,
|
|
50
50
|
baseURL,
|