인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

인프런 커뮤니티 질문&답변

강경준님의 프로필 이미지

작성한 질문수

모두를 위한 대규모 언어 모델 LLM Part 5 - LangGraph로 나만의 AI 에이전트 만들기

Plan-and-Execute 아키텍처 구현하기

"Plan-and-Execute 아키텍쳐 구현하기" 강의 prompt not found error

작성

·

55

0

  • "Plan-and-Execute 아키텍쳐 구현하기" 강의 hub.pull("ih/ih-react-agent-executor") 실행 시 not found error 발생

  • hub.pull("pollyjaky/ih-react-agent-executor") 로 대체

답변 1

0

AISchool님의 프로필 이미지
AISchool
지식공유자

안녕하세요~. 반갑습니다.

먼저 수강에 불편을 드려서 죄송하고 정보 공유 감사합니다~.

 

강의 촬영시점 이후로 시간이 흘러서 hub repo의 변화로 인해 에러가 발생한 것 같습니다.

말씀해주신대로 hub.pull("pollyjaky/ih-react-agent-executor")로 변경해서 사용하셔도 되고, 아니면 아래와 같이 간단하게 그냥 직접 프롬프트를 설정해주어도 됩니다.

from langchain import hub
from langchain_openai import ChatOpenAI

from langgraph.prebuilt import create_react_agent

# Get the prompt to use - you can modify this!
prompt = "You are a helpful assistant."

# Choose the LLM that will drive the agent
llm = ChatOpenAI(model="gpt-4o")
agent_executor = create_react_agent(llm, tools, state_modifier=prompt)

다른 분들도 참고하실 수 있도록 위와 같이 수정된 colab 링크를 아래에 첨부합니다.

 

https://colab.research.google.com/drive/1EKu16O8r_9PQkg3TaaglQWiQxmI8gHEa?usp=sharing

 

좋은 하루되세요.

감사합니다.