melomba2 commited on
Commit
310b522
·
verified ·
1 Parent(s): b3da293

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -15,7 +15,7 @@ ANSWER_CACHE = {}
15
  # --- Basic Agent Definition ---
16
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
17
 
18
- class BasicAgent:
19
  def __init__(self):
20
  print("Initializing Gemini Agent...")
21
  api_key = os.getenv("GOOGLE_API_KEY")
@@ -23,6 +23,13 @@ class BasicAgent:
23
  raise ValueError("GOOGLE_API_KEY environment variable not set. Please set it in your Hugging Face Space secrets.")
24
 
25
  genai.configure(api_key=api_key)
 
 
 
 
 
 
 
26
  self.model = genai.GenerativeModel('gemini-2.5-pro')
27
  print("Gemini Agent initialized successfully.")
28
 
 
15
  # --- Basic Agent Definition ---
16
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
17
 
18
+ class SuperAgent:
19
  def __init__(self):
20
  print("Initializing Gemini Agent...")
21
  api_key = os.getenv("GOOGLE_API_KEY")
 
23
  raise ValueError("GOOGLE_API_KEY environment variable not set. Please set it in your Hugging Face Space secrets.")
24
 
25
  genai.configure(api_key=api_key)
26
+ # Define a system prompt to guide the model's behavior
27
+ self.system_prompt = (
28
+ "You are an expert AI assistant. Your goal is to answer the following question as accurately and concisely as possible. "
29
+ "Analyze the question carefully. If the question involves a file, you will receive the question text only. "
30
+ "Acknowledge that you cannot access files. If you cannot answer the question, state that clearly. "
31
+ "Do not guess."
32
+ )
33
  self.model = genai.GenerativeModel('gemini-2.5-pro')
34
  print("Gemini Agent initialized successfully.")
35