Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cli/src/capture/contentExtractor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ describe("captionImagesWithGemini — Vertex AI provider", () => {
expect(clientOptions[0]).toMatchObject({
vertexai: true,
project: "prefab-kit-000000",
location: "us-central1",
location: "global",
googleAuthOptions: { credentials: JSON.parse(SERVICE_ACCOUNT) },
});
expect(clientOptions[0]).not.toHaveProperty("apiKey");
Expand Down Expand Up @@ -579,7 +579,7 @@ describe("captionImagesWithGemini — Vertex AI provider", () => {
expect(generateContentMock).toHaveBeenCalledTimes(1);
expect(thinkingConfig).toEqual({ thinkingBudget: 0 });
// The API's flash-lite preview id is not resolvable on Vertex, so the default differs.
expect(model).toBe("gemini-2.5-flash");
expect(model).toBe("gemini-3.1-flash-lite");
});

it("skips captioning when the service account is unparseable, without echoing it", async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/capture/contentExtractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export async function captionImagesWithGemini(
// the API's flash-lite preview id is not resolvable there — so it carries its own default.
const model = {
openrouter: process.env.HYPERFRAMES_OPENROUTER_MODEL || "google/gemini-3.1-flash-lite",
vertex: process.env.HYPERFRAMES_VERTEX_MODEL || "gemini-2.5-flash",
vertex: process.env.HYPERFRAMES_VERTEX_MODEL || "gemini-3.1-flash-lite",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocker: with this default, the id won't resolve at the default location. Google's page lists gemini-3.1-flash-lite only on global and the us/eu multi-regions, with no single region. The client below still defaults to location: process.env.HYPERFRAMES_VERTEX_LOCATION || "us-central1" (around line 394). So the setup this PR targets (HYPERFRAMES_VERTEX_PROJECT_ID and HYPERFRAMES_VERTEX_SERVICE_ACCOUNT set, no location) still sends every caption request to a model us-central1 doesn't serve. Captioning keeps failing, now with a not-found error instead of a retired-model error. Default the location to "global", and pin the location the client is built with in the Vertex default test. @google/genai accepts global.

gemini: process.env.HYPERFRAMES_GEMINI_MODEL || "gemini-3.1-flash-lite-preview",
}[provider];
const requestTimeoutMs = resolveVisionRequestTimeoutMs();
Expand Down Expand Up @@ -391,7 +391,7 @@ export async function captionImagesWithGemini(
ai = new GoogleGenAI({
vertexai: true,
project: vertexProject,
location: process.env.HYPERFRAMES_VERTEX_LOCATION || "us-central1",
location: process.env.HYPERFRAMES_VERTEX_LOCATION || "global",
googleAuthOptions: { credentials },
});
} else {
Expand Down