@opencode-ai/ai 0.0.0-beta-17492
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/README.md +392 -0
- package/dist/cache-policy.d.ts +2 -0
- package/dist/cache-policy.js +121 -0
- package/dist/image-client.d.ts +19 -0
- package/dist/image-client.js +19 -0
- package/dist/image.d.ts +110 -0
- package/dist/image.js +102 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +12 -0
- package/dist/llm.d.ts +230 -0
- package/dist/llm.js +77 -0
- package/dist/protocols/anthropic-messages.d.ts +633 -0
- package/dist/protocols/anthropic-messages.js +860 -0
- package/dist/protocols/bedrock-converse.d.ts +533 -0
- package/dist/protocols/bedrock-converse.js +584 -0
- package/dist/protocols/bedrock-event-stream.d.ts +9 -0
- package/dist/protocols/bedrock-event-stream.js +73 -0
- package/dist/protocols/gemini.d.ts +300 -0
- package/dist/protocols/gemini.js +512 -0
- package/dist/protocols/google-images.d.ts +30 -0
- package/dist/protocols/google-images.js +191 -0
- package/dist/protocols/index.d.ts +10 -0
- package/dist/protocols/index.js +10 -0
- package/dist/protocols/open-responses-channel.d.ts +26 -0
- package/dist/protocols/open-responses-channel.js +120 -0
- package/dist/protocols/open-responses.d.ts +951 -0
- package/dist/protocols/open-responses.js +873 -0
- package/dist/protocols/openai-chat.d.ts +795 -0
- package/dist/protocols/openai-chat.js +718 -0
- package/dist/protocols/openai-compatible-chat.d.ts +107 -0
- package/dist/protocols/openai-compatible-chat.js +20 -0
- package/dist/protocols/openai-compatible-responses.d.ts +96 -0
- package/dist/protocols/openai-compatible-responses.js +17 -0
- package/dist/protocols/openai-images.d.ts +32 -0
- package/dist/protocols/openai-images.js +188 -0
- package/dist/protocols/openai-responses-channel.d.ts +12 -0
- package/dist/protocols/openai-responses-channel.js +142 -0
- package/dist/protocols/openai-responses.d.ts +596 -0
- package/dist/protocols/openai-responses.js +208 -0
- package/dist/protocols/shared.d.ts +194 -0
- package/dist/protocols/shared.js +238 -0
- package/dist/protocols/utils/bedrock-auth.d.ts +21 -0
- package/dist/protocols/utils/bedrock-auth.js +43 -0
- package/dist/protocols/utils/bedrock-cache.d.ts +15 -0
- package/dist/protocols/utils/bedrock-cache.js +29 -0
- package/dist/protocols/utils/bedrock-media.d.ts +49 -0
- package/dist/protocols/utils/bedrock-media.js +70 -0
- package/dist/protocols/utils/cache.d.ts +6 -0
- package/dist/protocols/utils/cache.js +8 -0
- package/dist/protocols/utils/gemini-tool-schema.d.ts +2 -0
- package/dist/protocols/utils/gemini-tool-schema.js +103 -0
- package/dist/protocols/utils/image-input.d.ts +21 -0
- package/dist/protocols/utils/image-input.js +22 -0
- package/dist/protocols/utils/lifecycle.d.ts +20 -0
- package/dist/protocols/utils/lifecycle.js +68 -0
- package/dist/protocols/utils/open-responses-options.d.ts +21 -0
- package/dist/protocols/utils/open-responses-options.js +41 -0
- package/dist/protocols/utils/openai-image.d.ts +5 -0
- package/dist/protocols/utils/openai-image.js +18 -0
- package/dist/protocols/utils/openai-options.d.ts +14 -0
- package/dist/protocols/utils/openai-options.js +14 -0
- package/dist/protocols/utils/tool-schema.d.ts +8 -0
- package/dist/protocols/utils/tool-schema.js +81 -0
- package/dist/protocols/utils/tool-stream.d.ts +639 -0
- package/dist/protocols/utils/tool-stream.js +141 -0
- package/dist/protocols/xai-images.d.ts +26 -0
- package/dist/protocols/xai-images.js +111 -0
- package/dist/protocols/zai-images.d.ts +22 -0
- package/dist/protocols/zai-images.js +84 -0
- package/dist/protocols.d.ts +1 -0
- package/dist/protocols.js +1 -0
- package/dist/provider-error.d.ts +14 -0
- package/dist/provider-error.js +130 -0
- package/dist/provider-package.d.ts +15 -0
- package/dist/provider-package.js +1 -0
- package/dist/provider.d.ts +23 -0
- package/dist/provider.js +2 -0
- package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/chat.js +1 -0
- package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/responses.js +1 -0
- package/dist/providers/amazon-bedrock/mantle.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle.js +1 -0
- package/dist/providers/amazon-bedrock-mantle.d.ts +247 -0
- package/dist/providers/amazon-bedrock-mantle.js +68 -0
- package/dist/providers/amazon-bedrock.d.ts +172 -0
- package/dist/providers/amazon-bedrock.js +41 -0
- package/dist/providers/anthropic-compatible.d.ts +218 -0
- package/dist/providers/anthropic-compatible.js +45 -0
- package/dist/providers/anthropic.d.ts +216 -0
- package/dist/providers/anthropic.js +40 -0
- package/dist/providers/azure/chat.d.ts +2 -0
- package/dist/providers/azure/chat.js +1 -0
- package/dist/providers/azure/responses.d.ts +2 -0
- package/dist/providers/azure/responses.js +1 -0
- package/dist/providers/azure.d.ts +248 -0
- package/dist/providers/azure.js +90 -0
- package/dist/providers/cloudflare.d.ts +338 -0
- package/dist/providers/cloudflare.js +87 -0
- package/dist/providers/google-vertex/chat.d.ts +2 -0
- package/dist/providers/google-vertex/chat.js +1 -0
- package/dist/providers/google-vertex/gemini.d.ts +2 -0
- package/dist/providers/google-vertex/gemini.js +1 -0
- package/dist/providers/google-vertex/messages.d.ts +2 -0
- package/dist/providers/google-vertex/messages.js +1 -0
- package/dist/providers/google-vertex/responses.d.ts +2 -0
- package/dist/providers/google-vertex/responses.js +1 -0
- package/dist/providers/google-vertex-chat.d.ts +131 -0
- package/dist/providers/google-vertex-chat.js +50 -0
- package/dist/providers/google-vertex-messages.d.ts +215 -0
- package/dist/providers/google-vertex-messages.js +75 -0
- package/dist/providers/google-vertex-responses.d.ts +122 -0
- package/dist/providers/google-vertex-responses.js +51 -0
- package/dist/providers/google-vertex-shared.d.ts +22 -0
- package/dist/providers/google-vertex-shared.js +61 -0
- package/dist/providers/google-vertex.d.ts +115 -0
- package/dist/providers/google-vertex.js +64 -0
- package/dist/providers/google.d.ts +112 -0
- package/dist/providers/google.js +43 -0
- package/dist/providers/index.d.ts +18 -0
- package/dist/providers/index.js +18 -0
- package/dist/providers/open-responses-options.d.ts +16 -0
- package/dist/providers/open-responses-options.js +1 -0
- package/dist/providers/openai/chat.d.ts +2 -0
- package/dist/providers/openai/chat.js +1 -0
- package/dist/providers/openai/responses.d.ts +2 -0
- package/dist/providers/openai/responses.js +1 -0
- package/dist/providers/openai-compatible/responses.d.ts +1 -0
- package/dist/providers/openai-compatible/responses.js +1 -0
- package/dist/providers/openai-compatible-profile.d.ts +43 -0
- package/dist/providers/openai-compatible-profile.js +12 -0
- package/dist/providers/openai-compatible-responses.d.ts +120 -0
- package/dist/providers/openai-compatible-responses.js +33 -0
- package/dist/providers/openai-compatible.d.ts +167 -0
- package/dist/providers/openai-compatible.js +55 -0
- package/dist/providers/openai-options.d.ts +21 -0
- package/dist/providers/openai-options.js +41 -0
- package/dist/providers/openai.d.ts +264 -0
- package/dist/providers/openai.js +83 -0
- package/dist/providers/openrouter.d.ts +537 -0
- package/dist/providers/openrouter.js +117 -0
- package/dist/providers/xai.d.ts +249 -0
- package/dist/providers/xai.js +79 -0
- package/dist/providers/zai.d.ts +24 -0
- package/dist/providers/zai.js +21 -0
- package/dist/providers.d.ts +1 -0
- package/dist/providers.js +1 -0
- package/dist/route/auth-options.d.ts +34 -0
- package/dist/route/auth-options.js +14 -0
- package/dist/route/auth.d.ts +51 -0
- package/dist/route/auth.js +89 -0
- package/dist/route/client.d.ts +348 -0
- package/dist/route/client.js +214 -0
- package/dist/route/endpoint.d.ts +28 -0
- package/dist/route/endpoint.js +21 -0
- package/dist/route/executor.d.ts +23 -0
- package/dist/route/executor.js +227 -0
- package/dist/route/framing.d.ts +23 -0
- package/dist/route/framing.js +4 -0
- package/dist/route/index.d.ts +16 -0
- package/dist/route/index.js +9 -0
- package/dist/route/protocol.d.ts +77 -0
- package/dist/route/protocol.js +17 -0
- package/dist/route/transport/http.d.ts +34 -0
- package/dist/route/transport/http.js +63 -0
- package/dist/route/transport/index.d.ts +39 -0
- package/dist/route/transport/index.js +4 -0
- package/dist/route/transport/websocket-channel.d.ts +56 -0
- package/dist/route/transport/websocket-channel.js +1 -0
- package/dist/route/transport/websocket.d.ts +55 -0
- package/dist/route/transport/websocket.js +326 -0
- package/dist/route.d.ts +1 -0
- package/dist/route.js +1 -0
- package/dist/schema/errors.d.ts +159 -0
- package/dist/schema/errors.js +155 -0
- package/dist/schema/events.d.ts +4587 -0
- package/dist/schema/events.js +492 -0
- package/dist/schema/ids.d.ts +30 -0
- package/dist/schema/ids.js +19 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.js +5 -0
- package/dist/schema/messages.d.ts +402 -0
- package/dist/schema/messages.js +244 -0
- package/dist/schema/options.d.ts +159 -0
- package/dist/schema/options.js +202 -0
- package/dist/testing.d.ts +1493 -0
- package/dist/testing.js +88 -0
- package/dist/tool-runtime.d.ts +15 -0
- package/dist/tool-runtime.js +54 -0
- package/dist/tool.d.ts +135 -0
- package/dist/tool.js +66 -0
- package/dist/utils/record.d.ts +2 -0
- package/dist/utils/record.js +2 -0
- package/package.json +47 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { ProviderPackage } from "../provider-package.js";
|
|
2
|
+
import type { RouteDefaultsInput } from "../route/client.js";
|
|
3
|
+
import { type ModelID } from "../schema/index.js";
|
|
4
|
+
import { GoogleVertexShared } from "./google-vertex-shared.js";
|
|
5
|
+
import type { OpenResponsesProviderOptionsInput } from "./open-responses-options.js";
|
|
6
|
+
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
|
+
export type Config = RouteDefaultsInput & GoogleVertexShared.OAuthOptions & {
|
|
8
|
+
readonly baseURL?: string;
|
|
9
|
+
readonly location?: string;
|
|
10
|
+
readonly project?: string;
|
|
11
|
+
readonly providerOptions?: OpenResponsesProviderOptionsInput;
|
|
12
|
+
};
|
|
13
|
+
export interface Settings extends ProviderPackage.Settings {
|
|
14
|
+
readonly accessToken?: string;
|
|
15
|
+
readonly apiKey?: never;
|
|
16
|
+
readonly baseURL?: string;
|
|
17
|
+
readonly location?: string;
|
|
18
|
+
readonly project?: string;
|
|
19
|
+
readonly providerOptions?: OpenResponsesProviderOptionsInput;
|
|
20
|
+
}
|
|
21
|
+
export declare const routes: import("../route/client.js").Route<{
|
|
22
|
+
readonly input: readonly ({
|
|
23
|
+
readonly type: "reasoning";
|
|
24
|
+
readonly summary: readonly {
|
|
25
|
+
readonly type: "summary_text";
|
|
26
|
+
readonly text: string;
|
|
27
|
+
}[];
|
|
28
|
+
readonly id?: string | undefined;
|
|
29
|
+
readonly encrypted_content?: string | null | undefined;
|
|
30
|
+
} | {
|
|
31
|
+
readonly type: "item_reference";
|
|
32
|
+
readonly id: string;
|
|
33
|
+
} | {
|
|
34
|
+
readonly role: "system";
|
|
35
|
+
readonly content: string;
|
|
36
|
+
} | {
|
|
37
|
+
readonly role: "user";
|
|
38
|
+
readonly content: readonly ({
|
|
39
|
+
readonly type: "input_image";
|
|
40
|
+
readonly image_url: string;
|
|
41
|
+
} | {
|
|
42
|
+
readonly type: "input_file";
|
|
43
|
+
readonly filename: string;
|
|
44
|
+
readonly file_data: string;
|
|
45
|
+
readonly mime_type?: string | undefined;
|
|
46
|
+
} | {
|
|
47
|
+
readonly type: "input_text";
|
|
48
|
+
readonly text: string;
|
|
49
|
+
})[];
|
|
50
|
+
} | {
|
|
51
|
+
readonly content: readonly {
|
|
52
|
+
readonly type: "output_text";
|
|
53
|
+
readonly text: string;
|
|
54
|
+
}[];
|
|
55
|
+
readonly role: "assistant";
|
|
56
|
+
readonly phase?: "commentary" | "final_answer" | undefined;
|
|
57
|
+
} | {
|
|
58
|
+
readonly type: "function_call";
|
|
59
|
+
readonly call_id: string;
|
|
60
|
+
readonly name: string;
|
|
61
|
+
readonly arguments: string;
|
|
62
|
+
} | {
|
|
63
|
+
readonly type: "function_call_output";
|
|
64
|
+
readonly call_id: string;
|
|
65
|
+
readonly output: string | readonly ({
|
|
66
|
+
readonly type: "input_image";
|
|
67
|
+
readonly image_url: string;
|
|
68
|
+
} | {
|
|
69
|
+
readonly type: "input_file";
|
|
70
|
+
readonly filename: string;
|
|
71
|
+
readonly file_data: string;
|
|
72
|
+
readonly mime_type?: string | undefined;
|
|
73
|
+
} | {
|
|
74
|
+
readonly type: "input_text";
|
|
75
|
+
readonly text: string;
|
|
76
|
+
})[];
|
|
77
|
+
})[];
|
|
78
|
+
readonly model: string;
|
|
79
|
+
readonly stream: true;
|
|
80
|
+
readonly instructions?: string | undefined;
|
|
81
|
+
readonly reasoning?: {
|
|
82
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
83
|
+
readonly effort?: string | undefined;
|
|
84
|
+
} | undefined;
|
|
85
|
+
readonly tools?: readonly {
|
|
86
|
+
readonly type: "function";
|
|
87
|
+
readonly description: string;
|
|
88
|
+
readonly name: string;
|
|
89
|
+
readonly parameters: {
|
|
90
|
+
readonly [x: string]: unknown;
|
|
91
|
+
};
|
|
92
|
+
readonly strict?: boolean | undefined;
|
|
93
|
+
}[] | undefined;
|
|
94
|
+
readonly text?: {
|
|
95
|
+
readonly verbosity?: "low" | "medium" | "high" | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
readonly temperature?: number | undefined;
|
|
98
|
+
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
99
|
+
readonly type: "function";
|
|
100
|
+
readonly name: string;
|
|
101
|
+
} | undefined;
|
|
102
|
+
readonly top_p?: number | undefined;
|
|
103
|
+
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
104
|
+
readonly store?: boolean | undefined;
|
|
105
|
+
readonly prompt_cache_key?: string | undefined;
|
|
106
|
+
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
107
|
+
readonly max_output_tokens?: number | undefined;
|
|
108
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>[];
|
|
109
|
+
export declare const configure: (input?: Config) => {
|
|
110
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
111
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenResponsesProviderOptionsInput>;
|
|
112
|
+
configure: (input?: Config) => /*elided*/ any;
|
|
113
|
+
};
|
|
114
|
+
export declare const provider: {
|
|
115
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
116
|
+
configure: (input?: Config) => {
|
|
117
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
118
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenResponsesProviderOptionsInput>;
|
|
119
|
+
configure: /*elided*/ any;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
export declare const model: ProviderPackage.Definition<Settings, OpenResponsesProviderOptionsInput>["model"];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OpenAICompatibleResponses } from "../protocols/openai-compatible-responses.js";
|
|
2
|
+
import { ProviderID } from "../schema/index.js";
|
|
3
|
+
import { GoogleVertexShared } from "./google-vertex-shared.js";
|
|
4
|
+
export const id = ProviderID.make("google-vertex");
|
|
5
|
+
const route = OpenAICompatibleResponses.route.with({
|
|
6
|
+
id: "google-vertex-responses",
|
|
7
|
+
provider: id,
|
|
8
|
+
providerOptions: { openresponses: { store: false } },
|
|
9
|
+
});
|
|
10
|
+
export const routes = [route];
|
|
11
|
+
const configuredRoute = (input) => {
|
|
12
|
+
if ("apiKey" in input && input.apiKey !== undefined)
|
|
13
|
+
throw new Error("Google Vertex Responses does not support API keys");
|
|
14
|
+
const { accessToken: _accessToken, auth: _auth, baseURL, location: inputLocation, project: inputProject, ...rest } = input;
|
|
15
|
+
const location = GoogleVertexShared.location(inputLocation, "global");
|
|
16
|
+
const project = GoogleVertexShared.project(inputProject);
|
|
17
|
+
return route.with({
|
|
18
|
+
...rest,
|
|
19
|
+
endpoint: {
|
|
20
|
+
baseURL: baseURL ??
|
|
21
|
+
`https://aiplatform.googleapis.com/v1/projects/${GoogleVertexShared.requireProject(project)}/locations/${location}/endpoints/openapi`,
|
|
22
|
+
},
|
|
23
|
+
auth: GoogleVertexShared.oauth(input, project),
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
export const configure = (input = {}) => {
|
|
27
|
+
const route = configuredRoute(input);
|
|
28
|
+
return {
|
|
29
|
+
id,
|
|
30
|
+
model: (modelID) => route.model({ id: modelID }),
|
|
31
|
+
configure,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export const provider = {
|
|
35
|
+
id,
|
|
36
|
+
configure,
|
|
37
|
+
};
|
|
38
|
+
export const model = (modelID, settings) => {
|
|
39
|
+
if (settings.apiKey !== undefined)
|
|
40
|
+
throw new Error("Google Vertex Responses does not support API keys");
|
|
41
|
+
return configure({
|
|
42
|
+
accessToken: settings.accessToken,
|
|
43
|
+
baseURL: settings.baseURL,
|
|
44
|
+
headers: settings.headers === undefined ? undefined : { ...settings.headers },
|
|
45
|
+
http: settings.body === undefined ? undefined : { body: { ...settings.body } },
|
|
46
|
+
limits: settings.limits,
|
|
47
|
+
location: settings.location,
|
|
48
|
+
project: settings.project,
|
|
49
|
+
providerOptions: settings.providerOptions,
|
|
50
|
+
}).model(modelID);
|
|
51
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Auth } from "../route/auth.js";
|
|
2
|
+
export type OAuthOptions = {
|
|
3
|
+
readonly accessToken?: string;
|
|
4
|
+
readonly auth?: never;
|
|
5
|
+
} | {
|
|
6
|
+
readonly accessToken?: never;
|
|
7
|
+
readonly auth?: Auth.Definition;
|
|
8
|
+
};
|
|
9
|
+
export type ApiKeyOptions = (OAuthOptions & {
|
|
10
|
+
readonly apiKey?: never;
|
|
11
|
+
}) | {
|
|
12
|
+
readonly accessToken?: never;
|
|
13
|
+
readonly apiKey?: string;
|
|
14
|
+
readonly auth?: never;
|
|
15
|
+
};
|
|
16
|
+
export declare const project: (value?: string) => string | undefined;
|
|
17
|
+
export declare const location: (value: string | undefined, fallback: string) => string;
|
|
18
|
+
export declare const host: (location: string) => string;
|
|
19
|
+
export declare const requireProject: (value: string | undefined) => string;
|
|
20
|
+
export declare const apiKey: (input: ApiKeyOptions) => string | undefined;
|
|
21
|
+
export declare const oauth: (input: OAuthOptions, project?: string) => Auth.Definition;
|
|
22
|
+
export * as GoogleVertexShared from "./google-vertex-shared.js";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Effect, Redacted } from "effect";
|
|
2
|
+
import { Auth, MissingCredentialError } from "../route/auth.js";
|
|
3
|
+
const SCOPE = "https://www.googleapis.com/auth/cloud-platform";
|
|
4
|
+
export const project = (value) => value ??
|
|
5
|
+
process.env.GOOGLE_VERTEX_PROJECT ??
|
|
6
|
+
process.env.GOOGLE_CLOUD_PROJECT ??
|
|
7
|
+
process.env.GCP_PROJECT ??
|
|
8
|
+
process.env.GCLOUD_PROJECT;
|
|
9
|
+
export const location = (value, fallback) => value ??
|
|
10
|
+
process.env.GOOGLE_VERTEX_LOCATION ??
|
|
11
|
+
process.env.GOOGLE_CLOUD_LOCATION ??
|
|
12
|
+
process.env.VERTEX_LOCATION ??
|
|
13
|
+
fallback;
|
|
14
|
+
export const host = (location) => {
|
|
15
|
+
if (location === "global")
|
|
16
|
+
return "aiplatform.googleapis.com";
|
|
17
|
+
// Jurisdictional multi-regions use Regional Endpoint Platform domains.
|
|
18
|
+
if (location === "eu" || location === "us")
|
|
19
|
+
return `aiplatform.${location}.rep.googleapis.com`;
|
|
20
|
+
return `${location}-aiplatform.googleapis.com`;
|
|
21
|
+
};
|
|
22
|
+
export const requireProject = (value) => {
|
|
23
|
+
if (value)
|
|
24
|
+
return value;
|
|
25
|
+
throw new Error("Google Vertex requires a project when baseURL is not configured");
|
|
26
|
+
};
|
|
27
|
+
export const apiKey = (input) => {
|
|
28
|
+
if (input.apiKey !== undefined && (input.accessToken !== undefined || input.auth !== undefined))
|
|
29
|
+
throw new Error("Google Vertex apiKey cannot be combined with accessToken or auth");
|
|
30
|
+
if (input.accessToken !== undefined || input.auth !== undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
return input.apiKey ?? process.env.GOOGLE_VERTEX_API_KEY;
|
|
33
|
+
};
|
|
34
|
+
const adc = (project) => {
|
|
35
|
+
let client;
|
|
36
|
+
const loadClient = () => {
|
|
37
|
+
if (client)
|
|
38
|
+
return client;
|
|
39
|
+
client = import("google-auth-library").then(({ GoogleAuth }) => new GoogleAuth({ projectId: project, scopes: [SCOPE] }).getClient());
|
|
40
|
+
return client;
|
|
41
|
+
};
|
|
42
|
+
return Auth.effect(Effect.tryPromise({
|
|
43
|
+
try: async () => {
|
|
44
|
+
const token = await (await loadClient()).getAccessToken();
|
|
45
|
+
if (!token.token)
|
|
46
|
+
throw new Error("Google ADC returned an empty access token");
|
|
47
|
+
return Redacted.make(token.token);
|
|
48
|
+
},
|
|
49
|
+
catch: () => new MissingCredentialError("Google Application Default Credentials"),
|
|
50
|
+
})).bearer();
|
|
51
|
+
};
|
|
52
|
+
export const oauth = (input, project) => {
|
|
53
|
+
if (input.accessToken !== undefined && input.auth !== undefined)
|
|
54
|
+
throw new Error("Google Vertex accessToken cannot be combined with auth");
|
|
55
|
+
if (input.auth)
|
|
56
|
+
return input.auth;
|
|
57
|
+
if (input.accessToken !== undefined)
|
|
58
|
+
return Auth.bearer(input.accessToken);
|
|
59
|
+
return adc(project);
|
|
60
|
+
};
|
|
61
|
+
export * as GoogleVertexShared from "./google-vertex-shared.js";
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ProviderPackage } from "../provider-package.js";
|
|
2
|
+
import { Gemini } from "../protocols/gemini.js";
|
|
3
|
+
import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
4
|
+
import { type ModelID } from "../schema/index.js";
|
|
5
|
+
import { GoogleVertexShared } from "./google-vertex-shared.js";
|
|
6
|
+
export type GeminiOptionsInput = Gemini.OptionsInput;
|
|
7
|
+
export type GeminiProviderOptionsInput = Gemini.ProviderOptionsInput;
|
|
8
|
+
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
9
|
+
export type Config = RouteDefaultsInput & GoogleVertexShared.ApiKeyOptions & {
|
|
10
|
+
readonly baseURL?: string;
|
|
11
|
+
readonly location?: string;
|
|
12
|
+
readonly project?: string;
|
|
13
|
+
readonly providerOptions?: Gemini.ProviderOptionsInput;
|
|
14
|
+
};
|
|
15
|
+
export type Settings = ProviderPackage.Settings & ({
|
|
16
|
+
readonly accessToken?: string;
|
|
17
|
+
readonly apiKey?: never;
|
|
18
|
+
} | {
|
|
19
|
+
readonly accessToken?: never;
|
|
20
|
+
readonly apiKey?: string;
|
|
21
|
+
}) & {
|
|
22
|
+
readonly baseURL?: string;
|
|
23
|
+
readonly location?: string;
|
|
24
|
+
readonly project?: string;
|
|
25
|
+
readonly providerOptions?: Gemini.ProviderOptionsInput;
|
|
26
|
+
};
|
|
27
|
+
export declare const routes: Route<{
|
|
28
|
+
readonly contents: readonly {
|
|
29
|
+
readonly role: "user" | "model";
|
|
30
|
+
readonly parts: readonly ({
|
|
31
|
+
readonly inlineData: {
|
|
32
|
+
readonly mimeType: string;
|
|
33
|
+
readonly data: string;
|
|
34
|
+
};
|
|
35
|
+
} | {
|
|
36
|
+
readonly text: string;
|
|
37
|
+
readonly thought?: boolean | undefined;
|
|
38
|
+
readonly thoughtSignature?: string | undefined;
|
|
39
|
+
} | {
|
|
40
|
+
readonly functionCall: {
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly args: unknown;
|
|
43
|
+
readonly id?: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
readonly thoughtSignature?: string | undefined;
|
|
46
|
+
} | {
|
|
47
|
+
readonly functionResponse: {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly response: unknown;
|
|
50
|
+
readonly id?: string | undefined;
|
|
51
|
+
readonly parts?: readonly {
|
|
52
|
+
readonly inlineData: {
|
|
53
|
+
readonly mimeType: string;
|
|
54
|
+
readonly data: string;
|
|
55
|
+
};
|
|
56
|
+
}[] | undefined;
|
|
57
|
+
};
|
|
58
|
+
})[];
|
|
59
|
+
}[];
|
|
60
|
+
readonly tools?: readonly {
|
|
61
|
+
readonly functionDeclarations: readonly {
|
|
62
|
+
readonly description: string;
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly parameters?: {
|
|
65
|
+
readonly [x: string]: unknown;
|
|
66
|
+
} | undefined;
|
|
67
|
+
}[];
|
|
68
|
+
}[] | undefined;
|
|
69
|
+
readonly toolConfig?: {
|
|
70
|
+
readonly functionCallingConfig: {
|
|
71
|
+
readonly mode: "AUTO" | "NONE" | "ANY";
|
|
72
|
+
readonly allowedFunctionNames?: readonly string[] | undefined;
|
|
73
|
+
};
|
|
74
|
+
} | undefined;
|
|
75
|
+
readonly cachedContent?: string | undefined;
|
|
76
|
+
readonly safetySettings?: readonly {
|
|
77
|
+
readonly category: string;
|
|
78
|
+
readonly threshold: string;
|
|
79
|
+
}[] | undefined;
|
|
80
|
+
readonly serviceTier?: string | undefined;
|
|
81
|
+
readonly systemInstruction?: {
|
|
82
|
+
readonly parts: readonly {
|
|
83
|
+
readonly text: string;
|
|
84
|
+
}[];
|
|
85
|
+
} | undefined;
|
|
86
|
+
readonly generationConfig?: {
|
|
87
|
+
readonly temperature?: number | undefined;
|
|
88
|
+
readonly topP?: number | undefined;
|
|
89
|
+
readonly topK?: number | undefined;
|
|
90
|
+
readonly frequencyPenalty?: number | undefined;
|
|
91
|
+
readonly presencePenalty?: number | undefined;
|
|
92
|
+
readonly seed?: number | undefined;
|
|
93
|
+
readonly stopSequences?: readonly string[] | undefined;
|
|
94
|
+
readonly thinkingConfig?: {
|
|
95
|
+
readonly thinkingBudget?: number | undefined;
|
|
96
|
+
readonly includeThoughts?: boolean | undefined;
|
|
97
|
+
readonly thinkingLevel?: string | undefined;
|
|
98
|
+
} | undefined;
|
|
99
|
+
readonly maxOutputTokens?: number | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>[];
|
|
102
|
+
export declare const configure: (input?: Config) => {
|
|
103
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
104
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.ProviderOptionsInput>;
|
|
105
|
+
configure: (input?: Config) => /*elided*/ any;
|
|
106
|
+
};
|
|
107
|
+
export declare const provider: {
|
|
108
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
109
|
+
configure: (input?: Config) => {
|
|
110
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
111
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.ProviderOptionsInput>;
|
|
112
|
+
configure: /*elided*/ any;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export declare const model: ProviderPackage.Definition<Settings, Gemini.ProviderOptionsInput>["model"];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Gemini } from "../protocols/gemini.js";
|
|
2
|
+
import { Auth } from "../route/auth.js";
|
|
3
|
+
import { Route } from "../route/client.js";
|
|
4
|
+
import { Endpoint } from "../route/endpoint.js";
|
|
5
|
+
import { Framing } from "../route/framing.js";
|
|
6
|
+
import { ProviderID } from "../schema/index.js";
|
|
7
|
+
import { GoogleVertexShared } from "./google-vertex-shared.js";
|
|
8
|
+
export const id = ProviderID.make("google-vertex");
|
|
9
|
+
const route = Route.make({
|
|
10
|
+
id: "google-vertex-gemini",
|
|
11
|
+
provider: id,
|
|
12
|
+
providerMetadataKey: "google",
|
|
13
|
+
protocol: Gemini.protocol,
|
|
14
|
+
endpoint: Endpoint.path(({ request }) => {
|
|
15
|
+
const model = String(request.model.id);
|
|
16
|
+
return `/${model.startsWith("endpoints/") ? model : `models/${model}`}:streamGenerateContent?alt=sse`;
|
|
17
|
+
}),
|
|
18
|
+
auth: Auth.none,
|
|
19
|
+
framing: Framing.sse,
|
|
20
|
+
});
|
|
21
|
+
export const routes = [route];
|
|
22
|
+
const configuredRoute = (input, modelID) => {
|
|
23
|
+
const { accessToken: _accessToken, apiKey: _apiKey, auth: _auth, baseURL, location: inputLocation, project: inputProject, ...rest } = input;
|
|
24
|
+
const apiKey = GoogleVertexShared.apiKey(input);
|
|
25
|
+
const endpointModel = String(modelID).startsWith("endpoints/");
|
|
26
|
+
if (apiKey !== undefined && endpointModel)
|
|
27
|
+
throw new Error("Google Vertex tuned models do not support Express Mode API keys");
|
|
28
|
+
const location = GoogleVertexShared.location(inputLocation, "us-central1");
|
|
29
|
+
const project = GoogleVertexShared.project(inputProject);
|
|
30
|
+
const endpoint = baseURL ??
|
|
31
|
+
(apiKey
|
|
32
|
+
? "https://aiplatform.googleapis.com/v1/publishers/google"
|
|
33
|
+
: `https://${GoogleVertexShared.host(location)}/v1beta1/projects/${GoogleVertexShared.requireProject(project)}/locations/${location}${endpointModel ? "" : "/publishers/google"}`);
|
|
34
|
+
return route.with({
|
|
35
|
+
...rest,
|
|
36
|
+
endpoint: { baseURL: endpoint },
|
|
37
|
+
auth: apiKey === undefined ? GoogleVertexShared.oauth(input, project) : Auth.header("x-goog-api-key", apiKey),
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
export const configure = (input = {}) => {
|
|
41
|
+
return {
|
|
42
|
+
id,
|
|
43
|
+
model: (modelID) => configuredRoute(input, modelID).model({ id: modelID }),
|
|
44
|
+
configure,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export const provider = {
|
|
48
|
+
id,
|
|
49
|
+
configure,
|
|
50
|
+
};
|
|
51
|
+
export const model = (modelID, settings) => {
|
|
52
|
+
if (settings.apiKey !== undefined && settings.accessToken !== undefined)
|
|
53
|
+
throw new Error("Google Vertex apiKey cannot be combined with accessToken or auth");
|
|
54
|
+
return configure({
|
|
55
|
+
...(settings.apiKey === undefined ? { accessToken: settings.accessToken } : { apiKey: settings.apiKey }),
|
|
56
|
+
baseURL: settings.baseURL,
|
|
57
|
+
headers: settings.headers === undefined ? undefined : { ...settings.headers },
|
|
58
|
+
http: settings.body === undefined ? undefined : { body: { ...settings.body } },
|
|
59
|
+
limits: settings.limits,
|
|
60
|
+
location: settings.location,
|
|
61
|
+
project: settings.project,
|
|
62
|
+
providerOptions: settings.providerOptions,
|
|
63
|
+
}).model(modelID);
|
|
64
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { RouteDefaultsInput } from "../route/client.js";
|
|
2
|
+
import type { ProviderAuthOption } from "../route/auth-options.js";
|
|
3
|
+
import type { ProviderPackage } from "../provider-package.js";
|
|
4
|
+
import { type ModelID } from "../schema/index.js";
|
|
5
|
+
import { Gemini } from "../protocols/gemini.js";
|
|
6
|
+
export type { GoogleImageOptions } from "../protocols/google-images.js";
|
|
7
|
+
export type GeminiOptionsInput = Gemini.OptionsInput;
|
|
8
|
+
export type GeminiProviderOptionsInput = Gemini.ProviderOptionsInput;
|
|
9
|
+
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
10
|
+
export declare const routes: import("../route/client.js").Route<{
|
|
11
|
+
readonly contents: readonly {
|
|
12
|
+
readonly role: "user" | "model";
|
|
13
|
+
readonly parts: readonly ({
|
|
14
|
+
readonly inlineData: {
|
|
15
|
+
readonly mimeType: string;
|
|
16
|
+
readonly data: string;
|
|
17
|
+
};
|
|
18
|
+
} | {
|
|
19
|
+
readonly text: string;
|
|
20
|
+
readonly thought?: boolean | undefined;
|
|
21
|
+
readonly thoughtSignature?: string | undefined;
|
|
22
|
+
} | {
|
|
23
|
+
readonly functionCall: {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly args: unknown;
|
|
26
|
+
readonly id?: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
readonly thoughtSignature?: string | undefined;
|
|
29
|
+
} | {
|
|
30
|
+
readonly functionResponse: {
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly response: unknown;
|
|
33
|
+
readonly id?: string | undefined;
|
|
34
|
+
readonly parts?: readonly {
|
|
35
|
+
readonly inlineData: {
|
|
36
|
+
readonly mimeType: string;
|
|
37
|
+
readonly data: string;
|
|
38
|
+
};
|
|
39
|
+
}[] | undefined;
|
|
40
|
+
};
|
|
41
|
+
})[];
|
|
42
|
+
}[];
|
|
43
|
+
readonly tools?: readonly {
|
|
44
|
+
readonly functionDeclarations: readonly {
|
|
45
|
+
readonly description: string;
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly parameters?: {
|
|
48
|
+
readonly [x: string]: unknown;
|
|
49
|
+
} | undefined;
|
|
50
|
+
}[];
|
|
51
|
+
}[] | undefined;
|
|
52
|
+
readonly toolConfig?: {
|
|
53
|
+
readonly functionCallingConfig: {
|
|
54
|
+
readonly mode: "AUTO" | "NONE" | "ANY";
|
|
55
|
+
readonly allowedFunctionNames?: readonly string[] | undefined;
|
|
56
|
+
};
|
|
57
|
+
} | undefined;
|
|
58
|
+
readonly cachedContent?: string | undefined;
|
|
59
|
+
readonly safetySettings?: readonly {
|
|
60
|
+
readonly category: string;
|
|
61
|
+
readonly threshold: string;
|
|
62
|
+
}[] | undefined;
|
|
63
|
+
readonly serviceTier?: string | undefined;
|
|
64
|
+
readonly systemInstruction?: {
|
|
65
|
+
readonly parts: readonly {
|
|
66
|
+
readonly text: string;
|
|
67
|
+
}[];
|
|
68
|
+
} | undefined;
|
|
69
|
+
readonly generationConfig?: {
|
|
70
|
+
readonly temperature?: number | undefined;
|
|
71
|
+
readonly topP?: number | undefined;
|
|
72
|
+
readonly topK?: number | undefined;
|
|
73
|
+
readonly frequencyPenalty?: number | undefined;
|
|
74
|
+
readonly presencePenalty?: number | undefined;
|
|
75
|
+
readonly seed?: number | undefined;
|
|
76
|
+
readonly stopSequences?: readonly string[] | undefined;
|
|
77
|
+
readonly thinkingConfig?: {
|
|
78
|
+
readonly thinkingBudget?: number | undefined;
|
|
79
|
+
readonly includeThoughts?: boolean | undefined;
|
|
80
|
+
readonly thinkingLevel?: string | undefined;
|
|
81
|
+
} | undefined;
|
|
82
|
+
readonly maxOutputTokens?: number | undefined;
|
|
83
|
+
} | undefined;
|
|
84
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>[];
|
|
85
|
+
export type Config = RouteDefaultsInput & ProviderAuthOption<"optional"> & {
|
|
86
|
+
readonly baseURL?: string;
|
|
87
|
+
readonly providerOptions?: Gemini.ProviderOptionsInput;
|
|
88
|
+
};
|
|
89
|
+
export interface Settings extends ProviderPackage.Settings {
|
|
90
|
+
readonly apiKey?: string;
|
|
91
|
+
readonly baseURL?: string;
|
|
92
|
+
readonly providerOptions?: Gemini.ProviderOptionsInput;
|
|
93
|
+
}
|
|
94
|
+
export declare const configure: (input?: Config) => {
|
|
95
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
96
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.ProviderOptionsInput>;
|
|
97
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
98
|
+
configure: (input?: Config) => /*elided*/ any;
|
|
99
|
+
};
|
|
100
|
+
export declare const provider: {
|
|
101
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
102
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.ProviderOptionsInput>;
|
|
103
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
104
|
+
configure: (input?: Config) => {
|
|
105
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
106
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.ProviderOptionsInput>;
|
|
107
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
108
|
+
configure: /*elided*/ any;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
export declare const model: ProviderPackage.Definition<Settings, Gemini.ProviderOptionsInput>["model"];
|
|
112
|
+
export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Auth } from "../route/auth.js";
|
|
2
|
+
import { HttpOptions, ProviderID, mergeHttpOptions } from "../schema/index.js";
|
|
3
|
+
import { Gemini } from "../protocols/gemini.js";
|
|
4
|
+
import { GoogleImages } from "../protocols/google-images.js";
|
|
5
|
+
export const id = ProviderID.make("google");
|
|
6
|
+
export const routes = [Gemini.route];
|
|
7
|
+
const auth = (options) => {
|
|
8
|
+
if ("auth" in options && options.auth)
|
|
9
|
+
return options.auth;
|
|
10
|
+
return Auth.optional("apiKey" in options ? options.apiKey : undefined, "apiKey")
|
|
11
|
+
.orElse(Auth.config("GOOGLE_GENERATIVE_AI_API_KEY"))
|
|
12
|
+
.pipe(Auth.header("x-goog-api-key"));
|
|
13
|
+
};
|
|
14
|
+
const configuredRoute = (input) => {
|
|
15
|
+
const { apiKey: _, auth: _auth, baseURL, ...rest } = input;
|
|
16
|
+
return Gemini.route.with({ ...rest, endpoint: { baseURL }, auth: auth(input) });
|
|
17
|
+
};
|
|
18
|
+
export const configure = (input = {}) => {
|
|
19
|
+
const route = configuredRoute(input);
|
|
20
|
+
const image = (modelID) => GoogleImages.model({
|
|
21
|
+
id: modelID,
|
|
22
|
+
auth: auth(input),
|
|
23
|
+
baseURL: input.baseURL,
|
|
24
|
+
headers: input.headers,
|
|
25
|
+
http: mergeHttpOptions(input.http === undefined ? undefined : HttpOptions.make(input.http)),
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
id,
|
|
29
|
+
model: (modelID) => route.model({ id: modelID }),
|
|
30
|
+
image,
|
|
31
|
+
configure,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export const provider = configure();
|
|
35
|
+
export const model = (modelID, settings) => configure({
|
|
36
|
+
apiKey: settings.apiKey,
|
|
37
|
+
baseURL: settings.baseURL,
|
|
38
|
+
headers: settings.headers === undefined ? undefined : { ...settings.headers },
|
|
39
|
+
http: settings.body === undefined ? undefined : { body: { ...settings.body } },
|
|
40
|
+
limits: settings.limits,
|
|
41
|
+
providerOptions: settings.providerOptions,
|
|
42
|
+
}).model(modelID);
|
|
43
|
+
export const image = provider.image;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * as Anthropic from "./anthropic.js";
|
|
2
|
+
export * as AnthropicCompatible from "./anthropic-compatible.js";
|
|
3
|
+
export * as AmazonBedrock from "./amazon-bedrock.js";
|
|
4
|
+
export * as AmazonBedrockMantle from "./amazon-bedrock-mantle.js";
|
|
5
|
+
export * as Azure from "./azure.js";
|
|
6
|
+
export * as Cloudflare from "./cloudflare.js";
|
|
7
|
+
export { CloudflareAIGateway, CloudflareWorkersAI } from "./cloudflare.js";
|
|
8
|
+
export * as Google from "./google.js";
|
|
9
|
+
export * as GoogleVertex from "./google-vertex.js";
|
|
10
|
+
export * as GoogleVertexChat from "./google-vertex-chat.js";
|
|
11
|
+
export * as GoogleVertexMessages from "./google-vertex-messages.js";
|
|
12
|
+
export * as GoogleVertexResponses from "./google-vertex-responses.js";
|
|
13
|
+
export * as OpenAI from "./openai.js";
|
|
14
|
+
export * as OpenAICompatible from "./openai-compatible.js";
|
|
15
|
+
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js";
|
|
16
|
+
export * as OpenRouter from "./openrouter.js";
|
|
17
|
+
export * as XAI from "./xai.js";
|
|
18
|
+
export * as ZAI from "./zai.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * as Anthropic from "./anthropic.js";
|
|
2
|
+
export * as AnthropicCompatible from "./anthropic-compatible.js";
|
|
3
|
+
export * as AmazonBedrock from "./amazon-bedrock.js";
|
|
4
|
+
export * as AmazonBedrockMantle from "./amazon-bedrock-mantle.js";
|
|
5
|
+
export * as Azure from "./azure.js";
|
|
6
|
+
export * as Cloudflare from "./cloudflare.js";
|
|
7
|
+
export { CloudflareAIGateway, CloudflareWorkersAI } from "./cloudflare.js";
|
|
8
|
+
export * as Google from "./google.js";
|
|
9
|
+
export * as GoogleVertex from "./google-vertex.js";
|
|
10
|
+
export * as GoogleVertexChat from "./google-vertex-chat.js";
|
|
11
|
+
export * as GoogleVertexMessages from "./google-vertex-messages.js";
|
|
12
|
+
export * as GoogleVertexResponses from "./google-vertex-responses.js";
|
|
13
|
+
export * as OpenAI from "./openai.js";
|
|
14
|
+
export * as OpenAICompatible from "./openai-compatible.js";
|
|
15
|
+
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js";
|
|
16
|
+
export * as OpenRouter from "./openrouter.js";
|
|
17
|
+
export * as XAI from "./xai.js";
|
|
18
|
+
export * as ZAI from "./zai.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ResponseIncludable, ServiceTier } from "../protocols/utils/open-responses-options.js";
|
|
2
|
+
import type { ProviderOptions, ReasoningEffort, TextVerbosity } from "../schema/index.js";
|
|
3
|
+
export interface OpenResponsesOptionsInput {
|
|
4
|
+
readonly [key: string]: unknown;
|
|
5
|
+
readonly instructions?: string;
|
|
6
|
+
readonly store?: boolean;
|
|
7
|
+
readonly reasoningEffort?: ReasoningEffort;
|
|
8
|
+
readonly reasoningSummary?: "auto" | "concise" | "detailed";
|
|
9
|
+
readonly include?: ReadonlyArray<ResponseIncludable>;
|
|
10
|
+
readonly textVerbosity?: TextVerbosity;
|
|
11
|
+
readonly serviceTier?: ServiceTier;
|
|
12
|
+
}
|
|
13
|
+
export type OpenResponsesProviderOptionsInput = ProviderOptions & {
|
|
14
|
+
readonly openresponses?: OpenResponsesOptionsInput;
|
|
15
|
+
};
|
|
16
|
+
export * as OpenResponsesProviderOptions from "./open-responses-options.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as OpenResponsesProviderOptions from "./open-responses-options.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { chatModel as model } from "../openai.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { model } from "../openai.js";
|