|
1 |
| -# Create a new task |
| 1 | +# Create a new instruct task |
2 | 2 |
|
3 | 3 | ## Technical definition
|
4 | 4 | A task is a JSON object that contains all necessary information to render it in the app and to guide the assistant through the process of drafting the document resulting from the task.
|
5 | 5 | You can find a template of a task in the file `task_spec.json` in this repository.
|
6 | 6 |
|
7 | 7 | Let's break this specification down with "meeting_minutes" task as an example.
|
8 | 8 |
|
| 9 | +#### Task Type |
| 10 | +``` |
| 11 | +"task_type": "instruct" |
| 12 | +``` |
| 13 | +The type of the task. Can be "workflow" or "instruct". A workflow is a task that requires multiple steps, executed as code, to be completed. See dedicated `new_workflow` documentation for more information on how to create a workflow. |
| 14 | + |
9 | 15 | #### Platforms
|
10 | 16 | ```
|
11 | 17 | "platforms": ["mobile"]
|
@@ -120,13 +126,34 @@ This field contains all the information the assistant needs to collect from the
|
120 | 126 | - description: the description of the information as it will be used in the assistant prompt
|
121 | 127 |
|
122 | 128 |
|
123 |
| -#### predefined_actions |
| 129 | +### predefined_actions |
124 | 130 | ```
|
125 |
| -"predefined_actions": [] |
| 131 | +"predefined_actions": [ |
| 132 | + { |
| 133 | + "task_pk": <pk of the task to chain>, |
| 134 | + "displayed_data": [ |
| 135 | + { |
| 136 | + "language_code": "en", |
| 137 | + "data": { |
| 138 | + "name": "Send a follow-up email", # name of the predefined action |
| 139 | + "button_text": "Send email", # text displayed on the button of the predefined action |
| 140 | + "message_prefix": "Prepare a follow-up email to send this meeting minutes to the participants: " # prefix of the message that will be sent to the assistant in behalf of the user to start the task. It will be concatenated with the produced_text of the previous task. |
| 141 | + } |
| 142 | + } |
| 143 | + ] |
| 144 | + } |
| 145 | +] |
| 146 | +``` |
| 147 | +Predefined Actions in Mojodex allow for chaining Task Executions. This feature is currently available only on the mobile app. It enables the execution of a subsequent task using the result of the previous task, maintaining the same context. |
| 148 | + |
| 149 | +### result_chat_enabled |
| 150 | +``` |
| 151 | +"result_chat_enabled": true |
126 | 152 | ```
|
127 |
| -Predefined actions will be covered in a coming documentation. Let's keep it empty for now. |
| 153 | +This field is used to enable the chat at the end of the task, once produced_text has been generated, to let user give instruction to edit the produced_text. It is by default true. On instruct tasks, it is recommended to keep it true. |
| 154 | + |
128 | 155 |
|
129 |
| -## How to create a new task? |
| 156 | +## How to create a new instruct task? |
130 | 157 |
|
131 | 158 | Let's create your first task on Mojodex.
|
132 | 159 |
|
|
0 commit comments