Skip to content

Commit 01d5074

Browse files
authored
Merge pull request #205 from hoomano/kroussel/update_new_task
task doc update
2 parents 0ad1317 + c675e6f commit 01d5074

File tree

3 files changed

+38
-7
lines changed

3 files changed

+38
-7
lines changed

docs/guides/tasks/example.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Eager to assist Mia in her quest for the perfect pitch, I set out to create a ta
3232
"mobile",
3333
"webapp"
3434
],
35+
"task_type": "instruct",
3536
"predefined_actions": [],
3637
"task_displayed_data": [
3738
{
@@ -73,7 +74,8 @@ Eager to assist Mia in her quest for the perfect pitch, I set out to create a ta
7374
"info_name": "target_market",
7475
"description": "The target market represented by an ideal customer description"
7576
}
76-
]
77+
],
78+
"result_chat_enabled": true
7779
}
7880
```
7981

docs/guides/tasks/new_task.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
# Create a new task
1+
# Create a new instruct task
22

33
## Technical definition
44
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.
55
You can find a template of a task in the file `task_spec.json` in this repository.
66

77
Let's break this specification down with "meeting_minutes" task as an example.
88

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+
915
#### Platforms
1016
```
1117
"platforms": ["mobile"]
@@ -120,13 +126,34 @@ This field contains all the information the assistant needs to collect from the
120126
- description: the description of the information as it will be used in the assistant prompt
121127

122128

123-
#### predefined_actions
129+
### predefined_actions
124130
```
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
126152
```
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+
128155

129-
## How to create a new task?
156+
## How to create a new instruct task?
130157

131158
Let's create your first task on Mojodex.
132159

docs/guides/tasks/task_spec.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"datetime": "2024-02-14T17:49:26.545180",
3+
"task_type": "instruct",
34
"platforms": ["webapp","mobile"],
45
"predefined_actions": [],
56
"task_displayed_data": [
@@ -30,5 +31,6 @@
3031
"info_name": "<INFO NAME>",
3132
"description": "<INFO DESCRIPTION>"
3233
}
33-
]
34+
],
35+
"result_chat_enabled":true
3436
}

0 commit comments

Comments
 (0)