Skip to content

Conversation

@hank-kim97
Copy link

PR 타입

  • 새로운 튜토리얼 추가
  • 기존 튜토리얼 수정 (버그 수정 / 내용 개선 / 리팩토링)
  • 문서 수정
  • 기타 (chore, 의존성 업데이트 등)

변경 사항

  • LangGraph V1 에이전트 튜토리얼 전면 업데이트
  • create_agent 함수를 활용한 에이전트 생성 방법 설명
  • 모델 설정 방법 (문자열 식별자, init_chat_model, Provider별 클래스)
  • 동적 모델 선택 (wrap_model_call 데코레이터)
  • 시스템 프롬프트 및 동적 프롬프팅 (dynamic_prompt)
  • 미들웨어 활용 (before_model, after_model, 클래스 기반)
  • 모델 오류 시 재시도 로직 예시

수정된 파일

  • 03-Agent/01-LangGraph-Agents.ipynb
  • 03-Agent/assets/langgraph-agent.png (신규 이미지 추가)

체크리스트

기존 튜토리얼 수정인 경우

  • 금지 파일 미포함
  • 노트북 셀 에러 출력 없음 (마지막 셀은 재시도 로직 테스트를 위한 의도적 에러)
  • 파일명 형식 준수 ({NN}-LangGraph-{Topic}.ipynb)
  • 불필요한 출력/주석 없음
  • 오탈자 및 문장 오류 검토
  • AI 흔적 없음 (커밋 이력)
  • PR 미리보기 확인 완료

테스트 결과

테스트 환경:

  • OS: Mac
  • Python: 3.11+

노트북 전체 셀 실행 완료 확인 (마지막 셀은 의도적으로 존재하지 않는 모델명을 사용하여 재시도 로직 테스트)


추가 설명

LangGraph Agents 튜토리얼 주요 내용:

  • 에이전트 기본 개념 및 create_agent 함수 사용법
  • 모델 설정 방법 3가지: 문자열 식별자, init_chat_model, Provider별 클래스 직접 사용
  • 동적 모델 선택: wrap_model_call 데코레이터로 런타임 상태 기반 모델 라우팅
  • 프롬프트: 시스템 프롬프트 설정 및 dynamic_prompt를 활용한 동적 프롬프팅
  • 미들웨어: before_model, after_model 데코레이터 및 클래스 기반 미들웨어
  • 재시도 로직: 모델 호출 실패 시 자동 재시도 패턴

@hank-kim97 hank-kim97 requested a review from LHANTAEK January 15, 2026 02:19
@hank-kim97 hank-kim97 self-assigned this Jan 15, 2026
Copy link
Contributor

@LHANTAEK LHANTAEK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

말씀드린 부분들만 재검토 해주시면 되겠습니다. 감사합니다.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hank님 안녕하세요!
기존 SKILLS에 등록된 mermaid 생성 방식으로 이미지 톤앤매너를 맞추는건 어떨까요??
저는 스킬을 사용해보니 첨부된 것처럼 나오긴 했거든요. 행크님 의견이 궁금합니다.

Image

Copy link
Author

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",
"![](assets/wrap_model_call.png)\n",
Copy link
Contributor

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 로 변경해주셔야 될 것 같습니다.

Copy link
Author

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",
Copy link
Contributor

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[제안] 앞서 말씀드린 것처럼 해당 미들웨어도 명시적으로 모델 선택에 대해 print문을 추가하는게 어떨까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants