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