Skip to content

Commit

Permalink
fix openai compatible changes (microsoft#2718)
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
  • Loading branch information
IANTHEREAL and ekzhu committed May 22, 2024
1 parent 22a5666 commit 180acfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions autogen/agentchat/contrib/gpt_assistant_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def __init__(
# 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)
Expand Down
7 changes: 4 additions & 3 deletions test/agentchat/contrib/test_gpt_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
filter_dict={
"api_type": ["openai"],
"model": [
"gpt-4o",
"gpt-4-turbo",
"gpt-4-turbo-preview",
"gpt-4-0125-preview",
Expand Down Expand Up @@ -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",
}
Expand Down Expand Up @@ -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",
}
Expand Down

0 comments on commit 180acfa

Please sign in to comment.