trustgraph-base 2.7.14__tar.gz → 2.8.0__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.
Files changed (210) hide show
  1. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/PKG-INFO +2 -1
  2. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/pyproject.toml +1 -0
  3. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/__init__.py +8 -1
  4. trustgraph_base-2.8.0/trustgraph/base/async_backend.py +119 -0
  5. trustgraph_base-2.8.0/trustgraph/base/async_config_client.py +121 -0
  6. trustgraph_base-2.8.0/trustgraph/base/async_librarian_client.py +260 -0
  7. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/async_processor.py +116 -198
  8. trustgraph_base-2.8.0/trustgraph/base/async_pulsar_backend.py +296 -0
  9. trustgraph_base-2.8.0/trustgraph/base/async_rabbitmq_backend.py +318 -0
  10. trustgraph_base-2.8.0/trustgraph/base/async_rr_wrapper.py +36 -0
  11. trustgraph_base-2.8.0/trustgraph/base/audit_publisher.py +60 -0
  12. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/consumer_spec.py +23 -0
  13. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/document_embeddings_query_service.py +0 -7
  14. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/dynamic_tool_service.py +46 -62
  15. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/embeddings_service.py +0 -7
  16. trustgraph_base-2.8.0/trustgraph/base/flow.py +83 -0
  17. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/graph_embeddings_query_service.py +0 -7
  18. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/image_to_text_service.py +0 -7
  19. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/keyword_index_service.py +0 -7
  20. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/librarian_spec.py +19 -0
  21. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/llm_service.py +0 -7
  22. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/processor_group.py +12 -3
  23. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/producer_spec.py +12 -0
  24. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/pubsub.py +33 -0
  25. trustgraph_base-2.8.0/trustgraph/base/receiver_pool.py +270 -0
  26. trustgraph_base-2.8.0/trustgraph/base/request_response_client.py +182 -0
  27. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/request_response_spec.py +51 -0
  28. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/reranker_service.py +0 -7
  29. trustgraph_base-2.8.0/trustgraph/base/sender_pool.py +205 -0
  30. trustgraph_base-2.8.0/trustgraph/base/spec.py +9 -0
  31. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/tool_service.py +0 -7
  32. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/triples_query_service.py +0 -7
  33. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/workspace_processor.py +2 -3
  34. trustgraph_base-2.8.0/trustgraph/base_version.py +1 -0
  35. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph_base.egg-info/PKG-INFO +2 -1
  36. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph_base.egg-info/SOURCES.txt +9 -0
  37. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph_base.egg-info/requires.txt +1 -0
  38. trustgraph_base-2.7.14/trustgraph/base/audit_publisher.py +0 -41
  39. trustgraph_base-2.7.14/trustgraph/base/flow.py +0 -46
  40. trustgraph_base-2.7.14/trustgraph/base/spec.py +0 -4
  41. trustgraph_base-2.7.14/trustgraph/base_version.py +0 -1
  42. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/README.md +0 -0
  43. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/setup.cfg +0 -0
  44. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/__init__.py +0 -0
  45. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/api.py +0 -0
  46. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/async_bulk_client.py +0 -0
  47. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/async_flow.py +0 -0
  48. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/async_metrics.py +0 -0
  49. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/async_socket_client.py +0 -0
  50. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/bulk_client.py +0 -0
  51. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/collection.py +0 -0
  52. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/config.py +0 -0
  53. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/exceptions.py +0 -0
  54. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/explainability.py +0 -0
  55. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/flow.py +0 -0
  56. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/knowledge.py +0 -0
  57. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/library.py +0 -0
  58. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/metrics.py +0 -0
  59. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/socket_client.py +0 -0
  60. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/api/types.py +0 -0
  61. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/agent_client.py +0 -0
  62. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/agent_service.py +0 -0
  63. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/backend.py +0 -0
  64. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/cassandra_config.py +0 -0
  65. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/chunking_service.py +0 -0
  66. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/collection_config_handler.py +0 -0
  67. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/config_client.py +0 -0
  68. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/consumer.py +0 -0
  69. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/document_embeddings_client.py +0 -0
  70. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/document_embeddings_store_service.py +0 -0
  71. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/embeddings_client.py +0 -0
  72. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/flow_processor.py +0 -0
  73. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/graph_embeddings_client.py +0 -0
  74. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/graph_embeddings_store_service.py +0 -0
  75. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/graph_rag_client.py +0 -0
  76. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/iam_client.py +0 -0
  77. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/kafka_backend.py +0 -0
  78. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/keyword_index_client.py +0 -0
  79. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/librarian_client.py +0 -0
  80. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/logging.py +0 -0
  81. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/metrics.py +0 -0
  82. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/parameter_spec.py +0 -0
  83. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/producer.py +0 -0
  84. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/prompt_client.py +0 -0
  85. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/publisher.py +0 -0
  86. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/pulsar_backend.py +0 -0
  87. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/qdrant_config.py +0 -0
  88. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/rabbitmq_backend.py +0 -0
  89. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/reranker_client.py +0 -0
  90. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/row_embeddings_query_client.py +0 -0
  91. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/schema_compatibility.py +0 -0
  92. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/serialization.py +0 -0
  93. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/structured_query_client.py +0 -0
  94. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/subscriber.py +0 -0
  95. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/subscriber_spec.py +0 -0
  96. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/text_completion_client.py +0 -0
  97. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/tool_client.py +0 -0
  98. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/tool_service_client.py +0 -0
  99. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/triples_client.py +0 -0
  100. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/base/triples_store_service.py +0 -0
  101. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/__init__.py +0 -0
  102. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/agent_client.py +0 -0
  103. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/base.py +0 -0
  104. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/config_client.py +0 -0
  105. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/document_embeddings_client.py +0 -0
  106. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/document_rag_client.py +0 -0
  107. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/embeddings_client.py +0 -0
  108. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/graph_embeddings_client.py +0 -0
  109. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/graph_rag_client.py +0 -0
  110. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/llm_client.py +0 -0
  111. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/prompt_client.py +0 -0
  112. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/row_embeddings_client.py +0 -0
  113. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/clients/triples_query_client.py +0 -0
  114. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/exceptions.py +0 -0
  115. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/__init__.py +0 -0
  116. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/__init__.py +0 -0
  117. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/ar.json +0 -0
  118. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/en.json +0 -0
  119. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/es.json +0 -0
  120. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/he.json +0 -0
  121. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/hi.json +0 -0
  122. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/pt.json +0 -0
  123. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/ru.json +0 -0
  124. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/sw.json +0 -0
  125. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/tr.json +0 -0
  126. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/i18n/packs/zh-cn.json +0 -0
  127. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/knowledge/__init__.py +0 -0
  128. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/knowledge/defs.py +0 -0
  129. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/knowledge/document.py +0 -0
  130. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/knowledge/identifier.py +0 -0
  131. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/knowledge/organization.py +0 -0
  132. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/knowledge/publication.py +0 -0
  133. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/log_level.py +0 -0
  134. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/__init__.py +0 -0
  135. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/registry.py +0 -0
  136. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/__init__.py +0 -0
  137. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/agent.py +0 -0
  138. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/base.py +0 -0
  139. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/collection.py +0 -0
  140. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/config.py +0 -0
  141. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/diagnosis.py +0 -0
  142. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/document_loading.py +0 -0
  143. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/embeddings.py +0 -0
  144. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/embeddings_query.py +0 -0
  145. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/flow.py +0 -0
  146. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/iam.py +0 -0
  147. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/image_to_text.py +0 -0
  148. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/knowledge.py +0 -0
  149. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/library.py +0 -0
  150. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/metadata.py +0 -0
  151. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/nlp_query.py +0 -0
  152. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/primitives.py +0 -0
  153. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/prompt.py +0 -0
  154. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/reranker.py +0 -0
  155. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/retrieval.py +0 -0
  156. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/rows_query.py +0 -0
  157. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/sparql_query.py +0 -0
  158. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/structured_query.py +0 -0
  159. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/text_completion.py +0 -0
  160. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/tool.py +0 -0
  161. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/messaging/translators/triples.py +0 -0
  162. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/objects/__init__.py +0 -0
  163. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/objects/field.py +0 -0
  164. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/objects/object.py +0 -0
  165. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/provenance/__init__.py +0 -0
  166. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/provenance/agent.py +0 -0
  167. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/provenance/namespaces.py +0 -0
  168. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/provenance/triples.py +0 -0
  169. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/provenance/uris.py +0 -0
  170. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/provenance/vocabulary.py +0 -0
  171. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/rdf.py +0 -0
  172. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/__init__.py +0 -0
  173. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/core/__init__.py +0 -0
  174. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/core/metadata.py +0 -0
  175. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/core/primitives.py +0 -0
  176. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/core/topic.py +0 -0
  177. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/knowledge/__init__.py +0 -0
  178. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/knowledge/document.py +0 -0
  179. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/knowledge/embeddings.py +0 -0
  180. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/knowledge/graph.py +0 -0
  181. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/knowledge/knowledge.py +0 -0
  182. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/knowledge/nlp.py +0 -0
  183. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/knowledge/object.py +0 -0
  184. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/knowledge/rows.py +0 -0
  185. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/knowledge/structured.py +0 -0
  186. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/__init__.py +0 -0
  187. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/agent.py +0 -0
  188. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/audit.py +0 -0
  189. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/collection.py +0 -0
  190. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/config.py +0 -0
  191. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/diagnosis.py +0 -0
  192. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/flow.py +0 -0
  193. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/iam.py +0 -0
  194. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/image_to_text.py +0 -0
  195. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/library.py +0 -0
  196. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/llm.py +0 -0
  197. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/lookup.py +0 -0
  198. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/nlp_query.py +0 -0
  199. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/prompt.py +0 -0
  200. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/query.py +0 -0
  201. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/reranker.py +0 -0
  202. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/retrieval.py +0 -0
  203. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/rows_query.py +0 -0
  204. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/sparql_query.py +0 -0
  205. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/storage.py +0 -0
  206. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/structured_query.py +0 -0
  207. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph/schema/services/tool_service.py +0 -0
  208. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph_base.egg-info/dependency_links.txt +0 -0
  209. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/trustgraph_base.egg-info/entry_points.txt +0 -0
  210. {trustgraph_base-2.7.14 → trustgraph_base-2.8.0}/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.7.14
