Skip to content

Commit 91671e5

Browse files
fix: attribute redeploy openrouter requests
1 parent 4a85f0c commit 91671e5

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

redeploy/heal.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ def ask_llm(
160160
kwargs["api_key"] = api_key
161161
if api_base:
162162
kwargs["api_base"] = api_base
163+
kwargs["extra_headers"] = {
164+
"HTTP-Referer": os.getenv(
165+
"OPENROUTER_APP_URL", "https://github.com/semcod/redeploy"
166+
),
167+
"X-OpenRouter-Title": os.getenv("OPENROUTER_APP_NAME", "redeploy"),
168+
}
163169

164170
resp = litellm.completion(**kwargs)
165171
return resp.choices[0].message.content.strip()

redeploy/heal/hint_provider.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ def ask_llm(
176176
kwargs["api_key"] = api_key
177177
if api_base:
178178
kwargs["api_base"] = api_base
179+
kwargs["extra_headers"] = {
180+
"HTTP-Referer": os.getenv(
181+
"OPENROUTER_APP_URL", "https://github.com/semcod/redeploy"
182+
),
183+
"X-OpenRouter-Title": os.getenv("OPENROUTER_APP_NAME", "redeploy"),
184+
}
179185

180186
# Suppress litellm stdout/stderr spam (Provider List, etc.)
181187
import contextlib

0 commit comments

Comments
 (0)