Spaces:
Sleeping
Sleeping
mudança rotina vegetais
Browse files
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,
|
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
|
658 |
"""
|
659 |
-
|
660 |
|
661 |
Args:
|
662 |
-
|
|
|
663 |
|
664 |
Returns:
|
665 |
-
|
666 |
"""
|
667 |
-
|
668 |
-
|
|
|
|
|
|
|
|
|
|
|
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 |
|