Add tts/text output schema
This commit is contained in:
@@ -125,6 +125,36 @@ async def test_turn_without_tool_keeps_streaming(monkeypatch):
|
||||
assert "assistant.tool_call" not in event_types
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"metadata",
|
||||
[
|
||||
{"output": {"mode": "text"}},
|
||||
{"services": {"tts": {"enabled": False}}},
|
||||
],
|
||||
)
|
||||
async def test_text_output_mode_skips_audio_events(monkeypatch, metadata):
|
||||
pipeline, events = _build_pipeline(
|
||||
monkeypatch,
|
||||
[
|
||||
[
|
||||
LLMStreamEvent(type="text_delta", text="hello "),
|
||||
LLMStreamEvent(type="text_delta", text="world."),
|
||||
LLMStreamEvent(type="done"),
|
||||
]
|
||||
],
|
||||
)
|
||||
pipeline.apply_runtime_overrides(metadata)
|
||||
|
||||
await pipeline._handle_turn("hi")
|
||||
|
||||
event_types = [e.get("type") for e in events]
|
||||
assert "assistant.response.delta" in event_types
|
||||
assert "assistant.response.final" in event_types
|
||||
assert "output.audio.start" not in event_types
|
||||
assert "output.audio.end" not in event_types
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_turn_with_tool_call_then_results(monkeypatch):
|
||||
pipeline, events = _build_pipeline(
|
||||
|
||||
Reference in New Issue
Block a user