working chat, text for codestral

This commit is contained in:
Ishaan Jaff 2024-06-17 11:30:22 -07:00
parent 3ae05c0404
commit 5f76f96e4d
3 changed files with 48 additions and 6 deletions

View file

@ -817,6 +817,30 @@ def test_completion_mistral_api():
pytest.fail(f"Error occurred: {e}")
@pytest.mark.asyncio
async def test_completion_codestral_chat_api():
try:
litellm.set_verbose = True
response = await litellm.acompletion(
model="codestral/codestral-latest",
max_tokens=5,
messages=[
{
"role": "user",
"content": "Hey, how's it going?",
}
],
)
# Add any assertions here to check the response
print(response)
# cost = litellm.completion_cost(completion_response=response)
# print("cost to make mistral completion=", cost)
# assert cost > 0.0
except Exception as e:
pytest.fail(f"Error occurred: {e}")
def test_completion_mistral_api_mistral_large_function_call():
litellm.set_verbose = True
tools = [