Olá. Estou assistindo a aula 1, vídeo 2, onde vamos utilizar o LangChain para acessar uma base de dados em CSV e trazer os dados da aluna Bianca.
O script que estou a utilizar é o mesmo do repositório: https://github.com/alura-cursos/3860-langchain-agentes-python/blob/07a9d92462c0e327cc5796a8fecf4451b9c99f18/main.py
Ao tentar executar, recebo um erro informando que a chamada DadosDeEstudante._run() está sem o argumento "input".
Poderiam me ajudar? Acredito que pode se tratar de alguma alteração nos métodos ou bibliotecas do Langchain, talvez.
Erro:
Traceback (most recent call last):
File "c:\langchain-alura-course\main.py", line 65, in <module>
resposta = executor.invoke({"input" : pergunta})
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain\chains\base.py", line 164, in invoke
raise e
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain\chains\base.py", line 154, in invoke
self._call(inputs, run_manager=run_manager)
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain\agents\agent.py", line 1608, in _call
next_step_output = self._take_next_step(
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain\agents\agent.py", line 1314, in _take_next_step
[
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain\agents\agent.py", line 1314, in <listcomp>
[
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain\agents\agent.py", line 1399, in _iter_next_step
yield self._perform_agent_action(
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain\agents\agent.py", line 1421, in _perform_agent_action
observation = tool.run(
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain_core\tools.py", line 621, in run
raise error_to_raise
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain_core\tools.py", line 590, in run
response = context.run(self._run, *tool_args, **tool_kwargs)
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain_core\tools.py", line 813, in _run
return self.func(*args, **kwargs)
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain_core\tools.py", line 621, in run
raise error_to_raise
File "C:\langchain-alura-course\langchain-env\lib\site-packages\langchain_core\tools.py", line 590, in run
response = context.run(self._run, *tool_args, **tool_kwargs)
TypeError: DadosDeEstudante._run() missing 1 required positional argument: 'input'