Add ASR interim results support in Assistant model and API
- Introduced `asr_interim_enabled` field in the Assistant model to control interim ASR results. - Updated AssistantBase and AssistantUpdate schemas to include the new field. - Modified the database schema to add the `asr_interim_enabled` column. - Enhanced runtime metadata to reflect interim ASR settings. - Updated API endpoints and tests to validate the new functionality. - Adjusted documentation to include details about interim ASR results configuration.
This commit is contained in:
@@ -282,7 +282,7 @@ async def test_local_yaml_adapter_rejects_path_traversal_like_assistant_id(tmp_p
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_local_yaml_translates_agent_schema_to_runtime_services(tmp_path):
|
||||
async def test_local_yaml_translates_agent_schema_with_asr_interim_flag(tmp_path):
|
||||
config_dir = tmp_path / "assistants"
|
||||
config_dir.mkdir(parents=True, exist_ok=True)
|
||||
(config_dir / "default.yaml").write_text(
|
||||
@@ -305,6 +305,7 @@ async def test_local_yaml_translates_agent_schema_to_runtime_services(tmp_path):
|
||||
" model: asr-model",
|
||||
" api_key: sk-asr",
|
||||
" api_url: https://asr.example.com/v1/audio/transcriptions",
|
||||
" enable_interim: false",
|
||||
" duplex:",
|
||||
" system_prompt: You are test assistant",
|
||||
]
|
||||
@@ -321,4 +322,5 @@ async def test_local_yaml_translates_agent_schema_to_runtime_services(tmp_path):
|
||||
assert services.get("llm", {}).get("apiKey") == "sk-llm"
|
||||
assert services.get("tts", {}).get("apiKey") == "sk-tts"
|
||||
assert services.get("asr", {}).get("apiKey") == "sk-asr"
|
||||
assert services.get("asr", {}).get("enableInterim") is False
|
||||
assert assistant.get("systemPrompt") == "You are test assistant"
|
||||
|
||||
Reference in New Issue
Block a user