CopilotTask
CopilotTask is used to execute one-off tasks, for example on button click.
This class is used to execute one-off tasks, for example on button press. It can use the context available via useCopilotReadable and the actions provided by useCopilotAction, or you can provide your own context and actions.
Example
In the simplest case, use CopilotTask in the context of your app by giving it instructions on what to do.
Have a look at the Presentation Example App for a more complete example.
Constructor Parameters
The instructions to be given to the assistant.
An array of action definitions that can be called.
Whether to include the copilot readable context in the task.
Whether to include actions defined via useCopilotAction in the task.
Run the task.
The CopilotContext to use for the task. Use useCopilotContext
to obtain the current context.
The data to use for the task.