fix(palm.py): exception mapping bad requests / filtered responses

This commit is contained in:
Krrish Dholakia 2023-11-14 11:53:06 -08:00
parent e1a567a353
commit e9e86cac79
3 changed files with 24 additions and 7 deletions

View file

@ -58,7 +58,7 @@ def test_completion_claude():
except Exception as e:
pytest.fail(f"Error occurred: {e}")
test_completion_claude()
# test_completion_claude()
# def test_completion_oobabooga():
# try:
@ -1352,7 +1352,7 @@ def test_completion_deep_infra():
print(response)
except Exception as e:
pytest.fail(f"Error occurred: {e}")
test_completion_deep_infra()
# test_completion_deep_infra()
def test_completion_deep_infra_mistral():
print("deep infra test with temp=0")
@ -1374,15 +1374,16 @@ def test_completion_deep_infra_mistral():
# Palm tests
def test_completion_palm():
# litellm.set_verbose = True
litellm.set_verbose = True
model_name = "palm/chat-bison"
messages = [{"role": "user", "content": "what model are you?"}]
try:
response = completion(model=model_name, messages=messages, stop=["stop"])
response = completion(model=model_name, messages=messages)
# Add any assertions here to check the response
print(response)
except Exception as e:
pytest.fail(f"Error occurred: {e}")
# test_completion_palm()
test_completion_palm()
# test palm with streaming
def test_completion_palm_stream():
@ -1462,4 +1463,4 @@ def test_moderation():
print(output)
return output
test_moderation()
# test_moderation()