Allow overriding headers for anthropic

This commit is contained in:
Keegan McCallum 2024-01-18 20:12:59 -08:00 committed by GitHub
parent b6b584fdba
commit 3b719b2afd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -105,8 +105,9 @@ def completion(
optional_params=None,
litellm_params=None,
logger_fn=None,
headers={},
):
headers = validate_environment(api_key)
headers = { **validate_environment(api_key), **headers }
if model in custom_prompt_dict:
# check if the model has a registered custom prompt
model_prompt_details = custom_prompt_dict[model]

View file

@ -967,6 +967,7 @@ def completion(
encoding=encoding, # for calculating input/output tokens
api_key=api_key,
logging_obj=logging,
headers=headers,
)
if "stream" in optional_params and optional_params["stream"] == True:
# don't try to access stream object,