Skip to content

A programming framework for agentic AI

fix openai compatible changes (#2718)

Ianb698a98eb0df
diff --git a/autogen/agentchat/contrib/gpt_assistant_agent.py b/autogen/agentchat/contrib/gpt_assistant_agent.py
index 42056f4ca..417bbcdac 100644
--- a/autogen/agentchat/contrib/gpt_assistant_agent.py
+++ b/autogen/agentchat/contrib/gpt_assistant_agent.py
@@ -169,6 +169,7 @@ class GPTAssistantAgent(ConversableAgent):
# Tools are specified but overwrite_tools is False; do not update the assistant's tools
logger.warning("overwrite_tools is False. Using existing tools from assistant API.")
+ self.update_system_message(self._openai_assistant.instructions)
# lazily create threads
self._openai_threads = {}
self._unread_index = defaultdict(int)
diff --git a/test/agentchat/contrib/test_gpt_assistant.py b/test/agentchat/contrib/test_gpt_assistant.py
index 643e35e89..6fc69097f 100755
--- a/test/agentchat/contrib/test_gpt_assistant.py
+++ b/test/agentchat/contrib/test_gpt_assistant.py
@@ -28,6 +28,7 @@ if not skip_openai:
filter_dict={
"api_type": ["openai"],
"model": [
+ "gpt-4o",
"gpt-4-turbo",
"gpt-4-turbo-preview",
"gpt-4-0125-preview",
@@ -313,7 +314,7 @@ def test_assistant_retrieval() -> None:
"description": "This is a test function 1",
}
function_2_schema = {
- "name": "call_function_1",
+ "name": "call_function_2",
"parameters": {"type": "object", "properties": {}, "required": []},
"description": "This is a test function 2",
}
@@ -383,12 +384,12 @@ def test_assistant_mismatch_retrieval() -> None:
name = f"For test_assistant_retrieval {uuid.uuid4()}"
function_1_schema = {
- "name": "call_function",
+ "name": "call_function_1",
"parameters": {"type": "object", "properties": {}, "required": []},
"description": "This is a test function 1",
}
function_2_schema = {
- "name": "call_function",
+ "name": "call_function_2",
"parameters": {"type": "object", "properties": {}, "required": []},
"description": "This is a test function 2",
}