mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
initial code for working with openrouter
This commit is contained in:
parent
8c580dd332
commit
041f3a4a38
11 changed files with 99 additions and 26 deletions
|
@ -50,6 +50,12 @@ def send_with_retries(model, messages, functions, stream):
|
|||
if hasattr(openai, "api_engine"):
|
||||
kwargs["engine"] = openai.api_engine
|
||||
|
||||
if "openrouter.ai" in openai.api_base:
|
||||
kwargs["headers"] = {
|
||||
"HTTP-Referer": "http://aider.chat",
|
||||
"X-Title": "Aider"
|
||||
}
|
||||
|
||||
key = json.dumps(kwargs, sort_keys=True).encode()
|
||||
|
||||
# Generate SHA1 hash of kwargs and append it to chat_completion_call_hashes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue