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
507 changes: 490 additions & 17 deletions packages/commands/src/commands/vision/describe.ts

Large diffs are not rendered by default.

35 changes: 34 additions & 1 deletion packages/commands/tests/e2e/vision-describe.e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { writeFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, test } from "vite-plus/test";
import { makeE2eOutputDir, parseStdoutJson, runCommandE2e } from "./helpers.ts";
import {
makeE2eOutputDir,
parseStdoutJson,
runCommandE2e,
runCommandInProcess,
} from "./helpers.ts";
import { VISION_ROUTES } from "./topic-routes.ts";

describe("e2e: vision describe", () => {
Expand Down Expand Up @@ -42,4 +47,32 @@ describe("e2e: vision describe", () => {
const data = parseStdoutJson<{ request?: { model?: string } }>(stdout);
expect(data.request?.model).toBe("qwen3.8-max");
});

// Baseline for the OCR flag work: the legacy dry-run summary must stay
// key-for-key identical when none of the new flags are passed. This is the
// gate the OCR suite compares against, so it lives with the subprocess case
// that remains this topic's representative process-boundary test.
test("dry-run 摘要在不使用新参数时保持既有形状", async () => {
const { stdout, stderr, exitCode } = await runCommandInProcess(VISION_ROUTES, [
"vision",
"describe",
"--image",
"https://example.com/image.png",
"--api-key",
"sk-e2e",
"--base-url",
"https://dashscope.aliyuncs.com",
"--dry-run",
"--output",
"json",
"--quiet",
]);
expect(exitCode, stderr).toBe(0);
const data = parseStdoutJson<{ request?: Record<string, unknown> }>(stdout);
expect(data.request).toEqual({
prompt: "Describe the image.",
image: "https://example.com/image.png",
model: "qwen3-vl-plus",
});
});
});
Loading