(feat) exception mapping for cohere_chat

This commit is contained in:
ishaan-jaff 2024-03-12 10:45:42 -07:00
parent 8fabaed543
commit e5bb65669d
2 changed files with 58 additions and 1 deletions

View file

@ -1980,6 +1980,29 @@ def test_chat_completion_cohere():
pytest.fail(f"Error occurred: {e}")
def test_chat_completion_cohere_stream():
try:
litellm.set_verbose = False
messages = [
{"role": "system", "content": "You're a good bot"},
{
"role": "user",
"content": "Hey",
},
]
response = completion(
model="cohere_chat/command-r",
messages=messages,
max_tokens=10,
stream=True,
)
print(response)
for chunk in response:
print(chunk)
except Exception as e:
pytest.fail(f"Error occurred: {e}")
def test_azure_cloudflare_api():
litellm.set_verbose = True
try: