Spaces:
Sleeping
Sleeping
Added agent tool "get_corporate_bullshit_text"
Browse files
app.py
CHANGED
|
@@ -21,6 +21,28 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 21 |
"""
|
| 22 |
return "What magic will you build ?"
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
@tool
|
| 25 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 26 |
"""A tool that fetches the current local time in a specified timezone.
|
|
@@ -58,7 +80,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 58 |
|
| 59 |
agent = CodeAgent(
|
| 60 |
model=model,
|
| 61 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 62 |
max_steps=6,
|
| 63 |
verbosity_level=1,
|
| 64 |
grammar=None,
|
|
|
|
| 21 |
"""
|
| 22 |
return "What magic will you build ?"
|
| 23 |
|
| 24 |
+
|
| 25 |
+
@tool
|
| 26 |
+
def get_corporate_bullshit_text()-> str:
|
| 27 |
+
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 28 |
+
"""A tool that retrieves some "corporate bullshit" as text.
|
| 29 |
+
Args:
|
| 30 |
+
None
|
| 31 |
+
"""
|
| 32 |
+
try:
|
| 33 |
+
url = 'https://corporatebs-generator.sameerkumar.website/'
|
| 34 |
+
response = requests.get(url)
|
| 35 |
+
|
| 36 |
+
if response.status_code == 200:
|
| 37 |
+
data = response.json()
|
| 38 |
+
return data['phrase']
|
| 39 |
+
else:
|
| 40 |
+
return f'Error - get_corporate_bullshit_text() -> Response status code was not good ({response.status_code})'
|
| 41 |
+
|
| 42 |
+
except Exception as e:
|
| 43 |
+
return "Error - get_corporate_bullshit_text() -> Exception - Well this didn't work"
|
| 44 |
+
|
| 45 |
+
|
| 46 |
@tool
|
| 47 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 48 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
|
| 80 |
|
| 81 |
agent = CodeAgent(
|
| 82 |
model=model,
|
| 83 |
+
tools=[final_answer, get_corporate_bullshit_text], ## add your tools here (don't remove final answer)
|
| 84 |
max_steps=6,
|
| 85 |
verbosity_level=1,
|
| 86 |
grammar=None,
|