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_policywill not be used to answer questions about shipping. - However, the
suggested_replyfeature does not take code into account, so all sources can be used to generate answers in the chat.
AI agent example
{
"url": "https://kommo.com/blog",
"with_nested": true,
"available_functions": ["agent"],
"code": "privacy_policy"
}You added a source with available_functions: ["agent"] and code: "shipping_policy". This means that the AI agent will only use it for responses about shipping conditions and won't use it in other topics. The suggested_reply functionality won't index this source when searching for an answer.
AI Suggested Reply example
{
"url": "https://kommo.com/blog",
"with_nested": true,
"available_functions": ["suggested_reply"],
"code": "shipping_policy"
}You have added a source with available_functions: ["suggested_reply"]. When generating responses, this functionality doesn't 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:
|