diff --git a/notebook/oai_client_cost.ipynb b/notebook/oai_client_cost.ipynb index 857ee327a55..e4b35679313 100644 --- a/notebook/oai_client_cost.ipynb +++ b/notebook/oai_client_cost.ipynb @@ -300,7 +300,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.18" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/test/agentchat/contrib/test_agent_builder.py b/test/agentchat/contrib/test_agent_builder.py index 7380d6e62b9..de999f8b231 100644 --- a/test/agentchat/contrib/test_agent_builder.py +++ b/test/agentchat/contrib/test_agent_builder.py @@ -5,7 +5,9 @@ from packaging.requirements import Requirement from autogen.agentchat.contrib.agent_builder import AgentBuilder from autogen import UserProxyAgent -from conftest import skip_openai + +sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) +from conftest import skip_openai # noqa: E402 sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST # noqa: E402 diff --git a/test/agentchat/contrib/test_compressible_agent.py b/test/agentchat/contrib/test_compressible_agent.py index 298fd01e9da..9c5145a8dba 100644 --- a/test/agentchat/contrib/test_compressible_agent.py +++ b/test/agentchat/contrib/test_compressible_agent.py @@ -2,9 +2,11 @@ import sys import autogen import os -from conftest import skip_openai from autogen.agentchat.contrib.compressible_agent import CompressibleAgent +sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) +from conftest import skip_openai # noqa: E402 + here = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.join(os.path.dirname(__file__), "..")) @@ -12,7 +14,6 @@ try: import openai - except ImportError: skip = True else: diff --git a/test/agentchat/contrib/test_gpt_assistant.py b/test/agentchat/contrib/test_gpt_assistant.py index 0a7e92e8ccc..b4674b7c015 100644 --- a/test/agentchat/contrib/test_gpt_assistant.py +++ b/test/agentchat/contrib/test_gpt_assistant.py @@ -3,7 +3,9 @@ import sys import autogen from autogen import OpenAIWrapper -from conftest import skip_openai + +sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) +from conftest import skip_openai # noqa: E402 sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST # noqa: E402 diff --git a/test/agentchat/contrib/test_teachable_agent.py b/test/agentchat/contrib/test_teachable_agent.py index b8156296b66..0d8285f1de5 100644 --- a/test/agentchat/contrib/test_teachable_agent.py +++ b/test/agentchat/contrib/test_teachable_agent.py @@ -2,7 +2,9 @@ import os import sys from autogen import ConversableAgent, config_list_from_json -from conftest import skip_openai + +sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) +from conftest import skip_openai # noqa: E402 sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from test_assistant_agent import OAI_CONFIG_LIST, KEY_LOC # noqa: E402 diff --git a/test/agentchat/test_assistant_agent.py b/test/agentchat/test_assistant_agent.py index b05a1b77beb..0bd22785104 100644 --- a/test/agentchat/test_assistant_agent.py +++ b/test/agentchat/test_assistant_agent.py @@ -2,9 +2,11 @@ import sys import pytest import autogen -from conftest import skip_openai from autogen.agentchat import AssistantAgent, UserProxyAgent +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from conftest import skip_openai # noqa: E402 + try: from openai import OpenAI except ImportError: diff --git a/test/agentchat/test_async.py b/test/agentchat/test_async.py index d31f50c0cfb..496b73f7b58 100644 --- a/test/agentchat/test_async.py +++ b/test/agentchat/test_async.py @@ -1,8 +1,12 @@ import pytest import asyncio import autogen -from conftest import skip_openai from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST +import sys +import os + +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from conftest import skip_openai # noqa: E402 try: from openai import OpenAI diff --git a/test/agentchat/test_async_get_human_input.py b/test/agentchat/test_async_get_human_input.py index f9de9f1c2f1..1285696c03e 100644 --- a/test/agentchat/test_async_get_human_input.py +++ b/test/agentchat/test_async_get_human_input.py @@ -1,8 +1,12 @@ import asyncio import autogen import pytest -from conftest import skip_openai from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST +import sys +import os + +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from conftest import skip_openai # noqa: E402 try: from openai import OpenAI diff --git a/test/agentchat/test_function_call.py b/test/agentchat/test_function_call.py index 54f1f6dff00..3f4bdc79ad6 100644 --- a/test/agentchat/test_function_call.py +++ b/test/agentchat/test_function_call.py @@ -2,10 +2,13 @@ import asyncio import json import autogen -from conftest import skip_openai from autogen.math_utils import eval_math_responses from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST import sys +import os + +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from conftest import skip_openai # noqa: E402 try: from openai import OpenAI diff --git a/test/agentchat/test_function_call_groupchat.py b/test/agentchat/test_function_call_groupchat.py index 7b5266195f7..cf4b199cd51 100644 --- a/test/agentchat/test_function_call_groupchat.py +++ b/test/agentchat/test_function_call_groupchat.py @@ -1,9 +1,12 @@ import autogen import pytest import sys -from conftest import skip_openai +import os from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from conftest import skip_openai # noqa: E402 + try: from openai import OpenAI except ImportError: diff --git a/test/agentchat/test_math_user_proxy_agent.py b/test/agentchat/test_math_user_proxy_agent.py index 787a63f0409..c81449cec42 100644 --- a/test/agentchat/test_math_user_proxy_agent.py +++ b/test/agentchat/test_math_user_proxy_agent.py @@ -1,14 +1,17 @@ import pytest import sys +import os import autogen from autogen.agentchat.contrib.math_user_proxy_agent import ( MathUserProxyAgent, _remove_print, _add_print_to_last_line, ) -from conftest import skip_openai from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from conftest import skip_openai # noqa: E402 + try: from openai import OpenAI except ImportError: diff --git a/test/oai/test_client.py b/test/oai/test_client.py index 749c272ea7c..26a05396160 100644 --- a/test/oai/test_client.py +++ b/test/oai/test_client.py @@ -1,6 +1,10 @@ import pytest from autogen import OpenAIWrapper, config_list_from_json, config_list_openai_aoai -from conftest import skip_openai +import sys +import os + +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from conftest import skip_openai # noqa: E402 TOOL_ENABLED = False try: diff --git a/test/oai/test_client_stream.py b/test/oai/test_client_stream.py index c0ff760719a..284df095466 100644 --- a/test/oai/test_client_stream.py +++ b/test/oai/test_client_stream.py @@ -1,6 +1,10 @@ import pytest from autogen import OpenAIWrapper, config_list_from_json, config_list_openai_aoai -from conftest import skip_openai +import sys +import os + +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from conftest import skip_openai # noqa: E402 try: from openai import OpenAI