Skip to content

Commit

Permalink
Merge pull request #217 from leeeizhang/lei/openai-base-url
Browse files Browse the repository at this point in the history
[MRG] add manual openai base_url
  • Loading branch information
huangyz0918 authored Sep 20, 2024
2 parents c802a3c + 24fb280 commit f377b78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mle/model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import copy
import importlib.util
import json
Expand Down Expand Up @@ -107,7 +108,10 @@ def __init__(self, api_key, model, temperature=0.7):
self.model = model if model else 'gpt-4o-2024-08-06'
self.model_type = MODEL_OPENAI
self.temperature = temperature
self.client = self.openai(api_key=api_key)
self.client = self.openai(
api_key=api_key,
base_url=os.getenv("OPENAI_BASE_URL", "https://api.openai.com/v1"),
)
self.func_call_history = []

def query(self, chat_history, **kwargs):
Expand Down

0 comments on commit f377b78

Please sign in to comment.