mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 08:26:21 +02:00
Add chunk content ID to explain trace provenance output (#708)
When --show-provenance is used with tg-show-explain-trace, display the chunk URI on a Content: line below each Source: chain. This allows the user to easily fetch the source text with tg-get-document-content.
This commit is contained in:
parent
25995d03f4
commit
9330730afb
1 changed files with 6 additions and 0 deletions
|
|
@ -214,6 +214,12 @@ def print_graphrag_text(trace, explain_client, flow, user, collection, api=None,
|
|||
chain_str = format_provenance_chain(chain)
|
||||
if chain_str:
|
||||
print(f" Source: {chain_str}")
|
||||
# Show content ID for the chunk (second item in chain)
|
||||
for item in chain:
|
||||
uri = item.get("uri", "")
|
||||
if uri.startswith("urn:chunk:"):
|
||||
print(f" Content: {uri}")
|
||||
break
|
||||
|
||||
print()
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue