Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, FinalAnswerTool,
|
| 7 |
from groq import Groq
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
@@ -17,14 +17,14 @@ class BasicAgent:
|
|
| 17 |
def __init__(self):
|
| 18 |
print("BasicAgent initialized.")
|
| 19 |
self.model = LiteLLMModel(
|
| 20 |
-
"
|
| 21 |
api_base="https://api.groq.com/openai/v1",
|
| 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
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, FinalAnswerTool, PythonInterpreterTool, Tool, tool, VisitWebpageTool, LiteLLMModel
|
| 7 |
from groq import Groq
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
|
|
| 17 |
def __init__(self):
|
| 18 |
print("BasicAgent initialized.")
|
| 19 |
self.model = LiteLLMModel(
|
| 20 |
+
"llama-3.1-8b-instant",
|
| 21 |
api_base="https://api.groq.com/openai/v1",
|
| 22 |
api_key=GROQ_KEY
|
| 23 |
)
|
| 24 |
self.model.flatten_messages_as_text = True
|
| 25 |
|
| 26 |
self.agent = CodeAgent(
|
| 27 |
+
tools=[DuckDuckGoSearchTool(), FinalAnswerTool(), VisitWebpageTool(), PythonInterpreterTool(), ],
|
| 28 |
model=self.model,
|
| 29 |
add_base_tools=True,
|
| 30 |
verbosity_level=2
|