mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(utils.py): fix fix pydantic obj to schema creation for vertex en… (#6071)
* fix(utils.py): fix fix pydantic obj to schema creation for vertex endpoints Fixes https://github.com/BerriAI/litellm/issues/6027 * test(test_completion.pyu): skip test - avoid hitting gemini rate limits * fix(common_utils.py): fix ruff linting error
This commit is contained in:
parent
29da2d49d6
commit
49d8b2be46
3 changed files with 143 additions and 1 deletions
|
@ -2996,12 +2996,16 @@ def get_optional_params(
|
|||
"vertex_ai_beta",
|
||||
]
|
||||
):
|
||||
from litellm.llms.vertex_ai_and_google_ai_studio.common_utils import (
|
||||
_build_vertex_schema,
|
||||
)
|
||||
old_schema = copy.deepcopy(
|
||||
non_default_params["response_format"]
|
||||
.get("json_schema", {})
|
||||
.get("schema")
|
||||
)
|
||||
new_schema = _remove_additional_properties(schema=old_schema)
|
||||
new_schema = _build_vertex_schema(parameters=new_schema)
|
||||
non_default_params["response_format"]["json_schema"]["schema"] = new_schema
|
||||
if "tools" in non_default_params and isinstance(
|
||||
non_default_params, list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue