API plug-in configuration
This topic describes how to configure API plug-ins that use Function Compute for an intelligent outbound bot that uses large models.
Prerequisites
Before calling APIs with large models, you must activate Function Compute and create a service. To use proprietary APIs, you must also invoke them from within Function Compute.
When you create the function service, select the event function type.
Access the feature
Go to your intelligent outbound bot instance, select Large Model Scenario Management, navigate to global configuration, and then click API plug-in.
Features
Create API plug-in
On the API plug-in page, click Create API plug-in in the upper-left corner and configure the plug-in.
The following parameters are available when you create an API plug-in:
Service Name: A custom name for the plug-in. The name can be up to 50 characters long.
Service Description: A description of what the API plug-in does. A clear description helps the large model understand when to use the plug-in.
Prompt for long API calls: A pre-set message for long API calls. The system plays this message to the user while waiting for the API response to reduce perceived wait time.
API Configuration: You can call the API by using Function Compute or an HTTP service.
Function Compute:
Go to Function Compute, find the function service to use with large models, and enter its parameters.
Function Compute
Region: Select the region of the Function Compute service.
Function Name: Enter the function name in Function Compute.
Backup Region: Select the backup region.
HTTP service: You must specify the request method and the endpoint URL.
Input Parameters: Specify the input parameters required to call the API plug-in. These parameters can be populated from predefined variables or generated from the conversation with the large model.
If an input parameter's value source is a variable, the field value must match a configured variable name. Otherwise, an error occurs.
NoteThe parameters and data types you define here must match those in your Function Compute function or your HTTP service request.
Output Parameters: The API result is returned directly and used as a prompt for the large model.
Signature Authentication: When you select the HTTP service option, you can use signature authentication to secure your service. For instructions, see Signature Calculation Guide.
After you complete the configuration, click Confirm.
Publish API plug-in
After you create or edit an API plug-in, its status is draft or "edited", and you cannot use it. To use the latest version, click Publish. You can then call the published plug-in in a prompt.
Edit API plug-in
To modify an existing plug-in, click Edit in the Actions column.
If the plug-in has a
draftstatus, you can edit it directly.For a published plug-in, clicking Edit displays both the
draftand thepublished version. After you modify thedraft, click Confirm and then click Publish to overwrite thepublished versionwith your changes. If you want to discard the changes in thedraft, click Reset to Published Version. This action reverts thedraftto match thepublished version. You can then publish this version.
Debug API plug-in
After you create or edit an API plug-in, you can click Debug. Configure mock parameter values to test the plug-in and view the output.
Delete API plug-in
If you no longer need an API plug-in, click Delete.
After you create and publish the plug-in, you can add it to your bot configuration. For more information, see Large Model Outbound Scenario List.