fix openai compatible changes (#2718)

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
This commit is contained in:
Ian 2024-05-23 03:53:09 +08:00 committed by GitHub
parent fb74624376
commit b698a98eb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -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)

View File

@ -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",
}