Skip to content

Commit 4f23622

Browse files
authored
Merge branch 'main' into EcoAssistant-blog
2 parents 3f7f42c + 337ac4c commit 4f23622

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

autogen/oai/completion.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
import diskcache
2626

2727
ERROR = None
28-
except ImportError:
29-
ERROR = ImportError(
30-
"(Deprecated) The autogen.Completion class requires openai<1 and diskcache. "
31-
"Please switch to autogen.OpenAIWrapper for openai>=1."
32-
)
28+
assert openai.__version__ < "1"
29+
except (AssertionError, ImportError):
3330
openai_Completion = object
31+
# The autogen.Completion class requires openai<1
32+
ERROR = AssertionError("(Deprecated) The autogen.Completion class requires openai<1 and diskcache. ")
33+
3434
logger = logging.getLogger(__name__)
3535
if not logger.handlers:
3636
# Add the console handler.

autogen/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.2.0b4"
1+
__version__ = "0.2.0b5"

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
__version__ = version["__version__"]
1515

1616
install_requires = [
17-
"openai==1.1.1",
17+
"openai~=1.2",
1818
"diskcache",
1919
"termcolor",
2020
"flaml",

test/agentchat/contrib/test_gpt_assistant.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
except ImportError:
1414
skip_test = True
1515

16+
config_list = autogen.config_list_from_json(
17+
OAI_CONFIG_LIST, file_location=KEY_LOC, filter_dict={"api_type": ["openai"]}
18+
)
19+
1620

1721
def ask_ossinsight(question):
1822
return f"That is a good question, but I don't know the answer yet. Please ask your human developer friend to help you. \n\n{question}"
@@ -38,7 +42,6 @@ def test_gpt_assistant_chat():
3842
"description": "This is an API endpoint allowing users (analysts) to input question about GitHub in text format to retrieve the realted and structured data.",
3943
}
4044

41-
config_list = autogen.config_list_from_json(OAI_CONFIG_LIST, file_location=KEY_LOC)
4245
analyst = GPTAssistantAgent(
4346
name="Open_Source_Project_Analyst",
4447
llm_config={"tools": [{"type": "function", "function": ossinsight_api_schema}], "config_list": config_list},
@@ -73,7 +76,6 @@ def test_get_assistant_instructions():
7376
and assert that the retrieved instructions match the set instructions.
7477
"""
7578

76-
config_list = autogen.config_list_from_json(OAI_CONFIG_LIST, file_location=KEY_LOC)
7779
assistant = GPTAssistantAgent(
7880
"assistant",
7981
instructions="This is a test",
@@ -107,7 +109,6 @@ def test_gpt_assistant_instructions_overwrite():
107109
instructions1 = "This is a test #1"
108110
instructions2 = "This is a test #2"
109111

110-
config_list = autogen.config_list_from_json(OAI_CONFIG_LIST, file_location=KEY_LOC)
111112
assistant = GPTAssistantAgent(
112113
"assistant",
113114
instructions=instructions1,
@@ -144,7 +145,6 @@ def test_gpt_assistant_existing_no_instructions():
144145
"""
145146
instructions = "This is a test #1"
146147

147-
config_list = autogen.config_list_from_json(OAI_CONFIG_LIST, file_location=KEY_LOC)
148148
assistant = GPTAssistantAgent(
149149
"assistant",
150150
instructions=instructions,

0 commit comments

Comments
 (0)