trustgraph-flow 0.16.0__tar.gz → 0.16.2__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 (203) hide show
  1. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/PKG-INFO +2 -2
  2. trustgraph-flow-0.16.2/scripts/api-gateway +6 -0
  3. trustgraph-flow-0.16.0/scripts/api-gateway → trustgraph-flow-0.16.2/trustgraph/api/gateway/service.py +290 -85
  4. trustgraph-flow-0.16.2/trustgraph/flow_version.py +1 -0
  5. trustgraph-flow-0.16.2/trustgraph/model/prompt/template/__main__.py +7 -0
  6. trustgraph-flow-0.16.2/trustgraph/query/triples/neo4j/__init__.py +3 -0
  7. trustgraph-flow-0.16.2/trustgraph/storage/triples/__init__.py +0 -0
  8. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph_flow.egg-info/PKG-INFO +2 -2
  9. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph_flow.egg-info/SOURCES.txt +4 -0
  10. trustgraph-flow-0.16.0/trustgraph/flow_version.py +0 -1
  11. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/README.md +0 -0
  12. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/agent-manager-react +0 -0
  13. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/chunker-recursive +0 -0
  14. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/chunker-token +0 -0
  15. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/de-query-milvus +0 -0
  16. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/de-query-qdrant +0 -0
  17. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/de-write-milvus +0 -0
  18. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/de-write-qdrant +0 -0
  19. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/document-rag +0 -0
  20. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/embeddings-ollama +0 -0
  21. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/embeddings-vectorize +0 -0
  22. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/ge-query-milvus +0 -0
  23. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/ge-query-qdrant +0 -0
  24. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/ge-write-milvus +0 -0
  25. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/ge-write-qdrant +0 -0
  26. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/graph-rag +0 -0
  27. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/kg-extract-definitions +0 -0
  28. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/kg-extract-relationships +0 -0
  29. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/kg-extract-topics +0 -0
  30. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/metering +0 -0
  31. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/object-extract-row +0 -0
  32. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/oe-write-milvus +0 -0
  33. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/pdf-decoder +0 -0
  34. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/prompt-generic +0 -0
  35. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/prompt-template +0 -0
  36. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/rows-write-cassandra +0 -0
  37. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/run-processing +0 -0
  38. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/text-completion-azure +0 -0
  39. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/text-completion-azure-openai +0 -0
  40. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/text-completion-claude +0 -0
  41. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/text-completion-cohere +0 -0
  42. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/text-completion-googleaistudio +0 -0
  43. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/text-completion-llamafile +0 -0
  44. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/text-completion-ollama +0 -0
  45. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/text-completion-openai +0 -0
  46. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/triples-query-cassandra +0 -0
  47. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/triples-query-neo4j +0 -0
  48. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/triples-write-cassandra +0 -0
  49. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/scripts/triples-write-neo4j +0 -0
  50. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/setup.cfg +0 -0
  51. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/setup.py +0 -0
  52. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/__init__.py +0 -0
  53. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/agent/__init__.py +0 -0
  54. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/agent/react/__init__.py +0 -0
  55. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/agent/react/__main__.py +0 -0
  56. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/agent/react/agent_manager.py +0 -0
  57. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/agent/react/service.py +0 -0
  58. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/agent/react/tools.py +0 -0
  59. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/agent/react/types.py +0 -0
  60. {trustgraph-flow-0.16.0/trustgraph/chunking → trustgraph-flow-0.16.2/trustgraph/api}/__init__.py +0 -0
  61. {trustgraph-flow-0.16.0/trustgraph/model/prompt/generic → trustgraph-flow-0.16.2/trustgraph/api/gateway}/__init__.py +0 -0
  62. {trustgraph-flow-0.16.0/trustgraph/model/prompt/generic → trustgraph-flow-0.16.2/trustgraph/api/gateway}/__main__.py +0 -0
  63. {trustgraph-flow-0.16.0/trustgraph/decoding → trustgraph-flow-0.16.2/trustgraph/chunking}/__init__.py +0 -0
  64. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/chunking/recursive/__init__.py +0 -0
  65. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/chunking/recursive/__main__.py +0 -0
  66. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/chunking/recursive/chunker.py +0 -0
  67. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/chunking/token/__init__.py +0 -0
  68. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/chunking/token/__main__.py +0 -0
  69. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/chunking/token/chunker.py +0 -0
  70. {trustgraph-flow-0.16.0/trustgraph/direct → trustgraph-flow-0.16.2/trustgraph/decoding}/__init__.py +0 -0
  71. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/decoding/pdf/__init__.py +0 -0
  72. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/decoding/pdf/__main__.py +0 -0
  73. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
  74. {trustgraph-flow-0.16.0/trustgraph/embeddings → trustgraph-flow-0.16.2/trustgraph/direct}/__init__.py +0 -0
  75. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/direct/cassandra.py +0 -0
  76. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
  77. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
  78. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/direct/milvus_object_embeddings.py +0 -0
  79. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/document_rag.py +0 -0
  80. {trustgraph-flow-0.16.0/trustgraph/extract → trustgraph-flow-0.16.2/trustgraph/embeddings}/__init__.py +0 -0
  81. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/embeddings/ollama/__init__.py +0 -0
  82. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/embeddings/ollama/__main__.py +0 -0
  83. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/embeddings/ollama/processor.py +0 -0
  84. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/embeddings/vectorize/__init__.py +0 -0
  85. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/embeddings/vectorize/__main__.py +0 -0
  86. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/embeddings/vectorize/vectorize.py +0 -0
  87. {trustgraph-flow-0.16.0/trustgraph/extract/kg → trustgraph-flow-0.16.2/trustgraph/extract}/__init__.py +0 -0
  88. {trustgraph-flow-0.16.0/trustgraph/extract/object → trustgraph-flow-0.16.2/trustgraph/extract/kg}/__init__.py +0 -0
  89. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/kg/definitions/__init__.py +0 -0
  90. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/kg/definitions/__main__.py +0 -0
  91. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/kg/definitions/extract.py +0 -0
  92. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/kg/relationships/__init__.py +0 -0
  93. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/kg/relationships/__main__.py +0 -0
  94. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/kg/relationships/extract.py +0 -0
  95. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/kg/topics/__init__.py +0 -0
  96. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/kg/topics/__main__.py +0 -0
  97. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/kg/topics/extract.py +0 -0
  98. {trustgraph-flow-0.16.0/trustgraph/model → trustgraph-flow-0.16.2/trustgraph/extract/object}/__init__.py +0 -0
  99. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/object/row/__init__.py +0 -0
  100. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/object/row/__main__.py +0 -0
  101. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/extract/object/row/extract.py +0 -0
  102. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/graph_rag.py +0 -0
  103. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/metering/__init__.py +0 -0
  104. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/metering/__main__.py +0 -0
  105. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/metering/counter.py +0 -0
  106. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/metering/pricelist.py +0 -0
  107. {trustgraph-flow-0.16.0/trustgraph/model/prompt → trustgraph-flow-0.16.2/trustgraph/model}/__init__.py +0 -0
  108. {trustgraph-flow-0.16.0/trustgraph/model/text_completion → trustgraph-flow-0.16.2/trustgraph/model/prompt}/__init__.py +0 -0
  109. {trustgraph-flow-0.16.0/trustgraph/model/prompt/template → trustgraph-flow-0.16.2/trustgraph/model/prompt/generic}/__init__.py +0 -0
  110. {trustgraph-flow-0.16.0/trustgraph/model/prompt/template → trustgraph-flow-0.16.2/trustgraph/model/prompt/generic}/__main__.py +0 -0
  111. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/prompt/generic/prompts.py +0 -0
  112. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/prompt/generic/service.py +0 -0
  113. {trustgraph-flow-0.16.0/trustgraph/query/doc_embeddings/milvus → trustgraph-flow-0.16.2/trustgraph/model/prompt/template}/__init__.py +0 -0
  114. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/prompt/template/prompt_manager.py +0 -0
  115. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/prompt/template/service.py +0 -0
  116. {trustgraph-flow-0.16.0/trustgraph/query → trustgraph-flow-0.16.2/trustgraph/model/text_completion}/__init__.py +0 -0
  117. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/azure/__init__.py +0 -0
  118. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/azure/__main__.py +0 -0
  119. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/azure/llm.py +0 -0
  120. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
  121. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
  122. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
  123. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/claude/__init__.py +0 -0
  124. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/claude/__main__.py +0 -0
  125. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/claude/llm.py +0 -0
  126. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
  127. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
  128. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/cohere/llm.py +0 -0
  129. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
  130. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
  131. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
  132. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
  133. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
  134. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
  135. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
  136. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
  137. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/ollama/llm.py +0 -0
  138. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/openai/__init__.py +0 -0
  139. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/openai/__main__.py +0 -0
  140. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/model/text_completion/openai/llm.py +0 -0
  141. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/processing/__init__.py +0 -0
  142. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/processing/__main__.py +0 -0
  143. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/processing/processing.py +0 -0
  144. {trustgraph-flow-0.16.0/trustgraph/query/doc_embeddings → trustgraph-flow-0.16.2/trustgraph/query}/__init__.py +0 -0
  145. {trustgraph-flow-0.16.0/trustgraph/query/graph_embeddings → trustgraph-flow-0.16.2/trustgraph/query/doc_embeddings}/__init__.py +0 -0
  146. {trustgraph-flow-0.16.0/trustgraph/query/doc_embeddings/qdrant → trustgraph-flow-0.16.2/trustgraph/query/doc_embeddings/milvus}/__init__.py +0 -0
  147. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
  148. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
  149. {trustgraph-flow-0.16.0/trustgraph/query/graph_embeddings/milvus → trustgraph-flow-0.16.2/trustgraph/query/doc_embeddings/qdrant}/__init__.py +0 -0
  150. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
  151. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
  152. {trustgraph-flow-0.16.0/trustgraph/query/triples → trustgraph-flow-0.16.2/trustgraph/query/graph_embeddings}/__init__.py +0 -0
  153. {trustgraph-flow-0.16.0/trustgraph/query/graph_embeddings/qdrant → trustgraph-flow-0.16.2/trustgraph/query/graph_embeddings/milvus}/__init__.py +0 -0
  154. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
  155. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
  156. {trustgraph-flow-0.16.0/trustgraph/query/triples/cassandra → trustgraph-flow-0.16.2/trustgraph/query/graph_embeddings/qdrant}/__init__.py +0 -0
  157. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
  158. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
  159. {trustgraph-flow-0.16.0/trustgraph/retrieval → trustgraph-flow-0.16.2/trustgraph/query/triples}/__init__.py +0 -0
  160. {trustgraph-flow-0.16.0/trustgraph/query/triples/neo4j → trustgraph-flow-0.16.2/trustgraph/query/triples/cassandra}/__init__.py +0 -0
  161. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/triples/cassandra/__main__.py +0 -0
  162. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/triples/cassandra/service.py +0 -0
  163. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/triples/neo4j/__main__.py +0 -0
  164. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/query/triples/neo4j/service.py +0 -0
  165. {trustgraph-flow-0.16.0/trustgraph/storage → trustgraph-flow-0.16.2/trustgraph/retrieval}/__init__.py +0 -0
  166. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/retrieval/document_rag/__init__.py +0 -0
  167. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/retrieval/document_rag/__main__.py +0 -0
  168. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/retrieval/document_rag/rag.py +0 -0
  169. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
  170. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
  171. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/retrieval/graph_rag/rag.py +0 -0
  172. {trustgraph-flow-0.16.0/trustgraph/storage/doc_embeddings → trustgraph-flow-0.16.2/trustgraph/storage}/__init__.py +0 -0
  173. {trustgraph-flow-0.16.0/trustgraph/storage/graph_embeddings → trustgraph-flow-0.16.2/trustgraph/storage/doc_embeddings}/__init__.py +0 -0
  174. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
  175. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
  176. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
  177. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
  178. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
  179. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
  180. {trustgraph-flow-0.16.0/trustgraph/storage/object_embeddings → trustgraph-flow-0.16.2/trustgraph/storage/graph_embeddings}/__init__.py +0 -0
  181. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
  182. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
  183. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
  184. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
  185. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
  186. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
  187. {trustgraph-flow-0.16.0/trustgraph/storage/rows → trustgraph-flow-0.16.2/trustgraph/storage/object_embeddings}/__init__.py +0 -0
  188. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
  189. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
  190. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
  191. {trustgraph-flow-0.16.0/trustgraph/storage/triples → trustgraph-flow-0.16.2/trustgraph/storage/rows}/__init__.py +0 -0
  192. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
  193. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
  194. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/rows/cassandra/write.py +0 -0
  195. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
  196. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
  197. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/triples/cassandra/write.py +0 -0
  198. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
  199. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
  200. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph/storage/triples/neo4j/write.py +0 -0
  201. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
  202. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph_flow.egg-info/requires.txt +0 -0
  203. {trustgraph-flow-0.16.0 → trustgraph-flow-0.16.2}/trustgraph_flow.egg-info/top_level.txt +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-flow
