Skip to content

Commit

Permalink
Merge pull request #1513 from costly-ai/main
Browse files Browse the repository at this point in the history
Allow overriding headers for anthropic
  • Loading branch information
ishaan-jaff authored Jan 19, 2024
2 parents 6bc7cc4 + 3b719b2 commit 6134b65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion litellm/llms/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions litellm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,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,
Expand Down

0 comments on commit 6134b65

Please sign in to comment.