mahadewa commited on
Commit
a8f6f00
·
verified ·
1 Parent(s): ce8cf32

Update base_agent.py

Browse files
Files changed (1) hide show
  1. base_agent.py +8 -3
base_agent.py CHANGED
@@ -9,12 +9,17 @@ class BaseAgent:
9
 
10
  def __init__(self, model):
11
  """Initialize the base agent with the specified model."""
12
- print("Initializing Base Agent with " + model)
13
  if model is None:
14
  model = os.getenv("DEFAULT_LLM_MODEL")
15
-
 
 
16
  openai_key = os.getenv("OPENAI_API_KEY")
17
- print("OpenAI Key = " + openai_key)
 
 
 
18
  self.model = model
19
  print("Init Client")
20
  self.client = OpenAI(api_key=openai_key)
 
9
 
10
  def __init__(self, model):
11
  """Initialize the base agent with the specified model."""
12
+ print(f"Initializing Base Agent with {model}")
13
  if model is None:
14
  model = os.getenv("DEFAULT_LLM_MODEL")
15
+ if model is None:
16
+ raise ValueError("No model specified and DEFAULT_LLM_MODEL not set")
17
+
18
  openai_key = os.getenv("OPENAI_API_KEY")
19
+ if openai_key is None:
20
+ raise ValueError("OPENAI_API_KEY environment variable not set")
21
+ print(f"OpenAI Key = {openai_key}")
22
+
23
  self.model = model
24
  print("Init Client")
25
  self.client = OpenAI(api_key=openai_key)