Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep GPT4-Turbo for old vision agent #82

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/test_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ def test_chat_with_mock(openai_llm_mock): # noqa: F811
)


@pytest.mark.parametrize(
"openai_llm_mock_turbo", ["mocked response"], indirect=["openai_llm_mock_turbo"]
)
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_turbo.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"]
)
Expand Down
8 changes: 5 additions & 3 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Loading