Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,9 +34,11 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 34 |
except Exception as e:
|
| 35 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 36 |
|
|
|
|
| 37 |
|
| 38 |
final_answer = FinalAnswerTool()
|
| 39 |
-
|
|
|
|
| 40 |
# 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:
|
| 41 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 42 |
|
|
@@ -54,10 +56,9 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
|
|
| 54 |
with open("prompts.yaml", 'r') as stream:
|
| 55 |
prompt_templates = yaml.safe_load(stream)
|
| 56 |
|
| 57 |
-
timezone = 'Asia/Kolkata'
|
| 58 |
agent = CodeAgent(
|
| 59 |
model=model,
|
| 60 |
-
tools=[final_answer,
|
| 61 |
max_steps=6,
|
| 62 |
verbosity_level=1,
|
| 63 |
grammar=None,
|
|
|
|
| 34 |
except Exception as e:
|
| 35 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 36 |
|
| 37 |
+
timezone = 'Asia/Kolkata'
|
| 38 |
|
| 39 |
final_answer = FinalAnswerTool()
|
| 40 |
+
timezone_tool = get_current_time_in_timezone(timezone)
|
| 41 |
+
search = DuckDuckGoSearchTool()
|
| 42 |
# 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:
|
| 43 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 44 |
|
|
|
|
| 56 |
with open("prompts.yaml", 'r') as stream:
|
| 57 |
prompt_templates = yaml.safe_load(stream)
|
| 58 |
|
|
|
|
| 59 |
agent = CodeAgent(
|
| 60 |
model=model,
|
| 61 |
+
tools=[final_answer,search,timezone_tool], ## add your tools here (don't remove final answer)
|
| 62 |
max_steps=6,
|
| 63 |
verbosity_level=1,
|
| 64 |
grammar=None,
|