BairL commited on
Commit
8aabd17
·
verified ·
1 Parent(s): 78b2e32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -93,8 +93,12 @@ def get_simple_joke() -> str:
93
 
94
  except Exception as e:
95
  return f"Error: {str(e)}"
 
 
 
96
 
97
-
 
98
 
99
  final_answer = FinalAnswerTool()
100
 
@@ -117,7 +121,7 @@ with open("prompts.yaml", 'r') as stream:
117
 
118
  agent = CodeAgent(
119
  model=model,
120
- tools=[final_answer, my_custom_tool, get_current_time_in_timezone, get_eur_exchange_rate, get_simple_joke], ## add your tools here (don't remove final answer)
121
  max_steps=6,
122
  verbosity_level=1,
123
  grammar=None,
 
93
 
94
  except Exception as e:
95
  return f"Error: {str(e)}"
96
+ @tool
97
+ # Import tool from Hub
98
+ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
99
 
100
+ with open("prompts.yaml", 'r') as stream:
101
+ prompt_templates = yaml.safe_load(stream)
102
 
103
  final_answer = FinalAnswerTool()
104
 
 
121
 
122
  agent = CodeAgent(
123
  model=model,
124
+ tools=[final_answer, my_custom_tool, get_current_time_in_timezone, get_eur_exchange_rate, get_simple_joke,image_generation_tool], ## add your tools here (don't remove final answer)
125
  max_steps=6,
126
  verbosity_level=1,
127
  grammar=None,