BettoEsteves commited on
Commit
df08352
·
verified ·
1 Parent(s): c691794

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -33,9 +33,25 @@ def get_current_time_in_timezone(timezone: str) -> str:
33
  except Exception as e:
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:
40
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
41
 
 
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
36
+ @def research_assistant(question: str) -> str:
37
+ ''' Ferramenta de pesquisa na web e geração de conteúdo.
38
+ Args:
39
+ question: pergunta para a pesquisa
40
+ '''
41
+ search_results = DuckDuckGoSearchTool().run(question)
42
+
43
+ image_url = image_generation_tool(f"Infográfico sobre: {question[ :50]}...")
44
+
45
+ return f"""-> Resultados da pesquisa:
46
+ {search_results}
47
+
48
+ Visualização:
49
+ {image_url}"""
50
+
51
 
52
  final_answer = FinalAnswerTool()
53
 
54
+
55
  # 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:
56
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
57