You have completed purchase activation, project creation, and data preparation.
To integrate the intelligent analysis Agent with the Lark application in a privatized environment, during deployment of the intelligent analysis Agent, contact the deployment and operations administrator to configure the Lark office platform as part of office platform integration. Once this is completed, you can then configure the Lark platform integration settings in the intelligent analysis Agent.
Create a new intelligent agent. Go to the configuration page of the intelligent analysis Agent . Click "Create intelligent agent" in the upper right corner to access the initial configuration page for the intelligent agent.
General configuration for intelligent agent. Configure basic information for the intelligent agent, including avatar, name, description, and administrator. After configuration, click "Save".
Obtain the callback address. Click and copy the "Lark callback address" below the intelligent agent name.
Apply for a Lark bot. Go to the Lark open platform. To create a Lark bot, go to Lark open platform and select "Create enterprise self-built application".
Create an enterprise self-built application.
In the pop-up window to create an enterprise self-built application, enter the application name, description, and icon. The application name here will correspond to the intelligent agent name that users search for on Lark later.
After entering the information, click "Create" to create an application.
Add bot capabilities to the created application. First, go to the application's configuration page. Then, go to "Add application capabilities" on the left and select "Bot".
Add the required permissions for the bot**.** To enable normal interaction for the bot, you need to add certain permissions for the bot. You can find "Permission management" under "Development configuration" on the left. In Permission management, select "Batch import/export permissions," check the box, and enable permissions in bulk.
The permissions that need to be enabled are as follows:
Users can directly copy the code below and then paste it in the permission import section:
If the agent is a group chat agent:
Please add "im:chat:read" and "im:message.group_at_msg:readonly" in "tenant". Do not add im:message.group_msg, otherwise it will respond to all messages in the group.
To use the download data to Lark feature:
Please add "drive:drive.metadata:readonly" and "drive:drive" in "user".
After configuring the permissions, publish the Lark bot**.** Once you have filled in the required permissions for the bot, you can publish the bot by creating a version and publishing it on the "Version management and publishing" page. The version number, description, and other information, and the reason for application can be filled in as needed.
warning
Before proceeding to the next step, you must first publish the enterprise application; otherwise, you cannot continue to the next step.
Step 2: Create a new agent and associate it with the bot #
Configure the request address for the bot**.** Return to the Lark bot page created in the previous step, and paste the copied callback address into the request address fields of "Event configuration" and "Callback configuration" on the Lark bot's "Events and callbacks" page.
warning
Both event configuration and callback configuration need to be added.
Configure events for the bot. After filling in the address, you also need to add events for both the event and callback configurations.
The event configuration requires adding: im.message.receive_v1, p2p_chat_create
The callback configuration requires adding: card.action.trigger_v1
Publish the bot. After completing the previous steps, you can publish the bot by creating a version and publishing it on the "Version management and publishing" page. The version number, description, and other information can be filled in as needed.
warning
Before proceeding to the next step, you must first publish the enterprise application; otherwise, you cannot continue to the next step.
Obtain the App ID and App Secret of the Lark bot. After publishing the Lark bot, return to the bot's configuration page and copy the App ID and App Secret separately from the "Credentials and basic information" page.
(Optional) Configure encryption policy.
When the agent is used for external scenarios or special cases where request content needs to be encrypted, you can choose to configure an encryption policy for the agent; if the agent is only for internal company users, configuration is generally not required.
The available members of the agent are the available members of the bound robot. Therefore, you need the Lark Open Platform.
Add members. Edit the available members of the robot. After searching for users, simply check the box to select them. Do not select "All members".
Save and publish. After adding, save and publish. Note that it will only take effect after publishing.
warning
In addition to being added as available members, users of the agent must also have at least view permission for the dataset currently bound to the agent in order to use the agent properly.
Enable the Lark endpoint. Go to the configuration page of the previously created agent, find "Lark endpoint configuration" under "Basic information", and select "Enable Lark endpoint".
Add the agent. Enter the App ID and App Secret of the Lark robot in the basic settings for Lark. Click "Save" in the upper right corner. The agent will then be associated with the Lark robot. See Step 2: Create a new agent and associate it with the bot for how to obtain.