trustgraph-flow 0.17.3__tar.gz → 0.17.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/PKG-INFO +2 -2
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/setup.py +0 -1
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/endpoint.py +17 -27
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/graph_embeddings_load.py +3 -5
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/graph_embeddings_stream.py +7 -8
- trustgraph-flow-0.17.5/trustgraph/api/gateway/publisher.py +53 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/service.py +9 -30
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/socket.py +0 -6
- trustgraph-flow-0.17.5/trustgraph/api/gateway/subscriber.py +109 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/triples_load.py +3 -5
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/triples_stream.py +7 -8
- trustgraph-flow-0.17.5/trustgraph/flow_version.py +1 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph_flow.egg-info/PKG-INFO +2 -2
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph_flow.egg-info/requires.txt +0 -1
- trustgraph-flow-0.17.3/trustgraph/api/gateway/publisher.py +0 -39
- trustgraph-flow-0.17.3/trustgraph/api/gateway/subscriber.py +0 -66
- trustgraph-flow-0.17.3/trustgraph/flow_version.py +0 -1
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/README.md +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/agent-manager-react +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/api-gateway +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/chunker-recursive +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/chunker-token +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/de-query-milvus +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/de-query-pinecone +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/de-query-qdrant +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/de-write-milvus +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/de-write-pinecone +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/de-write-qdrant +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/document-rag +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/embeddings-ollama +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/embeddings-vectorize +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/ge-query-milvus +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/ge-query-pinecone +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/ge-query-qdrant +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/ge-write-milvus +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/ge-write-pinecone +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/ge-write-qdrant +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/graph-rag +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/kg-extract-definitions +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/kg-extract-relationships +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/kg-extract-topics +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/metering +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/object-extract-row +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/oe-write-milvus +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/pdf-decoder +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/prompt-generic +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/prompt-template +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/rows-write-cassandra +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/run-processing +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/text-completion-azure +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/text-completion-azure-openai +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/text-completion-claude +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/text-completion-cohere +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/text-completion-googleaistudio +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/text-completion-llamafile +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/text-completion-ollama +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/text-completion-openai +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/triples-query-cassandra +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/triples-query-neo4j +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/triples-write-cassandra +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/triples-write-neo4j +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/scripts/wikipedia-lookup +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/setup.cfg +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/agent/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/agent/react/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/agent/react/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/agent/react/agent_manager.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/agent/react/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/agent/react/tools.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/agent/react/types.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/agent.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/auth.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/dbpedia.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/embeddings.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/encyclopedia.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/graph_rag.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/internet_search.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/prompt.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/running.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/serialize.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/text_completion.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/triples_query.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/chunking/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/chunking/recursive/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/chunking/recursive/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/chunking/recursive/chunker.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/chunking/token/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/chunking/token/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/chunking/token/chunker.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/decoding/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/decoding/pdf/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/decoding/pdf/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/direct/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/direct/cassandra.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/direct/milvus_object_embeddings.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/document_rag.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/embeddings/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/embeddings/ollama/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/embeddings/ollama/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/embeddings/ollama/processor.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/embeddings/vectorize/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/embeddings/vectorize/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/embeddings/vectorize/vectorize.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/external/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/external/wikipedia/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/external/wikipedia/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/external/wikipedia/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/kg/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/kg/definitions/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/kg/definitions/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/kg/definitions/extract.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/kg/relationships/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/kg/relationships/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/kg/relationships/extract.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/kg/topics/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/kg/topics/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/kg/topics/extract.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/object/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/object/row/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/object/row/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/extract/object/row/extract.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/graph_rag.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/metering/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/metering/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/metering/counter.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/metering/pricelist.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/prompt/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/prompt/generic/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/prompt/generic/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/prompt/generic/prompts.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/prompt/generic/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/prompt/template/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/prompt/template/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/prompt/template/prompt_manager.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/prompt/template/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/azure/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/azure/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/azure/llm.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/claude/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/claude/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/claude/llm.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/cohere/llm.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/ollama/llm.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/openai/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/openai/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/model/text_completion/openai/llm.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/processing/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/processing/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/processing/processing.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/doc_embeddings/pinecone/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/graph_embeddings/pinecone/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/triples/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/triples/cassandra/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/query/triples/neo4j/service.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/retrieval/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/retrieval/document_rag/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/retrieval/document_rag/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/retrieval/document_rag/rag.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/retrieval/graph_rag/rag.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/doc_embeddings/pinecone/write.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/graph_embeddings/pinecone/write.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/object_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/rows/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/rows/cassandra/write.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/triples/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/triples/cassandra/write.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/storage/triples/neo4j/write.py +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph_flow.egg-info/SOURCES.txt +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
- {trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph_flow.egg-info/top_level.txt +0 -0
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: trustgraph-flow
|
3
|
-
Version: 0.17.
|
3
|
+
Version: 0.17.5
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
5
5
|
Home-page: https://github.com/trustgraph-ai/trustgraph
|
6
6
|
Author: trustgraph.ai
|
7
7
|
Author-email: security@trustgraph.ai
|
8
8
|
License: UNKNOWN
|
9
|
-
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.17.
|
9
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.17.5.tar.gz
|
10
10
|
Platform: UNKNOWN
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
12
12
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
@@ -41,15 +41,10 @@ class ServiceEndpoint:
|
|
41
41
|
|
42
42
|
self.operation = "service"
|
43
43
|
|
44
|
-
async def start(self
|
44
|
+
async def start(self):
|
45
45
|
|
46
|
-
self.
|
47
|
-
self.
|
48
|
-
|
49
|
-
async def join(self):
|
50
|
-
|
51
|
-
await self.pub_task
|
52
|
-
await self.sub_task
|
46
|
+
self.pub.start()
|
47
|
+
self.sub.start()
|
53
48
|
|
54
49
|
def add_routes(self, app):
|
55
50
|
|
@@ -87,20 +82,18 @@ class ServiceEndpoint:
|
|
87
82
|
|
88
83
|
print(data)
|
89
84
|
|
90
|
-
q =
|
85
|
+
q = self.sub.subscribe(id)
|
91
86
|
|
92
|
-
await
|
93
|
-
id,
|
94
|
-
self.to_request(data),
|
87
|
+
await asyncio.to_thread(
|
88
|
+
self.pub.send, id, self.to_request(data)
|
95
89
|
)
|
96
|
-
print("Request sent")
|
97
90
|
|
98
91
|
try:
|
99
|
-
resp = await asyncio.
|
100
|
-
except:
|
101
|
-
raise RuntimeError("Timeout
|
92
|
+
resp = await asyncio.to_thread(q.get, timeout=self.timeout)
|
93
|
+
except Exception as e:
|
94
|
+
raise RuntimeError("Timeout")
|
102
95
|
|
103
|
-
print(
|
96
|
+
print(resp)
|
104
97
|
|
105
98
|
if resp.error:
|
106
99
|
print("Error")
|
@@ -108,8 +101,6 @@ class ServiceEndpoint:
|
|
108
101
|
{ "error": resp.error.message }
|
109
102
|
)
|
110
103
|
|
111
|
-
print("Send response")
|
112
|
-
|
113
104
|
return web.json_response(
|
114
105
|
self.from_response(resp)
|
115
106
|
)
|
@@ -122,7 +113,7 @@ class ServiceEndpoint:
|
|
122
113
|
)
|
123
114
|
|
124
115
|
finally:
|
125
|
-
|
116
|
+
self.sub.unsubscribe(id)
|
126
117
|
|
127
118
|
|
128
119
|
class MultiResponseServiceEndpoint(ServiceEndpoint):
|
@@ -135,11 +126,10 @@ class MultiResponseServiceEndpoint(ServiceEndpoint):
|
|
135
126
|
|
136
127
|
data = await request.json()
|
137
128
|
|
138
|
-
q =
|
129
|
+
q = self.sub.subscribe(id)
|
139
130
|
|
140
|
-
await
|
141
|
-
id,
|
142
|
-
self.to_request(data),
|
131
|
+
await asyncio.to_thread(
|
132
|
+
self.pub.send, id, self.to_request(data)
|
143
133
|
)
|
144
134
|
|
145
135
|
# Keeps looking at responses...
|
@@ -147,8 +137,8 @@ class MultiResponseServiceEndpoint(ServiceEndpoint):
|
|
147
137
|
while True:
|
148
138
|
|
149
139
|
try:
|
150
|
-
resp = await asyncio.
|
151
|
-
except:
|
140
|
+
resp = await asyncio.to_thread(q.get, timeout=self.timeout)
|
141
|
+
except Exception as e:
|
152
142
|
raise RuntimeError("Timeout waiting for response")
|
153
143
|
|
154
144
|
if resp.error:
|
@@ -173,4 +163,4 @@ class MultiResponseServiceEndpoint(ServiceEndpoint):
|
|
173
163
|
)
|
174
164
|
|
175
165
|
finally:
|
176
|
-
|
166
|
+
self.sub.unsubscribe(id)
|
{trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/graph_embeddings_load.py
RENAMED
@@ -29,11 +29,9 @@ class GraphEmbeddingsLoadEndpoint(SocketEndpoint):
|
|
29
29
|
schema=JsonSchema(GraphEmbeddings)
|
30
30
|
)
|
31
31
|
|
32
|
-
async def start(self
|
32
|
+
async def start(self):
|
33
33
|
|
34
|
-
self.
|
35
|
-
self.publisher.run(client)
|
36
|
-
)
|
34
|
+
self.publisher.start()
|
37
35
|
|
38
36
|
async def listener(self, ws, running):
|
39
37
|
|
@@ -56,7 +54,7 @@ class GraphEmbeddingsLoadEndpoint(SocketEndpoint):
|
|
56
54
|
vectors=data["vectors"],
|
57
55
|
)
|
58
56
|
|
59
|
-
|
57
|
+
self.publisher.send(None, elt)
|
60
58
|
|
61
59
|
|
62
60
|
running.stop()
|
{trustgraph-flow-0.17.3 → trustgraph-flow-0.17.5}/trustgraph/api/gateway/graph_embeddings_stream.py
RENAMED
@@ -1,5 +1,6 @@
|
|
1
1
|
|
2
2
|
import asyncio
|
3
|
+
import queue
|
3
4
|
from pulsar.schema import JsonSchema
|
4
5
|
import uuid
|
5
6
|
|
@@ -28,31 +29,29 @@ class GraphEmbeddingsStreamEndpoint(SocketEndpoint):
|
|
28
29
|
schema=JsonSchema(GraphEmbeddings)
|
29
30
|
)
|
30
31
|
|
31
|
-
async def start(self
|
32
|
+
async def start(self):
|
32
33
|
|
33
|
-
self.
|
34
|
-
self.subscriber.run(client)
|
35
|
-
)
|
34
|
+
self.subscriber.start()
|
36
35
|
|
37
36
|
async def async_thread(self, ws, running):
|
38
37
|
|
39
38
|
id = str(uuid.uuid4())
|
40
39
|
|
41
|
-
q =
|
40
|
+
q = self.subscriber.subscribe_all(id)
|
42
41
|
|
43
42
|
while running.get():
|
44
43
|
try:
|
45
|
-
resp = await asyncio.
|
44
|
+
resp = await asyncio.to_thread(q.get, timeout=0.5)
|
46
45
|
await ws.send_json(serialize_graph_embeddings(resp))
|
47
46
|
|
48
|
-
except
|
47
|
+
except queue.Empty:
|
49
48
|
continue
|
50
49
|
|
51
50
|
except Exception as e:
|
52
51
|
print(f"Exception: {str(e)}", flush=True)
|
53
52
|
break
|
54
53
|
|
55
|
-
|
54
|
+
self.subscriber.unsubscribe_all(id)
|
56
55
|
|
57
56
|
running.stop()
|
58
57
|
|
@@ -0,0 +1,53 @@
|
|
1
|
+
|
2
|
+
import queue
|
3
|
+
import time
|
4
|
+
import pulsar
|
5
|
+
import threading
|
6
|
+
|
7
|
+
class Publisher:
|
8
|
+
|
9
|
+
def __init__(self, pulsar_host, topic, schema=None, max_size=10,
|
10
|
+
chunking_enabled=False):
|
11
|
+
self.pulsar_host = pulsar_host
|
12
|
+
self.topic = topic
|
13
|
+
self.schema = schema
|
14
|
+
self.q = queue.Queue(maxsize=max_size)
|
15
|
+
self.chunking_enabled = chunking_enabled
|
16
|
+
|
17
|
+
def start(self):
|
18
|
+
self.task = threading.Thread(target=self.run)
|
19
|
+
self.task.start()
|
20
|
+
|
21
|
+
def run(self):
|
22
|
+
|
23
|
+
while True:
|
24
|
+
|
25
|
+
try:
|
26
|
+
|
27
|
+
client = pulsar.Client(
|
28
|
+
self.pulsar_host,
|
29
|
+
)
|
30
|
+
|
31
|
+
producer = client.create_producer(
|
32
|
+
topic=self.topic,
|
33
|
+
schema=self.schema,
|
34
|
+
chunking_enabled=self.chunking_enabled,
|
35
|
+
)
|
36
|
+
|
37
|
+
while True:
|
38
|
+
|
39
|
+
id, item = self.q.get()
|
40
|
+
|
41
|
+
if id:
|
42
|
+
producer.send(item, { "id": id })
|
43
|
+
else:
|
44
|
+
producer.send(item)
|
45
|
+
|
46
|
+
except Exception as e:
|
47
|
+
print("Exception:", e, flush=True)
|
48
|
+
|
49
|
+
# If handler drops out, sleep a retry
|
50
|
+
time.sleep(2)
|
51
|
+
|
52
|
+
def send(self, id, msg):
|
53
|
+
self.q.put((id, msg))
|
@@ -17,7 +17,6 @@ from aiohttp import web
|
|
17
17
|
import logging
|
18
18
|
import os
|
19
19
|
import base64
|
20
|
-
import aiopulsar
|
21
20
|
|
22
21
|
import pulsar
|
23
22
|
from pulsar.schema import JsonSchema
|
@@ -167,7 +166,8 @@ class Api:
|
|
167
166
|
# content is valid base64
|
168
167
|
doc = base64.b64decode(data["data"])
|
169
168
|
|
170
|
-
resp = await
|
169
|
+
resp = await asyncio.to_thread(
|
170
|
+
self.document_out.send,
|
171
171
|
None,
|
172
172
|
Document(
|
173
173
|
metadata=Metadata(
|
@@ -212,7 +212,8 @@ class Api:
|
|
212
212
|
# Text is base64 encoded
|
213
213
|
text = base64.b64decode(data["text"]).decode(charset)
|
214
214
|
|
215
|
-
resp = await
|
215
|
+
resp = await asyncio.to_thread(
|
216
|
+
self.text_out.send,
|
216
217
|
None,
|
217
218
|
TextDocument(
|
218
219
|
metadata=Metadata(
|
@@ -238,35 +239,13 @@ class Api:
|
|
238
239
|
{ "error": str(e) }
|
239
240
|
)
|
240
241
|
|
241
|
-
async def run_endpoints(self):
|
242
|
-
|
243
|
-
async with aiopulsar.connect(self.pulsar_host) as client:
|
244
|
-
|
245
|
-
for ep in self.endpoints:
|
246
|
-
await ep.start(client)
|
247
|
-
|
248
|
-
self.doc_ingest_pub_task = asyncio.create_task(
|
249
|
-
self.document_out.run(client)
|
250
|
-
)
|
251
|
-
|
252
|
-
self.text_ingest_pub_task = asyncio.create_task(
|
253
|
-
self.text_out.run(client)
|
254
|
-
)
|
255
|
-
|
256
|
-
print("Endpoints are running...")
|
257
|
-
|
258
|
-
# They never exit
|
259
|
-
for ep in self.endpoints:
|
260
|
-
await ep.join()
|
261
|
-
|
262
|
-
await self.doc_ingest_pub_task
|
263
|
-
await self.text_ingest_pub_task
|
264
|
-
|
265
|
-
print("Endpoints are stopped.")
|
266
|
-
|
267
242
|
async def app_factory(self):
|
268
243
|
|
269
|
-
|
244
|
+
for ep in self.endpoints:
|
245
|
+
await ep.start()
|
246
|
+
|
247
|
+
self.document_out.start()
|
248
|
+
self.text_out.start()
|
270
249
|
|
271
250
|
return self.app
|
272
251
|
|
@@ -0,0 +1,109 @@
|
|
1
|
+
|
2
|
+
import queue
|
3
|
+
import pulsar
|
4
|
+
import threading
|
5
|
+
import time
|
6
|
+
|
7
|
+
class Subscriber:
|
8
|
+
|
9
|
+
def __init__(self, pulsar_host, topic, subscription, consumer_name,
|
10
|
+
schema=None, max_size=100):
|
11
|
+
self.pulsar_host = pulsar_host
|
12
|
+
self.topic = topic
|
13
|
+
self.subscription = subscription
|
14
|
+
self.consumer_name = consumer_name
|
15
|
+
self.schema = schema
|
16
|
+
self.q = {}
|
17
|
+
self.full = {}
|
18
|
+
self.max_size = max_size
|
19
|
+
self.lock = threading.Lock()
|
20
|
+
|
21
|
+
def start(self):
|
22
|
+
self.task = threading.Thread(target=self.run)
|
23
|
+
self.task.start()
|
24
|
+
|
25
|
+
def run(self):
|
26
|
+
|
27
|
+
while True:
|
28
|
+
|
29
|
+
try:
|
30
|
+
|
31
|
+
client = pulsar.Client(
|
32
|
+
self.pulsar_host,
|
33
|
+
)
|
34
|
+
|
35
|
+
consumer = client.subscribe(
|
36
|
+
topic=self.topic,
|
37
|
+
subscription_name=self.subscription,
|
38
|
+
consumer_name=self.consumer_name,
|
39
|
+
schema=self.schema,
|
40
|
+
)
|
41
|
+
|
42
|
+
while True:
|
43
|
+
|
44
|
+
msg = consumer.receive()
|
45
|
+
|
46
|
+
# Acknowledge successful reception of the message
|
47
|
+
consumer.acknowledge(msg)
|
48
|
+
|
49
|
+
try:
|
50
|
+
id = msg.properties()["id"]
|
51
|
+
except:
|
52
|
+
id = None
|
53
|
+
|
54
|
+
value = msg.value()
|
55
|
+
|
56
|
+
with self.lock:
|
57
|
+
|
58
|
+
if id in self.q:
|
59
|
+
try:
|
60
|
+
self.q[id].put(value, timeout=0.5)
|
61
|
+
except:
|
62
|
+
pass
|
63
|
+
|
64
|
+
for q in self.full.values():
|
65
|
+
try:
|
66
|
+
q.put(value, timeout=0.5)
|
67
|
+
except:
|
68
|
+
pass
|
69
|
+
|
70
|
+
except Exception as e:
|
71
|
+
print("Exception:", e, flush=True)
|
72
|
+
|
73
|
+
# If handler drops out, sleep a retry
|
74
|
+
time.sleep(2)
|
75
|
+
|
76
|
+
def subscribe(self, id):
|
77
|
+
|
78
|
+
with self.lock:
|
79
|
+
|
80
|
+
q = queue.Queue(maxsize=self.max_size)
|
81
|
+
self.q[id] = q
|
82
|
+
|
83
|
+
return q
|
84
|
+
|
85
|
+
def unsubscribe(self, id):
|
86
|
+
|
87
|
+
with self.lock:
|
88
|
+
|
89
|
+
if id in self.q:
|
90
|
+
# self.q[id].shutdown(immediate=True)
|
91
|
+
del self.q[id]
|
92
|
+
|
93
|
+
def subscribe_all(self, id):
|
94
|
+
|
95
|
+
with self.lock:
|
96
|
+
|
97
|
+
q = queue.Queue(maxsize=self.max_size)
|
98
|
+
self.full[id] = q
|
99
|
+
|
100
|
+
return q
|
101
|
+
|
102
|
+
def unsubscribe_all(self, id):
|
103
|
+
|
104
|
+
with self.lock:
|
105
|
+
|
106
|
+
if id in self.full:
|
107
|
+
# self.full[id].shutdown(immediate=True)
|
108
|
+
del self.full[id]
|
109
|
+
|
@@ -27,11 +27,9 @@ class TriplesLoadEndpoint(SocketEndpoint):
|
|
27
27
|
schema=JsonSchema(Triples)
|
28
28
|
)
|
29
29
|
|
30
|
-
async def start(self
|
30
|
+
async def start(self):
|
31
31
|
|
32
|
-
self.
|
33
|
-
self.publisher.run(client)
|
34
|
-
)
|
32
|
+
self.publisher.start()
|
35
33
|
|
36
34
|
async def listener(self, ws, running):
|
37
35
|
|
@@ -53,7 +51,7 @@ class TriplesLoadEndpoint(SocketEndpoint):
|
|
53
51
|
triples=to_subgraph(data["triples"]),
|
54
52
|
)
|
55
53
|
|
56
|
-
|
54
|
+
self.publisher.send(None, elt)
|
57
55
|
|
58
56
|
|
59
57
|
running.stop()
|
@@ -1,5 +1,6 @@
|
|
1
1
|
|
2
2
|
import asyncio
|
3
|
+
import queue
|
3
4
|
from pulsar.schema import JsonSchema
|
4
5
|
import uuid
|
5
6
|
|
@@ -26,31 +27,29 @@ class TriplesStreamEndpoint(SocketEndpoint):
|
|
26
27
|
schema=JsonSchema(Triples)
|
27
28
|
)
|
28
29
|
|
29
|
-
async def start(self
|
30
|
+
async def start(self):
|
30
31
|
|
31
|
-
self.
|
32
|
-
self.subscriber.run(client)
|
33
|
-
)
|
32
|
+
self.subscriber.start()
|
34
33
|
|
35
34
|
async def async_thread(self, ws, running):
|
36
35
|
|
37
36
|
id = str(uuid.uuid4())
|
38
37
|
|
39
|
-
q =
|
38
|
+
q = self.subscriber.subscribe_all(id)
|
40
39
|
|
41
40
|
while running.get():
|
42
41
|
try:
|
43
|
-
resp = await asyncio.
|
42
|
+
resp = await asyncio.to_thread(q.get, timeout=0.5)
|
44
43
|
await ws.send_json(serialize_triples(resp))
|
45
44
|
|
46
|
-
except
|
45
|
+
except queue.Empty:
|
47
46
|
continue
|
48
47
|
|
49
48
|
except Exception as e:
|
50
49
|
print(f"Exception: {str(e)}", flush=True)
|
51
50
|
break
|
52
51
|
|
53
|
-
|
52
|
+
self.subscriber.unsubscribe_all(id)
|
54
53
|
|
55
54
|
running.stop()
|
56
55
|
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.17.5"
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: trustgraph-flow
|
3
|
-
Version: 0.17.
|
3
|
+
Version: 0.17.5
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
5
5
|
Home-page: https://github.com/trustgraph-ai/trustgraph
|
6
6
|
Author: trustgraph.ai
|
7
7
|
Author-email: security@trustgraph.ai
|
8
8
|
License: UNKNOWN
|
9
|
-
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.17.
|
9
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.17.5.tar.gz
|
10
10
|
Platform: UNKNOWN
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
12
12
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
@@ -1,39 +0,0 @@
|
|
1
|
-
|
2
|
-
import asyncio
|
3
|
-
|
4
|
-
class Publisher:
|
5
|
-
|
6
|
-
def __init__(self, pulsar_host, topic, schema=None, max_size=10,
|
7
|
-
chunking_enabled=False):
|
8
|
-
self.pulsar_host = pulsar_host
|
9
|
-
self.topic = topic
|
10
|
-
self.schema = schema
|
11
|
-
self.q = asyncio.Queue(maxsize=max_size)
|
12
|
-
self.chunking_enabled = chunking_enabled
|
13
|
-
|
14
|
-
async def run(self, client):
|
15
|
-
|
16
|
-
while True:
|
17
|
-
|
18
|
-
try:
|
19
|
-
async with client.create_producer(
|
20
|
-
topic=self.topic,
|
21
|
-
schema=self.schema,
|
22
|
-
chunking_enabled=self.chunking_enabled,
|
23
|
-
) as producer:
|
24
|
-
while True:
|
25
|
-
id, item = await self.q.get()
|
26
|
-
|
27
|
-
if id:
|
28
|
-
await producer.send(item, { "id": id })
|
29
|
-
else:
|
30
|
-
await producer.send(item)
|
31
|
-
|
32
|
-
except Exception as e:
|
33
|
-
print("Exception:", e, flush=True)
|
34
|
-
|
35
|
-
# If handler drops out, sleep a retry
|
36
|
-
await asyncio.sleep(2)
|
37
|
-
|
38
|
-
async def send(self, id, msg):
|
39
|
-
await self.q.put((id, msg))
|
@@ -1,66 +0,0 @@
|
|
1
|
-
|
2
|
-
import asyncio
|
3
|
-
|
4
|
-
class Subscriber:
|
5
|
-
|
6
|
-
def __init__(self, pulsar_host, topic, subscription, consumer_name,
|
7
|
-
schema=None, max_size=10):
|
8
|
-
self.pulsar_host = pulsar_host
|
9
|
-
self.topic = topic
|
10
|
-
self.subscription = subscription
|
11
|
-
self.consumer_name = consumer_name
|
12
|
-
self.schema = schema
|
13
|
-
self.q = {}
|
14
|
-
self.full = {}
|
15
|
-
|
16
|
-
async def run(self, client):
|
17
|
-
while True:
|
18
|
-
try:
|
19
|
-
async with client.subscribe(
|
20
|
-
topic=self.topic,
|
21
|
-
subscription_name=self.subscription,
|
22
|
-
consumer_name=self.consumer_name,
|
23
|
-
schema=self.schema,
|
24
|
-
) as consumer:
|
25
|
-
while True:
|
26
|
-
msg = await consumer.receive()
|
27
|
-
|
28
|
-
# Acknowledge successful reception of the message
|
29
|
-
await consumer.acknowledge(msg)
|
30
|
-
|
31
|
-
try:
|
32
|
-
id = msg.properties()["id"]
|
33
|
-
except:
|
34
|
-
id = None
|
35
|
-
|
36
|
-
value = msg.value()
|
37
|
-
if id in self.q:
|
38
|
-
await self.q[id].put(value)
|
39
|
-
|
40
|
-
for q in self.full.values():
|
41
|
-
await q.put(value)
|
42
|
-
|
43
|
-
except Exception as e:
|
44
|
-
print("Exception:", e, flush=True)
|
45
|
-
|
46
|
-
# If handler drops out, sleep a retry
|
47
|
-
await asyncio.sleep(2)
|
48
|
-
|
49
|
-
async def subscribe(self, id):
|
50
|
-
q = asyncio.Queue()
|
51
|
-
self.q[id] = q
|
52
|
-
return q
|
53
|
-
|
54
|
-
async def unsubscribe(self, id):
|
55
|
-
if id in self.q:
|
56
|
-
del self.q[id]
|
57
|
-
|
58
|
-
async def subscribe_all(self, id):
|
59
|
-
q = asyncio.Queue()
|
60
|
-
self.full[id] = q
|
61
|
-
return q
|
62
|
-
|
63
|
-
async def unsubscribe_all(self, id):
|
64
|
-
if id in self.full:
|
65
|
-
del self.full[id]
|
66
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.17.3"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|