mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(utils.py): drop response_format if 'drop_params=True' for gpt-4
This commit is contained in:
parent
5d3fe52a08
commit
12942c39db
3 changed files with 76 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
import sys, os
|
||||
import sys, os, json
|
||||
import traceback
|
||||
from dotenv import load_dotenv
|
||||
|
||||
|
@ -1054,6 +1054,25 @@ def test_completion_azure_gpt4_vision():
|
|||
# test_completion_azure_gpt4_vision()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", ["gpt-3.5-turbo", "gpt-4", "gpt-4o"])
|
||||
def test_completion_openai_params(model):
|
||||
litellm.drop_params = True
|
||||
messages = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": """Generate JSON about Bill Gates: { "full_name": "", "title": "" }""",
|
||||
}
|
||||
]
|
||||
|
||||
response = completion(
|
||||
model=model,
|
||||
messages=messages,
|
||||
response_format={"type": "json_object"},
|
||||
)
|
||||
|
||||
print(f"response: {response}")
|
||||
|
||||
|
||||
def test_completion_fireworks_ai():
|
||||
try:
|
||||
litellm.set_verbose = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue