vision: real camera frames to the model (image_url), auto-detected for multimodal ollama models; --vision/--no-vision flags; verified gemma4:12b sees frames and completed the beacon mission

This commit is contained in:
opencode
2026-08-08 19:38:21 +03:00
parent 6a509aacc6
commit ef02e5f9ea
6 changed files with 5747 additions and 6 deletions
+10
View File
@@ -139,6 +139,7 @@ async def run_llm_agent(
model: str,
max_steps: int,
recorder: FrameRecorder | None = None,
vision: 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
@@ -150,6 +151,7 @@ async def run_llm_agent(
api_key=api_key,
model=model,
log=lambda role, msg: print(f"[{role}] {msg}"),
multimodal=vision,
)
try:
return await run_llm_agent_loop(
@@ -307,6 +309,7 @@ async def run_demo(args: argparse.Namespace) -> dict[str, Any]:
model=args.model,
max_steps=args.max_steps,
recorder=recorder,
vision=args.vision,
)
elif args.agent == "scripted":
summary = await run_scripted_agent(
@@ -327,6 +330,7 @@ async def run_demo(args: argparse.Namespace) -> dict[str, Any]:
model=args.model,
max_steps=llm_steps,
recorder=recorder,
vision=args.vision,
)
if summary.get("interacted"):
return summary
@@ -388,6 +392,12 @@ def main() -> int:
)
parser.add_argument("--api-key", default="ollama", help="API key for the endpoint")
parser.add_argument("--max-steps", type=int, default=60, help="max agent steps")
parser.add_argument(
"--vision",
action=argparse.BooleanOptionalAction,
default=None,
help="pass real camera frames to the model as images (auto-detected for local ollama)",
)
parser.add_argument(
"--frame",
default="demo_final_frame.png",