Skip to content

Commit e3e3653

Browse files
committed
Format again
1 parent 50d142f commit e3e3653

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

openrouter-api/ask_auto_model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
api_key = os.getenv("OPENROUTER_API_KEY")
77

8-
headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
8+
headers = {
9+
"Authorization": f"Bearer {api_key}",
10+
"Content-Type": "application/json",
11+
}
912
payload = {
1013
"model": "openrouter/auto",
1114
"messages": [{"role": "user", "content": "Say hello in one sentence."}],

openrouter-api/ask_specific_model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
api_key = os.getenv("OPENROUTER_API_KEY")
77

8-
headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
8+
headers = {
9+
"Authorization": f"Bearer {api_key}",
10+
"Content-Type": "application/json",
11+
}
912
payload = {
1013
"model": "openai/gpt-3.5-turbo",
1114
"messages": [{"role": "user", "content": "Say hello in one sentence."}],

openrouter-api/fallback_models.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,21 @@
77

88

99
def make_request_with_fallback(models_list, messages):
10-
headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
10+
headers = {
11+
"Authorization": f"Bearer {api_key}",
12+
"Content-Type": "application/json",
13+
}
1114
payload = {"models": models_list, "messages": messages}
1215

1316
return requests.post(OPENROUTER_API_URL, headers=headers, json=payload)
1417

1518

1619
response = make_request_with_fallback(
17-
models_list=["openai/gpt-5", "openai/gpt-3.5-turbo", "openai/gpt-3.5-turbo-16k"],
20+
models_list=[
21+
"openai/gpt-5",
22+
"openai/gpt-3.5-turbo",
23+
"openai/gpt-3.5-turbo-16k",
24+
],
1825
messages=[{"role": "user", "content": "What is the capital of France?"}],
1926
)
2027

openrouter-api/route_requests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88

99
def make_request(model, messages, provider_config=None):
10-
headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
10+
headers = {
11+
"Authorization": f"Bearer {api_key}",
12+
"Content-Type": "application/json",
13+
}
1114
payload = {"model": model, "messages": messages}
1215
if provider_config:
1316
payload["provider"] = provider_config

0 commit comments

Comments
 (0)