forked from phoenix/litellm-mirror
Allow overriding headers for anthropic
This commit is contained in:
parent
b6b584fdba
commit
3b719b2afd
2 changed files with 3 additions and 1 deletions
|
@ -105,8 +105,9 @@ def completion(
|
||||||
optional_params=None,
|
optional_params=None,
|
||||||
litellm_params=None,
|
litellm_params=None,
|
||||||
logger_fn=None,
|
logger_fn=None,
|
||||||
|
headers={},
|
||||||
):
|
):
|
||||||
headers = validate_environment(api_key)
|
headers = { **validate_environment(api_key), **headers }
|
||||||
if model in custom_prompt_dict:
|
if model in custom_prompt_dict:
|
||||||
# check if the model has a registered custom prompt
|
# check if the model has a registered custom prompt
|
||||||
model_prompt_details = custom_prompt_dict[model]
|
model_prompt_details = custom_prompt_dict[model]
|
||||||
|
|
|
@ -967,6 +967,7 @@ def completion(
|
||||||
encoding=encoding, # for calculating input/output tokens
|
encoding=encoding, # for calculating input/output tokens
|
||||||
api_key=api_key,
|
api_key=api_key,
|
||||||
logging_obj=logging,
|
logging_obj=logging,
|
||||||
|
headers=headers,
|
||||||
)
|
)
|
||||||
if "stream" in optional_params and optional_params["stream"] == True:
|
if "stream" in optional_params and optional_params["stream"] == True:
|
||||||
# don't try to access stream object,
|
# don't try to access stream object,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue