diff --git a/litellm/llms/openai.py b/litellm/llms/openai.py index 93f4c2d95..2065a724b 100644 --- a/litellm/llms/openai.py +++ b/litellm/llms/openai.py @@ -1033,7 +1033,7 @@ class OpenAITextCompletion(BaseLLM): ): prompt = messages[0]["content"] else: - prompt = " ".join([message["content"] for message in messages]) # type: ignore + prompt = [message["content"] for message in messages] # type: ignore # don't send max retries to the api, if set diff --git a/litellm/tests/test_text_completion.py b/litellm/tests/test_text_completion.py index 84e3bb5de..0b4103ca0 100644 --- a/litellm/tests/test_text_completion.py +++ b/litellm/tests/test_text_completion.py @@ -3775,12 +3775,12 @@ def test_completion_openai_prompt(): try: print("\n text 003 test\n") response = text_completion( - model="gpt-3.5-turbo-instruct", prompt="What's the weather in SF?" + model="gpt-3.5-turbo-instruct", + prompt=["What's the weather in SF?", "How is Manchester?"], ) print(response) + assert len(response.choices) == 2 response_str = response["choices"][0]["text"] - # print(response.choices[0]) - # print(response.choices[0].text) except Exception as e: pytest.fail(f"Error occurred: {e}")