inflearn logo
강의

講義

知識共有

シリコンバレーエンジニアと一緒に学ぶLangChainとLangGraphそしてMCP

Agentsについて調べる

Custom Agent executor error

解決済みの質問

407

joung65170555

投稿した質問数 33

1

else:
  print("TOOL NAME : ", output.tool)
  print("TOOL INPUT : ", output.tool_input)

Traceback (most recent call last):
  File "/Users/chaejinjeong/Desktop/myGit/Study/langchain/inflearn/5.Agent/basic.py", line 75, in <module>
    print("TOOL NAME : ", output.tool)
output : [OpenAIToolAgentAction(tool='get_word_length', tool_input={'word': 'eudca'}, log="\nInvoking: `get_word_length` with `{'word': 'eudca'}`\n\n\n", message_log=[AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_DlTa5qRanu9HhiWGneMz2V3C', 'function': {'arguments': '{"word":"eudca"}', 'name': 'get_word_length'}, 'type': 'function'}]})], tool_call_id='call_DlTa5qRanu9HhiWGneMz2V3C')], <class 'list'>
intermediate_steps = []
final_result = dict()
while True:
    query.update({"intermediate_steps": intermediate_steps})
    output: Union[AgentFinish, AgentAction] = agent.invoke(query)

    if isinstance(output, AgentFinish):
        final_result = output.return_values
        final_result = final_result.get("output")
        break
    else:
        if isinstance(output, list):
            output = output[0]
        print("TOOL NAME : ", output.tool)
        print("TOOL INPUT : ", output.tool_input)
        _tool = tools.get(output.tool)
        observation = _tool.run(output.tool_input)
        intermediate_steps.append((output, observation))


TOOL NAME :  get_word_length
TOOL INPUT :  {'word': 'eudca'}

NLP openai 프롬프트엔지니어링 llm langchain

回答 2

1

altoformula

안녕하세요 정채진님,

이상하네요. 저는 코드가 아무 문제 없이 돌아가는데요? AgentFinish의 인스턴스가 아닌 경우, 아래와 같이 output을 확인했지만 tooltool_input 모두 존재하고 있었습니다.

image

tool='get_word_length' tool_input={'word': 'educa'} log="\nInvoking: `get_word_length` with `{'word': 'educa'}`\n\n\n" message_log=[AIMessage(content='', additional_kwargs={'function_call': {'arguments': '{"word":"educa"}', 'name': 'get_word_length'}})]

혹시 에러가 나시는 분들은 output을 확인하시고 정채진님처럼 하시는 것도 좋은 방법인 것 같습니다.

0

joung65170555

아하 저는 그냥 최신 버전으로 설치했는데 버저닝 문제였나보네요

감사합니다

session이 점점 길어지면 어떻게 대처하나요?

0

10

1

dotenv, langchain_community 로드가 되지 않습니다.

0

14

1

FMP API 유료

1

21

1

SSL 발급할때 HTTP로 진행하는 이유가 궁금합니다.

0

29

2

혹시 강의에서 사용하시는 손글씨 도구? 프로그램이 뭔가요??

0

24

1

9-3 강 영상 짤림.

0

17

2

실습2_GPT기반_온라인_댓글_분류_자동.ipynb 파일 오류 있습니다.

0

26

1

선생님 질문이 있어요

0

42

2

7-5강 영상 확인 요청

0

31

3

시놀로지 나스(램32GB) 컨테이너 매니저에 n8n 설치

0

47

2

SKILL 기능 관련

0

30

1

온톨로지 구축

0

26

1

섹션 10에 수업 자료 링크가 없네요

0

85

3

100% 수강 완료가 되지 않아요

0

79

1

100% 수강 완료가 되지 않아 문의드립니다.

0

134

4

MCP 서버 관련 질문이있습니다.

0

176

2

랭체인 외부 인터넷 사용 관련

0

220

1

summary buffer memory token_limit 질문

1

288

2

[공유] SQLDatabase를 에디터에서 인식하지 못한다면

1

296

1

ChatPromptTemplate.from_messages(("ai", ...)) 질문

1

405

1

chroma db import 가 업데이트된 것 같습니다.

1

510

1

CommonList output이 안되는데 무엇이 문제일까요 ?

1

269

2

Langchain version이 업데이트 되어서 코드를 수정해야할 것 같습니다.

1

1057

2

주어진 코드를 그대로 실행 해 보았는데 결과가 달라요

1

582

3