trustgraph-flow 0.18.14__tar.gz → 0.19.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/PKG-INFO +2 -2
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/setup.py +1 -1
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/embeddings/vectorize/vectorize.py +27 -13
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/definitions/extract.py +65 -7
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/relationships/extract.py +5 -44
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/topics/extract.py +6 -6
- trustgraph-flow-0.19.1/trustgraph/flow_version.py +1 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/graph_embeddings/milvus/write.py +5 -3
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/graph_embeddings/pinecone/write.py +57 -50
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/graph_embeddings/qdrant/write.py +43 -33
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph_flow.egg-info/PKG-INFO +2 -2
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph_flow.egg-info/requires.txt +1 -1
- trustgraph-flow-0.18.14/trustgraph/flow_version.py +0 -1
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/README.md +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/agent-manager-react +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/api-gateway +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/chunker-recursive +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/chunker-token +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/de-query-milvus +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/de-query-pinecone +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/de-query-qdrant +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/de-write-milvus +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/de-write-pinecone +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/de-write-qdrant +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/document-rag +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/embeddings-ollama +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/embeddings-vectorize +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/ge-query-milvus +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/ge-query-pinecone +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/ge-query-qdrant +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/ge-write-milvus +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/ge-write-pinecone +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/ge-write-qdrant +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/graph-rag +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/kg-extract-definitions +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/kg-extract-relationships +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/kg-extract-topics +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/metering +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/object-extract-row +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/oe-write-milvus +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/pdf-decoder +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/prompt-generic +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/prompt-template +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/rows-write-cassandra +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/run-processing +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/text-completion-azure +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/text-completion-azure-openai +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/text-completion-claude +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/text-completion-cohere +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/text-completion-googleaistudio +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/text-completion-llamafile +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/text-completion-ollama +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/text-completion-openai +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/triples-query-cassandra +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/triples-query-falkordb +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/triples-query-memgraph +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/triples-query-neo4j +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/triples-write-cassandra +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/triples-write-falkordb +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/triples-write-memgraph +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/triples-write-neo4j +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/scripts/wikipedia-lookup +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/setup.cfg +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/agent/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/agent/react/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/agent/react/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/agent/react/agent_manager.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/agent/react/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/agent/react/tools.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/agent/react/types.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/chunking/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/chunking/recursive/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/chunking/recursive/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/chunking/recursive/chunker.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/chunking/token/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/chunking/token/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/chunking/token/chunker.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/decoding/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/decoding/pdf/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/decoding/pdf/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/direct/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/direct/cassandra.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/direct/milvus_object_embeddings.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/document_rag.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/embeddings/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/embeddings/ollama/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/embeddings/ollama/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/embeddings/ollama/processor.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/embeddings/vectorize/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/embeddings/vectorize/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/external/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/external/wikipedia/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/external/wikipedia/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/external/wikipedia/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/definitions/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/definitions/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/relationships/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/relationships/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/topics/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/topics/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/object/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/object/row/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/object/row/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/object/row/extract.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/agent.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/auth.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/dbpedia.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/document_load.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/embeddings.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/encyclopedia.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/endpoint.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/graph_embeddings_load.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/graph_embeddings_query.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/graph_embeddings_stream.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/graph_rag.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/internet_search.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/mux.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/prompt.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/publisher.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/requestor.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/running.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/sender.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/serialize.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/socket.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/subscriber.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/text_completion.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/text_load.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/triples_load.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/triples_query.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/gateway/triples_stream.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/graph_rag.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/metering/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/metering/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/metering/counter.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/metering/pricelist.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/prompt/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/prompt/generic/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/prompt/generic/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/prompt/generic/prompts.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/prompt/generic/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/prompt/template/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/prompt/template/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/prompt/template/prompt_manager.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/prompt/template/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/azure/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/azure/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/azure/llm.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/claude/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/claude/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/claude/llm.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/cohere/llm.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/ollama/llm.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/openai/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/openai/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/model/text_completion/openai/llm.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/processing/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/processing/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/processing/processing.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/doc_embeddings/pinecone/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/graph_embeddings/pinecone/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/cassandra/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/falkordb/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/falkordb/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/falkordb/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/memgraph/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/memgraph/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/memgraph/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/query/triples/neo4j/service.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/retrieval/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/retrieval/document_rag/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/retrieval/document_rag/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/retrieval/document_rag/rag.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/retrieval/graph_rag/rag.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/doc_embeddings/pinecone/write.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/object_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/rows/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/rows/cassandra/write.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/cassandra/write.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/falkordb/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/falkordb/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/falkordb/write.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/memgraph/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/memgraph/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/memgraph/write.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/storage/triples/neo4j/write.py +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph_flow.egg-info/SOURCES.txt +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
- {trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph_flow.egg-info/top_level.txt +0 -0
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: trustgraph-flow
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.19.1
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
5
5
|
Home-page: https://github.com/trustgraph-ai/trustgraph
|
6
6
|
Author: trustgraph.ai
|
7
7
|
Author-email: security@trustgraph.ai
|
8
8
|
License: UNKNOWN
|
9
|
-
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.
|
9
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.19.1.tar.gz
|
10
10
|
Platform: UNKNOWN
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
12
12
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
@@ -34,7 +34,7 @@ setuptools.setup(
|
|
34
34
|
python_requires='>=3.8',
|
35
35
|
download_url = "https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v" + version + ".tar.gz",
|
36
36
|
install_requires=[
|
37
|
-
"trustgraph-base>=0.
|
37
|
+
"trustgraph-base>=0.19,<0.20",
|
38
38
|
"urllib3",
|
39
39
|
"rdflib",
|
40
40
|
"pymilvus",
|
{trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/embeddings/vectorize/vectorize.py
RENAMED
@@ -4,8 +4,9 @@ Vectorizer, calls the embeddings service to get embeddings for a chunk.
|
|
4
4
|
Input is text chunk, output is chunk and vectors.
|
5
5
|
"""
|
6
6
|
|
7
|
-
from ... schema import
|
8
|
-
from ... schema import
|
7
|
+
from ... schema import EntityContexts, EntityEmbeddings, GraphEmbeddings
|
8
|
+
from ... schema import entity_contexts_ingest_queue
|
9
|
+
from ... schema import graph_embeddings_store_queue
|
9
10
|
from ... schema import embeddings_request_queue, embeddings_response_queue
|
10
11
|
from ... clients.embeddings_client import EmbeddingsClient
|
11
12
|
from ... log_level import LogLevel
|
@@ -13,8 +14,8 @@ from ... base import ConsumerProducer
|
|
13
14
|
|
14
15
|
module = ".".join(__name__.split(".")[1:-1])
|
15
16
|
|
16
|
-
default_input_queue =
|
17
|
-
default_output_queue =
|
17
|
+
default_input_queue = entity_contexts_ingest_queue
|
18
|
+
default_output_queue = graph_embeddings_store_queue
|
18
19
|
default_subscriber = module
|
19
20
|
|
20
21
|
class Processor(ConsumerProducer):
|
@@ -38,8 +39,8 @@ class Processor(ConsumerProducer):
|
|
38
39
|
"embeddings_request_queue": emb_request_queue,
|
39
40
|
"embeddings_response_queue": emb_response_queue,
|
40
41
|
"subscriber": subscriber,
|
41
|
-
"input_schema":
|
42
|
-
"output_schema":
|
42
|
+
"input_schema": EntityContexts,
|
43
|
+
"output_schema": GraphEmbeddings,
|
43
44
|
}
|
44
45
|
)
|
45
46
|
|
@@ -50,9 +51,9 @@ class Processor(ConsumerProducer):
|
|
50
51
|
subscriber=module + "-emb",
|
51
52
|
)
|
52
53
|
|
53
|
-
def emit(self,
|
54
|
+
def emit(self, rec, vectors):
|
54
55
|
|
55
|
-
r =
|
56
|
+
r = GraphEmbeddings(metadata=metadata, chunk=chunk, vectors=vectors)
|
56
57
|
self.producer.send(r)
|
57
58
|
|
58
59
|
def handle(self, msg):
|
@@ -60,21 +61,34 @@ class Processor(ConsumerProducer):
|
|
60
61
|
v = msg.value()
|
61
62
|
print(f"Indexing {v.metadata.id}...", flush=True)
|
62
63
|
|
63
|
-
|
64
|
+
entities = []
|
64
65
|
|
65
66
|
try:
|
66
67
|
|
67
|
-
|
68
|
+
for entity in v.entities:
|
68
69
|
|
69
|
-
|
70
|
+
vectors = self.embeddings.request(entity.context)
|
71
|
+
|
72
|
+
entities.append(
|
73
|
+
EntityEmbeddings(
|
74
|
+
entity=entity.entity,
|
75
|
+
vectors=vectors
|
76
|
+
)
|
77
|
+
)
|
78
|
+
|
79
|
+
r = GraphEmbeddings(
|
70
80
|
metadata=v.metadata,
|
71
|
-
|
72
|
-
vectors=vectors
|
81
|
+
entities=entities,
|
73
82
|
)
|
74
83
|
|
84
|
+
self.producer.send(r)
|
85
|
+
|
75
86
|
except Exception as e:
|
76
87
|
print("Exception:", e, flush=True)
|
77
88
|
|
89
|
+
# Retry
|
90
|
+
raise e
|
91
|
+
|
78
92
|
print("Done.", flush=True)
|
79
93
|
|
80
94
|
@staticmethod
|
{trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/definitions/extract.py
RENAMED
@@ -1,14 +1,17 @@
|
|
1
1
|
|
2
2
|
"""
|
3
|
-
Simple decoder, accepts
|
4
|
-
get entity definitions which are output as graph edges
|
3
|
+
Simple decoder, accepts text chunks input, applies entity analysis to
|
4
|
+
get entity definitions which are output as graph edges along with
|
5
|
+
entity/context definitions for embedding.
|
5
6
|
"""
|
6
7
|
|
7
8
|
import urllib.parse
|
8
|
-
import
|
9
|
+
from pulsar.schema import JsonSchema
|
9
10
|
|
10
|
-
from .... schema import
|
11
|
-
from .... schema import
|
11
|
+
from .... schema import Chunk, Triple, Triples, Metadata, Value
|
12
|
+
from .... schema import EntityContext, EntityContexts
|
13
|
+
from .... schema import chunk_ingest_queue, triples_store_queue
|
14
|
+
from .... schema import entity_contexts_ingest_queue
|
12
15
|
from .... schema import prompt_request_queue
|
13
16
|
from .... schema import prompt_response_queue
|
14
17
|
from .... log_level import LogLevel
|
@@ -22,8 +25,9 @@ SUBJECT_OF_VALUE = Value(value=SUBJECT_OF, is_uri=True)
|
|
22
25
|
|
23
26
|
module = ".".join(__name__.split(".")[1:-1])
|
24
27
|
|
25
|
-
default_input_queue =
|
28
|
+
default_input_queue = chunk_ingest_queue
|
26
29
|
default_output_queue = triples_store_queue
|
30
|
+
default_entity_context_queue = entity_contexts_ingest_queue
|
27
31
|
default_subscriber = module
|
28
32
|
|
29
33
|
class Processor(ConsumerProducer):
|
@@ -32,6 +36,10 @@ class Processor(ConsumerProducer):
|
|
32
36
|
|
33
37
|
input_queue = params.get("input_queue", default_input_queue)
|
34
38
|
output_queue = params.get("output_queue", default_output_queue)
|
39
|
+
ec_queue = params.get(
|
40
|
+
"entity_context_queue",
|
41
|
+
default_entity_context_queue
|
42
|
+
)
|
35
43
|
subscriber = params.get("subscriber", default_subscriber)
|
36
44
|
pr_request_queue = params.get(
|
37
45
|
"prompt_request_queue", prompt_request_queue
|
@@ -45,13 +53,30 @@ class Processor(ConsumerProducer):
|
|
45
53
|
"input_queue": input_queue,
|
46
54
|
"output_queue": output_queue,
|
47
55
|
"subscriber": subscriber,
|
48
|
-
"input_schema":
|
56
|
+
"input_schema": Chunk,
|
49
57
|
"output_schema": Triples,
|
50
58
|
"prompt_request_queue": pr_request_queue,
|
51
59
|
"prompt_response_queue": pr_response_queue,
|
52
60
|
}
|
53
61
|
)
|
54
62
|
|
63
|
+
self.ec_prod = self.client.create_producer(
|
64
|
+
topic=ec_queue,
|
65
|
+
schema=JsonSchema(EntityContexts),
|
66
|
+
)
|
67
|
+
|
68
|
+
__class__.pubsub_metric.info({
|
69
|
+
"input_queue": input_queue,
|
70
|
+
"output_queue": output_queue,
|
71
|
+
"entity_context_queue": ec_queue,
|
72
|
+
"prompt_request_queue": pr_request_queue,
|
73
|
+
"prompt_response_queue": pr_response_queue,
|
74
|
+
"subscriber": subscriber,
|
75
|
+
"input_schema": Chunk.__name__,
|
76
|
+
"output_schema": Triples.__name__,
|
77
|
+
"vector_schema": EntityContexts.__name__,
|
78
|
+
})
|
79
|
+
|
55
80
|
self.prompt = PromptClient(
|
56
81
|
pulsar_host=self.pulsar_host,
|
57
82
|
input_queue=pr_request_queue,
|
@@ -79,6 +104,14 @@ class Processor(ConsumerProducer):
|
|
79
104
|
)
|
80
105
|
self.producer.send(t)
|
81
106
|
|
107
|
+
def emit_ecs(self, metadata, entities):
|
108
|
+
|
109
|
+
t = EntityContexts(
|
110
|
+
metadata=metadata,
|
111
|
+
entities=entities,
|
112
|
+
)
|
113
|
+
self.ec_prod.send(t)
|
114
|
+
|
82
115
|
def handle(self, msg):
|
83
116
|
|
84
117
|
v = msg.value()
|
@@ -91,6 +124,7 @@ class Processor(ConsumerProducer):
|
|
91
124
|
defs = self.get_definitions(chunk)
|
92
125
|
|
93
126
|
triples = []
|
127
|
+
entities = []
|
94
128
|
|
95
129
|
# FIXME: Putting metadata into triples store is duplicated in
|
96
130
|
# relationships extractor too
|
@@ -129,6 +163,14 @@ class Processor(ConsumerProducer):
|
|
129
163
|
o=Value(value=v.metadata.id, is_uri=True)
|
130
164
|
))
|
131
165
|
|
166
|
+
ec = EntityContext(
|
167
|
+
entity=s_value,
|
168
|
+
context=defn.definition,
|
169
|
+
)
|
170
|
+
|
171
|
+
entities.append(ec)
|
172
|
+
|
173
|
+
|
132
174
|
self.emit_edges(
|
133
175
|
Metadata(
|
134
176
|
id=v.metadata.id,
|
@@ -139,6 +181,16 @@ class Processor(ConsumerProducer):
|
|
139
181
|
triples
|
140
182
|
)
|
141
183
|
|
184
|
+
self.emit_ecs(
|
185
|
+
Metadata(
|
186
|
+
id=v.metadata.id,
|
187
|
+
metadata=[],
|
188
|
+
user=v.metadata.user,
|
189
|
+
collection=v.metadata.collection,
|
190
|
+
),
|
191
|
+
entities
|
192
|
+
)
|
193
|
+
|
142
194
|
except Exception as e:
|
143
195
|
print("Exception: ", e, flush=True)
|
144
196
|
|
@@ -152,6 +204,12 @@ class Processor(ConsumerProducer):
|
|
152
204
|
default_output_queue,
|
153
205
|
)
|
154
206
|
|
207
|
+
parser.add_argument(
|
208
|
+
'-e', '--entity-context-queue',
|
209
|
+
default=default_entity_context_queue,
|
210
|
+
help=f'Entity context queue (default: {default_entity_context_queue})'
|
211
|
+
)
|
212
|
+
|
155
213
|
parser.add_argument(
|
156
214
|
'--prompt-request-queue',
|
157
215
|
default=prompt_request_queue,
|
{trustgraph-flow-0.18.14 → trustgraph-flow-0.19.1}/trustgraph/extract/kg/relationships/extract.py
RENAMED
@@ -1,18 +1,15 @@
|
|
1
1
|
|
2
2
|
"""
|
3
|
-
Simple decoder, accepts
|
3
|
+
Simple decoder, accepts text chunks input, applies entity
|
4
4
|
relationship analysis to get entity relationship edges which are output as
|
5
5
|
graph edges.
|
6
6
|
"""
|
7
7
|
|
8
8
|
import urllib.parse
|
9
|
-
import os
|
10
|
-
from pulsar.schema import JsonSchema
|
11
9
|
|
12
|
-
from .... schema import
|
10
|
+
from .... schema import Chunk, Triple, Triples
|
13
11
|
from .... schema import Metadata, Value
|
14
|
-
from .... schema import
|
15
|
-
from .... schema import graph_embeddings_store_queue
|
12
|
+
from .... schema import chunk_ingest_queue, triples_store_queue
|
16
13
|
from .... schema import prompt_request_queue
|
17
14
|
from .... schema import prompt_response_queue
|
18
15
|
from .... log_level import LogLevel
|
@@ -25,9 +22,8 @@ SUBJECT_OF_VALUE = Value(value=SUBJECT_OF, is_uri=True)
|
|
25
22
|
|
26
23
|
module = ".".join(__name__.split(".")[1:-1])
|
27
24
|
|
28
|
-
default_input_queue =
|
25
|
+
default_input_queue = chunk_ingest_queue
|
29
26
|
default_output_queue = triples_store_queue
|
30
|
-
default_vector_queue = graph_embeddings_store_queue
|
31
27
|
default_subscriber = module
|
32
28
|
|
33
29
|
class Processor(ConsumerProducer):
|
@@ -36,7 +32,6 @@ class Processor(ConsumerProducer):
|
|
36
32
|
|
37
33
|
input_queue = params.get("input_queue", default_input_queue)
|
38
34
|
output_queue = params.get("output_queue", default_output_queue)
|
39
|
-
vector_queue = params.get("vector_queue", default_vector_queue)
|
40
35
|
subscriber = params.get("subscriber", default_subscriber)
|
41
36
|
pr_request_queue = params.get(
|
42
37
|
"prompt_request_queue", prompt_request_queue
|
@@ -50,30 +45,13 @@ class Processor(ConsumerProducer):
|
|
50
45
|
"input_queue": input_queue,
|
51
46
|
"output_queue": output_queue,
|
52
47
|
"subscriber": subscriber,
|
53
|
-
"input_schema":
|
48
|
+
"input_schema": Chunk,
|
54
49
|
"output_schema": Triples,
|
55
50
|
"prompt_request_queue": pr_request_queue,
|
56
51
|
"prompt_response_queue": pr_response_queue,
|
57
52
|
}
|
58
53
|
)
|
59
54
|
|
60
|
-
self.vec_prod = self.client.create_producer(
|
61
|
-
topic=vector_queue,
|
62
|
-
schema=JsonSchema(GraphEmbeddings),
|
63
|
-
)
|
64
|
-
|
65
|
-
__class__.pubsub_metric.info({
|
66
|
-
"input_queue": input_queue,
|
67
|
-
"output_queue": output_queue,
|
68
|
-
"vector_queue": vector_queue,
|
69
|
-
"prompt_request_queue": pr_request_queue,
|
70
|
-
"prompt_response_queue": pr_response_queue,
|
71
|
-
"subscriber": subscriber,
|
72
|
-
"input_schema": ChunkEmbeddings.__name__,
|
73
|
-
"output_schema": Triples.__name__,
|
74
|
-
"vector_schema": GraphEmbeddings.__name__,
|
75
|
-
})
|
76
|
-
|
77
55
|
self.prompt = PromptClient(
|
78
56
|
pulsar_host=self.pulsar_host,
|
79
57
|
input_queue=pr_request_queue,
|
@@ -101,11 +79,6 @@ class Processor(ConsumerProducer):
|
|
101
79
|
)
|
102
80
|
self.producer.send(t)
|
103
81
|
|
104
|
-
def emit_vec(self, metadata, ent, vec):
|
105
|
-
|
106
|
-
r = GraphEmbeddings(metadata=metadata, entity=ent, vectors=vec)
|
107
|
-
self.vec_prod.send(r)
|
108
|
-
|
109
82
|
def handle(self, msg):
|
110
83
|
|
111
84
|
v = msg.value()
|
@@ -193,12 +166,6 @@ class Processor(ConsumerProducer):
|
|
193
166
|
o=Value(value=v.metadata.id, is_uri=True)
|
194
167
|
))
|
195
168
|
|
196
|
-
self.emit_vec(v.metadata, s_value, v.vectors)
|
197
|
-
self.emit_vec(v.metadata, p_value, v.vectors)
|
198
|
-
|
199
|
-
if rel.o_entity:
|
200
|
-
self.emit_vec(v.metadata, o_value, v.vectors)
|
201
|
-
|
202
169
|
self.emit_edges(
|
203
170
|
Metadata(
|
204
171
|
id=v.metadata.id,
|
@@ -222,12 +189,6 @@ class Processor(ConsumerProducer):
|
|
222
189
|
default_output_queue,
|
223
190
|
)
|
224
191
|
|
225
|
-
parser.add_argument(
|
226
|
-
'-c', '--vector-queue',
|
227
|
-
default=default_vector_queue,
|
228
|
-
help=f'Vector output queue (default: {default_vector_queue})'
|
229
|
-
)
|
230
|
-
|
231
192
|
parser.add_argument(
|
232
193
|
'--prompt-request-queue',
|
233
194
|
default=prompt_request_queue,
|
@@ -1,14 +1,14 @@
|
|
1
1
|
|
2
2
|
"""
|
3
|
-
Simple decoder, accepts
|
4
|
-
get
|
3
|
+
Simple decoder, accepts text chunks input, applies entity analysis to
|
4
|
+
get topics which are output as graph edges.
|
5
5
|
"""
|
6
6
|
|
7
7
|
import urllib.parse
|
8
8
|
import json
|
9
9
|
|
10
|
-
from .... schema import
|
11
|
-
from .... schema import
|
10
|
+
from .... schema import Chunk, Triple, Triples, Metadata, Value
|
11
|
+
from .... schema import chunk_ingest_queue, triples_store_queue
|
12
12
|
from .... schema import prompt_request_queue
|
13
13
|
from .... schema import prompt_response_queue
|
14
14
|
from .... log_level import LogLevel
|
@@ -20,7 +20,7 @@ DEFINITION_VALUE = Value(value=DEFINITION, is_uri=True)
|
|
20
20
|
|
21
21
|
module = ".".join(__name__.split(".")[1:-1])
|
22
22
|
|
23
|
-
default_input_queue =
|
23
|
+
default_input_queue = chunk_ingest_queue
|
24
24
|
default_output_queue = triples_store_queue
|
25
25
|
default_subscriber = module
|
26
26
|
|
@@ -43,7 +43,7 @@ class Processor(ConsumerProducer):
|
|
43
43
|
"input_queue": input_queue,
|
44
44
|
"output_queue": output_queue,
|
45
45
|
"subscriber": subscriber,
|
46
|
-
"input_schema":
|
46
|
+
"input_schema": Chunk,
|
47
47
|
"output_schema": Triples,
|
48
48
|
"prompt_request_queue": pr_request_queue,
|
49
49
|
"prompt_response_queue": pr_response_queue,
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.19.1"
|
@@ -38,9 +38,11 @@ class Processor(Consumer):
|
|
38
38
|
|
39
39
|
v = msg.value()
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
for entity in v.entities:
|
42
|
+
|
43
|
+
if entity.entity.value != "" and entity.entity.value is not None:
|
44
|
+
for vec in entity.vectors:
|
45
|
+
self.vecstore.insert(vec, entity.entity.value)
|
44
46
|
|
45
47
|
@staticmethod
|
46
48
|
def add_args(parser):
|
@@ -60,76 +60,83 @@ class Processor(Consumer):
|
|
60
60
|
|
61
61
|
self.last_index_name = None
|
62
62
|
|
63
|
-
def
|
63
|
+
def create_index(self, index_name, dim):
|
64
|
+
|
65
|
+
self.pinecone.create_index(
|
66
|
+
name = index_name,
|
67
|
+
dimension = dim,
|
68
|
+
metric = "cosine",
|
69
|
+
spec = ServerlessSpec(
|
70
|
+
cloud = self.cloud,
|
71
|
+
region = self.region,
|
72
|
+
)
|
73
|
+
)
|
64
74
|
|
65
|
-
|
75
|
+
for i in range(0, 1000):
|
66
76
|
|
67
|
-
|
77
|
+
if self.pinecone.describe_index(
|
78
|
+
index_name
|
79
|
+
).status["ready"]:
|
80
|
+
break
|
68
81
|
|
69
|
-
|
82
|
+
time.sleep(1)
|
70
83
|
|
71
|
-
|
84
|
+
if not self.pinecone.describe_index(
|
85
|
+
index_name
|
86
|
+
).status["ready"]:
|
87
|
+
raise RuntimeError(
|
88
|
+
"Gave up waiting for index creation"
|
89
|
+
)
|
72
90
|
|
73
|
-
|
91
|
+
def handle(self, msg):
|
74
92
|
|
75
|
-
|
76
|
-
|
77
|
-
|
93
|
+
v = msg.value()
|
94
|
+
|
95
|
+
id = str(uuid.uuid4())
|
78
96
|
|
79
|
-
|
97
|
+
for entity in v.entities:
|
80
98
|
|
81
|
-
|
99
|
+
if entity.entity.value == "" or entity.entity.value is None:
|
100
|
+
continue
|
82
101
|
|
83
|
-
|
102
|
+
for vec in entity.vectors:
|
84
103
|
|
85
|
-
|
86
|
-
name = index_name,
|
87
|
-
dimension = dim,
|
88
|
-
metric = "cosine",
|
89
|
-
spec = ServerlessSpec(
|
90
|
-
cloud = self.cloud,
|
91
|
-
region = self.region,
|
92
|
-
)
|
93
|
-
)
|
104
|
+
dim = len(vec)
|
94
105
|
|
95
|
-
|
106
|
+
index_name = (
|
107
|
+
"t-" + v.metadata.user + "-" + str(dim)
|
108
|
+
)
|
96
109
|
|
97
|
-
|
98
|
-
index_name
|
99
|
-
).status["ready"]:
|
100
|
-
break
|
110
|
+
if index_name != self.last_index_name:
|
101
111
|
|
102
|
-
|
112
|
+
if not self.pinecone.has_index(index_name):
|
103
113
|
|
104
|
-
|
105
|
-
index_name
|
106
|
-
).status["ready"]:
|
107
|
-
raise RuntimeError(
|
108
|
-
"Gave up waiting for index creation"
|
109
|
-
)
|
114
|
+
try:
|
110
115
|
|
111
|
-
|
112
|
-
print("Pinecone index creation failed")
|
113
|
-
raise e
|
116
|
+
self.create_index(index_name, dim)
|
114
117
|
|
115
|
-
|
118
|
+
except Exception as e:
|
119
|
+
print("Pinecone index creation failed")
|
120
|
+
raise e
|
116
121
|
|
117
|
-
|
122
|
+
print(f"Index {index_name} created", flush=True)
|
118
123
|
|
119
|
-
|
124
|
+
self.last_index_name = index_name
|
120
125
|
|
121
|
-
|
122
|
-
{
|
123
|
-
"id": id,
|
124
|
-
"values": vec,
|
125
|
-
"metadata": { "entity": v.entity.value },
|
126
|
-
}
|
127
|
-
]
|
126
|
+
index = self.pinecone.Index(index_name)
|
128
127
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
128
|
+
records = [
|
129
|
+
{
|
130
|
+
"id": id,
|
131
|
+
"values": vec,
|
132
|
+
"metadata": { "entity": entity.entity.value },
|
133
|
+
}
|
134
|
+
]
|
135
|
+
|
136
|
+
index.upsert(
|
137
|
+
vectors = records,
|
138
|
+
namespace = v.metadata.collection,
|
139
|
+
)
|
133
140
|
|
134
141
|
@staticmethod
|
135
142
|
def add_args(parser):
|
@@ -40,49 +40,59 @@ class Processor(Consumer):
|
|
40
40
|
|
41
41
|
self.client = QdrantClient(url=store_uri)
|
42
42
|
|
43
|
+
def get_collection(self, dim, user, collection):
|
44
|
+
|
45
|
+
cname = (
|
46
|
+
"t_" + user + "_" + collection + "_" + str(dim)
|
47
|
+
)
|
48
|
+
|
49
|
+
if cname != self.last_collection:
|
50
|
+
|
51
|
+
if not self.client.collection_exists(cname):
|
52
|
+
|
53
|
+
try:
|
54
|
+
self.client.create_collection(
|
55
|
+
collection_name=cname,
|
56
|
+
vectors_config=VectorParams(
|
57
|
+
size=dim, distance=Distance.COSINE
|
58
|
+
),
|
59
|
+
)
|
60
|
+
except Exception as e:
|
61
|
+
print("Qdrant collection creation failed")
|
62
|
+
raise e
|
63
|
+
|
64
|
+
self.last_collection = cname
|
65
|
+
|
66
|
+
return cname
|
67
|
+
|
43
68
|
def handle(self, msg):
|
44
69
|
|
45
70
|
v = msg.value()
|
46
71
|
|
47
|
-
|
72
|
+
for entity in v.entities:
|
48
73
|
|
49
|
-
|
74
|
+
if entity.entity.value == "" or entity.entity.value is None: return
|
50
75
|
|
51
|
-
|
52
|
-
collection = (
|
53
|
-
"t_" + v.metadata.user + "_" + v.metadata.collection + "_" +
|
54
|
-
str(dim)
|
55
|
-
)
|
76
|
+
for vec in entity.vectors:
|
56
77
|
|
57
|
-
|
78
|
+
dim = len(vec)
|
58
79
|
|
59
|
-
|
80
|
+
collection = self.get_collection(
|
81
|
+
dim, v.metadata.user, v.metadata.collection
|
82
|
+
)
|
60
83
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
84
|
+
self.client.upsert(
|
85
|
+
collection_name=collection,
|
86
|
+
points=[
|
87
|
+
PointStruct(
|
88
|
+
id=str(uuid.uuid4()),
|
89
|
+
vector=vec,
|
90
|
+
payload={
|
91
|
+
"entity": entity.entity.value,
|
92
|
+
}
|
67
93
|
)
|
68
|
-
|
69
|
-
|
70
|
-
raise e
|
71
|
-
|
72
|
-
self.last_collection = collection
|
73
|
-
|
74
|
-
self.client.upsert(
|
75
|
-
collection_name=collection,
|
76
|
-
points=[
|
77
|
-
PointStruct(
|
78
|
-
id=str(uuid.uuid4()),
|
79
|
-
vector=vec,
|
80
|
-
payload={
|
81
|
-
"entity": v.entity.value,
|
82
|
-
}
|
83
|
-
)
|
84
|
-
]
|
85
|
-
)
|
94
|
+
]
|
95
|
+
)
|
86
96
|
|
87
97
|
@staticmethod
|
88
98
|
def add_args(parser):
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: trustgraph-flow
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.19.1
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
5
5
|
Home-page: https://github.com/trustgraph-ai/trustgraph
|
6
6
|
Author: trustgraph.ai
|
7
7
|
Author-email: security@trustgraph.ai
|
8
8
|
License: UNKNOWN
|
9
|
-
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.
|
9
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.19.1.tar.gz
|
10
10
|
Platform: UNKNOWN
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
12
12
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.18.14"
|
File without changes
|