mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
make benchmark listen to openai_api_base env var
This commit is contained in:
parent
9e656945fe
commit
93f32d3855
1 changed files with 2 additions and 2 deletions
|
@ -787,11 +787,10 @@ def run_test(
|
||||||
chat_history_file=history_fname,
|
chat_history_file=history_fname,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check if AIDER_DOCKER environment variable is set and create client accordingly
|
|
||||||
if "OPENAI_API_BASE" in os.environ and "openrouter.ai" in os.environ["OPENAI_API_BASE"]:
|
if "OPENAI_API_BASE" in os.environ and "openrouter.ai" in os.environ["OPENAI_API_BASE"]:
|
||||||
client = openai.OpenAI(
|
client = openai.OpenAI(
|
||||||
api_key=os.environ["OPENAI_API_KEY"],
|
api_key=os.environ["OPENAI_API_KEY"],
|
||||||
base_url=os.environ.get("OPENAI_API_BASE", "https://api.openai.com"),
|
base_url=os.environ.get("OPENAI_API_BASE"),
|
||||||
default_headers={
|
default_headers={
|
||||||
"HTTP-Referer": "http://aider.chat",
|
"HTTP-Referer": "http://aider.chat",
|
||||||
"X-Title": "Aider",
|
"X-Title": "Aider",
|
||||||
|
@ -800,6 +799,7 @@ def run_test(
|
||||||
else:
|
else:
|
||||||
client = openai.OpenAI(
|
client = openai.OpenAI(
|
||||||
api_key=os.environ["OPENAI_API_KEY"],
|
api_key=os.environ["OPENAI_API_KEY"],
|
||||||
|
base_url=os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1"),
|
||||||
)
|
)
|
||||||
|
|
||||||
main_model = models.Model.create(model_name, client)
|
main_model = models.Model.create(model_name, client)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue