trustgraph-base 2.2.20__tar.gz → 2.2.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/PKG-INFO +1 -1
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/socket_client.py +38 -8
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/types.py +24 -2
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/async_processor.py +2 -1
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/consumer.py +1 -1
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/rabbitmq_backend.py +1 -0
- trustgraph_base-2.2.21/trustgraph/base_version.py +1 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/agent.py +13 -2
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/collection.py +0 -3
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/retrieval.py +21 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/agent.py +4 -3
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/retrieval.py +8 -6
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph_base.egg-info/PKG-INFO +1 -1
- trustgraph_base-2.2.20/trustgraph/base_version.py +0 -1
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/README.md +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/pyproject.toml +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/setup.cfg +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/api.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/async_bulk_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/async_flow.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/async_metrics.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/async_socket_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/bulk_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/collection.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/config.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/exceptions.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/explainability.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/flow.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/knowledge.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/library.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/api/metrics.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/agent_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/agent_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/backend.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/cassandra_config.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/chunking_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/collection_config_handler.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/consumer_spec.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/document_embeddings_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/document_embeddings_query_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/document_embeddings_store_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/dynamic_tool_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/embeddings_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/embeddings_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/flow.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/flow_processor.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/graph_embeddings_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/graph_embeddings_query_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/graph_embeddings_store_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/graph_rag_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/librarian_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/llm_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/logging.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/metrics.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/parameter_spec.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/producer.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/producer_spec.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/prompt_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/publisher.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/pubsub.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/pulsar_backend.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/request_response_spec.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/row_embeddings_query_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/serialization.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/spec.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/structured_query_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/subscriber.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/subscriber_spec.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/text_completion_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/tool_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/tool_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/tool_service_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/triples_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/triples_query_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/triples_store_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/agent_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/base.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/config_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/document_embeddings_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/document_rag_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/embeddings_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/graph_embeddings_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/graph_rag_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/llm_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/prompt_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/row_embeddings_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/triples_query_client.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/exceptions.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/knowledge/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/knowledge/defs.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/knowledge/document.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/knowledge/identifier.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/knowledge/organization.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/knowledge/publication.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/log_level.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/registry.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/base.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/config.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/diagnosis.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/document_loading.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/embeddings.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/embeddings_query.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/flow.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/knowledge.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/library.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/metadata.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/nlp_query.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/primitives.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/prompt.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/rows_query.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/sparql_query.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/structured_query.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/text_completion.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/tool.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/triples.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/objects/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/objects/field.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/objects/object.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/provenance/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/provenance/agent.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/provenance/namespaces.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/provenance/triples.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/provenance/uris.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/provenance/vocabulary.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/rdf.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/core/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/core/metadata.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/core/primitives.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/core/topic.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/knowledge/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/knowledge/document.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/knowledge/embeddings.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/knowledge/graph.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/knowledge/knowledge.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/knowledge/nlp.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/knowledge/object.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/knowledge/rows.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/knowledge/structured.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/__init__.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/collection.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/config.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/diagnosis.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/flow.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/library.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/llm.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/lookup.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/nlp_query.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/prompt.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/query.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/rows_query.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/sparql_query.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/storage.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/structured_query.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/tool_service.py +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph_base.egg-info/SOURCES.txt +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph_base.egg-info/dependency_links.txt +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph_base.egg-info/requires.txt +0 -0
- {trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph_base.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trustgraph-base
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.21
|
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
|
5
5
|
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
|
6
6
|
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
|
@@ -366,19 +366,13 @@ class SocketClient:
|
|
|
366
366
|
# Handle GraphRAG/DocRAG message format with message_type
|
|
367
367
|
if message_type == "explain":
|
|
368
368
|
if include_provenance:
|
|
369
|
-
return
|
|
370
|
-
explain_id=resp.get("explain_id", ""),
|
|
371
|
-
explain_graph=resp.get("explain_graph", "")
|
|
372
|
-
)
|
|
369
|
+
return self._build_provenance_event(resp)
|
|
373
370
|
return None
|
|
374
371
|
|
|
375
372
|
# Handle Agent message format with chunk_type="explain"
|
|
376
373
|
if chunk_type == "explain":
|
|
377
374
|
if include_provenance:
|
|
378
|
-
return
|
|
379
|
-
explain_id=resp.get("explain_id", ""),
|
|
380
|
-
explain_graph=resp.get("explain_graph", "")
|
|
381
|
-
)
|
|
375
|
+
return self._build_provenance_event(resp)
|
|
382
376
|
return None
|
|
383
377
|
|
|
384
378
|
if chunk_type == "thought":
|
|
@@ -413,6 +407,42 @@ class SocketClient:
|
|
|
413
407
|
error=None
|
|
414
408
|
)
|
|
415
409
|
|
|
410
|
+
def _build_provenance_event(self, resp: Dict[str, Any]) -> ProvenanceEvent:
|
|
411
|
+
"""Build a ProvenanceEvent from a response dict, parsing inline triples
|
|
412
|
+
into an ExplainEntity if available."""
|
|
413
|
+
explain_id = resp.get("explain_id", "")
|
|
414
|
+
explain_graph = resp.get("explain_graph", "")
|
|
415
|
+
raw_triples = resp.get("explain_triples", [])
|
|
416
|
+
|
|
417
|
+
entity = None
|
|
418
|
+
if raw_triples:
|
|
419
|
+
try:
|
|
420
|
+
from .explainability import ExplainEntity
|
|
421
|
+
# Convert wire-format triple dicts to (s, p, o) tuples
|
|
422
|
+
parsed = []
|
|
423
|
+
for t in raw_triples:
|
|
424
|
+
s = t.get("s", {}).get("i", "") if t.get("s") else ""
|
|
425
|
+
p = t.get("p", {}).get("i", "") if t.get("p") else ""
|
|
426
|
+
o_term = t.get("o", {})
|
|
427
|
+
if o_term:
|
|
428
|
+
if o_term.get("t") == "i":
|
|
429
|
+
o = o_term.get("i", "")
|
|
430
|
+
else:
|
|
431
|
+
o = o_term.get("v", "")
|
|
432
|
+
else:
|
|
433
|
+
o = ""
|
|
434
|
+
parsed.append((s, p, o))
|
|
435
|
+
entity = ExplainEntity.from_triples(explain_id, parsed)
|
|
436
|
+
except Exception:
|
|
437
|
+
pass
|
|
438
|
+
|
|
439
|
+
return ProvenanceEvent(
|
|
440
|
+
explain_id=explain_id,
|
|
441
|
+
explain_graph=explain_graph,
|
|
442
|
+
entity=entity,
|
|
443
|
+
triples=raw_triples,
|
|
444
|
+
)
|
|
445
|
+
|
|
416
446
|
def close(self) -> None:
|
|
417
447
|
"""Close the persistent WebSocket connection."""
|
|
418
448
|
if self._loop and not self._loop.is_closed():
|
|
@@ -213,25 +213,47 @@ class ProvenanceEvent:
|
|
|
213
213
|
"""
|
|
214
214
|
Provenance event for explainability.
|
|
215
215
|
|
|
216
|
-
Emitted during
|
|
216
|
+
Emitted during retrieval queries when explainable mode is enabled.
|
|
217
217
|
Each event represents a provenance node created during query processing.
|
|
218
218
|
|
|
219
219
|
Attributes:
|
|
220
220
|
explain_id: URI of the provenance node (e.g., urn:trustgraph:question:abc123)
|
|
221
221
|
explain_graph: Named graph where provenance triples are stored (e.g., urn:graph:retrieval)
|
|
222
|
-
event_type: Type of provenance event (question, exploration, focus, synthesis)
|
|
222
|
+
event_type: Type of provenance event (question, exploration, focus, synthesis, etc.)
|
|
223
|
+
entity: Parsed ExplainEntity from inline triples (if available)
|
|
224
|
+
triples: Raw triples from the response (wire format dicts)
|
|
223
225
|
"""
|
|
224
226
|
explain_id: str
|
|
225
227
|
explain_graph: str = ""
|
|
226
228
|
event_type: str = "" # Derived from explain_id
|
|
229
|
+
entity: object = None # ExplainEntity (parsed from triples)
|
|
230
|
+
triples: list = dataclasses.field(default_factory=list) # Raw wire-format triple dicts
|
|
227
231
|
|
|
228
232
|
def __post_init__(self):
|
|
229
233
|
# Extract event type from explain_id
|
|
230
234
|
if "question" in self.explain_id:
|
|
231
235
|
self.event_type = "question"
|
|
236
|
+
elif "grounding" in self.explain_id:
|
|
237
|
+
self.event_type = "grounding"
|
|
232
238
|
elif "exploration" in self.explain_id:
|
|
233
239
|
self.event_type = "exploration"
|
|
234
240
|
elif "focus" in self.explain_id:
|
|
235
241
|
self.event_type = "focus"
|
|
236
242
|
elif "synthesis" in self.explain_id:
|
|
237
243
|
self.event_type = "synthesis"
|
|
244
|
+
elif "iteration" in self.explain_id:
|
|
245
|
+
self.event_type = "iteration"
|
|
246
|
+
elif "observation" in self.explain_id:
|
|
247
|
+
self.event_type = "observation"
|
|
248
|
+
elif "conclusion" in self.explain_id:
|
|
249
|
+
self.event_type = "conclusion"
|
|
250
|
+
elif "decomposition" in self.explain_id:
|
|
251
|
+
self.event_type = "decomposition"
|
|
252
|
+
elif "finding" in self.explain_id:
|
|
253
|
+
self.event_type = "finding"
|
|
254
|
+
elif "plan" in self.explain_id:
|
|
255
|
+
self.event_type = "plan"
|
|
256
|
+
elif "step-result" in self.explain_id:
|
|
257
|
+
self.event_type = "step-result"
|
|
258
|
+
elif "session" in self.explain_id:
|
|
259
|
+
self.event_type = "session"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.2.21"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Dict, Any, Tuple
|
|
2
2
|
from ...schema import AgentRequest, AgentResponse
|
|
3
3
|
from .base import MessageTranslator
|
|
4
|
+
from .primitives import TripleTranslator
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class AgentRequestTranslator(MessageTranslator):
|
|
@@ -49,10 +50,13 @@ class AgentRequestTranslator(MessageTranslator):
|
|
|
49
50
|
|
|
50
51
|
class AgentResponseTranslator(MessageTranslator):
|
|
51
52
|
"""Translator for AgentResponse schema objects"""
|
|
52
|
-
|
|
53
|
+
|
|
54
|
+
def __init__(self):
|
|
55
|
+
self.triple_translator = TripleTranslator()
|
|
56
|
+
|
|
53
57
|
def decode(self, data: Dict[str, Any]) -> AgentResponse:
|
|
54
58
|
raise NotImplementedError("Response translation to Pulsar not typically needed")
|
|
55
|
-
|
|
59
|
+
|
|
56
60
|
def encode(self, obj: AgentResponse) -> Dict[str, Any]:
|
|
57
61
|
result = {}
|
|
58
62
|
|
|
@@ -75,6 +79,13 @@ class AgentResponseTranslator(MessageTranslator):
|
|
|
75
79
|
if explain_graph is not None:
|
|
76
80
|
result["explain_graph"] = explain_graph
|
|
77
81
|
|
|
82
|
+
# Include explain_triples for explain messages
|
|
83
|
+
explain_triples = getattr(obj, "explain_triples", [])
|
|
84
|
+
if explain_triples:
|
|
85
|
+
result["explain_triples"] = [
|
|
86
|
+
self.triple_translator.encode(t) for t in explain_triples
|
|
87
|
+
]
|
|
88
|
+
|
|
78
89
|
# Always include error if present
|
|
79
90
|
if hasattr(obj, 'error') and obj.error and obj.error.message:
|
|
80
91
|
result["error"] = {"message": obj.error.message, "code": obj.error.code}
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/collection.py
RENAMED
|
@@ -79,7 +79,6 @@ class CollectionManagementResponseTranslator(MessageTranslator):
|
|
|
79
79
|
def encode(self, obj: CollectionManagementResponse) -> Dict[str, Any]:
|
|
80
80
|
result = {}
|
|
81
81
|
|
|
82
|
-
print("COLLECTIONMGMT", obj, flush=True)
|
|
83
82
|
|
|
84
83
|
if obj.error is not None:
|
|
85
84
|
result["error"] = {
|
|
@@ -99,6 +98,4 @@ class CollectionManagementResponseTranslator(MessageTranslator):
|
|
|
99
98
|
"tags": list(coll.tags) if coll.tags else []
|
|
100
99
|
})
|
|
101
100
|
|
|
102
|
-
print("RESULT IS", result, flush=True)
|
|
103
|
-
|
|
104
101
|
return result
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/retrieval.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Dict, Any, Tuple
|
|
2
2
|
from ...schema import DocumentRagQuery, DocumentRagResponse, GraphRagQuery, GraphRagResponse
|
|
3
3
|
from .base import MessageTranslator
|
|
4
|
+
from .primitives import TripleTranslator
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class DocumentRagRequestTranslator(MessageTranslator):
|
|
@@ -28,6 +29,9 @@ class DocumentRagRequestTranslator(MessageTranslator):
|
|
|
28
29
|
class DocumentRagResponseTranslator(MessageTranslator):
|
|
29
30
|
"""Translator for DocumentRagResponse schema objects"""
|
|
30
31
|
|
|
32
|
+
def __init__(self):
|
|
33
|
+
self.triple_translator = TripleTranslator()
|
|
34
|
+
|
|
31
35
|
def decode(self, data: Dict[str, Any]) -> DocumentRagResponse:
|
|
32
36
|
raise NotImplementedError("Response translation to Pulsar not typically needed")
|
|
33
37
|
|
|
@@ -53,6 +57,13 @@ class DocumentRagResponseTranslator(MessageTranslator):
|
|
|
53
57
|
if explain_graph is not None:
|
|
54
58
|
result["explain_graph"] = explain_graph
|
|
55
59
|
|
|
60
|
+
# Include explain_triples for explain messages
|
|
61
|
+
explain_triples = getattr(obj, "explain_triples", [])
|
|
62
|
+
if explain_triples:
|
|
63
|
+
result["explain_triples"] = [
|
|
64
|
+
self.triple_translator.encode(t) for t in explain_triples
|
|
65
|
+
]
|
|
66
|
+
|
|
56
67
|
# Include end_of_stream flag (LLM stream complete)
|
|
57
68
|
result["end_of_stream"] = getattr(obj, "end_of_stream", False)
|
|
58
69
|
|
|
@@ -107,6 +118,9 @@ class GraphRagRequestTranslator(MessageTranslator):
|
|
|
107
118
|
class GraphRagResponseTranslator(MessageTranslator):
|
|
108
119
|
"""Translator for GraphRagResponse schema objects"""
|
|
109
120
|
|
|
121
|
+
def __init__(self):
|
|
122
|
+
self.triple_translator = TripleTranslator()
|
|
123
|
+
|
|
110
124
|
def decode(self, data: Dict[str, Any]) -> GraphRagResponse:
|
|
111
125
|
raise NotImplementedError("Response translation to Pulsar not typically needed")
|
|
112
126
|
|
|
@@ -132,6 +146,13 @@ class GraphRagResponseTranslator(MessageTranslator):
|
|
|
132
146
|
if explain_graph is not None:
|
|
133
147
|
result["explain_graph"] = explain_graph
|
|
134
148
|
|
|
149
|
+
# Include explain_triples for explain messages
|
|
150
|
+
explain_triples = getattr(obj, "explain_triples", [])
|
|
151
|
+
if explain_triples:
|
|
152
|
+
result["explain_triples"] = [
|
|
153
|
+
self.triple_translator.encode(t) for t in explain_triples
|
|
154
|
+
]
|
|
155
|
+
|
|
135
156
|
# Include end_of_stream flag (LLM stream complete)
|
|
136
157
|
result["end_of_stream"] = getattr(obj, "end_of_stream", False)
|
|
137
158
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
from dataclasses import dataclass, field
|
|
3
3
|
from typing import Optional
|
|
4
4
|
|
|
5
|
-
from ..core.primitives import Error
|
|
5
|
+
from ..core.primitives import Error, Triple
|
|
6
6
|
|
|
7
7
|
############################################################################
|
|
8
8
|
|
|
@@ -57,8 +57,9 @@ class AgentResponse:
|
|
|
57
57
|
end_of_dialog: bool = False # Entire agent dialog is complete
|
|
58
58
|
|
|
59
59
|
# Explainability fields
|
|
60
|
-
explain_id: str | None = None #
|
|
61
|
-
explain_graph: str | None = None # Named graph
|
|
60
|
+
explain_id: str | None = None # Root URI for this explain step
|
|
61
|
+
explain_graph: str | None = None # Named graph (e.g., urn:graph:retrieval)
|
|
62
|
+
explain_triples: list[Triple] = field(default_factory=list) # Provenance triples for this step
|
|
62
63
|
|
|
63
64
|
# Orchestration fields
|
|
64
65
|
message_id: str = "" # Unique ID for this response message
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from ..core.primitives import Error, Term
|
|
1
|
+
from dataclasses import dataclass, field
|
|
2
|
+
from ..core.primitives import Error, Term, Triple
|
|
3
3
|
|
|
4
4
|
############################################################################
|
|
5
5
|
|
|
@@ -24,8 +24,9 @@ class GraphRagResponse:
|
|
|
24
24
|
error: Error | None = None
|
|
25
25
|
response: str = ""
|
|
26
26
|
end_of_stream: bool = False # LLM response stream complete
|
|
27
|
-
explain_id: str | None = None #
|
|
28
|
-
explain_graph: str | None = None # Named graph
|
|
27
|
+
explain_id: str | None = None # Root URI for this explain step
|
|
28
|
+
explain_graph: str | None = None # Named graph (e.g., urn:graph:retrieval)
|
|
29
|
+
explain_triples: list[Triple] = field(default_factory=list) # Provenance triples for this step
|
|
29
30
|
message_type: str = "" # "chunk" or "explain"
|
|
30
31
|
end_of_session: bool = False # Entire session complete
|
|
31
32
|
|
|
@@ -46,7 +47,8 @@ class DocumentRagResponse:
|
|
|
46
47
|
error: Error | None = None
|
|
47
48
|
response: str | None = ""
|
|
48
49
|
end_of_stream: bool = False # LLM response stream complete
|
|
49
|
-
explain_id: str | None = None #
|
|
50
|
-
explain_graph: str | None = None # Named graph
|
|
50
|
+
explain_id: str | None = None # Root URI for this explain step
|
|
51
|
+
explain_graph: str | None = None # Named graph (e.g., urn:graph:retrieval)
|
|
52
|
+
explain_triples: list[Triple] = field(default_factory=list) # Provenance triples for this step
|
|
51
53
|
message_type: str = "" # "chunk" or "explain"
|
|
52
54
|
end_of_session: bool = False # Entire session complete
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trustgraph-base
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.21
|
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
|
5
5
|
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
|
6
6
|
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.2.20"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/collection_config_handler.py
RENAMED
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/document_embeddings_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/graph_embeddings_client.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/graph_embeddings_query_service.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/graph_embeddings_store_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/row_embeddings_query_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/base/structured_query_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/document_embeddings_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/graph_embeddings_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/row_embeddings_client.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/clients/triples_query_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/config.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/diagnosis.py
RENAMED
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/embeddings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/knowledge.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/library.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/metadata.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/nlp_query.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/primitives.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/prompt.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/rows_query.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/sparql_query.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/messaging/translators/triples.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/sparql_query.py
RENAMED
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/structured_query.py
RENAMED
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph/schema/services/tool_service.py
RENAMED
|
File without changes
|
|
File without changes
|
{trustgraph_base-2.2.20 → trustgraph_base-2.2.21}/trustgraph_base.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|