feat: Add extra_headers parameter to send_with_retries function

This commit is contained in:
Paul Gauthier (aider) 2024-08-01 17:27:31 -03:00
parent 83b72c5a5d
commit 38b411a6cb

View file

@ -57,7 +57,7 @@ def lazy_litellm_retry_decorator(func):
@lazy_litellm_retry_decorator
def send_with_retries(model_name, messages, functions, stream, temperature=0):
def send_with_retries(model_name, messages, functions, stream, temperature=0, extra_headers=None):
from aider.llm import litellm
kwargs = dict(
@ -68,6 +68,8 @@ def send_with_retries(model_name, messages, functions, stream, temperature=0):
)
if functions is not None:
kwargs["functions"] = functions
if extra_headers is not None:
kwargs["extra_headers"] = extra_headers
key = json.dumps(kwargs, sort_keys=True).encode()