trustgraph-flow 1.3.17__tar.gz → 1.4.0__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-1.3.17 → trustgraph_flow-1.4.0}/PKG-INFO +2 -2
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/pyproject.toml +1 -2
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/direct/milvus_doc_embeddings.py +34 -11
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/direct/milvus_graph_embeddings.py +34 -11
- trustgraph_flow-1.4.0/trustgraph/flow_version.py +1 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/milvus/service.py +6 -1
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/milvus/service.py +6 -1
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/memgraph/service.py +68 -16
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/neo4j/service.py +68 -16
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/doc_embeddings/milvus/write.py +5 -1
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/graph_embeddings/milvus/write.py +5 -1
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/triples/memgraph/write.py +83 -44
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/triples/neo4j/write.py +65 -25
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph_flow.egg-info/PKG-INFO +2 -2
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph_flow.egg-info/SOURCES.txt +0 -4
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph_flow.egg-info/entry_points.txt +0 -1
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph_flow.egg-info/requires.txt +1 -1
- trustgraph_flow-1.3.17/trustgraph/direct/milvus_object_embeddings.py +0 -157
- trustgraph_flow-1.3.17/trustgraph/flow_version.py +0 -1
- trustgraph_flow-1.3.17/trustgraph/storage/object_embeddings/milvus/write.py +0 -61
- trustgraph_flow-1.3.17/trustgraph/storage/triples/neo4j/__init__.py +0 -3
- trustgraph_flow-1.3.17/trustgraph/storage/triples/neo4j/__main__.py +0 -7
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/README.md +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/setup.cfg +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/mcp_tool/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/mcp_tool/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/mcp_tool/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/react/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/react/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/react/agent_manager.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/react/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/react/tools.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/react/types.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/agent/tool_filter.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/chunking/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/chunking/recursive/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/chunking/recursive/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/chunking/recursive/chunker.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/chunking/token/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/chunking/token/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/chunking/token/chunker.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/config/service/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/config/service/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/config/service/config.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/config/service/flow.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/config/service/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/cores/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/cores/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/cores/knowledge.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/cores/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/decoding/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/decoding/mistral_ocr/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/decoding/mistral_ocr/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/decoding/mistral_ocr/processor.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/decoding/pdf/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/decoding/pdf/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/direct/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/direct/cassandra.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/document_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/document_embeddings/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/document_embeddings/embeddings.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/fastembed/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/fastembed/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/fastembed/processor.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/graph_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/graph_embeddings/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/graph_embeddings/embeddings.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/ollama/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/ollama/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/embeddings/ollama/processor.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/external/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/external/wikipedia/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/external/wikipedia/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/external/wikipedia/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/agent/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/agent/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/agent/extract.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/definitions/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/definitions/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/definitions/extract.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/objects/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/objects/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/objects/processor.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/relationships/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/relationships/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/relationships/extract.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/topics/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/topics/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/extract/kg/topics/extract.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/auth.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/config/receiver.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/agent.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/config.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/core_export.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/core_import.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/document_embeddings_export.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/document_embeddings_import.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/document_load.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/document_rag.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/embeddings.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/entity_contexts_export.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/entity_contexts_import.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/flow.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/graph_embeddings_export.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/graph_embeddings_import.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/graph_embeddings_query.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/graph_rag.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/knowledge.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/librarian.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/manager.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/mcp_tool.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/mux.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/nlp_query.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/objects_import.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/objects_query.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/prompt.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/requestor.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/sender.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/serialize.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/streamer.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/structured_query.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/text_completion.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/text_load.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/triples_export.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/triples_import.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/dispatch/triples_query.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/endpoint/constant_endpoint.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/endpoint/manager.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/endpoint/metrics.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/endpoint/socket.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/endpoint/stream_endpoint.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/endpoint/variable_endpoint.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/running.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/unused/dbpedia.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/unused/encyclopedia.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/gateway/unused/internet_search.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/librarian/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/librarian/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/librarian/blob_store.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/librarian/librarian.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/librarian/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/metering/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/metering/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/metering/counter.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/azure/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/azure/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/azure/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/claude/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/claude/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/claude/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/cohere/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/lmstudio/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/lmstudio/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/lmstudio/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/mistral/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/mistral/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/mistral/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/ollama/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/openai/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/openai/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/openai/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/tgi/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/tgi/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/tgi/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/vllm/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/vllm/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/model/text_completion/vllm/llm.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/processing/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/processing/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/processing/processing.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/prompt/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/prompt/template/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/prompt/template/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/prompt/template/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/pinecone/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/pinecone/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/objects/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/objects/cassandra/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/objects/cassandra/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/objects/cassandra/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/cassandra/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/cassandra/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/cassandra/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/falkordb/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/falkordb/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/falkordb/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/memgraph/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/memgraph/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/neo4j/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/neo4j/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/document_rag/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/document_rag/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/document_rag/document_rag.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/document_rag/rag.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/graph_rag/graph_rag.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/graph_rag/rag.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/nlp_query/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/nlp_query/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/nlp_query/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/structured_query/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/structured_query/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/retrieval/structured_query/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/rev_gateway/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/rev_gateway/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/rev_gateway/dispatcher.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/rev_gateway/service.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/doc_embeddings/pinecone/write.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/graph_embeddings/pinecone/write.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/knowledge/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/knowledge/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/knowledge/store.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/object_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/objects/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/objects/cassandra/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/objects/cassandra/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/objects/cassandra/write.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/rows/__init__.py +0 -0
- {trustgraph_flow-1.3.17/trustgraph/storage/object_embeddings/milvus → trustgraph_flow-1.4.0/trustgraph/storage/rows/cassandra}/__init__.py +0 -0
- {trustgraph_flow-1.3.17/trustgraph/storage/object_embeddings/milvus → trustgraph_flow-1.4.0/trustgraph/storage/rows/cassandra}/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/rows/cassandra/write.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/triples/__init__.py +0 -0
- {trustgraph_flow-1.3.17/trustgraph/storage/rows → trustgraph_flow-1.4.0/trustgraph/storage/triples}/cassandra/__init__.py +0 -0
- {trustgraph_flow-1.3.17/trustgraph/storage/rows → trustgraph_flow-1.4.0/trustgraph/storage/triples}/cassandra/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/triples/cassandra/write.py +0 -0
- {trustgraph_flow-1.3.17/trustgraph/storage/triples/cassandra → trustgraph_flow-1.4.0/trustgraph/storage/triples/falkordb}/__init__.py +0 -0
- {trustgraph_flow-1.3.17/trustgraph/storage/triples/cassandra → trustgraph_flow-1.4.0/trustgraph/storage/triples/falkordb}/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/storage/triples/falkordb/write.py +0 -0
- {trustgraph_flow-1.3.17/trustgraph/storage/triples/falkordb → trustgraph_flow-1.4.0/trustgraph/storage/triples/memgraph}/__init__.py +0 -0
- {trustgraph_flow-1.3.17/trustgraph/storage/triples/falkordb → trustgraph_flow-1.4.0/trustgraph/storage/triples/memgraph}/__main__.py +0 -0
- {trustgraph_flow-1.3.17/trustgraph/storage/triples/memgraph → trustgraph_flow-1.4.0/trustgraph/storage/triples/neo4j}/__init__.py +0 -0
- {trustgraph_flow-1.3.17/trustgraph/storage/triples/memgraph → trustgraph_flow-1.4.0/trustgraph/storage/triples/neo4j}/__main__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/tables/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/tables/config.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/tables/knowledge.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/tables/library.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/template/__init__.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/template/prompt_manager.py +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
- {trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph_flow.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: trustgraph-flow
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.4.0
|
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
|
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
6
6
|
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
@@ -8,7 +8,7 @@ Classifier: Programming Language :: Python :: 3
|
|
8
8
|
Classifier: Operating System :: OS Independent
|
9
9
|
Requires-Python: >=3.8
|
10
10
|
Description-Content-Type: text/markdown
|
11
|
-
Requires-Dist: trustgraph-base<1.
|
11
|
+
Requires-Dist: trustgraph-base<1.5,>=1.4
|
12
12
|
Requires-Dist: aiohttp
|
13
13
|
Requires-Dist: anthropic
|
14
14
|
Requires-Dist: cassandra-driver
|
@@ -10,7 +10,7 @@ description = "TrustGraph provides a means to run a pipeline of flexible AI proc
|
|
10
10
|
readme = "README.md"
|
11
11
|
requires-python = ">=3.8"
|
12
12
|
dependencies = [
|
13
|
-
"trustgraph-base>=1.
|
13
|
+
"trustgraph-base>=1.4,<1.5",
|
14
14
|
"aiohttp",
|
15
15
|
"anthropic",
|
16
16
|
"cassandra-driver",
|
@@ -90,7 +90,6 @@ metering = "trustgraph.metering:run"
|
|
90
90
|
nlp-query = "trustgraph.retrieval.nlp_query:run"
|
91
91
|
objects-write-cassandra = "trustgraph.storage.objects.cassandra:run"
|
92
92
|
objects-query-cassandra = "trustgraph.query.objects.cassandra:run"
|
93
|
-
oe-write-milvus = "trustgraph.storage.object_embeddings.milvus:run"
|
94
93
|
pdf-decoder = "trustgraph.decoding.pdf:run"
|
95
94
|
pdf-ocr-mistral = "trustgraph.decoding.mistral_ocr:run"
|
96
95
|
prompt-template = "trustgraph.prompt.template:run"
|
@@ -2,9 +2,32 @@
|
|
2
2
|
from pymilvus import MilvusClient, CollectionSchema, FieldSchema, DataType
|
3
3
|
import time
|
4
4
|
import logging
|
5
|
+
import re
|
5
6
|
|
6
7
|
logger = logging.getLogger(__name__)
|
7
8
|
|
9
|
+
def make_safe_collection_name(user, collection, dimension, prefix):
|
10
|
+
"""
|
11
|
+
Create a safe Milvus collection name from user/collection parameters.
|
12
|
+
Milvus only allows letters, numbers, and underscores.
|
13
|
+
"""
|
14
|
+
def sanitize(s):
|
15
|
+
# Replace non-alphanumeric characters (except underscore) with underscore
|
16
|
+
# Then collapse multiple underscores into single underscore
|
17
|
+
safe = re.sub(r'[^a-zA-Z0-9_]', '_', s)
|
18
|
+
safe = re.sub(r'_+', '_', safe)
|
19
|
+
# Remove leading/trailing underscores
|
20
|
+
safe = safe.strip('_')
|
21
|
+
# Ensure it's not empty
|
22
|
+
if not safe:
|
23
|
+
safe = 'default'
|
24
|
+
return safe
|
25
|
+
|
26
|
+
safe_user = sanitize(user)
|
27
|
+
safe_collection = sanitize(collection)
|
28
|
+
|
29
|
+
return f"{prefix}_{safe_user}_{safe_collection}_{dimension}"
|
30
|
+
|
8
31
|
class DocVectors:
|
9
32
|
|
10
33
|
def __init__(self, uri="http://localhost:19530", prefix='doc'):
|
@@ -26,9 +49,9 @@ class DocVectors:
|
|
26
49
|
self.next_reload = time.time() + self.reload_time
|
27
50
|
logger.debug(f"Reload at {self.next_reload}")
|
28
51
|
|
29
|
-
def init_collection(self, dimension):
|
52
|
+
def init_collection(self, dimension, user, collection):
|
30
53
|
|
31
|
-
collection_name = self.prefix
|
54
|
+
collection_name = make_safe_collection_name(user, collection, dimension, self.prefix)
|
32
55
|
|
33
56
|
pkey_field = FieldSchema(
|
34
57
|
name="id",
|
@@ -75,14 +98,14 @@ class DocVectors:
|
|
75
98
|
index_params=index_params
|
76
99
|
)
|
77
100
|
|
78
|
-
self.collections[dimension] = collection_name
|
101
|
+
self.collections[(dimension, user, collection)] = collection_name
|
79
102
|
|
80
|
-
def insert(self, embeds, doc):
|
103
|
+
def insert(self, embeds, doc, user, collection):
|
81
104
|
|
82
105
|
dim = len(embeds)
|
83
106
|
|
84
|
-
if dim not in self.collections:
|
85
|
-
self.init_collection(dim)
|
107
|
+
if (dim, user, collection) not in self.collections:
|
108
|
+
self.init_collection(dim, user, collection)
|
86
109
|
|
87
110
|
data = [
|
88
111
|
{
|
@@ -92,18 +115,18 @@ class DocVectors:
|
|
92
115
|
]
|
93
116
|
|
94
117
|
self.client.insert(
|
95
|
-
collection_name=self.collections[dim],
|
118
|
+
collection_name=self.collections[(dim, user, collection)],
|
96
119
|
data=data
|
97
120
|
)
|
98
121
|
|
99
|
-
def search(self, embeds, fields=["doc"], limit=10):
|
122
|
+
def search(self, embeds, user, collection, fields=["doc"], limit=10):
|
100
123
|
|
101
124
|
dim = len(embeds)
|
102
125
|
|
103
|
-
if dim not in self.collections:
|
104
|
-
self.init_collection(dim)
|
126
|
+
if (dim, user, collection) not in self.collections:
|
127
|
+
self.init_collection(dim, user, collection)
|
105
128
|
|
106
|
-
coll = self.collections[dim]
|
129
|
+
coll = self.collections[(dim, user, collection)]
|
107
130
|
|
108
131
|
search_params = {
|
109
132
|
"metric_type": "COSINE",
|
{trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/direct/milvus_graph_embeddings.py
RENAMED
@@ -2,9 +2,32 @@
|
|
2
2
|
from pymilvus import MilvusClient, CollectionSchema, FieldSchema, DataType
|
3
3
|
import time
|
4
4
|
import logging
|
5
|
+
import re
|
5
6
|
|
6
7
|
logger = logging.getLogger(__name__)
|
7
8
|
|
9
|
+
def make_safe_collection_name(user, collection, dimension, prefix):
|
10
|
+
"""
|
11
|
+
Create a safe Milvus collection name from user/collection parameters.
|
12
|
+
Milvus only allows letters, numbers, and underscores.
|
13
|
+
"""
|
14
|
+
def sanitize(s):
|
15
|
+
# Replace non-alphanumeric characters (except underscore) with underscore
|
16
|
+
# Then collapse multiple underscores into single underscore
|
17
|
+
safe = re.sub(r'[^a-zA-Z0-9_]', '_', s)
|
18
|
+
safe = re.sub(r'_+', '_', safe)
|
19
|
+
# Remove leading/trailing underscores
|
20
|
+
safe = safe.strip('_')
|
21
|
+
# Ensure it's not empty
|
22
|
+
if not safe:
|
23
|
+
safe = 'default'
|
24
|
+
return safe
|
25
|
+
|
26
|
+
safe_user = sanitize(user)
|
27
|
+
safe_collection = sanitize(collection)
|
28
|
+
|
29
|
+
return f"{prefix}_{safe_user}_{safe_collection}_{dimension}"
|
30
|
+
|
8
31
|
class EntityVectors:
|
9
32
|
|
10
33
|
def __init__(self, uri="http://localhost:19530", prefix='entity'):
|
@@ -26,9 +49,9 @@ class EntityVectors:
|
|
26
49
|
self.next_reload = time.time() + self.reload_time
|
27
50
|
logger.debug(f"Reload at {self.next_reload}")
|
28
51
|
|
29
|
-
def init_collection(self, dimension):
|
52
|
+
def init_collection(self, dimension, user, collection):
|
30
53
|
|
31
|
-
collection_name = self.prefix
|
54
|
+
collection_name = make_safe_collection_name(user, collection, dimension, self.prefix)
|
32
55
|
|
33
56
|
pkey_field = FieldSchema(
|
34
57
|
name="id",
|
@@ -75,14 +98,14 @@ class EntityVectors:
|
|
75
98
|
index_params=index_params
|
76
99
|
)
|
77
100
|
|
78
|
-
self.collections[dimension] = collection_name
|
101
|
+
self.collections[(dimension, user, collection)] = collection_name
|
79
102
|
|
80
|
-
def insert(self, embeds, entity):
|
103
|
+
def insert(self, embeds, entity, user, collection):
|
81
104
|
|
82
105
|
dim = len(embeds)
|
83
106
|
|
84
|
-
if dim not in self.collections:
|
85
|
-
self.init_collection(dim)
|
107
|
+
if (dim, user, collection) not in self.collections:
|
108
|
+
self.init_collection(dim, user, collection)
|
86
109
|
|
87
110
|
data = [
|
88
111
|
{
|
@@ -92,18 +115,18 @@ class EntityVectors:
|
|
92
115
|
]
|
93
116
|
|
94
117
|
self.client.insert(
|
95
|
-
collection_name=self.collections[dim],
|
118
|
+
collection_name=self.collections[(dim, user, collection)],
|
96
119
|
data=data
|
97
120
|
)
|
98
121
|
|
99
|
-
def search(self, embeds, fields=["entity"], limit=10):
|
122
|
+
def search(self, embeds, user, collection, fields=["entity"], limit=10):
|
100
123
|
|
101
124
|
dim = len(embeds)
|
102
125
|
|
103
|
-
if dim not in self.collections:
|
104
|
-
self.init_collection(dim)
|
126
|
+
if (dim, user, collection) not in self.collections:
|
127
|
+
self.init_collection(dim, user, collection)
|
105
128
|
|
106
|
-
coll = self.collections[dim]
|
129
|
+
coll = self.collections[(dim, user, collection)]
|
107
130
|
|
108
131
|
search_params = {
|
109
132
|
"metric_type": "COSINE",
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "1.4.0"
|
{trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/doc_embeddings/milvus/service.py
RENAMED
@@ -43,7 +43,12 @@ class Processor(DocumentEmbeddingsQueryService):
|
|
43
43
|
|
44
44
|
for vec in msg.vectors:
|
45
45
|
|
46
|
-
resp = self.vecstore.search(
|
46
|
+
resp = self.vecstore.search(
|
47
|
+
vec,
|
48
|
+
msg.user,
|
49
|
+
msg.collection,
|
50
|
+
limit=msg.limit
|
51
|
+
)
|
47
52
|
|
48
53
|
for r in resp:
|
49
54
|
chunk = r["entity"]["doc"]
|
{trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/graph_embeddings/milvus/service.py
RENAMED
@@ -50,7 +50,12 @@ class Processor(GraphEmbeddingsQueryService):
|
|
50
50
|
|
51
51
|
for vec in msg.vectors:
|
52
52
|
|
53
|
-
resp = self.vecstore.search(
|
53
|
+
resp = self.vecstore.search(
|
54
|
+
vec,
|
55
|
+
msg.user,
|
56
|
+
msg.collection,
|
57
|
+
limit=msg.limit * 2
|
58
|
+
)
|
54
59
|
|
55
60
|
for r in resp:
|
56
61
|
ent = r["entity"]["entity"]
|
{trustgraph_flow-1.3.17 → trustgraph_flow-1.4.0}/trustgraph/query/triples/memgraph/service.py
RENAMED
@@ -55,6 +55,10 @@ class Processor(TriplesQueryService):
|
|
55
55
|
|
56
56
|
try:
|
57
57
|
|
58
|
+
# Extract user and collection, use defaults if not provided
|
59
|
+
user = query.user if query.user else "default"
|
60
|
+
collection = query.collection if query.collection else "default"
|
61
|
+
|
58
62
|
triples = []
|
59
63
|
|
60
64
|
if query.s is not None:
|
@@ -64,10 +68,13 @@ class Processor(TriplesQueryService):
|
|
64
68
|
# SPO
|
65
69
|
|
66
70
|
records, summary, keys = self.io.execute_query(
|
67
|
-
"MATCH (src:Node {uri: $src
|
71
|
+
"MATCH (src:Node {uri: $src, user: $user, collection: $collection})-"
|
72
|
+
"[rel:Rel {uri: $rel, user: $user, collection: $collection}]->"
|
73
|
+
"(dest:Literal {value: $value, user: $user, collection: $collection}) "
|
68
74
|
"RETURN $src as src "
|
69
75
|
"LIMIT " + str(query.limit),
|
70
76
|
src=query.s.value, rel=query.p.value, value=query.o.value,
|
77
|
+
user=user, collection=collection,
|
71
78
|
database_=self.db,
|
72
79
|
)
|
73
80
|
|
@@ -75,10 +82,13 @@ class Processor(TriplesQueryService):
|
|
75
82
|
triples.append((query.s.value, query.p.value, query.o.value))
|
76
83
|
|
77
84
|
records, summary, keys = self.io.execute_query(
|
78
|
-
"MATCH (src:Node {uri: $src
|
85
|
+
"MATCH (src:Node {uri: $src, user: $user, collection: $collection})-"
|
86
|
+
"[rel:Rel {uri: $rel, user: $user, collection: $collection}]->"
|
87
|
+
"(dest:Node {uri: $uri, user: $user, collection: $collection}) "
|
79
88
|
"RETURN $src as src "
|
80
89
|
"LIMIT " + str(query.limit),
|
81
90
|
src=query.s.value, rel=query.p.value, uri=query.o.value,
|
91
|
+
user=user, collection=collection,
|
82
92
|
database_=self.db,
|
83
93
|
)
|
84
94
|
|
@@ -90,10 +100,13 @@ class Processor(TriplesQueryService):
|
|
90
100
|
# SP
|
91
101
|
|
92
102
|
records, summary, keys = self.io.execute_query(
|
93
|
-
"MATCH (src:Node {uri: $src
|
103
|
+
"MATCH (src:Node {uri: $src, user: $user, collection: $collection})-"
|
104
|
+
"[rel:Rel {uri: $rel, user: $user, collection: $collection}]->"
|
105
|
+
"(dest:Literal {user: $user, collection: $collection}) "
|
94
106
|
"RETURN dest.value as dest "
|
95
107
|
"LIMIT " + str(query.limit),
|
96
108
|
src=query.s.value, rel=query.p.value,
|
109
|
+
user=user, collection=collection,
|
97
110
|
database_=self.db,
|
98
111
|
)
|
99
112
|
|
@@ -102,10 +115,13 @@ class Processor(TriplesQueryService):
|
|
102
115
|
triples.append((query.s.value, query.p.value, data["dest"]))
|
103
116
|
|
104
117
|
records, summary, keys = self.io.execute_query(
|
105
|
-
"MATCH (src:Node {uri: $src
|
118
|
+
"MATCH (src:Node {uri: $src, user: $user, collection: $collection})-"
|
119
|
+
"[rel:Rel {uri: $rel, user: $user, collection: $collection}]->"
|
120
|
+
"(dest:Node {user: $user, collection: $collection}) "
|
106
121
|
"RETURN dest.uri as dest "
|
107
122
|
"LIMIT " + str(query.limit),
|
108
123
|
src=query.s.value, rel=query.p.value,
|
124
|
+
user=user, collection=collection,
|
109
125
|
database_=self.db,
|
110
126
|
)
|
111
127
|
|
@@ -120,10 +136,13 @@ class Processor(TriplesQueryService):
|
|
120
136
|
# SO
|
121
137
|
|
122
138
|
records, summary, keys = self.io.execute_query(
|
123
|
-
"MATCH (src:Node {uri: $src
|
139
|
+
"MATCH (src:Node {uri: $src, user: $user, collection: $collection})-"
|
140
|
+
"[rel:Rel {user: $user, collection: $collection}]->"
|
141
|
+
"(dest:Literal {value: $value, user: $user, collection: $collection}) "
|
124
142
|
"RETURN rel.uri as rel "
|
125
143
|
"LIMIT " + str(query.limit),
|
126
144
|
src=query.s.value, value=query.o.value,
|
145
|
+
user=user, collection=collection,
|
127
146
|
database_=self.db,
|
128
147
|
)
|
129
148
|
|
@@ -132,10 +151,13 @@ class Processor(TriplesQueryService):
|
|
132
151
|
triples.append((query.s.value, data["rel"], query.o.value))
|
133
152
|
|
134
153
|
records, summary, keys = self.io.execute_query(
|
135
|
-
"MATCH (src:Node {uri: $src
|
154
|
+
"MATCH (src:Node {uri: $src, user: $user, collection: $collection})-"
|
155
|
+
"[rel:Rel {user: $user, collection: $collection}]->"
|
156
|
+
"(dest:Node {uri: $uri, user: $user, collection: $collection}) "
|
136
157
|
"RETURN rel.uri as rel "
|
137
158
|
"LIMIT " + str(query.limit),
|
138
159
|
src=query.s.value, uri=query.o.value,
|
160
|
+
user=user, collection=collection,
|
139
161
|
database_=self.db,
|
140
162
|
)
|
141
163
|
|
@@ -148,10 +170,13 @@ class Processor(TriplesQueryService):
|
|
148
170
|
# S
|
149
171
|
|
150
172
|
records, summary, keys = self.io.execute_query(
|
151
|
-
"MATCH (src:Node {uri: $src})-
|
173
|
+
"MATCH (src:Node {uri: $src, user: $user, collection: $collection})-"
|
174
|
+
"[rel:Rel {user: $user, collection: $collection}]->"
|
175
|
+
"(dest:Literal {user: $user, collection: $collection}) "
|
152
176
|
"RETURN rel.uri as rel, dest.value as dest "
|
153
177
|
"LIMIT " + str(query.limit),
|
154
178
|
src=query.s.value,
|
179
|
+
user=user, collection=collection,
|
155
180
|
database_=self.db,
|
156
181
|
)
|
157
182
|
|
@@ -160,10 +185,13 @@ class Processor(TriplesQueryService):
|
|
160
185
|
triples.append((query.s.value, data["rel"], data["dest"]))
|
161
186
|
|
162
187
|
records, summary, keys = self.io.execute_query(
|
163
|
-
"MATCH (src:Node {uri: $src})-
|
188
|
+
"MATCH (src:Node {uri: $src, user: $user, collection: $collection})-"
|
189
|
+
"[rel:Rel {user: $user, collection: $collection}]->"
|
190
|
+
"(dest:Node {user: $user, collection: $collection}) "
|
164
191
|
"RETURN rel.uri as rel, dest.uri as dest "
|
165
192
|
"LIMIT " + str(query.limit),
|
166
193
|
src=query.s.value,
|
194
|
+
user=user, collection=collection,
|
167
195
|
database_=self.db,
|
168
196
|
)
|
169
197
|
|
@@ -181,10 +209,13 @@ class Processor(TriplesQueryService):
|
|
181
209
|
# PO
|
182
210
|
|
183
211
|
records, summary, keys = self.io.execute_query(
|
184
|
-
"MATCH (src:Node
|
212
|
+
"MATCH (src:Node {user: $user, collection: $collection})-"
|
213
|
+
"[rel:Rel {uri: $uri, user: $user, collection: $collection}]->"
|
214
|
+
"(dest:Literal {value: $value, user: $user, collection: $collection}) "
|
185
215
|
"RETURN src.uri as src "
|
186
216
|
"LIMIT " + str(query.limit),
|
187
217
|
uri=query.p.value, value=query.o.value,
|
218
|
+
user=user, collection=collection,
|
188
219
|
database_=self.db,
|
189
220
|
)
|
190
221
|
|
@@ -193,10 +224,13 @@ class Processor(TriplesQueryService):
|
|
193
224
|
triples.append((data["src"], query.p.value, query.o.value))
|
194
225
|
|
195
226
|
records, summary, keys = self.io.execute_query(
|
196
|
-
"MATCH (src:Node
|
227
|
+
"MATCH (src:Node {user: $user, collection: $collection})-"
|
228
|
+
"[rel:Rel {uri: $uri, user: $user, collection: $collection}]->"
|
229
|
+
"(dest:Node {uri: $dest, user: $user, collection: $collection}) "
|
197
230
|
"RETURN src.uri as src "
|
198
231
|
"LIMIT " + str(query.limit),
|
199
232
|
uri=query.p.value, dest=query.o.value,
|
233
|
+
user=user, collection=collection,
|
200
234
|
database_=self.db,
|
201
235
|
)
|
202
236
|
|
@@ -209,10 +243,13 @@ class Processor(TriplesQueryService):
|
|
209
243
|
# P
|
210
244
|
|
211
245
|
records, summary, keys = self.io.execute_query(
|
212
|
-
"MATCH (src:Node
|
246
|
+
"MATCH (src:Node {user: $user, collection: $collection})-"
|
247
|
+
"[rel:Rel {uri: $uri, user: $user, collection: $collection}]->"
|
248
|
+
"(dest:Literal {user: $user, collection: $collection}) "
|
213
249
|
"RETURN src.uri as src, dest.value as dest "
|
214
250
|
"LIMIT " + str(query.limit),
|
215
251
|
uri=query.p.value,
|
252
|
+
user=user, collection=collection,
|
216
253
|
database_=self.db,
|
217
254
|
)
|
218
255
|
|
@@ -221,10 +258,13 @@ class Processor(TriplesQueryService):
|
|
221
258
|
triples.append((data["src"], query.p.value, data["dest"]))
|
222
259
|
|
223
260
|
records, summary, keys = self.io.execute_query(
|
224
|
-
"MATCH (src:Node
|
261
|
+
"MATCH (src:Node {user: $user, collection: $collection})-"
|
262
|
+
"[rel:Rel {uri: $uri, user: $user, collection: $collection}]->"
|
263
|
+
"(dest:Node {user: $user, collection: $collection}) "
|
225
264
|
"RETURN src.uri as src, dest.uri as dest "
|
226
265
|
"LIMIT " + str(query.limit),
|
227
266
|
uri=query.p.value,
|
267
|
+
user=user, collection=collection,
|
228
268
|
database_=self.db,
|
229
269
|
)
|
230
270
|
|
@@ -239,10 +279,13 @@ class Processor(TriplesQueryService):
|
|
239
279
|
# O
|
240
280
|
|
241
281
|
records, summary, keys = self.io.execute_query(
|
242
|
-
"MATCH (src:Node
|
282
|
+
"MATCH (src:Node {user: $user, collection: $collection})-"
|
283
|
+
"[rel:Rel {user: $user, collection: $collection}]->"
|
284
|
+
"(dest:Literal {value: $value, user: $user, collection: $collection}) "
|
243
285
|
"RETURN src.uri as src, rel.uri as rel "
|
244
286
|
"LIMIT " + str(query.limit),
|
245
287
|
value=query.o.value,
|
288
|
+
user=user, collection=collection,
|
246
289
|
database_=self.db,
|
247
290
|
)
|
248
291
|
|
@@ -251,10 +294,13 @@ class Processor(TriplesQueryService):
|
|
251
294
|
triples.append((data["src"], data["rel"], query.o.value))
|
252
295
|
|
253
296
|
records, summary, keys = self.io.execute_query(
|
254
|
-
"MATCH (src:Node
|
297
|
+
"MATCH (src:Node {user: $user, collection: $collection})-"
|
298
|
+
"[rel:Rel {user: $user, collection: $collection}]->"
|
299
|
+
"(dest:Node {uri: $uri, user: $user, collection: $collection}) "
|
255
300
|
"RETURN src.uri as src, rel.uri as rel "
|
256
301
|
"LIMIT " + str(query.limit),
|
257
302
|
uri=query.o.value,
|
303
|
+
user=user, collection=collection,
|
258
304
|
database_=self.db,
|
259
305
|
)
|
260
306
|
|
@@ -267,9 +313,12 @@ class Processor(TriplesQueryService):
|
|
267
313
|
# *
|
268
314
|
|
269
315
|
records, summary, keys = self.io.execute_query(
|
270
|
-
"MATCH (src:Node
|
316
|
+
"MATCH (src:Node {user: $user, collection: $collection})-"
|
317
|
+
"[rel:Rel {user: $user, collection: $collection}]->"
|
318
|
+
"(dest:Literal {user: $user, collection: $collection}) "
|
271
319
|
"RETURN src.uri as src, rel.uri as rel, dest.value as dest "
|
272
320
|
"LIMIT " + str(query.limit),
|
321
|
+
user=user, collection=collection,
|
273
322
|
database_=self.db,
|
274
323
|
)
|
275
324
|
|
@@ -278,9 +327,12 @@ class Processor(TriplesQueryService):
|
|
278
327
|
triples.append((data["src"], data["rel"], data["dest"]))
|
279
328
|
|
280
329
|
records, summary, keys = self.io.execute_query(
|
281
|
-
"MATCH (src:Node
|
330
|
+
"MATCH (src:Node {user: $user, collection: $collection})-"
|
331
|
+
"[rel:Rel {user: $user, collection: $collection}]->"
|
332
|
+
"(dest:Node {user: $user, collection: $collection}) "
|
282
333
|
"RETURN src.uri as src, rel.uri as rel, dest.uri as dest "
|
283
334
|
"LIMIT " + str(query.limit),
|
335
|
+
user=user, collection=collection,
|
284
336
|
database_=self.db,
|
285
337
|
)
|
286
338
|
|