mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
refactor: cleanup dead codeblock (#7936)
* refactor: cleanup dead codeblock * fix(main.py): add extra headers to headers * fix: remove dead codeblock
This commit is contained in:
parent
77bb7f0717
commit
0208780a41
2 changed files with 3 additions and 36 deletions
|
@ -837,6 +837,7 @@ def completion( # type: ignore # noqa: PLR0915
|
|||
Optional[ProviderSpecificHeader], kwargs.get("provider_specific_header", None)
|
||||
)
|
||||
headers = kwargs.get("headers", None) or extra_headers
|
||||
|
||||
ensure_alternating_roles: Optional[bool] = kwargs.get(
|
||||
"ensure_alternating_roles", None
|
||||
)
|
||||
|
@ -848,6 +849,8 @@ def completion( # type: ignore # noqa: PLR0915
|
|||
)
|
||||
if headers is None:
|
||||
headers = {}
|
||||
if extra_headers is not None:
|
||||
headers.update(extra_headers)
|
||||
num_retries = kwargs.get(
|
||||
"num_retries", None
|
||||
) ## alt. param for 'max_retries'. Use this to pass retries w/ instructor.
|
||||
|
@ -1052,14 +1055,9 @@ def completion( # type: ignore # noqa: PLR0915
|
|||
api_version=api_version,
|
||||
parallel_tool_calls=parallel_tool_calls,
|
||||
messages=messages,
|
||||
extra_headers=extra_headers,
|
||||
**non_default_params,
|
||||
)
|
||||
|
||||
extra_headers = optional_params.pop("extra_headers", None)
|
||||
if extra_headers is not None:
|
||||
headers.update(extra_headers)
|
||||
|
||||
if litellm.add_function_to_prompt and optional_params.get(
|
||||
"functions_unsupported_model", None
|
||||
): # if user opts to add it to prompt, when API doesn't support function calling
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue