mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(utils.py): only filter additional properties if gemini/vertex ai
This commit is contained in:
parent
92e5cd113d
commit
3007f0344d
2 changed files with 20 additions and 8 deletions
|
@ -2893,10 +2893,13 @@ def get_optional_params(
|
|||
response_format=non_default_params["response_format"]
|
||||
)
|
||||
# # clean out 'additionalProperties = False'. Causes vertexai/gemini OpenAI API Schema errors - https://github.com/langchain-ai/langchainjs/issues/5240
|
||||
if (
|
||||
non_default_params["response_format"].get("json_schema", {}).get("schema")
|
||||
is not None
|
||||
):
|
||||
if non_default_params["response_format"].get("json_schema", {}).get(
|
||||
"schema"
|
||||
) is not None and custom_llm_provider in [
|
||||
"gemini",
|
||||
"vertex_ai",
|
||||
"vertex_ai_beta",
|
||||
]:
|
||||
old_schema = copy.deepcopy(
|
||||
non_default_params["response_format"]
|
||||
.get("json_schema", {})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue