mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix(utils.py): function_setup empty message fix
fixes https://github.com/BerriAI/litellm/issues/2858
This commit is contained in:
parent
b38c09c87f
commit
6eb8fe35c8
2 changed files with 231 additions and 202 deletions
33
litellm/tests/test_function_setup.py
Normal file
33
litellm/tests/test_function_setup.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
# What is this?
|
||||
## Unit tests for the 'function_setup()' function
|
||||
import sys, os
|
||||
import traceback
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
import os, io
|
||||
|
||||
sys.path.insert(
|
||||
0, os.path.abspath("../..")
|
||||
) # Adds the parent directory to the, system path
|
||||
import pytest, uuid
|
||||
from litellm.utils import function_setup, Rules
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
def test_empty_content():
|
||||
"""
|
||||
Make a chat completions request with empty content -> expect this to work
|
||||
"""
|
||||
rules_obj = Rules()
|
||||
|
||||
def completion():
|
||||
pass
|
||||
|
||||
function_setup(
|
||||
original_function=completion,
|
||||
rules_obj=rules_obj,
|
||||
start_time=datetime.now(),
|
||||
messages=[],
|
||||
litellm_call_id=str(uuid.uuid4()),
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue