trustgraph-flow 0.15.5__tar.gz → 0.16.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/PKG-INFO +2 -2
- trustgraph-flow-0.16.0/scripts/api-gateway +553 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/setup.py +4 -1
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/agent/react/service.py +13 -3
- trustgraph-flow-0.16.0/trustgraph/flow_version.py +1 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph_flow.egg-info/PKG-INFO +2 -2
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph_flow.egg-info/SOURCES.txt +1 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph_flow.egg-info/requires.txt +3 -1
- trustgraph-flow-0.15.5/trustgraph/flow_version.py +0 -1
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/README.md +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/agent-manager-react +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/chunker-recursive +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/chunker-token +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/de-query-milvus +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/de-query-qdrant +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/de-write-milvus +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/de-write-qdrant +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/document-rag +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/embeddings-ollama +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/embeddings-vectorize +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/ge-query-milvus +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/ge-query-qdrant +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/ge-write-milvus +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/ge-write-qdrant +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/graph-rag +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/kg-extract-definitions +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/kg-extract-relationships +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/kg-extract-topics +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/metering +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/object-extract-row +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/oe-write-milvus +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/pdf-decoder +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/prompt-generic +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/prompt-template +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/rows-write-cassandra +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/run-processing +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/text-completion-azure +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/text-completion-azure-openai +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/text-completion-claude +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/text-completion-cohere +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/text-completion-googleaistudio +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/text-completion-llamafile +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/text-completion-ollama +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/text-completion-openai +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/triples-query-cassandra +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/triples-query-neo4j +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/triples-write-cassandra +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/scripts/triples-write-neo4j +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/setup.cfg +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/agent/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/agent/react/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/agent/react/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/agent/react/agent_manager.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/agent/react/tools.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/agent/react/types.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/chunking/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/chunking/recursive/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/chunking/recursive/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/chunking/recursive/chunker.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/chunking/token/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/chunking/token/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/chunking/token/chunker.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/decoding/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/decoding/pdf/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/decoding/pdf/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/direct/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/direct/cassandra.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/direct/milvus_object_embeddings.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/document_rag.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/embeddings/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/embeddings/ollama/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/embeddings/ollama/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/embeddings/ollama/processor.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/embeddings/vectorize/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/embeddings/vectorize/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/embeddings/vectorize/vectorize.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/kg/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/kg/definitions/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/kg/definitions/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/kg/definitions/extract.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/kg/relationships/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/kg/relationships/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/kg/relationships/extract.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/kg/topics/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/kg/topics/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/kg/topics/extract.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/object/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/object/row/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/object/row/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/extract/object/row/extract.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/graph_rag.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/metering/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/metering/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/metering/counter.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/metering/pricelist.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/prompt/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/prompt/generic/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/prompt/generic/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/prompt/generic/prompts.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/prompt/generic/service.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/prompt/template/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/prompt/template/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/prompt/template/prompt_manager.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/prompt/template/service.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/azure/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/azure/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/azure/llm.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/claude/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/claude/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/claude/llm.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/cohere/llm.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/ollama/llm.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/openai/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/openai/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/model/text_completion/openai/llm.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/processing/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/processing/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/processing/processing.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/triples/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/triples/cassandra/service.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/query/triples/neo4j/service.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/retrieval/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/retrieval/document_rag/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/retrieval/document_rag/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/retrieval/document_rag/rag.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/retrieval/graph_rag/rag.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/object_embeddings/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/rows/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/rows/cassandra/write.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/triples/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/triples/cassandra/write.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph/storage/triples/neo4j/write.py +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
- {trustgraph-flow-0.15.5 → trustgraph-flow-0.16.0}/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.
|
3
|
+
Version: 0.16.0
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
5
5
|
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.
|
9
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.16.0.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+)
|
@@ -0,0 +1,553 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
|
3
|
+
# FIXME: Subscribes to Pulsar unnecessarily, should only do it when there
|
4
|
+
# are active listeners
|
5
|
+
|
6
|
+
# FIXME: Connection errors in publishers / subscribers cause those threads
|
7
|
+
# to fail and are not failed or retried
|
8
|
+
|
9
|
+
import asyncio
|
10
|
+
from aiohttp import web
|
11
|
+
import json
|
12
|
+
import logging
|
13
|
+
import uuid
|
14
|
+
import os
|
15
|
+
|
16
|
+
import pulsar
|
17
|
+
from pulsar.asyncio import Client
|
18
|
+
from pulsar.schema import JsonSchema
|
19
|
+
import _pulsar
|
20
|
+
import aiopulsar
|
21
|
+
|
22
|
+
from trustgraph.clients.llm_client import LlmClient
|
23
|
+
from trustgraph.clients.prompt_client import PromptClient
|
24
|
+
|
25
|
+
from trustgraph.schema import TextCompletionRequest, TextCompletionResponse
|
26
|
+
from trustgraph.schema import text_completion_request_queue
|
27
|
+
from trustgraph.schema import text_completion_response_queue
|
28
|
+
|
29
|
+
from trustgraph.schema import PromptRequest, PromptResponse
|
30
|
+
from trustgraph.schema import prompt_request_queue
|
31
|
+
from trustgraph.schema import prompt_response_queue
|
32
|
+
|
33
|
+
from trustgraph.schema import GraphRagQuery, GraphRagResponse
|
34
|
+
from trustgraph.schema import graph_rag_request_queue
|
35
|
+
from trustgraph.schema import graph_rag_response_queue
|
36
|
+
|
37
|
+
from trustgraph.schema import TriplesQueryRequest, TriplesQueryResponse, Value
|
38
|
+
from trustgraph.schema import triples_request_queue
|
39
|
+
from trustgraph.schema import triples_response_queue
|
40
|
+
|
41
|
+
from trustgraph.schema import AgentRequest, AgentResponse
|
42
|
+
from trustgraph.schema import agent_request_queue
|
43
|
+
from trustgraph.schema import agent_response_queue
|
44
|
+
|
45
|
+
from trustgraph.schema import EmbeddingsRequest, EmbeddingsResponse
|
46
|
+
from trustgraph.schema import embeddings_request_queue
|
47
|
+
from trustgraph.schema import embeddings_response_queue
|
48
|
+
|
49
|
+
logger = logging.getLogger("api")
|
50
|
+
logger.setLevel(logging.INFO)
|
51
|
+
|
52
|
+
pulsar_host = os.getenv("PULSAR_HOST", "pulsar://pulsar:6650")
|
53
|
+
TIME_OUT = 600
|
54
|
+
|
55
|
+
class Publisher:
|
56
|
+
|
57
|
+
def __init__(self, pulsar_host, topic, schema=None, max_size=10):
|
58
|
+
self.pulsar_host = pulsar_host
|
59
|
+
self.topic = topic
|
60
|
+
self.schema = schema
|
61
|
+
self.q = asyncio.Queue(maxsize=max_size)
|
62
|
+
|
63
|
+
async def run(self):
|
64
|
+
try:
|
65
|
+
async with aiopulsar.connect(self.pulsar_host) as client:
|
66
|
+
async with client.create_producer(
|
67
|
+
topic=self.topic,
|
68
|
+
schema=self.schema,
|
69
|
+
) as producer:
|
70
|
+
while True:
|
71
|
+
id, item = await self.q.get()
|
72
|
+
await producer.send(item, { "id": id })
|
73
|
+
# print("message out")
|
74
|
+
except Exception as e:
|
75
|
+
print("Exception:", e, flush=True)
|
76
|
+
|
77
|
+
async def send(self, id, msg):
|
78
|
+
await self.q.put((id, msg))
|
79
|
+
|
80
|
+
class Subscriber:
|
81
|
+
|
82
|
+
def __init__(self, pulsar_host, topic, subscription, consumer_name,
|
83
|
+
schema=None, max_size=10):
|
84
|
+
self.pulsar_host = pulsar_host
|
85
|
+
self.topic = topic
|
86
|
+
self.subscription = subscription
|
87
|
+
self.consumer_name = consumer_name
|
88
|
+
self.schema = schema
|
89
|
+
self.q = {}
|
90
|
+
|
91
|
+
async def run(self):
|
92
|
+
try:
|
93
|
+
async with aiopulsar.connect(pulsar_host) as client:
|
94
|
+
async with client.subscribe(
|
95
|
+
topic=self.topic,
|
96
|
+
subscription_name=self.subscription,
|
97
|
+
consumer_name=self.consumer_name,
|
98
|
+
schema=self.schema,
|
99
|
+
) as consumer:
|
100
|
+
while True:
|
101
|
+
msg = await consumer.receive()
|
102
|
+
# print("message in", self.topic)
|
103
|
+
id = msg.properties()["id"]
|
104
|
+
value = msg.value()
|
105
|
+
if id in self.q:
|
106
|
+
await self.q[id].put(value)
|
107
|
+
except Exception as e:
|
108
|
+
print("Exception:", e, flush=True)
|
109
|
+
|
110
|
+
async def subscribe(self, id):
|
111
|
+
q = asyncio.Queue()
|
112
|
+
self.q[id] = q
|
113
|
+
return q
|
114
|
+
|
115
|
+
async def unsubscribe(self, id):
|
116
|
+
if id in self.q:
|
117
|
+
del self.q[id]
|
118
|
+
|
119
|
+
class Api:
|
120
|
+
|
121
|
+
def __init__(self, **config):
|
122
|
+
|
123
|
+
self.port = int(config.get("port", "8088"))
|
124
|
+
self.app = web.Application(middlewares=[])
|
125
|
+
|
126
|
+
self.llm_out = Publisher(
|
127
|
+
pulsar_host, text_completion_request_queue,
|
128
|
+
schema=JsonSchema(TextCompletionRequest)
|
129
|
+
)
|
130
|
+
|
131
|
+
self.llm_in = Subscriber(
|
132
|
+
pulsar_host, text_completion_response_queue,
|
133
|
+
"api-gateway", "api-gateway",
|
134
|
+
JsonSchema(TextCompletionResponse)
|
135
|
+
)
|
136
|
+
|
137
|
+
self.prompt_out = Publisher(
|
138
|
+
pulsar_host, prompt_request_queue,
|
139
|
+
schema=JsonSchema(PromptRequest)
|
140
|
+
)
|
141
|
+
|
142
|
+
self.prompt_in = Subscriber(
|
143
|
+
pulsar_host, prompt_response_queue,
|
144
|
+
"api-gateway", "api-gateway",
|
145
|
+
JsonSchema(PromptResponse)
|
146
|
+
)
|
147
|
+
|
148
|
+
self.graph_rag_out = Publisher(
|
149
|
+
pulsar_host, graph_rag_request_queue,
|
150
|
+
schema=JsonSchema(GraphRagQuery)
|
151
|
+
)
|
152
|
+
|
153
|
+
self.graph_rag_in = Subscriber(
|
154
|
+
pulsar_host, graph_rag_response_queue,
|
155
|
+
"api-gateway", "api-gateway",
|
156
|
+
JsonSchema(GraphRagResponse)
|
157
|
+
)
|
158
|
+
|
159
|
+
self.triples_query_out = Publisher(
|
160
|
+
pulsar_host, triples_request_queue,
|
161
|
+
schema=JsonSchema(TriplesQueryRequest)
|
162
|
+
)
|
163
|
+
|
164
|
+
self.triples_query_in = Subscriber(
|
165
|
+
pulsar_host, triples_response_queue,
|
166
|
+
"api-gateway", "api-gateway",
|
167
|
+
JsonSchema(TriplesQueryResponse)
|
168
|
+
)
|
169
|
+
|
170
|
+
self.agent_out = Publisher(
|
171
|
+
pulsar_host, agent_request_queue,
|
172
|
+
schema=JsonSchema(AgentRequest)
|
173
|
+
)
|
174
|
+
|
175
|
+
self.agent_in = Subscriber(
|
176
|
+
pulsar_host, agent_response_queue,
|
177
|
+
"api-gateway", "api-gateway",
|
178
|
+
JsonSchema(AgentResponse)
|
179
|
+
)
|
180
|
+
|
181
|
+
self.embeddings_out = Publisher(
|
182
|
+
pulsar_host, embeddings_request_queue,
|
183
|
+
schema=JsonSchema(EmbeddingsRequest)
|
184
|
+
)
|
185
|
+
|
186
|
+
self.embeddings_in = Subscriber(
|
187
|
+
pulsar_host, embeddings_response_queue,
|
188
|
+
"api-gateway", "api-gateway",
|
189
|
+
JsonSchema(EmbeddingsResponse)
|
190
|
+
)
|
191
|
+
|
192
|
+
self.app.add_routes([
|
193
|
+
web.post("/api/v1/text-completion", self.llm),
|
194
|
+
web.post("/api/v1/prompt", self.prompt),
|
195
|
+
web.post("/api/v1/graph-rag", self.graph_rag),
|
196
|
+
web.post("/api/v1/triples-query", self.triples_query),
|
197
|
+
web.post("/api/v1/agent", self.agent),
|
198
|
+
web.post("/api/v1/embeddings", self.embeddings),
|
199
|
+
])
|
200
|
+
|
201
|
+
async def llm(self, request):
|
202
|
+
|
203
|
+
id = str(uuid.uuid4())
|
204
|
+
|
205
|
+
try:
|
206
|
+
|
207
|
+
data = await request.json()
|
208
|
+
|
209
|
+
q = await self.llm_in.subscribe(id)
|
210
|
+
|
211
|
+
await self.llm_out.send(
|
212
|
+
id,
|
213
|
+
TextCompletionRequest(
|
214
|
+
system=data["system"],
|
215
|
+
prompt=data["prompt"]
|
216
|
+
)
|
217
|
+
)
|
218
|
+
|
219
|
+
try:
|
220
|
+
resp = await asyncio.wait_for(q.get(), TIME_OUT)
|
221
|
+
except:
|
222
|
+
raise RuntimeError("Timeout waiting for response")
|
223
|
+
|
224
|
+
if resp.error:
|
225
|
+
return web.json_response(
|
226
|
+
{ "error": resp.error.message }
|
227
|
+
)
|
228
|
+
|
229
|
+
return web.json_response(
|
230
|
+
{ "response": resp.response }
|
231
|
+
)
|
232
|
+
|
233
|
+
except Exception as e:
|
234
|
+
logging.error(f"Exception: {e}")
|
235
|
+
|
236
|
+
return web.json_response(
|
237
|
+
{ "error": str(e) }
|
238
|
+
)
|
239
|
+
|
240
|
+
finally:
|
241
|
+
await self.llm_in.unsubscribe(id)
|
242
|
+
|
243
|
+
async def prompt(self, request):
|
244
|
+
|
245
|
+
id = str(uuid.uuid4())
|
246
|
+
|
247
|
+
try:
|
248
|
+
|
249
|
+
data = await request.json()
|
250
|
+
|
251
|
+
q = await self.prompt_in.subscribe(id)
|
252
|
+
|
253
|
+
terms = {
|
254
|
+
k: json.dumps(v)
|
255
|
+
for k, v in data["variables"].items()
|
256
|
+
}
|
257
|
+
|
258
|
+
await self.prompt_out.send(
|
259
|
+
id,
|
260
|
+
PromptRequest(
|
261
|
+
id=data["id"],
|
262
|
+
terms=terms
|
263
|
+
)
|
264
|
+
)
|
265
|
+
|
266
|
+
try:
|
267
|
+
resp = await asyncio.wait_for(q.get(), TIME_OUT)
|
268
|
+
except:
|
269
|
+
raise RuntimeError("Timeout waiting for response")
|
270
|
+
|
271
|
+
if resp.error:
|
272
|
+
return web.json_response(
|
273
|
+
{ "error": resp.error.message }
|
274
|
+
)
|
275
|
+
|
276
|
+
if resp.object:
|
277
|
+
return web.json_response(
|
278
|
+
{ "object": resp.object }
|
279
|
+
)
|
280
|
+
|
281
|
+
return web.json_response(
|
282
|
+
{ "text": resp.text }
|
283
|
+
)
|
284
|
+
|
285
|
+
except Exception as e:
|
286
|
+
logging.error(f"Exception: {e}")
|
287
|
+
|
288
|
+
return web.json_response(
|
289
|
+
{ "error": str(e) }
|
290
|
+
)
|
291
|
+
|
292
|
+
finally:
|
293
|
+
await self.prompt_in.unsubscribe(id)
|
294
|
+
|
295
|
+
async def graph_rag(self, request):
|
296
|
+
|
297
|
+
id = str(uuid.uuid4())
|
298
|
+
|
299
|
+
try:
|
300
|
+
|
301
|
+
data = await request.json()
|
302
|
+
|
303
|
+
q = await self.graph_rag_in.subscribe(id)
|
304
|
+
|
305
|
+
await self.graph_rag_out.send(
|
306
|
+
id,
|
307
|
+
GraphRagQuery(
|
308
|
+
query=data["query"],
|
309
|
+
user=data.get("user", "trustgraph"),
|
310
|
+
collection=data.get("collection", "default"),
|
311
|
+
)
|
312
|
+
)
|
313
|
+
|
314
|
+
try:
|
315
|
+
resp = await asyncio.wait_for(q.get(), TIME_OUT)
|
316
|
+
except:
|
317
|
+
raise RuntimeError("Timeout waiting for response")
|
318
|
+
|
319
|
+
if resp.error:
|
320
|
+
return web.json_response(
|
321
|
+
{ "error": resp.error.message }
|
322
|
+
)
|
323
|
+
|
324
|
+
return web.json_response(
|
325
|
+
{ "response": resp.response }
|
326
|
+
)
|
327
|
+
|
328
|
+
except Exception as e:
|
329
|
+
logging.error(f"Exception: {e}")
|
330
|
+
|
331
|
+
return web.json_response(
|
332
|
+
{ "error": str(e) }
|
333
|
+
)
|
334
|
+
|
335
|
+
finally:
|
336
|
+
await self.graph_rag_in.unsubscribe(id)
|
337
|
+
|
338
|
+
async def triples_query(self, request):
|
339
|
+
|
340
|
+
id = str(uuid.uuid4())
|
341
|
+
|
342
|
+
try:
|
343
|
+
|
344
|
+
data = await request.json()
|
345
|
+
|
346
|
+
q = await self.triples_query_in.subscribe(id)
|
347
|
+
|
348
|
+
if "s" in data:
|
349
|
+
if data["s"].startswith("http:") or data["s"].startswith("https:"):
|
350
|
+
s = Value(value=data["s"], is_uri=True)
|
351
|
+
else:
|
352
|
+
s = Value(value=data["s"], is_uri=True)
|
353
|
+
else:
|
354
|
+
s = None
|
355
|
+
|
356
|
+
if "p" in data:
|
357
|
+
if data["p"].startswith("http:") or data["p"].startswith("https:"):
|
358
|
+
p = Value(value=data["p"], is_uri=True)
|
359
|
+
else:
|
360
|
+
p = Value(value=data["p"], is_uri=True)
|
361
|
+
else:
|
362
|
+
p = None
|
363
|
+
|
364
|
+
if "o" in data:
|
365
|
+
if data["o"].startswith("http:") or data["o"].startswith("https:"):
|
366
|
+
o = Value(value=data["o"], is_uri=True)
|
367
|
+
else:
|
368
|
+
o = Value(value=data["o"], is_uri=True)
|
369
|
+
else:
|
370
|
+
o = None
|
371
|
+
|
372
|
+
limit = int(data.get("limit", 10000))
|
373
|
+
|
374
|
+
await self.triples_query_out.send(
|
375
|
+
id,
|
376
|
+
TriplesQueryRequest(
|
377
|
+
s = s, p = p, o = o,
|
378
|
+
limit = limit,
|
379
|
+
user = data.get("user", "trustgraph"),
|
380
|
+
collection = data.get("collection", "default"),
|
381
|
+
)
|
382
|
+
)
|
383
|
+
|
384
|
+
try:
|
385
|
+
resp = await asyncio.wait_for(q.get(), TIME_OUT)
|
386
|
+
except:
|
387
|
+
raise RuntimeError("Timeout waiting for response")
|
388
|
+
|
389
|
+
if resp.error:
|
390
|
+
return web.json_response(
|
391
|
+
{ "error": resp.error.message }
|
392
|
+
)
|
393
|
+
|
394
|
+
return web.json_response(
|
395
|
+
{
|
396
|
+
"response": [
|
397
|
+
{
|
398
|
+
"s": {
|
399
|
+
"v": t.s.value,
|
400
|
+
"e": t.s.is_uri,
|
401
|
+
},
|
402
|
+
"p": {
|
403
|
+
"v": t.p.value,
|
404
|
+
"e": t.p.is_uri,
|
405
|
+
},
|
406
|
+
"o": {
|
407
|
+
"v": t.o.value,
|
408
|
+
"e": t.o.is_uri,
|
409
|
+
}
|
410
|
+
}
|
411
|
+
for t in resp.triples
|
412
|
+
]
|
413
|
+
}
|
414
|
+
)
|
415
|
+
|
416
|
+
except Exception as e:
|
417
|
+
logging.error(f"Exception: {e}")
|
418
|
+
|
419
|
+
return web.json_response(
|
420
|
+
{ "error": str(e) }
|
421
|
+
)
|
422
|
+
|
423
|
+
finally:
|
424
|
+
await self.graph_rag_in.unsubscribe(id)
|
425
|
+
|
426
|
+
async def agent(self, request):
|
427
|
+
|
428
|
+
id = str(uuid.uuid4())
|
429
|
+
|
430
|
+
try:
|
431
|
+
|
432
|
+
data = await request.json()
|
433
|
+
|
434
|
+
q = await self.agent_in.subscribe(id)
|
435
|
+
|
436
|
+
await self.agent_out.send(
|
437
|
+
id,
|
438
|
+
AgentRequest(
|
439
|
+
question=data["question"],
|
440
|
+
)
|
441
|
+
)
|
442
|
+
|
443
|
+
while True:
|
444
|
+
try:
|
445
|
+
resp = await asyncio.wait_for(q.get(), TIME_OUT)
|
446
|
+
except:
|
447
|
+
raise RuntimeError("Timeout waiting for response")
|
448
|
+
|
449
|
+
if resp.error:
|
450
|
+
return web.json_response(
|
451
|
+
{ "error": resp.error.message }
|
452
|
+
)
|
453
|
+
|
454
|
+
if resp.answer: break
|
455
|
+
|
456
|
+
if resp.thought: print("thought:", resp.thought)
|
457
|
+
if resp.observation: print("observation:", resp.observation)
|
458
|
+
|
459
|
+
if resp.answer:
|
460
|
+
return web.json_response(
|
461
|
+
{ "answer": resp.answer }
|
462
|
+
)
|
463
|
+
|
464
|
+
# Can't happen, ook at the logic
|
465
|
+
raise RuntimeError("Strange state")
|
466
|
+
|
467
|
+
except Exception as e:
|
468
|
+
logging.error(f"Exception: {e}")
|
469
|
+
|
470
|
+
return web.json_response(
|
471
|
+
{ "error": str(e) }
|
472
|
+
)
|
473
|
+
|
474
|
+
finally:
|
475
|
+
await self.agent_in.unsubscribe(id)
|
476
|
+
|
477
|
+
async def embeddings(self, request):
|
478
|
+
|
479
|
+
id = str(uuid.uuid4())
|
480
|
+
|
481
|
+
try:
|
482
|
+
|
483
|
+
data = await request.json()
|
484
|
+
|
485
|
+
q = await self.embeddings_in.subscribe(id)
|
486
|
+
|
487
|
+
await self.embeddings_out.send(
|
488
|
+
id,
|
489
|
+
EmbeddingsRequest(
|
490
|
+
text=data["text"],
|
491
|
+
)
|
492
|
+
)
|
493
|
+
|
494
|
+
try:
|
495
|
+
resp = await asyncio.wait_for(q.get(), TIME_OUT)
|
496
|
+
except:
|
497
|
+
raise RuntimeError("Timeout waiting for response")
|
498
|
+
|
499
|
+
if resp.error:
|
500
|
+
return web.json_response(
|
501
|
+
{ "error": resp.error.message }
|
502
|
+
)
|
503
|
+
|
504
|
+
return web.json_response(
|
505
|
+
{ "vectors": resp.vectors }
|
506
|
+
)
|
507
|
+
|
508
|
+
except Exception as e:
|
509
|
+
logging.error(f"Exception: {e}")
|
510
|
+
|
511
|
+
return web.json_response(
|
512
|
+
{ "error": str(e) }
|
513
|
+
)
|
514
|
+
|
515
|
+
finally:
|
516
|
+
await self.embeddings_in.unsubscribe(id)
|
517
|
+
|
518
|
+
async def app_factory(self):
|
519
|
+
|
520
|
+
self.llm_pub_task = asyncio.create_task(self.llm_in.run())
|
521
|
+
self.llm_sub_task = asyncio.create_task(self.llm_out.run())
|
522
|
+
|
523
|
+
self.prompt_pub_task = asyncio.create_task(self.prompt_in.run())
|
524
|
+
self.prompt_sub_task = asyncio.create_task(self.prompt_out.run())
|
525
|
+
|
526
|
+
self.graph_rag_pub_task = asyncio.create_task(self.graph_rag_in.run())
|
527
|
+
self.graph_rag_sub_task = asyncio.create_task(self.graph_rag_out.run())
|
528
|
+
|
529
|
+
self.triples_query_pub_task = asyncio.create_task(
|
530
|
+
self.triples_query_in.run()
|
531
|
+
)
|
532
|
+
self.triples_query_sub_task = asyncio.create_task(
|
533
|
+
self.triples_query_out.run()
|
534
|
+
)
|
535
|
+
|
536
|
+
self.agent_pub_task = asyncio.create_task(self.agent_in.run())
|
537
|
+
self.agent_sub_task = asyncio.create_task(self.agent_out.run())
|
538
|
+
|
539
|
+
self.embeddings_pub_task = asyncio.create_task(
|
540
|
+
self.embeddings_in.run()
|
541
|
+
)
|
542
|
+
self.embeddings_sub_task = asyncio.create_task(
|
543
|
+
self.embeddings_out.run()
|
544
|
+
)
|
545
|
+
|
546
|
+
return self.app
|
547
|
+
|
548
|
+
def run(self):
|
549
|
+
web.run_app(self.app_factory(), port=self.port)
|
550
|
+
|
551
|
+
a = Api()
|
552
|
+
a.run()
|
553
|
+
|
@@ -34,7 +34,7 @@ setuptools.setup(
|
|
34
34
|
python_requires='>=3.8',
|
35
35
|
download_url = "https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v" + version + ".tar.gz",
|
36
36
|
install_requires=[
|
37
|
-
"trustgraph-base>=0.
|
37
|
+
"trustgraph-base>=0.16,<0.17",
|
38
38
|
"urllib3",
|
39
39
|
"rdflib",
|
40
40
|
"pymilvus",
|
@@ -58,8 +58,11 @@ setuptools.setup(
|
|
58
58
|
"google-generativeai",
|
59
59
|
"ibis",
|
60
60
|
"jsonschema",
|
61
|
+
"aiohttp",
|
62
|
+
"aiopulsar-py",
|
61
63
|
],
|
62
64
|
scripts=[
|
65
|
+
"scripts/api-gateway",
|
63
66
|
"scripts/agent-manager-react",
|
64
67
|
"scripts/chunker-recursive",
|
65
68
|
"scripts/chunker-token",
|
@@ -32,6 +32,7 @@ module = ".".join(__name__.split(".")[1:-1])
|
|
32
32
|
default_input_queue = agent_request_queue
|
33
33
|
default_output_queue = agent_response_queue
|
34
34
|
default_subscriber = module
|
35
|
+
default_max_iterations = 15
|
35
36
|
|
36
37
|
class Processor(ConsumerProducer):
|
37
38
|
|
@@ -39,6 +40,8 @@ class Processor(ConsumerProducer):
|
|
39
40
|
|
40
41
|
additional = params.get("context", None)
|
41
42
|
|
43
|
+
self.max_iterations = int(params.get("max_iterations", default_max_iterations))
|
44
|
+
|
42
45
|
tools = {}
|
43
46
|
|
44
47
|
# Parsing the prompt information to the prompt configuration
|
@@ -67,8 +70,9 @@ class Processor(ConsumerProducer):
|
|
67
70
|
)
|
68
71
|
|
69
72
|
if len(ttoks) == 1:
|
73
|
+
|
70
74
|
tools[toks[0]] = Tool(
|
71
|
-
name =
|
75
|
+
name = toks[0],
|
72
76
|
description = "",
|
73
77
|
implementation = impl,
|
74
78
|
config = { "input": "query" },
|
@@ -76,7 +80,7 @@ class Processor(ConsumerProducer):
|
|
76
80
|
)
|
77
81
|
else:
|
78
82
|
tools[toks[0]] = Tool(
|
79
|
-
name =
|
83
|
+
name = toks[0],
|
80
84
|
description = "",
|
81
85
|
implementation = impl,
|
82
86
|
config = { "input": ttoks[1] },
|
@@ -226,7 +230,7 @@ class Processor(ConsumerProducer):
|
|
226
230
|
|
227
231
|
print(f"Question: {v.question}", flush=True)
|
228
232
|
|
229
|
-
if len(history)
|
233
|
+
if len(history) >= self.max_iterations:
|
230
234
|
raise RuntimeError("Too many agent iterations")
|
231
235
|
|
232
236
|
print(f"History: {history}", flush=True)
|
@@ -394,6 +398,12 @@ description.'''
|
|
394
398
|
help=f'Optional, specifies additional context text for the LLM.'
|
395
399
|
)
|
396
400
|
|
401
|
+
parser.add_argument(
|
402
|
+
'--max-iterations',
|
403
|
+
default=default_max_iterations,
|
404
|
+
help=f'Maximum number of react iterations (default: {default_max_iterations})',
|
405
|
+
)
|
406
|
+
|
397
407
|
def run():
|
398
408
|
|
399
409
|
Processor.start(module, __doc__)
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.16.0"
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: trustgraph-flow
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.16.0
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
5
5
|
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.
|
9
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.16.0.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 +0,0 @@
|
|
1
|
-
__version__ = "0.15.5"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|