Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,8 @@ import json
|
|
| 11 |
import boto3
|
| 12 |
from smolagents import FinalAnswerTool, Tool, tool, OpenAIServerModel, DuckDuckGoSearchTool, CodeAgent, VisitWebpageTool
|
| 13 |
from nova_agent import NovaProAgent
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
from dotenv import load_dotenv
|
| 17 |
|
|
@@ -91,11 +92,10 @@ class SlpMultiAgent:
|
|
| 91 |
short_question = question # [:MAX_QUESTION_LENGTH]
|
| 92 |
|
| 93 |
# Use cheaper, faster model
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
)
|
| 99 |
|
| 100 |
# Create only essential agents with reduced complexity
|
| 101 |
research_agent = CodeAgent(
|
|
@@ -229,7 +229,7 @@ async def run_and_submit_all(profile):
|
|
| 229 |
|
| 230 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 231 |
try:
|
| 232 |
-
agent =
|
| 233 |
except Exception as e:
|
| 234 |
print(f"Error instantiating agent: {e}")
|
| 235 |
return f"Error initializing agent: {e}", None
|
|
|
|
| 11 |
import boto3
|
| 12 |
from smolagents import FinalAnswerTool, Tool, tool, OpenAIServerModel, DuckDuckGoSearchTool, CodeAgent, VisitWebpageTool
|
| 13 |
from nova_agent import NovaProAgent
|
| 14 |
+
|
| 15 |
+
import google.generativeai as genai
|
| 16 |
|
| 17 |
from dotenv import load_dotenv
|
| 18 |
|
|
|
|
| 92 |
short_question = question # [:MAX_QUESTION_LENGTH]
|
| 93 |
|
| 94 |
# Use cheaper, faster model
|
| 95 |
+
api_key = os.getenv('GOOGLE_API_KEY')
|
| 96 |
+
genai.configure(api_key=api_key)
|
| 97 |
+
|
| 98 |
+
model = genai.GenerativeModel('gemini-2.0-flash-exp')
|
|
|
|
| 99 |
|
| 100 |
# Create only essential agents with reduced complexity
|
| 101 |
research_agent = CodeAgent(
|
|
|
|
| 229 |
|
| 230 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 231 |
try:
|
| 232 |
+
agent = SlpMultiAgent()
|
| 233 |
except Exception as e:
|
| 234 |
print(f"Error instantiating agent: {e}")
|
| 235 |
return f"Error initializing agent: {e}", None
|