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

   Good catch — you are right, the trace was always `{}`. Fixed in c270a36.
   
   **What changed**
   
   - `RAGGraphVectorFlow` now accepts `is_graph_rag_recall` and, like 
`RAGGraphOnlyFlow` already did, returns the full `wkflow_state` from 
`post_deal` when it is set; the default path still returns exactly the four 
answer fields.
   - `rag_answer()` passes `include_trace` through as `is_graph_rag_recall`, so 
both graph flows hand the trace back and `/rag` can pick `keywords` / 
`match_vids` / `graph_result_flag` / `gremlin` / `graph_result` / 
`vertex_degree_list` from the real state.
   - Vector-only and raw flows keep their answer-only contract (they have no 
graph state to return); the trace is `{}` there, which is consistent with 
asking for a graph trace when no graph recall ran.
   
   **Tests** — `src/tests/flows/test_rag_flow_trace.py` covers both flows with 
and without the flag:
   
   ```python
   flow.post_deal(_Pipeline(payload))                 # -> four answer fields
   flow.post_deal(_Pipeline(payload | {is_graph_rag_recall: True}))  # -> full 
state
   ```
   
   ```
   $ pytest src/tests/flows/test_rag_flow_trace.py 
src/tests/api/test_rag_api.py -q
   25 passed
   ```
   
   The `/rag` response shape itself is unchanged, so existing callers see no 
difference unless they ask for `include_trace`.
   


-- 
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