@opencode-ai/ai 0.0.0-next-15646 → 0.0.0-next-15647

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 CHANGED
@@ -128,11 +128,12 @@ OpenAI Chat and OpenAI Responses are separate semantic entrypoints:
128
128
  - `@opencode-ai/ai/providers/openai-compatible/responses`
129
129
  - `@opencode-ai/ai/providers/anthropic-compatible`
130
130
  - `@opencode-ai/ai/providers/google-vertex/gemini`
131
+ - `@opencode-ai/ai/providers/google-vertex/chat`
131
132
  - `@opencode-ai/ai/providers/google-vertex/messages`
132
133
 
133
134
  Responses HTTP versus WebSocket is a scoped `transport` setting on the OpenAI Responses entrypoint, not another entrypoint. Azure follows the same Chat/Responses split at `providers/azure/chat` and `providers/azure/responses`. Generic OpenAI-compatible Chat remains at `providers/openai-compatible`; compatible Responses is separate at `providers/openai-compatible/responses`. Generic Anthropic Messages-compatible providers use `providers/anthropic-compatible`, which the named Anthropic provider composes. Google Gemini and Amazon Bedrock expose their single native API through their existing provider paths.
134
135
 
135
- Vertex Gemini and Vertex Messages are separate API entrypoints. Both accept `project`, `location`, and an optional `accessToken`; when no explicit token or auth override is supplied they lazily use Google Application Default Credentials. Vertex Gemini instead selects express mode when `apiKey` or `GOOGLE_VERTEX_API_KEY` is present. `providers/google-vertex` remains the default alias for `providers/google-vertex/gemini`.
136
+ Vertex Gemini, Vertex Chat, and Vertex Messages are separate API entrypoints. All accept `project`, `location`, and an optional `accessToken`; when no explicit token or auth override is supplied they lazily use Google Application Default Credentials. Vertex Gemini instead selects express mode when `apiKey` or `GOOGLE_VERTEX_API_KEY` is present. Vertex Chat targets MaaS models through the OpenAI-compatible Chat Completions endpoint. `providers/google-vertex` remains the default alias for `providers/google-vertex/gemini`.
136
137
 
137
138
  Tuned Vertex Gemini deployments use model ids shaped like `endpoints/1234567890` and require OAuth or ADC; Vertex express-mode API keys support publisher models only.
138
139
 
@@ -142,6 +143,12 @@ import { model } from "@opencode-ai/ai/providers/google-vertex/gemini"
142
143
  model("gemini-3.5-flash", { project: "my-project", location: "global" })
143
144
  ```
144
145
 
146
+ ```ts
147
+ import { model } from "@opencode-ai/ai/providers/google-vertex/chat"
148
+
149
+ model("deepseek-ai/deepseek-v3.2-maas", { project: "my-project", location: "global" })
150
+ ```
151
+
145
152
  ```ts
146
153
  import { model } from "@opencode-ai/ai/providers/google-vertex/messages"
147
154
 
@@ -0,0 +1,2 @@
1
+ export { model } from "../google-vertex-chat";
2
+ export type { Settings } from "../google-vertex-chat";
@@ -0,0 +1 @@
1
+ export { model } from "../google-vertex-chat";
@@ -0,0 +1,95 @@
1
+ import type { ProviderPackage } from "../provider-package";
2
+ import type { RouteDefaultsInput } from "../route/client";
3
+ import { type ModelID, type ProviderOptions } from "../schema";
4
+ import { GoogleVertexShared } from "./google-vertex-shared";
5
+ export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
6
+ export type Config = RouteDefaultsInput & GoogleVertexShared.OAuthOptions & {
7
+ readonly baseURL?: string;
8
+ readonly location?: string;
9
+ readonly project?: string;
10
+ };
11
+ export interface Settings extends ProviderPackage.Settings {
12
+ readonly accessToken?: string;
13
+ readonly apiKey?: never;
14
+ readonly baseURL?: string;
15
+ readonly location?: string;
16
+ readonly project?: string;
17
+ readonly providerOptions?: ProviderOptions;
18
+ }
19
+ export declare const routes: import("../route").Route<{
20
+ readonly model: string;
21
+ readonly messages: readonly ({
22
+ readonly role: "system";
23
+ readonly content: string;
24
+ } | {
25
+ readonly role: "user";
26
+ readonly content: string | readonly ({
27
+ readonly type: "text";
28
+ readonly text: string;
29
+ } | {
30
+ readonly type: "image_url";
31
+ readonly image_url: {
32
+ readonly url: string;
33
+ };
34
+ })[];
35
+ } | {
36
+ readonly role: "assistant";
37
+ readonly content: string | null;
38
+ readonly tool_calls?: readonly {
39
+ readonly id: string;
40
+ readonly type: "function";
41
+ readonly function: {
42
+ readonly name: string;
43
+ readonly arguments: string;
44
+ };
45
+ }[] | undefined;
46
+ readonly reasoning_content?: string | undefined;
47
+ } | {
48
+ readonly role: "tool";
49
+ readonly tool_call_id: string;
50
+ readonly content: string;
51
+ })[];
52
+ readonly stream: true;
53
+ readonly tools?: readonly {
54
+ readonly type: "function";
55
+ readonly function: {
56
+ readonly name: string;
57
+ readonly description: string;
58
+ readonly parameters: {
59
+ readonly [x: string]: unknown;
60
+ };
61
+ };
62
+ }[] | undefined;
63
+ readonly tool_choice?: "required" | "none" | "auto" | {
64
+ readonly type: "function";
65
+ readonly function: {
66
+ readonly name: string;
67
+ };
68
+ } | undefined;
69
+ readonly stream_options?: {
70
+ readonly include_usage: boolean;
71
+ } | undefined;
72
+ readonly store?: boolean | undefined;
73
+ readonly reasoning_effort?: string | undefined;
74
+ readonly max_tokens?: number | undefined;
75
+ readonly temperature?: number | undefined;
76
+ readonly top_p?: number | undefined;
77
+ readonly frequency_penalty?: number | undefined;
78
+ readonly presence_penalty?: number | undefined;
79
+ readonly seed?: number | undefined;
80
+ readonly stop?: readonly string[] | undefined;
81
+ }, import("../route/transport/http").HttpPrepared<string>>[];
82
+ export declare const configure: (input?: Config) => {
83
+ id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
84
+ model: (modelID: string | ModelID) => import("..").Model;
85
+ configure: (input?: Config) => /*elided*/ any;
86
+ };
87
+ export declare const provider: {
88
+ id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
89
+ configure: (input?: Config) => {
90
+ id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
91
+ model: (modelID: string | ModelID) => import("..").Model;
92
+ configure: /*elided*/ any;
93
+ };
94
+ };
95
+ export declare const model: ProviderPackage.Definition<Settings>["model"];
@@ -0,0 +1,50 @@
1
+ import { OpenAICompatibleChat } from "../protocols/openai-compatible-chat";
2
+ import { ProviderID } from "../schema";
3
+ import { GoogleVertexShared } from "./google-vertex-shared";
4
+ export const id = ProviderID.make("google-vertex");
5
+ const route = OpenAICompatibleChat.route.with({
6
+ id: "google-vertex-chat",
7
+ provider: id,
8
+ });
9
+ export const routes = [route];
10
+ const configuredRoute = (input) => {
11
+ if ("apiKey" in input && input.apiKey !== undefined)
12
+ throw new Error("Google Vertex Chat does not support API keys");
13
+ const { accessToken: _accessToken, auth: _auth, baseURL, location: inputLocation, project: inputProject, ...rest } = input;
14
+ const location = GoogleVertexShared.location(inputLocation, "global");
15
+ const project = GoogleVertexShared.project(inputProject);
16
+ return route.with({
17
+ ...rest,
18
+ endpoint: {
19
+ baseURL: baseURL ??
20
+ `https://aiplatform.googleapis.com/v1/projects/${GoogleVertexShared.requireProject(project)}/locations/${location}/endpoints/openapi`,
21
+ },
22
+ auth: GoogleVertexShared.oauth(input, project),
23
+ });
24
+ };
25
+ export const configure = (input = {}) => {
26
+ const route = configuredRoute(input);
27
+ return {
28
+ id,
29
+ model: (modelID) => route.model({ id: modelID }),
30
+ configure,
31
+ };
32
+ };
33
+ export const provider = {
34
+ id,
35
+ configure,
36
+ };
37
+ export const model = (modelID, settings) => {
38
+ if (settings.apiKey !== undefined)
39
+ throw new Error("Google Vertex Chat does not support API keys");
40
+ return configure({
41
+ accessToken: settings.accessToken,
42
+ baseURL: settings.baseURL,
43
+ headers: settings.headers === undefined ? undefined : { ...settings.headers },
44
+ http: settings.body === undefined ? undefined : { body: { ...settings.body } },
45
+ limits: settings.limits,
46
+ location: settings.location,
47
+ project: settings.project,
48
+ providerOptions: settings.providerOptions,
49
+ }).model(modelID);
50
+ };
@@ -7,6 +7,7 @@ export { CloudflareAIGateway, CloudflareWorkersAI } from "./cloudflare";
7
7
  export * as GitHubCopilot from "./github-copilot";
8
8
  export * as Google from "./google";
9
9
  export * as GoogleVertex from "./google-vertex";
10
+ export * as GoogleVertexChat from "./google-vertex-chat";
10
11
  export * as GoogleVertexMessages from "./google-vertex-messages";
11
12
  export * as OpenAI from "./openai";
12
13
  export * as OpenAICompatible from "./openai-compatible";
@@ -7,6 +7,7 @@ export { CloudflareAIGateway, CloudflareWorkersAI } from "./cloudflare";
7
7
  export * as GitHubCopilot from "./github-copilot";
8
8
  export * as Google from "./google";
9
9
  export * as GoogleVertex from "./google-vertex";
10
+ export * as GoogleVertexChat from "./google-vertex-chat";
10
11
  export * as GoogleVertexMessages from "./google-vertex-messages";
11
12
  export * as OpenAI from "./openai";
12
13
  export * as OpenAICompatible from "./openai-compatible";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "0.0.0-next-15646",
3
+ "version": "0.0.0-next-15647",
4
4
  "name": "@opencode-ai/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -26,7 +26,7 @@
26
26
  "devDependencies": {
27
27
  "@clack/prompts": "1.0.0-alpha.1",
28
28
  "@effect/platform-node": "4.0.0-beta.83",
29
- "@opencode-ai/http-recorder": "0.0.0-next-15646",
29
+ "@opencode-ai/http-recorder": "0.0.0-next-15647",
30
30
  "@tsconfig/bun": "1.0.9",
31
31
  "@types/bun": "1.3.13",
32
32
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@smithy/eventstream-codec": "4.2.14",
37
37
  "@smithy/util-utf8": "4.2.2",
38
- "@opencode-ai/schema": "0.0.0-next-15646",
38
+ "@opencode-ai/schema": "0.0.0-next-15647",
39
39
  "aws4fetch": "1.0.20",
40
40
  "effect": "4.0.0-beta.83",
41
41
  "google-auth-library": "10.5.0"