From 38b411a6cbb0193587482be7c347d7b3339644a4 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 1 Aug 2024 17:27:31 -0300 Subject: [PATCH] feat: Add extra_headers parameter to send_with_retries function --- aider/sendchat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/sendchat.py b/aider/sendchat.py index 7dfcbf145..19a4e3a1a 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -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()