[Week2] thread_id 기반 대화 상태 유지 및 스트리밍 출력 구현#9
Open
taekoong wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
구현 요약
파일 구조
추가한 기능
MemorySaver체크포인터로 같은 thread_id 내 대화 맥락 유지'stream_mode'="updates"로 노드 단위 실시간 출력 (agent/tools/format_output 진행 상황 확인 가능)with_token_loggin래퍼 함수로 agent 노드 실행 시 토큰 수 출력변경된 사항
build_graph()에checkpointer=MemorySaver()추가agent_node를with_token_logging으로 감싸서 등록run.ipynb의run_agent()에thread_id파라미터 추가 및graph.stream()적용테스트 결과
개선할 점
print로만 출력됨 → 파일이나 별도 저장소에 누적 기록하는 구조로 개선 가능