Alexandre Gazola commited on
Commit
56e1107
·
1 Parent(s): 1853c0c

tool para alfabetizar lista

Browse files
Files changed (2) hide show
  1. alphabetizer_tool.py +15 -0
  2. langchain_agent.py +3 -1
alphabetizer_tool.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain_core.tools import tool
2
+
3
+ @tool
4
+ def alphabetizer(input_list):
5
+ """
6
+ Alphabetizes a list.
7
+
8
+ Args:
9
+ input_list (list): A list of comparable elements.
10
+
11
+ Returns:
12
+ list: A new list with the items alphabetized.
13
+ """
14
+ return sorted(input_list)
15
+
langchain_agent.py CHANGED
@@ -17,6 +17,7 @@ from analyse_chess_position_tool import get_chess_best_move
17
  from convert_chessboard_image_to_fen_tool import convert_chessboard_image_to_fen
18
  from chess_image_to_fen_tool import chess_image_to_fen
19
  from audio_to_text_tool import audio_to_text,audio_to_text_from_youtube
 
20
 
21
  class LangChainAgent:
22
  def __init__(self):
@@ -36,7 +37,8 @@ class LangChainAgent:
36
  chess_image_to_fen,
37
  get_chess_best_move,
38
  audio_to_text,
39
- audio_to_text_from_youtube
 
40
  ]
41
 
42
  prompt = ChatPromptTemplate.from_messages([
 
17
  from convert_chessboard_image_to_fen_tool import convert_chessboard_image_to_fen
18
  from chess_image_to_fen_tool import chess_image_to_fen
19
  from audio_to_text_tool import audio_to_text,audio_to_text_from_youtube
20
+ from alphabetizer_tool import import alphabetizer
21
 
22
  class LangChainAgent:
23
  def __init__(self):
 
37
  chess_image_to_fen,
38
  get_chess_best_move,
39
  audio_to_text,
40
+ audio_to_text_from_youtube,
41
+ alphabetizer
42
  ]
43
 
44
  prompt = ChatPromptTemplate.from_messages([