mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
Allow passing thinking
param to litellm proxy via client sdk + Code QA Refactor on get_optional_params (get correct values) (#9386)
* fix(litellm_proxy/chat/transformation.py): support 'thinking' param Fixes https://github.com/BerriAI/litellm/issues/9380 * feat(azure/gpt_transformation.py): add azure audio model support Closes https://github.com/BerriAI/litellm/issues/6305 * fix(utils.py): use provider_config in common functions * fix(utils.py): add missing provider configs to get_chat_provider_config * test: fix test * fix: fix path * feat(utils.py): make bedrock invoke nova config baseconfig compatible * fix: fix linting errors * fix(azure_ai/transformation.py): remove buggy optional param filtering for azure ai Removes incorrect check for support tool choice when calling azure ai - prevented calling models with response_format unless on litell model cost map * fix(amazon_cohere_transformation.py): fix bedrock invoke cohere transformation to inherit from coherechatconfig * test: fix azure ai tool choice mapping * fix: fix model cost map to add 'supports_tool_choice' to cohere models * fix(get_supported_openai_params.py): check if custom llm provider in llm providers * fix(get_supported_openai_params.py): fix llm provider in list check * fix: fix ruff check errors * fix: support defs when calling bedrock nova * fix(factory.py): fix test
This commit is contained in:
parent
fcf17d114f
commit
ac9f03beae
21 changed files with 278 additions and 86 deletions
|
@ -6,6 +6,7 @@ import httpx
|
|||
import litellm
|
||||
from litellm import supports_response_schema, supports_system_messages, verbose_logger
|
||||
from litellm.constants import DEFAULT_MAX_RECURSE_DEPTH
|
||||
from litellm.litellm_core_utils.prompt_templates.common_utils import unpack_defs
|
||||
from litellm.llms.base_llm.chat.transformation import BaseLLMException
|
||||
from litellm.types.llms.vertex_ai import PartType, Schema
|
||||
|
||||
|
@ -229,39 +230,6 @@ def filter_schema_fields(
|
|||
return result
|
||||
|
||||
|
||||
def unpack_defs(schema, defs):
|
||||
properties = schema.get("properties", None)
|
||||
if properties is None:
|
||||
return
|
||||
|
||||
for name, value in properties.items():
|
||||
ref_key = value.get("$ref", None)
|
||||
if ref_key is not None:
|
||||
ref = defs[ref_key.split("defs/")[-1]]
|
||||
unpack_defs(ref, defs)
|
||||
properties[name] = ref
|
||||
continue
|
||||
|
||||
anyof = value.get("anyOf", None)
|
||||
if anyof is not None:
|
||||
for i, atype in enumerate(anyof):
|
||||
ref_key = atype.get("$ref", None)
|
||||
if ref_key is not None:
|
||||
ref = defs[ref_key.split("defs/")[-1]]
|
||||
unpack_defs(ref, defs)
|
||||
anyof[i] = ref
|
||||
continue
|
||||
|
||||
items = value.get("items", None)
|
||||
if items is not None:
|
||||
ref_key = items.get("$ref", None)
|
||||
if ref_key is not None:
|
||||
ref = defs[ref_key.split("defs/")[-1]]
|
||||
unpack_defs(ref, defs)
|
||||
value["items"] = ref
|
||||
continue
|
||||
|
||||
|
||||
def convert_anyof_null_to_nullable(schema, depth=0):
|
||||
if depth > DEFAULT_MAX_RECURSE_DEPTH:
|
||||
raise ValueError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue