gdms commited on
Commit
1f75af9
·
1 Parent(s): 33d7671

mudança rotina vegetais

Browse files
Files changed (2) hide show
  1. agent.py +2 -2
  2. tools.py +12 -6
agent.py CHANGED
@@ -14,7 +14,7 @@ class Agent:
14
 
15
  print("Initializing Agent....")
16
  print("**************************************************************************************")
17
- print('........ Versão: Vegetais .....')
18
  print("**************************************************************************************")
19
 
20
  print("--> Audio Agent")
@@ -39,7 +39,7 @@ class Agent:
39
  agents=[self.web_search_agent, self.audio_agent],
40
  tools=[bird_video_count_tool,chess_image_to_fen_tool,chess_fen_get_best_next_move_tool,
41
  get_excel_columns_tool, calculate_excel_sum_by_columns_tool,execute_python_code_tool,
42
- text_inverter_tool, check_table_commutativity_tool, is_vegetable_tool],
43
  prompt= SUPERVISOR_PROMPT,
44
  add_handoff_back_messages=True,
45
  output_mode="last_message",
 
14
 
15
  print("Initializing Agent....")
16
  print("**************************************************************************************")
17
+ print('........ Versão: Filtro Vegetais .....')
18
  print("**************************************************************************************")
19
 
20
  print("--> Audio Agent")
 
39
  agents=[self.web_search_agent, self.audio_agent],
40
  tools=[bird_video_count_tool,chess_image_to_fen_tool,chess_fen_get_best_next_move_tool,
41
  get_excel_columns_tool, calculate_excel_sum_by_columns_tool,execute_python_code_tool,
42
+ text_inverter_tool, check_table_commutativity_tool, filter_vegetables_from_list_tool],
43
  prompt= SUPERVISOR_PROMPT,
44
  add_handoff_back_messages=True,
45
  output_mode="last_message",
tools.py CHANGED
@@ -654,16 +654,22 @@ def normalize_item(text: str) -> str:
654
  singular.append(word)
655
  return " ".join(singular)
656
 
657
- def is_vegetable_tool(item_name: str) -> bool:
658
  """
659
- Verify if an item is a vegetable
660
 
661
  Args:
662
- item_name: Name of the item
 
663
 
664
  Returns:
665
- True if is vegetable, otherwise false
666
  """
667
- norm = normalize_item(item_name)
668
- return norm in VEGETABLES
 
 
 
 
 
669
 
 
654
  singular.append(word)
655
  return " ".join(singular)
656
 
657
+ def filter_vegetables_from_list_tool(items: list[str]) -> list[str]:
658
  """
659
+ Return a set of vegetables from items
660
 
661
  Args:
662
+ items:
663
+ Listo of items
664
 
665
  Returns:
666
+ List of vegetable items
667
  """
668
+ lista: list[str]= []
669
+ for i in items:
670
+ norm = normalize_item(i)
671
+ if norm in VEGETABLES:
672
+ lista.append(norm)
673
+
674
+ return list
675