@opencode/ai 0.0.0-dev-19580 → 0.0.0-dev-19583

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.
@@ -346,7 +346,7 @@ const lowerToolCall = (part, providerMetadataKey) => {
346
346
  call_id: part.id,
347
347
  name: part.name,
348
348
  namespace: part.namespace,
349
- arguments: ProviderShared.encodeJson(part.input),
349
+ arguments: ProviderShared.encodeJson(part.input === undefined ? {} : part.input),
350
350
  };
351
351
  };
352
352
  const lowerReasoning = (part, providerMetadataKey) => {
@@ -200,14 +200,17 @@ const lowerToolCall = (part, options) => ({
200
200
  type: "function",
201
201
  function: {
202
202
  name: part.name,
203
- arguments: ProviderShared.encodeJson(part.input),
203
+ arguments: ProviderShared.encodeJson(part.input === undefined ? {} : part.input),
204
204
  },
205
205
  });
206
206
  const lowerMedia = Effect.fn("OpenAIChat.lowerMedia")(function* (part) {
207
207
  const media = ProviderShared.normalizeMedia(part);
208
208
  if (!media.mime.startsWith("image/"))
209
209
  return yield* ProviderShared.invalidRequest(`OpenAI Chat does not support media type ${part.mediaType}`);
210
- return { type: "image_url", image_url: { url: media.dataUrl } };
210
+ const url = typeof part.data === "string" && (part.data.startsWith("https://") || part.data.startsWith("http://"))
211
+ ? part.data
212
+ : media.dataUrl;
213
+ return { type: "image_url", image_url: { url } };
211
214
  });
212
215
  const openAICompatibleReasoningContent = (native) => isRecord(native) && typeof native.reasoning_content === "string" ? native.reasoning_content : undefined;
213
216
  const reasoningField = (part, providerMetadataKey) => {
@@ -9,7 +9,7 @@ import { ProviderConfigurationError, ProviderID } from "../schema/index.js";
9
9
  import { GoogleVertexShared } from "./google-vertex-shared.js";
10
10
  export const id = ProviderID.make("google-vertex");
11
11
  const fromRequest = Effect.fn("GoogleVertex.fromRequest")(function* (request) {
12
- const body = yield* Gemini.protocol.body.from(request);
12
+ const { serviceTier: _, ...body } = yield* Gemini.protocol.body.from(request);
13
13
  // Vertex's native REST schema rejects `id` on FunctionCall/FunctionResponse parts with HTTP 400,
14
14
  // unlike AI Studio, so history minted there cannot be lowered verbatim.
15
15
  const contents = body.contents.map((content) => ({
@@ -45,6 +45,10 @@ const route = Route.make({
45
45
  return `/${model.startsWith("endpoints/") ? model : `models/${model}`}:streamGenerateContent?alt=sse`;
46
46
  }),
47
47
  auth: Auth.none,
48
+ headers: ({ request }) => {
49
+ const serviceTier = request.providerOptions?.serviceTier;
50
+ return typeof serviceTier === "string" ? { "x-vertex-ai-llm-shared-request-type": serviceTier } : {};
51
+ },
48
52
  framing: Framing.sse,
49
53
  });
50
54
  export const routes = [route];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "0.0.0-dev-19580",
3
+ "version": "0.0.0-dev-19583",
4
4
  "name": "@opencode/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "devDependencies": {
31
31
  "@clack/prompts": "1.0.0-alpha.1",
32
32
  "@effect/platform-node": "4.0.0-rc.112",
33
- "@opencode/http-recorder": "0.0.0-dev-19580",
33
+ "@opencode/http-recorder": "0.0.0-dev-19583",
34
34
  "@tsconfig/bun": "1.0.9",
35
35
  "@types/bun": "1.4.0",
36
36
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -40,7 +40,7 @@
40
40
  "@aws-sdk/credential-providers": "3.1057.0",
41
41
  "@smithy/eventstream-codec": "4.2.14",
42
42
  "@smithy/util-utf8": "4.2.2",
43
- "@opencode/schema": "0.0.0-dev-19580",
43
+ "@opencode/schema": "0.0.0-dev-19583",
44
44
  "aws4fetch": "1.0.20",
45
45
  "effect": "4.0.0-rc.112",
46
46
  "google-auth-library": "10.5.0"