Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,6 +34,11 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
final_answer = FinalAnswerTool()
|
38 |
|
39 |
# 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:
|
@@ -58,7 +63,6 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
|
|
58 |
with open("prompts.yaml", 'r') as stream:
|
59 |
prompt_templates = yaml.safe_load(stream)
|
60 |
|
61 |
-
print([tool.name for tool in selected_tools])
|
62 |
|
63 |
# Changing Agent to CodeAgent will authomatically give the agent access to python_interpreter so it will be able to generate code and run it.
|
64 |
agent = Agent(
|
|
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
|
37 |
+
@tool(name="python_interpreter")
|
38 |
+
def blocked_python_interpreter(code: str) -> str:
|
39 |
+
"""This tool is intentionally disabled."""
|
40 |
+
return "Use of Python interpreter is disabled in this agent."
|
41 |
+
|
42 |
final_answer = FinalAnswerTool()
|
43 |
|
44 |
# 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:
|
|
|
63 |
with open("prompts.yaml", 'r') as stream:
|
64 |
prompt_templates = yaml.safe_load(stream)
|
65 |
|
|
|
66 |
|
67 |
# Changing Agent to CodeAgent will authomatically give the agent access to python_interpreter so it will be able to generate code and run it.
|
68 |
agent = Agent(
|