added vertex ai streaming

This commit is contained in:
ishaan-jaff 2023-09-15 14:15:08 -07:00
parent 5ec1fc5048
commit f1d18f1637

View file

@ -734,6 +734,22 @@ def test_completion_bedrock_ai21():
# pytest.fail(f"Error occurred: {e}") # pytest.fail(f"Error occurred: {e}")
# test_vertex_ai() # test_vertex_ai()
# def test_vertex_ai_stream():
# litellm.vertex_project = "hardy-device-386718"
# litellm.vertex_location = "us-central1"
# test_models = litellm.vertex_chat_models + litellm.vertex_code_chat_models + litellm.vertex_text_models + litellm.vertex_code_text_models
# for model in test_models:
# try:
# print("making request", model)
# response = completion(model=model, messages=[{"role": "user", "content": "write code for saying hi"}], stream=True)
# print(response)
# for chunk in response:
# print(chunk)
# # pass
# except Exception as e:
# pytest.fail(f"Error occurred: {e}")
# test_vertex_ai_stream()
def test_completion_with_fallbacks(): def test_completion_with_fallbacks():
fallbacks = ["gpt-3.5-turb", "gpt-3.5-turbo", "command-nightly"] fallbacks = ["gpt-3.5-turb", "gpt-3.5-turbo", "command-nightly"]