From 4dd7e2519f8734b5301b44ed517594456bda87f0 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Wed, 8 Nov 2023 11:59:31 -0800 Subject: [PATCH] (test) add text completion steaming test --- litellm/tests/test_text_completion.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/litellm/tests/test_text_completion.py b/litellm/tests/test_text_completion.py index b268bb4e766..b31e01682fa 100644 --- a/litellm/tests/test_text_completion.py +++ b/litellm/tests/test_text_completion.py @@ -122,4 +122,14 @@ def test_completion_hf_prompt_array(): # response_str = response["choices"][0]["text"] except Exception as e: pytest.fail(f"Error occurred: {e}") -test_completion_hf_prompt_array() +# test_completion_hf_prompt_array() + +def test_text_completion_stream(): + response = text_completion( + model="huggingface/mistralai/Mistral-7B-v0.1", + prompt="good morning", + stream=True + ) + for chunk in response: + print(chunk) +test_text_completion_stream()