@opencode/ai 0.0.0-dev-19485 → 0.0.0-dev-19486
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 +4 -0
- package/dist/providers/alibaba.d.ts +1 -2
- package/dist/providers/alibaba.js +6 -1
- package/dist/providers/amazon-bedrock-mantle.d.ts +2 -3
- package/dist/providers/amazon-bedrock-mantle.js +11 -11
- package/dist/providers/anthropic-compatible.d.ts +1 -2
- package/dist/providers/anthropic-compatible.js +9 -11
- package/dist/providers/anthropic.d.ts +1 -2
- package/dist/providers/anthropic.js +7 -7
- package/dist/providers/azure.d.ts +1 -2
- package/dist/providers/azure.js +12 -12
- package/dist/providers/baseten.d.ts +2 -3
- package/dist/providers/baseten.js +6 -6
- package/dist/providers/cerebras.d.ts +2 -3
- package/dist/providers/cerebras.js +6 -6
- package/dist/providers/cloudflare-ai-gateway.d.ts +1 -2
- package/dist/providers/cloudflare-ai-gateway.js +11 -8
- package/dist/providers/cloudflare-workers-ai.d.ts +1 -2
- package/dist/providers/cloudflare-workers-ai.js +10 -7
- package/dist/providers/deepinfra.d.ts +2 -3
- package/dist/providers/deepinfra.js +6 -6
- package/dist/providers/deepseek.d.ts +2 -3
- package/dist/providers/deepseek.js +6 -6
- package/dist/providers/fireworks.d.ts +2 -3
- package/dist/providers/fireworks.js +6 -6
- package/dist/providers/google-vertex-chat.d.ts +2 -3
- package/dist/providers/google-vertex-chat.js +9 -9
- package/dist/providers/google-vertex-messages.d.ts +2 -3
- package/dist/providers/google-vertex-messages.js +9 -9
- package/dist/providers/google-vertex-responses.d.ts +2 -3
- package/dist/providers/google-vertex-responses.js +9 -9
- package/dist/providers/google-vertex.d.ts +1 -2
- package/dist/providers/google-vertex.js +9 -9
- package/dist/providers/google.d.ts +2 -3
- package/dist/providers/google.js +6 -6
- package/dist/providers/groq.d.ts +2 -3
- package/dist/providers/groq.js +6 -6
- package/dist/providers/meta.d.ts +2 -3
- package/dist/providers/meta.js +6 -6
- package/dist/providers/minimax/chat.js +6 -6
- package/dist/providers/minimax/responses.js +6 -6
- package/dist/providers/minimax.d.ts +2 -3
- package/dist/providers/minimax.js +6 -6
- package/dist/providers/mistral.d.ts +2 -3
- package/dist/providers/mistral.js +6 -6
- package/dist/providers/moonshot/messages.js +6 -6
- package/dist/providers/moonshot/responses.js +6 -6
- package/dist/providers/moonshot.d.ts +2 -3
- package/dist/providers/moonshot.js +6 -6
- package/dist/providers/openai-compatible-responses.d.ts +2 -3
- package/dist/providers/openai-compatible-responses.js +7 -7
- package/dist/providers/openai-compatible.d.ts +2 -3
- package/dist/providers/openai-compatible.js +7 -7
- package/dist/providers/openai.d.ts +2 -3
- package/dist/providers/openai.js +9 -9
- package/dist/providers/openrouter.d.ts +2 -3
- package/dist/providers/openrouter.js +6 -6
- package/dist/providers/togetherai.d.ts +2 -3
- package/dist/providers/togetherai.js +6 -6
- package/dist/providers/xai.d.ts +2 -3
- package/dist/providers/xai.js +6 -6
- package/dist/providers/zai-coding-plan/messages.js +6 -6
- package/dist/providers/zai-coding-plan/responses.js +6 -6
- package/dist/providers/zai-coding-plan.d.ts +2 -3
- package/dist/providers/zai-coding-plan.js +6 -6
- package/dist/providers/zai.d.ts +2 -3
- package/dist/providers/zai.js +6 -6
- package/package.json +3 -3
|
@@ -80,19 +80,19 @@ export const provider = {
|
|
|
80
80
|
id,
|
|
81
81
|
configure,
|
|
82
82
|
};
|
|
83
|
-
export const model = (modelID,
|
|
84
|
-
if (
|
|
83
|
+
export const model = (modelID, { accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions }) => {
|
|
84
|
+
if (apiKey !== undefined && accessToken !== undefined)
|
|
85
85
|
throw new ProviderConfigurationError({
|
|
86
86
|
provider: id,
|
|
87
87
|
message: "Google Vertex apiKey cannot be combined with accessToken or auth",
|
|
88
88
|
});
|
|
89
89
|
return configure({
|
|
90
|
-
...(
|
|
91
|
-
baseURL
|
|
92
|
-
headers:
|
|
93
|
-
http:
|
|
94
|
-
location
|
|
95
|
-
project
|
|
96
|
-
providerOptions
|
|
90
|
+
...(apiKey === undefined ? { accessToken: accessToken } : { apiKey: apiKey }),
|
|
91
|
+
baseURL,
|
|
92
|
+
headers: headers === undefined ? undefined : { ...headers },
|
|
93
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
94
|
+
location,
|
|
95
|
+
project,
|
|
96
|
+
providerOptions,
|
|
97
97
|
}).model(modelID);
|
|
98
98
|
};
|
|
@@ -89,11 +89,10 @@ export type Config = RouteDefaultsInput & ProviderAuthOption<"optional"> & {
|
|
|
89
89
|
readonly baseURL?: string;
|
|
90
90
|
readonly providerOptions?: Gemini.ProviderOptionsInput;
|
|
91
91
|
};
|
|
92
|
-
export
|
|
92
|
+
export type Settings = ProviderPackage.Settings & Gemini.ProviderOptionsInput & {
|
|
93
93
|
readonly apiKey?: string;
|
|
94
94
|
readonly baseURL?: string;
|
|
95
|
-
|
|
96
|
-
}
|
|
95
|
+
};
|
|
97
96
|
export declare const configure: (input?: Config) => {
|
|
98
97
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
99
98
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
package/dist/providers/google.js
CHANGED
|
@@ -32,11 +32,11 @@ export const configure = (input = {}) => {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
export const provider = configure();
|
|
35
|
-
export const model = (modelID,
|
|
36
|
-
apiKey
|
|
37
|
-
baseURL
|
|
38
|
-
headers:
|
|
39
|
-
http:
|
|
40
|
-
providerOptions
|
|
35
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
36
|
+
apiKey,
|
|
37
|
+
baseURL,
|
|
38
|
+
headers: headers === undefined ? undefined : { ...headers },
|
|
39
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
40
|
+
providerOptions,
|
|
41
41
|
}).model(modelID);
|
|
42
42
|
export const image = provider.image;
|
package/dist/providers/groq.d.ts
CHANGED
|
@@ -17,11 +17,10 @@ export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> &
|
|
|
17
17
|
readonly baseURL?: string;
|
|
18
18
|
readonly providerOptions?: ProviderOptions;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type Settings = ProviderPackage.Settings & ProviderOptions & {
|
|
21
21
|
readonly apiKey?: string;
|
|
22
22
|
readonly baseURL?: string;
|
|
23
|
-
|
|
24
|
-
}
|
|
23
|
+
};
|
|
25
24
|
export declare const protocol: Protocol<{
|
|
26
25
|
readonly model: string;
|
|
27
26
|
readonly messages: readonly ({
|
package/dist/providers/groq.js
CHANGED
|
@@ -71,11 +71,11 @@ export const configure = (input = {}) => {
|
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
73
|
export const provider = configure();
|
|
74
|
-
export const model = (modelID,
|
|
75
|
-
apiKey
|
|
76
|
-
baseURL
|
|
77
|
-
headers:
|
|
78
|
-
http:
|
|
79
|
-
providerOptions
|
|
74
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
75
|
+
apiKey,
|
|
76
|
+
baseURL,
|
|
77
|
+
headers: headers === undefined ? undefined : { ...headers },
|
|
78
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
79
|
+
providerOptions,
|
|
80
80
|
}).model(modelID);
|
|
81
81
|
export * as Groq from "./groq.js";
|
package/dist/providers/meta.d.ts
CHANGED
|
@@ -34,11 +34,10 @@ export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> &
|
|
|
34
34
|
readonly baseURL?: string;
|
|
35
35
|
readonly providerOptions?: ProviderOptionsInput;
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type Settings = ProviderPackage.Settings & ProviderOptionsInput & {
|
|
38
38
|
readonly apiKey?: string;
|
|
39
39
|
readonly baseURL?: string;
|
|
40
|
-
|
|
41
|
-
}
|
|
40
|
+
};
|
|
42
41
|
export declare const routes: (Route<{
|
|
43
42
|
readonly model: string;
|
|
44
43
|
readonly messages: readonly ({
|
package/dist/providers/meta.js
CHANGED
|
@@ -101,13 +101,13 @@ export const image = provider.image;
|
|
|
101
101
|
export const model = (modelID, settings) => fromSettings(settings).responses(modelID);
|
|
102
102
|
export const chatModel = (modelID, settings) => fromSettings(settings).chat(modelID);
|
|
103
103
|
export const messagesModel = (modelID, settings) => fromSettings(settings).messages(modelID);
|
|
104
|
-
function fromSettings(
|
|
104
|
+
function fromSettings({ apiKey, baseURL, body, headers, ...providerOptions }) {
|
|
105
105
|
return configure({
|
|
106
|
-
apiKey
|
|
107
|
-
baseURL
|
|
108
|
-
headers
|
|
109
|
-
http:
|
|
110
|
-
providerOptions
|
|
106
|
+
apiKey,
|
|
107
|
+
baseURL,
|
|
108
|
+
headers,
|
|
109
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
110
|
+
providerOptions,
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
export * as Meta from "./meta.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MiniMax } from "../minimax.js";
|
|
2
|
-
export const model = (modelID,
|
|
3
|
-
apiKey
|
|
4
|
-
baseURL
|
|
5
|
-
headers
|
|
6
|
-
http:
|
|
7
|
-
providerOptions
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => MiniMax.configure({
|
|
3
|
+
apiKey,
|
|
4
|
+
baseURL,
|
|
5
|
+
headers,
|
|
6
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
7
|
+
providerOptions,
|
|
8
8
|
}).chat(modelID);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MiniMax } from "../minimax.js";
|
|
2
|
-
export const model = (modelID,
|
|
3
|
-
apiKey
|
|
4
|
-
baseURL
|
|
5
|
-
headers
|
|
6
|
-
http:
|
|
7
|
-
providerOptions
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => MiniMax.configure({
|
|
3
|
+
apiKey,
|
|
4
|
+
baseURL,
|
|
5
|
+
headers,
|
|
6
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
7
|
+
providerOptions,
|
|
8
8
|
}).responses(modelID);
|
|
@@ -29,11 +29,10 @@ export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthO
|
|
|
29
29
|
readonly baseURL?: string;
|
|
30
30
|
readonly providerOptions?: ProviderOptionsInput;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type Settings<Options = MessagesOptionsInput> = ProviderPackage.Settings & Options & {
|
|
33
33
|
readonly apiKey?: string;
|
|
34
34
|
readonly baseURL?: string;
|
|
35
|
-
|
|
36
|
-
}
|
|
35
|
+
};
|
|
37
36
|
export declare const routes: (Route<{
|
|
38
37
|
readonly max_tokens: number;
|
|
39
38
|
readonly model: string;
|
|
@@ -76,12 +76,12 @@ export const configure = (input = {}) => {
|
|
|
76
76
|
return { id, model: messages, messages, chat, responses, configure };
|
|
77
77
|
};
|
|
78
78
|
export const provider = configure();
|
|
79
|
-
export const model = (modelID,
|
|
80
|
-
apiKey
|
|
81
|
-
baseURL
|
|
82
|
-
headers
|
|
83
|
-
http:
|
|
84
|
-
providerOptions
|
|
79
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
80
|
+
apiKey,
|
|
81
|
+
baseURL,
|
|
82
|
+
headers,
|
|
83
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
84
|
+
providerOptions,
|
|
85
85
|
}).model(modelID);
|
|
86
86
|
export const messages = provider.messages;
|
|
87
87
|
export const chat = provider.chat;
|
|
@@ -9,11 +9,10 @@ export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> &
|
|
|
9
9
|
readonly baseURL?: string;
|
|
10
10
|
readonly providerOptions?: ProviderOptions;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type Settings = ProviderPackage.Settings & ProviderOptions & {
|
|
13
13
|
readonly apiKey?: string;
|
|
14
14
|
readonly baseURL?: string;
|
|
15
|
-
|
|
16
|
-
}
|
|
15
|
+
};
|
|
17
16
|
export declare const route: import("../route/client.js").Route<{
|
|
18
17
|
readonly model: string;
|
|
19
18
|
readonly messages: readonly ({
|
|
@@ -18,11 +18,11 @@ export const configure = (input = {}) => {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
export const provider = configure();
|
|
21
|
-
export const model = (modelID,
|
|
22
|
-
apiKey
|
|
23
|
-
baseURL
|
|
24
|
-
headers:
|
|
25
|
-
http:
|
|
26
|
-
providerOptions
|
|
21
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
22
|
+
apiKey,
|
|
23
|
+
baseURL,
|
|
24
|
+
headers: headers === undefined ? undefined : { ...headers },
|
|
25
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
26
|
+
providerOptions,
|
|
27
27
|
}).model(modelID);
|
|
28
28
|
export * as Mistral from "./mistral.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Moonshot } from "../moonshot.js";
|
|
2
|
-
export const model = (modelID,
|
|
3
|
-
apiKey
|
|
4
|
-
baseURL
|
|
5
|
-
headers
|
|
6
|
-
http:
|
|
7
|
-
providerOptions
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => Moonshot.configure({
|
|
3
|
+
apiKey,
|
|
4
|
+
baseURL,
|
|
5
|
+
headers,
|
|
6
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
7
|
+
providerOptions,
|
|
8
8
|
}).messages(modelID);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Moonshot } from "../moonshot.js";
|
|
2
|
-
export const model = (modelID,
|
|
3
|
-
apiKey
|
|
4
|
-
baseURL
|
|
5
|
-
headers
|
|
6
|
-
http:
|
|
7
|
-
providerOptions
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => Moonshot.configure({
|
|
3
|
+
apiKey,
|
|
4
|
+
baseURL,
|
|
5
|
+
headers,
|
|
6
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
7
|
+
providerOptions,
|
|
8
8
|
}).responses(modelID);
|
|
@@ -27,11 +27,10 @@ export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthO
|
|
|
27
27
|
readonly baseURL?: string;
|
|
28
28
|
readonly providerOptions?: ChatOptionsInput | MessagesOptionsInput | ResponsesOptionsInput;
|
|
29
29
|
};
|
|
30
|
-
export
|
|
30
|
+
export type Settings<Options = ChatOptionsInput> = ProviderPackage.Settings & Options & {
|
|
31
31
|
readonly apiKey?: string;
|
|
32
32
|
readonly baseURL?: string;
|
|
33
|
-
|
|
34
|
-
}
|
|
33
|
+
};
|
|
35
34
|
export declare const routes: (Route<{
|
|
36
35
|
readonly max_tokens: number;
|
|
37
36
|
readonly model: string;
|
|
@@ -80,11 +80,11 @@ export const provider = configure();
|
|
|
80
80
|
export const chat = provider.chat;
|
|
81
81
|
export const messages = provider.messages;
|
|
82
82
|
export const responses = provider.responses;
|
|
83
|
-
export const model = (modelID,
|
|
84
|
-
apiKey
|
|
85
|
-
baseURL
|
|
86
|
-
headers
|
|
87
|
-
http:
|
|
88
|
-
providerOptions
|
|
83
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
84
|
+
apiKey,
|
|
85
|
+
baseURL,
|
|
86
|
+
headers,
|
|
87
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
88
|
+
providerOptions,
|
|
89
89
|
}).model(modelID);
|
|
90
90
|
export * as Moonshot from "./moonshot.js";
|
|
@@ -10,12 +10,11 @@ export type Config = RouteDefaultsInput & ProviderAuthOption<"optional"> & {
|
|
|
10
10
|
readonly baseURL: string;
|
|
11
11
|
readonly providerOptions?: OpenResponsesProviderOptionsInput;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type Settings = ProviderPackage.Settings & OpenResponsesProviderOptionsInput & {
|
|
14
14
|
readonly apiKey?: string;
|
|
15
15
|
readonly baseURL: string;
|
|
16
16
|
readonly provider?: string;
|
|
17
|
-
|
|
18
|
-
}
|
|
17
|
+
};
|
|
19
18
|
export declare const routes: import("../route/client.js").Route<{
|
|
20
19
|
readonly input: readonly ({
|
|
21
20
|
readonly [x: string]: unknown;
|
|
@@ -22,11 +22,11 @@ export const provider = {
|
|
|
22
22
|
id,
|
|
23
23
|
configure,
|
|
24
24
|
};
|
|
25
|
-
export const model = (modelID,
|
|
26
|
-
apiKey
|
|
27
|
-
baseURL
|
|
28
|
-
headers:
|
|
29
|
-
http:
|
|
30
|
-
provider
|
|
31
|
-
providerOptions
|
|
25
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, provider, ...providerOptions }) => configure({
|
|
26
|
+
apiKey,
|
|
27
|
+
baseURL,
|
|
28
|
+
headers: headers === undefined ? undefined : { ...headers },
|
|
29
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
30
|
+
provider,
|
|
31
|
+
providerOptions,
|
|
32
32
|
}).model(modelID);
|
|
@@ -9,12 +9,11 @@ type GenericModelOptions = Omit<RouteDefaultsInput, "providerOptions"> & Provide
|
|
|
9
9
|
readonly baseURL: string;
|
|
10
10
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & {
|
|
13
13
|
readonly apiKey?: string;
|
|
14
14
|
readonly baseURL: string;
|
|
15
15
|
readonly provider?: string;
|
|
16
|
-
|
|
17
|
-
}
|
|
16
|
+
};
|
|
18
17
|
export declare const routes: import("../route/client.js").Route<{
|
|
19
18
|
readonly model: string;
|
|
20
19
|
readonly messages: readonly ({
|
|
@@ -22,12 +22,12 @@ export const provider = {
|
|
|
22
22
|
id,
|
|
23
23
|
configure,
|
|
24
24
|
};
|
|
25
|
-
export const model = (modelID,
|
|
26
|
-
apiKey
|
|
27
|
-
baseURL
|
|
28
|
-
headers:
|
|
29
|
-
http:
|
|
30
|
-
provider
|
|
31
|
-
providerOptions
|
|
25
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, provider, ...providerOptions }) => configure({
|
|
26
|
+
apiKey,
|
|
27
|
+
baseURL,
|
|
28
|
+
headers: headers === undefined ? undefined : { ...headers },
|
|
29
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
30
|
+
provider,
|
|
31
|
+
providerOptions,
|
|
32
32
|
}).model(modelID);
|
|
33
33
|
export * as OpenAICompatible from "./openai-compatible.js";
|
|
@@ -346,14 +346,13 @@ export interface ImageGenerationOptions {
|
|
|
346
346
|
readonly size?: OpenAIImageString<"auto" | "256x256" | "512x512" | "1024x1024" | "1536x1024" | "1024x1536" | "1792x1024" | "1024x1792">;
|
|
347
347
|
}
|
|
348
348
|
export declare const imageGeneration: (options?: ImageGenerationOptions) => ToolDefinition;
|
|
349
|
-
export
|
|
349
|
+
export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & {
|
|
350
350
|
readonly apiKey?: string;
|
|
351
351
|
readonly baseURL?: string;
|
|
352
352
|
readonly organization?: string;
|
|
353
353
|
readonly project?: string;
|
|
354
354
|
readonly queryParams?: Readonly<Record<string, string>>;
|
|
355
|
-
|
|
356
|
-
}
|
|
355
|
+
};
|
|
357
356
|
export declare const configure: (input?: Config) => {
|
|
358
357
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
359
358
|
model: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, {
|
package/dist/providers/openai.js
CHANGED
|
@@ -58,19 +58,19 @@ export const configure = (input = {}) => {
|
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
60
|
export const provider = configure();
|
|
61
|
-
const config = (
|
|
61
|
+
const config = ({ apiKey, baseURL, body, headers: given, organization, project, queryParams, ...providerOptions }) => {
|
|
62
62
|
const headers = {
|
|
63
|
-
...(
|
|
64
|
-
...(
|
|
65
|
-
...
|
|
63
|
+
...(organization === undefined ? {} : { "OpenAI-Organization": organization }),
|
|
64
|
+
...(project === undefined ? {} : { "OpenAI-Project": project }),
|
|
65
|
+
...given,
|
|
66
66
|
};
|
|
67
67
|
return {
|
|
68
|
-
apiKey
|
|
69
|
-
baseURL
|
|
68
|
+
apiKey,
|
|
69
|
+
baseURL,
|
|
70
70
|
headers: Object.keys(headers).length === 0 ? undefined : headers,
|
|
71
|
-
http:
|
|
72
|
-
providerOptions
|
|
73
|
-
queryParams:
|
|
71
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
72
|
+
providerOptions,
|
|
73
|
+
queryParams: queryParams === undefined ? undefined : { ...queryParams },
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
export const model = (modelID, settings) => {
|
|
@@ -77,11 +77,10 @@ export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> &
|
|
|
77
77
|
readonly baseURL?: string;
|
|
78
78
|
readonly providerOptions?: OpenRouterProviderOptionsInput;
|
|
79
79
|
};
|
|
80
|
-
export
|
|
80
|
+
export type Settings = ProviderPackage.Settings & OpenRouterProviderOptionsInput & {
|
|
81
81
|
readonly apiKey?: string;
|
|
82
82
|
readonly baseURL?: string;
|
|
83
|
-
|
|
84
|
-
}
|
|
83
|
+
};
|
|
85
84
|
declare const OpenRouterBody: Schema.StructWithRest<Schema.Struct<{
|
|
86
85
|
model: Schema.String;
|
|
87
86
|
messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
@@ -105,10 +105,10 @@ export const configure = (input = {}) => {
|
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
export const provider = configure();
|
|
108
|
-
export const model = (modelID,
|
|
109
|
-
apiKey
|
|
110
|
-
baseURL
|
|
111
|
-
headers
|
|
112
|
-
http:
|
|
113
|
-
providerOptions
|
|
108
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
109
|
+
apiKey,
|
|
110
|
+
baseURL,
|
|
111
|
+
headers,
|
|
112
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
113
|
+
providerOptions,
|
|
114
114
|
}).model(modelID);
|
|
@@ -8,11 +8,10 @@ export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> &
|
|
|
8
8
|
readonly baseURL?: string;
|
|
9
9
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & {
|
|
12
12
|
readonly apiKey?: string;
|
|
13
13
|
readonly baseURL?: string;
|
|
14
|
-
|
|
15
|
-
}
|
|
14
|
+
};
|
|
16
15
|
export declare const route: Route<{
|
|
17
16
|
readonly model: string;
|
|
18
17
|
readonly messages: readonly ({
|
|
@@ -31,10 +31,10 @@ export const configure = (input = {}) => {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
export const provider = configure();
|
|
34
|
-
export const model = (modelID,
|
|
35
|
-
apiKey
|
|
36
|
-
baseURL
|
|
37
|
-
headers:
|
|
38
|
-
http:
|
|
39
|
-
providerOptions
|
|
34
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
35
|
+
apiKey,
|
|
36
|
+
baseURL,
|
|
37
|
+
headers: headers === undefined ? undefined : { ...headers },
|
|
38
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
39
|
+
providerOptions,
|
|
40
40
|
}).model(modelID);
|
package/dist/providers/xai.d.ts
CHANGED
|
@@ -11,11 +11,10 @@ export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> &
|
|
|
11
11
|
readonly baseURL?: string;
|
|
12
12
|
readonly providerOptions?: XAIProviderOptionsInput;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type Settings = ProviderPackage.Settings & XAIProviderOptionsInput & {
|
|
15
15
|
readonly apiKey?: string;
|
|
16
16
|
readonly baseURL?: string;
|
|
17
|
-
|
|
18
|
-
}
|
|
17
|
+
};
|
|
19
18
|
export type { XAIImageOptions } from "../protocols/xai-images.js";
|
|
20
19
|
declare const responsesRoute: Route<unknown, import("../protocols/open-responses-channel.js").Prepared, {
|
|
21
20
|
endpoint: import("../route/client.js").CompactOperation;
|
package/dist/providers/xai.js
CHANGED
|
@@ -76,12 +76,12 @@ export const configure = (input = {}) => {
|
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
78
|
export const provider = configure();
|
|
79
|
-
export const model = (modelID,
|
|
80
|
-
apiKey
|
|
81
|
-
baseURL
|
|
82
|
-
headers
|
|
83
|
-
http:
|
|
84
|
-
providerOptions
|
|
79
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
80
|
+
apiKey,
|
|
81
|
+
baseURL,
|
|
82
|
+
headers,
|
|
83
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
84
|
+
providerOptions,
|
|
85
85
|
}).model(modelID);
|
|
86
86
|
export const responses = provider.responses;
|
|
87
87
|
export const chat = provider.chat;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ZAICodingPlan } from "../zai-coding-plan.js";
|
|
2
|
-
export const model = (modelID,
|
|
3
|
-
apiKey
|
|
4
|
-
baseURL
|
|
5
|
-
headers
|
|
6
|
-
http:
|
|
7
|
-
providerOptions
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => ZAICodingPlan.configure({
|
|
3
|
+
apiKey,
|
|
4
|
+
baseURL,
|
|
5
|
+
headers,
|
|
6
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
7
|
+
providerOptions,
|
|
8
8
|
}).messages(modelID);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ZAICodingPlan } from "../zai-coding-plan.js";
|
|
2
|
-
export const model = (modelID,
|
|
3
|
-
apiKey
|
|
4
|
-
baseURL
|
|
5
|
-
headers
|
|
6
|
-
http:
|
|
7
|
-
providerOptions
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => ZAICodingPlan.configure({
|
|
3
|
+
apiKey,
|
|
4
|
+
baseURL,
|
|
5
|
+
headers,
|
|
6
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
7
|
+
providerOptions,
|
|
8
8
|
}).responses(modelID);
|
|
@@ -15,11 +15,10 @@ export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthO
|
|
|
15
15
|
readonly baseURL?: string;
|
|
16
16
|
readonly providerOptions?: ChatOptionsInput | MessagesOptionsInput | ResponsesOptionsInput;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type Settings<Options = ChatOptionsInput> = ProviderPackage.Settings & Options & {
|
|
19
19
|
readonly apiKey?: string;
|
|
20
20
|
readonly baseURL?: string;
|
|
21
|
-
|
|
22
|
-
}
|
|
21
|
+
};
|
|
23
22
|
export declare const routes: (Route<{
|
|
24
23
|
readonly input: readonly ({
|
|
25
24
|
readonly [x: string]: unknown;
|
|
@@ -53,11 +53,11 @@ export const provider = configure();
|
|
|
53
53
|
export const chat = provider.chat;
|
|
54
54
|
export const messages = provider.messages;
|
|
55
55
|
export const responses = provider.responses;
|
|
56
|
-
export const model = (modelID,
|
|
57
|
-
apiKey
|
|
58
|
-
baseURL
|
|
59
|
-
headers
|
|
60
|
-
http:
|
|
61
|
-
providerOptions
|
|
56
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
57
|
+
apiKey,
|
|
58
|
+
baseURL,
|
|
59
|
+
headers,
|
|
60
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
61
|
+
providerOptions,
|
|
62
62
|
}).model(modelID);
|
|
63
63
|
export * as ZAICodingPlan from "./zai-coding-plan.js";
|
package/dist/providers/zai.d.ts
CHANGED
|
@@ -9,11 +9,10 @@ export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthO
|
|
|
9
9
|
readonly baseURL?: string;
|
|
10
10
|
readonly providerOptions?: ChatOptionsInput;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type Settings = ProviderPackage.Settings & ChatOptionsInput & {
|
|
13
13
|
readonly apiKey?: string;
|
|
14
14
|
readonly baseURL?: string;
|
|
15
|
-
|
|
16
|
-
}
|
|
15
|
+
};
|
|
17
16
|
export type { ZAIImageOptions } from "../protocols/zai-images.js";
|
|
18
17
|
export declare const routes: Route<{
|
|
19
18
|
readonly model: string;
|
package/dist/providers/zai.js
CHANGED
|
@@ -43,11 +43,11 @@ export const configure = (input = {}) => {
|
|
|
43
43
|
export const provider = configure();
|
|
44
44
|
export const image = provider.image;
|
|
45
45
|
export const chat = provider.chat;
|
|
46
|
-
export const model = (modelID,
|
|
47
|
-
apiKey
|
|
48
|
-
baseURL
|
|
49
|
-
headers
|
|
50
|
-
http:
|
|
51
|
-
providerOptions
|
|
46
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
47
|
+
apiKey,
|
|
48
|
+
baseURL,
|
|
49
|
+
headers,
|
|
50
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
51
|
+
providerOptions,
|
|
52
52
|
}).model(modelID);
|
|
53
53
|
export * as ZAI from "./zai.js";
|