Skip to content
Draft
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
2 changes: 1 addition & 1 deletion src/uipath/runtime/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class UiPathRuntimeContext(BaseModel):
None,
description="Conversation owner id for CAS (a real cloud user id or a synthetic user id)",
)
voice_mode: Literal["session"] | None = Field(
voice_mode: Literal["session", "maestro_flow"] | None = Field(
None, description="Voice job type for CAS"
)
mcp_server_id: str | None = None
Expand Down
27 changes: 27 additions & 0 deletions tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Any

import pytest
from pydantic import ValidationError
from uipath.core.errors import ErrorCategory, UiPathFaultedTriggerError

from uipath.runtime.context import UiPathRuntimeContext
Expand Down Expand Up @@ -371,3 +372,29 @@ def test_explicit_execution_source_not_overwritten() -> None:
ctx = UiPathRuntimeContext(command="run", execution_source="custom")

assert ctx.execution_source == "custom"


@pytest.mark.parametrize("voice_mode", ["session", "maestro_flow"])
def test_constructor_accepts_supported_voice_modes(voice_mode: str) -> None:
ctx = UiPathRuntimeContext(voice_mode=voice_mode)

assert ctx.voice_mode == voice_mode


@pytest.mark.parametrize("voice_mode", ["session", "maestro_flow"])
def test_from_config_accepts_supported_voice_modes(
voice_mode: str, tmp_path: Path
) -> None:
config_path = tmp_path / "uipath.json"
config_path.write_text(
json.dumps({"fpsProperties": {"voice.mode": voice_mode}})
)

ctx = UiPathRuntimeContext.from_config(str(config_path))

assert ctx.voice_mode == voice_mode


def test_constructor_rejects_unknown_voice_mode() -> None:
with pytest.raises(ValidationError):
UiPathRuntimeContext(voice_mode="chat")
Loading