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"] )