-
Notifications
You must be signed in to change notification settings - Fork 31
[03-Agent] 01-LangGraph-Agents - LangGraph V1 에이전트 튜토리얼 업데이트 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
LHANTAEK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
말씀드린 부분들만 재검토 해주시면 되겠습니다. 감사합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 이미지는 저희 현재 excalidraw skill이 마무리 되는 대로 해당하는 것으로 수정하겠습니다!
| "\n", | ||
| "`wrap_model_call` 데코레이터를 사용하면 모델 호출 전에 요청을 검사하고 수정할 수 있는 미들웨어를 생성할 수 있습니다.\n", | ||
| "\n", | ||
| "\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
루트 폴더에 있는 wrap_model_call.png 를 참고하려고 한 의도였을까요??
의도대로 이미지 첨부하려면, 현재는 경로가 잘못되어있어서 ../assets/wrap_model_call.png 로 변경해주셔야 될 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 제가 수정하면서 경로를 놓쳤네요. 감사합니다! 수정하겠습니다.
| " else:\n", | ||
| " model = basic_model\n", | ||
| "\n", | ||
| " request.model = model\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[제안] 해당 셀은 메시지 개수에 따라 동적으로 모델이 변경되는 미들웨어를 정의하는 곳입니다. 이후로 모델 선택이 제대로 되는지 확인하기 위해서 아래와 같이 추가하는게 어떨까요? 하위 셀들에서 현재는 어떤 모델이 선택되었는지 확인할 수 없고 단순히 실행만 되고 있어서요.
# 기존
request.model = model
# 새로 추가
print(f"모델 선택: {request.model.model}")
# 기존
return handler(request)| "outputs": [], | ||
| "source": [ | ||
| "@wrap_model_call\n", | ||
| "def dynamic_model_selection(request: ModelRequest, handler) -> ModelResponse:\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[제안] 앞서 말씀드린 것처럼 해당 미들웨어도 명시적으로 모델 선택에 대해 print문을 추가하는게 어떨까요?

PR 타입
변경 사항
create_agent함수를 활용한 에이전트 생성 방법 설명수정된 파일
03-Agent/01-LangGraph-Agents.ipynb03-Agent/assets/langgraph-agent.png(신규 이미지 추가)체크리스트
기존 튜토리얼 수정인 경우
{NN}-LangGraph-{Topic}.ipynb)테스트 결과
테스트 환경:
노트북 전체 셀 실행 완료 확인 (마지막 셀은 의도적으로 존재하지 않는 모델명을 사용하여 재시도 로직 테스트)
추가 설명
LangGraph Agents 튜토리얼 주요 내용:
create_agent함수 사용법init_chat_model, Provider별 클래스 직접 사용wrap_model_call데코레이터로 런타임 상태 기반 모델 라우팅dynamic_prompt를 활용한 동적 프롬프팅before_model,after_model데코레이터 및 클래스 기반 미들웨어