adriansanz commited on
Commit
3e23945
·
verified ·
1 Parent(s): 1f13cec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -264,14 +264,11 @@ class BasicAgent:
264
  self.max_iterations = max_iterations
265
 
266
  # Descripción simplificada de herramientas para el prompt
267
- tools_desc = "\n".join(f"- {name}: {func.__doc__.strip().splitlines()[0]}" for name, func in self.tools.items())
268
- prompt_str = (
269
- "You can use the following tools by calling them with syntax:\n"
270
- "tool:<tool_name>(arg1,arg2,...)\n\n"
271
- "Available tools:\n"
272
- f"{tools_desc}\n\n"
273
- "Question: {{question}}\nAnswer:"
274
  )
 
275
  self.prompt_template = PromptTemplate.from_template(prompt_str)
276
  self.chain = LLMChain(prompt=self.prompt_template, llm=self.llm)
277
 
 
264
  self.max_iterations = max_iterations
265
 
266
  # Descripción simplificada de herramientas para el prompt
267
+ tools_desc = "\n".join(
268
+ f"- {name}: {(func.__doc__ or 'No description available').strip().splitlines()[0]}"
269
+ for name, func in self.tools.items()
 
 
 
 
270
  )
271
+
272
  self.prompt_template = PromptTemplate.from_template(prompt_str)
273
  self.chain = LLMChain(prompt=self.prompt_template, llm=self.llm)
274