trustgraph-flow 0.22.1__tar.gz → 0.22.3__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 (300) hide show
  1. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/PKG-INFO +2 -2
  2. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/agent/react/agent_manager.py +4 -4
  3. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/agent/react/service.py +77 -129
  4. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/agent/react/tools.py +1 -1
  5. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/config/service/service.py +7 -7
  6. trustgraph-flow-0.22.3/trustgraph/flow_version.py +1 -0
  7. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/prompt/template/service.py +56 -110
  8. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph_flow.egg-info/PKG-INFO +2 -2
  9. trustgraph-flow-0.22.1/trustgraph/flow_version.py +0 -1
  10. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/README.md +0 -0
  11. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/agent-manager-react +0 -0
  12. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/api-gateway +0 -0
  13. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/chunker-recursive +0 -0
  14. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/chunker-token +0 -0
  15. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/config-svc +0 -0
  16. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/de-query-milvus +0 -0
  17. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/de-query-pinecone +0 -0
  18. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/de-query-qdrant +0 -0
  19. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/de-write-milvus +0 -0
  20. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/de-write-pinecone +0 -0
  21. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/de-write-qdrant +0 -0
  22. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/document-embeddings +0 -0
  23. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/document-rag +0 -0
  24. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/embeddings-fastembed +0 -0
  25. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/embeddings-ollama +0 -0
  26. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/ge-query-milvus +0 -0
  27. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/ge-query-pinecone +0 -0
  28. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/ge-query-qdrant +0 -0
  29. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/ge-write-milvus +0 -0
  30. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/ge-write-pinecone +0 -0
  31. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/ge-write-qdrant +0 -0
  32. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/graph-embeddings +0 -0
  33. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/graph-rag +0 -0
  34. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/kg-extract-definitions +0 -0
  35. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/kg-extract-relationships +0 -0
  36. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/kg-extract-topics +0 -0
  37. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/librarian +0 -0
  38. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/metering +0 -0
  39. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/object-extract-row +0 -0
  40. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/oe-write-milvus +0 -0
  41. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/pdf-decoder +0 -0
  42. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/pdf-ocr-mistral +0 -0
  43. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/prompt-generic +0 -0
  44. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/prompt-template +0 -0
  45. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/rows-write-cassandra +0 -0
  46. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/run-processing +0 -0
  47. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/text-completion-azure +0 -0
  48. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/text-completion-azure-openai +0 -0
  49. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/text-completion-claude +0 -0
  50. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/text-completion-cohere +0 -0
  51. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/text-completion-googleaistudio +0 -0
  52. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/text-completion-llamafile +0 -0
  53. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/text-completion-lmstudio +0 -0
  54. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/text-completion-mistral +0 -0
  55. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/text-completion-ollama +0 -0
  56. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/text-completion-openai +0 -0
  57. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/triples-query-cassandra +0 -0
  58. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/triples-query-falkordb +0 -0
  59. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/triples-query-memgraph +0 -0
  60. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/triples-query-neo4j +0 -0
  61. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/triples-write-cassandra +0 -0
  62. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/triples-write-falkordb +0 -0
  63. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/triples-write-memgraph +0 -0
  64. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/triples-write-neo4j +0 -0
  65. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/scripts/wikipedia-lookup +0 -0
  66. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/setup.cfg +0 -0
  67. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/setup.py +0 -0
  68. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/__init__.py +0 -0
  69. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/agent/__init__.py +0 -0
  70. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/agent/react/__init__.py +0 -0
  71. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/agent/react/__main__.py +0 -0
  72. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/agent/react/types.py +0 -0
  73. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/chunking/__init__.py +0 -0
  74. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/chunking/recursive/__init__.py +0 -0
  75. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/chunking/recursive/__main__.py +0 -0
  76. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/chunking/recursive/chunker.py +0 -0
  77. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/chunking/token/__init__.py +0 -0
  78. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/chunking/token/__main__.py +0 -0
  79. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/chunking/token/chunker.py +0 -0
  80. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/config/service/__init__.py +0 -0
  81. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/config/service/__main__.py +0 -0
  82. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/decoding/__init__.py +0 -0
  83. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/decoding/mistral_ocr/__init__.py +0 -0
  84. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/decoding/mistral_ocr/__main__.py +0 -0
  85. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/decoding/mistral_ocr/processor.py +0 -0
  86. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/decoding/pdf/__init__.py +0 -0
  87. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/decoding/pdf/__main__.py +0 -0
  88. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
  89. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/direct/__init__.py +0 -0
  90. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/direct/cassandra.py +0 -0
  91. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
  92. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
  93. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/direct/milvus_object_embeddings.py +0 -0
  94. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/document_rag.py +0 -0
  95. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/__init__.py +0 -0
  96. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/document_embeddings/__init__.py +0 -0
  97. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/document_embeddings/__main__.py +0 -0
  98. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/document_embeddings/embeddings.py +0 -0
  99. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/fastembed/__init__.py +0 -0
  100. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/fastembed/__main__.py +0 -0
  101. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/fastembed/processor.py +0 -0
  102. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/graph_embeddings/__init__.py +0 -0
  103. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/graph_embeddings/__main__.py +0 -0
  104. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/graph_embeddings/embeddings.py +0 -0
  105. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/ollama/__init__.py +0 -0
  106. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/ollama/__main__.py +0 -0
  107. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/embeddings/ollama/processor.py +0 -0
  108. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/external/__init__.py +0 -0
  109. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/external/wikipedia/__init__.py +0 -0
  110. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/external/wikipedia/__main__.py +0 -0
  111. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/external/wikipedia/service.py +0 -0
  112. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/__init__.py +0 -0
  113. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/kg/__init__.py +0 -0
  114. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/kg/definitions/__init__.py +0 -0
  115. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/kg/definitions/__main__.py +0 -0
  116. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/kg/definitions/extract.py +0 -0
  117. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/kg/relationships/__init__.py +0 -0
  118. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/kg/relationships/__main__.py +0 -0
  119. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/kg/relationships/extract.py +0 -0
  120. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/kg/topics/__init__.py +0 -0
  121. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/kg/topics/__main__.py +0 -0
  122. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/kg/topics/extract.py +0 -0
  123. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/object/__init__.py +0 -0
  124. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/object/row/__init__.py +0 -0
  125. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/object/row/__main__.py +0 -0
  126. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/extract/object/row/extract.py +0 -0
  127. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/__init__.py +0 -0
  128. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/__main__.py +0 -0
  129. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/agent.py +0 -0
  130. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/auth.py +0 -0
  131. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/config.py +0 -0
  132. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/dbpedia.py +0 -0
  133. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/document_embeddings_load.py +0 -0
  134. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/document_embeddings_stream.py +0 -0
  135. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/document_load.py +0 -0
  136. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/document_rag.py +0 -0
  137. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/embeddings.py +0 -0
  138. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/encyclopedia.py +0 -0
  139. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/endpoint.py +0 -0
  140. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/graph_embeddings_load.py +0 -0
  141. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/graph_embeddings_query.py +0 -0
  142. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/graph_embeddings_stream.py +0 -0
  143. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/graph_rag.py +0 -0
  144. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/internet_search.py +0 -0
  145. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/librarian.py +0 -0
  146. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/metrics.py +0 -0
  147. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/mux.py +0 -0
  148. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/prompt.py +0 -0
  149. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/requestor.py +0 -0
  150. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/running.py +0 -0
  151. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/sender.py +0 -0
  152. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/serialize.py +0 -0
  153. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/service.py +0 -0
  154. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/socket.py +0 -0
  155. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/text_completion.py +0 -0
  156. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/text_load.py +0 -0
  157. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/triples_load.py +0 -0
  158. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/triples_query.py +0 -0
  159. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/gateway/triples_stream.py +0 -0
  160. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/graph_rag.py +0 -0
  161. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/librarian/__init__.py +0 -0
  162. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/librarian/__main__.py +0 -0
  163. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/librarian/blob_store.py +0 -0
  164. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/librarian/librarian.py +0 -0
  165. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/librarian/service.py +0 -0
  166. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/librarian/table_store.py +0 -0
  167. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/metering/__init__.py +0 -0
  168. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/metering/__main__.py +0 -0
  169. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/metering/counter.py +0 -0
  170. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/metering/pricelist.py +0 -0
  171. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/__init__.py +0 -0
  172. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/prompt/__init__.py +0 -0
  173. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/prompt/generic/__init__.py +0 -0
  174. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/prompt/generic/__main__.py +0 -0
  175. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/prompt/generic/prompts.py +0 -0
  176. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/prompt/generic/service.py +0 -0
  177. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/prompt/template/__init__.py +0 -0
  178. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/prompt/template/__main__.py +0 -0
  179. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/prompt/template/prompt_manager.py +0 -0
  180. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/__init__.py +0 -0
  181. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/azure/__init__.py +0 -0
  182. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/azure/__main__.py +0 -0
  183. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/azure/llm.py +0 -0
  184. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
  185. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
  186. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
  187. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/claude/__init__.py +0 -0
  188. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/claude/__main__.py +0 -0
  189. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/claude/llm.py +0 -0
  190. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
  191. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
  192. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/cohere/llm.py +0 -0
  193. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
  194. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
  195. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
  196. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
  197. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
  198. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
  199. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/lmstudio/__init__.py +0 -0
  200. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/lmstudio/__main__.py +0 -0
  201. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/lmstudio/llm.py +0 -0
  202. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/mistral/__init__.py +0 -0
  203. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/mistral/__main__.py +0 -0
  204. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/mistral/llm.py +0 -0
  205. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
  206. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
  207. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/ollama/llm.py +0 -0
  208. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/openai/__init__.py +0 -0
  209. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/openai/__main__.py +0 -0
  210. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/model/text_completion/openai/llm.py +0 -0
  211. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/processing/__init__.py +0 -0
  212. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/processing/__main__.py +0 -0
  213. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/processing/processing.py +0 -0
  214. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/__init__.py +0 -0
  215. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/doc_embeddings/__init__.py +0 -0
  216. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
  217. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
  218. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
  219. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
  220. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
  221. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/doc_embeddings/pinecone/service.py +0 -0
  222. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
  223. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
  224. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
  225. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/graph_embeddings/__init__.py +0 -0
  226. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
  227. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
  228. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
  229. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
  230. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
  231. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/graph_embeddings/pinecone/service.py +0 -0
  232. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
  233. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
  234. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
  235. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/__init__.py +0 -0
  236. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/cassandra/__init__.py +0 -0
  237. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/cassandra/__main__.py +0 -0
  238. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/cassandra/service.py +0 -0
  239. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/falkordb/__init__.py +0 -0
  240. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/falkordb/__main__.py +0 -0
  241. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/falkordb/service.py +0 -0
  242. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/memgraph/__init__.py +0 -0
  243. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/memgraph/__main__.py +0 -0
  244. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/memgraph/service.py +0 -0
  245. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/neo4j/__init__.py +0 -0
  246. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/neo4j/__main__.py +0 -0
  247. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/query/triples/neo4j/service.py +0 -0
  248. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/retrieval/__init__.py +0 -0
  249. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/retrieval/document_rag/__init__.py +0 -0
  250. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/retrieval/document_rag/__main__.py +0 -0
  251. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/retrieval/document_rag/rag.py +0 -0
  252. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
  253. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
  254. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/retrieval/graph_rag/rag.py +0 -0
  255. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/__init__.py +0 -0
  256. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
  257. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
  258. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
  259. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
  260. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
  261. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
  262. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/doc_embeddings/pinecone/write.py +0 -0
  263. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
  264. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
  265. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
  266. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
  267. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
  268. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
  269. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
  270. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
  271. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
  272. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/graph_embeddings/pinecone/write.py +0 -0
  273. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
  274. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
  275. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
  276. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/object_embeddings/__init__.py +0 -0
  277. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
  278. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
  279. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
  280. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/rows/__init__.py +0 -0
  281. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
  282. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
  283. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/rows/cassandra/write.py +0 -0
  284. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/__init__.py +0 -0
  285. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
  286. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
  287. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/cassandra/write.py +0 -0
  288. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/falkordb/__init__.py +0 -0
  289. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/falkordb/__main__.py +0 -0
  290. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/falkordb/write.py +0 -0
  291. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/memgraph/__init__.py +0 -0
  292. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/memgraph/__main__.py +0 -0
  293. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/memgraph/write.py +0 -0
  294. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
  295. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
  296. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph/storage/triples/neo4j/write.py +0 -0
  297. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph_flow.egg-info/SOURCES.txt +0 -0
  298. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
  299. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph_flow.egg-info/requires.txt +0 -0
  300. {trustgraph-flow-0.22.1 → trustgraph-flow-0.22.3}/trustgraph_flow.egg-info/top_level.txt +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-flow
3
- Version: 0.22.1
3
+ Version: 0.22.3
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
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.22.1.tar.gz
6
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.22.3.tar.gz
7
7
  Author: trustgraph.ai
8
8
  Author-email: security@trustgraph.ai
9
9
  Classifier: Programming Language :: Python :: 3
@@ -85,19 +85,19 @@ class AgentManager:
85
85
 
86
86
  return a
87
87
 
88
- def react(self, question, history, think, observe):
88
+ async def react(self, question, history, think, observe):
89
89
 
90
90
  act = self.reason(question, history)
91
91
  logger.info(f"act: {act}")
92
92
 
93
93
  if isinstance(act, Final):
94
94
 
95
- think(act.thought)
95
+ await think(act.thought)
96
96
  return act
97
97
 
98
98
  else:
99
99
 
100
- think(act.thought)
100
+ await think(act.thought)
101
101
 
102
102
  if act.name in self.tools:
103
103
  action = self.tools[act.name]
@@ -110,7 +110,7 @@ class AgentManager:
110
110
 
111
111
  logger.info(f"resp: {resp}")
112
112
 
113
- observe(resp)
113
+ await observe(resp)
114
114
 
115
115
  act.observation = resp
116
116
 
@@ -36,92 +36,12 @@ class Processor(ConsumerProducer):
36
36
 
