mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
Fix: mypy chat transformation
This commit is contained in:
parent
c571a02f3b
commit
d145a36c90
1 changed files with 5 additions and 8 deletions
|
|
@ -222,17 +222,14 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
|
|||
"""
|
||||
if not isinstance(schema, dict):
|
||||
return schema
|
||||
|
||||
# Fields that Anthropic doesn't support in output_format
|
||||
|
||||
unsupported_fields = {"maxItems", "minItems"}
|
||||
|
||||
result = {}
|
||||
|
||||
result: Dict[str, Any] = {}
|
||||
for key, value in schema.items():
|
||||
# Skip unsupported fields
|
||||
if key in unsupported_fields:
|
||||
continue
|
||||
|
||||
# Recursively filter nested structures
|
||||
|
||||
if key == "properties" and isinstance(value, dict):
|
||||
result[key] = {
|
||||
k: AnthropicConfig.filter_anthropic_output_schema(v)
|
||||
|
|
@ -262,7 +259,7 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
|
|||
]
|
||||
else:
|
||||
result[key] = value
|
||||
|
||||
|
||||
return result
|
||||
|
||||
def get_json_schema_from_pydantic_object(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue