vision: images are the primary channel for multimodal models (digest off by default); digest is the text-only fallback; --digest/--no-digest to override

This commit is contained in:
opencode
2026-08-08 19:44:18 +03:00
parent ef02e5f9ea
commit d8373a50fc
5 changed files with 164 additions and 19 deletions
+10
View File
@@ -140,6 +140,7 @@ async def run_llm_agent(
max_steps: int,
recorder: FrameRecorder | None = None,
vision: bool | None = None,
digest: bool | None = None,
) -> dict[str, Any]:
"""Autonomous LLM run: controller + nudge/correct loop (see llm_agent)."""
from testbed.llm_agent import LLMController, run_llm_agent_loop
@@ -152,6 +153,7 @@ async def run_llm_agent(
model=model,
log=lambda role, msg: print(f"[{role}] {msg}"),
multimodal=vision,
digest=digest,
)
try:
return await run_llm_agent_loop(
@@ -310,6 +312,7 @@ async def run_demo(args: argparse.Namespace) -> dict[str, Any]:
max_steps=args.max_steps,
recorder=recorder,
vision=args.vision,
digest=args.digest,
)
elif args.agent == "scripted":
summary = await run_scripted_agent(
@@ -331,6 +334,7 @@ async def run_demo(args: argparse.Namespace) -> dict[str, Any]:
max_steps=llm_steps,
recorder=recorder,
vision=args.vision,
digest=args.digest,
)
if summary.get("interacted"):
return summary
@@ -398,6 +402,12 @@ def main() -> int:
default=None,
help="pass real camera frames to the model as images (auto-detected for local ollama)",
)
parser.add_argument(
"--digest",
action=argparse.BooleanOptionalAction,
default=None,
help="always include the color-grid digest alongside images (off by default for multimodal models)",
)
parser.add_argument(
"--frame",
default="demo_final_frame.png",