diff --git a/tests/agents/test_agent_hooks.py b/tests/agents/test_agent_hooks.py index 28caa58e..a43ef10f 100644 --- a/tests/agents/test_agent_hooks.py +++ b/tests/agents/test_agent_hooks.py @@ -13,8 +13,8 @@ from cai.sdk.agents.run import Runner from cai.sdk.agents.run_context import RunContextWrapper, TContext from cai.sdk.agents.tool import Tool -from .fake_model import FakeModel -from .test_responses import ( +from tests.fake_model import FakeModel +from tests.core.test_responses import ( get_final_output_message, get_function_tool, get_function_tool_call, diff --git a/tests/agents/test_agent_one_tool.py b/tests/agents/test_agent_one_tool.py index 2bb3c1f0..457e51f8 100644 --- a/tests/agents/test_agent_one_tool.py +++ b/tests/agents/test_agent_one_tool.py @@ -7,7 +7,7 @@ generic_linux_command tool. import pytest from tests.fake_model import FakeModel -from tests.test_responses import ( +from tests.core.test_responses import ( get_text_message, get_function_tool_call, get_function_tool, diff --git a/tests/agents/test_agent_runner.py b/tests/agents/test_agent_runner.py index 0ec851b5..0b84dbaf 100644 --- a/tests/agents/test_agent_runner.py +++ b/tests/agents/test_agent_runner.py @@ -27,7 +27,7 @@ from cai.sdk.agents.agent import ToolsToFinalOutputResult from cai.sdk.agents.tool import FunctionToolResult, function_tool from tests.fake_model import FakeModel -from tests.test_responses import ( +from tests.core.test_responses import ( get_final_output_message, get_function_tool, get_function_tool_call, diff --git a/tests/agents/test_agent_runner_streamed.py b/tests/agents/test_agent_runner_streamed.py index 9bca3957..4d42ad97 100644 --- a/tests/agents/test_agent_runner_streamed.py +++ b/tests/agents/test_agent_runner_streamed.py @@ -25,7 +25,7 @@ from cai.sdk.agents.run import RunConfig from cai.sdk.agents.stream_events import AgentUpdatedStreamEvent from tests.fake_model import FakeModel -from tests.test_responses import ( +from tests.core.test_responses import ( get_final_output_message, get_function_tool, get_function_tool_call, diff --git a/tests/test_global_hooks.py b/tests/agents/test_global_hooks.py similarity index 99% rename from tests/test_global_hooks.py rename to tests/agents/test_global_hooks.py index 0cf12612..2617ee91 100644 --- a/tests/test_global_hooks.py +++ b/tests/agents/test_global_hooks.py @@ -9,8 +9,8 @@ from typing_extensions import TypedDict from cai.sdk.agents import Agent, RunContextWrapper, RunHooks, Runner, TContext, Tool -from .fake_model import FakeModel -from .test_responses import ( +from tests.fake_model import FakeModel +from tests.core.test_responses import ( get_final_output_message, get_function_tool, get_function_tool_call, diff --git a/tests/test_guardrails.py b/tests/agents/test_guardrails.py similarity index 100% rename from tests/test_guardrails.py rename to tests/agents/test_guardrails.py diff --git a/tests/test_items_helpers.py b/tests/agents/test_items_helpers.py similarity index 100% rename from tests/test_items_helpers.py rename to tests/agents/test_items_helpers.py diff --git a/tests/test_max_turns.py b/tests/agents/test_max_turns.py similarity index 96% rename from tests/test_max_turns.py rename to tests/agents/test_max_turns.py index 1a827590..280cda96 100644 --- a/tests/test_max_turns.py +++ b/tests/agents/test_max_turns.py @@ -7,8 +7,8 @@ from typing_extensions import TypedDict from cai.sdk.agents import Agent, MaxTurnsExceeded, Runner -from .fake_model import FakeModel -from .test_responses import get_function_tool, get_function_tool_call, get_text_message +from tests.fake_model import FakeModel +from tests.core.test_responses import get_function_tool, get_function_tool_call, get_text_message @pytest.mark.asyncio diff --git a/tests/conftest.py b/tests/conftest.py index e096797e..952d2e06 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,7 +8,7 @@ from cai.sdk.agents.models.openai_responses import OpenAIResponsesModel from cai.sdk.agents.tracing import set_trace_processors from cai.sdk.agents.tracing.setup import GLOBAL_TRACE_PROVIDER -from .testing_processor import SPAN_PROCESSOR_TESTING +from tests.testing_processor import SPAN_PROCESSOR_TESTING # This fixture will run once before any tests are executed diff --git a/tests/test_openai_chatcompletions.py b/tests/core/test_openai_chatcompletions.py similarity index 100% rename from tests/test_openai_chatcompletions.py rename to tests/core/test_openai_chatcompletions.py diff --git a/tests/test_openai_chatcompletions_converter.py b/tests/core/test_openai_chatcompletions_converter.py similarity index 100% rename from tests/test_openai_chatcompletions_converter.py rename to tests/core/test_openai_chatcompletions_converter.py diff --git a/tests/test_openai_chatcompletions_stream.py b/tests/core/test_openai_chatcompletions_stream.py similarity index 100% rename from tests/test_openai_chatcompletions_stream.py rename to tests/core/test_openai_chatcompletions_stream.py diff --git a/tests/test_openai_responses_converter.py b/tests/core/test_openai_responses_converter.py similarity index 100% rename from tests/test_openai_responses_converter.py rename to tests/core/test_openai_responses_converter.py diff --git a/tests/test_responses.py b/tests/core/test_responses.py similarity index 100% rename from tests/test_responses.py rename to tests/core/test_responses.py diff --git a/tests/test_run_config.py b/tests/core/test_run_config.py similarity index 100% rename from tests/test_run_config.py rename to tests/core/test_run_config.py diff --git a/tests/test_run_step_execution.py b/tests/core/test_run_step_execution.py similarity index 100% rename from tests/test_run_step_execution.py rename to tests/core/test_run_step_execution.py diff --git a/tests/test_run_step_processing.py b/tests/core/test_run_step_processing.py similarity index 100% rename from tests/test_run_step_processing.py rename to tests/core/test_run_step_processing.py diff --git a/tests/mcp/helpers.py b/tests/helpers.py similarity index 100% rename from tests/mcp/helpers.py rename to tests/helpers.py diff --git a/tests/mcp/test_caching.py b/tests/mcp/test_caching.py index cac409e6..16dcd227 100644 --- a/tests/mcp/test_caching.py +++ b/tests/mcp/test_caching.py @@ -3,9 +3,9 @@ from unittest.mock import AsyncMock, patch import pytest from mcp.types import ListToolsResult, Tool as MCPTool -from agents.mcp import MCPServerStdio +from cai.sdk.agents.mcp import MCPServerStdio -from .helpers import DummyStreamsContextManager, tee +from tests.mcp.helpers import DummyStreamsContextManager, tee @pytest.mark.asyncio diff --git a/tests/mcp/test_connect_disconnect.py b/tests/mcp/test_connect_disconnect.py index b0013039..85ee6ec6 100644 --- a/tests/mcp/test_connect_disconnect.py +++ b/tests/mcp/test_connect_disconnect.py @@ -3,7 +3,7 @@ from unittest.mock import AsyncMock, patch import pytest from mcp.types import ListToolsResult, Tool as MCPTool -from agents.mcp import MCPServerStdio +from cai.sdk.agents.mcp import MCPServerStdio from .helpers import DummyStreamsContextManager, tee diff --git a/tests/mcp/test_mcp_tracing.py b/tests/mcp/test_mcp_tracing.py index b71954b5..a4ebc653 100644 --- a/tests/mcp/test_mcp_tracing.py +++ b/tests/mcp/test_mcp_tracing.py @@ -1,11 +1,11 @@ import pytest from inline_snapshot import snapshot -from agents import Agent, Runner +from cai.sdk.agents import Agent, Runner -from ..fake_model import FakeModel -from ..test_responses import get_function_tool, get_function_tool_call, get_text_message -from ..testing_processor import SPAN_PROCESSOR_TESTING, fetch_normalized_spans +from tests.fake_model import FakeModel +from tests.core.test_responses import get_function_tool, get_function_tool_call, get_text_message +from tests.testing_processor import SPAN_PROCESSOR_TESTING, fetch_normalized_spans from .helpers import FakeMCPServer diff --git a/tests/mcp/test_mcp_util.py b/tests/mcp/test_mcp_util.py index 345df996..f62d3ab0 100644 --- a/tests/mcp/test_mcp_util.py +++ b/tests/mcp/test_mcp_util.py @@ -5,9 +5,9 @@ import pytest from mcp.types import Tool as MCPTool from pydantic import BaseModel -from agents import FunctionTool, RunContextWrapper -from agents.exceptions import AgentsException, ModelBehaviorError -from agents.mcp import MCPServer, MCPUtil +from cai.sdk.agents import FunctionTool, RunContextWrapper +from cai.sdk.agents.exceptions import AgentsException, ModelBehaviorError +from cai.sdk.agents.mcp import MCPServer, MCPUtil from .helpers import FakeMCPServer diff --git a/tests/mcp/test_runner_calls_mcp.py b/tests/mcp/test_runner_calls_mcp.py index 3319c097..c879e8fd 100644 --- a/tests/mcp/test_runner_calls_mcp.py +++ b/tests/mcp/test_runner_calls_mcp.py @@ -3,10 +3,10 @@ import json import pytest from pydantic import BaseModel -from agents import Agent, ModelBehaviorError, Runner, UserError +from cai.sdk.agents import Agent, ModelBehaviorError, Runner, UserError -from ..fake_model import FakeModel -from ..test_responses import get_function_tool_call, get_text_message +from tests.fake_model import FakeModel +from tests.core.test_responses import get_function_tool_call, get_text_message from .helpers import FakeMCPServer diff --git a/tests/mcp/test_server_errors.py b/tests/mcp/test_server_errors.py index bdca7ce6..705ef64d 100644 --- a/tests/mcp/test_server_errors.py +++ b/tests/mcp/test_server_errors.py @@ -1,7 +1,7 @@ import pytest -from agents.exceptions import UserError -from agents.mcp.server import _MCPServerWithClientSession +from cai.sdk.agents.exceptions import UserError +from cai.sdk.agents.mcp.server import _MCPServerWithClientSession class CrashingClientSessionServer(_MCPServerWithClientSession): diff --git a/tests/test_computer_action.py b/tests/others/test_computer_action.py similarity index 100% rename from tests/test_computer_action.py rename to tests/others/test_computer_action.py diff --git a/tests/test_config.py b/tests/others/test_config.py similarity index 100% rename from tests/test_config.py rename to tests/others/test_config.py diff --git a/tests/test_doc_parsing.py b/tests/others/test_doc_parsing.py similarity index 100% rename from tests/test_doc_parsing.py rename to tests/others/test_doc_parsing.py diff --git a/tests/test_extension_filters.py b/tests/others/test_extension_filters.py similarity index 100% rename from tests/test_extension_filters.py rename to tests/others/test_extension_filters.py diff --git a/tests/test_function_schema.py b/tests/others/test_function_schema.py similarity index 98% rename from tests/test_function_schema.py rename to tests/others/test_function_schema.py index ef1e9c22..a68519be 100644 --- a/tests/test_function_schema.py +++ b/tests/others/test_function_schema.py @@ -6,9 +6,9 @@ import pytest from pydantic import BaseModel, ValidationError from typing_extensions import TypedDict -from agents import RunContextWrapper -from agents.exceptions import UserError -from agents.function_schema import function_schema +from cai.sdk.agents import RunContextWrapper +from cai.sdk.agents.exceptions import UserError +from cai.sdk.agents.function_schema import function_schema def no_args_function(): diff --git a/tests/test_pretty_print.py b/tests/others/test_pretty_print.py similarity index 98% rename from tests/test_pretty_print.py rename to tests/others/test_pretty_print.py index 54c52b2f..b3d6efef 100644 --- a/tests/test_pretty_print.py +++ b/tests/others/test_pretty_print.py @@ -9,7 +9,7 @@ from cai.sdk.agents.agent_output import _WRAPPER_DICT_KEY from cai.sdk.agents.util._pretty_print import pretty_print_result, pretty_print_run_result_streaming from tests.fake_model import FakeModel -from .test_responses import get_final_output_message, get_text_message +from tests.core.test_responses import get_final_output_message, get_text_message @pytest.mark.asyncio diff --git a/tests/test_result_cast.py b/tests/others/test_result_cast.py similarity index 100% rename from tests/test_result_cast.py rename to tests/others/test_result_cast.py diff --git a/tests/test_strict_schema.py b/tests/others/test_strict_schema.py similarity index 100% rename from tests/test_strict_schema.py rename to tests/others/test_strict_schema.py diff --git a/tests/test_trace_processor.py b/tests/others/test_trace_processor.py similarity index 100% rename from tests/test_trace_processor.py rename to tests/others/test_trace_processor.py diff --git a/tests/test_visualization.py b/tests/others/test_visualization.py similarity index 100% rename from tests/test_visualization.py rename to tests/others/test_visualization.py diff --git a/tests/tools/test_tool_choice_reset.py b/tests/tools/test_tool_choice_reset.py index 220ca4c2..93895e1a 100644 --- a/tests/tools/test_tool_choice_reset.py +++ b/tests/tools/test_tool_choice_reset.py @@ -4,7 +4,7 @@ from cai.sdk.agents import Agent, ModelSettings, Runner from cai.sdk.agents._run_impl import AgentToolUseTracker, RunImpl from tests.fake_model import FakeModel -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 class TestToolChoiceReset: diff --git a/tests/tools/test_tool_use_behavior.py b/tests/tools/test_tool_use_behavior.py index adf25946..355392b2 100644 --- a/tests/tools/test_tool_use_behavior.py +++ b/tests/tools/test_tool_use_behavior.py @@ -18,7 +18,7 @@ from cai.sdk.agents import ( ) from cai.sdk.agents._run_impl import RunImpl -from tests.test_responses import get_function_tool +from tests.core.test_responses import get_function_tool def _make_function_tool_result( diff --git a/tests/tracing/test_agent_tracing.py b/tests/tracing/test_agent_tracing.py index 446a99e7..34535120 100644 --- a/tests/tracing/test_agent_tracing.py +++ b/tests/tracing/test_agent_tracing.py @@ -8,7 +8,7 @@ from inline_snapshot import snapshot from cai.sdk.agents import Agent, RunConfig, Runner, trace from tests.fake_model import FakeModel -from tests.test_responses import get_text_message +from tests.core.test_responses import get_text_message from tests.testing_processor import assert_no_traces, fetch_normalized_spans diff --git a/tests/test_responses_tracing.py b/tests/tracing/test_responses_tracing.py similarity index 98% rename from tests/test_responses_tracing.py rename to tests/tracing/test_responses_tracing.py index 32b5224e..79205adc 100644 --- a/tests/test_responses_tracing.py +++ b/tests/tracing/test_responses_tracing.py @@ -7,7 +7,7 @@ from cai.sdk.agents import ModelSettings, ModelTracing, OpenAIResponsesModel, tr from cai.sdk.agents.tracing.span_data import ResponseSpanData from tests import fake_model -from .testing_processor import assert_no_spans, fetch_normalized_spans, fetch_ordered_spans +from tests.testing_processor import assert_no_spans, fetch_normalized_spans, fetch_ordered_spans class DummyTracing: diff --git a/tests/tracing/test_tracing_errors.py b/tests/tracing/test_tracing_errors.py index 584b77b2..3233606a 100644 --- a/tests/tracing/test_tracing_errors.py +++ b/tests/tracing/test_tracing_errors.py @@ -20,7 +20,7 @@ from cai.sdk.agents import ( ) from tests.fake_model import FakeModel -from tests.test_responses import ( +from tests.core.test_responses import ( get_final_output_message, get_function_tool, get_function_tool_call, diff --git a/tests/tracing/test_tracing_errors_streamed.py b/tests/tracing/test_tracing_errors_streamed.py index 088d86df..0d6b1d22 100644 --- a/tests/tracing/test_tracing_errors_streamed.py +++ b/tests/tracing/test_tracing_errors_streamed.py @@ -23,7 +23,7 @@ from cai.sdk.agents import ( ) from tests.fake_model import FakeModel -from tests.test_responses import ( +from tests.core.test_responses import ( get_final_output_message, get_function_tool, get_function_tool_call, diff --git a/tests/voice/test_input.py b/tests/voice/test_input.py index d41d870d..454fce60 100644 --- a/tests/voice/test_input.py +++ b/tests/voice/test_input.py @@ -5,9 +5,9 @@ import numpy as np import pytest try: - from agents import UserError - from agents.voice import AudioInput, StreamedAudioInput - from agents.voice.input import DEFAULT_SAMPLE_RATE, _buffer_to_audio_file + from cai.sdk.agents import UserError + from cai.sdk.agents.voice import AudioInput, StreamedAudioInput + from cai.sdk.agents.voice.input import DEFAULT_SAMPLE_RATE, _buffer_to_audio_file except ImportError: pass diff --git a/tests/voice/test_openai_stt.py b/tests/voice/test_openai_stt.py index 89b5cca7..e20c2b26 100644 --- a/tests/voice/test_openai_stt.py +++ b/tests/voice/test_openai_stt.py @@ -9,11 +9,11 @@ import numpy as np import pytest try: - from agents.voice import OpenAISTTTranscriptionSession, StreamedAudioInput, STTModelSettings - from agents.voice.exceptions import STTWebsocketConnectionError - from agents.voice.models.openai_stt import EVENT_INACTIVITY_TIMEOUT + from cai.sdk.agents.voice import OpenAISTTTranscriptionSession, StreamedAudioInput, STTModelSettings + from cai.sdk.agents.voice.exceptions import STTWebsocketConnectionError + from cai.sdk.agents.voice.models.openai_stt import EVENT_INACTIVITY_TIMEOUT - from .fake_models import FakeStreamedAudioInput + from tests.fake_models import FakeStreamedAudioInput except ImportError: pass diff --git a/tests/voice/test_pipeline.py b/tests/voice/test_pipeline.py index 51904468..3bff2c60 100644 --- a/tests/voice/test_pipeline.py +++ b/tests/voice/test_pipeline.py @@ -5,10 +5,10 @@ import numpy.typing as npt import pytest try: - from agents.voice import AudioInput, TTSModelSettings, VoicePipeline, VoicePipelineConfig + from cai.sdk.agents.voice import AudioInput, TTSModelSettings, VoicePipeline, VoicePipelineConfig - from .fake_models import FakeStreamedAudioInput, FakeSTT, FakeTTS, FakeWorkflow - from .helpers import extract_events + from tests.fake_models import FakeStreamedAudioInput, FakeSTT, FakeTTS, FakeWorkflow + from tests.helpers import extract_events except ImportError: pass diff --git a/tests/voice/test_workflow.py b/tests/voice/test_workflow.py index 3f18c049..a66eb079 100644 --- a/tests/voice/test_workflow.py +++ b/tests/voice/test_workflow.py @@ -8,10 +8,10 @@ from inline_snapshot import snapshot from openai.types.responses import ResponseCompletedEvent from openai.types.responses.response_text_delta_event import ResponseTextDeltaEvent -from agents import Agent, Model, ModelSettings, ModelTracing, Tool -from agents.agent_output import AgentOutputSchema -from agents.handoffs import Handoff -from agents.items import ( +from cai.sdk.agents import Agent, Model, ModelSettings, ModelTracing, Tool +from cai.sdk.agents.agent_output import AgentOutputSchema +from cai.sdk.agents.handoffs import Handoff +from cai.sdk.agents.items import ( ModelResponse, TResponseInputItem, TResponseOutputItem, @@ -19,10 +19,10 @@ from agents.items import ( ) try: - from agents.voice import SingleAgentVoiceWorkflow + from cai.sdk.agents.voice import SingleAgentVoiceWorkflow - from ..fake_model import get_response_obj - from ..test_responses import get_function_tool, get_function_tool_call, get_text_message + from tests.fake_model import get_response_obj + from tests.test_responses import get_function_tool, get_function_tool_call, get_text_message except ImportError: pass