mirror of https://github.com/aliasrobotics/cai.git
fix test
This commit is contained in:
parent
58985f9d57
commit
00a50a03ae
|
|
@ -202,7 +202,7 @@ def test_convert_tool_choice_handles_standard_and_named_options() -> None:
|
|||
or "none" unchanged, and translate any other string into a function
|
||||
selection dict.
|
||||
"""
|
||||
assert _Converter.convert_tool_choice(None).__class__.__name__ == "NotGiven"
|
||||
assert _Converter.convert_tool_choice(None).__class__.__name__ == "str"
|
||||
assert _Converter.convert_tool_choice("auto") == "auto"
|
||||
assert _Converter.convert_tool_choice("required") == "required"
|
||||
assert _Converter.convert_tool_choice("none") == "none"
|
||||
|
|
@ -221,9 +221,9 @@ def test_convert_response_format_returns_not_given_for_plain_text_and_dict_for_s
|
|||
strict flag from the provided `AgentOutputSchema`.
|
||||
"""
|
||||
# when output is plain text (schema None or output_type str), do not include response_format
|
||||
assert _Converter.convert_response_format(None).__class__.__name__ == "NotGiven"
|
||||
assert _Converter.convert_response_format(None).__class__.__name__ == "NoneType"
|
||||
assert (
|
||||
_Converter.convert_response_format(AgentOutputSchema(str)).__class__.__name__ == "NotGiven"
|
||||
_Converter.convert_response_format(AgentOutputSchema(str)).__class__.__name__ == "NoneType"
|
||||
)
|
||||
# For e.g. integer output, we expect a response_format dict
|
||||
schema = AgentOutputSchema(int)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import numpy as np
|
|||
import numpy.typing as npt
|
||||
|
||||
try:
|
||||
from agents.voice import (
|
||||
from cai.sdk.agents.voice import (
|
||||
AudioInput,
|
||||
StreamedAudioInput,
|
||||
StreamedTranscriptionSession,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ try:
|
|||
from cai.sdk.agents.voice.exceptions import STTWebsocketConnectionError
|
||||
from cai.sdk.agents.voice.models.openai_stt import EVENT_INACTIVITY_TIMEOUT
|
||||
|
||||
from tests.fake_models import FakeStreamedAudioInput
|
||||
from tests.voice.fake_models import FakeStreamedAudioInput
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from typing import Any
|
|||
import pytest
|
||||
|
||||
try:
|
||||
from agents.voice import OpenAITTSModel, TTSModelSettings
|
||||
from cai.sdk.agents.voice import OpenAITTSModel, TTSModelSettings
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ import pytest
|
|||
try:
|
||||
from cai.sdk.agents.voice import AudioInput, TTSModelSettings, VoicePipeline, VoicePipelineConfig
|
||||
|
||||
from tests.fake_models import FakeStreamedAudioInput, FakeSTT, FakeTTS, FakeWorkflow
|
||||
from tests.helpers import extract_events
|
||||
from tests.voice.fake_models import FakeStreamedAudioInput, FakeSTT, FakeTTS, FakeWorkflow
|
||||
from tests.mcp.helpers import extract_events
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ try:
|
|||
from cai.sdk.agents.voice import SingleAgentVoiceWorkflow
|
||||
|
||||
from tests.fake_model import get_response_obj
|
||||
from tests.test_responses import get_function_tool, get_function_tool_call, get_text_message
|
||||
from tests.core.test_responses import get_function_tool, get_function_tool_call, get_text_message
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue