diff --git a/tests/test_agent.py b/tests/test_agent.py index 9c44681..388fa30 100644 --- a/tests/test_agent.py +++ b/tests/test_agent.py @@ -237,6 +237,27 @@ def test_agent_config_service_tier_invalid(self, config_class): with pytest.raises(ValidationError): config_class(service_tier="ultra") + @pytest.mark.parametrize("mode", ["agent", "program"]) + def test_agent_execution_config_mode(self, mode): + """mode is accepted on AgentExecutionConfig and round-trips through model_dump().""" + config = AgentExecutionConfig(prompt="hi", mode=mode) + assert config.mode == mode + dumped = config.model_dump(exclude_none=True) + assert dumped["mode"] == mode + + def test_agent_execution_config_mode_default_is_none(self): + """mode defaults to None and is excluded from model_dump(exclude_none=True).""" + config = AgentExecutionConfig(prompt="hi") + assert config.mode is None + assert "mode" not in config.model_dump(exclude_none=True) + + def test_agent_execution_config_mode_invalid(self): + """Invalid mode values are rejected by pydantic.""" + from pydantic import ValidationError + + with pytest.raises(ValidationError): + AgentExecutionConfig(prompt="hi", mode="auto") + class TestAgentCompletions: """Test the Agent OpenAI completions integration.""" diff --git a/vlmrun/client/types.py b/vlmrun/client/types.py index d6adec7..8b6931c 100644 --- a/vlmrun/client/types.py +++ b/vlmrun/client/types.py @@ -306,6 +306,15 @@ class AgentExecutionConfig(AgentExecutionOrCreationConfig): prompt: Optional[str] = Field( default=None, description="The prompt to guide the execution of the agent." ) + mode: Literal["agent", "program"] | None = Field( + default=None, + description=( + "Orion-2 only (ignored for other models). `program` (default): run " + "cached skill pipeline.py as fixed code when available. `agent`: " + "run the full LLM agent loop. When omitted, the server default " + "applies." + ), + ) class AgentInfo(BaseModel): diff --git a/vlmrun/version.py b/vlmrun/version.py index 49e0fc1..a5f830a 100644 --- a/vlmrun/version.py +++ b/vlmrun/version.py @@ -1 +1 @@ -__version__ = "0.7.0" +__version__ = "0.7.1"