trustgraph-flow 1.2.20__tar.gz → 1.3.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-1.2.20 → trustgraph_flow-1.3.1}/PKG-INFO +2 -2
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/pyproject.toml +1 -1
- trustgraph_flow-1.3.1/trustgraph/flow_version.py +1 -0
- trustgraph_flow-1.3.1/trustgraph/gateway/dispatch/document_embeddings_export.py +91 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/document_embeddings_import.py +10 -2
- trustgraph_flow-1.3.1/trustgraph/gateway/dispatch/entity_contexts_export.py +91 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/entity_contexts_import.py +10 -2
- trustgraph_flow-1.3.1/trustgraph/gateway/dispatch/graph_embeddings_export.py +91 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/graph_embeddings_import.py +10 -2
- trustgraph_flow-1.3.1/trustgraph/gateway/dispatch/triples_export.py +91 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/triples_import.py +10 -2
- trustgraph_flow-1.3.1/trustgraph/gateway/endpoint/socket.py +152 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph_flow.egg-info/PKG-INFO +2 -2
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph_flow.egg-info/requires.txt +1 -1
- trustgraph_flow-1.2.20/trustgraph/flow_version.py +0 -1
- trustgraph_flow-1.2.20/trustgraph/gateway/dispatch/document_embeddings_export.py +0 -71
- trustgraph_flow-1.2.20/trustgraph/gateway/dispatch/entity_contexts_export.py +0 -71
- trustgraph_flow-1.2.20/trustgraph/gateway/dispatch/graph_embeddings_export.py +0 -71
- trustgraph_flow-1.2.20/trustgraph/gateway/dispatch/triples_export.py +0 -71
- trustgraph_flow-1.2.20/trustgraph/gateway/endpoint/socket.py +0 -111
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/README.md +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/setup.cfg +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/agent/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/agent/mcp_tool/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/agent/mcp_tool/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/agent/mcp_tool/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/agent/react/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/agent/react/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/agent/react/agent_manager.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/agent/react/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/agent/react/tools.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/agent/react/types.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/chunking/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/chunking/recursive/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/chunking/recursive/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/chunking/recursive/chunker.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/chunking/token/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/chunking/token/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/chunking/token/chunker.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/config/service/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/config/service/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/config/service/config.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/config/service/flow.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/config/service/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/cores/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/cores/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/cores/knowledge.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/cores/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/decoding/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/decoding/mistral_ocr/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/decoding/mistral_ocr/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/decoding/mistral_ocr/processor.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/decoding/pdf/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/decoding/pdf/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/direct/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/direct/cassandra.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/direct/milvus_object_embeddings.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/document_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/document_embeddings/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/document_embeddings/embeddings.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/fastembed/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/fastembed/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/fastembed/processor.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/graph_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/graph_embeddings/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/graph_embeddings/embeddings.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/ollama/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/ollama/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/embeddings/ollama/processor.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/external/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/external/wikipedia/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/external/wikipedia/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/external/wikipedia/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/agent/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/agent/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/agent/extract.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/definitions/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/definitions/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/definitions/extract.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/objects/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/objects/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/objects/processor.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/relationships/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/relationships/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/relationships/extract.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/topics/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/topics/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/extract/kg/topics/extract.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/auth.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/config/receiver.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/agent.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/config.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/core_export.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/core_import.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/document_load.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/document_rag.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/embeddings.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/flow.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/graph_embeddings_query.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/graph_rag.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/knowledge.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/librarian.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/manager.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/mcp_tool.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/mux.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/prompt.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/requestor.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/sender.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/serialize.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/streamer.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/text_completion.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/text_load.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/triples_query.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/endpoint/constant_endpoint.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/endpoint/manager.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/endpoint/metrics.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/endpoint/stream_endpoint.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/endpoint/variable_endpoint.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/running.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/unused/dbpedia.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/unused/encyclopedia.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/unused/internet_search.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/librarian/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/librarian/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/librarian/blob_store.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/librarian/librarian.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/librarian/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/metering/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/metering/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/metering/counter.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/azure/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/azure/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/azure/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/claude/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/claude/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/claude/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/cohere/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/lmstudio/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/lmstudio/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/lmstudio/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/mistral/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/mistral/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/mistral/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/ollama/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/openai/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/openai/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/openai/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/tgi/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/tgi/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/tgi/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/vllm/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/vllm/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/model/text_completion/vllm/llm.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/processing/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/processing/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/processing/processing.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/prompt/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/prompt/template/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/prompt/template/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/prompt/template/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/doc_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/doc_embeddings/pinecone/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/graph_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/graph_embeddings/pinecone/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/cassandra/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/cassandra/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/cassandra/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/falkordb/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/falkordb/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/falkordb/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/memgraph/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/memgraph/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/memgraph/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/neo4j/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/neo4j/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/query/triples/neo4j/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/retrieval/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/retrieval/document_rag/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/retrieval/document_rag/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/retrieval/document_rag/document_rag.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/retrieval/document_rag/rag.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/retrieval/graph_rag/graph_rag.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/retrieval/graph_rag/rag.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/rev_gateway/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/rev_gateway/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/rev_gateway/dispatcher.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/rev_gateway/service.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/doc_embeddings/pinecone/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/graph_embeddings/pinecone/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/knowledge/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/knowledge/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/knowledge/store.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/object_embeddings/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/objects/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/objects/cassandra/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/objects/cassandra/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/objects/cassandra/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/rows/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/rows/cassandra/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/cassandra/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/falkordb/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/falkordb/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/falkordb/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/memgraph/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/memgraph/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/memgraph/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/storage/triples/neo4j/write.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/tables/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/tables/config.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/tables/knowledge.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/tables/library.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/template/__init__.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/template/prompt_manager.py +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph_flow.egg-info/SOURCES.txt +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph_flow.egg-info/entry_points.txt +0 -0
- {trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/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.3.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
|
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.4,>=1.3
|
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.3,<1.4",
|
14
14
|
"aiohttp",
|
15
15
|
"anthropic",
|
16
16
|
"cassandra-driver",
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "1.3.1"
|
@@ -0,0 +1,91 @@
|
|
1
|
+
|
2
|
+
import asyncio
|
3
|
+
import queue
|
4
|
+
import uuid
|
5
|
+
import logging
|
6
|
+
|
7
|
+
from ... schema import DocumentEmbeddings
|
8
|
+
from ... base import Subscriber
|
9
|
+
|
10
|
+
from . serialize import serialize_document_embeddings
|
11
|
+
|
12
|
+
# Module logger
|
13
|
+
logger = logging.getLogger(__name__)
|
14
|
+
|
15
|
+
class DocumentEmbeddingsExport:
|
16
|
+
|
17
|
+
def __init__(
|
18
|
+
self, ws, running, pulsar_client, queue, consumer, subscriber
|
19
|
+
):
|
20
|
+
|
21
|
+
self.ws = ws
|
22
|
+
self.running = running
|
23
|
+
self.pulsar_client = pulsar_client
|
24
|
+
self.queue = queue
|
25
|
+
self.consumer = consumer
|
26
|
+
self.subscriber = subscriber
|
27
|
+
|
28
|
+
async def destroy(self):
|
29
|
+
# Step 1: Signal stop to prevent new messages
|
30
|
+
self.running.stop()
|
31
|
+
|
32
|
+
# Step 2: Wait briefly for in-flight messages
|
33
|
+
await asyncio.sleep(0.5)
|
34
|
+
|
35
|
+
# Step 3: Unsubscribe and stop subscriber (triggers queue drain)
|
36
|
+
if hasattr(self, 'subs'):
|
37
|
+
await self.subs.unsubscribe_all(self.id)
|
38
|
+
await self.subs.stop()
|
39
|
+
|
40
|
+
# Step 4: Close websocket last
|
41
|
+
if self.ws and not self.ws.closed:
|
42
|
+
await self.ws.close()
|
43
|
+
|
44
|
+
async def receive(self, msg):
|
45
|
+
# Ignore incoming info from websocket
|
46
|
+
pass
|
47
|
+
|
48
|
+
async def run(self):
|
49
|
+
"""Enhanced run with better error handling"""
|
50
|
+
self.subs = Subscriber(
|
51
|
+
client = self.pulsar_client,
|
52
|
+
topic = self.queue,
|
53
|
+
consumer_name = self.consumer,
|
54
|
+
subscription = self.subscriber,
|
55
|
+
schema = DocumentEmbeddings,
|
56
|
+
backpressure_strategy = "block" # Configurable
|
57
|
+
)
|
58
|
+
|
59
|
+
await self.subs.start()
|
60
|
+
|
61
|
+
self.id = str(uuid.uuid4())
|
62
|
+
q = await self.subs.subscribe_all(self.id)
|
63
|
+
|
64
|
+
consecutive_errors = 0
|
65
|
+
max_consecutive_errors = 5
|
66
|
+
|
67
|
+
while self.running.get():
|
68
|
+
try:
|
69
|
+
resp = await asyncio.wait_for(q.get(), timeout=0.5)
|
70
|
+
await self.ws.send_json(serialize_document_embeddings(resp))
|
71
|
+
consecutive_errors = 0 # Reset on success
|
72
|
+
|
73
|
+
except asyncio.TimeoutError:
|
74
|
+
continue
|
75
|
+
|
76
|
+
except queue.Empty:
|
77
|
+
continue
|
78
|
+
|
79
|
+
except Exception as e:
|
80
|
+
logger.error(f"Exception sending to websocket: {str(e)}")
|
81
|
+
consecutive_errors += 1
|
82
|
+
|
83
|
+
if consecutive_errors >= max_consecutive_errors:
|
84
|
+
logger.error("Too many consecutive errors, shutting down")
|
85
|
+
break
|
86
|
+
|
87
|
+
# Brief pause before retry
|
88
|
+
await asyncio.sleep(0.1)
|
89
|
+
|
90
|
+
# Graceful cleanup handled in destroy()
|
91
|
+
|
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
2
|
import asyncio
|
3
3
|
import uuid
|
4
|
+
import logging
|
4
5
|
from aiohttp import WSMsgType
|
5
6
|
|
6
7
|
from ... schema import Metadata
|
@@ -8,6 +9,9 @@ from ... schema import DocumentEmbeddings, ChunkEmbeddings
|
|
8
9
|
from ... base import Publisher
|
9
10
|
from ... messaging.translators.document_loading import DocumentEmbeddingsTranslator
|
10
11
|
|
12
|
+
# Module logger
|
13
|
+
logger = logging.getLogger(__name__)
|
14
|
+
|
11
15
|
class DocumentEmbeddingsImport:
|
12
16
|
|
13
17
|
def __init__(
|
@@ -26,13 +30,17 @@ class DocumentEmbeddingsImport:
|
|
26
30
|
await self.publisher.start()
|
27
31
|
|
28
32
|
async def destroy(self):
|
33
|
+
# Step 1: Stop accepting new messages
|
29
34
|
self.running.stop()
|
30
35
|
|
36
|
+
# Step 2: Wait for publisher to drain its queue
|
37
|
+
logger.info("Draining publisher queue...")
|
38
|
+
await self.publisher.stop()
|
39
|
+
|
40
|
+
# Step 3: Close websocket only after queue is drained
|
31
41
|
if self.ws:
|
32
42
|
await self.ws.close()
|
33
43
|
|
34
|
-
await self.publisher.stop()
|
35
|
-
|
36
44
|
async def receive(self, msg):
|
37
45
|
|
38
46
|
data = msg.json()
|
@@ -0,0 +1,91 @@
|
|
1
|
+
|
2
|
+
import asyncio
|
3
|
+
import queue
|
4
|
+
import uuid
|
5
|
+
import logging
|
6
|
+
|
7
|
+
from ... schema import EntityContexts
|
8
|
+
from ... base import Subscriber
|
9
|
+
|
10
|
+
from . serialize import serialize_entity_contexts
|
11
|
+
|
12
|
+
# Module logger
|
13
|
+
logger = logging.getLogger(__name__)
|
14
|
+
|
15
|
+
class EntityContextsExport:
|
16
|
+
|
17
|
+
def __init__(
|
18
|
+
self, ws, running, pulsar_client, queue, consumer, subscriber
|
19
|
+
):
|
20
|
+
|
21
|
+
self.ws = ws
|
22
|
+
self.running = running
|
23
|
+
self.pulsar_client = pulsar_client
|
24
|
+
self.queue = queue
|
25
|
+
self.consumer = consumer
|
26
|
+
self.subscriber = subscriber
|
27
|
+
|
28
|
+
async def destroy(self):
|
29
|
+
# Step 1: Signal stop to prevent new messages
|
30
|
+
self.running.stop()
|
31
|
+
|
32
|
+
# Step 2: Wait briefly for in-flight messages
|
33
|
+
await asyncio.sleep(0.5)
|
34
|
+
|
35
|
+
# Step 3: Unsubscribe and stop subscriber (triggers queue drain)
|
36
|
+
if hasattr(self, 'subs'):
|
37
|
+
await self.subs.unsubscribe_all(self.id)
|
38
|
+
await self.subs.stop()
|
39
|
+
|
40
|
+
# Step 4: Close websocket last
|
41
|
+
if self.ws and not self.ws.closed:
|
42
|
+
await self.ws.close()
|
43
|
+
|
44
|
+
async def receive(self, msg):
|
45
|
+
# Ignore incoming info from websocket
|
46
|
+
pass
|
47
|
+
|
48
|
+
async def run(self):
|
49
|
+
"""Enhanced run with better error handling"""
|
50
|
+
self.subs = Subscriber(
|
51
|
+
client = self.pulsar_client,
|
52
|
+
topic = self.queue,
|
53
|
+
consumer_name = self.consumer,
|
54
|
+
subscription = self.subscriber,
|
55
|
+
schema = EntityContexts,
|
56
|
+
backpressure_strategy = "block" # Configurable
|
57
|
+
)
|
58
|
+
|
59
|
+
await self.subs.start()
|
60
|
+
|
61
|
+
self.id = str(uuid.uuid4())
|
62
|
+
q = await self.subs.subscribe_all(self.id)
|
63
|
+
|
64
|
+
consecutive_errors = 0
|
65
|
+
max_consecutive_errors = 5
|
66
|
+
|
67
|
+
while self.running.get():
|
68
|
+
try:
|
69
|
+
resp = await asyncio.wait_for(q.get(), timeout=0.5)
|
70
|
+
await self.ws.send_json(serialize_entity_contexts(resp))
|
71
|
+
consecutive_errors = 0 # Reset on success
|
72
|
+
|
73
|
+
except asyncio.TimeoutError:
|
74
|
+
continue
|
75
|
+
|
76
|
+
except queue.Empty:
|
77
|
+
continue
|
78
|
+
|
79
|
+
except Exception as e:
|
80
|
+
logger.error(f"Exception sending to websocket: {str(e)}")
|
81
|
+
consecutive_errors += 1
|
82
|
+
|
83
|
+
if consecutive_errors >= max_consecutive_errors:
|
84
|
+
logger.error("Too many consecutive errors, shutting down")
|
85
|
+
break
|
86
|
+
|
87
|
+
# Brief pause before retry
|
88
|
+
await asyncio.sleep(0.1)
|
89
|
+
|
90
|
+
# Graceful cleanup handled in destroy()
|
91
|
+
|
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
2
|
import asyncio
|
3
3
|
import uuid
|
4
|
+
import logging
|
4
5
|
from aiohttp import WSMsgType
|
5
6
|
|
6
7
|
from ... schema import Metadata
|
@@ -9,6 +10,9 @@ from ... base import Publisher
|
|
9
10
|
|
10
11
|
from . serialize import to_subgraph, to_value
|
11
12
|
|
13
|
+
# Module logger
|
14
|
+
logger = logging.getLogger(__name__)
|
15
|
+
|
12
16
|
class EntityContextsImport:
|
13
17
|
|
14
18
|
def __init__(
|
@@ -26,13 +30,17 @@ class EntityContextsImport:
|
|
26
30
|
await self.publisher.start()
|
27
31
|
|
28
32
|
async def destroy(self):
|
33
|
+
# Step 1: Stop accepting new messages
|
29
34
|
self.running.stop()
|
30
35
|
|
36
|
+
# Step 2: Wait for publisher to drain its queue
|
37
|
+
logger.info("Draining publisher queue...")
|
38
|
+
await self.publisher.stop()
|
39
|
+
|
40
|
+
# Step 3: Close websocket only after queue is drained
|
31
41
|
if self.ws:
|
32
42
|
await self.ws.close()
|
33
43
|
|
34
|
-
await self.publisher.stop()
|
35
|
-
|
36
44
|
async def receive(self, msg):
|
37
45
|
|
38
46
|
data = msg.json()
|
@@ -0,0 +1,91 @@
|
|
1
|
+
|
2
|
+
import asyncio
|
3
|
+
import queue
|
4
|
+
import uuid
|
5
|
+
import logging
|
6
|
+
|
7
|
+
from ... schema import GraphEmbeddings
|
8
|
+
from ... base import Subscriber
|
9
|
+
|
10
|
+
from . serialize import serialize_graph_embeddings
|
11
|
+
|
12
|
+
# Module logger
|
13
|
+
logger = logging.getLogger(__name__)
|
14
|
+
|
15
|
+
class GraphEmbeddingsExport:
|
16
|
+
|
17
|
+
def __init__(
|
18
|
+
self, ws, running, pulsar_client, queue, consumer, subscriber
|
19
|
+
):
|
20
|
+
|
21
|
+
self.ws = ws
|
22
|
+
self.running = running
|
23
|
+
self.pulsar_client = pulsar_client
|
24
|
+
self.queue = queue
|
25
|
+
self.consumer = consumer
|
26
|
+
self.subscriber = subscriber
|
27
|
+
|
28
|
+
async def destroy(self):
|
29
|
+
# Step 1: Signal stop to prevent new messages
|
30
|
+
self.running.stop()
|
31
|
+
|
32
|
+
# Step 2: Wait briefly for in-flight messages
|
33
|
+
await asyncio.sleep(0.5)
|
34
|
+
|
35
|
+
# Step 3: Unsubscribe and stop subscriber (triggers queue drain)
|
36
|
+
if hasattr(self, 'subs'):
|
37
|
+
await self.subs.unsubscribe_all(self.id)
|
38
|
+
await self.subs.stop()
|
39
|
+
|
40
|
+
# Step 4: Close websocket last
|
41
|
+
if self.ws and not self.ws.closed:
|
42
|
+
await self.ws.close()
|
43
|
+
|
44
|
+
async def receive(self, msg):
|
45
|
+
# Ignore incoming info from websocket
|
46
|
+
pass
|
47
|
+
|
48
|
+
async def run(self):
|
49
|
+
"""Enhanced run with better error handling"""
|
50
|
+
self.subs = Subscriber(
|
51
|
+
client = self.pulsar_client,
|
52
|
+
topic = self.queue,
|
53
|
+
consumer_name = self.consumer,
|
54
|
+
subscription = self.subscriber,
|
55
|
+
schema = GraphEmbeddings,
|
56
|
+
backpressure_strategy = "block" # Configurable
|
57
|
+
)
|
58
|
+
|
59
|
+
await self.subs.start()
|
60
|
+
|
61
|
+
self.id = str(uuid.uuid4())
|
62
|
+
q = await self.subs.subscribe_all(self.id)
|
63
|
+
|
64
|
+
consecutive_errors = 0
|
65
|
+
max_consecutive_errors = 5
|
66
|
+
|
67
|
+
while self.running.get():
|
68
|
+
try:
|
69
|
+
resp = await asyncio.wait_for(q.get(), timeout=0.5)
|
70
|
+
await self.ws.send_json(serialize_graph_embeddings(resp))
|
71
|
+
consecutive_errors = 0 # Reset on success
|
72
|
+
|
73
|
+
except asyncio.TimeoutError:
|
74
|
+
continue
|
75
|
+
|
76
|
+
except queue.Empty:
|
77
|
+
continue
|
78
|
+
|
79
|
+
except Exception as e:
|
80
|
+
logger.error(f"Exception sending to websocket: {str(e)}")
|
81
|
+
consecutive_errors += 1
|
82
|
+
|
83
|
+
if consecutive_errors >= max_consecutive_errors:
|
84
|
+
logger.error("Too many consecutive errors, shutting down")
|
85
|
+
break
|
86
|
+
|
87
|
+
# Brief pause before retry
|
88
|
+
await asyncio.sleep(0.1)
|
89
|
+
|
90
|
+
# Graceful cleanup handled in destroy()
|
91
|
+
|
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
2
|
import asyncio
|
3
3
|
import uuid
|
4
|
+
import logging
|
4
5
|
from aiohttp import WSMsgType
|
5
6
|
|
6
7
|
from ... schema import Metadata
|
@@ -9,6 +10,9 @@ from ... base import Publisher
|
|
9
10
|
|
10
11
|
from . serialize import to_subgraph, to_value
|
11
12
|
|
13
|
+
# Module logger
|
14
|
+
logger = logging.getLogger(__name__)
|
15
|
+
|
12
16
|
class GraphEmbeddingsImport:
|
13
17
|
|
14
18
|
def __init__(
|
@@ -26,13 +30,17 @@ class GraphEmbeddingsImport:
|
|
26
30
|
await self.publisher.start()
|
27
31
|
|
28
32
|
async def destroy(self):
|
33
|
+
# Step 1: Stop accepting new messages
|
29
34
|
self.running.stop()
|
30
35
|
|
36
|
+
# Step 2: Wait for publisher to drain its queue
|
37
|
+
logger.info("Draining publisher queue...")
|
38
|
+
await self.publisher.stop()
|
39
|
+
|
40
|
+
# Step 3: Close websocket only after queue is drained
|
31
41
|
if self.ws:
|
32
42
|
await self.ws.close()
|
33
43
|
|
34
|
-
await self.publisher.stop()
|
35
|
-
|
36
44
|
async def receive(self, msg):
|
37
45
|
|
38
46
|
data = msg.json()
|
@@ -0,0 +1,91 @@
|
|
1
|
+
|
2
|
+
import asyncio
|
3
|
+
import queue
|
4
|
+
import uuid
|
5
|
+
import logging
|
6
|
+
|
7
|
+
from ... schema import Triples
|
8
|
+
from ... base import Subscriber
|
9
|
+
|
10
|
+
from . serialize import serialize_triples
|
11
|
+
|
12
|
+
# Module logger
|
13
|
+
logger = logging.getLogger(__name__)
|
14
|
+
|
15
|
+
class TriplesExport:
|
16
|
+
|
17
|
+
def __init__(
|
18
|
+
self, ws, running, pulsar_client, queue, consumer, subscriber
|
19
|
+
):
|
20
|
+
|
21
|
+
self.ws = ws
|
22
|
+
self.running = running
|
23
|
+
self.pulsar_client = pulsar_client
|
24
|
+
self.queue = queue
|
25
|
+
self.consumer = consumer
|
26
|
+
self.subscriber = subscriber
|
27
|
+
|
28
|
+
async def destroy(self):
|
29
|
+
# Step 1: Signal stop to prevent new messages
|
30
|
+
self.running.stop()
|
31
|
+
|
32
|
+
# Step 2: Wait briefly for in-flight messages
|
33
|
+
await asyncio.sleep(0.5)
|
34
|
+
|
35
|
+
# Step 3: Unsubscribe and stop subscriber (triggers queue drain)
|
36
|
+
if hasattr(self, 'subs'):
|
37
|
+
await self.subs.unsubscribe_all(self.id)
|
38
|
+
await self.subs.stop()
|
39
|
+
|
40
|
+
# Step 4: Close websocket last
|
41
|
+
if self.ws and not self.ws.closed:
|
42
|
+
await self.ws.close()
|
43
|
+
|
44
|
+
async def receive(self, msg):
|
45
|
+
# Ignore incoming info from websocket
|
46
|
+
pass
|
47
|
+
|
48
|
+
async def run(self):
|
49
|
+
"""Enhanced run with better error handling"""
|
50
|
+
self.subs = Subscriber(
|
51
|
+
client = self.pulsar_client,
|
52
|
+
topic = self.queue,
|
53
|
+
consumer_name = self.consumer,
|
54
|
+
subscription = self.subscriber,
|
55
|
+
schema = Triples,
|
56
|
+
backpressure_strategy = "block" # Configurable
|
57
|
+
)
|
58
|
+
|
59
|
+
await self.subs.start()
|
60
|
+
|
61
|
+
self.id = str(uuid.uuid4())
|
62
|
+
q = await self.subs.subscribe_all(self.id)
|
63
|
+
|
64
|
+
consecutive_errors = 0
|
65
|
+
max_consecutive_errors = 5
|
66
|
+
|
67
|
+
while self.running.get():
|
68
|
+
try:
|
69
|
+
resp = await asyncio.wait_for(q.get(), timeout=0.5)
|
70
|
+
await self.ws.send_json(serialize_triples(resp))
|
71
|
+
consecutive_errors = 0 # Reset on success
|
72
|
+
|
73
|
+
except asyncio.TimeoutError:
|
74
|
+
continue
|
75
|
+
|
76
|
+
except queue.Empty:
|
77
|
+
continue
|
78
|
+
|
79
|
+
except Exception as e:
|
80
|
+
logger.error(f"Exception sending to websocket: {str(e)}")
|
81
|
+
consecutive_errors += 1
|
82
|
+
|
83
|
+
if consecutive_errors >= max_consecutive_errors:
|
84
|
+
logger.error("Too many consecutive errors, shutting down")
|
85
|
+
break
|
86
|
+
|
87
|
+
# Brief pause before retry
|
88
|
+
await asyncio.sleep(0.1)
|
89
|
+
|
90
|
+
# Graceful cleanup handled in destroy()
|
91
|
+
|
{trustgraph_flow-1.2.20 → trustgraph_flow-1.3.1}/trustgraph/gateway/dispatch/triples_import.py
RENAMED
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
2
|
import asyncio
|
3
3
|
import uuid
|
4
|
+
import logging
|
4
5
|
from aiohttp import WSMsgType
|
5
6
|
|
6
7
|
from ... schema import Metadata
|
@@ -9,6 +10,9 @@ from ... base import Publisher
|
|
9
10
|
|
10
11
|
from . serialize import to_subgraph
|
11
12
|
|
13
|
+
# Module logger
|
14
|
+
logger = logging.getLogger(__name__)
|
15
|
+
|
12
16
|
class TriplesImport:
|
13
17
|
|
14
18
|
def __init__(
|
@@ -26,13 +30,17 @@ class TriplesImport:
|
|
26
30
|
await self.publisher.start()
|
27
31
|
|
28
32
|
async def destroy(self):
|
33
|
+
# Step 1: Stop accepting new messages
|
29
34
|
self.running.stop()
|
30
35
|
|
36
|
+
# Step 2: Wait for publisher to drain its queue
|
37
|
+
logger.info("Draining publisher queue...")
|
38
|
+
await self.publisher.stop()
|
39
|
+
|
40
|
+
# Step 3: Close websocket only after queue is drained
|
31
41
|
if self.ws:
|
32
42
|
await self.ws.close()
|
33
43
|
|
34
|
-
await self.publisher.stop()
|
35
|
-
|
36
44
|
async def receive(self, msg):
|
37
45
|
|
38
46
|
data = msg.json()
|
@@ -0,0 +1,152 @@
|
|
1
|
+
|
2
|
+
import asyncio
|
3
|
+
from aiohttp import web, WSMsgType
|
4
|
+
import logging
|
5
|
+
|
6
|
+
from .. running import Running
|
7
|
+
|
8
|
+
logger = logging.getLogger("socket")
|
9
|
+
logger.setLevel(logging.INFO)
|
10
|
+
|
11
|
+
class SocketEndpoint:
|
12
|
+
|
13
|
+
def __init__(
|
14
|
+
self, endpoint_path, auth, dispatcher,
|
15
|
+
):
|
16
|
+
|
17
|
+
self.path = endpoint_path
|
18
|
+
self.auth = auth
|
19
|
+
self.operation = "socket"
|
20
|
+
|
21
|
+
self.dispatcher = dispatcher
|
22
|
+
|
23
|
+
async def worker(self, ws, dispatcher, running):
|
24
|
+
|
25
|
+
await dispatcher.run()
|
26
|
+
|
27
|
+
async def listener(self, ws, dispatcher, running):
|
28
|
+
"""Enhanced listener with graceful shutdown"""
|
29
|
+
try:
|
30
|
+
async for msg in ws:
|
31
|
+
# On error, finish
|
32
|
+
if msg.type == WSMsgType.TEXT:
|
33
|
+
await dispatcher.receive(msg)
|
34
|
+
continue
|
35
|
+
elif msg.type == WSMsgType.BINARY:
|
36
|
+
await dispatcher.receive(msg)
|
37
|
+
continue
|
38
|
+
else:
|
39
|
+
# Graceful shutdown on close
|
40
|
+
logger.info("Websocket closing, initiating graceful shutdown")
|
41
|
+
running.stop()
|
42
|
+
|
43
|
+
# Allow time for dispatcher cleanup
|
44
|
+
await asyncio.sleep(1.0)
|
45
|
+
|
46
|
+
# Close websocket if not already closed
|
47
|
+
if not ws.closed:
|
48
|
+
await ws.close()
|
49
|
+
break
|
50
|
+
else:
|
51
|
+
# This executes when the async for loop completes normally (no break)
|
52
|
+
logger.debug("Websocket iteration completed, performing cleanup")
|
53
|
+
running.stop()
|
54
|
+
if not ws.closed:
|
55
|
+
await ws.close()
|
56
|
+
except Exception:
|
57
|
+
# Handle exceptions and cleanup
|
58
|
+
running.stop()
|
59
|
+
if not ws.closed:
|
60
|
+
await ws.close()
|
61
|
+
raise
|
62
|
+
|
63
|
+
async def handle(self, request):
|
64
|
+
"""Enhanced handler with better cleanup"""
|
65
|
+
try:
|
66
|
+
token = request.query['token']
|
67
|
+
except:
|
68
|
+
token = ""
|
69
|
+
|
70
|
+
if not self.auth.permitted(token, self.operation):
|
71
|
+
return web.HTTPUnauthorized()
|
72
|
+
|
73
|
+
# 50MB max message size
|
74
|
+
ws = web.WebSocketResponse(max_msg_size=52428800)
|
75
|
+
|
76
|
+
await ws.prepare(request)
|
77
|
+
|
78
|
+
dispatcher = None
|
79
|
+
|
80
|
+
try:
|
81
|
+
|
82
|
+
async with asyncio.TaskGroup() as tg:
|
83
|
+
|
84
|
+
running = Running()
|
85
|
+
|
86
|
+
dispatcher = await self.dispatcher(
|
87
|
+
ws, running, request.match_info
|
88
|
+
)
|
89
|
+
|
90
|
+
worker_task = tg.create_task(
|
91
|
+
self.worker(ws, dispatcher, running)
|
92
|
+
)
|
93
|
+
|
94
|
+
lsnr_task = tg.create_task(
|
95
|
+
self.listener(ws, dispatcher, running)
|
96
|
+
)
|
97
|
+
|
98
|
+
logger.debug("Created task group, waiting for completion...")
|
99
|
+
|
100
|
+
# Wait for threads to complete
|
101
|
+
|
102
|
+
logger.debug("Task group closed")
|
103
|
+
|
104
|
+
except ExceptionGroup as e:
|
105
|
+
|
106
|
+
logger.error("Exception group occurred:", exc_info=True)
|
107
|
+
|
108
|
+
for se in e.exceptions:
|
109
|
+
logger.error(f" Exception type: {type(se)}")
|
110
|
+
logger.error(f" Exception: {se}")
|
111
|
+
|
112
|
+
# Attempt graceful dispatcher shutdown
|
113
|
+
if dispatcher and hasattr(dispatcher, 'destroy'):
|
114
|
+
try:
|
115
|
+
await asyncio.wait_for(
|
116
|
+
dispatcher.destroy(),
|
117
|
+
timeout=5.0
|
118
|
+
)
|
119
|
+
except asyncio.TimeoutError:
|
120
|
+
logger.warning("Dispatcher shutdown timed out")
|
121
|
+
except Exception as de:
|
122
|
+
logger.error(f"Error during dispatcher cleanup: {de}")
|
123
|
+
|
124
|
+
except Exception as e:
|
125
|
+
logger.error(f"Socket exception: {e}", exc_info=True)
|
126
|
+
|
127
|
+
finally:
|
128
|
+
# Ensure dispatcher cleanup
|
129
|
+
if dispatcher and hasattr(dispatcher, 'destroy'):
|
130
|
+
try:
|
131
|
+
await dispatcher.destroy()
|
132
|
+
except Exception as de:
|
133
|
+
logger.error(f"Error in final dispatcher cleanup: {de}")
|
134
|
+
|
135
|
+
# Ensure websocket is closed
|
136
|
+
if ws and not ws.closed:
|
137
|
+
await ws.close()
|
138
|
+
|
139
|
+
return ws
|
140
|
+
|
141
|
+
async def start(self):
|
142
|
+
pass
|
143
|
+
|
144
|
+
async def stop(self):
|
145
|
+
self.running.stop()
|
146
|
+
|
147
|
+
def add_routes(self, app):
|
148
|
+
|
149
|
+
app.add_routes([
|
150
|
+
web.get(self.path, self.handle),
|
151
|
+
])
|
152
|
+
|