Skip to content

armgit / txtai

Public Imported from GitHub
0

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

Update documentation

davidmezzettief9b01b9d5ff
diff --git a/docs/api/configuration.md b/docs/api/configuration.md
index 2f73d50d..6ce2a167 100644
--- a/docs/api/configuration.md
+++ b/docs/api/configuration.md
@@ -95,20 +95,32 @@ tasks: list
Expects a list of workflow tasks. Each element defines a single workflow task. All [task configuration](../../workflow/task) is supported.
+A shorthand syntax for creating tasks is supported. This syntax will automatically map task strings to an `action:value` pair.
+
+Example below.
+
+```yaml
+workflow:
+ index:
+ tasks:
+ - action1
+ - action2
+```
+
Each task element supports the following additional arguments.
#### action
```yaml
-task: string|list
+action: string|list
```
Both single and multi-action tasks are supported.
-The action parameter works slightly different when passed via configuration. The parameter(s) needs to be converted into callable method(s). If action is pipeline that has been defined in the current configuration, it will use that pipeline as the action.
+The action parameter works slightly different when passed via configuration. The parameter(s) needs to be converted into callable method(s). If action is a pipeline that has been defined in the current configuration, it will use that pipeline as the action.
-There are two special action names `index` and `upsert`. If those are used as the action, the task will collect workflow data elements and load them into defined the embeddings index.
+There are three special action names `index`, `upsert` and `search`. If `index` or `upsert` are used as the action, the task will collect workflow data elements and load them into defined the embeddings index. If `search` is used, the task will execute embeddings queries for each input data element.
-Otherwise, the action must be a path to a static callable function. The configuration parser will resolve the function name and use that as the task action.
+Otherwise, the action must be a path to a callable object or function. The configuration parser will resolve the function name and use that as the task action.
#### task
```yaml
diff --git a/docs/workflow/task/console.md b/docs/workflow/task/console.md
new file mode 100644
index 00000000..cbb7bf4e
--- /dev/null
+++ b/docs/workflow/task/console.md
@@ -0,0 +1,33 @@
+# Console Task
+
+![task](../../images/task.png#only-light)
+![task](../../images/task-dark.png#only-dark)
+
+The Console Task prints task inputs and outputs to standard output. This task is mainly used for debugging and can be added at any point in a workflow.
+
+## Example
+
+The following shows a simple example using this task as part of a workflow.
+
+```python
+from txtai.workflow import FileTask, Workflow
+
+workflow = Workflow([ConsoleTask()])
+workflow(["Input 1", "Input2"])
+```
+
+## Configuration-driven example
+
+This task can also be created with workflow configuration.
+
+```yaml
+workflow:
+ tasks:
+ - task: console
+```
+
+## Methods
+
+Python documentation for the task.
+
+### ::: txtai.workflow.ConsoleTask.__init__
diff --git a/docs/workflow/task/export.md b/docs/workflow/task/export.md
new file mode 100644
index 00000000..35348d8f
--- /dev/null
+++ b/docs/workflow/task/export.md
@@ -0,0 +1,34 @@
+# Export Task
+
+![task](../../images/task.png#only-light)
+![task](../../images/task-dark.png#only-dark)
+
+The Export Task exports task outputs to CSV or Excel.
+
+## Example
+
+The following shows a simple example using this task as part of a workflow.
+
+```python
+from txtai.workflow import FileTask, Workflow
+
+workflow = Workflow([ExportTask()])
+workflow(["Input 1", "Input2"])
+```
+
+## Configuration-driven example
+
+This task can also be created with workflow configuration.
+
+```yaml
+workflow:
+ tasks:
+ - task: export
+```
+
+## Methods
+
+Python documentation for the task.
+
+### ::: txtai.workflow.ExportTask.__init__
+### ::: txtai.workflow.ExportTask.register
diff --git a/mkdocs.yml b/mkdocs.yml
index d5c25c00..5e825957 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -81,6 +81,8 @@ nav:
- Schedule: workflow/schedule.md
- Tasks:
- workflow/task/index.md
+ - Console: workflow/task/console.md
+ - Export: workflow/task/export.md
- File: workflow/task/file.md
- Image: workflow/task/image.md
- Retrieve: workflow/task/retrieve.md