Skip to content

Instantly share code, notes, and snippets.

@foeken
Created October 7, 2024 05:59
Show Gist options
  • Save foeken/5b0a0a49a71ba3e6ff71c9243290a880 to your computer and use it in GitHub Desktop.
Save foeken/5b0a0a49a71ba3e6ff71c9243290a880 to your computer and use it in GitHub Desktop.
Inbox AI + Todoist: Extract Task + API
[
{
"forceConfigurable" : false,
"icon" : "folder",
"variables" : [
],
"id" : "948AA799-B00C-4F9F-AE46-D55D6DCC4D97",
"instructions" : "",
"identifier" : "todoist",
"description" : "",
"order" : 24,
"displayName" : "Todoist",
"type" : "folder"
},
{
"instructions" : "",
"type" : "askAI",
"order" : 30,
"actions" : [
"11D61252-7538-433E-B83C-1C457CF78040"
],
"identifier" : "extractTasksAdd",
"icon" : "brain",
"displayName" : "Extract Tasks & Add",
"prompt" : "Today is {{ date.weekday }}, {{ date.today }} {{ time.now }}.\n\nExtract all tasks for {{ settings.name }} from the input below (and optionally the image), assume the input is directed at the receiver of the tasks. \n\nIf you see a name that you assume is the requester, include that. Include the source of the task if you can figure that out (i.e Mail, Slack) as a label. Do not use other labels. Tasks are ALWAYS in English, and NEVER contain newlines.\n\nRead the assignment again: Extract tasks, requester, and source. In English, no newlines.\n\nExample tasks:\n- Perform x for y (Label: Slack)\n- Read x\n- Sign document x (Label: Mail)\n\nInput:\n{{ originalInput | process }}",
"id" : "683BACD4-415E-490D-8655-7E7D049D3389",
"description" : "This action extracts tasks and sends them to Todoist",
"folderId" : "948AA799-B00C-4F9F-AE46-D55D6DCC4D97",
"forceConfigurable" : false,
"variables" : [
]
},
{
"identifier" : "createTaskApi",
"variables" : [
{
"label" : "Task",
"type" : "string",
"description" : "The task to add",
"id" : "FB118F7A-1E56-4B8E-B5C5-3DD9F3841FFC",
"name" : "task",
"ai" : true,
"value" : ""
},
{
"type" : "string",
"id" : "6A65B214-A874-41EB-BBD7-EE666CB26452",
"ai" : true,
"label" : "Due",
"value" : "",
"name" : "dueString",
"description" : "Human readable string of the due date (i.e Today). Keep empty for no due date."
},
{
"name" : "labels",
"id" : "16CA481B-7754-48D9-9540-6281779A13EC",
"ai" : true,
"value" : "",
"label" : "Labels",
"description" : "A set of text labels for your task",
"type" : "array"
},
{
"label" : "API Token",
"ai" : false,
"type" : "string",
"id" : "0EED9C78-0D1F-400D-9945-6CA99B11D5A0",
"value" : "",
"description" : "Your Todoist Integration Token",
"name" : "secretToken"
}
],
"id" : "11D61252-7538-433E-B83C-1C457CF78040",
"displayName" : "Create Task (API)",
"order" : 31,
"description" : "Add a task to Todoist",
"url" : "https:\/\/api.todoist.com\/rest\/v2\/tasks",
"instructions" : "Uses the Todoist API to add tasks.",
"payload" : "{\n \"content\": \"{{ task | jsonEscape }}\", \n \"due_string\": \"{{ dueString }}\", \n \"priority\": 2, \n \"labels\": [{% for label in labels %}\"{{ label }}\"{% if forloop.counter != forloop.length %},{% endif %}{% endfor %}]\n}",
"type" : "makeAPIRequest",
"method" : "POST",
"folderId" : "948AA799-B00C-4F9F-AE46-D55D6DCC4D97",
"forceConfigurable" : true,
"icon" : "network",
"headers" : [
{
"value" : "application\/json",
"id" : "A76D1D9E-4490-418E-96A7-4FA32EBAD5FA",
"key" : "Content-Type"
},
{
"id" : "4FC37D09-4DAE-4FBA-BC38-853666C27234",
"key" : "Authorization",
"value" : "Bearer {{secretToken}}"
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment