Skip to content
Merged
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
21 changes: 21 additions & 0 deletions tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
9 changes: 9 additions & 0 deletions vlmrun/client/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion vlmrun/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.0"
__version__ = "0.7.1"
Loading