Configure data sources to help your users to talk to your agent
Your agent can help its users to talk to him with Datasources. A datasource is a list of preset of inputs wich will prefill the chatbox input by text, attachments, tools or metadata. Each agent needs to be configured with its own Datasources. Datasource can be designed from a simple static items list or a more complex data fetch from Automation.
Go to AI Knowledge > your agent > Advanced > Datasources.
Click on “Add a datasource”.
Fill the form
Options is the way your list will be populated. You can fill your own options statically in this form, or you can define a endpoint URL in optionsEndpoint field.Once the datasource is saved, your agent will display a + icon instead of the attachment button:This button will display a menu with every of you datasources titles:with items listed in a right sidebar:
You can set a endpoint to tell agent where to find and paginate items datasource. This endpoint must Output the following structure:
Copy
Ask AI
interface Output { items: Item[]; // Array of items of Item (see below) total: number; // Total count of items page: number; // Current page perPage: number; // Items count per page onSelect?: { url: string; }; // Optional callback endpoint called when user select an item. selection: 'single' | 'multiple'; // Single selection will close the pickr on the first selection, when multiple will allow to check many then will need to click on submit button.}interface Item { title: { fr: string en: string }; // The item title, localized description:{ fr: string en: string }; // The item description, localized author?: string; // The author name, optional updatedAt?: string; // The last update date as ISO string, optional value: { // The more important : the value added to the input when selecting item input?: string; // will replace the current value in input, but without submitting it attachments?: { url: string; type: 'image' | 'audio' | 'file'; }[]; // will attach a file to the input tool_choice?: string[]; // a list of tools to trigger metadata?: { [key: string]: any; }; // some metadata to decorate the input }; id: string; // A unique id. If you want to use the counter functionnality, keep it stable}