Skip to content

Commit e842aec

Browse files
committed
Add default headers for OpenRouter API in _create_llm function
1 parent b33d435 commit e842aec

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tradingbot/utils/aitools.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ def _create_llm(model: str, api_key: str) -> ChatOpenAI:
9898
model=model,
9999
base_url=OPENROUTER_BASE_URL,
100100
api_key=api_key,
101+
default_headers={
102+
"X-Title": "python_tradingbot_framework",
103+
'HTTP-Referer': 'https://github.com/JustinGuese/python_tradingbot_framework',
104+
"X-OpenRouter-Categories" : "personal-agent,cloud-agent"
105+
},
101106
)
102107

103108

0 commit comments

Comments
 (0)