trustgraph-flow 0.21.4__tar.gz → 0.21.5__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.21.4 → trustgraph-flow-0.21.5}/PKG-INFO +2 -2
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/document_rag.py +12 -7
- trustgraph-flow-0.21.5/trustgraph/flow_version.py +1 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/document_rag.py +1 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/graph_rag.py +4 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/graph_rag.py +73 -50
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/retrieval/document_rag/rag.py +17 -1
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/retrieval/graph_rag/rag.py +48 -13
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph_flow.egg-info/PKG-INFO +2 -2
- trustgraph-flow-0.21.4/trustgraph/flow_version.py +0 -1
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/README.md +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/agent-manager-react +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/api-gateway +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/chunker-recursive +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/chunker-token +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/de-query-milvus +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/de-query-pinecone +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/de-query-qdrant +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/de-write-milvus +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/de-write-pinecone +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/de-write-qdrant +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/document-embeddings +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/document-rag +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/embeddings-fastembed +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/embeddings-ollama +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/ge-query-milvus +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/ge-query-pinecone +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/ge-query-qdrant +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/ge-write-milvus +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/ge-write-pinecone +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/ge-write-qdrant +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/graph-embeddings +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/graph-rag +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/kg-extract-definitions +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/kg-extract-relationships +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/kg-extract-topics +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/librarian +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/metering +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/object-extract-row +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/oe-write-milvus +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/pdf-decoder +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/prompt-generic +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/prompt-template +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/rows-write-cassandra +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/run-processing +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/text-completion-azure +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/text-completion-azure-openai +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/text-completion-claude +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/text-completion-cohere +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/text-completion-googleaistudio +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/text-completion-llamafile +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/text-completion-ollama +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/text-completion-openai +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/triples-query-cassandra +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/triples-query-falkordb +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/triples-query-memgraph +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/triples-query-neo4j +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/triples-write-cassandra +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/triples-write-falkordb +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/triples-write-memgraph +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/triples-write-neo4j +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/scripts/wikipedia-lookup +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/setup.cfg +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/setup.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/agent/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/agent/react/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/agent/react/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/agent/react/agent_manager.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/agent/react/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/agent/react/tools.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/agent/react/types.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/chunking/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/chunking/recursive/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/chunking/recursive/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/chunking/recursive/chunker.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/chunking/token/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/chunking/token/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/chunking/token/chunker.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/decoding/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/decoding/pdf/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/decoding/pdf/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/direct/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/direct/cassandra.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/direct/milvus_object_embeddings.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/document_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/document_embeddings/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/document_embeddings/embeddings.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/fastembed/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/fastembed/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/fastembed/processor.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/graph_embeddings/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/graph_embeddings/embeddings.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/ollama/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/ollama/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/embeddings/ollama/processor.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/external/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/external/wikipedia/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/external/wikipedia/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/external/wikipedia/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/kg/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/kg/definitions/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/kg/definitions/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/kg/definitions/extract.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/kg/relationships/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/kg/relationships/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/kg/relationships/extract.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/kg/topics/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/kg/topics/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/kg/topics/extract.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/object/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/object/row/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/object/row/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/extract/object/row/extract.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/agent.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/auth.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/dbpedia.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/document_embeddings_load.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/document_embeddings_stream.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/document_load.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/embeddings.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/encyclopedia.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/endpoint.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/graph_embeddings_load.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/graph_embeddings_query.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/graph_embeddings_stream.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/internet_search.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/librarian.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/metrics.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/mux.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/prompt.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/requestor.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/running.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/sender.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/serialize.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/socket.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/text_completion.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/text_load.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/triples_load.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/triples_query.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/gateway/triples_stream.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/librarian/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/librarian/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/librarian/blob_store.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/librarian/librarian.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/librarian/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/librarian/table_store.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/metering/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/metering/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/metering/counter.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/metering/pricelist.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/prompt/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/prompt/generic/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/prompt/generic/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/prompt/generic/prompts.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/prompt/generic/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/prompt/template/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/prompt/template/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/prompt/template/prompt_manager.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/prompt/template/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/azure/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/azure/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/azure/llm.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/claude/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/claude/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/claude/llm.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/cohere/llm.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/ollama/llm.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/openai/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/openai/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/model/text_completion/openai/llm.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/processing/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/processing/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/processing/processing.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/doc_embeddings/pinecone/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/graph_embeddings/pinecone/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/cassandra/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/falkordb/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/falkordb/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/falkordb/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/memgraph/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/memgraph/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/memgraph/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/query/triples/neo4j/service.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/retrieval/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/retrieval/document_rag/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/retrieval/document_rag/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/doc_embeddings/pinecone/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/graph_embeddings/pinecone/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/object_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/rows/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/rows/cassandra/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/cassandra/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/falkordb/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/falkordb/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/falkordb/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/memgraph/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/memgraph/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/memgraph/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph/storage/triples/neo4j/write.py +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph_flow.egg-info/SOURCES.txt +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/trustgraph_flow.egg-info/requires.txt +0 -0
- {trustgraph-flow-0.21.4 → trustgraph-flow-0.21.5}/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.21.
|
3
|
+
Version: 0.21.5
|
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.21.
|
6
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.21.5.tar.gz
|
7
7
|
Author: trustgraph.ai
|
8
8
|
Author-email: security@trustgraph.ai
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
@@ -18,11 +18,15 @@ DEFINITION="http://www.w3.org/2004/02/skos/core#definition"
|
|
18
18
|
|
19
19
|
class Query:
|
20
20
|
|
21
|
-
def __init__(
|
21
|
+
def __init__(
|
22
|
+
self, rag, user, collection, verbose,
|
23
|
+
doc_limit=20
|
24
|
+
):
|
22
25
|
self.rag = rag
|
23
26
|
self.user = user
|
24
27
|
self.collection = collection
|
25
28
|
self.verbose = verbose
|
29
|
+
self.doc_limit = doc_limit
|
26
30
|
|
27
31
|
def get_vector(self, query):
|
28
32
|
|
@@ -44,7 +48,7 @@ class Query:
|
|
44
48
|
print("Get entities...", flush=True)
|
45
49
|
|
46
50
|
docs = self.rag.de_client.request(
|
47
|
-
vectors, limit=self.
|
51
|
+
vectors, limit=self.doc_limit
|
48
52
|
)
|
49
53
|
|
50
54
|
if self.verbose:
|
@@ -93,9 +97,6 @@ class DocumentRag:
|
|
93
97
|
if self.verbose:
|
94
98
|
print("Initialising...", flush=True)
|
95
99
|
|
96
|
-
# FIXME: Configurable
|
97
|
-
self.doc_limit = 20
|
98
|
-
|
99
100
|
self.de_client = DocumentEmbeddingsClient(
|
100
101
|
pulsar_host=pulsar_host,
|
101
102
|
subscriber=module + "-de",
|
@@ -123,13 +124,17 @@ class DocumentRag:
|
|
123
124
|
if self.verbose:
|
124
125
|
print("Initialised", flush=True)
|
125
126
|
|
126
|
-
def query(
|
127
|
+
def query(
|
128
|
+
self, query, user="trustgraph", collection="default",
|
129
|
+
doc_limit=20,
|
130
|
+
):
|
127
131
|
|
128
132
|
if self.verbose:
|
129
133
|
print("Construct prompt...", flush=True)
|
130
134
|
|
131
135
|
q = Query(
|
132
|
-
rag=self, user=user, collection=collection, verbose=self.verbose
|
136
|
+
rag=self, user=user, collection=collection, verbose=self.verbose,
|
137
|
+
doc_limit=doc_limit
|
133
138
|
)
|
134
139
|
|
135
140
|
docs = q.get_docs(query)
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.21.5"
|
@@ -23,6 +23,10 @@ class GraphRagRequestor(ServiceRequestor):
|
|
23
23
|
query=body["query"],
|
24
24
|
user=body.get("user", "trustgraph"),
|
25
25
|
collection=body.get("collection", "default"),
|
26
|
+
entity_limit=int(body.get("entity-limit", 50)),
|
27
|
+
triple_limit=int(body.get("triple-limit", 30)),
|
28
|
+
max_subgraph_size=int(body.get("max-subgraph-size", 1000)),
|
29
|
+
max_path_length=int(body.get("max-path-length", 2)),
|
26
30
|
)
|
27
31
|
|
28
32
|
def from_response(self, message):
|
@@ -20,11 +20,19 @@ DEFINITION="http://www.w3.org/2004/02/skos/core#definition"
|
|
20
20
|
|
21
21
|
class Query:
|
22
22
|
|
23
|
-
def __init__(
|
23
|
+
def __init__(
|
24
|
+
self, rag, user, collection, verbose,
|
25
|
+
entity_limit=50, triple_limit=30, max_subgraph_size=1000,
|
26
|
+
max_path_length=2,
|
27
|
+
):
|
24
28
|
self.rag = rag
|
25
29
|
self.user = user
|
26
30
|
self.collection = collection
|
27
31
|
self.verbose = verbose
|
32
|
+
self.entity_limit = entity_limit
|
33
|
+
self.triple_limit = triple_limit
|
34
|
+
self.max_subgraph_size = max_subgraph_size
|
35
|
+
self.max_path_length = max_path_length
|
28
36
|
|
29
37
|
def get_vector(self, query):
|
30
38
|
|
@@ -47,7 +55,7 @@ class Query:
|
|
47
55
|
|
48
56
|
entities = self.rag.ge_client.request(
|
49
57
|
user=self.user, collection=self.collection,
|
50
|
-
vectors=vectors, limit=self.
|
58
|
+
vectors=vectors, limit=self.entity_limit,
|
51
59
|
)
|
52
60
|
|
53
61
|
entities = [
|
@@ -79,61 +87,66 @@ class Query:
|
|
79
87
|
self.rag.label_cache[e] = res[0].o.value
|
80
88
|
return self.rag.label_cache[e]
|
81
89
|
|
82
|
-
def
|
83
|
-
|
84
|
-
entities = self.get_entities(query)
|
90
|
+
def follow_edges(self, ent, subgraph, path_length):
|
85
91
|
|
86
|
-
|
92
|
+
# Not needed?
|
93
|
+
if path_length <= 0:
|
94
|
+
return
|
87
95
|
|
88
|
-
if
|
89
|
-
|
96
|
+
# Stop spanning around if the subgraph is already maxed out
|
97
|
+
if len(subgraph) >= self.max_subgraph_size:
|
98
|
+
return
|
90
99
|
|
91
|
-
|
100
|
+
res = self.rag.triples_client.request(
|
101
|
+
user=self.user, collection=self.collection,
|
102
|
+
s=ent, p=None, o=None,
|
103
|
+
limit=self.triple_limit
|
104
|
+
)
|
92
105
|
|
93
|
-
|
94
|
-
|
95
|
-
s
|
96
|
-
limit=self.rag.query_limit
|
106
|
+
for triple in res:
|
107
|
+
subgraph.add(
|
108
|
+
(triple.s.value, triple.p.value, triple.o.value)
|
97
109
|
)
|
110
|
+
if path_length > 1:
|
111
|
+
self.follow_edges(triple.o.value, subgraph, path_length-1)
|
98
112
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
113
|
+
res = self.rag.triples_client.request(
|
114
|
+
user=self.user, collection=self.collection,
|
115
|
+
s=None, p=ent, o=None,
|
116
|
+
limit=self.triple_limit
|
117
|
+
)
|
103
118
|
|
104
|
-
|
105
|
-
|
106
|
-
s
|
107
|
-
limit=self.rag.query_limit
|
119
|
+
for triple in res:
|
120
|
+
subgraph.add(
|
121
|
+
(triple.s.value, triple.p.value, triple.o.value)
|
108
122
|
)
|
109
123
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
124
|
+
res = self.rag.triples_client.request(
|
125
|
+
user=self.user, collection=self.collection,
|
126
|
+
s=None, p=None, o=ent,
|
127
|
+
limit=self.triple_limit,
|
128
|
+
)
|
114
129
|
|
115
|
-
|
116
|
-
|
117
|
-
s
|
118
|
-
limit=self.rag.query_limit,
|
130
|
+
for triple in res:
|
131
|
+
subgraph.add(
|
132
|
+
(triple.s.value, triple.p.value, triple.o.value)
|
119
133
|
)
|
134
|
+
if path_length > 1:
|
135
|
+
self.follow_edges(triple.s.value, subgraph, path_length-1)
|
120
136
|
|
121
|
-
|
122
|
-
subgraph.add(
|
123
|
-
(triple.s.value, triple.p.value, triple.o.value)
|
124
|
-
)
|
125
|
-
|
126
|
-
subgraph = list(subgraph)
|
137
|
+
def get_subgraph(self, query):
|
127
138
|
|
128
|
-
|
139
|
+
entities = self.get_entities(query)
|
129
140
|
|
130
141
|
if self.verbose:
|
131
|
-
print("
|
132
|
-
for edge in subgraph:
|
133
|
-
print(" ", str(edge), flush=True)
|
142
|
+
print("Get subgraph...", flush=True)
|
134
143
|
|
135
|
-
|
136
|
-
|
144
|
+
subgraph = set()
|
145
|
+
|
146
|
+
for ent in entities:
|
147
|
+
self.follow_edges(ent, subgraph, self.max_path_length)
|
148
|
+
|
149
|
+
subgraph = list(subgraph)
|
137
150
|
|
138
151
|
return subgraph
|
139
152
|
|
@@ -154,6 +167,16 @@ class Query:
|
|
154
167
|
|
155
168
|
sg2.append((s, p, o))
|
156
169
|
|
170
|
+
sg2 = sg2[0:self.max_subgraph_size]
|
171
|
+
|
172
|
+
if self.verbose:
|
173
|
+
print("Subgraph:", flush=True)
|
174
|
+
for edge in sg2:
|
175
|
+
print(" ", str(edge), flush=True)
|
176
|
+
|
177
|
+
if self.verbose:
|
178
|
+
print("Done.", flush=True)
|
179
|
+
|
157
180
|
return sg2
|
158
181
|
|
159
182
|
class GraphRag:
|
@@ -171,9 +194,6 @@ class GraphRag:
|
|
171
194
|
tpl_request_queue=None,
|
172
195
|
tpl_response_queue=None,
|
173
196
|
verbose=False,
|
174
|
-
entity_limit=50,
|
175
|
-
triple_limit=30,
|
176
|
-
max_subgraph_size=3000,
|
177
197
|
module="test",
|
178
198
|
):
|
179
199
|
|
@@ -230,10 +250,6 @@ class GraphRag:
|
|
230
250
|
subscriber=module + "-emb",
|
231
251
|
)
|
232
252
|
|
233
|
-
self.entity_limit=entity_limit
|
234
|
-
self.query_limit=triple_limit
|
235
|
-
self.max_subgraph_size=max_subgraph_size
|
236
|
-
|
237
253
|
self.label_cache = {}
|
238
254
|
|
239
255
|
self.prompt = PromptClient(
|
@@ -247,13 +263,20 @@ class GraphRag:
|
|
247
263
|
if self.verbose:
|
248
264
|
print("Initialised", flush=True)
|
249
265
|
|
250
|
-
def query(
|
266
|
+
def query(
|
267
|
+
self, query, user="trustgraph", collection="default",
|
268
|
+
entity_limit=50, triple_limit=30, max_subgraph_size=1000,
|
269
|
+
max_path_length=2,
|
270
|
+
):
|
251
271
|
|
252
272
|
if self.verbose:
|
253
273
|
print("Construct prompt...", flush=True)
|
254
274
|
|
255
275
|
q = Query(
|
256
|
-
rag=self, user=user, collection=collection, verbose=self.verbose
|
276
|
+
rag=self, user=user, collection=collection, verbose=self.verbose,
|
277
|
+
entity_limit=entity_limit, triple_limit=triple_limit,
|
278
|
+
max_subgraph_size=max_subgraph_size,
|
279
|
+
max_path_length=max_path_length,
|
257
280
|
)
|
258
281
|
|
259
282
|
kg = q.get_labelgraph(query)
|
@@ -50,6 +50,8 @@ class Processor(ConsumerProducer):
|
|
50
50
|
document_embeddings_response_queue
|
51
51
|
)
|
52
52
|
|
53
|
+
doc_limit = params.get("doc_limit", 10)
|
54
|
+
|
53
55
|
super(Processor, self).__init__(
|
54
56
|
**params | {
|
55
57
|
"input_queue": input_queue,
|
@@ -79,6 +81,8 @@ class Processor(ConsumerProducer):
|
|
79
81
|
module=module,
|
80
82
|
)
|
81
83
|
|
84
|
+
self.doc_limit = doc_limit
|
85
|
+
|
82
86
|
async def handle(self, msg):
|
83
87
|
|
84
88
|
try:
|
@@ -90,7 +94,12 @@ class Processor(ConsumerProducer):
|
|
90
94
|
|
91
95
|
print(f"Handling input {id}...", flush=True)
|
92
96
|
|
93
|
-
|
97
|
+
if v.doc_limit:
|
98
|
+
doc_limit = v.doc_limit
|
99
|
+
else:
|
100
|
+
doc_limit = self.doc_limit
|
101
|
+
|
102
|
+
response = self.rag.query(v.query, doc_limit=doc_limit)
|
94
103
|
|
95
104
|
print("Send response...", flush=True)
|
96
105
|
r = DocumentRagResponse(response = response, error=None)
|
@@ -124,6 +133,13 @@ class Processor(ConsumerProducer):
|
|
124
133
|
default_output_queue,
|
125
134
|
)
|
126
135
|
|
136
|
+
parser.add_argument(
|
137
|
+
'-d', '--doc-limit',
|
138
|
+
type=int,
|
139
|
+
default=20,
|
140
|
+
help=f'Default document fetch limit (default: 10)'
|
141
|
+
)
|
142
|
+
|
127
143
|
parser.add_argument(
|
128
144
|
'--prompt-request-queue',
|
129
145
|
default=prompt_request_queue,
|
@@ -31,9 +31,7 @@ class Processor(ConsumerProducer):
|
|
31
31
|
input_queue = params.get("input_queue", default_input_queue)
|
32
32
|
output_queue = params.get("output_queue", default_output_queue)
|
33
33
|
subscriber = params.get("subscriber", default_subscriber)
|
34
|
-
|
35
|
-
triple_limit = params.get("triple_limit", 30)
|
36
|
-
max_subgraph_size = params.get("max_subgraph_size", 3000)
|
34
|
+
|
37
35
|
pr_request_queue = params.get(
|
38
36
|
"prompt_request_queue", prompt_request_queue
|
39
37
|
)
|
@@ -59,6 +57,11 @@ class Processor(ConsumerProducer):
|
|
59
57
|
"triples_response_queue", triples_response_queue
|
60
58
|
)
|
61
59
|
|
60
|
+
entity_limit = params.get("entity_limit", 50)
|
61
|
+
triple_limit = params.get("triple_limit", 30)
|
62
|
+
max_subgraph_size = params.get("max_subgraph_size", 150)
|
63
|
+
max_path_length = params.get("max_path_length", 2)
|
64
|
+
|
62
65
|
super(Processor, self).__init__(
|
63
66
|
**params | {
|
64
67
|
"input_queue": input_queue,
|
@@ -92,12 +95,14 @@ class Processor(ConsumerProducer):
|
|
92
95
|
tpl_request_queue=triples_request_queue,
|
93
96
|
tpl_response_queue=triples_response_queue,
|
94
97
|
verbose=True,
|
95
|
-
entity_limit=entity_limit,
|
96
|
-
triple_limit=triple_limit,
|
97
|
-
max_subgraph_size=max_subgraph_size,
|
98
98
|
module=module,
|
99
99
|
)
|
100
100
|
|
101
|
+
self.default_entity_limit = entity_limit
|
102
|
+
self.default_triple_limit = triple_limit
|
103
|
+
self.default_max_subgraph_size = max_subgraph_size
|
104
|
+
self.default_max_path_length = max_path_length
|
105
|
+
|
101
106
|
async def handle(self, msg):
|
102
107
|
|
103
108
|
try:
|
@@ -106,15 +111,38 @@ class Processor(ConsumerProducer):
|
|
106
111
|
|
107
112
|
# Sender-produced ID
|
108
113
|
id = msg.properties()["id"]
|
109
|
-
|
114
|
+
|
110
115
|
print(f"Handling input {id}...", flush=True)
|
111
116
|
|
117
|
+
if v.entity_limit:
|
118
|
+
entity_limit = v.entity_limit
|
119
|
+
else:
|
120
|
+
entity_limit = self.default_entity_limit
|
121
|
+
|
122
|
+
if v.triple_limit:
|
123
|
+
triple_limit = v.triple_limit
|
124
|
+
else:
|
125
|
+
triple_limit = self.default_triple_limit
|
126
|
+
|
127
|
+
if v.max_subgraph_size:
|
128
|
+
max_subgraph_size = v.max_subgraph_size
|
129
|
+
else:
|
130
|
+
max_subgraph_size = self.default_max_subgraph_size
|
131
|
+
|
132
|
+
if v.max_path_length:
|
133
|
+
max_path_length = v.max_path_length
|
134
|
+
else:
|
135
|
+
max_path_length = self.default_max_path_length
|
136
|
+
|
112
137
|
response = self.rag.query(
|
113
|
-
query=v.query, user=v.user, collection=v.collection
|
138
|
+
query=v.query, user=v.user, collection=v.collection,
|
139
|
+
entity_limit=entity_limit, triple_limit=triple_limit,
|
140
|
+
max_subgraph_size=max_subgraph_size,
|
141
|
+
max_path_length=max_path_length,
|
114
142
|
)
|
115
143
|
|
116
144
|
print("Send response...", flush=True)
|
117
|
-
r = GraphRagResponse(response
|
145
|
+
r = GraphRagResponse(response=response, error=None)
|
118
146
|
await self.send(r, properties={"id": id})
|
119
147
|
|
120
148
|
print("Done.", flush=True)
|
@@ -149,21 +177,28 @@ class Processor(ConsumerProducer):
|
|
149
177
|
'-e', '--entity-limit',
|
150
178
|
type=int,
|
151
179
|
default=50,
|
152
|
-
help=f'
|
180
|
+
help=f'Default entity vector fetch limit (default: 50)'
|
153
181
|
)
|
154
182
|
|
155
183
|
parser.add_argument(
|
156
184
|
'-t', '--triple-limit',
|
157
185
|
type=int,
|
158
186
|
default=30,
|
159
|
-
help=f'
|
187
|
+
help=f'Default triple query limit, per query (default: 30)'
|
160
188
|
)
|
161
189
|
|
162
190
|
parser.add_argument(
|
163
191
|
'-u', '--max-subgraph-size',
|
164
192
|
type=int,
|
165
|
-
default=
|
166
|
-
help=f'
|
193
|
+
default=150,
|
194
|
+
help=f'Default max subgraph size (default: 150)'
|
195
|
+
)
|
196
|
+
|
197
|
+
parser.add_argument(
|
198
|
+
'-a', '--max-path-length',
|
199
|
+
type=int,
|
200
|
+
default=2,
|
201
|
+
help=f'Default max path length (default: 2)'
|
167
202
|
)
|
168
203
|
|
169
204
|
parser.add_argument(
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: trustgraph-flow
|
3
|
-
Version: 0.21.
|
3
|
+
Version: 0.21.5
|
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.21.
|
6
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.21.5.tar.gz
|
7
7
|
Author: trustgraph.ai
|
8
8
|
Author-email: security@trustgraph.ai
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.21.4"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|