Spaces:
Running
Running
| # # app/graph/rag_agent.py | |
| # from app.core.rag_service import get_rag_context | |
| # def rag_agent_node(state): | |
| # print("DEBUG β state received:", state) | |
| # query= state["query"] | |
| # doc_id= state["doc_id"] | |
| # print("DEBUG β query:", query) | |
| # print("DEBUG β doc_id:", doc_id) | |
| # context, sources= get_rag_context(query, doc_id) | |
| # print("DEBUG β context:", context[:200] if context else "EMPTY") | |
| # return { | |
| # **state, | |
| # "context": context, | |
| # "sources": sources | |
| # } | |
| def rag_agent_node(state): | |
| print("DEBUG β state received:", state) | |
| # β context already comes from router now | |
| context = state.get("context") | |
| sources = state.get("sources") | |
| print("DEBUG β context:", context[:200] if context else "EMPTY") | |
| return { | |
| **state, | |
| "context": context, | |
| "sources": sources | |
| } | |