Saiteja1981's picture
Update app.py
e84cd6c verified
Raw
History Blame
819 Bytes
```python
import google.generativeai as genai
class BasicAgent:
def __init__(self):
api_key = os.getenv("AIzaSyANWl4RBntGQDkPU4ll_3hWd8GmjWtOGt0")
genai.configure(api_key=api_key)
self.model = genai.GenerativeModel(
"gemini-1.5-flash"
)
print("Gemini Agent initialized.")
def __call__(self, question: str) -> str:
print(f"Question: {question[:100]}")
prompt = f"""
You are a GAIA benchmark assistant.
Answer the question carefully.
IMPORTANT:
- Return ONLY the final answer.
- No explanation.
- No extra text.
- No formatting.
- Exact answer only.
Question:
{question}
"""
response = self.model.generate_content(prompt)
answer = response.text.strip()
print(f"Answer: {answer}")
return answer
```