From f3b0a56a1fb9ecc758cdb512bd8f7e6b0d48caa6 Mon Sep 17 00:00:00 2001 From: shankar_ws3 Date: Mon, 13 May 2024 16:32:37 -0700 Subject: [PATCH 1/3] adding gpt4t as default model for old vision agent --- vision_agent/agent/vision_agent.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vision_agent/agent/vision_agent.py b/vision_agent/agent/vision_agent.py index 0e63a70b..42fcbee6 100644 --- a/vision_agent/agent/vision_agent.py +++ b/vision_agent/agent/vision_agent.py @@ -464,15 +464,17 @@ def __init__( report_progress_callback: a callback to report the progress of the agent. This is useful for streaming logs in a web application where multiple VisionAgent instances are running in parallel. This callback ensures that the progress are not mixed up. """ self.task_model = ( - OpenAILLM(json_mode=True, temperature=0.1) + OpenAILLM(model_name="gpt-4-turbo", json_mode=True, temperature=0.0) if task_model is None else task_model ) self.answer_model = ( - OpenAILLM(temperature=0.1) if answer_model is None else answer_model + OpenAILLM(model_name="gpt-4-turbo", temperature=0.0) + if answer_model is None + else answer_model ) self.reflect_model = ( - OpenAILMM(json_mode=True, temperature=0.1) + OpenAILMM(model_name="gpt-4-turbo", json_mode=True, temperature=0.0) if reflect_model is None else reflect_model ) From 24bdde58aacfed7fa1f3cb9e473353d040ee2c59 Mon Sep 17 00:00:00 2001 From: shankar_ws3 Date: Mon, 13 May 2024 16:35:32 -0700 Subject: [PATCH 2/3] adding test case --- tests/test_llm.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_llm.py b/tests/test_llm.py index b10ba7fc..8f065530 100644 --- a/tests/test_llm.py +++ b/tests/test_llm.py @@ -36,6 +36,19 @@ def test_chat_with_mock(openai_llm_mock): # noqa: F811 ) +@pytest.mark.parametrize( + "openai_llm_mock", ["mocked response"], indirect=["openai_llm_mock"] +) +def test_chat_with_mock(openai_llm_mock): # noqa: F811 + llm = OpenAILLM() + response = llm.chat([{"role": "user", "content": "test prompt"}]) + assert response == "mocked response" + openai_llm_mock.chat.completions.create.assert_called_once_with( + model="gpt-4-turbo", + messages=[{"role": "user", "content": "test prompt"}], + ) + + @pytest.mark.parametrize( "openai_llm_mock", ["mocked response"], indirect=["openai_llm_mock"] ) From e21df918992b0e7685e8f45420a538a151a912d0 Mon Sep 17 00:00:00 2001 From: shankar_ws3 Date: Mon, 13 May 2024 16:44:58 -0700 Subject: [PATCH 3/3] fix test case --- tests/test_llm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_llm.py b/tests/test_llm.py index 8f065530..40c8f8bc 100644 --- a/tests/test_llm.py +++ b/tests/test_llm.py @@ -37,13 +37,13 @@ def test_chat_with_mock(openai_llm_mock): # noqa: F811 @pytest.mark.parametrize( - "openai_llm_mock", ["mocked response"], indirect=["openai_llm_mock"] + "openai_llm_mock_turbo", ["mocked response"], indirect=["openai_llm_mock_turbo"] ) -def test_chat_with_mock(openai_llm_mock): # noqa: F811 +def openai_llm_mock_turbo(openai_llm_mock_2): # noqa: F811 llm = OpenAILLM() response = llm.chat([{"role": "user", "content": "test prompt"}]) assert response == "mocked response" - openai_llm_mock.chat.completions.create.assert_called_once_with( + openai_llm_mock_turbo.chat.completions.create.assert_called_once_with( model="gpt-4-turbo", messages=[{"role": "user", "content": "test prompt"}], )