trustgraph-flow 0.22.4__tar.gz → 0.22.6__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.
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/PKG-INFO +2 -2
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/agent/react/agent_manager.py +15 -10
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/agent/react/service.py +62 -122
- trustgraph-flow-0.22.6/trustgraph/agent/react/tools.py +25 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/chunking/recursive/chunker.py +33 -28
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/chunking/token/chunker.py +33 -28
- trustgraph-flow-0.22.6/trustgraph/config/service/config.py +215 -0
- trustgraph-flow-0.22.6/trustgraph/config/service/service.py +152 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/decoding/mistral_ocr/processor.py +8 -15
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/decoding/pdf/pdf_decoder.py +28 -26
- trustgraph-flow-0.22.6/trustgraph/embeddings/document_embeddings/embeddings.py +97 -0
- trustgraph-flow-0.22.6/trustgraph/embeddings/fastembed/processor.py +51 -0
- trustgraph-flow-0.22.6/trustgraph/embeddings/graph_embeddings/embeddings.py +95 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/embeddings/ollama/processor.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/external/wikipedia/service.py +1 -1
- trustgraph-flow-0.22.6/trustgraph/extract/kg/definitions/extract.py +198 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/kg/relationships/extract.py +57 -65
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/kg/topics/extract.py +1 -1
- trustgraph-flow-0.22.6/trustgraph/flow_version.py +1 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/agent.py +0 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/document_embeddings_load.py +3 -4
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/document_embeddings_stream.py +5 -6
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/endpoint.py +0 -4
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/graph_embeddings_load.py +3 -4
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/graph_embeddings_stream.py +5 -6
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/metrics.py +0 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/mux.py +0 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/requestor.py +9 -13
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/sender.py +3 -6
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/service.py +1 -2
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/triples_load.py +3 -4
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/triples_stream.py +2 -3
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/librarian/service.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/metering/counter.py +1 -2
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/prompt/generic/service.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/prompt/template/prompt_manager.py +7 -10
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/prompt/template/service.py +61 -72
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/azure/llm.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/azure_openai/llm.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/claude/llm.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/cohere/llm.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/googleaistudio/llm.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/llamafile/llm.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/lmstudio/llm.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/mistral/llm.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/ollama/llm.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/openai/llm.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/doc_embeddings/milvus/service.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/doc_embeddings/pinecone/service.py +1 -1
- trustgraph-flow-0.22.6/trustgraph/query/doc_embeddings/qdrant/service.py +89 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/graph_embeddings/milvus/service.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/graph_embeddings/pinecone/service.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/graph_embeddings/qdrant/service.py +18 -54
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/cassandra/service.py +40 -81
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/falkordb/service.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/memgraph/service.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/neo4j/service.py +1 -1
- trustgraph-flow-0.22.6/trustgraph/retrieval/document_rag/document_rag.py +94 -0
- trustgraph-flow-0.22.6/trustgraph/retrieval/document_rag/rag.py +135 -0
- trustgraph-flow-0.22.6/trustgraph/retrieval/graph_rag/graph_rag.py +218 -0
- trustgraph-flow-0.22.6/trustgraph/retrieval/graph_rag/rag.py +193 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/doc_embeddings/milvus/write.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/doc_embeddings/pinecone/write.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/doc_embeddings/qdrant/write.py +13 -26
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/graph_embeddings/milvus/write.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/graph_embeddings/pinecone/write.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/graph_embeddings/qdrant/write.py +12 -26
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/object_embeddings/milvus/write.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/rows/cassandra/write.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/cassandra/write.py +15 -26
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/falkordb/write.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/memgraph/write.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/neo4j/write.py +1 -1
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph_flow.egg-info/PKG-INFO +2 -2
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph_flow.egg-info/SOURCES.txt +3 -2
- trustgraph-flow-0.22.4/trustgraph/agent/react/tools.py +0 -19
- trustgraph-flow-0.22.4/trustgraph/config/service/service.py +0 -312
- trustgraph-flow-0.22.4/trustgraph/document_rag.py +0 -153
- trustgraph-flow-0.22.4/trustgraph/embeddings/document_embeddings/embeddings.py +0 -110
- trustgraph-flow-0.22.4/trustgraph/embeddings/fastembed/processor.py +0 -89
- trustgraph-flow-0.22.4/trustgraph/embeddings/graph_embeddings/embeddings.py +0 -113
- trustgraph-flow-0.22.4/trustgraph/extract/kg/definitions/extract.py +0 -229
- trustgraph-flow-0.22.4/trustgraph/flow_version.py +0 -1
- trustgraph-flow-0.22.4/trustgraph/graph_rag.py +0 -295
- trustgraph-flow-0.22.4/trustgraph/query/doc_embeddings/qdrant/service.py +0 -129
- trustgraph-flow-0.22.4/trustgraph/retrieval/document_rag/rag.py +0 -182
- trustgraph-flow-0.22.4/trustgraph/retrieval/graph_rag/rag.py +0 -255
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/README.md +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/agent-manager-react +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/api-gateway +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/chunker-recursive +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/chunker-token +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/config-svc +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/de-query-milvus +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/de-query-pinecone +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/de-query-qdrant +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/de-write-milvus +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/de-write-pinecone +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/de-write-qdrant +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/document-embeddings +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/document-rag +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/embeddings-fastembed +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/embeddings-ollama +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/ge-query-milvus +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/ge-query-pinecone +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/ge-query-qdrant +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/ge-write-milvus +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/ge-write-pinecone +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/ge-write-qdrant +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/graph-embeddings +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/graph-rag +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/kg-extract-definitions +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/kg-extract-relationships +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/kg-extract-topics +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/librarian +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/metering +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/object-extract-row +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/oe-write-milvus +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/pdf-decoder +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/pdf-ocr-mistral +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/prompt-generic +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/prompt-template +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/rows-write-cassandra +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/run-processing +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/text-completion-azure +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/text-completion-azure-openai +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/text-completion-claude +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/text-completion-cohere +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/text-completion-googleaistudio +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/text-completion-llamafile +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/text-completion-lmstudio +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/text-completion-mistral +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/text-completion-ollama +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/text-completion-openai +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/triples-query-cassandra +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/triples-query-falkordb +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/triples-query-memgraph +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/triples-query-neo4j +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/triples-write-cassandra +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/triples-write-falkordb +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/triples-write-memgraph +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/triples-write-neo4j +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/scripts/wikipedia-lookup +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/setup.cfg +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/setup.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/agent/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/agent/react/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/agent/react/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/agent/react/types.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/chunking/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/chunking/recursive/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/chunking/recursive/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/chunking/token/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/chunking/token/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/config/service/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/config/service/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/decoding/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/decoding/mistral_ocr/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/decoding/mistral_ocr/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/decoding/pdf/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/decoding/pdf/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/direct/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/direct/cassandra.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/direct/milvus_object_embeddings.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/embeddings/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/embeddings/document_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/embeddings/document_embeddings/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/embeddings/fastembed/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/embeddings/fastembed/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/embeddings/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/embeddings/graph_embeddings/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/embeddings/ollama/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/embeddings/ollama/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/external/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/external/wikipedia/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/external/wikipedia/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/kg/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/kg/definitions/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/kg/definitions/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/kg/relationships/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/kg/relationships/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/kg/topics/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/kg/topics/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/object/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/object/row/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/object/row/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/extract/object/row/extract.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/auth.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/config.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/dbpedia.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/document_load.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/document_rag.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/embeddings.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/encyclopedia.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/graph_embeddings_query.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/graph_rag.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/internet_search.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/librarian.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/prompt.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/running.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/serialize.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/socket.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/text_completion.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/text_load.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/gateway/triples_query.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/librarian/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/librarian/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/librarian/blob_store.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/librarian/librarian.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/librarian/table_store.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/metering/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/metering/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/metering/pricelist.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/prompt/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/prompt/generic/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/prompt/generic/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/prompt/generic/prompts.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/prompt/template/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/prompt/template/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/azure/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/azure/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/claude/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/claude/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/lmstudio/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/lmstudio/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/mistral/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/mistral/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/openai/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/model/text_completion/openai/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/processing/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/processing/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/processing/processing.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/falkordb/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/falkordb/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/memgraph/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/memgraph/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/query/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/retrieval/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/retrieval/document_rag/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/retrieval/document_rag/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/object_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/rows/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/falkordb/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/falkordb/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/memgraph/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/memgraph/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/trustgraph_flow.egg-info/requires.txt +0 -0
- {trustgraph-flow-0.22.4 → trustgraph-flow-0.22.6}/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.
|
3
|
+
Version: 0.22.6
|
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.
|
6
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.22.6.tar.gz
|
7
7
|
Author: trustgraph.ai
|
8
8
|
Author-email: security@trustgraph.ai
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
@@ -8,12 +8,11 @@ logger = logging.getLogger(__name__)
|
|
8
8
|
|
9
9
|
class AgentManager:
|
10
10
|
|
11
|
-
def __init__(self,
|
12
|
-
self.context = context
|
11
|
+
def __init__(self, tools, additional_context=None):
|
13
12
|
self.tools = tools
|
14
13
|
self.additional_context = additional_context
|
15
14
|
|
16
|
-
def reason(self, question, history):
|
15
|
+
async def reason(self, question, history, context):
|
17
16
|
|
18
17
|
tools = self.tools
|
19
18
|
|
@@ -56,10 +55,7 @@ class AgentManager:
|
|
56
55
|
|
57
56
|
logger.info(f"prompt: {variables}")
|
58
57
|
|
59
|
-
obj =
|
60
|
-
"agent-react",
|
61
|
-
variables
|
62
|
-
)
|
58
|
+
obj = await context("prompt-request").agent_react(variables)
|
63
59
|
|
64
60
|
print(json.dumps(obj, indent=4), flush=True)
|
65
61
|
|
@@ -85,9 +81,13 @@ class AgentManager:
|
|
85
81
|
|
86
82
|
return a
|
87
83
|
|
88
|
-
async def react(self, question, history, think, observe):
|
84
|
+
async def react(self, question, history, think, observe, context):
|
89
85
|
|
90
|
-
act = self.reason(
|
86
|
+
act = await self.reason(
|
87
|
+
question = question,
|
88
|
+
history = history,
|
89
|
+
context = context,
|
90
|
+
)
|
91
91
|
logger.info(f"act: {act}")
|
92
92
|
|
93
93
|
if isinstance(act, Final):
|
@@ -104,7 +104,12 @@ class AgentManager:
|
|
104
104
|
else:
|
105
105
|
raise RuntimeError(f"No action for {act.name}!")
|
106
106
|
|
107
|
-
|
107
|
+
print("TOOL>>>", act)
|
108
|
+
resp = await action.implementation(context).invoke(
|
109
|
+
**act.arguments
|
110
|
+
)
|
111
|
+
|
112
|
+
print("RSETUL", resp)
|
108
113
|
|
109
114
|
resp = resp.strip()
|
110
115
|
|
@@ -6,103 +6,68 @@ import json
|
|
6
6
|
import re
|
7
7
|
import sys
|
8
8
|
|
9
|
-
from
|
10
|
-
|
11
|
-
|
12
|
-
from ... schema import Error
|
13
|
-
from ... schema import AgentRequest, AgentResponse, AgentStep
|
14
|
-
from ... schema import agent_request_queue, agent_response_queue
|
15
|
-
from ... schema import prompt_request_queue as pr_request_queue
|
16
|
-
from ... schema import prompt_response_queue as pr_response_queue
|
17
|
-
from ... schema import graph_rag_request_queue as gr_request_queue
|
18
|
-
from ... schema import graph_rag_response_queue as gr_response_queue
|
19
|
-
from ... clients.prompt_client import PromptClient
|
20
|
-
from ... clients.llm_client import LlmClient
|
21
|
-
from ... clients.graph_rag_client import GraphRagClient
|
9
|
+
from ... base import AgentService, TextCompletionClientSpec, PromptClientSpec
|
10
|
+
from ... base import GraphRagClientSpec
|
11
|
+
|
12
|
+
from ... schema import AgentRequest, AgentResponse, AgentStep, Error
|
22
13
|
|
23
14
|
from . tools import KnowledgeQueryImpl, TextCompletionImpl
|
24
15
|
from . agent_manager import AgentManager
|
25
16
|
|
26
17
|
from . types import Final, Action, Tool, Argument
|
27
18
|
|
28
|
-
|
29
|
-
|
30
|
-
default_input_queue = agent_request_queue
|
31
|
-
default_output_queue = agent_response_queue
|
32
|
-
default_subscriber = module
|
33
|
-
default_max_iterations = 15
|
19
|
+
default_ident = "agent-manager"
|
20
|
+
default_max_iterations = 10
|
34
21
|
|
35
|
-
class Processor(
|
22
|
+
class Processor(AgentService):
|
36
23
|
|
37
24
|
def __init__(self, **params):
|
38
25
|
|
26
|
+
id = params.get("id")
|
27
|
+
|
39
28
|
self.max_iterations = int(
|
40
29
|
params.get("max_iterations", default_max_iterations)
|
41
30
|
)
|
42
31
|
|
43
|
-
tools = {}
|
44
|
-
|
45
|
-
input_queue = params.get("input_queue", default_input_queue)
|
46
|
-
output_queue = params.get("output_queue", default_output_queue)
|
47
|
-
subscriber = params.get("subscriber", default_subscriber)
|
48
|
-
prompt_request_queue = params.get(
|
49
|
-
"prompt_request_queue", pr_request_queue
|
50
|
-
)
|
51
|
-
prompt_response_queue = params.get(
|
52
|
-
"prompt_response_queue", pr_response_queue
|
53
|
-
)
|
54
|
-
graph_rag_request_queue = params.get(
|
55
|
-
"graph_rag_request_queue", gr_request_queue
|
56
|
-
)
|
57
|
-
graph_rag_response_queue = params.get(
|
58
|
-
"graph_rag_response_queue", gr_response_queue
|
59
|
-
)
|
60
|
-
|
61
32
|
self.config_key = params.get("config_type", "agent")
|
62
33
|
|
63
34
|
super(Processor, self).__init__(
|
64
35
|
**params | {
|
65
|
-
"
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"input_schema": AgentRequest,
|
69
|
-
"output_schema": AgentResponse,
|
70
|
-
"prompt_request_queue": prompt_request_queue,
|
71
|
-
"prompt_response_queue": prompt_response_queue,
|
72
|
-
"graph_rag_request_queue": gr_request_queue,
|
73
|
-
"graph_rag_response_queue": gr_response_queue,
|
36
|
+
"id": id,
|
37
|
+
"max_iterations": self.max_iterations,
|
38
|
+
"config_type": self.config_key,
|
74
39
|
}
|
75
40
|
)
|
76
41
|
|
77
|
-
self.
|
78
|
-
|
79
|
-
|
80
|
-
output_queue=prompt_response_queue,
|
81
|
-
pulsar_host = self.pulsar_host,
|
82
|
-
pulsar_api_key=self.pulsar_api_key,
|
42
|
+
self.agent = AgentManager(
|
43
|
+
tools=[],
|
44
|
+
additional_context="",
|
83
45
|
)
|
84
46
|
|
85
|
-
self.
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
47
|
+
self.config_handlers.append(self.on_tools_config)
|
48
|
+
|
49
|
+
self.register_specification(
|
50
|
+
TextCompletionClientSpec(
|
51
|
+
request_name = "text-completion-request",
|
52
|
+
response_name = "text-completion-response",
|
53
|
+
)
|
91
54
|
)
|
92
55
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
56
|
+
self.register_specification(
|
57
|
+
GraphRagClientSpec(
|
58
|
+
request_name = "graph-rag-request",
|
59
|
+
response_name = "graph-rag-response",
|
60
|
+
)
|
97
61
|
)
|
98
62
|
|
99
|
-
self.
|
100
|
-
|
101
|
-
|
102
|
-
|
63
|
+
self.register_specification(
|
64
|
+
PromptClientSpec(
|
65
|
+
request_name = "prompt-request",
|
66
|
+
response_name = "prompt-response",
|
67
|
+
)
|
103
68
|
)
|
104
69
|
|
105
|
-
async def
|
70
|
+
async def on_tools_config(self, config, version):
|
106
71
|
|
107
72
|
print("Loading configuration version", version)
|
108
73
|
|
@@ -138,9 +103,9 @@ class Processor(ConsumerProducer):
|
|
138
103
|
impl_id = data.get("type")
|
139
104
|
|
140
105
|
if impl_id == "knowledge-query":
|
141
|
-
impl = KnowledgeQueryImpl
|
106
|
+
impl = KnowledgeQueryImpl
|
142
107
|
elif impl_id == "text-completion":
|
143
|
-
impl = TextCompletionImpl
|
108
|
+
impl = TextCompletionImpl
|
144
109
|
else:
|
145
110
|
raise RuntimeError(
|
146
111
|
f"Tool-kind {impl_id} not known"
|
@@ -155,7 +120,6 @@ class Processor(ConsumerProducer):
|
|
155
120
|
)
|
156
121
|
|
157
122
|
self.agent = AgentManager(
|
158
|
-
context=self,
|
159
123
|
tools=tools,
|
160
124
|
additional_context=additional
|
161
125
|
)
|
@@ -164,19 +128,14 @@ class Processor(ConsumerProducer):
|
|
164
128
|
|
165
129
|
except Exception as e:
|
166
130
|
|
167
|
-
print("Exception:", e, flush=True)
|
131
|
+
print("on_tools_config Exception:", e, flush=True)
|
168
132
|
print("Configuration reload failed", flush=True)
|
169
133
|
|
170
|
-
async def
|
134
|
+
async def agent_request(self, request, respond, next, flow):
|
171
135
|
|
172
136
|
try:
|
173
137
|
|
174
|
-
|
175
|
-
|
176
|
-
# Sender-produced ID
|
177
|
-
id = msg.properties()["id"]
|
178
|
-
|
179
|
-
if v.history:
|
138
|
+
if request.history:
|
180
139
|
history = [
|
181
140
|
Action(
|
182
141
|
thought=h.thought,
|
@@ -184,12 +143,12 @@ class Processor(ConsumerProducer):
|
|
184
143
|
arguments=h.arguments,
|
185
144
|
observation=h.observation
|
186
145
|
)
|
187
|
-
for h in
|
146
|
+
for h in request.history
|
188
147
|
]
|
189
148
|
else:
|
190
149
|
history = []
|
191
150
|
|
192
|
-
print(f"Question: {
|
151
|
+
print(f"Question: {request.question}", flush=True)
|
193
152
|
|
194
153
|
if len(history) >= self.max_iterations:
|
195
154
|
raise RuntimeError("Too many agent iterations")
|
@@ -207,7 +166,7 @@ class Processor(ConsumerProducer):
|
|
207
166
|
observation=None,
|
208
167
|
)
|
209
168
|
|
210
|
-
await
|
169
|
+
await respond(r)
|
211
170
|
|
212
171
|
async def observe(x):
|
213
172
|
|
@@ -220,15 +179,21 @@ class Processor(ConsumerProducer):
|
|
220
179
|
observation=x,
|
221
180
|
)
|
222
181
|
|
223
|
-
await
|
182
|
+
await respond(r)
|
224
183
|
|
225
|
-
act = await self.agent.react(
|
184
|
+
act = await self.agent.react(
|
185
|
+
question = request.question,
|
186
|
+
history = history,
|
187
|
+
think = think,
|
188
|
+
observe = observe,
|
189
|
+
context = flow,
|
190
|
+
)
|
226
191
|
|
227
192
|
print(f"Action: {act}", flush=True)
|
228
193
|
|
229
|
-
|
194
|
+
if isinstance(act, Final):
|
230
195
|
|
231
|
-
|
196
|
+
print("Send final response...", flush=True)
|
232
197
|
|
233
198
|
r = AgentResponse(
|
234
199
|
answer=act.final,
|
@@ -236,18 +201,20 @@ class Processor(ConsumerProducer):
|
|
236
201
|
thought=None,
|
237
202
|
)
|
238
203
|
|
239
|
-
await
|
204
|
+
await respond(r)
|
240
205
|
|
241
206
|
print("Done.", flush=True)
|
242
207
|
|
243
208
|
return
|
244
209
|
|
210
|
+
print("Send next...", flush=True)
|
211
|
+
|
245
212
|
history.append(act)
|
246
213
|
|
247
214
|
r = AgentRequest(
|
248
|
-
question=
|
249
|
-
plan=
|
250
|
-
state=
|
215
|
+
question=request.question,
|
216
|
+
plan=request.plan,
|
217
|
+
state=request.state,
|
251
218
|
history=[
|
252
219
|
AgentStep(
|
253
220
|
thought=h.thought,
|
@@ -259,7 +226,7 @@ class Processor(ConsumerProducer):
|
|
259
226
|
]
|
260
227
|
)
|
261
228
|
|
262
|
-
|
229
|
+
await next(r)
|
263
230
|
|
264
231
|
print("Done.", flush=True)
|
265
232
|
|
@@ -267,7 +234,7 @@ class Processor(ConsumerProducer):
|
|
267
234
|
|
268
235
|
except Exception as e:
|
269
236
|
|
270
|
-
print(f"Exception: {e}")
|
237
|
+
print(f"agent_request Exception: {e}")
|
271
238
|
|
272
239
|
print("Send error response...", flush=True)
|
273
240
|
|
@@ -279,39 +246,12 @@ class Processor(ConsumerProducer):
|
|
279
246
|
response=None,
|
280
247
|
)
|
281
248
|
|
282
|
-
await
|
249
|
+
await respond(r)
|
283
250
|
|
284
251
|
@staticmethod
|
285
252
|
def add_args(parser):
|
286
253
|
|
287
|
-
|
288
|
-
parser, default_input_queue, default_subscriber,
|
289
|
-
default_output_queue,
|
290
|
-
)
|
291
|
-
|
292
|
-
parser.add_argument(
|
293
|
-
'--prompt-request-queue',
|
294
|
-
default=pr_request_queue,
|
295
|
-
help=f'Prompt request queue (default: {pr_request_queue})',
|
296
|
-
)
|
297
|
-
|
298
|
-
parser.add_argument(
|
299
|
-
'--prompt-response-queue',
|
300
|
-
default=pr_response_queue,
|
301
|
-
help=f'Prompt response queue (default: {pr_response_queue})',
|
302
|
-
)
|
303
|
-
|
304
|
-
parser.add_argument(
|
305
|
-
'--graph-rag-request-queue',
|
306
|
-
default=gr_request_queue,
|
307
|
-
help=f'Graph RAG request queue (default: {gr_request_queue})',
|
308
|
-
)
|
309
|
-
|
310
|
-
parser.add_argument(
|
311
|
-
'--graph-rag-response-queue',
|
312
|
-
default=gr_response_queue,
|
313
|
-
help=f'Graph RAG response queue (default: {gr_response_queue})',
|
314
|
-
)
|
254
|
+
AgentService.add_args(parser)
|
315
255
|
|
316
256
|
parser.add_argument(
|
317
257
|
'--max-iterations',
|
@@ -327,5 +267,5 @@ class Processor(ConsumerProducer):
|
|
327
267
|
|
328
268
|
def run():
|
329
269
|
|
330
|
-
Processor.launch(
|
270
|
+
Processor.launch(default_ident, __doc__)
|
331
271
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
# This tool implementation knows how to put a question to the graph RAG
|
3
|
+
# service
|
4
|
+
class KnowledgeQueryImpl:
|
5
|
+
def __init__(self, context):
|
6
|
+
self.context = context
|
7
|
+
async def invoke(self, **arguments):
|
8
|
+
client = self.context("graph-rag-request")
|
9
|
+
print("Graph RAG question...", flush=True)
|
10
|
+
return await client.rag(
|
11
|
+
arguments.get("question")
|
12
|
+
)
|
13
|
+
|
14
|
+
# This tool implementation knows how to do text completion. This uses
|
15
|
+
# the prompt service, rather than talking to TextCompletion directly.
|
16
|
+
class TextCompletionImpl:
|
17
|
+
def __init__(self, context):
|
18
|
+
self.context = context
|
19
|
+
async def invoke(self, **arguments):
|
20
|
+
client = self.context("prompt-request")
|
21
|
+
print("Prompt question...", flush=True)
|
22
|
+
return await client.question(
|
23
|
+
arguments.get("question")
|
24
|
+
)
|
25
|
+
|
@@ -7,40 +7,27 @@ as text as separate output objects.
|
|
7
7
|
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
8
8
|
from prometheus_client import Histogram
|
9
9
|
|
10
|
-
from ... schema import TextDocument, Chunk
|
11
|
-
from ...
|
12
|
-
from ... log_level import LogLevel
|
13
|
-
from ... base import ConsumerProducer
|
10
|
+
from ... schema import TextDocument, Chunk
|
11
|
+
from ... base import FlowProcessor, ConsumerSpec, ProducerSpec
|
14
12
|
|
15
|
-
|
13
|
+
default_ident = "chunker"
|
16
14
|
|
17
|
-
|
18
|
-
default_output_queue = chunk_ingest_queue
|
19
|
-
default_subscriber = module
|
20
|
-
|
21
|
-
class Processor(ConsumerProducer):
|
15
|
+
class Processor(FlowProcessor):
|
22
16
|
|
23
17
|
def __init__(self, **params):
|
24
18
|
|
25
|
-
|
26
|
-
output_queue = params.get("output_queue", default_output_queue)
|
27
|
-
subscriber = params.get("subscriber", default_subscriber)
|
19
|
+
id = params.get("id", default_ident)
|
28
20
|
chunk_size = params.get("chunk_size", 2000)
|
29
21
|
chunk_overlap = params.get("chunk_overlap", 100)
|
30
22
|
|
31
23
|
super(Processor, self).__init__(
|
32
|
-
**params | {
|
33
|
-
"input_queue": input_queue,
|
34
|
-
"output_queue": output_queue,
|
35
|
-
"subscriber": subscriber,
|
36
|
-
"input_schema": TextDocument,
|
37
|
-
"output_schema": Chunk,
|
38
|
-
}
|
24
|
+
**params | { "id": id }
|
39
25
|
)
|
40
26
|
|
41
27
|
if not hasattr(__class__, "chunk_metric"):
|
42
28
|
__class__.chunk_metric = Histogram(
|
43
29
|
'chunk_size', 'Chunk size',
|
30
|
+
["id", "flow"],
|
44
31
|
buckets=[100, 160, 250, 400, 650, 1000, 1600,
|
45
32
|
2500, 4000, 6400, 10000, 16000]
|
46
33
|
)
|
@@ -52,7 +39,24 @@ class Processor(ConsumerProducer):
|
|
52
39
|
is_separator_regex=False,
|
53
40
|
)
|
54
41
|
|
55
|
-
|
42
|
+
self.register_specification(
|
43
|
+
ConsumerSpec(
|
44
|
+
name = "input",
|
45
|
+
schema = TextDocument,
|
46
|
+
handler = self.on_message,
|
47
|
+
)
|
48
|
+
)
|
49
|
+
|
50
|
+
self.register_specification(
|
51
|
+
ProducerSpec(
|
52
|
+
name = "output",
|
53
|
+
schema = Chunk,
|
54
|
+
)
|
55
|
+
)
|
56
|
+
|
57
|
+
print("Chunker initialised", flush=True)
|
58
|
+
|
59
|
+
async def on_message(self, msg, consumer, flow):
|
56
60
|
|
57
61
|
v = msg.value()
|
58
62
|
print(f"Chunking {v.metadata.id}...", flush=True)
|
@@ -63,24 +67,25 @@ class Processor(ConsumerProducer):
|
|
63
67
|
|
64
68
|
for ix, chunk in enumerate(texts):
|
65
69
|
|
70
|
+
print("Chunk", len(chunk.page_content), flush=True)
|
71
|
+
|
66
72
|
r = Chunk(
|
67
73
|
metadata=v.metadata,
|
68
74
|
chunk=chunk.page_content.encode("utf-8"),
|
69
75
|
)
|
70
76
|
|
71
|
-
__class__.chunk_metric.
|
77
|
+
__class__.chunk_metric.labels(
|
78
|
+
id=consumer.id, flow=consumer.flow
|
79
|
+
).observe(len(chunk.page_content))
|
72
80
|
|
73
|
-
await
|
81
|
+
await flow("output").send(r)
|
74
82
|
|
75
83
|
print("Done.", flush=True)
|
76
84
|
|
77
85
|
@staticmethod
|
78
86
|
def add_args(parser):
|
79
87
|
|
80
|
-
|
81
|
-
parser, default_input_queue, default_subscriber,
|
82
|
-
default_output_queue,
|
83
|
-
)
|
88
|
+
FlowProcessor.add_args(parser)
|
84
89
|
|
85
90
|
parser.add_argument(
|
86
91
|
'-z', '--chunk-size',
|
@@ -98,5 +103,5 @@ class Processor(ConsumerProducer):
|
|
98
103
|
|
99
104
|
def run():
|
100
105
|
|
101
|
-
Processor.launch(
|
106
|
+
Processor.launch(default_ident, __doc__)
|
102
107
|
|
@@ -7,40 +7,27 @@ as text as separate output objects.
|
|
7
7
|
from langchain_text_splitters import TokenTextSplitter
|
8
8
|
from prometheus_client import Histogram
|
9
9
|
|
10
|
-
from ... schema import TextDocument, Chunk
|
11
|
-
from ...
|
12
|
-
from ... log_level import LogLevel
|
13
|
-
from ... base import ConsumerProducer
|
10
|
+
from ... schema import TextDocument, Chunk
|
11
|
+
from ... base import FlowProcessor
|
14
12
|
|
15
|
-
|
13
|
+
default_ident = "chunker"
|
16
14
|
|
17
|
-
|
18
|
-
default_output_queue = chunk_ingest_queue
|
19
|
-
default_subscriber = module
|
20
|
-
|
21
|
-
class Processor(ConsumerProducer):
|
15
|
+
class Processor(FlowProcessor):
|
22
16
|
|
23
17
|
def __init__(self, **params):
|
24
18
|
|
25
|
-
|
26
|
-
output_queue = params.get("output_queue", default_output_queue)
|
27
|
-
subscriber = params.get("subscriber", default_subscriber)
|
19
|
+
id = params.get("id")
|
28
20
|
chunk_size = params.get("chunk_size", 250)
|
29
21
|
chunk_overlap = params.get("chunk_overlap", 15)
|
30
22
|
|
31
23
|
super(Processor, self).__init__(
|
32
|
-
**params | {
|
33
|
-
"input_queue": input_queue,
|
34
|
-
"output_queue": output_queue,
|
35
|
-
"subscriber": subscriber,
|
36
|
-
"input_schema": TextDocument,
|
37
|
-
"output_schema": Chunk,
|
38
|
-
}
|
24
|
+
**params | { "id": id }
|
39
25
|
)
|
40
26
|
|
41
27
|
if not hasattr(__class__, "chunk_metric"):
|
42
28
|
__class__.chunk_metric = Histogram(
|
43
29
|
'chunk_size', 'Chunk size',
|
30
|
+
["id", "flow"],
|
44
31
|
buckets=[100, 160, 250, 400, 650, 1000, 1600,
|
45
32
|
2500, 4000, 6400, 10000, 16000]
|
46
33
|
)
|
@@ -51,7 +38,24 @@ class Processor(ConsumerProducer):
|
|
51
38
|
chunk_overlap=chunk_overlap,
|
52
39
|
)
|
53
40
|
|
54
|
-
|
41
|
+
self.register_specification(
|
42
|
+
ConsumerSpec(
|
43
|
+
name = "input",
|
44
|
+
schema = TextDocument,
|
45
|
+
handler = self.on_message,
|
46
|
+
)
|
47
|
+
)
|
48
|
+
|
49
|
+
self.register_specification(
|
50
|
+
ProducerSpec(
|
51
|
+
name = "output",
|
52
|
+
schema = Chunk,
|
53
|
+
)
|
54
|
+
)
|
55
|
+
|
56
|
+
print("Chunker initialised", flush=True)
|
57
|
+
|
58
|
+
async def on_message(self, msg, consumer, flow):
|
55
59
|
|
56
60
|
v = msg.value()
|
57
61
|
print(f"Chunking {v.metadata.id}...", flush=True)
|
@@ -62,24 +66,25 @@ class Processor(ConsumerProducer):
|
|
62
66
|
|
63
67
|
for ix, chunk in enumerate(texts):
|
64
68
|
|
69
|
+
print("Chunk", len(chunk.page_content), flush=True)
|
70
|
+
|
65
71
|
r = Chunk(
|
66
72
|
metadata=v.metadata,
|
67
73
|
chunk=chunk.page_content.encode("utf-8"),
|
68
74
|
)
|
69
75
|
|
70
|
-
__class__.chunk_metric.
|
76
|
+
__class__.chunk_metric.labels(
|
77
|
+
id=consumer.id, flow=consumer.flow
|
78
|
+
).observe(len(chunk.page_content))
|
71
79
|
|
72
|
-
await
|
80
|
+
await flow("output").send(r)
|
73
81
|
|
74
82
|
print("Done.", flush=True)
|
75
83
|
|
76
84
|
@staticmethod
|
77
85
|
def add_args(parser):
|
78
86
|
|
79
|
-
|
80
|
-
parser, default_input_queue, default_subscriber,
|
81
|
-
default_output_queue,
|
82
|
-
)
|
87
|
+
FlowProcessor.add_args(parser)
|
83
88
|
|
84
89
|
parser.add_argument(
|
85
90
|
'-z', '--chunk-size',
|
@@ -97,5 +102,5 @@ class Processor(ConsumerProducer):
|
|
97
102
|
|
98
103
|
def run():
|
99
104
|
|
100
|
-
Processor.launch(
|
105
|
+
Processor.launch(default_ident, __doc__)
|
101
106
|
|