3
- Version: 0.16.0
3
+ Version: 0.16.2
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
  Home-page: https://github.com/trustgraph-ai/trustgraph
6
6
  Author: trustgraph.ai
7
7
  Author-email: security@trustgraph.ai
8
8
  License: UNKNOWN
9
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.16.0.tar.gz
9
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.16.2.tar.gz
10
10
  Platform: UNKNOWN
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env python3
2
+
3
+ from trustgraph.api.gateway import run
4
+
5
+ run()
6
+
@@ -1,4 +1,10 @@
1
- #!/usr/bin/env python3
1
+
2
+ """
3
+ API gateway. Offers HTTP services which are translated to interaction on the
4
+ Pulsar bus.
5
+ """
6
+
7
+ module = ".".join(__name__.split(".")[1:-1])
2
8
 
3
9
  # FIXME: Subscribes to Pulsar unnecessarily, should only do it when there
4
10
  # are active listeners
@@ -7,72 +13,111 @@
7
13
  # to fail and are not failed or retried
8
14
 
9
15
  import asyncio
16
+ import argparse
10
17
  from aiohttp import web
11
18
  import json
12
19
  import logging
13
20
  import uuid
14
21
  import os
22
+ import base64
15
23
 
16
24
  import pulsar
17
25
  from pulsar.asyncio import Client
18
26
  from pulsar.schema import JsonSchema
19
27
  import _pulsar
20
28
  import aiopulsar
29
+ from prometheus_client import start_http_server
30
+
31
+ from ... log_level import LogLevel
21
32
 
22
33
  from trustgraph.clients.llm_client import LlmClient
23
34
  from trustgraph.clients.prompt_client import PromptClient
24
35
 
25
- from trustgraph.schema import TextCompletionRequest, TextCompletionResponse
26
- from trustgraph.schema import text_completion_request_queue
27
- from trustgraph.schema import text_completion_response_queue
36
+ from ... schema import Value, Metadata, Document, TextDocument, Triple
37
+
38
+ from ... schema import TextCompletionRequest, TextCompletionResponse
39
+ from ... schema import text_completion_request_queue
40
+ from ... schema import text_completion_response_queue
41
+
42
+ from ... schema import PromptRequest, PromptResponse
43
+ from ... schema import prompt_request_queue
44
+ from ... schema import prompt_response_queue
28
45
 
29
- from trustgraph.schema import PromptRequest, PromptResponse
30
- from trustgraph.schema import prompt_request_queue
31
- from trustgraph.schema import prompt_response_queue
46
+ from ... schema import GraphRagQuery, GraphRagResponse
47
+ from ... schema import graph_rag_request_queue
48
+ from ... schema import graph_rag_response_queue
32
49
 
33
- from trustgraph.schema import GraphRagQuery, GraphRagResponse
34
- from trustgraph.schema import graph_rag_request_queue
35
- from trustgraph.schema import graph_rag_response_queue
50
+ from ... schema import TriplesQueryRequest, TriplesQueryResponse
51
+ from ... schema import triples_request_queue
52
+ from ... schema import triples_response_queue
36
53
 
37
- from trustgraph.schema import TriplesQueryRequest, TriplesQueryResponse, Value
38
- from trustgraph.schema import triples_request_queue
39
- from trustgraph.schema import triples_response_queue
54
+ from ... schema import AgentRequest, AgentResponse
55
+ from ... schema import agent_request_queue
56
+ from ... schema import agent_response_queue
40
57
 
41
- from trustgraph.schema import AgentRequest, AgentResponse
42
- from trustgraph.schema import agent_request_queue
43
- from trustgraph.schema import agent_response_queue
58
+ from ... schema import EmbeddingsRequest, EmbeddingsResponse
59
+ from ... schema import embeddings_request_queue
60
+ from ... schema import embeddings_response_queue
44
61
 
45
- from trustgraph.schema import EmbeddingsRequest, EmbeddingsResponse
46
- from trustgraph.schema import embeddings_request_queue
47
- from trustgraph.schema import embeddings_response_queue
62
+ from ... schema import document_ingest_queue, text_ingest_queue
48
63
 
49
64
  logger = logging.getLogger("api")
50
65
  logger.setLevel(logging.INFO)
51
66
 
52
- pulsar_host = os.getenv("PULSAR_HOST", "pulsar://pulsar:6650")
53
- TIME_OUT = 600
67
+ default_pulsar_host = os.getenv("PULSAR_HOST", "pulsar://pulsar:6650")
68
+ default_timeout = 600
69
+ default_port = 8088
70
+
71
+ def to_value(x):
72
+ if x.startswith("http:") or x.startswith("https:"):
73
+ return Value(value=x, is_uri=True)
74
+ else:
75
+ return Value(value=x, is_uri=True)
76
+
77
+ def to_subgraph(x):
78
+ return [
79
+ Triple(
80
+ s=to_value(t["s"]),
81
+ p=to_value(t["p"]),
82
+ o=to_value(t["o"])
83
+ )
84
+ for t in x
85
+ ]
54
86
 
55
87
  class Publisher:
56
88
 
57
- def __init__(self, pulsar_host, topic, schema=None, max_size=10):
89
+ def __init__(self, pulsar_host, topic, schema=None, max_size=10,
90
+ chunking_enabled=False):
58
91
  self.pulsar_host = pulsar_host
59
92
  self.topic = topic
60
93
  self.schema = schema
61
94
  self.q = asyncio.Queue(maxsize=max_size)
95
+ self.chunking_enabled = chunking_enabled
62
96
 
63
97
  async def run(self):
64
- try:
65
- async with aiopulsar.connect(self.pulsar_host) as client:
66
- async with client.create_producer(
67
- topic=self.topic,
68
- schema=self.schema,
69
- ) as producer:
70
- while True:
71
- id, item = await self.q.get()
72
- await producer.send(item, { "id": id })
73
- # print("message out")
74
- except Exception as e:
75
- print("Exception:", e, flush=True)
98
+
99
+ while True:
100
+
101
+ try:
102
+ async with aiopulsar.connect(self.pulsar_host) as client:
103
+ async with client.create_producer(
104
+ topic=self.topic,
105
+ schema=self.schema,
106
+ chunking_enabled=self.chunking_enabled,
107
+ ) as producer:
108
+ while True:
109
+ id, item = await self.q.get()
110
+
111
+ if id:
112
+ await producer.send(item, { "id": id })
113
+ else:
114
+ await producer.send(item)
115
+
116
+ except Exception as e:
117
+ print("Exception:", e, flush=True)
118
+
119
+ # If handler drops out, sleep a retry
120
+ await asyncio.sleep(2)
76
121
 
77
122
  async def send(self, id, msg):
78
123
  await self.q.put((id, msg))
@@ -89,24 +134,27 @@ class Subscriber:
89
134
  self.q = {}
90
135
 
91
136
  async def run(self):
92
- try:
93
- async with aiopulsar.connect(pulsar_host) as client:
94
- async with client.subscribe(
95
- topic=self.topic,
96
- subscription_name=self.subscription,
97
- consumer_name=self.consumer_name,
98
- schema=self.schema,
99
- ) as consumer:
100
- while True:
101
- msg = await consumer.receive()
102
- # print("message in", self.topic)
103
- id = msg.properties()["id"]
104
- value = msg.value()
105
- if id in self.q:
106
- await self.q[id].put(value)
107
- except Exception as e:
108
- print("Exception:", e, flush=True)
137
+ while True:
138
+ try:
139
+ async with aiopulsar.connect(self.pulsar_host) as client:
140
+ async with client.subscribe(
141
+ topic=self.topic,
142
+ subscription_name=self.subscription,
143
+ consumer_name=self.consumer_name,
144
+ schema=self.schema,
145
+ ) as consumer:
146
+ while True:
147
+ msg = await consumer.receive()
148
+ id = msg.properties()["id"]
149
+ value = msg.value()
150
+ if id in self.q:
151
+ await self.q[id].put(value)
152
+ except Exception as e:
153
+ print("Exception:", e, flush=True)
109
154
 
155
+ # If handler drops out, sleep a retry
156
+ await asyncio.sleep(2)
157
+
110
158
  async def subscribe(self, id):
111
159
  q = asyncio.Queue()
112
160
  self.q[id] = q
@@ -120,75 +168,93 @@ class Api:
120
168
 
121
169
  def __init__(self, **config):
122
170
 
123
- self.port = int(config.get("port", "8088"))
124
- self.app = web.Application(middlewares=[])
171
+ self.app = web.Application(
172
+ middlewares=[],
173
+ client_max_size=256 * 1024 * 1024
174
+ )
175
+
176
+ self.port = int(config.get("port", default_port))
177
+ self.timeout = int(config.get("timeout", default_timeout))
178
+ self.pulsar_host = config.get("pulsar_host", default_pulsar_host)
125
179
 
126
180
  self.llm_out = Publisher(
127
- pulsar_host, text_completion_request_queue,
181
+ self.pulsar_host, text_completion_request_queue,
128
182
  schema=JsonSchema(TextCompletionRequest)
129
183
  )
130
184
 
131
185
  self.llm_in = Subscriber(
132
- pulsar_host, text_completion_response_queue,
186
+ self.pulsar_host, text_completion_response_queue,
133
187
  "api-gateway", "api-gateway",
134
188
  JsonSchema(TextCompletionResponse)
135
189
  )
136
190
 
137
191
  self.prompt_out = Publisher(
138
- pulsar_host, prompt_request_queue,
192
+ self.pulsar_host, prompt_request_queue,
139
193
  schema=JsonSchema(PromptRequest)
140
194
  )
141
195
 
142
196
  self.prompt_in = Subscriber(
143
- pulsar_host, prompt_response_queue,
197
+ self.pulsar_host, prompt_response_queue,
144
198
  "api-gateway", "api-gateway",
145
199
  JsonSchema(PromptResponse)
146
200
  )
147
201
 
148
202
  self.graph_rag_out = Publisher(
149
- pulsar_host, graph_rag_request_queue,
203
+ self.pulsar_host, graph_rag_request_queue,
150
204
  schema=JsonSchema(GraphRagQuery)
151
205
  )
152
206
 
153
207
  self.graph_rag_in = Subscriber(
154
- pulsar_host, graph_rag_response_queue,
208
+ self.pulsar_host, graph_rag_response_queue,
155
209
  "api-gateway", "api-gateway",
156
210
  JsonSchema(GraphRagResponse)
157
211
  )
158
212
 
159
213
  self.triples_query_out = Publisher(
160
- pulsar_host, triples_request_queue,
214
+ self.pulsar_host, triples_request_queue,
161
215
  schema=JsonSchema(TriplesQueryRequest)
162
216
  )
163
217
 
164
218
  self.triples_query_in = Subscriber(
165
- pulsar_host, triples_response_queue,
219
+ self.pulsar_host, triples_response_queue,
166
220
  "api-gateway", "api-gateway",
167
221
  JsonSchema(TriplesQueryResponse)
168
222
  )
169
223
 
170
224
  self.agent_out = Publisher(
171
- pulsar_host, agent_request_queue,
225
+ self.pulsar_host, agent_request_queue,
172
226
  schema=JsonSchema(AgentRequest)
173
227
  )
174
228
 
175
229
  self.agent_in = Subscriber(
176
- pulsar_host, agent_response_queue,
230
+ self.pulsar_host, agent_response_queue,
177
231
  "api-gateway", "api-gateway",
178
232
  JsonSchema(AgentResponse)
179
233
  )
180
234
 
181
235
  self.embeddings_out = Publisher(
182
- pulsar_host, embeddings_request_queue,
236
+ self.pulsar_host, embeddings_request_queue,
183
237
  schema=JsonSchema(EmbeddingsRequest)
184
238
  )
185
239
 
186
240
  self.embeddings_in = Subscriber(
187
- pulsar_host, embeddings_response_queue,
241
+ self.pulsar_host, embeddings_response_queue,
188
242
  "api-gateway", "api-gateway",
189
243
  JsonSchema(EmbeddingsResponse)
190
244
  )
191
245
 
246
+ self.document_out = Publisher(
247
+ self.pulsar_host, document_ingest_queue,
248
+ schema=JsonSchema(Document),
249
+ chunking_enabled=True,
250
+ )
251
+
252
+ self.text_out = Publisher(
253
+ self.pulsar_host, text_ingest_queue,
254
+ schema=JsonSchema(TextDocument),
255
+ chunking_enabled=True,
256
+ )
257
+
192
258
  self.app.add_routes([
193
259
  web.post("/api/v1/text-completion", self.llm),
194
260
  web.post("/api/v1/prompt", self.prompt),
@@ -196,6 +262,8 @@ class Api:
196
262
  web.post("/api/v1/triples-query", self.triples_query),
197
263
  web.post("/api/v1/agent", self.agent),
198
264
  web.post("/api/v1/embeddings", self.embeddings),
265
+ web.post("/api/v1/load/document", self.load_document),
266
+ web.post("/api/v1/load/text", self.load_text),
199
267
  ])
200
268
 
201
269
  async def llm(self, request):
@@ -217,7 +285,7 @@ class Api:
217
285
  )
218
286
 
219
287
  try:
220
- resp = await asyncio.wait_for(q.get(), TIME_OUT)
288
+ resp = await asyncio.wait_for(q.get(), self.timeout)
221
289
  except:
222
290
  raise RuntimeError("Timeout waiting for response")
223
291
 
@@ -264,7 +332,7 @@ class Api:
264
332
  )
265
333
 
266
334
  try:
267
- resp = await asyncio.wait_for(q.get(), TIME_OUT)
335
+ resp = await asyncio.wait_for(q.get(), self.timeout)
268
336
  except:
269
337
  raise RuntimeError("Timeout waiting for response")
270
338
 
@@ -312,7 +380,7 @@ class Api:
312
380
  )
313
381
 
314
382
  try:
315
- resp = await asyncio.wait_for(q.get(), TIME_OUT)
383
+ resp = await asyncio.wait_for(q.get(), self.timeout)
316
384
  except:
317
385
  raise RuntimeError("Timeout waiting for response")
318
386
 
@@ -346,26 +414,17 @@ class Api:
346
414
  q = await self.triples_query_in.subscribe(id)
347
415
 
348
416
  if "s" in data:
349
- if data["s"].startswith("http:") or data["s"].startswith("https:"):
350
- s = Value(value=data["s"], is_uri=True)
351
- else:
352
- s = Value(value=data["s"], is_uri=True)
417
+ s = to_value(data["s"])
353
418
  else:
354
419
  s = None
355
420
 
356
421
  if "p" in data:
357
- if data["p"].startswith("http:") or data["p"].startswith("https:"):
358
- p = Value(value=data["p"], is_uri=True)
359
- else:
360
- p = Value(value=data["p"], is_uri=True)
422
+ p = to_value(data["p"])
361
423
  else:
362
424
  p = None
363
425
 
364
426
  if "o" in data:
365
- if data["o"].startswith("http:") or data["o"].startswith("https:"):
366
- o = Value(value=data["o"], is_uri=True)
367
- else:
368
- o = Value(value=data["o"], is_uri=True)
427
+ o = to_value(data["o"])
369
428
  else:
370
429
  o = None
371
430
 
@@ -382,7 +441,7 @@ class Api:
382
441
  )
383
442
 
384
443
  try:
385
- resp = await asyncio.wait_for(q.get(), TIME_OUT)
444
+ resp = await asyncio.wait_for(q.get(), self.timeout)
386
445
  except:
387
446
  raise RuntimeError("Timeout waiting for response")
388
447
 
@@ -442,7 +501,7 @@ class Api:
442
501
 
443
502
  while True:
444
503
  try:
445
- resp = await asyncio.wait_for(q.get(), TIME_OUT)
504
+ resp = await asyncio.wait_for(q.get(), self.timeout)
446
505
  except:
447
506
  raise RuntimeError("Timeout waiting for response")
448
507
 
@@ -492,7 +551,7 @@ class Api:
492
551
  )
493
552
 
494
553
  try:
495
- resp = await asyncio.wait_for(q.get(), TIME_OUT)
554
+ resp = await asyncio.wait_for(q.get(), self.timeout)
496
555
  except:
497
556
  raise RuntimeError("Timeout waiting for response")
498
557
 
@@ -515,6 +574,92 @@ class Api:
515
574
  finally:
516
575
  await self.embeddings_in.unsubscribe(id)
517
576
 
577
+ async def load_document(self, request):
578
+
579
+ try:
580
+
581
+ data = await request.json()
582
+
583
+ if "metadata" in data:
584
+ metadata = to_subgraph(data["metadata"])
585
+ else:
586
+ metadata = []
587
+
588
+ # Doing a base64 decode/encode here to make sure the
589
+ # content is valid base64
590
+ doc = base64.b64decode(data["data"])
591
+
592
+ resp = await self.document_out.send(
593
+ None,
594
+ Document(
595
+ metadata=Metadata(
596
+ id=data.get("id"),
597
+ metadata=metadata,
598
+ user=data.get("user", "trustgraph"),
599
+ collection=data.get("collection", "default"),
600
+ ),
601
+ data=base64.b64encode(doc).decode("utf-8")
602
+ )
603
+ )
604
+
605
+ print("Document loaded.")
606
+
607
+ return web.json_response(
608
+ { }
609
+ )
610
+
611
+ except Exception as e:
612
+ logging.error(f"Exception: {e}")
613
+
614
+ return web.json_response(
615
+ { "error": str(e) }
616
+ )
617
+
618
+ async def load_text(self, request):
619
+
620
+ try:
621
+
622
+ data = await request.json()
623
+
624
+ if "metadata" in data:
625
+ metadata = to_subgraph(data["metadata"])
626
+ else:
627
+ metadata = []
628
+
629
+ if "charset" in data:
630
+ charset = data["charset"]
631
+ else:
632
+ charset = "utf-8"
633
+
634
+ # Text is base64 encoded
635
+ text = base64.b64decode(data["text"]).decode(charset)
636
+
637
+ resp = await self.text_out.send(
638
+ None,
639
+ TextDocument(
640
+ metadata=Metadata(
641
+ id=data.get("id"),
642
+ metadata=metadata,
643
+ user=data.get("user", "trustgraph"),
644
+ collection=data.get("collection", "default"),
645
+ ),
646
+ text=text,
647
+ )
648
+ )
649
+
650
+ print("Text document loaded.")
651
+
652
+ return web.json_response(
653
+ { }
654
+ )
655
+
656
+ except Exception as e:
657
+ logging.error(f"Exception: {e}")
658
+
659
+ return web.json_response(
660
+ { "error": str(e) }
661
+ )
662
+
518
663
  async def app_factory(self):
519
664
 
520
665
  self.llm_pub_task = asyncio.create_task(self.llm_in.run())
@@ -543,11 +688,71 @@ class Api:
543
688
  self.embeddings_out.run()
544
689
  )
545
690
 
691
+ self.doc_ingest_pub_task = asyncio.create_task(self.document_out.run())
692
+
693
+ self.text_ingest_pub_task = asyncio.create_task(self.text_out.run())
694
+
546
695
  return self.app
547
696
 
548
697
  def run(self):
549
698
  web.run_app(self.app_factory(), port=self.port)
550
699
 
551
- a = Api()
552
- a.run()
700
+ def run():
701
+
702
+
703
+ parser = argparse.ArgumentParser(
704
+ prog="api-gateway",
705
+ description=__doc__
706
+ )
707
+
708
+ parser.add_argument(
709
+ '-p', '--pulsar-host',
710
+ default=default_pulsar_host,
711
+ help=f'Pulsar host (default: {default_pulsar_host})',
712
+ )
713
+
714
+ parser.add_argument(
715
+ '--port',
716
+ type=int,
717
+ default=default_port,
718
+ help=f'Port number to listen on (default: {default_port})',
719
+ )
720
+
721
+ parser.add_argument(
722
+ '--timeout',
723
+ type=int,
724
+ default=default_timeout,
725
+ help=f'API request timeout in seconds (default: {default_timeout})',
726
+ )
727
+
728
+ parser.add_argument(
729
+ '-l', '--log-level',
730
+ type=LogLevel,
731
+ default=LogLevel.INFO,
732
+ choices=list(LogLevel),
733
+ help=f'Output queue (default: info)'
734
+ )
735
+
736
+ parser.add_argument(
737
+ '--metrics',
738
+ action=argparse.BooleanOptionalAction,
739
+ default=True,
740
+ help=f'Metrics enabled (default: true)',
741
+ )
742
+
743
+ parser.add_argument(
744
+ '-P', '--metrics-port',
745
+ type=int,
746
+ default=8000,
747
+ help=f'Prometheus metrics port (default: 8000)',
748
+ )
749
+
750
+ args = parser.parse_args()
751
+ args = vars(args)
752
+
753
+ if args["metrics"]:
754
+ start_http_server(args["metrics_port"])
755
+
756
+ a = Api(**args)
757
+ a.run()
553
758
 
@@ -0,0 +1 @@
1
+ __version__ = "0.16.2"
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env python3
2
+
3
+ from . service import run
4
+
5
+ if __name__ == '__main__':
6
+ run()
7
+
@@ -0,0 +1,3 @@
1
+
2
+ from . service import *
3
+
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-flow
3
- Version: 0.16.0
3
+ Version: 0.16.2
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
  Home-page: https://github.com/trustgraph-ai/trustgraph
6
6
  Author: trustgraph.ai
7
7
  Author-email: security@trustgraph.ai
8
8
  License: UNKNOWN
9
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.16.0.tar.gz
9
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.16.2.tar.gz
10
10
  Platform: UNKNOWN
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
@@ -50,6 +50,10 @@ trustgraph/agent/react/agent_manager.py
50
50
  trustgraph/agent/react/service.py
51
51
  trustgraph/agent/react/tools.py
52
52
  trustgraph/agent/react/types.py
53
+ trustgraph/api/__init__.py
54
+ trustgraph/api/gateway/__init__.py
55
+ trustgraph/api/gateway/__main__.py
56
+ trustgraph/api/gateway/service.py
53
57
  trustgraph/chunking/__init__.py
54
58
  trustgraph/chunking/recursive/__init__.py
55
59
  trustgraph/chunking/recursive/__main__.py
@@ -1 +0,0 @@
1
- __version__ = "0.16.0"