Spaces:
Runtime error
Runtime error
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, OpenAIServerModel, DuckDuckGoSearchTool, WikipediaSearchTool
|
| 7 |
from smolagents.agents import PromptTemplates
|
| 8 |
|
| 9 |
GEMINI_API_KEY = os.environ.get("GEMINI_API_KEY")
|
|
@@ -58,11 +58,6 @@ model = OpenAIServerModel(
|
|
| 58 |
# """
|
| 59 |
# )
|
| 60 |
|
| 61 |
-
class CustomMultiStepAgent(MultiStepAgent):
|
| 62 |
-
def initialize_system_prompt(self):
|
| 63 |
-
# Implement the method as required
|
| 64 |
-
pass
|
| 65 |
-
|
| 66 |
prompt = {
|
| 67 |
'system_prompt':"""
|
| 68 |
You are a helpful assistant tasked with answering questions using a set of tools.
|
|
@@ -116,11 +111,11 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 116 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 117 |
class BasicAgent:
|
| 118 |
def __init__(self):
|
| 119 |
-
self.agent =
|
| 120 |
tools = [DuckDuckGoSearchTool(), WikipediaSearchTool()],
|
| 121 |
model = model,
|
| 122 |
add_base_tools=True,
|
| 123 |
-
|
| 124 |
)
|
| 125 |
print("BasicAgent initialized.")
|
| 126 |
def __call__(self, question: str) -> str:
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
from smolagents import CodeAgent, OpenAIServerModel, DuckDuckGoSearchTool, WikipediaSearchTool
|
| 7 |
from smolagents.agents import PromptTemplates
|
| 8 |
|
| 9 |
GEMINI_API_KEY = os.environ.get("GEMINI_API_KEY")
|
|
|
|
| 58 |
# """
|
| 59 |
# )
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
prompt = {
|
| 62 |
'system_prompt':"""
|
| 63 |
You are a helpful assistant tasked with answering questions using a set of tools.
|
|
|
|
| 111 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 112 |
class BasicAgent:
|
| 113 |
def __init__(self):
|
| 114 |
+
self.agent = CodeAgent(
|
| 115 |
tools = [DuckDuckGoSearchTool(), WikipediaSearchTool()],
|
| 116 |
model = model,
|
| 117 |
add_base_tools=True,
|
| 118 |
+
system_prompt = prompt
|
| 119 |
)
|
| 120 |
print("BasicAgent initialized.")
|
| 121 |
def __call__(self, question: str) -> str:
|