trustgraph-flow 0.13.2__tar.gz → 0.14.1__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 (192) hide show
  1. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/PKG-INFO +2 -2
  2. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/setup.py +3 -1
  3. trustgraph-flow-0.14.1/trustgraph/flow_version.py +1 -0
  4. trustgraph-flow-0.14.1/trustgraph/model/prompt/template/prompt_manager.py +95 -0
  5. trustgraph-flow-0.14.1/trustgraph/model/prompt/template/service.py +297 -0
  6. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph_flow.egg-info/PKG-INFO +2 -2
  7. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph_flow.egg-info/SOURCES.txt +1 -1
  8. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph_flow.egg-info/requires.txt +3 -1
  9. trustgraph-flow-0.13.2/trustgraph/flow_version.py +0 -1
  10. trustgraph-flow-0.13.2/trustgraph/model/prompt/template/prompts.py +0 -47
  11. trustgraph-flow-0.13.2/trustgraph/model/prompt/template/service.py +0 -523
  12. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/README.md +0 -0
  13. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/chunker-recursive +0 -0
  14. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/chunker-token +0 -0
  15. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/de-query-milvus +0 -0
  16. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/de-query-qdrant +0 -0
  17. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/de-write-milvus +0 -0
  18. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/de-write-qdrant +0 -0
  19. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/document-rag +0 -0
  20. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/embeddings-ollama +0 -0
  21. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/embeddings-vectorize +0 -0
  22. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/ge-query-milvus +0 -0
  23. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/ge-query-qdrant +0 -0
  24. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/ge-write-milvus +0 -0
  25. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/ge-write-qdrant +0 -0
  26. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/graph-rag +0 -0
  27. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/kg-extract-definitions +0 -0
  28. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/kg-extract-relationships +0 -0
  29. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/kg-extract-topics +0 -0
  30. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/metering +0 -0
  31. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/object-extract-row +0 -0
  32. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/oe-write-milvus +0 -0
  33. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/pdf-decoder +0 -0
  34. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/prompt-generic +0 -0
  35. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/prompt-template +0 -0
  36. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/rows-write-cassandra +0 -0
  37. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/run-processing +0 -0
  38. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/text-completion-azure +0 -0
  39. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/text-completion-azure-openai +0 -0
  40. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/text-completion-claude +0 -0
  41. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/text-completion-cohere +0 -0
  42. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/text-completion-googleaistudio +0 -0
  43. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/text-completion-llamafile +0 -0
  44. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/text-completion-ollama +0 -0
  45. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/text-completion-openai +0 -0
  46. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/triples-query-cassandra +0 -0
  47. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/triples-query-neo4j +0 -0
  48. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/triples-write-cassandra +0 -0
  49. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/scripts/triples-write-neo4j +0 -0
  50. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/setup.cfg +0 -0
  51. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/__init__.py +0 -0
  52. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/chunking/__init__.py +0 -0
  53. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/chunking/recursive/__init__.py +0 -0
  54. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/chunking/recursive/__main__.py +0 -0
  55. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/chunking/recursive/chunker.py +0 -0
  56. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/chunking/token/__init__.py +0 -0
  57. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/chunking/token/__main__.py +0 -0
  58. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/chunking/token/chunker.py +0 -0
  59. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/decoding/__init__.py +0 -0
  60. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/decoding/pdf/__init__.py +0 -0
  61. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/decoding/pdf/__main__.py +0 -0
  62. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
  63. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/direct/__init__.py +0 -0
  64. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/direct/cassandra.py +0 -0
  65. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
  66. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
  67. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/direct/milvus_object_embeddings.py +0 -0
  68. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/document_rag.py +0 -0
  69. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/embeddings/__init__.py +0 -0
  70. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/embeddings/ollama/__init__.py +0 -0
  71. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/embeddings/ollama/__main__.py +0 -0
  72. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/embeddings/ollama/processor.py +0 -0
  73. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/embeddings/vectorize/__init__.py +0 -0
  74. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/embeddings/vectorize/__main__.py +0 -0
  75. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/embeddings/vectorize/vectorize.py +0 -0
  76. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/__init__.py +0 -0
  77. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/kg/__init__.py +0 -0
  78. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/kg/definitions/__init__.py +0 -0
  79. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/kg/definitions/__main__.py +0 -0
  80. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/kg/definitions/extract.py +0 -0
  81. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/kg/relationships/__init__.py +0 -0
  82. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/kg/relationships/__main__.py +0 -0
  83. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/kg/relationships/extract.py +0 -0
  84. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/kg/topics/__init__.py +0 -0
  85. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/kg/topics/__main__.py +0 -0
  86. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/kg/topics/extract.py +0 -0
  87. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/object/__init__.py +0 -0
  88. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/object/row/__init__.py +0 -0
  89. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/object/row/__main__.py +0 -0
  90. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/extract/object/row/extract.py +0 -0
  91. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/graph_rag.py +0 -0
  92. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/metering/__init__.py +0 -0
  93. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/metering/__main__.py +0 -0
  94. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/metering/counter.py +0 -0
  95. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/metering/pricelist.py +0 -0
  96. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/__init__.py +0 -0
  97. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/prompt/__init__.py +0 -0
  98. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/prompt/generic/__init__.py +0 -0
  99. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/prompt/generic/__main__.py +0 -0
  100. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/prompt/generic/prompts.py +0 -0
  101. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/prompt/generic/service.py +0 -0
  102. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/prompt/template/__init__.py +0 -0
  103. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/prompt/template/__main__.py +0 -0
  104. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/__init__.py +0 -0
  105. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/azure/__init__.py +0 -0
  106. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/azure/__main__.py +0 -0
  107. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/azure/llm.py +0 -0
  108. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
  109. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
  110. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
  111. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/claude/__init__.py +0 -0
  112. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/claude/__main__.py +0 -0
  113. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/claude/llm.py +0 -0
  114. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
  115. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
  116. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/cohere/llm.py +0 -0
  117. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
  118. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
  119. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
  120. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
  121. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
  122. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
  123. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
  124. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
  125. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/ollama/llm.py +0 -0
  126. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/openai/__init__.py +0 -0
  127. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/openai/__main__.py +0 -0
  128. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/model/text_completion/openai/llm.py +0 -0
  129. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/processing/__init__.py +0 -0
  130. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/processing/__main__.py +0 -0
  131. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/processing/processing.py +0 -0
  132. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/__init__.py +0 -0
  133. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/doc_embeddings/__init__.py +0 -0
  134. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
  135. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
  136. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
  137. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
  138. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
  139. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
  140. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/graph_embeddings/__init__.py +0 -0
  141. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
  142. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
  143. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
  144. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
  145. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
  146. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
  147. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/triples/__init__.py +0 -0
  148. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/triples/cassandra/__init__.py +0 -0
  149. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/triples/cassandra/__main__.py +0 -0
  150. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/triples/cassandra/service.py +0 -0
  151. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/triples/neo4j/__init__.py +0 -0
  152. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/triples/neo4j/__main__.py +0 -0
  153. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/query/triples/neo4j/service.py +0 -0
  154. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/retrieval/__init__.py +0 -0
  155. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/retrieval/document_rag/__init__.py +0 -0
  156. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/retrieval/document_rag/__main__.py +0 -0
  157. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/retrieval/document_rag/rag.py +0 -0
  158. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
  159. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
  160. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/retrieval/graph_rag/rag.py +0 -0
  161. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/__init__.py +0 -0
  162. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
  163. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
  164. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
  165. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
  166. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
  167. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
  168. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
  169. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
  170. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
  171. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
  172. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
  173. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
  174. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
  175. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
  176. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/object_embeddings/__init__.py +0 -0
  177. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
  178. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
  179. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
  180. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/rows/__init__.py +0 -0
  181. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
  182. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
  183. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/rows/cassandra/write.py +0 -0
  184. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/triples/__init__.py +0 -0
  185. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
  186. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
  187. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/triples/cassandra/write.py +0 -0
  188. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
  189. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
  190. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph/storage/triples/neo4j/write.py +0 -0
  191. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
  192. {trustgraph-flow-0.13.2 → trustgraph-flow-0.14.1}/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.13.2
3
+ Version: 0.14.1
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.13.2.tar.gz
9
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.14.1.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+)
@@ -34,7 +34,7 @@ setuptools.setup(
34
34
  python_requires='>=3.8',
35
35
  download_url = "https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v" + version + ".tar.gz",
36
36
  install_requires=[
37
- "trustgraph-base>=0.13,<0.14",
37
+ "trustgraph-base>=0.14,<0.15",
38
38
  "urllib3",
39
39
  "rdflib",
40
40
  "pymilvus",
@@ -56,6 +56,8 @@ setuptools.setup(
56
56
  "neo4j",
57
57
  "tiktoken",
58
58
  "google-generativeai",
59
+ "ibis",
60
+ "jsonschema",
59
61
  ],
60
62
  scripts=[
61
63
  "scripts/chunker-recursive",
@@ -0,0 +1 @@
1
+ __version__ = "0.14.1"
@@ -0,0 +1,95 @@
1
+
2
+ import ibis
3
+ import json
4
+ from jsonschema import validate
5
+ import re
6
+
7
+ from trustgraph.clients.llm_client import LlmClient
8
+
9
+ class PromptConfiguration:
10
+ def __init__(self, system_template, global_terms={}, prompts={}):
11
+ self.system_template = system_template
12
+ self.global_terms = global_terms
13
+ self.prompts = prompts
14
+
15
+ class Prompt:
16
+ def __init__(self, template, response_type = "text", terms=None, schema=None):
17
+ self.template = template
18
+ self.response_type = response_type
19
+ self.terms = terms
20
+ self.schema = schema
21
+
22
+ class PromptManager:
23
+
24
+ def __init__(self, llm, config):
25
+ self.llm = llm
26
+ self.config = config
27
+ self.terms = config.global_terms
28
+
29
+ self.prompts = config.prompts
30
+
31
+ try:
32
+ self.system_template = ibis.Template(config.system_template)
33
+ except:
34
+ raise RuntimeError("Error in system template")
35
+
36
+ self.templates = {}
37
+ for k, v in self.prompts.items():
38
+ try:
39
+ self.templates[k] = ibis.Template(v.template)
40
+ except:
41
+ raise RuntimeError(f"Error in template: {k}")
42
+
43
+ if v.terms is None:
44
+ v.terms = {}
45
+
46
+ def parse_json(self, text):
47
+ json_match = re.search(r'```(?:json)?(.*?)```', text, re.DOTALL)
48
+
49
+ if json_match:
50
+ json_str = json_match.group(1).strip()
51
+ else:
52
+ # If no delimiters, assume the entire output is JSON
53
+ json_str = text.strip()
54
+
55
+ return json.loads(json_str)
56
+
57
+ def invoke(self, id, input):
58
+
59
+ if id not in self.prompts:
60
+ raise RuntimeError("ID invalid")
61
+
62
+ terms = self.terms | self.prompts[id].terms | input
63
+
64
+ resp_type = self.prompts[id].response_type
65
+
66
+ prompt = {
67
+ "system": self.system_template.render(terms),
68
+ "prompt": self.templates[id].render(terms)
69
+ }
70
+
71
+ resp = self.llm.request(**prompt)
72
+
73
+ print(resp, flush=True)
74
+
75
+ if resp_type == "text":
76
+ return resp
77
+
78
+ if resp_type != "json":
79
+ raise RuntimeError(f"Response type {resp_type} not known")
80
+
81
+ try:
82
+ obj = self.parse_json(resp)
83
+ except:
84
+ raise RuntimeError("JSON parse fail")
85
+
86
+ print(obj, flush=True)
87
+ if self.prompts[id].schema:
88
+ try:
89
+ print(self.prompts[id].schema)
90
+ validate(instance=obj, schema=self.prompts[id].schema)
91
+ except Exception as e:
92
+ raise RuntimeError(f"Schema validation fail: {e}")
93
+
94
+ return obj
95
+
@@ -0,0 +1,297 @@
1
+
2
+ """
3
+ Language service abstracts prompt engineering from LLM.
4
+ """
5
+
6
+ import json
7
+ import re
8
+
9
+ from .... schema import Definition, Relationship, Triple
10
+ from .... schema import Topic
11
+ from .... schema import PromptRequest, PromptResponse, Error
12
+ from .... schema import TextCompletionRequest, TextCompletionResponse
13
+ from .... schema import text_completion_request_queue
14
+ from .... schema import text_completion_response_queue
15
+ from .... schema import prompt_request_queue, prompt_response_queue
16
+ from .... base import ConsumerProducer
17
+ from .... clients.llm_client import LlmClient
18
+
19
+ from . prompt_manager import PromptConfiguration, Prompt, PromptManager
20
+
21
+ module = ".".join(__name__.split(".")[1:-1])
22
+
23
+ default_input_queue = prompt_request_queue
24
+ default_output_queue = prompt_response_queue
25
+ default_subscriber = module
26
+
27
+ class Processor(ConsumerProducer):
28
+
29
+ def __init__(self, **params):
30
+
31
+ prompt_base = {}
32
+
33
+ # Parsing the prompt information to the prompt configuration
34
+ # structure
35
+ prompt_arg = params.get("prompt", [])
36
+ if prompt_arg:
37
+ for p in prompt_arg:
38
+ toks = p.split("=", 1)
39
+ if len(toks) < 2:
40
+ raise RuntimeError(f"Prompt string not well-formed: {p}")
41
+ prompt_base[toks[0]] = {
42
+ "template": toks[1]
43
+ }
44
+
45
+ prompt_response_type_arg = params.get("prompt_response_type", [])
46
+ if prompt_response_type_arg:
47
+ for p in prompt_response_type_arg:
48
+ toks = p.split("=", 1)
49
+ if len(toks) < 2:
50
+ raise RuntimeError(f"Response type not well-formed: {p}")
51
+ if toks[0] not in prompt_base:
52
+ raise RuntimeError(f"Response-type, {toks[0]} not known")
53
+ prompt_base[toks[0]]["response_type"] = toks[1]
54
+
55
+ prompt_schema_arg = params.get("prompt_schema", [])
56
+ if prompt_schema_arg:
57
+ for p in prompt_schema_arg:
58
+ toks = p.split("=", 1)
59
+ if len(toks) < 2:
60
+ raise RuntimeError(f"Schema arg not well-formed: {p}")
61
+ if toks[0] not in prompt_base:
62
+ raise RuntimeError(f"Schema, {toks[0]} not known")
63
+ try:
64
+ prompt_base[toks[0]]["schema"] = json.loads(toks[1])
65
+ except:
66
+ raise RuntimeError(f"Failed to parse JSON schema: {p}")
67
+
68
+ prompt_term_arg = params.get("prompt_term", [])
69
+ if prompt_term_arg:
70
+ for p in prompt_term_arg:
71
+ toks = p.split("=", 1)
72
+ if len(toks) < 2:
73
+ raise RuntimeError(f"Term arg not well-formed: {p}")
74
+ if toks[0] not in prompt_base:
75
+ raise RuntimeError(f"Term, {toks[0]} not known")
76
+ kvtoks = toks[1].split(":", 1)
77
+ if len(kvtoks) < 2:
78
+ raise RuntimeError(f"Term not well-formed: {toks[1]}")
79
+ k, v = kvtoks
80
+ if "terms" not in prompt_base[toks[0]]:
81
+ prompt_base[toks[0]]["terms"] = {}
82
+ prompt_base[toks[0]]["terms"][k] = v
83
+
84
+ global_terms = {}
85
+
86
+ global_term_arg = params.get("global_term", [])
87
+ if global_term_arg:
88
+ for t in global_term_arg:
89
+ toks = t.split("=", 1)
90
+ if len(toks) < 2:
91
+ raise RuntimeError(f"Global term arg not well-formed: {t}")
92
+ global_terms[toks[0]] = toks[1]
93
+
94
+ print(global_terms)
95
+
96
+ prompts = {
97
+ k: Prompt(**v)
98
+ for k, v in prompt_base.items()
99
+ }
100
+
101
+ prompt_configuration = PromptConfiguration(
102
+ system_template = params.get("system_prompt", ""),
103
+ global_terms = global_terms,
104
+ prompts = prompts
105
+ )
106
+
107
+ input_queue = params.get("input_queue", default_input_queue)
108
+ output_queue = params.get("output_queue", default_output_queue)
109
+ subscriber = params.get("subscriber", default_subscriber)
110
+ tc_request_queue = params.get(
111
+ "text_completion_request_queue", text_completion_request_queue
112
+ )
113
+ tc_response_queue = params.get(
114
+ "text_completion_response_queue", text_completion_response_queue
115
+ )
116
+ definition_template = params.get("definition_template")
117
+ relationship_template = params.get("relationship_template")
118
+ topic_template = params.get("topic_template")
119
+ rows_template = params.get("rows_template")
120
+ knowledge_query_template = params.get("knowledge_query_template")
121
+ document_query_template = params.get("document_query_template")
122
+
123
+ super(Processor, self).__init__(
124
+ **params | {
125
+ "input_queue": input_queue,
126
+ "output_queue": output_queue,
127
+ "subscriber": subscriber,
128
+ "input_schema": PromptRequest,
129
+ "output_schema": PromptResponse,
130
+ "text_completion_request_queue": tc_request_queue,
131
+ "text_completion_response_queue": tc_response_queue,
132
+ }
133
+ )
134
+
135
+ self.llm = LlmClient(
136
+ subscriber=subscriber,
137
+ input_queue=tc_request_queue,
138
+ output_queue=tc_response_queue,
139
+ pulsar_host = self.pulsar_host
140
+ )
141
+
142
+ # System prompt hack
143
+ class Llm:
144
+ def __init__(self, llm):
145
+ self.llm = llm
146
+ def request(self, system, prompt):
147
+ print(system)
148
+ print(prompt, flush=True)
149
+ return self.llm.request(system + "\n\n" + prompt)
150
+
151
+ self.llm = Llm(self.llm)
152
+
153
+ self.manager = PromptManager(
154
+ llm = self.llm,
155
+ config = prompt_configuration,
156
+ )
157
+
158
+ def handle(self, msg):
159
+
160
+ v = msg.value()
161
+
162
+ # Sender-produced ID
163
+
164
+ id = msg.properties()["id"]
165
+
166
+ kind = v.id
167
+
168
+ try:
169
+
170
+ print(v.terms)
171
+
172
+ input = {
173
+ k: json.loads(v)
174
+ for k, v in v.terms.items()
175
+ }
176
+
177
+ print(f"Handling kind {kind}...", flush=True)
178
+ print(input, flush=True)
179
+
180
+ resp = self.manager.invoke(kind, input)
181
+
182
+ if isinstance(resp, str):
183
+
184
+ print("Send text response...", flush=True)
185
+ print(resp, flush=True)
186
+
187
+ r = PromptResponse(
188
+ text=resp,
189
+ object=None,
190
+ error=None,
191
+ )
192
+
193
+ self.producer.send(r, properties={"id": id})
194
+
195
+ return
196
+
197
+ else:
198
+
199
+ print("Send object response...", flush=True)
200
+ print(json.dumps(resp, indent=4), flush=True)
201
+
202
+ r = PromptResponse(
203
+ text=None,
204
+ object=json.dumps(resp),
205
+ error=None,
206
+ )
207
+
208
+ self.producer.send(r, properties={"id": id})
209
+
210
+ return
211
+
212
+ except Exception as e:
213
+
214
+ print(f"Exception: {e}")
215
+
216
+ print("Send error response...", flush=True)
217
+
218
+ r = PromptResponse(
219
+ error=Error(
220
+ type = "llm-error",
221
+ message = str(e),
222
+ ),
223
+ response=None,
224
+ )
225
+
226
+ self.producer.send(r, properties={"id": id})
227
+
228
+ except Exception as e:
229
+
230
+ print(f"Exception: {e}")
231
+
232
+ print("Send error response...", flush=True)
233
+
234
+ r = PromptResponse(
235
+ error=Error(
236
+ type = "llm-error",
237
+ message = str(e),
238
+ ),
239
+ response=None,
240
+ )
241
+
242
+ self.producer.send(r, properties={"id": id})
243
+
244
+ @staticmethod
245
+ def add_args(parser):
246
+
247
+ ConsumerProducer.add_args(
248
+ parser, default_input_queue, default_subscriber,
249
+ default_output_queue,
250
+ )
251
+
252
+ parser.add_argument(
253
+ '--text-completion-request-queue',
254
+ default=text_completion_request_queue,
255
+ help=f'Text completion request queue (default: {text_completion_request_queue})',
256
+ )
257
+
258
+ parser.add_argument(
259
+ '--text-completion-response-queue',
260
+ default=text_completion_response_queue,
261
+ help=f'Text completion response queue (default: {text_completion_response_queue})',
262
+ )
263
+
264
+ parser.add_argument(
265
+ '--prompt', nargs='*',
266
+ help=f'Prompt template form id=template',
267
+ )
268
+
269
+ parser.add_argument(
270
+ '--prompt-response-type', nargs='*',
271
+ help=f'Prompt response type, form id=json|text',
272
+ )
273
+
274
+ parser.add_argument(
275
+ '--prompt-term', nargs='*',
276
+ help=f'Prompt response type, form id=key:value',
277
+ )
278
+
279
+ parser.add_argument(
280
+ '--prompt-schema', nargs='*',
281
+ help=f'Prompt response schema, form id=schema',
282
+ )
283
+
284
+ parser.add_argument(
285
+ '--system-prompt',
286
+ help=f'System prompt template',
287
+ )
288
+
289
+ parser.add_argument(
290
+ '--global-term', nargs='+',
291
+ help=f'Global term, form key:value'
292
+ )
293
+
294
+ def run():
295
+
296
+ Processor.start(module, __doc__)
297
+
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-flow
3
- Version: 0.13.2
3
+ Version: 0.14.1
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.13.2.tar.gz
9
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.14.1.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+)
@@ -91,7 +91,7 @@ trustgraph/model/prompt/generic/prompts.py
91
91
  trustgraph/model/prompt/generic/service.py
92
92
  trustgraph/model/prompt/template/__init__.py
93
93
  trustgraph/model/prompt/template/__main__.py
94
- trustgraph/model/prompt/template/prompts.py
94
+ trustgraph/model/prompt/template/prompt_manager.py
95
95
  trustgraph/model/prompt/template/service.py
96
96
  trustgraph/model/text_completion/__init__.py
97
97
  trustgraph/model/text_completion/azure/__init__.py
@@ -2,6 +2,8 @@ anthropic
2
2
  cassandra-driver
3
3
  cohere
4
4
  google-generativeai
5
+ ibis
6
+ jsonschema
5
7
  langchain
6
8
  langchain-community
7
9
  langchain-core
@@ -18,5 +20,5 @@ rdflib
18
20
  requests
19
21
  tabulate
20
22
  tiktoken
21
- trustgraph-base<0.14,>=0.13
23
+ trustgraph-base<0.15,>=0.14
22
24
  urllib3
@@ -1 +0,0 @@
1
- __version__ = "0.13.2"
@@ -1,47 +0,0 @@
1
-
2
- def to_relationships(template, text):
3
- return template.format(text=text)
4
-
5
- def to_definitions(template, text):
6
- return template.format(text=text)
7
-
8
- def to_topics(template, text):
9
- return template.format(text=text)
10
-
11
- def to_rows(template, schema, text):
12
-
13
- field_schema = [
14
- f"- Name: {f.name}\n Type: {f.type}\n Definition: {f.description}"
15
- for f in schema.fields
16
- ]
17
-
18
- field_schema = "\n".join(field_schema)
19
-
20
- return template.format(schema=schema, text=text)
21
-
22
- schema = f"""Object name: {schema.name}
23
- Description: {schema.description}
24
-
25
- Fields:
26
- {schema}"""
27
-
28
- prompt = f""""""
29
-
30
- return prompt
31
-
32
- def get_cypher(kg):
33
- sg2 = []
34
- for f in kg:
35
- sg2.append(f"({f.s})-[{f.p}]->({f.o})")
36
- kg = "\n".join(sg2)
37
- kg = kg.replace("\\", "-")
38
- return kg
39
-
40
- def to_kg_query(template, query, kg):
41
- cypher = get_cypher(kg)
42
- return template.format(query=query, graph=cypher)
43
-
44
- def to_document_query(template, query, docs):
45
- docs = "\n\n".join(docs)
46
- return template.format(query=query, documents=docs)
47
-