Request parameters
The code
field defines what a source can be used for in the AI agent.
The field helps the system understand how to use the data. For example, if a source contains a return policy, it should only be used in responses related to product returns.
- If a source has a specific code, the AI agent will not be able to use it in other contexts. For example, a document with code:
'privacy_policy'
won't be used to answer questions about shipping. - However, the
suggested_reply
feature doesn't take code into account, so all sources can be used to generate answers in the chat.
AI agent example
{
"name": "Source 13.02.2025 16:12",
"lang": "en",
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec est neque, iaculis eu viverra id, sollicitudin non orci. Aenean fringilla est sed neque egestas, ac mattis nibh venenatis. Etiam sit amet ornare nisi, eget volutpat mauris. Praesent eget sollicitudin nibh, eu ullamcorper felis. Aliquam vestibulum libero vel neque tristique sagittis. Vivamus ornare, quam id dictum sollicitudin, nisi ex fringilla mi, vitae varius turpis turpis eu arcu. Suspendisse vulputate rhoncus nulla, vehicula scelerisque metus porttitor et. In laoreet erat ut libero consequat convallis. Curabitur eget risus gravida, fringilla massa at, aliquet nunc.",
"available_functions": ["agent"],
"code": "privacy_policy"
}
You added a source with available_functions: ["agent"]
and code: "privacy_policy"
. This means that the AI agent will only use it for responses about privacy policy and will not use it in other topics. The suggested_reply
functionality will not index this source when searching for an answer.
AI Suggested Reply example
{
"name": "Source 27.02.2025 16:35",
"lang": "es",
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec est neque, iaculis eu viverra id, sollicitudin non orci. Aenean fringilla est sed neque egestas, ac mattis nibh venenatis. Etiam sit amet ornare nisi, eget volutpat mauris. Praesent eget sollicitudin nibh, eu ullamcorper felis. Aliquam vestibulum libero vel neque tristique sagittis. Vivamus ornare, quam id dictum sollicitudin, nisi ex fringilla mi, vitae varius turpis turpis eu arcu. Suspendisse vulputate rhoncus nulla, vehicula scelerisque metus porttitor et. In laoreet erat ut libero consequat convallis. Curabitur eget risus gravida, fringilla massa at, aliquet nunc.",
"available_functions": ["suggested_reply"],
"code": "shipping_policy"
}
You have added a source with available_functions: ["suggested_reply"]
. When generating responses, this functionality does not check the value of the code field at all, but simply uses any sources available to it with the available functions field.
There are 5 unique policies in total:
- contact information (
contact_information
) - personal data processing (
privacy_policy
) - return policy (
return_and_refund_policy
) - delivery policy (
shipping_policy
) - terms of service (
terms_of_service
)

Displaying policies for AI agent functionality in the interface
Response parameters
Parameter | Data type | Description |
---|---|---|
id | int | ID of the added source |
name | string | The name of the added source. |
updated_at | int | Time of the last source update. Time format is Unix Timestmp. |
updated_by | int | ID of the last user to perform an update on the source. |
code | string | Available values: 1. contact_information 2. privacy_policy 3. return_and_refund_policy 4. shipping_policy 5. terms_of_service If the source does not have the code, this field does not come in the response. |