arrow072 commited on
Commit
08fff15
·
verified ·
1 Parent(s): 5feca69

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +4 -3
inference.py CHANGED
@@ -9,10 +9,11 @@ import openai
9
 
10
  class LLMAgent:
11
  def __init__(self):
12
- api_base = os.environ.get("API_BASE_URL") or "https://api.openai.com/v1"
13
- api_key = os.environ.get("API_KEY") or "dummy"
14
  try:
15
- self.client = openai.OpenAI(base_url=api_base, api_key=api_key)
 
 
 
16
  except Exception:
17
  self.client = None
18
  self.fallback = RuleBasedAgent()
 
9
 
10
  class LLMAgent:
11
  def __init__(self):
 
 
12
  try:
13
+ self.client = openai.OpenAI(
14
+ base_url=os.environ["API_BASE_URL"],
15
+ api_key=os.environ["API_KEY"]
16
+ )
17
  except Exception:
18
  self.client = None
19
  self.fallback = RuleBasedAgent()