bosprimigenious commented on PR #411:
URL: https://github.com/apache/hugegraph-ai/pull/411#issuecomment-6763170712

   Both review findings are fixed in 99cdef7 — thanks, they were exactly right.
   
   **1. Separate flag instead of `is_graph_rag_recall` (@imbajin)**
   
   `is_graph_rag_recall` is untouched and keeps its recall-only semantics 
(`GraphRecallCondition` still switches on it). The trace now has its own 
`include_trace` flag:
   
   - `WkFlowInput.include_trace` / `WkFlowState.include_trace`
   - `rag_answer()` passes `include_trace=include_trace` to both graph flows
   - `RAGGraphOnlyFlow.post_deal` returns the full state when **either** 
`is_graph_rag_recall` **or** `include_trace` is set; a normal graph-only answer 
still goes through `AnswerSynthesizeNode`
   
   **2. The flag now reaches `WkFlowState` (@bitflicker64)**
   
   `prepare()` in `RAGGraphOnlyFlow` and `RAGGraphVectorFlow` writes 
`"include_trace": include_trace` into `prepared_input.data_json`, which 
`WkFlowState.assign_from_json` copies into the state. `post_deal` reads 
`res.get("include_trace")`, so `graph_vector_answer=true` + 
`include_trace=true` actually returns the trace.
   
   **3. Test gap you called out**
   
   `test_rag_flow_trace.py` no longer injects the flag into a fake state. It 
now:
   
   - runs the real `prepare()` on both flows and asserts 
`prepared_input.data_json["include_trace"]` is set, and that 
`WkFlowState.assign_from_json()` carries it into `to_json()` — this is the 
assertion that would have failed on the previous head;
   - keeps the `post_deal` contract tests (answers only by default, full state 
when tracing);
   - keeps a guard that `is_graph_rag_recall` still returns the full state for 
the recall path.
   
   ```
   $ pytest src/tests/flows/test_rag_flow_trace.py 
src/tests/api/test_rag_api.py -q
   28 passed
   ```
   
   Still not a live-cluster run — it is a unit-level check of the plumbing; the 
flow still needs a real HugeGraph instance to produce trace values end to end.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to