Clean up
Browse files
app.py
CHANGED
|
@@ -12,17 +12,7 @@ verbose = True
|
|
| 12 |
|
| 13 |
if verbose: print("Running app.py")
|
| 14 |
|
| 15 |
-
|
| 16 |
-
@tool
|
| 17 |
-
def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
| 18 |
-
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 19 |
-
"""A tool that does nothing yet
|
| 20 |
-
Args:
|
| 21 |
-
arg1: the first argument
|
| 22 |
-
arg2: the second argument
|
| 23 |
-
"""
|
| 24 |
-
return "What magic will you build ?"
|
| 25 |
-
|
| 26 |
## https://huggingface.co/spaces/iamnamas/nse_stockprice_agent ## Look up the price of an NSE stock like TATAMOTORS or ADANINT
|
| 27 |
## https://huggingface.co/spaces/DenverJones/First_agent_template/blob/main/app.py ## randomly select a Motivational Quote
|
| 28 |
|
|
@@ -73,8 +63,8 @@ final_answer = FinalAnswerTool()
|
|
| 73 |
# Import tool from Hub
|
| 74 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True) ## https://huggingface.co/spaces/agents-course/text-to-image
|
| 75 |
|
| 76 |
-
# Create a list of the tools available to the agent
|
| 77 |
-
|
| 78 |
|
| 79 |
MODEL_IDS = [
|
| 80 |
#'https://wxknx1kg971u7k1n.us-east-1.aws.endpoints.huggingface.cloud/',
|
|
@@ -131,7 +121,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 131 |
|
| 132 |
agent = CodeAgent(
|
| 133 |
model=model,
|
| 134 |
-
tools=
|
| 135 |
max_steps=6,
|
| 136 |
verbosity_level=1,
|
| 137 |
grammar=None,
|
|
|
|
| 12 |
|
| 13 |
if verbose: print("Running app.py")
|
| 14 |
|
| 15 |
+
## Nice spaces to keep an eye on:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
## https://huggingface.co/spaces/iamnamas/nse_stockprice_agent ## Look up the price of an NSE stock like TATAMOTORS or ADANINT
|
| 17 |
## https://huggingface.co/spaces/DenverJones/First_agent_template/blob/main/app.py ## randomly select a Motivational Quote
|
| 18 |
|
|
|
|
| 63 |
# Import tool from Hub
|
| 64 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True) ## https://huggingface.co/spaces/agents-course/text-to-image
|
| 65 |
|
| 66 |
+
# Create a list of the tools available to the agent - (don't remove final answer)
|
| 67 |
+
tool_list = [final_answer, get_current_time_in_timezone, image_generation_tool, toss_a_die, available_tools]
|
| 68 |
|
| 69 |
MODEL_IDS = [
|
| 70 |
#'https://wxknx1kg971u7k1n.us-east-1.aws.endpoints.huggingface.cloud/',
|
|
|
|
| 121 |
|
| 122 |
agent = CodeAgent(
|
| 123 |
model=model,
|
| 124 |
+
tools=tool_list,
|
| 125 |
max_steps=6,
|
| 126 |
verbosity_level=1,
|
| 127 |
grammar=None,
|