forked from phoenix/litellm-mirror
(feat) exception mapping for cohere_chat
This commit is contained in:
parent
8fabaed543
commit
e5bb65669d
2 changed files with 58 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue