Shakeel401 commited on
Commit
35018c9
·
verified ·
1 Parent(s): d5ef06c

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +10 -0
agent.py CHANGED
@@ -5,6 +5,16 @@ from typing import Optional
5
 
6
  from agents import Agent, Runner, SQLiteSession
7
  from get_kb import fetch_kb, KB_PATH # our tool
 
 
 
 
 
 
 
 
 
 
8
 
9
  # System-level instructions (short, precise)
10
  SYSTEM_PROMPT = """
 
5
 
6
  from agents import Agent, Runner, SQLiteSession
7
  from get_kb import fetch_kb, KB_PATH # our tool
8
+ import os
9
+ from dotenv import load_dotenv
10
+ load_dotenv()
11
+
12
+ OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
13
+
14
+ if not OPENAI_API_KEY:
15
+ raise ValueError("Missing OPENAI_API_KEY ENV variable. Please export it before running.")
16
+
17
+ os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY
18
 
19
  # System-level instructions (short, precise)
20
  SYSTEM_PROMPT = """