37
37
  def __init__(self, **params):
38
38
 
39
- additional = params.get("context", None)
40
-
41
- self.max_iterations = int(params.get("max_iterations", default_max_iterations))
39
+ self.max_iterations = int(
40
+ params.get("max_iterations", default_max_iterations)
41
+ )
42
42
 
43
43
  tools = {}
44
44
 
45
- # Parsing the prompt information to the prompt configuration
46
- # structure
47
- tool_type_arg = params.get("tool_type", [])
48
- if tool_type_arg:
49
- for t in tool_type_arg:
50
- toks = t.split("=", 1)
51
- if len(toks) < 2:
52
- raise RuntimeError(
53
- f"Tool-type string not well-formed: {t}"
54
- )
55
- ttoks = toks[1].split(":", 1)
56
- if len(ttoks) < 1:
57
- raise RuntimeError(
58
- f"Tool-type string not well-formed: {t}"
59
- )
60
-
61
- if ttoks[0] == "knowledge-query":
62
- impl = KnowledgeQueryImpl(self)
63
- elif ttoks[0] == "text-completion":
64
- impl = TextCompletionImpl(self)
65
- else:
66
- raise RuntimeError(
67
- f"Tool-kind {ttoks[0]} not known"
68
- )
69
-
70
- if len(ttoks) == 1:
71
-
72
- tools[toks[0]] = Tool(
73
- name = toks[0],
74
- description = "",
75
- implementation = impl,
76
- config = { "input": "query" },
77
- arguments = {},
78
- )
79
- else:
80
- tools[toks[0]] = Tool(
81
- name = toks[0],
82
- description = "",
83
- implementation = impl,
84
- config = { "input": ttoks[1] },
85
- arguments = {},
86
- )
87
-
88
- # parsing the prompt information to the prompt configuration
89
- # structure
90
- tool_desc_arg = params.get("tool_description", [])
91
- if tool_desc_arg:
92
- for t in tool_desc_arg:
93
- toks = t.split("=", 1)
94
- if len(toks) < 2:
95
- raise runtimeerror(
96
- f"tool-type string not well-formed: {t}"
97
- )
98
- if toks[0] not in tools:
99
- raise runtimeerror(f"description, tool {toks[0]} not known")
100
- tools[toks[0]].description = toks[1]
101
-
102
- # Parsing the prompt information to the prompt configuration
103
- # structure
104
- tool_arg_arg = params.get("tool_argument", [])
105
- if tool_arg_arg:
106
- for t in tool_arg_arg:
107
- toks = t.split("=", 1)
108
- if len(toks) < 2:
109
- raise RuntimeError(
110
- f"Tool-type string not well-formed: {t}"
111
- )
112
- ttoks = toks[1].split(":", 2)
113
- if len(ttoks) != 3:
114
- raise RuntimeError(
115
- f"Tool argument string not well-formed: {t}"
116
- )
117
- if toks[0] not in tools:
118
- raise RuntimeError(f"Description, tool {toks[0]} not known")
119
- tools[toks[0]].arguments[ttoks[0]] = Argument(
120
- name = ttoks[0],
121
- type = ttoks[1],
122
- description = ttoks[2]
123
- )
124
-
125
45
  input_queue = params.get("input_queue", default_input_queue)
126
46
  output_queue = params.get("output_queue", default_output_queue)
127
47
  subscriber = params.get("subscriber", default_subscriber)
@@ -138,6 +58,8 @@ class Processor(ConsumerProducer):
138
58
  "graph_rag_response_queue", gr_response_queue
139
59
  )
140
60
 
61
+ self.config_key = params.get("config_type", "agent")
62
+
141
63
  super(Processor, self).__init__(
142
64
  **params | {
143
65
  "input_queue": input_queue,
@@ -176,20 +98,74 @@ class Processor(ConsumerProducer):
176
98
 
177
99
  self.agent = AgentManager(
178
100
  context=self,
179
- tools=tools,
180
- additional_context=additional
101
+ tools=[],
102
+ additional_context="",
181
103
  )
182
104
 
183
- def parse_json(self, text):
184
- json_match = re.search(r'```(?:json)?(.*?)```', text, re.DOTALL)
185
-
186
- if json_match:
187
- json_str = json_match.group(1).strip()
188
- else:
189
- # If no delimiters, assume the entire output is JSON
190
- json_str = text.strip()
105
+ async def on_config(self, version, config):
106
+
107
+ print("Loading configuration version", version)
108
+
109
+ if self.config_key not in config:
110
+ print(f"No key {self.config_key} in config", flush=True)
111
+ return
112
+
113
+ config = config[self.config_key]
114
+
115
+ try:
116
+
117
+ # This is some extra stuff to put in the prompt
118
+ additional = config.get("additional-context", None)
119
+
120
+ ix = json.loads(config["tool-index"])
191
121
 
192
- return json.loads(json_str)
122
+ tools = {}
123
+
124
+ for k in ix:
125
+
126
+ pc = config[f"tool.{k}"]
127
+ data = json.loads(pc)
128
+
129
+ arguments = {
130
+ v.get("name"): Argument(
131
+ name = v.get("name"),
132
+ type = v.get("type"),
133
+ description = v.get("description")
134
+ )
135
+ for v in data["arguments"]
136
+ }
137
+
138
+ impl_id = data.get("type")
139
+
140
+ if impl_id == "knowledge-query":
141
+ impl = KnowledgeQueryImpl(self)
142
+ elif impl_id == "text-completion":
143
+ impl = TextCompletionImpl(self)
144
+ else:
145
+ raise RuntimeError(
146
+ f"Tool-kind {impl_id} not known"
147
+ )
148
+
149
+ tools[data.get("name")] = Tool(
150
+ name = data.get("name"),
151
+ description = data.get("description"),
152
+ implementation = impl,
153
+ config=data.get("config", {}),
154
+ arguments = arguments,
155
+ )
156
+
157
+ self.agent = AgentManager(
158
+ context=self,
159
+ tools=tools,
160
+ additional_context=additional
161
+ )
162
+
163
+ print("Prompt configuration reloaded.", flush=True)
164
+
165
+ except Exception as e:
166
+
167
+ print("Exception:", e, flush=True)
168
+ print("Configuration reload failed", flush=True)
193
169
 
194
170
  async def handle(self, msg):
195
171
 
@@ -246,7 +222,7 @@ class Processor(ConsumerProducer):
246
222
 
247
223
  await self.send(r, properties={"id": id})
248
224
 
249
- act = self.agent.react(v.question, history, think, observe)
225
+ act = await self.agent.react(v.question, history, think, observe)
250
226
 
251
227
  print(f"Action: {act}", flush=True)
252
228
 
@@ -337,46 +313,18 @@ class Processor(ConsumerProducer):
337
313
  help=f'Graph RAG response queue (default: {gr_response_queue})',
338
314
  )
339
315
 
340
- parser.add_argument(
341
- '--tool-type', nargs='*',
342
- help=f'''Specifies the type of an agent tool. Takes the form
343
- <id>=<specifier>. <id> is the name of the tool. <specifier> is one of
344
- knowledge-query, text-completion. Additional parameters are specified
345
- for different tools which are tool-specific. e.g. knowledge-query:<arg>
346
- which specifies the name of the arg whose content is fed into the knowledge
347
- query as a question. text-completion:<arg> specifies the name of the arg
348
- whose content is fed into the text-completion service as a prompt'''
349
- )
350
-
351
- parser.add_argument(
352
- '--tool-description', nargs='*',
353
- help=f'''Specifies the textual description of a tool. Takes
354
- the form <id>=<description>. The description is important, it teaches the
355
- LLM how to use the tool. It should describe what it does and how to
356
- use the arguments. This is specified in natural language.'''
357
- )
358
-
359
- parser.add_argument(
360
- '--tool-argument', nargs='*',
361
- help=f'''Specifies argument usage for a tool. Takes
362
- the form <id>=<arg>:<type>:<description>. The description is important,
363
- it is read by the LLM and used to determine how to use the argument.
364
- <id> can be specified multiple times to give a tool multiple arguments.
365
- <type> is one of string, number. <description> is a natural language
366
- description.'''
367
- )
368
-
369
- parser.add_argument(
370
- '--context',
371
- help=f'Optional, specifies additional context text for the LLM.'
372
- )
373
-
374
316
  parser.add_argument(
375
317
  '--max-iterations',
376
318
  default=default_max_iterations,
377
319
  help=f'Maximum number of react iterations (default: {default_max_iterations})',
378
320
  )
379
321
 
322
+ parser.add_argument(
323
+ '--config-type',
324
+ default="agent",
325
+ help=f'Configuration key for prompts (default: agent)',
326
+ )
327
+
380
328
  def run():
381
329
 
382
330
  Processor.launch(module, __doc__)
@@ -5,7 +5,7 @@ class KnowledgeQueryImpl:
5
5
  def __init__(self, context):
6
6
  self.context = context
7
7
  def invoke(self, **arguments):
8
- return self.context.graph_rag.request(arguments.get("query"))
8
+ return self.context.graph_rag.request(arguments.get("question"))
9
9
 
10
10
  # This tool implementation knows how to do text completion. This uses
11
11
  # the prompt service, rather than talking to TextCompletion directly.
@@ -80,7 +80,7 @@ class Processor(ConsumerProducer):
80
80
  directory = None,
81
81
  config = None,
82
82
  error = Error(
83
- code = "key-error",
83
+ type = "key-error",
84
84
  message = f"Key error"
85
85
  )
86
86
  )
