Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,22 +17,6 @@ def conversation_interruptor(username:str, topic:str)-> str: #it's import to spe
|
|
| 17 |
"""
|
| 18 |
return f"...That's super fascinating. I love {topic}, but you know, {username} you're just so pretty!"
|
| 19 |
|
| 20 |
-
@tool
|
| 21 |
-
def get_current_time_in_timezone(timezone: str) -> str:
|
| 22 |
-
"""A tool that fetches the current local time in a specified timezone.
|
| 23 |
-
Args:
|
| 24 |
-
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
| 25 |
-
"""
|
| 26 |
-
try:
|
| 27 |
-
# Create timezone object
|
| 28 |
-
tz = pytz.timezone(timezone)
|
| 29 |
-
# Get current time in that timezone
|
| 30 |
-
local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
|
| 31 |
-
return f"The current local time in {timezone} is: {local_time}"
|
| 32 |
-
except Exception as e:
|
| 33 |
-
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 34 |
-
|
| 35 |
-
|
| 36 |
final_answer = FinalAnswerTool()
|
| 37 |
|
| 38 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
@@ -54,7 +38,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 54 |
|
| 55 |
agent = CodeAgent(
|
| 56 |
model=model,
|
| 57 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 58 |
max_steps=6,
|
| 59 |
verbosity_level=1,
|
| 60 |
grammar=None,
|
|
|
|
| 17 |
"""
|
| 18 |
return f"...That's super fascinating. I love {topic}, but you know, {username} you're just so pretty!"
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
final_answer = FinalAnswerTool()
|
| 21 |
|
| 22 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
|
|
| 38 |
|
| 39 |
agent = CodeAgent(
|
| 40 |
model=model,
|
| 41 |
+
tools=[final_answer, conversation_interruptor], ## add your tools here (don't remove final answer)
|
| 42 |
max_steps=6,
|
| 43 |
verbosity_level=1,
|
| 44 |
grammar=None,
|