Update app.py
Browse files
app.py
CHANGED
|
@@ -22,19 +22,19 @@ class BasicAgent:
|
|
| 22 |
api_key=GROQ_KEY
|
| 23 |
)
|
| 24 |
self.model.flatten_messages_as_text = True
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 28 |
-
agent = CodeAgent(
|
| 29 |
tools=[DuckDuckGoSearchTool(), FinalAnswerTool(), VisitWebpageTool()],
|
| 30 |
-
model=model,
|
| 31 |
add_base_tools=True,
|
| 32 |
verbosity_level=2
|
| 33 |
)
|
| 34 |
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
print(response)
|
| 37 |
-
return
|
| 38 |
|
| 39 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 40 |
"""
|
|
|
|
| 22 |
api_key=GROQ_KEY
|
| 23 |
)
|
| 24 |
self.model.flatten_messages_as_text = True
|
| 25 |
+
|
| 26 |
+
self.agent = CodeAgent(
|
|
|
|
|
|
|
| 27 |
tools=[DuckDuckGoSearchTool(), FinalAnswerTool(), VisitWebpageTool()],
|
| 28 |
+
model=self.model,
|
| 29 |
add_base_tools=True,
|
| 30 |
verbosity_level=2
|
| 31 |
)
|
| 32 |
|
| 33 |
+
def __call__(self, question: str) -> str:
|
| 34 |
+
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 35 |
+
response = self.agent.run(question)
|
| 36 |
print(response)
|
| 37 |
+
return response
|
| 38 |
|
| 39 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 40 |
"""
|