[Week1] StateGraph를 활용한 야구 규칙 관련 ReAct Agent 구현#4
Open
daexvk wants to merge 1 commit into
Open
Conversation
Member
|
넌 안되겠다 다시짜와라 |
|
단일 커밋에 변경 사항 다 때려박는 앱티브 총무 ㄷㄷ |
GiyunKim00
reviewed
May 10, 2026
| if any(keyword in question for keyword in ["좋은", "어떤 정보", "설명하려면", "기준"]): | ||
| return AIMessage(content="도구 없이 답변할 수 있는 일반 질문입니다.") | ||
|
|
||
| if any(keyword in question for keyword in ["상황", "판정", "주자", "아웃", "플라이", "투구 동작"]): |
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.
변경점 👍
StateGraph로 직접 구현했습니다.create_agent같은 high-level helper 없이add_node,add_edge,add_conditional_edges로 그래프를 구성했습니다.lookup_baseball_rule: 규칙 검색judge_game_situation: 경기 상황 판정explain_baseball_term: 야구 용어 설명ToolNode를 사용해 도구 호출 결과를ToolMessage로 받아 다시 agent 노드로 순환하도록 구성했습니다.route_after_agent조건부 라우터로 tool call 여부에 따라tools또는final노드로 분기하도록 구현했습니다.BaseballFinalAnswerPydantic 스키마로 구조화했습니다.graph.png를 생성했습니다.테스트 💻
아래 명령어로 테스트했습니다.
테스트 질문 결과: