mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
Litellm dev 01 25 2025 p2 (#8003)
* fix(base_utils.py): supported nested json schema passed in for anthropic calls * refactor(base_utils.py): refactor ref parsing to prevent infinite loop * test(test_openai_endpoints.py): refactor anthropic test to use bedrock * fix(langfuse_prompt_management.py): add unit test for sync langfuse calls Resolves https://github.com/BerriAI/litellm/issues/7938#issuecomment-2613293757
This commit is contained in:
parent
fe24e729a9
commit
26a4958be5
12 changed files with 214 additions and 5 deletions
|
@ -1567,3 +1567,49 @@ async def test_wrapper_kwargs_passthrough():
|
|||
litellm_logging_obj.model_call_details["litellm_params"]["base_model"]
|
||||
== "gpt-4o-mini"
|
||||
)
|
||||
|
||||
|
||||
def test_dict_to_response_format_helper():
|
||||
from litellm.llms.base_llm.base_utils import _dict_to_response_format_helper
|
||||
|
||||
args = {
|
||||
"response_format": {
|
||||
"type": "json_schema",
|
||||
"json_schema": {
|
||||
"schema": {
|
||||
"$defs": {
|
||||
"CalendarEvent": {
|
||||
"properties": {
|
||||
"name": {"title": "Name", "type": "string"},
|
||||
"date": {"title": "Date", "type": "string"},
|
||||
"participants": {
|
||||
"items": {"type": "string"},
|
||||
"title": "Participants",
|
||||
"type": "array",
|
||||
},
|
||||
},
|
||||
"required": ["name", "date", "participants"],
|
||||
"title": "CalendarEvent",
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"events": {
|
||||
"items": {"$ref": "#/$defs/CalendarEvent"},
|
||||
"title": "Events",
|
||||
"type": "array",
|
||||
}
|
||||
},
|
||||
"required": ["events"],
|
||||
"title": "EventsList",
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
},
|
||||
"name": "EventsList",
|
||||
"strict": True,
|
||||
},
|
||||
},
|
||||
"ref_template": "/$defs/{model}",
|
||||
}
|
||||
_dict_to_response_format_helper(**args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue