trustgraph-flow 0.17.0__tar.gz → 0.17.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 (244) hide show
  1. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/PKG-INFO +2 -2
  2. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/agent.py +2 -1
  3. trustgraph-flow-0.17.2/trustgraph/api/gateway/auth.py +22 -0
  4. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/dbpedia.py +2 -1
  5. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/embeddings.py +2 -1
  6. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/encyclopedia.py +2 -1
  7. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/endpoint.py +25 -7
  8. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/graph_embeddings_load.py +4 -2
  9. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/graph_embeddings_stream.py +4 -2
  10. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/graph_rag.py +2 -1
  11. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/internet_search.py +2 -1
  12. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/prompt.py +2 -1
  13. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/service.py +33 -4
  14. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/socket.py +20 -4
  15. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/text_completion.py +2 -1
  16. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/triples_load.py +2 -2
  17. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/triples_query.py +2 -1
  18. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/triples_stream.py +2 -2
  19. trustgraph-flow-0.17.2/trustgraph/flow_version.py +1 -0
  20. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/doc_embeddings/pinecone/service.py +8 -3
  21. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph_flow.egg-info/PKG-INFO +2 -2
  22. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph_flow.egg-info/SOURCES.txt +1 -0
  23. trustgraph-flow-0.17.0/trustgraph/flow_version.py +0 -1
  24. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/README.md +0 -0
  25. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/agent-manager-react +0 -0
  26. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/api-gateway +0 -0
  27. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/chunker-recursive +0 -0
  28. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/chunker-token +0 -0
  29. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/de-query-milvus +0 -0
  30. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/de-query-pinecone +0 -0
  31. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/de-query-qdrant +0 -0
  32. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/de-write-milvus +0 -0
  33. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/de-write-pinecone +0 -0
  34. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/de-write-qdrant +0 -0
  35. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/document-rag +0 -0
  36. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/embeddings-ollama +0 -0
  37. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/embeddings-vectorize +0 -0
  38. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/ge-query-milvus +0 -0
  39. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/ge-query-pinecone +0 -0
  40. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/ge-query-qdrant +0 -0
  41. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/ge-write-milvus +0 -0
  42. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/ge-write-pinecone +0 -0
  43. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/ge-write-qdrant +0 -0
  44. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/graph-rag +0 -0
  45. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/kg-extract-definitions +0 -0
  46. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/kg-extract-relationships +0 -0
  47. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/kg-extract-topics +0 -0
  48. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/metering +0 -0
  49. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/object-extract-row +0 -0
  50. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/oe-write-milvus +0 -0
  51. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/pdf-decoder +0 -0
  52. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/prompt-generic +0 -0
  53. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/prompt-template +0 -0
  54. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/rows-write-cassandra +0 -0
  55. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/run-processing +0 -0
  56. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/text-completion-azure +0 -0
  57. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/text-completion-azure-openai +0 -0
  58. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/text-completion-claude +0 -0
  59. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/text-completion-cohere +0 -0
  60. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/text-completion-googleaistudio +0 -0
  61. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/text-completion-llamafile +0 -0
  62. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/text-completion-ollama +0 -0
  63. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/text-completion-openai +0 -0
  64. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/triples-query-cassandra +0 -0
  65. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/triples-query-neo4j +0 -0
  66. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/triples-write-cassandra +0 -0
  67. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/triples-write-neo4j +0 -0
  68. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/scripts/wikipedia-lookup +0 -0
  69. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/setup.cfg +0 -0
  70. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/setup.py +0 -0
  71. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/__init__.py +0 -0
  72. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/agent/__init__.py +0 -0
  73. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/agent/react/__init__.py +0 -0
  74. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/agent/react/__main__.py +0 -0
  75. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/agent/react/agent_manager.py +0 -0
  76. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/agent/react/service.py +0 -0
  77. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/agent/react/tools.py +0 -0
  78. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/agent/react/types.py +0 -0
  79. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/__init__.py +0 -0
  80. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/__init__.py +0 -0
  81. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/__main__.py +0 -0
  82. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/publisher.py +0 -0
  83. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/running.py +0 -0
  84. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/serialize.py +0 -0
  85. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/api/gateway/subscriber.py +0 -0
  86. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/chunking/__init__.py +0 -0
  87. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/chunking/recursive/__init__.py +0 -0
  88. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/chunking/recursive/__main__.py +0 -0
  89. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/chunking/recursive/chunker.py +0 -0
  90. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/chunking/token/__init__.py +0 -0
  91. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/chunking/token/__main__.py +0 -0
  92. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/chunking/token/chunker.py +0 -0
  93. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/decoding/__init__.py +0 -0
  94. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/decoding/pdf/__init__.py +0 -0
  95. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/decoding/pdf/__main__.py +0 -0
  96. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
  97. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/direct/__init__.py +0 -0
  98. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/direct/cassandra.py +0 -0
  99. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
  100. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
  101. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/direct/milvus_object_embeddings.py +0 -0
  102. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/document_rag.py +0 -0
  103. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/embeddings/__init__.py +0 -0
  104. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/embeddings/ollama/__init__.py +0 -0
  105. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/embeddings/ollama/__main__.py +0 -0
  106. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/embeddings/ollama/processor.py +0 -0
  107. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/embeddings/vectorize/__init__.py +0 -0
  108. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/embeddings/vectorize/__main__.py +0 -0
  109. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/embeddings/vectorize/vectorize.py +0 -0
  110. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/external/__init__.py +0 -0
  111. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/external/wikipedia/__init__.py +0 -0
  112. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/external/wikipedia/__main__.py +0 -0
  113. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/external/wikipedia/service.py +0 -0
  114. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/__init__.py +0 -0
  115. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/kg/__init__.py +0 -0
  116. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/kg/definitions/__init__.py +0 -0
  117. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/kg/definitions/__main__.py +0 -0
  118. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/kg/definitions/extract.py +0 -0
  119. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/kg/relationships/__init__.py +0 -0
  120. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/kg/relationships/__main__.py +0 -0
  121. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/kg/relationships/extract.py +0 -0
  122. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/kg/topics/__init__.py +0 -0
  123. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/kg/topics/__main__.py +0 -0
  124. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/kg/topics/extract.py +0 -0
  125. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/object/__init__.py +0 -0
  126. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/object/row/__init__.py +0 -0
  127. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/object/row/__main__.py +0 -0
  128. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/extract/object/row/extract.py +0 -0
  129. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/graph_rag.py +0 -0
  130. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/metering/__init__.py +0 -0
  131. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/metering/__main__.py +0 -0
  132. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/metering/counter.py +0 -0
  133. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/metering/pricelist.py +0 -0
  134. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/__init__.py +0 -0
  135. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/prompt/__init__.py +0 -0
  136. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/prompt/generic/__init__.py +0 -0
  137. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/prompt/generic/__main__.py +0 -0
  138. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/prompt/generic/prompts.py +0 -0
  139. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/prompt/generic/service.py +0 -0
  140. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/prompt/template/__init__.py +0 -0
  141. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/prompt/template/__main__.py +0 -0
  142. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/prompt/template/prompt_manager.py +0 -0
  143. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/prompt/template/service.py +0 -0
  144. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/__init__.py +0 -0
  145. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/azure/__init__.py +0 -0
  146. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/azure/__main__.py +0 -0
  147. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/azure/llm.py +0 -0
  148. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
  149. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
  150. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
  151. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/claude/__init__.py +0 -0
  152. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/claude/__main__.py +0 -0
  153. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/claude/llm.py +0 -0
  154. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
  155. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
  156. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/cohere/llm.py +0 -0
  157. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
  158. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
  159. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
  160. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
  161. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
  162. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
  163. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
  164. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
  165. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/ollama/llm.py +0 -0
  166. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/openai/__init__.py +0 -0
  167. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/openai/__main__.py +0 -0
  168. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/model/text_completion/openai/llm.py +0 -0
  169. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/processing/__init__.py +0 -0
  170. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/processing/__main__.py +0 -0
  171. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/processing/processing.py +0 -0
  172. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/__init__.py +0 -0
  173. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/doc_embeddings/__init__.py +0 -0
  174. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
  175. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
  176. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
  177. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
  178. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
  179. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
  180. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
  181. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
  182. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/graph_embeddings/__init__.py +0 -0
  183. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
  184. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
  185. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
  186. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
  187. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
  188. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/graph_embeddings/pinecone/service.py +0 -0
  189. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
  190. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
  191. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
  192. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/triples/__init__.py +0 -0
  193. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/triples/cassandra/__init__.py +0 -0
  194. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/triples/cassandra/__main__.py +0 -0
  195. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/triples/cassandra/service.py +0 -0
  196. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/triples/neo4j/__init__.py +0 -0
  197. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/triples/neo4j/__main__.py +0 -0
  198. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/query/triples/neo4j/service.py +0 -0
  199. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/retrieval/__init__.py +0 -0
  200. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/retrieval/document_rag/__init__.py +0 -0
  201. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/retrieval/document_rag/__main__.py +0 -0
  202. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/retrieval/document_rag/rag.py +0 -0
  203. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
  204. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
  205. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/retrieval/graph_rag/rag.py +0 -0
  206. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/__init__.py +0 -0
  207. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
  208. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
  209. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
  210. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
  211. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
  212. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
  213. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/doc_embeddings/pinecone/write.py +0 -0
  214. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
  215. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
  216. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
  217. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
  218. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
  219. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
  220. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
  221. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
  222. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
  223. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/graph_embeddings/pinecone/write.py +0 -0
  224. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
  225. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
  226. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
  227. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/object_embeddings/__init__.py +0 -0
  228. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
  229. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
  230. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
  231. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/rows/__init__.py +0 -0
  232. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
  233. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
  234. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/rows/cassandra/write.py +0 -0
  235. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/triples/__init__.py +0 -0
  236. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
  237. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
  238. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/triples/cassandra/write.py +0 -0
  239. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
  240. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
  241. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph/storage/triples/neo4j/write.py +0 -0
  242. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
  243. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.2}/trustgraph_flow.egg-info/requires.txt +0 -0
  244. {trustgraph-flow-0.17.0 → trustgraph-flow-0.17.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.17.0
3
+ Version: 0.17.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.17.0.tar.gz
9
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.17.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+)
@@ -6,7 +6,7 @@ from ... schema import agent_response_queue
6
6
  from . endpoint import MultiResponseServiceEndpoint
7
7
 
8
8
  class AgentEndpoint(MultiResponseServiceEndpoint):
9
- def __init__(self, pulsar_host, timeout):
9
+ def __init__(self, pulsar_host, timeout, auth):
10
10
 
11
11
  super(AgentEndpoint, self).__init__(
12
12
  pulsar_host=pulsar_host,
@@ -16,6 +16,7 @@ class AgentEndpoint(MultiResponseServiceEndpoint):
16
16
  response_schema=AgentResponse,
17
17
  endpoint_path="/api/v1/agent",
18
18
  timeout=timeout,
19
+ auth=auth,
19
20
  )
20
21
 
21
22
  def to_request(self, body):
@@ -0,0 +1,22 @@
1
+
2
+ class Authenticator:
3
+
4
+ def __init__(self, token=None, allow_all=False):
5
+
6
+ if not allow_all and token is None:
7
+ raise RuntimeError("Need a token")
8
+
9
+ if not allow_all and token == "":
10
+ raise RuntimeError("Need a token")
11
+
12
+ self.token = token
13
+ self.allow_all = allow_all
14
+
15
+ def permitted(self, token, roles):
16
+
17
+ if self.allow_all: return True
18
+
19
+ if self.token != token: return False
20
+
21
+ return True
22
+
@@ -6,7 +6,7 @@ from ... schema import dbpedia_lookup_response_queue
6
6
  from . endpoint import ServiceEndpoint
7
7
 
8
8
  class DbpediaEndpoint(ServiceEndpoint):
9
- def __init__(self, pulsar_host, timeout):
9
+ def __init__(self, pulsar_host, timeout, auth):
10
10
 
11
11
  super(DbpediaEndpoint, self).__init__(
12
12
  pulsar_host=pulsar_host,
@@ -16,6 +16,7 @@ class DbpediaEndpoint(ServiceEndpoint):
16
16
  response_schema=LookupResponse,
17
17
  endpoint_path="/api/v1/dbpedia",
18
18
  timeout=timeout,
19
+ auth=auth,
19
20
  )
20
21
 
21
22
  def to_request(self, body):
@@ -6,7 +6,7 @@ from ... schema import embeddings_response_queue
6
6
  from . endpoint import ServiceEndpoint
7
7
 
8
8
  class EmbeddingsEndpoint(ServiceEndpoint):
9
- def __init__(self, pulsar_host, timeout):
9
+ def __init__(self, pulsar_host, timeout, auth):
10
10
 
11
11
  super(EmbeddingsEndpoint, self).__init__(
12
12
  pulsar_host=pulsar_host,
@@ -16,6 +16,7 @@ class EmbeddingsEndpoint(ServiceEndpoint):
16
16
  response_schema=EmbeddingsResponse,
17
17
  endpoint_path="/api/v1/embeddings",
18
18
  timeout=timeout,
19
+ auth=auth,
19
20
  )
20
21
 
21
22
  def to_request(self, body):
@@ -6,7 +6,7 @@ from ... schema import encyclopedia_lookup_response_queue
6
6
  from . endpoint import ServiceEndpoint
7
7
 
8
8
  class EncyclopediaEndpoint(ServiceEndpoint):
9
- def __init__(self, pulsar_host, timeout):
9
+ def __init__(self, pulsar_host, timeout, auth):
10
10
 
11
11
  super(EncyclopediaEndpoint, self).__init__(
12
12
  pulsar_host=pulsar_host,
@@ -16,6 +16,7 @@ class EncyclopediaEndpoint(ServiceEndpoint):
16
16
  response_schema=LookupResponse,
17
17
  endpoint_path="/api/v1/encyclopedia",
18
18
  timeout=timeout,
19
+ auth=auth,
19
20
  )
20
21
 
21
22
  def to_request(self, body):
@@ -19,6 +19,7 @@ class ServiceEndpoint:
19
19
  request_queue, request_schema,
20
20
  response_queue, response_schema,
21
21
  endpoint_path,
22
+ auth,
22
23
  subscription="api-gateway", consumer_name="api-gateway",
23
24
  timeout=600,
24
25
  ):
@@ -36,6 +37,9 @@ class ServiceEndpoint:
36
37
 
37
38
  self.path = endpoint_path
38
39
  self.timeout = timeout
40
+ self.auth = auth
41
+
42
+ self.operation = "service"
39
43
 
40
44
  async def start(self):
41
45
 
@@ -58,31 +62,49 @@ class ServiceEndpoint:
58
62
 
59
63
  id = str(uuid.uuid4())
60
64
 
65
+ print(request.path, "...")
66
+
61
67
  try:
68
+ ht = request.headers["Authorization"]
69
+ tokens = ht.split(" ", 2)
70
+ if tokens[0] != "Bearer":
71
+ return web.HTTPUnauthorized()
72
+ token = tokens[1]
73
+ except:
74
+ token = ""
62
75
 
63
- data = await request.json()
76
+ if not self.auth.permitted(token, self.operation):
77
+ return web.HTTPUnauthorized()
64
78
 
65
- q = await self.sub.subscribe(id)
79
+ try:
80
+
81
+ data = await request.json()
66
82
 
67
83
  print(data)
68
84
 
85
+ q = await self.sub.subscribe(id)
86
+
69
87
  await self.pub.send(
70
88
  id,
71
89
  self.to_request(data),
72
90
  )
91
+ print("Request sent")
73
92
 
74
93
  try:
75
94
  resp = await asyncio.wait_for(q.get(), self.timeout)
76
95
  except:
77
96
  raise RuntimeError("Timeout waiting for response")
78
97
 
79
- print(resp)
98
+ print("Response got")
80
99
 
81
100
  if resp.error:
101
+ print("Error")
82
102
  return web.json_response(
83
103
  { "error": resp.error.message }
84
104
  )
85
105
 
106
+ print("Send response")
107
+
86
108
  return web.json_response(
87
109
  self.from_response(resp)
88
110
  )
@@ -110,8 +132,6 @@ class MultiResponseServiceEndpoint(ServiceEndpoint):
110
132
 
111
133
  q = await self.sub.subscribe(id)
112
134
 
113
- print(data)
114
-
115
135
  await self.pub.send(
116
136
  id,
117
137
  self.to_request(data),
@@ -126,8 +146,6 @@ class MultiResponseServiceEndpoint(ServiceEndpoint):
126
146
  except:
127
147
  raise RuntimeError("Timeout waiting for response")
128
148
 
129
- print(resp)
130
-
131
149
  if resp.error:
132
150
  return web.json_response(
133
151
  { "error": resp.error.message }
@@ -14,10 +14,12 @@ from . serialize import to_subgraph, to_value
14
14
 
15
15
  class GraphEmbeddingsLoadEndpoint(SocketEndpoint):
16
16
 
17
- def __init__(self, pulsar_host, path="/api/v1/load/graph-embeddings"):
17
+ def __init__(
18
+ self, pulsar_host, auth, path="/api/v1/load/graph-embeddings",
19
+ ):
18
20
 
19
21
  super(GraphEmbeddingsLoadEndpoint, self).__init__(
20
- endpoint_path=path
22
+ endpoint_path=path, auth=auth,
21
23
  )
22
24
 
23
25
  self.pulsar_host=pulsar_host
@@ -12,10 +12,12 @@ from . serialize import serialize_graph_embeddings
12
12
 
13
13
  class GraphEmbeddingsStreamEndpoint(SocketEndpoint):
14
14
 
15
- def __init__(self, pulsar_host, path="/api/v1/stream/graph-embeddings"):
15
+ def __init__(
16
+ self, pulsar_host, auth, path="/api/v1/stream/graph-embeddings"
17
+ ):
16
18
 
17
19
  super(GraphEmbeddingsStreamEndpoint, self).__init__(
18
- endpoint_path=path
20
+ endpoint_path=path, auth=auth,
19
21
  )
20
22
 
21
23
  self.pulsar_host=pulsar_host
@@ -6,7 +6,7 @@ from ... schema import graph_rag_response_queue
6
6
  from . endpoint import ServiceEndpoint
7
7
 
8
8
  class GraphRagEndpoint(ServiceEndpoint):
9
- def __init__(self, pulsar_host, timeout):
9
+ def __init__(self, pulsar_host, timeout, auth):
10
10
 
11
11
  super(GraphRagEndpoint, self).__init__(
12
12
  pulsar_host=pulsar_host,
@@ -16,6 +16,7 @@ class GraphRagEndpoint(ServiceEndpoint):
16
16
  response_schema=GraphRagResponse,
17
17
  endpoint_path="/api/v1/graph-rag",
18
18
  timeout=timeout,
19
+ auth=auth,
19
20
  )
20
21
 
21
22
  def to_request(self, body):
@@ -6,7 +6,7 @@ from ... schema import internet_search_response_queue
6
6
  from . endpoint import ServiceEndpoint
7
7
 
8
8
  class InternetSearchEndpoint(ServiceEndpoint):
9
- def __init__(self, pulsar_host, timeout):
9
+ def __init__(self, pulsar_host, timeout, auth):
10
10
 
11
11
  super(InternetSearchEndpoint, self).__init__(
12
12
  pulsar_host=pulsar_host,
@@ -16,6 +16,7 @@ class InternetSearchEndpoint(ServiceEndpoint):
16
16
  response_schema=LookupResponse,
17
17
  endpoint_path="/api/v1/internet-search",
18
18
  timeout=timeout,
19
+ auth=auth,
19
20
  )
20
21
 
21
22
  def to_request(self, body):
@@ -8,7 +8,7 @@ from ... schema import prompt_response_queue
8
8
  from . endpoint import ServiceEndpoint
9
9
 
10
10
  class PromptEndpoint(ServiceEndpoint):
11
- def __init__(self, pulsar_host, timeout):
11
+ def __init__(self, pulsar_host, timeout, auth):
12
12
 
13
13
  super(PromptEndpoint, self).__init__(
14
14
  pulsar_host=pulsar_host,
@@ -18,6 +18,7 @@ class PromptEndpoint(ServiceEndpoint):
18
18
  response_schema=PromptResponse,
19
19
  endpoint_path="/api/v1/prompt",
20
20
  timeout=timeout,
21
+ auth=auth,
21
22
  )
22
23
 
23
24
  def to_request(self, body):
@@ -45,6 +45,7 @@ from . triples_stream import TriplesStreamEndpoint
45
45
  from . graph_embeddings_stream import GraphEmbeddingsStreamEndpoint
46
46
  from . triples_load import TriplesLoadEndpoint
47
47
  from . graph_embeddings_load import GraphEmbeddingsLoadEndpoint
48
+ from . auth import Authenticator
48
49
 
49
50
  logger = logging.getLogger("api")
50
51
  logger.setLevel(logging.INFO)
@@ -52,6 +53,7 @@ logger.setLevel(logging.INFO)
52
53
  default_pulsar_host = os.getenv("PULSAR_HOST", "pulsar://pulsar:6650")
53
54
  default_timeout = 600
54
55
  default_port = 8088
56
+ default_api_token = os.getenv("GATEWAY_SECRET", "")
55
57
 
56
58
  class Api:
57
59
 
@@ -66,45 +68,66 @@ class Api:
66
68
  self.timeout = int(config.get("timeout", default_timeout))
67
69
  self.pulsar_host = config.get("pulsar_host", default_pulsar_host)
68
70
 
71
+ api_token = config.get("api_token", default_api_token)
72
+
73
+ # Token not set, or token equal empty string means no auth
74
+ if api_token:
75
+ self.auth = Authenticator(token=api_token)
76
+ else:
77
+ self.auth = Authenticator(allow_all=True)
78
+
69
79
  self.endpoints = [
70
80
  TextCompletionEndpoint(
71
81
  pulsar_host=self.pulsar_host, timeout=self.timeout,
82
+ auth = self.auth,
72
83
  ),
73
84
  PromptEndpoint(
74
85
  pulsar_host=self.pulsar_host, timeout=self.timeout,
86
+ auth = self.auth,
75
87
  ),
76
88
  GraphRagEndpoint(
77
89
  pulsar_host=self.pulsar_host, timeout=self.timeout,
90
+ auth = self.auth,
78
91
  ),
79
92
  TriplesQueryEndpoint(
80
93
  pulsar_host=self.pulsar_host, timeout=self.timeout,
94
+ auth = self.auth,
81
95
  ),
82
96
  EmbeddingsEndpoint(
83
97
  pulsar_host=self.pulsar_host, timeout=self.timeout,
98
+ auth = self.auth,
84
99
  ),
85
100
  AgentEndpoint(
86
101
  pulsar_host=self.pulsar_host, timeout=self.timeout,
102
+ auth = self.auth,
87
103
  ),
88
104
  EncyclopediaEndpoint(
89
105
  pulsar_host=self.pulsar_host, timeout=self.timeout,
106
+ auth = self.auth,
90
107
  ),
91
108
  DbpediaEndpoint(
92
109
  pulsar_host=self.pulsar_host, timeout=self.timeout,
110
+ auth = self.auth,
93
111
  ),
94
112
  InternetSearchEndpoint(
95
113
  pulsar_host=self.pulsar_host, timeout=self.timeout,
114
+ auth = self.auth,
96
115
  ),
97
116
  TriplesStreamEndpoint(
98
- pulsar_host=self.pulsar_host
117
+ pulsar_host=self.pulsar_host,
118
+ auth = self.auth,
99
119
  ),
100
120
  GraphEmbeddingsStreamEndpoint(
101
- pulsar_host=self.pulsar_host
121
+ pulsar_host=self.pulsar_host,
122
+ auth = self.auth,
102
123
  ),
103
124
  TriplesLoadEndpoint(
104
- pulsar_host=self.pulsar_host
125
+ pulsar_host=self.pulsar_host,
126
+ auth = self.auth,
105
127
  ),
106
128
  GraphEmbeddingsLoadEndpoint(
107
- pulsar_host=self.pulsar_host
129
+ pulsar_host=self.pulsar_host,
130
+ auth = self.auth,
108
131
  ),
109
132
  ]
110
133
 
@@ -254,6 +277,12 @@ def run():
254
277
  help=f'API request timeout in seconds (default: {default_timeout})',
255
278
  )
256
279
 
280
+ parser.add_argument(
281
+ '--api-token',
282
+ default=default_api_token,
283
+ help=f'Secret API token (default: no auth)',
284
+ )
285
+
257
286
  parser.add_argument(
258
287
  '-l', '--log-level',
259
288
  type=LogLevel,
@@ -11,11 +11,12 @@ logger.setLevel(logging.INFO)
11
11
  class SocketEndpoint:
12
12
 
13
13
  def __init__(
14
- self,
15
- endpoint_path="/api/v1/socket",
14
+ self, endpoint_path, auth,
16
15
  ):
17
16
 
18
17
  self.path = endpoint_path
18
+ self.auth = auth
19
+ self.operation = "socket"
19
20
 
20
21
  async def listener(self, ws, running):
21
22
 
@@ -43,18 +44,33 @@ class SocketEndpoint:
43
44
 
44
45
  async def handle(self, request):
45
46
 
47
+ try:
48
+ token = request.query['token']
49
+ except:
50
+ token = ""
51
+
52
+ if not self.auth.permitted(token, self.operation):
53
+ return web.HTTPUnauthorized()
54
+
46
55
  running = Running()
47
56
  ws = web.WebSocketResponse()
48
57
  await ws.prepare(request)
49
58
 
50
59
  task = asyncio.create_task(self.async_thread(ws, running))
51
60
 
52
- await self.listener(ws, running)
61
+ try:
53
62
 
54
- await task
63
+ await self.listener(ws, running)
64
+
65
+ except Exception as e:
66
+ print(e, flush=True)
55
67
 
56
68
  running.stop()
57
69
 
70
+ await ws.close()
71
+
72
+ await task
73
+
58
74
  return ws
59
75
 
60
76
  async def start(self):
@@ -6,7 +6,7 @@ from ... schema import text_completion_response_queue
6
6
  from . endpoint import ServiceEndpoint
7
7
 
8
8
  class TextCompletionEndpoint(ServiceEndpoint):
9
- def __init__(self, pulsar_host, timeout):
9
+ def __init__(self, pulsar_host, timeout, auth):
10
10
 
11
11
  super(TextCompletionEndpoint, self).__init__(
12
12
  pulsar_host=pulsar_host,
@@ -16,6 +16,7 @@ class TextCompletionEndpoint(ServiceEndpoint):
16
16
  response_schema=TextCompletionResponse,
17
17
  endpoint_path="/api/v1/text-completion",
18
18
  timeout=timeout,
19
+ auth=auth,
19
20
  )
20
21
 
21
22
  def to_request(self, body):
@@ -14,10 +14,10 @@ from . serialize import to_subgraph
14
14
 
15
15
  class TriplesLoadEndpoint(SocketEndpoint):
16
16
 
17
- def __init__(self, pulsar_host, path="/api/v1/load/triples"):
17
+ def __init__(self, pulsar_host, auth, path="/api/v1/load/triples"):
18
18
 
19
19
  super(TriplesLoadEndpoint, self).__init__(
20
- endpoint_path=path
20
+ endpoint_path=path, auth=auth,
21
21
  )
22
22
 
23
23
  self.pulsar_host=pulsar_host
@@ -7,7 +7,7 @@ from . endpoint import ServiceEndpoint
7
7
  from . serialize import to_value, serialize_subgraph
8
8
 
9
9
  class TriplesQueryEndpoint(ServiceEndpoint):
10
- def __init__(self, pulsar_host, timeout):
10
+ def __init__(self, pulsar_host, timeout, auth):
11
11
 
12
12
  super(TriplesQueryEndpoint, self).__init__(
13
13
  pulsar_host=pulsar_host,
@@ -17,6 +17,7 @@ class TriplesQueryEndpoint(ServiceEndpoint):
17
17
  response_schema=TriplesQueryResponse,
18
18
  endpoint_path="/api/v1/triples-query",
19
19
  timeout=timeout,
20
+ auth=auth,
20
21
  )
21
22
 
22
23
  def to_request(self, body):
@@ -12,10 +12,10 @@ from . serialize import serialize_triples
12
12
 
13
13
  class TriplesStreamEndpoint(SocketEndpoint):
14
14
 
15
- def __init__(self, pulsar_host, path="/api/v1/stream/triples"):
15
+ def __init__(self, pulsar_host, auth, path="/api/v1/stream/triples"):
16
16
 
17
17
  super(TriplesStreamEndpoint, self).__init__(
18
- endpoint_path=path
18
+ endpoint_path=path, auth=auth,
19
19
  )
20
20
 
21
21
  self.pulsar_host=pulsar_host
@@ -0,0 +1 @@
1
+ __version__ = "0.17.2"
@@ -131,9 +131,14 @@ class Processor(ConsumerProducer):
131
131
  )
132
132
 
133
133
  parser.add_argument(
134
- '-t', '--store-uri',
135
- default=default_store_uri,
136
- help=f'Milvus store URI (default: {default_store_uri})'
134
+ '-a', '--api-key',
135
+ default=default_api_key,
136
+ help='Pinecone API key. (default from PINECONE_API_KEY)'
137
+ )
138
+
139
+ parser.add_argument(
140
+ '-u', '--url',
141
+ help='Pinecone URL. If unspecified, serverless is used'
137
142
  )
138
143
 
139
144
  def run():
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-flow
3
- Version: 0.17.0
3
+ Version: 0.17.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.17.0.tar.gz
9
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.17.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+)
@@ -59,6 +59,7 @@ trustgraph/api/__init__.py
59
59
  trustgraph/api/gateway/__init__.py
60
60
  trustgraph/api/gateway/__main__.py
61
61
  trustgraph/api/gateway/agent.py
62
+ trustgraph/api/gateway/auth.py
62
63
  trustgraph/api/gateway/dbpedia.py
63
64
  trustgraph/api/gateway/embeddings.py
64
65
  trustgraph/api/gateway/encyclopedia.py
@@ -1 +0,0 @@
1
- __version__ = "0.17.0"