-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopencode-vision.example.jsonc
More file actions
84 lines (77 loc) · 6.46 KB
/
Copy pathopencode-vision.example.jsonc
File metadata and controls
84 lines (77 loc) · 6.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// opencode-vision.example.jsonc
// Full example configuration for the opencode-vision plugin.
// Copy to your project as .opencode/opencode-vision.jsonc or
// user-level as ~/.config/opencode/opencode-vision.jsonc
{
// ─────────────────────────────────────────────────────────────────────────────
// Vision model patterns — force activation for these models (allowlist).
// Format: "providerID/modelID" or glob patterns like "providerID/*".
// These patterns ALWAYS activate vision bridging, overriding auto-detect.
// ─────────────────────────────────────────────────────────────────────────────
"models": [
"openai/gpt-4o-mini",
"anthropic/claude-3-haiku"
],
// ─────────────────────────────────────────────────────────────────────────────
// Force-off patterns — these models NEVER activate vision bridging.
// Takes precedence over `models` allowlist. Default: [] (empty).
// ─────────────────────────────────────────────────────────────────────────────
"denylist": [
"openai/gpt-4o"
],
// ─────────────────────────────────────────────────────────────────────────────
// Detection mode: how to decide if vision bridging is needed.
// "auto" — resolve via client.config.providers() capabilities only
// "patterns" — only use models/denylist patterns (no auto-detect)
// "hybrid" — auto-detect, fall back to patterns when unresolvable (DEFAULT)
// ─────────────────────────────────────────────────────────────────────────────
"detection": "hybrid",
// ─────────────────────────────────────────────────────────────────────────────
// Backend: how to analyze the image.
// type: "mcp" — inject instructions telling the model to call an MCP tool (DEFAULT)
// type: "cli" — spawn a CLI command and inject its stdout as description
// NOTE: type "tool" is NOT supported in v1.
// ─────────────────────────────────────────────────────────────────────────────
"backend": {
"type": "mcp",
// Required for type "mcp": the MCP tool to instruct the model to call.
"mcp": {
"tool": "openrouter_image_analyze",
"prompt": "Analyze this image and describe what you see.",
"format": "text",
"maxTokens": 512
},
// For type "cli":
// "cli": {
// "command": "mmx",
// "args": ["vision", "describe"], // mmx requires the "describe" subcommand
// "promptFlag": "--prompt",
// "jsonFlag": "--json",
// "imageFlag": "--image", // pass each image as "--image <ref>" instead of a positional arg
// "env": { "API_KEY": "..." },
// "timeoutMs": 30000 // default 30000ms
// }
},
// ─────────────────────────────────────────────────────────────────────────────
// Prompt template injected into the chat when vision is activated.
// Placeholders: {imageCount} — number of images, {userText} — original text.
// If absent, a built-in maximum-detail template is used.
// ─────────────────────────────────────────────────────────────────────────────
"promptTemplate": "You have {imageCount} image(s). Describe each image in detail for the following request: {userText}",
// ─────────────────────────────────────────────────────────────────────────────
// Directory for temporary image files saved from base64 pastes.
// Default: os.tmpdir()/opencode-vision/
// ─────────────────────────────────────────────────────────────────────────────
"tempDir": "/tmp/opencode-vision",
// ─────────────────────────────────────────────────────────────────────────────
// After how many hours to delete temporary image files on plugin init.
// Default: 24. Set to 0 to disable TTL cleanup.
// ─────────────────────────────────────────────────────────────────────────────
"cleanupAfterHours": 24,
// ─────────────────────────────────────────────────────────────────────────────
// When to run TTL cleanup:
// "init" — sweep tempDir on plugin initialization (DEFAULT)
// "never" — never auto-delete; rely on OS tmp cleanup or manual cleanup
// ─────────────────────────────────────────────────────────────────────────────
"cleanup": "init"
}