trustgraph-flow 0.16.3__tar.gz → 0.16.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.16.3 → trustgraph-flow-0.16.5}/PKG-INFO +2 -2
- trustgraph-flow-0.16.5/scripts/ge-query-pinecone +6 -0
- trustgraph-flow-0.16.5/scripts/ge-write-pinecone +6 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/setup.py +3 -0
- trustgraph-flow-0.16.5/trustgraph/flow_version.py +1 -0
- trustgraph-flow-0.16.5/trustgraph/query/doc_embeddings/pinecone/service.py +142 -0
- trustgraph-flow-0.16.5/trustgraph/query/graph_embeddings/pinecone/service.py +156 -0
- trustgraph-flow-0.16.5/trustgraph/query/triples/cassandra/__init__.py +3 -0
- trustgraph-flow-0.16.5/trustgraph/query/triples/cassandra/__main__.py +7 -0
- trustgraph-flow-0.16.5/trustgraph/query/triples/neo4j/__init__.py +3 -0
- trustgraph-flow-0.16.5/trustgraph/query/triples/neo4j/__main__.py +7 -0
- trustgraph-flow-0.16.5/trustgraph/storage/doc_embeddings/pinecone/write.py +167 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/graph_embeddings/milvus → trustgraph-flow-0.16.5/trustgraph/storage/doc_embeddings/qdrant}/__main__.py +0 -0
- trustgraph-flow-0.16.5/trustgraph/storage/graph_embeddings/pinecone/write.py +167 -0
- trustgraph-flow-0.16.5/trustgraph/storage/triples/cassandra/__init__.py +3 -0
- trustgraph-flow-0.16.5/trustgraph/storage/triples/cassandra/__main__.py +7 -0
- trustgraph-flow-0.16.5/trustgraph/storage/triples/neo4j/__init__.py +3 -0
- trustgraph-flow-0.16.5/trustgraph/storage/triples/neo4j/__main__.py +7 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph_flow.egg-info/PKG-INFO +2 -2
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph_flow.egg-info/SOURCES.txt +14 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph_flow.egg-info/requires.txt +1 -0
- trustgraph-flow-0.16.3/trustgraph/flow_version.py +0 -1
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/README.md +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/agent-manager-react +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/api-gateway +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/chunker-recursive +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/chunker-token +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/de-query-milvus +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/de-query-qdrant +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/de-write-milvus +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/de-write-qdrant +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/document-rag +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/embeddings-ollama +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/embeddings-vectorize +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/ge-query-milvus +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/ge-query-qdrant +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/ge-write-milvus +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/ge-write-qdrant +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/graph-rag +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/kg-extract-definitions +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/kg-extract-relationships +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/kg-extract-topics +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/metering +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/object-extract-row +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/oe-write-milvus +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/pdf-decoder +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/prompt-generic +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/prompt-template +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/rows-write-cassandra +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/run-processing +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/text-completion-azure +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/text-completion-azure-openai +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/text-completion-claude +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/text-completion-cohere +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/text-completion-googleaistudio +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/text-completion-llamafile +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/text-completion-ollama +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/text-completion-openai +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/triples-query-cassandra +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/triples-query-neo4j +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/triples-write-cassandra +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/scripts/triples-write-neo4j +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/setup.cfg +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/agent/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/agent/react/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/agent/react/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/agent/react/agent_manager.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/agent/react/service.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/agent/react/tools.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/agent/react/types.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/api/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/api/gateway/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/api/gateway/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/api/gateway/service.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/chunking/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/chunking/recursive/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/chunking/recursive/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/chunking/recursive/chunker.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/chunking/token/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/chunking/token/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/chunking/token/chunker.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/decoding/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/decoding/pdf/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/decoding/pdf/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/direct/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/direct/cassandra.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/direct/milvus_object_embeddings.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/document_rag.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/embeddings/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/embeddings/ollama/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/embeddings/ollama/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/embeddings/ollama/processor.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/embeddings/vectorize/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/embeddings/vectorize/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/embeddings/vectorize/vectorize.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/kg/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/kg/definitions/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/kg/definitions/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/kg/definitions/extract.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/kg/relationships/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/kg/relationships/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/kg/relationships/extract.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/kg/topics/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/kg/topics/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/kg/topics/extract.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/object/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/object/row/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/object/row/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/extract/object/row/extract.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/graph_rag.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/metering/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/metering/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/metering/counter.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/metering/pricelist.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/prompt/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/prompt/generic/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/prompt/generic/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/prompt/generic/prompts.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/prompt/generic/service.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/prompt/template/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/prompt/template/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/prompt/template/prompt_manager.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/prompt/template/service.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/azure/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/azure/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/azure/llm.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/claude/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/claude/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/claude/llm.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/cohere/llm.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/ollama/llm.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/openai/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/openai/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/model/text_completion/openai/llm.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/processing/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/processing/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/processing/processing.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/query/doc_embeddings/qdrant → trustgraph-flow-0.16.5/trustgraph/query/doc_embeddings/pinecone}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/query/doc_embeddings/qdrant → trustgraph-flow-0.16.5/trustgraph/query/doc_embeddings/pinecone}/__main__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/query/graph_embeddings/milvus → trustgraph-flow-0.16.5/trustgraph/query/doc_embeddings/qdrant}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/query/graph_embeddings/milvus → trustgraph-flow-0.16.5/trustgraph/query/doc_embeddings/qdrant}/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/query/graph_embeddings/qdrant → trustgraph-flow-0.16.5/trustgraph/query/graph_embeddings/milvus}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/query/graph_embeddings/qdrant → trustgraph-flow-0.16.5/trustgraph/query/graph_embeddings/milvus}/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/query/triples/cassandra → trustgraph-flow-0.16.5/trustgraph/query/graph_embeddings/pinecone}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/query/triples/cassandra → trustgraph-flow-0.16.5/trustgraph/query/graph_embeddings/pinecone}/__main__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/query/triples/neo4j → trustgraph-flow-0.16.5/trustgraph/query/graph_embeddings/qdrant}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/query/triples/neo4j → trustgraph-flow-0.16.5/trustgraph/query/graph_embeddings/qdrant}/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/triples/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/triples/cassandra/service.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/query/triples/neo4j/service.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/retrieval/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/retrieval/document_rag/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/retrieval/document_rag/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/retrieval/document_rag/rag.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/retrieval/graph_rag/rag.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/doc_embeddings/qdrant → trustgraph-flow-0.16.5/trustgraph/storage/doc_embeddings/pinecone}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/doc_embeddings/qdrant → trustgraph-flow-0.16.5/trustgraph/storage/doc_embeddings/pinecone}/__main__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/graph_embeddings/milvus → trustgraph-flow-0.16.5/trustgraph/storage/doc_embeddings/qdrant}/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/graph_embeddings/qdrant → trustgraph-flow-0.16.5/trustgraph/storage/graph_embeddings/milvus}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/graph_embeddings/qdrant → trustgraph-flow-0.16.5/trustgraph/storage/graph_embeddings/milvus}/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/object_embeddings/milvus → trustgraph-flow-0.16.5/trustgraph/storage/graph_embeddings/pinecone}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/object_embeddings/milvus → trustgraph-flow-0.16.5/trustgraph/storage/graph_embeddings/pinecone}/__main__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/rows/cassandra → trustgraph-flow-0.16.5/trustgraph/storage/graph_embeddings/qdrant}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/rows/cassandra → trustgraph-flow-0.16.5/trustgraph/storage/graph_embeddings/qdrant}/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/object_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/triples/cassandra → trustgraph-flow-0.16.5/trustgraph/storage/object_embeddings/milvus}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/triples/cassandra → trustgraph-flow-0.16.5/trustgraph/storage/object_embeddings/milvus}/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/rows/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/triples/neo4j → trustgraph-flow-0.16.5/trustgraph/storage/rows/cassandra}/__init__.py +0 -0
- {trustgraph-flow-0.16.3/trustgraph/storage/triples/neo4j → trustgraph-flow-0.16.5/trustgraph/storage/rows/cassandra}/__main__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/rows/cassandra/write.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/triples/__init__.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/triples/cassandra/write.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph/storage/triples/neo4j/write.py +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.5}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
- {trustgraph-flow-0.16.3 → trustgraph-flow-0.16.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.16.
|
3
|
+
Version: 0.16.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.16.
|
9
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.16.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+)
|
@@ -60,6 +60,7 @@ setuptools.setup(
|
|
60
60
|
"jsonschema",
|
61
61
|
"aiohttp",
|
62
62
|
"aiopulsar-py",
|
63
|
+
"pinecone[grpc]",
|
63
64
|
],
|
64
65
|
scripts=[
|
65
66
|
"scripts/api-gateway",
|
@@ -74,8 +75,10 @@ setuptools.setup(
|
|
74
75
|
"scripts/embeddings-ollama",
|
75
76
|
"scripts/embeddings-vectorize",
|
76
77
|
"scripts/ge-query-milvus",
|
78
|
+
"scripts/ge-query-pinecone",
|
77
79
|
"scripts/ge-query-qdrant",
|
78
80
|
"scripts/ge-write-milvus",
|
81
|
+
"scripts/ge-write-pinecone",
|
79
82
|
"scripts/ge-write-qdrant",
|
80
83
|
"scripts/graph-rag",
|
81
84
|
"scripts/kg-extract-definitions",
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.16.5"
|
@@ -0,0 +1,142 @@
|
|
1
|
+
|
2
|
+
"""
|
3
|
+
Document embeddings query service. Input is vector, output is an array
|
4
|
+
of chunks. Pinecone implementation.
|
5
|
+
"""
|
6
|
+
|
7
|
+
from pinecone import Pinecone, ServerlessSpec
|
8
|
+
from pinecone.grpc import PineconeGRPC, GRPCClientConfig
|
9
|
+
|
10
|
+
import uuid
|
11
|
+
import os
|
12
|
+
|
13
|
+
from .... schema import DocumentEmbeddingsRequest, DocumentEmbeddingsResponse
|
14
|
+
from .... schema import Error, Value
|
15
|
+
from .... schema import document_embeddings_request_queue
|
16
|
+
from .... schema import document_embeddings_response_queue
|
17
|
+
from .... base import ConsumerProducer
|
18
|
+
|
19
|
+
module = ".".join(__name__.split(".")[1:-1])
|
20
|
+
|
21
|
+
default_input_queue = document_embeddings_request_queue
|
22
|
+
default_output_queue = document_embeddings_response_queue
|
23
|
+
default_subscriber = module
|
24
|
+
default_api_key = os.getenv("PINECONE_API_KEY", "not-specified")
|
25
|
+
|
26
|
+
class Processor(ConsumerProducer):
|
27
|
+
|
28
|
+
def __init__(self, **params):
|
29
|
+
|
30
|
+
input_queue = params.get("input_queue", default_input_queue)
|
31
|
+
output_queue = params.get("output_queue", default_output_queue)
|
32
|
+
subscriber = params.get("subscriber", default_subscriber)
|
33
|
+
|
34
|
+
self.url = params.get("url", None)
|
35
|
+
self.api_key = params.get("api_key", default_api_key)
|
36
|
+
|
37
|
+
if self.url:
|
38
|
+
|
39
|
+
self.pinecone = PineconeGRPC(
|
40
|
+
api_key = self.api_key,
|
41
|
+
host = self.url
|
42
|
+
)
|
43
|
+
|
44
|
+
else:
|
45
|
+
|
46
|
+
self.pinecone = Pinecone(api_key = self.api_key)
|
47
|
+
|
48
|
+
super(Processor, self).__init__(
|
49
|
+
**params | {
|
50
|
+
"input_queue": input_queue,
|
51
|
+
"output_queue": output_queue,
|
52
|
+
"subscriber": subscriber,
|
53
|
+
"input_schema": DocumentEmbeddingsRequest,
|
54
|
+
"output_schema": DocumentEmbeddingsResponse,
|
55
|
+
"url": self.url,
|
56
|
+
}
|
57
|
+
)
|
58
|
+
|
59
|
+
def handle(self, msg):
|
60
|
+
|
61
|
+
try:
|
62
|
+
|
63
|
+
v = msg.value()
|
64
|
+
|
65
|
+
# Sender-produced ID
|
66
|
+
id = msg.properties()["id"]
|
67
|
+
|
68
|
+
print(f"Handling input {id}...", flush=True)
|
69
|
+
|
70
|
+
chunks = []
|
71
|
+
|
72
|
+
for vec in v.vectors:
|
73
|
+
|
74
|
+
dim = len(vec)
|
75
|
+
|
76
|
+
index_name = (
|
77
|
+
"d-" + v.user + "-" + str(dim)
|
78
|
+
)
|
79
|
+
|
80
|
+
index = self.pinecone.Index(index_name)
|
81
|
+
|
82
|
+
results = index.query(
|
83
|
+
namespace=v.collection,
|
84
|
+
vector=vec,
|
85
|
+
top_k=v.limit,
|
86
|
+
include_values=False,
|
87
|
+
include_metadata=True
|
88
|
+
)
|
89
|
+
|
90
|
+
search_result = self.client.query_points(
|
91
|
+
collection_name=collection,
|
92
|
+
query=vec,
|
93
|
+
limit=v.limit,
|
94
|
+
with_payload=True,
|
95
|
+
).points
|
96
|
+
|
97
|
+
for r in results.matches:
|
98
|
+
doc = r.metadata["doc"]
|
99
|
+
chunks.add(doc)
|
100
|
+
|
101
|
+
print("Send response...", flush=True)
|
102
|
+
r = DocumentEmbeddingsResponse(documents=chunks, error=None)
|
103
|
+
self.producer.send(r, properties={"id": id})
|
104
|
+
|
105
|
+
print("Done.", flush=True)
|
106
|
+
|
107
|
+
except Exception as e:
|
108
|
+
|
109
|
+
print(f"Exception: {e}")
|
110
|
+
|
111
|
+
print("Send error response...", flush=True)
|
112
|
+
|
113
|
+
r = DocumentEmbeddingsResponse(
|
114
|
+
error=Error(
|
115
|
+
type = "llm-error",
|
116
|
+
message = str(e),
|
117
|
+
),
|
118
|
+
documents=None,
|
119
|
+
)
|
120
|
+
|
121
|
+
self.producer.send(r, properties={"id": id})
|
122
|
+
|
123
|
+
self.consumer.acknowledge(msg)
|
124
|
+
|
125
|
+
@staticmethod
|
126
|
+
def add_args(parser):
|
127
|
+
|
128
|
+
ConsumerProducer.add_args(
|
129
|
+
parser, default_input_queue, default_subscriber,
|
130
|
+
default_output_queue,
|
131
|
+
)
|
132
|
+
|
133
|
+
parser.add_argument(
|
134
|
+
'-t', '--store-uri',
|
135
|
+
default=default_store_uri,
|
136
|
+
help=f'Milvus store URI (default: {default_store_uri})'
|
137
|
+
)
|
138
|
+
|
139
|
+
def run():
|
140
|
+
|
141
|
+
Processor.start(module, __doc__)
|
142
|
+
|
@@ -0,0 +1,156 @@
|
|
1
|
+
|
2
|
+
"""
|
3
|
+
Graph embeddings query service. Input is vector, output is list of
|
4
|
+
entities. Pinecone implementation.
|
5
|
+
"""
|
6
|
+
|
7
|
+
from pinecone import Pinecone, ServerlessSpec
|
8
|
+
from pinecone.grpc import PineconeGRPC, GRPCClientConfig
|
9
|
+
|
10
|
+
import uuid
|
11
|
+
import os
|
12
|
+
|
13
|
+
from .... schema import GraphEmbeddingsRequest, GraphEmbeddingsResponse
|
14
|
+
from .... schema import Error, Value
|
15
|
+
from .... schema import graph_embeddings_request_queue
|
16
|
+
from .... schema import graph_embeddings_response_queue
|
17
|
+
from .... base import ConsumerProducer
|
18
|
+
|
19
|
+
module = ".".join(__name__.split(".")[1:-1])
|
20
|
+
|
21
|
+
default_input_queue = graph_embeddings_request_queue
|
22
|
+
default_output_queue = graph_embeddings_response_queue
|
23
|
+
default_subscriber = module
|
24
|
+
default_api_key = os.getenv("PINECONE_API_KEY", "not-specified")
|
25
|
+
|
26
|
+
class Processor(ConsumerProducer):
|
27
|
+
|
28
|
+
def __init__(self, **params):
|
29
|
+
|
30
|
+
input_queue = params.get("input_queue", default_input_queue)
|
31
|
+
output_queue = params.get("output_queue", default_output_queue)
|
32
|
+
subscriber = params.get("subscriber", default_subscriber)
|
33
|
+
|
34
|
+
self.url = params.get("url", None)
|
35
|
+
self.api_key = params.get("api_key", default_api_key)
|
36
|
+
|
37
|
+
if self.url:
|
38
|
+
|
39
|
+
self.pinecone = PineconeGRPC(
|
40
|
+
api_key = self.api_key,
|
41
|
+
host = self.url
|
42
|
+
)
|
43
|
+
|
44
|
+
else:
|
45
|
+
|
46
|
+
self.pinecone = Pinecone(api_key = self.api_key)
|
47
|
+
|
48
|
+
super(Processor, self).__init__(
|
49
|
+
**params | {
|
50
|
+
"input_queue": input_queue,
|
51
|
+
"output_queue": output_queue,
|
52
|
+
"subscriber": subscriber,
|
53
|
+
"input_schema": GraphEmbeddingsRequest,
|
54
|
+
"output_schema": GraphEmbeddingsResponse,
|
55
|
+
"url": self.url,
|
56
|
+
}
|
57
|
+
)
|
58
|
+
|
59
|
+
def create_value(self, ent):
|
60
|
+
if ent.startswith("http://") or ent.startswith("https://"):
|
61
|
+
return Value(value=ent, is_uri=True)
|
62
|
+
else:
|
63
|
+
return Value(value=ent, is_uri=False)
|
64
|
+
|
65
|
+
def handle(self, msg):
|
66
|
+
|
67
|
+
try:
|
68
|
+
|
69
|
+
v = msg.value()
|
70
|
+
|
71
|
+
# Sender-produced ID
|
72
|
+
id = msg.properties()["id"]
|
73
|
+
|
74
|
+
print(f"Handling input {id}...", flush=True)
|
75
|
+
|
76
|
+
entities = set()
|
77
|
+
|
78
|
+
for vec in v.vectors:
|
79
|
+
|
80
|
+
dim = len(vec)
|
81
|
+
|
82
|
+
index_name = (
|
83
|
+
"t-" + v.user + "-" + str(dim)
|
84
|
+
)
|
85
|
+
|
86
|
+
index = self.pinecone.Index(index_name)
|
87
|
+
|
88
|
+
results = index.query(
|
89
|
+
namespace=v.collection,
|
90
|
+
vector=vec,
|
91
|
+
top_k=v.limit,
|
92
|
+
include_values=False,
|
93
|
+
include_metadata=True
|
94
|
+
)
|
95
|
+
|
96
|
+
for r in results.matches:
|
97
|
+
ent = r.metadata["entity"]
|
98
|
+
entities.add(ent)
|
99
|
+
|
100
|
+
# Convert set to list
|
101
|
+
entities = list(entities)
|
102
|
+
|
103
|
+
ents2 = []
|
104
|
+
|
105
|
+
for ent in entities:
|
106
|
+
ents2.append(self.create_value(ent))
|
107
|
+
|
108
|
+
entities = ents2
|
109
|
+
|
110
|
+
print("Send response...", flush=True)
|
111
|
+
r = GraphEmbeddingsResponse(entities=entities, error=None)
|
112
|
+
self.producer.send(r, properties={"id": id})
|
113
|
+
|
114
|
+
print("Done.", flush=True)
|
115
|
+
|
116
|
+
except Exception as e:
|
117
|
+
|
118
|
+
print(f"Exception: {e}")
|
119
|
+
|
120
|
+
print("Send error response...", flush=True)
|
121
|
+
|
122
|
+
r = GraphEmbeddingsResponse(
|
123
|
+
error=Error(
|
124
|
+
type = "llm-error",
|
125
|
+
message = str(e),
|
126
|
+
),
|
127
|
+
entities=None,
|
128
|
+
)
|
129
|
+
|
130
|
+
self.producer.send(r, properties={"id": id})
|
131
|
+
|
132
|
+
self.consumer.acknowledge(msg)
|
133
|
+
|
134
|
+
@staticmethod
|
135
|
+
def add_args(parser):
|
136
|
+
|
137
|
+
ConsumerProducer.add_args(
|
138
|
+
parser, default_input_queue, default_subscriber,
|
139
|
+
default_output_queue,
|
140
|
+
)
|
141
|
+
|
142
|
+
parser.add_argument(
|
143
|
+
'-a', '--api-key',
|
144
|
+
default=default_api_key,
|
145
|
+
help='Pinecone API key. (default from PINECONE_API_KEY)'
|
146
|
+
)
|
147
|
+
|
148
|
+
parser.add_argument(
|
149
|
+
'-u', '--url',
|
150
|
+
help='Pinecone URL. If unspecified, serverless is used'
|
151
|
+
)
|
152
|
+
|
153
|
+
def run():
|
154
|
+
|
155
|
+
Processor.start(module, __doc__)
|
156
|
+
|
@@ -0,0 +1,167 @@
|
|
1
|
+
|
2
|
+
"""
|
3
|
+
Accepts entity/vector pairs and writes them to a Qdrant store.
|
4
|
+
"""
|
5
|
+
|
6
|
+
from qdrant_client import QdrantClient
|
7
|
+
from qdrant_client.models import PointStruct
|
8
|
+
from qdrant_client.models import Distance, VectorParams
|
9
|
+
|
10
|
+
import time
|
11
|
+
import uuid
|
12
|
+
import os
|
13
|
+
|
14
|
+
from .... schema import ChunkEmbeddings
|
15
|
+
from .... schema import chunk_embeddings_ingest_queue
|
16
|
+
from .... log_level import LogLevel
|
17
|
+
from .... base import Consumer
|
18
|
+
|
19
|
+
module = ".".join(__name__.split(".")[1:-1])
|
20
|
+
|
21
|
+
default_input_queue = chunk_embeddings_ingest_queue
|
22
|
+
default_subscriber = module
|
23
|
+
default_api_key = os.getenv("PINECONE_API_KEY", "not-specified")
|
24
|
+
default_cloud = "aws"
|
25
|
+
default_region = "us-east-1"
|
26
|
+
|
27
|
+
class Processor(Consumer):
|
28
|
+
|
29
|
+
def __init__(self, **params):
|
30
|
+
|
31
|
+
input_queue = params.get("input_queue", default_input_queue)
|
32
|
+
subscriber = params.get("subscriber", default_subscriber)
|
33
|
+
|
34
|
+
self.url = params.get("url", None)
|
35
|
+
self.cloud = params.get("cloud", default_cloud)
|
36
|
+
self.region = params.get("region", default_region)
|
37
|
+
self.api_key = params.get("api_key", default_api_key)
|
38
|
+
|
39
|
+
if self.api_key is None:
|
40
|
+
raise RuntimeError("Pinecone API key must be specified")
|
41
|
+
|
42
|
+
if self.url:
|
43
|
+
|
44
|
+
self.pinecone = PineconeGRPC(
|
45
|
+
api_key = self.api_key,
|
46
|
+
host = self.url
|
47
|
+
)
|
48
|
+
|
49
|
+
else:
|
50
|
+
|
51
|
+
self.pinecone = Pinecone(api_key = self.api_key)
|
52
|
+
|
53
|
+
super(Processor, self).__init__(
|
54
|
+
**params | {
|
55
|
+
"input_queue": input_queue,
|
56
|
+
"subscriber": subscriber,
|
57
|
+
"input_schema": ChunkEmbeddings,
|
58
|
+
"url": self.url,
|
59
|
+
}
|
60
|
+
)
|
61
|
+
|
62
|
+
self.last_index_name = None
|
63
|
+
|
64
|
+
def handle(self, msg):
|
65
|
+
|
66
|
+
v = msg.value()
|
67
|
+
|
68
|
+
chunk = v.chunk.decode("utf-8")
|
69
|
+
|
70
|
+
if chunk == "": return
|
71
|
+
|
72
|
+
for vec in v.vectors:
|
73
|
+
|
74
|
+
dim = len(vec)
|
75
|
+
collection = (
|
76
|
+
"d-" + v.metadata.user + "-" + str(dim)
|
77
|
+
)
|
78
|
+
|
79
|
+
if index_name != self.last_index_name:
|
80
|
+
|
81
|
+
if not self.pinecone.has_index(index_name):
|
82
|
+
|
83
|
+
try:
|
84
|
+
|
85
|
+
self.pinecone.create_index(
|
86
|
+
name = index_name,
|
87
|
+
dimension = dim,
|
88
|
+
metric = "cosine",
|
89
|
+
spec = ServerlessSpec(
|
90
|
+
cloud = self.cloud,
|
91
|
+
region = self.region,
|
92
|
+
)
|
93
|
+
)
|
94
|
+
|
95
|
+
for i in range(0, 1000):
|
96
|
+
|
97
|
+
if self.pinecone.describe_index(
|
98
|
+
index_name
|
99
|
+
).status["ready"]:
|
100
|
+
break
|
101
|
+
|
102
|
+
time.sleep(1)
|
103
|
+
|
104
|
+
if not self.pinecone.describe_index(
|
105
|
+
index_name
|
106
|
+
).status["ready"]:
|
107
|
+
raise RuntimeError(
|
108
|
+
"Gave up waiting for index creation"
|
109
|
+
)
|
110
|
+
|
111
|
+
except Exception as e:
|
112
|
+
print("Pinecone index creation failed")
|
113
|
+
raise e
|
114
|
+
|
115
|
+
print(f"Index {index_name} created", flush=True)
|
116
|
+
|
117
|
+
self.last_index_name = index_name
|
118
|
+
|
119
|
+
index = self.pinecone.Index(index_name)
|
120
|
+
|
121
|
+
records = [
|
122
|
+
{
|
123
|
+
"id": id,
|
124
|
+
"values": vec,
|
125
|
+
"metadata": { "doc": chunk },
|
126
|
+
}
|
127
|
+
]
|
128
|
+
|
129
|
+
index.upsert(
|
130
|
+
vectors = records,
|
131
|
+
namespace = v.metadata.collection,
|
132
|
+
)
|
133
|
+
|
134
|
+
@staticmethod
|
135
|
+
def add_args(parser):
|
136
|
+
|
137
|
+
Consumer.add_args(
|
138
|
+
parser, default_input_queue, default_subscriber,
|
139
|
+
)
|
140
|
+
|
141
|
+
parser.add_argument(
|
142
|
+
'-a', '--api-key',
|
143
|
+
default=default_api_key,
|
144
|
+
help='Pinecone API key. (default from PINECONE_API_KEY)'
|
145
|
+
)
|
146
|
+
|
147
|
+
parser.add_argument(
|
148
|
+
'-u', '--url',
|
149
|
+
help='Pinecone URL. If unspecified, serverless is used'
|
150
|
+
)
|
151
|
+
|
152
|
+
parser.add_argument(
|
153
|
+
'--cloud',
|
154
|
+
default=default_cloud,
|
155
|
+
help=f'Pinecone cloud, (default: {default_cloud}'
|
156
|
+
)
|
157
|
+
|
158
|
+
parser.add_argument(
|
159
|
+
'--region',
|
160
|
+
default=default_region,
|
161
|
+
help=f'Pinecone region, (default: {default_region}'
|
162
|
+
)
|
163
|
+
|
164
|
+
def run():
|
165
|
+
|
166
|
+
Processor.start(module, __doc__)
|
167
|
+
|