mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-11 22:32:12 +02:00
Add chunk content ID to explain trace provenance output
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
96fd1eab15
commit
d2a43c0858
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)
|
chain_str = format_provenance_chain(chain)
|
||||||
if chain_str:
|
if chain_str:
|
||||||
print(f" Source: {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()
|
print()
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue