diff --git a/litellm/tests/test_streaming.py b/litellm/tests/test_streaming.py index 155633da13..10aa05536b 100644 --- a/litellm/tests/test_streaming.py +++ b/litellm/tests/test_streaming.py @@ -398,6 +398,35 @@ def test_completion_claude_stream(): # test_completion_claude_stream() +def test_completion_palm_stream(): + try: + messages = [ + {"role": "system", "content": "You are a helpful assistant."}, + { + "role": "user", + "content": "how does a court case get to the Supreme Court?", + }, + ] + print("testing palm streaming") + response = completion( + model="palm/chat-bison", messages=messages, stream=True + ) + + complete_response = "" + # Add any assertions here to check the response + for idx, chunk in enumerate(response): + chunk, finished = streaming_format_tests(idx, chunk) + if finished: + break + complete_response += chunk + if complete_response.strip() == "": + raise Exception("Empty response received") + print(f"completion_response: {complete_response}") + except Exception as e: + pytest.fail(f"Error occurred: {e}") +# test_completion_palm_stream() + + def test_completion_claude_stream_bad_key(): try: api_key = "bad-key"