trustgraph-flow 0.23.13__tar.gz → 0.23.15__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.23.13 → trustgraph-flow-0.23.15}/PKG-INFO +2 -2
- trustgraph-flow-0.23.15/scripts/kg-manager +6 -0
- trustgraph-flow-0.23.15/scripts/kg-store +6 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/setup.py +2 -0
- trustgraph-flow-0.23.15/trustgraph/cores/__init__.py +3 -0
- trustgraph-flow-0.23.15/trustgraph/cores/__main__.py +5 -0
- trustgraph-flow-0.23.15/trustgraph/cores/knowledge.py +104 -0
- trustgraph-flow-0.23.15/trustgraph/cores/service.py +228 -0
- trustgraph-flow-0.23.15/trustgraph/flow_version.py +1 -0
- trustgraph-flow-0.23.15/trustgraph/gateway/dispatch/knowledge.py +68 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/manager.py +2 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/requestor.py +1 -1
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/librarian/librarian.py +2 -2
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/librarian/service.py +1 -1
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/cohere/llm.py +2 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/lmstudio/llm.py +0 -1
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/mistral/llm.py +2 -0
- trustgraph-flow-0.23.15/trustgraph/storage/knowledge/__init__.py +3 -0
- trustgraph-flow-0.23.15/trustgraph/storage/knowledge/__main__.py +5 -0
- trustgraph-flow-0.23.15/trustgraph/storage/knowledge/store.py +78 -0
- trustgraph-flow-0.23.15/trustgraph/tables/__init__.py +0 -0
- trustgraph-flow-0.23.15/trustgraph/tables/knowledge.py +504 -0
- trustgraph-flow-0.23.13/trustgraph/librarian/table_store.py → trustgraph-flow-0.23.15/trustgraph/tables/library.py +1 -228
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph_flow.egg-info/PKG-INFO +2 -2
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph_flow.egg-info/SOURCES.txt +13 -1
- trustgraph-flow-0.23.13/trustgraph/flow_version.py +0 -1
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/README.md +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/agent-manager-react +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/api-gateway +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/chunker-recursive +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/chunker-token +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/config-svc +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/de-query-milvus +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/de-query-pinecone +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/de-query-qdrant +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/de-write-milvus +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/de-write-pinecone +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/de-write-qdrant +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/document-embeddings +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/document-rag +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/embeddings-fastembed +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/embeddings-ollama +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/ge-query-milvus +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/ge-query-pinecone +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/ge-query-qdrant +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/ge-write-milvus +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/ge-write-pinecone +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/ge-write-qdrant +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/graph-embeddings +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/graph-rag +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/kg-extract-definitions +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/kg-extract-relationships +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/kg-extract-topics +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/librarian +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/metering +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/object-extract-row +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/oe-write-milvus +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/pdf-decoder +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/pdf-ocr-mistral +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/prompt-generic +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/prompt-template +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/rows-write-cassandra +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/run-processing +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/text-completion-azure +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/text-completion-azure-openai +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/text-completion-claude +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/text-completion-cohere +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/text-completion-googleaistudio +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/text-completion-llamafile +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/text-completion-lmstudio +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/text-completion-mistral +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/text-completion-ollama +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/text-completion-openai +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/triples-query-cassandra +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/triples-query-falkordb +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/triples-query-memgraph +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/triples-query-neo4j +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/triples-write-cassandra +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/triples-write-falkordb +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/triples-write-memgraph +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/triples-write-neo4j +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/scripts/wikipedia-lookup +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/setup.cfg +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/agent/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/agent/react/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/agent/react/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/agent/react/agent_manager.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/agent/react/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/agent/react/tools.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/agent/react/types.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/chunking/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/chunking/recursive/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/chunking/recursive/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/chunking/recursive/chunker.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/chunking/token/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/chunking/token/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/chunking/token/chunker.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/config/service/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/config/service/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/config/service/config.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/config/service/flow.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/config/service/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/decoding/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/decoding/mistral_ocr/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/decoding/mistral_ocr/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/decoding/mistral_ocr/processor.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/decoding/pdf/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/decoding/pdf/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/direct/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/direct/cassandra.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/direct/milvus_object_embeddings.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/document_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/document_embeddings/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/document_embeddings/embeddings.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/fastembed/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/fastembed/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/fastembed/processor.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/graph_embeddings/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/graph_embeddings/embeddings.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/ollama/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/ollama/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/embeddings/ollama/processor.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/external/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/external/wikipedia/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/external/wikipedia/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/external/wikipedia/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/kg/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/kg/definitions/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/kg/definitions/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/kg/definitions/extract.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/kg/relationships/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/kg/relationships/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/kg/relationships/extract.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/kg/topics/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/kg/topics/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/kg/topics/extract.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/object/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/object/row/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/object/row/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/extract/object/row/extract.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/auth.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/config/receiver.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/agent.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/config.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/document_embeddings_export.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/document_embeddings_import.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/document_load.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/document_rag.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/embeddings.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/flow.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/graph_embeddings_export.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/graph_embeddings_import.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/graph_embeddings_query.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/graph_rag.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/librarian.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/mux.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/prompt.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/sender.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/serialize.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/streamer.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/text_completion.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/text_load.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/triples_export.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/triples_import.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/dispatch/triples_query.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/endpoint/constant_endpoint.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/endpoint/manager.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/endpoint/metrics.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/endpoint/socket.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/endpoint/variable_endpoint.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/running.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/unused/dbpedia.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/unused/encyclopedia.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/gateway/unused/internet_search.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/librarian/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/librarian/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/librarian/blob_store.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/metering/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/metering/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/metering/counter.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/prompt/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/prompt/generic/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/prompt/generic/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/prompt/generic/prompts.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/prompt/generic/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/prompt/template/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/prompt/template/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/prompt/template/prompt_manager.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/prompt/template/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/azure/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/azure/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/azure/llm.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/claude/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/claude/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/claude/llm.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/lmstudio/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/lmstudio/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/mistral/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/mistral/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/ollama/llm.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/openai/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/openai/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/model/text_completion/openai/llm.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/processing/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/processing/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/processing/processing.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/doc_embeddings/pinecone/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/graph_embeddings/pinecone/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/cassandra/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/falkordb/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/falkordb/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/falkordb/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/memgraph/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/memgraph/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/memgraph/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/query/triples/neo4j/service.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/retrieval/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/retrieval/document_rag/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/retrieval/document_rag/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/retrieval/document_rag/document_rag.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/retrieval/document_rag/rag.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/retrieval/graph_rag/graph_rag.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/retrieval/graph_rag/rag.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/doc_embeddings/pinecone/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/graph_embeddings/pinecone/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/object_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/rows/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/rows/cassandra/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/cassandra/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/falkordb/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/falkordb/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/falkordb/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/memgraph/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/memgraph/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/memgraph/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph/storage/triples/neo4j/write.py +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph_flow.egg-info/requires.txt +0 -0
- {trustgraph-flow-0.23.13 → trustgraph-flow-0.23.15}/trustgraph_flow.egg-info/top_level.txt +0 -0
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: trustgraph-flow
|
3
|
-
Version: 0.23.
|
3
|
+
Version: 0.23.15
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
5
5
|
Home-page: https://github.com/trustgraph-ai/trustgraph
|
6
|
-
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.23.
|
6
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.23.15.tar.gz
|
7
7
|
Author: trustgraph.ai
|
8
8
|
Author-email: security@trustgraph.ai
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
@@ -0,0 +1,104 @@
|
|
1
|
+
|
2
|
+
from .. schema import KnowledgeResponse, Error
|
3
|
+
from .. knowledge import hash
|
4
|
+
from .. exceptions import RequestError
|
5
|
+
from .. tables.knowledge import KnowledgeTableStore
|
6
|
+
import base64
|
7
|
+
|
8
|
+
import uuid
|
9
|
+
|
10
|
+
class KnowledgeManager:
|
11
|
+
|
12
|
+
def __init__(
|
13
|
+
self, cassandra_host, cassandra_user, cassandra_password,
|
14
|
+
keyspace,
|
15
|
+
):
|
16
|
+
|
17
|
+
self.table_store = KnowledgeTableStore(
|
18
|
+
cassandra_host, cassandra_user, cassandra_password, keyspace
|
19
|
+
)
|
20
|
+
|
21
|
+
async def delete_kg_core(self, request, respond):
|
22
|
+
|
23
|
+
print("Deleting core...", flush=True)
|
24
|
+
|
25
|
+
await self.table_store.delete_kg_core(
|
26
|
+
request.user, request.id
|
27
|
+
)
|
28
|
+
|
29
|
+
await respond(
|
30
|
+
KnowledgeResponse(
|
31
|
+
error = None,
|
32
|
+
ids = None,
|
33
|
+
eos = False,
|
34
|
+
triples = None,
|
35
|
+
graph_embeddings = None,
|
36
|
+
)
|
37
|
+
)
|
38
|
+
|
39
|
+
async def fetch_kg_core(self, request, respond):
|
40
|
+
|
41
|
+
print("Fetch core...", flush=True)
|
42
|
+
|
43
|
+
async def publish_triples(t):
|
44
|
+
await respond(
|
45
|
+
KnowledgeResponse(
|
46
|
+
error = None,
|
47
|
+
ids = None,
|
48
|
+
eos = False,
|
49
|
+
triples = t,
|
50
|
+
graph_embeddings = None,
|
51
|
+
)
|
52
|
+
)
|
53
|
+
|
54
|
+
# Remove doc table row
|
55
|
+
await self.table_store.get_triples(
|
56
|
+
request.user,
|
57
|
+
request.id,
|
58
|
+
publish_triples,
|
59
|
+
)
|
60
|
+
|
61
|
+
async def publish_ge(g):
|
62
|
+
await respond(
|
63
|
+
KnowledgeResponse(
|
64
|
+
error = None,
|
65
|
+
ids = None,
|
66
|
+
eos = False,
|
67
|
+
triples = None,
|
68
|
+
graph_embeddings = g,
|
69
|
+
)
|
70
|
+
)
|
71
|
+
|
72
|
+
# Remove doc table row
|
73
|
+
await self.table_store.get_graph_embeddings(
|
74
|
+
request.user,
|
75
|
+
request.id,
|
76
|
+
publish_ge,
|
77
|
+
)
|
78
|
+
|
79
|
+
print("Fetch complete", flush=True)
|
80
|
+
|
81
|
+
await respond(
|
82
|
+
KnowledgeResponse(
|
83
|
+
error = None,
|
84
|
+
ids = None,
|
85
|
+
eos = True,
|
86
|
+
triples = None,
|
87
|
+
graph_embeddings = None,
|
88
|
+
)
|
89
|
+
)
|
90
|
+
|
91
|
+
async def list_kg_cores(self, request, respond):
|
92
|
+
|
93
|
+
ids = await self.table_store.list_kg_cores(request.user)
|
94
|
+
|
95
|
+
await respond(
|
96
|
+
KnowledgeResponse(
|
97
|
+
error = None,
|
98
|
+
ids = ids,
|
99
|
+
eos = False,
|
100
|
+
triples = None,
|
101
|
+
graph_embeddings = None
|
102
|
+
)
|
103
|
+
)
|
104
|
+
|
@@ -0,0 +1,228 @@
|
|
1
|
+
|
2
|
+
"""
|
3
|
+
Knowledge core service, manages cores and exports them
|
4
|
+
"""
|
5
|
+
|
6
|
+
from functools import partial
|
7
|
+
import asyncio
|
8
|
+
import base64
|
9
|
+
import json
|
10
|
+
|
11
|
+
from .. base import AsyncProcessor, Consumer, Producer, Publisher, Subscriber
|
12
|
+
from .. base import ConsumerMetrics, ProducerMetrics
|
13
|
+
|
14
|
+
from .. schema import KnowledgeRequest, KnowledgeResponse, Error
|
15
|
+
from .. schema import knowledge_request_queue, knowledge_response_queue
|
16
|
+
|
17
|
+
from .. schema import Document, Metadata
|
18
|
+
from .. schema import TextDocument, Metadata
|
19
|
+
|
20
|
+
from .. exceptions import RequestError
|
21
|
+
|
22
|
+
from . knowledge import KnowledgeManager
|
23
|
+
|
24
|
+
default_ident = "knowledge"
|
25
|
+
|
26
|
+
default_knowledge_request_queue = knowledge_request_queue
|
27
|
+
default_knowledge_response_queue = knowledge_response_queue
|
28
|
+
|
29
|
+
default_cassandra_host = "cassandra"
|
30
|
+
|
31
|
+
# FIXME: How to ensure this doesn't conflict with other usage?
|
32
|
+
keyspace = "knowledge"
|
33
|
+
|
34
|
+
class Processor(AsyncProcessor):
|
35
|
+
|
36
|
+
def __init__(self, **params):
|
37
|
+
|
38
|
+
id = params.get("id")
|
39
|
+
|
40
|
+
knowledge_request_queue = params.get(
|
41
|
+
"knowledge_request_queue", default_knowledge_request_queue
|
42
|
+
)
|
43
|
+
|
44
|
+
knowledge_response_queue = params.get(
|
45
|
+
"knowledge_response_queue", default_knowledge_response_queue
|
46
|
+
)
|
47
|
+
|
48
|
+
cassandra_host = params.get("cassandra_host", default_cassandra_host)
|
49
|
+
cassandra_user = params.get("cassandra_user")
|
50
|
+
cassandra_password = params.get("cassandra_password")
|
51
|
+
|
52
|
+
super(Processor, self).__init__(
|
53
|
+
**params | {
|
54
|
+
"knowledge_request_queue": knowledge_request_queue,
|
55
|
+
"knowledge_response_queue": knowledge_response_queue,
|
56
|
+
"cassandra_host": cassandra_host,
|
57
|
+
"cassandra_user": cassandra_user,
|
58
|
+
}
|
59
|
+
)
|
60
|
+
|
61
|
+
knowledge_request_metrics = ConsumerMetrics(
|
62
|
+
processor = self.id, flow = None, name = "knowledge-request"
|
63
|
+
)
|
64
|
+
|
65
|
+
knowledge_response_metrics = ProducerMetrics(
|
66
|
+
processor = self.id, flow = None, name = "knowledge-response"
|
67
|
+
)
|
68
|
+
|
69
|
+
self.knowledge_request_consumer = Consumer(
|
70
|
+
taskgroup = self.taskgroup,
|
71
|
+
client = self.pulsar_client,
|
72
|
+
flow = None,
|
73
|
+
topic = knowledge_request_queue,
|
74
|
+
subscriber = id,
|
75
|
+
schema = KnowledgeRequest,
|
76
|
+
handler = self.on_knowledge_request,
|
77
|
+
metrics = knowledge_request_metrics,
|
78
|
+
)
|
79
|
+
|
80
|
+
self.knowledge_response_producer = Producer(
|
81
|
+
client = self.pulsar_client,
|
82
|
+
topic = knowledge_response_queue,
|
83
|
+
schema = KnowledgeResponse,
|
84
|
+
metrics = knowledge_response_metrics,
|
85
|
+
)
|
86
|
+
|
87
|
+
self.knowledge = KnowledgeManager(
|
88
|
+
cassandra_host = cassandra_host.split(","),
|
89
|
+
cassandra_user = cassandra_user,
|
90
|
+
cassandra_password = cassandra_password,
|
91
|
+
keyspace = keyspace,
|
92
|
+
)
|
93
|
+
|
94
|
+
self.register_config_handler(self.on_knowledge_config)
|
95
|
+
|
96
|
+
self.flows = {}
|
97
|
+
|
98
|
+
print("Initialised.", flush=True)
|
99
|
+
|
100
|
+
async def start(self):
|
101
|
+
|
102
|
+
await super(Processor, self).start()
|
103
|
+
await self.knowledge_request_consumer.start()
|
104
|
+
await self.knowledge_response_producer.start()
|
105
|
+
|
106
|
+
async def on_knowledge_config(self, config, version):
|
107
|
+
|
108
|
+
print("config version", version)
|
109
|
+
|
110
|
+
if "flows" in config:
|
111
|
+
|
112
|
+
self.flows = {
|
113
|
+
k: json.loads(v)
|
114
|
+
for k, v in config["flows"].items()
|
115
|
+
}
|
116
|
+
|
117
|
+
print(self.flows)
|
118
|
+
|
119
|
+
async def process_request(self, v, id):
|
120
|
+
|
121
|
+
if v.operation is None:
|
122
|
+
raise RequestError("Null operation")
|
123
|
+
|
124
|
+
print("request", v.operation)
|
125
|
+
|
126
|
+
impls = {
|
127
|
+
"list-kg-cores": self.knowledge.list_kg_cores,
|
128
|
+
"fetch-kg-core": self.knowledge.fetch_kg_core,
|
129
|
+
"delete-kg-core": self.knowledge.delete_kg_core,
|
130
|
+
}
|
131
|
+
|
132
|
+
if v.operation not in impls:
|
133
|
+
raise RequestError(f"Invalid operation: {v.operation}")
|
134
|
+
|
135
|
+
async def respond(x):
|
136
|
+
await self.knowledge_response_producer.send(
|
137
|
+
x, { "id": id }
|
138
|
+
)
|
139
|
+
return await impls[v.operation](v, respond)
|
140
|
+
|
141
|
+
async def on_knowledge_request(self, msg, consumer, flow):
|
142
|
+
|
143
|
+
v = msg.value()
|
144
|
+
|
145
|
+
# Sender-produced ID
|
146
|
+
|
147
|
+
id = msg.properties()["id"]
|
148
|
+
|
149
|
+
print(f"Handling input {id}...", flush=True)
|
150
|
+
|
151
|
+
try:
|
152
|
+
|
153
|
+
await self.process_request(v, id)
|
154
|
+
|
155
|
+
# await self.knowledge_response_producer.send(
|
156
|
+
# resp, properties={"id": id}
|
157
|
+
# )
|
158
|
+
|
159
|
+
return
|
160
|
+
|
161
|
+
except RequestError as e:
|
162
|
+
resp = KnowledgeResponse(
|
163
|
+
error = Error(
|
164
|
+
type = "request-error",
|
165
|
+
message = str(e),
|
166
|
+
)
|
167
|
+
)
|
168
|
+
|
169
|
+
await self.knowledge_response_producer.send(
|
170
|
+
resp, properties={"id": id}
|
171
|
+
)
|
172
|
+
|
173
|
+
return
|
174
|
+
except Exception as e:
|
175
|
+
resp = KnowledgeResponse(
|
176
|
+
error = Error(
|
177
|
+
type = "unexpected-error",
|
178
|
+
message = str(e),
|
179
|
+
)
|
180
|
+
)
|
181
|
+
|
182
|
+
await self.knowledge_response_producer.send(
|
183
|
+
resp, properties={"id": id}
|
184
|
+
)
|
185
|
+
|
186
|
+
return
|
187
|
+
|
188
|
+
print("Done.", flush=True)
|
189
|
+
|
190
|
+
@staticmethod
|
191
|
+
def add_args(parser):
|
192
|
+
|
193
|
+
AsyncProcessor.add_args(parser)
|
194
|
+
|
195
|
+
parser.add_argument(
|
196
|
+
'--knowledge-request-queue',
|
197
|
+
default=default_knowledge_request_queue,
|
198
|
+
help=f'Config request queue (default: {default_knowledge_request_queue})'
|
199
|
+
)
|
200
|
+
|
201
|
+
parser.add_argument(
|
202
|
+
'--knowledge-response-queue',
|
203
|
+
default=default_knowledge_response_queue,
|
204
|
+
help=f'Config response queue {default_knowledge_response_queue}',
|
205
|
+
)
|
206
|
+
|
207
|
+
parser.add_argument(
|
208
|
+
'--cassandra-host',
|
209
|
+
default="cassandra",
|
210
|
+
help=f'Graph host (default: cassandra)'
|
211
|
+
)
|
212
|
+
|
213
|
+
parser.add_argument(
|
214
|
+
'--cassandra-user',
|
215
|
+
default=None,
|
216
|
+
help=f'Cassandra user'
|
217
|
+
)
|
218
|
+
|
219
|
+
parser.add_argument(
|
220
|
+
'--cassandra-password',
|
221
|
+
default=None,
|
222
|
+
help=f'Cassandra password'
|
223
|
+
)
|
224
|
+
|
225
|
+
def run():
|
226
|
+
|
227
|
+
Processor.launch(default_ident, __doc__)
|
228
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.23.15"
|
@@ -0,0 +1,68 @@
|
|
1
|
+
|
2
|
+
import base64
|
3
|
+
|
4
|
+
from ... schema import KnowledgeRequest, KnowledgeResponse
|
5
|
+
from ... schema import knowledge_request_queue
|
6
|
+
from ... schema import knowledge_response_queue
|
7
|
+
|
8
|
+
from . requestor import ServiceRequestor
|
9
|
+
from . serialize import serialize_graph_embeddings
|
10
|
+
from . serialize import serialize_triples
|
11
|
+
from . serialize import to_document_metadata, to_processing_metadata
|
12
|
+
|
13
|
+
class KnowledgeRequestor(ServiceRequestor):
|
14
|
+
def __init__(self, pulsar_client, consumer, subscriber, timeout=120):
|
15
|
+
|
16
|
+
super(KnowledgeRequestor, self).__init__(
|
17
|
+
pulsar_client=pulsar_client,
|
18
|
+
consumer_name = consumer,
|
19
|
+
subscription = subscriber,
|
20
|
+
request_queue=knowledge_request_queue,
|
21
|
+
response_queue=knowledge_response_queue,
|
22
|
+
request_schema=KnowledgeRequest,
|
23
|
+
response_schema=KnowledgeResponse,
|
24
|
+
timeout=timeout,
|
25
|
+
)
|
26
|
+
|
27
|
+
def to_request(self, body):
|
28
|
+
|
29
|
+
return KnowledgeRequest(
|
30
|
+
operation = body.get("operation", None),
|
31
|
+
user = body.get("user", None),
|
32
|
+
id = body.get("id", None),
|
33
|
+
)
|
34
|
+
|
35
|
+
def from_response(self, message):
|
36
|
+
|
37
|
+
print("Processing message")
|
38
|
+
|
39
|
+
# Response to list,
|
40
|
+
if message.ids is not None:
|
41
|
+
print("-> IDS")
|
42
|
+
return {
|
43
|
+
"ids": message.ids
|
44
|
+
}, True
|
45
|
+
|
46
|
+
if message.triples:
|
47
|
+
print("-> triples")
|
48
|
+
return {
|
49
|
+
"triples": serialize_triples(message.triples)
|
50
|
+
}, False
|
51
|
+
|
52
|
+
if message.graph_embeddings:
|
53
|
+
print("-> ge")
|
54
|
+
return {
|
55
|
+
"graph-embeddings": serialize_graph_embeddings(
|
56
|
+
message.graph_embeddings
|
57
|
+
)
|
58
|
+
}, False
|
59
|
+
|
60
|
+
if message.eos is True:
|
61
|
+
print("-> eos")
|
62
|
+
return {
|
63
|
+
"eos": True
|
64
|
+
}, True
|
65
|
+
|
66
|
+
# Empty case, return from successful delete.
|
67
|
+
return {}, True
|
68
|
+
|
@@ -5,6 +5,7 @@ import uuid
|
|
5
5
|
from . config import ConfigRequestor
|
6
6
|
from . flow import FlowRequestor
|
7
7
|
from . librarian import LibrarianRequestor
|
8
|
+
from . knowledge import KnowledgeRequestor
|
8
9
|
|
9
10
|
from . embeddings import EmbeddingsRequestor
|
10
11
|
from . agent import AgentRequestor
|
@@ -44,6 +45,7 @@ global_dispatchers = {
|
|
44
45
|
"config": ConfigRequestor,
|
45
46
|
"flow": FlowRequestor,
|
46
47
|
"librarian": LibrarianRequestor,
|
48
|
+
"knowledge": KnowledgeRequestor,
|
47
49
|
}
|
48
50
|
|
49
51
|
sender_dispatchers = {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
from .. schema import LibrarianRequest, LibrarianResponse, Error, Triple
|
3
3
|
from .. knowledge import hash
|
4
4
|
from .. exceptions import RequestError
|
5
|
-
from .
|
5
|
+
from .. tables.library import LibraryTableStore
|
6
6
|
from . blob_store import BlobStore
|
7
7
|
import base64
|
8
8
|
|
@@ -21,7 +21,7 @@ class Librarian:
|
|
21
21
|
minio_host, minio_access_key, minio_secret_key, bucket_name
|
22
22
|
)
|
23
23
|
|
24
|
-
self.table_store =
|
24
|
+
self.table_store = LibraryTableStore(
|
25
25
|
cassandra_host, cassandra_user, cassandra_password, keyspace
|
26
26
|
)
|
27
27
|
|
@@ -0,0 +1,78 @@
|
|
1
|
+
|
2
|
+
"""
|
3
|
+
Stores knowledge-cores in Cassandra
|
4
|
+
"""
|
5
|
+
|
6
|
+
import json
|
7
|
+
import urllib.parse
|
8
|
+
|
9
|
+
from ... schema import Triples, GraphEmbeddings
|
10
|
+
from ... base import FlowProcessor, ConsumerSpec
|
11
|
+
|
12
|
+
from ... tables.knowledge import KnowledgeTableStore
|
13
|
+
|
14
|
+
default_ident = "kg-store"
|
15
|
+
|
16
|
+
default_cassandra_host = "cassandra"
|
17
|
+
keyspace = "knowledge"
|
18
|
+
|
19
|
+
class Processor(FlowProcessor):
|
20
|
+
|
21
|
+
def __init__(self, **params):
|
22
|
+
|
23
|
+
id = params.get("id")
|
24
|
+
|
25
|
+
cassandra_host = params.get("cassandra_host", default_cassandra_host)
|
26
|
+
cassandra_user = params.get("cassandra_user")
|
27
|
+
cassandra_password = params.get("cassandra_password")
|
28
|
+
|
29
|
+
super(Processor, self).__init__(
|
30
|
+
**params | {
|
31
|
+
"id": id,
|
32
|
+
"cassandra_host": cassandra_host,
|
33
|
+
"cassandra_user": cassandra_user,
|
34
|
+
}
|
35
|
+
)
|
36
|
+
|
37
|
+
self.register_specification(
|
38
|
+
ConsumerSpec(
|
39
|
+
name = "triples-input",
|
40
|
+
schema = Triples,
|
41
|
+
handler = self.on_triples
|
42
|
+
)
|
43
|
+
)
|
44
|
+
|
45
|
+
self.register_specification(
|
46
|
+
ConsumerSpec(
|
47
|
+
name = "graph-embeddings-input",
|
48
|
+
schema = GraphEmbeddings,
|
49
|
+
handler = self.on_graph_embeddings
|
50
|
+
)
|
51
|
+
)
|
52
|
+
|
53
|
+
self.table_store = KnowledgeTableStore(
|
54
|
+
cassandra_host = cassandra_host.split(","),
|
55
|
+
cassandra_user = cassandra_user,
|
56
|
+
cassandra_password = cassandra_password,
|
57
|
+
keyspace = keyspace,
|
58
|
+
)
|
59
|
+
|
60
|
+
async def on_triples(self, msg, consumer, flow):
|
61
|
+
|
62
|
+
v = msg.value()
|
63
|
+
await self.table_store.add_triples(v)
|
64
|
+
|
65
|
+
async def on_graph_embeddings(self, msg, consumer, flow):
|
66
|
+
|
67
|
+
v = msg.value()
|
68
|
+
await self.table_store.add_graph_embeddings(v)
|
69
|
+
|
70
|
+
@staticmethod
|
71
|
+
def add_args(parser):
|
72
|
+
|
73
|
+
FlowProcessor.add_args(parser)
|
74
|
+
|
75
|
+
def run():
|
76
|
+
|
77
|
+
Processor.launch(default_ident, __doc__)
|
78
|
+
|
File without changes
|