💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Consume generator outputs in workflow tasks, closes #291
davidmezzetti67b776ca437f
diff --git a/src/python/txtai/workflow/task/base.py b/src/python/txtai/workflow/task/base.pyindex 1caec5f2..8558c0f6 100644--- a/src/python/txtai/workflow/task/base.py+++ b/src/python/txtai/workflow/task/base.py@@ -3,6 +3,7 @@ Task module"""import re+import typesimport numpy as npimport torch@@ -314,7 +315,13 @@ class Task:"""# Execute action and get outputs- return action(inputs)+ outputs = action(inputs)++ # Consume generator output, if necessary+ if isinstance(outputs, types.GeneratorType):+ outputs = list(outputs)++ return outputsdef postprocess(self, outputs):"""