refactor: separa composição OCI e inicialização do DeepAgents

This commit is contained in:
alex alves
2026-11-05 16:39:01 -03:00
parent 85fc4c4d46
commit e319b4089c
10 changed files with 508 additions and 153 deletions

View File

@@ -111,18 +111,9 @@ def test_timeout_is_renewed_for_each_next_event():
@pytest.mark.parametrize("timeout", [0, -1, float("inf"), float("nan"), True, "60", None])
def test_invalid_timeout_fails_before_model_construction(monkeypatch, timeout):
import voice_assistant.agent.deep_agent as module
def unexpected_model(**kwargs):
pytest.fail("Invalid configuration must not create a model")
monkeypatch.setattr(module, "ChatOCIGenAI", unexpected_model)
def test_invalid_stream_timeout_is_rejected(timeout):
with pytest.raises(ValueError, match="finite and positive"):
DeepAgentsAdapter(
region="sa-vinhedo-1", compartment_id="test", model_id="test",
temperature=0.3, max_completion_tokens=256, timeout_seconds=timeout,
)
DeepAgentsAdapter(graph=SimpleNamespace(), timeout_seconds=timeout)
def test_adapter_streams_real_deepagents_graph_with_fake_model():