Spaces:
Sleeping
Sleeping
Upload agent
Browse files- agent.json +16 -23
- app.py +8 -17
- requirements.txt +0 -3
agent.json
CHANGED
|
@@ -1,19 +1,15 @@
|
|
| 1 |
{
|
| 2 |
"tools": [
|
| 3 |
-
"web_search",
|
| 4 |
-
"visit_webpage",
|
| 5 |
-
"suggest_menu",
|
| 6 |
-
"catering_service_tool",
|
| 7 |
-
"superhero_party_theme_generator",
|
| 8 |
"final_answer"
|
| 9 |
],
|
| 10 |
"model": {
|
| 11 |
-
"class": "
|
| 12 |
"data": {
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
"
|
| 16 |
-
"
|
|
|
|
| 17 |
}
|
| 18 |
},
|
| 19 |
"managed_agents": {},
|
|
@@ -36,29 +32,26 @@
|
|
| 36 |
"post_messages": "Based on the above, please provide an answer to the following user request:\n{{task}}"
|
| 37 |
}
|
| 38 |
},
|
| 39 |
-
"max_steps":
|
| 40 |
-
"verbosity_level":
|
| 41 |
"grammar": null,
|
| 42 |
"planning_interval": null,
|
| 43 |
"name": null,
|
| 44 |
"description": null,
|
| 45 |
"requirements": [
|
| 46 |
-
"
|
| 47 |
-
"smolagents",
|
| 48 |
-
"duckduckgo_search",
|
| 49 |
-
"requests"
|
| 50 |
],
|
| 51 |
"authorized_imports": [
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
"datetime",
|
| 53 |
"re",
|
| 54 |
-
"math",
|
| 55 |
-
"time",
|
| 56 |
"unicodedata",
|
| 57 |
-
"
|
| 58 |
"queue",
|
| 59 |
-
"
|
| 60 |
-
"
|
| 61 |
-
"statistics",
|
| 62 |
-
"random"
|
| 63 |
]
|
| 64 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"tools": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"final_answer"
|
| 4 |
],
|
| 5 |
"model": {
|
| 6 |
+
"class": "LiteLLMModel",
|
| 7 |
"data": {
|
| 8 |
+
"num_ctx": 20000,
|
| 9 |
+
"last_input_token_count": 2924,
|
| 10 |
+
"last_output_token_count": 133,
|
| 11 |
+
"model_id": "ollama_chat/hf.co/bartowski/Qwen2.5-7B-Instruct-GGUF:Q6_K_L",
|
| 12 |
+
"api_base": "http://localhost:11434"
|
| 13 |
}
|
| 14 |
},
|
| 15 |
"managed_agents": {},
|
|
|
|
| 32 |
"post_messages": "Based on the above, please provide an answer to the following user request:\n{{task}}"
|
| 33 |
}
|
| 34 |
},
|
| 35 |
+
"max_steps": 6,
|
| 36 |
+
"verbosity_level": 1,
|
| 37 |
"grammar": null,
|
| 38 |
"planning_interval": null,
|
| 39 |
"name": null,
|
| 40 |
"description": null,
|
| 41 |
"requirements": [
|
| 42 |
+
"smolagents"
|
|
|
|
|
|
|
|
|
|
| 43 |
],
|
| 44 |
"authorized_imports": [
|
| 45 |
+
"itertools",
|
| 46 |
+
"random",
|
| 47 |
+
"statistics",
|
| 48 |
+
"stat",
|
| 49 |
"datetime",
|
| 50 |
"re",
|
|
|
|
|
|
|
| 51 |
"unicodedata",
|
| 52 |
+
"math",
|
| 53 |
"queue",
|
| 54 |
+
"collections",
|
| 55 |
+
"time"
|
|
|
|
|
|
|
| 56 |
]
|
| 57 |
}
|
app.py
CHANGED
|
@@ -1,29 +1,20 @@
|
|
| 1 |
import yaml
|
| 2 |
import os
|
| 3 |
-
from smolagents import GradioUI, CodeAgent,
|
| 4 |
|
| 5 |
# Get current directory path
|
| 6 |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 7 |
|
| 8 |
-
from tools.web_search import DuckDuckGoSearchTool as WebSearch
|
| 9 |
-
from tools.visit_webpage import VisitWebpageTool as VisitWebpage
|
| 10 |
-
from tools.suggest_menu import SimpleTool as SuggestMenu
|
| 11 |
-
from tools.catering_service_tool import SimpleTool as CateringServiceTool
|
| 12 |
-
from tools.superhero_party_theme_generator import SuperheroPartyThemeTool as SuperheroPartyThemeGenerator
|
| 13 |
from tools.final_answer import FinalAnswerTool as FinalAnswer
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
-
model =
|
| 18 |
-
|
| 19 |
-
|
|
|
|
| 20 |
)
|
| 21 |
|
| 22 |
-
web_search = WebSearch()
|
| 23 |
-
visit_webpage = VisitWebpage()
|
| 24 |
-
suggest_menu = SuggestMenu()
|
| 25 |
-
catering_service_tool = CateringServiceTool()
|
| 26 |
-
superhero_party_theme_generator = SuperheroPartyThemeGenerator()
|
| 27 |
final_answer = FinalAnswer()
|
| 28 |
|
| 29 |
|
|
@@ -32,10 +23,10 @@ with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream:
|
|
| 32 |
|
| 33 |
agent = CodeAgent(
|
| 34 |
model=model,
|
| 35 |
-
tools=[
|
| 36 |
managed_agents=[],
|
| 37 |
-
max_steps=
|
| 38 |
-
verbosity_level=
|
| 39 |
grammar=None,
|
| 40 |
planning_interval=None,
|
| 41 |
name=None,
|
|
|
|
| 1 |
import yaml
|
| 2 |
import os
|
| 3 |
+
from smolagents import GradioUI, CodeAgent, LiteLLMModel
|
| 4 |
|
| 5 |
# Get current directory path
|
| 6 |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
from tools.final_answer import FinalAnswerTool as FinalAnswer
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
+
model = LiteLLMModel(
|
| 13 |
+
num_ctx=20000,
|
| 14 |
+
model_id='ollama_chat/hf.co/bartowski/Qwen2.5-7B-Instruct-GGUF:Q6_K_L',
|
| 15 |
+
api_base='http://localhost:11434',
|
| 16 |
)
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
final_answer = FinalAnswer()
|
| 19 |
|
| 20 |
|
|
|
|
| 23 |
|
| 24 |
agent = CodeAgent(
|
| 25 |
model=model,
|
| 26 |
+
tools=[],
|
| 27 |
managed_agents=[],
|
| 28 |
+
max_steps=6,
|
| 29 |
+
verbosity_level=1,
|
| 30 |
grammar=None,
|
| 31 |
planning_interval=None,
|
| 32 |
name=None,
|
requirements.txt
CHANGED
|
@@ -1,4 +1 @@
|
|
| 1 |
-
markdownify
|
| 2 |
smolagents
|
| 3 |
-
duckduckgo_search
|
| 4 |
-
requests
|
|
|
|
|
|
|
| 1 |
smolagents
|
|
|
|
|
|