3
+ Version: 2.8.0
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
@@ -13,6 +13,7 @@ Requires-Dist: prometheus-client
13
13
  Requires-Dist: requests
14
14
  Requires-Dist: python-logging-loki
15
15
  Requires-Dist: pika
16
+ Requires-Dist: aio-pika
16
17
  Requires-Dist: confluent-kafka
17
18
  Requires-Dist: pyyaml
18
19
  Requires-Dist: websockets
@@ -15,6 +15,7 @@ dependencies = [
15
15
  "requests",
16
16
  "python-logging-loki",
17
17
  "pika",
18
+ "aio-pika",
18
19
  "confluent-kafka",
19
20
  "pyyaml",
20
21
  "websockets",
@@ -1,5 +1,5 @@
1
1
 
2
- from . pubsub import get_pubsub, add_pubsub_args
2
+ from . pubsub import get_pubsub, get_async_pubsub, add_pubsub_args
3
3
  from . async_processor import AsyncProcessor
4
4
  from . consumer import Consumer
5
5
  from . producer import Producer
@@ -51,4 +51,11 @@ from . row_embeddings_query_client import RowEmbeddingsQueryClientSpec
51
51
  from . collection_config_handler import CollectionConfigHandler
52
52
  from . audit_publisher import AuditPublisher
53
53
  from . schema_compatibility import is_strict_mode_compatible
54
+ from . async_backend import (
55
+ AsyncPubSubBackend, AsyncBackendConsumer, AsyncBackendProducer, Message,
56
+ )
57
+ from . receiver_pool import ReceiverPool, ConsumerRegistration
58
+ from . sender_pool import SenderPool, ProducerHandle
59
+ from . request_response_client import RequestResponseClient
60
+ from . async_librarian_client import AsyncLibrarianClient
54
61
 
@@ -0,0 +1,119 @@
1
+ """
2
+ Async backend abstraction interfaces for pub/sub systems.
3
+
4
+ These protocols replace the synchronous protocols in backend.py.
5
+ All methods that perform broker I/O are async. The backend handles
6
+ its own threading internally — the application layer never creates
7
+ threads for broker operations.
8
+ """
9
+
10
+ from typing import Protocol, Any, runtime_checkable
11
+
12
+
13
+ @runtime_checkable
14
+ class Message(Protocol):
15
+ """Protocol for a received message."""
16
+
17
+ def value(self) -> Any:
18
+ """Get the deserialized message content."""
19
+ ...
20
+
21
+ def properties(self) -> dict:
22
+ """Get message properties/metadata."""
23
+ ...
24
+
25
+
26
+ @runtime_checkable
27
+ class AsyncBackendConsumer(Protocol):
28
+ """Protocol for an async backend consumer.
29
+
30
+ receive() is awaitable with no timeout — shutdown is signalled
31
+ by cancelling the awaiting task. acknowledge() and
32
+ negative_acknowledge() are async so that backends with threading
33
+ constraints (e.g. RabbitMQ) can route ack calls internally.
34
+ """
35
+
36
+ async def receive(self) -> Message:
37
+ """Await the next message.
38
+
39
+ Does not time out. Shutdown is signalled by cancelling the
40
+ awaiting task.
41
+ """
42
+ ...
43
+
44
+ async def acknowledge(self, message: Message) -> None:
45
+ """Acknowledge successful processing of a message."""
46
+ ...
47
+
48
+ async def negative_acknowledge(self, message: Message) -> None:
49
+ """Negative acknowledge — triggers redelivery."""
50
+ ...
51
+
52
+ async def close(self) -> None:
53
+ """Close the consumer and release broker resources."""
54
+ ...
55
+
56
+
57
+ @runtime_checkable
58
+ class AsyncBackendProducer(Protocol):
59
+ """Protocol for an async backend producer.
60
+
61
+ send() is async so the backend can perform broker I/O without
62
+ blocking the event loop.
63
+ """
64
+
65
+ async def send(self, message: Any, properties: dict = {}) -> None:
66
+ """Send a message with optional properties."""
67
+ ...
68
+
69
+ async def close(self) -> None:
70
+ """Flush pending messages and close the producer."""
71
+ ...
72
+
73
+
74
+ @runtime_checkable
75
+ class AsyncPubSubBackend(Protocol):
76
+ """Protocol for an async pub/sub backend.
77
+
78
+ Factory methods are async since they perform broker roundtrips.
79
+ """
80
+
81
+ async def create_consumer(
82
+ self, topic: str, subscription: str, schema: type,
83
+ initial_position: str = 'latest', **options,
84
+ ) -> AsyncBackendConsumer:
85
+ """Create a consumer subscribed to a topic.
86
+
87
+ Returns only when the subscription is active and ready to
88
+ receive messages.
89
+ """
90
+ ...
91
+
92
+ async def create_producer(
93
+ self, topic: str, schema: type, **options,
94
+ ) -> AsyncBackendProducer:
95
+ """Create a producer bound to a topic.
96
+
97
+ Returns only when the producer is ready to send.
98
+ """
99
+ ...
100
+
101
+ async def create_topic(self, topic: str) -> None:
102
+ """Create broker-side resources for a logical topic."""
103
+ ...
104
+
105
+ async def delete_topic(self, topic: str) -> None:
106
+ """Delete a topic and discard any in-flight messages."""
107
+ ...
108
+
109
+ async def topic_exists(self, topic: str) -> bool:
110
+ """Check whether a topic exists."""
111
+ ...
112
+
113
+ async def ensure_topic(self, topic: str) -> None:
114
+ """Ensure a topic exists, creating it if necessary."""
115
+ ...
116
+
117
+ async def close(self) -> None:
118
+ """Close the backend and release all resources."""
119
+ ...
@@ -0,0 +1,121 @@
1
+
2
+ from .. schema import ConfigRequest, ConfigResponse, ConfigKey, ConfigValue
3
+ from . request_response_client import RequestResponseClient
4
+
5
+ CONFIG_TIMEOUT = 10
6
+
7
+
8
+ class AsyncConfigClient:
9
+
10
+ def __init__(self, client):
11
+ self._client = client
12
+
13
+ @classmethod
14
+ async def create(cls, backend, request_topic, response_topic,
15
+ subscription=None):
16
+ client = await RequestResponseClient.create(
17
+ backend=backend,
18
+ request_topic=request_topic,
19
+ response_topic=response_topic,
20
+ request_schema=ConfigRequest,
21
+ response_schema=ConfigResponse,
22
+ subscription=subscription,
23
+ )
24
+ return cls(client)
25
+
26
+ async def start(self):
27
+ pass
28
+
29
+ async def stop(self):
30
+ await self._client.close()
31
+
32
+ async def close(self):
33
+ await self._client.close()
34
+
35
+ async def request(self, message, timeout=CONFIG_TIMEOUT):
36
+ return await self._client.request(message, timeout=timeout)
37
+
38
+ async def _request(self, timeout=CONFIG_TIMEOUT, **kwargs):
39
+ resp = await self._client.request(
40
+ ConfigRequest(**kwargs),
41
+ timeout=timeout,
42
+ )
43
+ if resp.error:
44
+ raise RuntimeError(
45
+ f"{resp.error.type}: {resp.error.message}"
46
+ )
47
+ return resp
48
+
49
+ async def get(self, workspace, type, key, timeout=CONFIG_TIMEOUT):
50
+ resp = await self._request(
51
+ operation="get",
52
+ workspace=workspace,
53
+ keys=[ConfigKey(type=type, key=key)],
54
+ timeout=timeout,
55
+ )
56
+ if resp.values and len(resp.values) > 0:
57
+ return resp.values[0].value
58
+ return None
59
+
60
+ async def put(self, workspace, type, key, value, timeout=CONFIG_TIMEOUT):
61
+ await self._request(
62
+ operation="put",
63
+ workspace=workspace,
64
+ values=[ConfigValue(type=type, key=key, value=value)],
65
+ timeout=timeout,
66
+ )
67
+
68
+ async def put_many(self, workspace, values, timeout=CONFIG_TIMEOUT):
69
+ await self._request(
70
+ operation="put",
71
+ workspace=workspace,
72
+ values=[
73
+ ConfigValue(type=t, key=k, value=v)
74
+ for t, k, v in values
75
+ ],
76
+ timeout=timeout,
77
+ )
78
+
79
+ async def delete(self, workspace, type, key, timeout=CONFIG_TIMEOUT):
80
+ await self._request(
81
+ operation="delete",
82
+ workspace=workspace,
83
+ keys=[ConfigKey(type=type, key=key)],
84
+ timeout=timeout,
85
+ )
86
+
87
+ async def delete_many(self, workspace, keys, timeout=CONFIG_TIMEOUT):
88
+ await self._request(
89
+ operation="delete",
90
+ workspace=workspace,
91
+ keys=[
92
+ ConfigKey(type=t, key=k)
93
+ for t, k in keys
94
+ ],
95
+ timeout=timeout,
96
+ )
97
+
98
+ async def keys(self, workspace, type, timeout=CONFIG_TIMEOUT):
99
+ resp = await self._request(
100
+ operation="list",
101
+ workspace=workspace,
102
+ type=type,
103
+ timeout=timeout,
104
+ )
105
+ return resp.directory
106
+
107
+ async def get_all(self, workspace, timeout=CONFIG_TIMEOUT):
108
+ resp = await self._request(
109
+ operation="config",
110
+ workspace=workspace,
111
+ timeout=timeout,
112
+ )
113
+ return resp.config
114
+
115
+ async def workspaces_for_type(self, type, timeout=CONFIG_TIMEOUT):
116
+ resp = await self._request(
117
+ operation="getvalues-all-ws",
118
+ type=type,
119
+ timeout=timeout,
120
+ )
121
+ return {v.workspace for v in resp.values if v.workspace}
@@ -0,0 +1,260 @@
1
+ """
2
+ Async librarian client using the async pub/sub backend directly.
3
+
4
+ Replaces LibrarianClient's Consumer+Producer (which create OS threads)
5
+ with async backend producers/consumers and a dedicated receiver
6
+ coroutine. Supports both single-response and streaming operations.
7
+ """
8
+
9
+ import asyncio
10
+ import base64
11
+ import logging
12
+ import uuid
13
+
14
+ from ..schema import LibrarianRequest, LibrarianResponse, DocumentMetadata
15
+
16
+ logger = logging.getLogger(__name__)
17
+
18
+
19
+ class AsyncLibrarianClient:
20
+
21
+ def __init__(self):
22
+ self._producer = None
23
+ self._consumer = None
24
+ self._receiver_task = None
25
+ self._pending = {}
26
+ self._streams = {}
27
+ self.running = False
28
+
29
+ @classmethod
30
+ async def create(
31
+ cls, backend, request_topic, response_topic,
32
+ subscription=None,
33
+ ):
34
+ client = cls()
35
+
36
+ client._producer = await backend.create_producer(
37
+ topic=request_topic,
38
+ schema=LibrarianRequest,
39
+ )
40
+
41
+ if subscription is None:
42
+ subscription = f"librarian-{uuid.uuid4().hex[:12]}"
43
+
44
+ client._consumer = await backend.create_consumer(
45
+ topic=response_topic,
46
+ subscription=subscription,
47
+ schema=LibrarianResponse,
48
+ initial_position='latest',
49
+ )
50
+
51
+ client.running = True
52
+ client._receiver_task = asyncio.create_task(
53
+ client._response_loop(),
54
+ name=f"librarian-receiver-{response_topic}",
55
+ )
56
+
57
+ logger.info(
58
+ f"AsyncLibrarianClient created: "
59
+ f"req={request_topic}, resp={response_topic}"
60
+ )
61
+ return client
62
+
63
+ async def start(self):
64
+ pass
65
+
66
+ async def _response_loop(self):
67
+ try:
68
+ while self.running:
69
+ msg = await self._consumer.receive()
70
+ response = msg.value()
71
+ request_id = msg.properties().get("id")
72
+
73
+ if request_id:
74
+ if request_id in self._pending:
75
+ future = self._pending.pop(request_id)
76
+ if not future.done():
77
+ future.set_result(response)
78
+ elif request_id in self._streams:
79
+ await self._streams[request_id].put(response)
80
+
81
+ await self._consumer.acknowledge(msg)
82
+
83
+ except asyncio.CancelledError:
84
+ raise
85
+ except Exception as e:
86
+ logger.error(
87
+ f"Librarian response loop error: {e}", exc_info=True,
88
+ )
89
+
90
+ async def request(self, request, timeout=120):
91
+ request_id = str(uuid.uuid4())
92
+
93
+ future = asyncio.get_event_loop().create_future()
94
+ self._pending[request_id] = future
95
+
96
+ try:
97
+ await self._producer.send(
98
+ request, properties={"id": request_id},
99
+ )
100
+ response = await asyncio.wait_for(future, timeout=timeout)
101
+
102
+ if response.error:
103
+ raise RuntimeError(
104
+ f"Librarian error: {response.error.type}: "
105
+ f"{response.error.message}"
106
+ )
107
+
108
+ return response
109
+
110
+ except asyncio.TimeoutError:
111
+ self._pending.pop(request_id, None)
112
+ raise RuntimeError("Timeout waiting for librarian response")
113
+
114
+ async def stream(self, request, timeout=120):
115
+ request_id = str(uuid.uuid4())
116
+
117
+ q = asyncio.Queue()
118
+ self._streams[request_id] = q
119
+
120
+ try:
121
+ await self._producer.send(
122
+ request, properties={"id": request_id},
123
+ )
124
+
125
+ chunks = []
126
+ while True:
127
+ response = await asyncio.wait_for(
128
+ q.get(), timeout=timeout,
129
+ )
130
+
131
+ if response.error:
132
+ raise RuntimeError(
133
+ f"Librarian error: {response.error.type}: "
134
+ f"{response.error.message}"
135
+ )
136
+
137
+ chunks.append(response)
138
+
139
+ if response.is_final:
140
+ break
141
+
142
+ return chunks
143
+
144
+ except asyncio.TimeoutError:
145
+ self._streams.pop(request_id, None)
146
+ raise RuntimeError("Timeout waiting for librarian stream")
147
+ finally:
148
+ self._streams.pop(request_id, None)
149
+
150
+ async def stop(self):
151
+ self.running = False
152
+
153
+ if self._receiver_task:
154
+ self._receiver_task.cancel()
155
+ try:
156
+ await self._receiver_task
157
+ except asyncio.CancelledError:
158
+ pass
159
+
160
+ for future in self._pending.values():
161
+ if not future.done():
162
+ future.cancel()
163
+ self._pending.clear()
164
+
165
+ for q in self._streams.values():
166
+ await q.put(None)
167
+ self._streams.clear()
168
+
169
+ if self._producer:
170
+ try:
171
+ await self._producer.close()
172
+ except Exception as e:
173
+ logger.warning(f"Error closing librarian producer: {e}")
174
+
175
+ if self._consumer:
176
+ try:
177
+ await self._consumer.close()
178
+ except Exception as e:
179
+ logger.warning(f"Error closing librarian consumer: {e}")
180
+
181
+ logger.info("AsyncLibrarianClient closed")
182
+
183
+ async def fetch_document_content(self, document_id, timeout=120):
184
+ req = LibrarianRequest(
185
+ operation="stream-document",
186
+ document_id=document_id,
187
+ )
188
+ chunks = await self.stream(req, timeout=timeout)
189
+
190
+ raw = b""
191
+ for chunk in chunks:
192
+ if chunk.content:
193
+ if isinstance(chunk.content, bytes):
194
+ raw += base64.b64decode(chunk.content)
195
+ else:
196
+ raw += base64.b64decode(
197
+ chunk.content.encode("utf-8")
198
+ )
199
+
200
+ return base64.b64encode(raw)
201
+
202
+ async def fetch_document_text(self, document_id, timeout=120):
203
+ content = await self.fetch_document_content(
204
+ document_id, timeout=timeout,
205
+ )
206
+ return base64.b64decode(content).decode("utf-8")
207
+
208
+ async def fetch_document_metadata(self, document_id, timeout=120):
209
+ req = LibrarianRequest(
210
+ operation="get-document-metadata",
211
+ document_id=document_id,
212
+ )
213
+ response = await self.request(req, timeout=timeout)
214
+ return response.document_metadata
215
+
216
+ async def save_child_document(self, doc_id, parent_id, content,
217
+ document_type="chunk", title=None,
218
+ kind="text/plain", timeout=120):
219
+ if isinstance(content, str):
220
+ content = content.encode("utf-8")
221
+
222
+ doc_metadata = DocumentMetadata(
223
+ id=doc_id,
224
+ kind=kind,
225
+ title=title or doc_id,
226
+ parent_id=parent_id,
227
+ document_type=document_type,
228
+ )
229
+
230
+ req = LibrarianRequest(
231
+ operation="add-child-document",
232
+ document_metadata=doc_metadata,
233
+ content=base64.b64encode(content).decode("utf-8"),
234
+ )
235
+
236
+ await self.request(req, timeout=timeout)
237
+ return doc_id
238
+
239
+ async def save_document(self, doc_id, content, title=None,
240
+ document_type="answer", kind="text/plain",
241
+ timeout=120):
242
+ if isinstance(content, str):
243
+ content = content.encode("utf-8")
244
+
245
+ doc_metadata = DocumentMetadata(
246
+ id=doc_id,
247
+ kind=kind,
248
+ title=title or doc_id,
249
+ document_type=document_type,
250
+ )
251
+
252
+ req = LibrarianRequest(
253
+ operation="add-document",
254
+ document_id=doc_id,
255
+ document_metadata=doc_metadata,
256
+ content=base64.b64encode(content).decode("utf-8"),
257
+ )
258
+
259
+ await self.request(req, timeout=timeout)
260
+ return doc_id