AI Task
Perform specific and defined AI-powered actions in your bot's workflow.
AI Task Overview
The AI Task is a tool for generating content using AI and can be used to automate a wide range of tasks. By providing clear instructions, specific inputs, and well-named variables, users can leverage the full capabilities of this tool to improve their workflows and boost their productivity.
Task Instructions
To accomplish a generative task using the AI Task Card, users will need to provide specific instructions in natural language on what they want the AI engine to generate. This can be done using the Task Instructions parameter.
Users should provide a clear and detailed description of the task they want the AI engine to perform, including any relevant constraints or guidelines that should be followed.
There is a certain date beyond which the information is not available to the AI model. You can find that date on the model you use (for example GPT-3-5). If you want to get around this, please use a Knowledge Base and add its answer as an input to give context to the AI Task.
AI Task Input
This is the input that will be sent to the Generative AI Engine. Think of it as the problem subject. Users should be as specific as possible when providing the AI task input, as this will help the AI engine generate more accurate and relevant content. You can use multiple variants as an input - not limited to:
**Type** | **Description** |
`{{event.preview}}` | that will use the last value sent to the bot as input to the AI Task. |
`{{workflow.variableName}}` | where the variableName is a variable you have previously defined in this workflow and you want to use as an input to the AI Task. |
`{{user.propertyName}}` | where the propertyName is the user property we want to use as an input to the AI Task. In addition to free text, depending on your use case and what you are trying to achieve. |
To make your AI task take into account the current date, you need to include it in the input by using this code snippet that shows the current date in javascript format: `Today's date: {{ new Date().toLocaleString()}}`
Storing result in variables
This allows users to specify the variables where the extracted information will be stored within Botpress. It is important to choose variable names that are easy to understand and identify, as these variables will be used to reference the generated content in other parts of the Botpress workflow and it will influence the AI task on what to extract and how.
Task Example
Example Input
By providing clear and realistic examples, you can help the AI better understand its task and be used
to solve real-world problems and generate useful content. This can ultimately lead to a more successful and productive experience for users who are targeting the power of artificial intelligence in their workflows.
Displaying result (optional)
You still need a content-type card to display the output of the AI Task Card if you want to.
Advanced Settings
Temperature
Temperature is a setting that controls how creative and varied the responses generated by an AI language model can be. Think of it like a dial that you can turn up or down to control how much the AI is allowed to come up with new and different responses. It ranges from 0 to 1.
When the temperature is set to 0, the AI will stick to the same answer most of the time, which can be useful for tasks that require consistency and accuracy. However, if you want more creative and varied responses, you can turn up the temperature, and the AI will come up with more diverse answers that may not always be the same.
For example, if you ask the LLM "What is your favorite animal?", with a temperature of 1 it might respond with "My favorite animal is a cat because they are cute and cuddly", but it might also generate a response like "My favorite animal is a platypus because they're such odd creatures and so unique". Both responses are consistent with the LLM's training data (which includes information about cats and platypuses), but the second response is more creative and unexpected.
In simpler terms, temperature is a way to control how much "imagination" the AI has when generating responses. A lower temperature means more consistency, while a higher temperature means more creativity and variability.
Add transition to handle failure
You can enable this option to have your bot transition to another node when an issue happens with the AI Task. The possible issues are: Request Timeout (when the AI can't answer in a timely manner), Token Overflow (when the input or the output of the task exceeds the limit) and others.
Updated 3 months ago