Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Fixed regression with WorkflowTask

davidmezzettif200f2c2d871
diff --git a/.coverage.neuml.1330784.482110 b/.coverage.neuml.1330784.482110
new file mode 100644
index 00000000..be176b40
Binary files /dev/null and b/.coverage.neuml.1330784.482110 differ
diff --git a/.coverage.neuml.1330785.830081 b/.coverage.neuml.1330785.830081
new file mode 100644
index 00000000..e69de29b
diff --git a/src/python/txtai/workflow/task/workflow.py b/src/python/txtai/workflow/task/workflow.py
index 8ebcd5ef..8dd63418 100644
--- a/src/python/txtai/workflow/task/workflow.py
+++ b/src/python/txtai/workflow/task/workflow.py
@@ -11,4 +11,4 @@ class WorkflowTask(Task):
"""
def __call__(self, elements):
- return [list(result) for result in super().__call__(elements)]
+ return list(super().__call__(elements))
diff --git a/test/python/testworkflow.py b/test/python/testworkflow.py
index 7f9c3a20..cb103b97 100644
--- a/test/python/testworkflow.py
+++ b/test/python/testworkflow.py
@@ -61,8 +61,7 @@ class TestWorkflow(unittest.TestCase):
# Execute workflow, discard results as they are streamed
workflow = Workflow(tasks)
- for _ in workflow(data):
- pass
+ data = list(workflow(data))
# Build the embeddings index
embeddings.index(documents)
@@ -73,6 +72,7 @@ class TestWorkflow(unittest.TestCase):
# Run search and validate result
index, _ = embeddings.search("search text", 1)[0]
self.assertEqual(index, 0)
+ self.assertEqual(data[0][1], "txtai builds an AI-powered index over sections")
def testExtractWorkflow(self):
"""