@@ -112,8 +112,8 @@ class Processor(ConsumerProducer):
112
112
  directory = None,
113
113
  config = None,
114
114
  error = Error(
115
- code="key-error",
116
- message="No such type",
115
+ type = "key-error",
116
+ message = "No such type",
117
117
  ),
118
118
  )
119
119
 
@@ -135,7 +135,7 @@ class Processor(ConsumerProducer):
135
135
  directory = None,
136
136
  config = None,
137
137
  error = Error(
138
- code = "key-error",
138
+ type = "key-error",
139
139
  message = f"Key error"
140
140
  )
141
141
  )
@@ -167,7 +167,7 @@ class Processor(ConsumerProducer):
167
167
  directory = None,
168
168
  config = None,
169
169
  error = Error(
170
- code = "key-error",
170
+ type = "key-error",
171
171
  message = f"Key error"
172
172
  )
173
173
  )
@@ -271,8 +271,8 @@ class Processor(ConsumerProducer):
271
271
  directory=None,
272
272
  values=None,
273
273
  error=Error(
274
- code="bad-operation",
275
- message="Bad operation"
274
+ type = "bad-operation",
275
+ message = "Bad operation"
276
276
  )
277
277
  )
278
278
 
@@ -0,0 +1 @@
1
+ __version__ = "0.22.3"
@@ -28,82 +28,6 @@ class Processor(ConsumerProducer):
28
28
 
29
29
  def __init__(self, **params):
30
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
31
  input_queue = params.get("input_queue", default_input_queue)
108
32
  output_queue = params.get("output_queue", default_output_queue)
109
33
  subscriber = params.get("subscriber", default_subscriber)
@@ -113,12 +37,8 @@ class Processor(ConsumerProducer):
113
37
  tc_response_queue = params.get(
114
38
  "text_completion_response_queue", text_completion_response_queue
115
39
  )
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")
40
+
41
+ self.config_key = params.get("config_type", "prompt")
122
42
 
123
43
  super(Processor, self).__init__(
124
44
  **params | {
@@ -151,11 +71,61 @@ class Processor(ConsumerProducer):
151
71
 
152
72
  self.llm = Llm(self.llm)
153
73
 
74
+ # Null configuration, should reload quickly
154
75
  self.manager = PromptManager(
155
76
  llm = self.llm,
156
- config = prompt_configuration,
77
+ config = PromptConfiguration("", {}, {})
157
78
  )
158
79
 
80
+ async def on_config(self, version, config):
81
+
82
+ print("Loading configuration version", version)
83
+
84
+ if self.config_key not in config:
85
+ print(f"No key {self.config_key} in config", flush=True)
86
+ return
87
+
88
+ config = config[self.config_key]
89
+
90
+ try:
91
+
92
+ system = json.loads(config["system"])
93
+ ix = json.loads(config["template-index"])
94
+
95
+ prompts = {}
96
+
97
+ for k in ix:
98
+
99
+ pc = config[f"template.{k}"]
100
+ data = json.loads(pc)
101
+
102
+ prompt = data.get("prompt")
103
+ rtype = data.get("response-type", "text")
104
+ schema = data.get("schema", None)
105
+
106
+ prompts[k] = Prompt(
107
+ template = prompt,
108
+ response_type = rtype,
109
+ schema = schema,
110
+ terms = {}
111
+ )
112
+
113
+ self.manager = PromptManager(
114
+ self.llm,
115
+ PromptConfiguration(
116
+ system,
117
+ {},
118
+ prompts
119
+ )
120
+ )
121
+
122
+ print("Prompt configuration reloaded.", flush=True)
123
+
124
+ except Exception as e:
125
+
126
+ print("Exception:", e, flush=True)
127
+ print("Configuration reload failed", flush=True)
128
+
159
129
  async def handle(self, msg):
160
130
 
161
131
  v = msg.value()
@@ -263,33 +233,9 @@ class Processor(ConsumerProducer):
263
233
  )
264
234
 
265
235
  parser.add_argument(
266
- '--prompt', nargs='*',
267
- help=f'Prompt template form id=template',
268
- )
269
-
270
- parser.add_argument(
271
- '--prompt-response-type', nargs='*',
272
- help=f'Prompt response type, form id=json|text',
273
- )
274
-
275
- parser.add_argument(
276
- '--prompt-term', nargs='*',
277
- help=f'Prompt response type, form id=key:value',
278
- )
279
-
280
- parser.add_argument(
281
- '--prompt-schema', nargs='*',
282
- help=f'Prompt response schema, form id=schema',
283
- )
284
-
285
- parser.add_argument(
286
- '--system-prompt',
287
- help=f'System prompt template',
288
- )
289
-
290
- parser.add_argument(
291
- '--global-term', nargs='+',
292
- help=f'Global term, form key:value'
236
+ '--config-type',
237
+ default="prompt",
238
+ help=f'Configuration key for prompts (default: prompt)',
293
239
  )
294
240
 
295
241
  def run():
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-flow
3
- Version: 0.22.1
3
+ Version: 0.22.3
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
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.22.1.tar.gz
6
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.22.3.tar.gz
7
7
  Author: trustgraph.ai
8
8
  Author-email: security@trustgraph.ai
9
9
  Classifier: Programming Language :: Python :: 3
@@ -1 +0,0 @@
1
- __version__ = "0.22.1"