When Alibaba Cloud Bailian's official plugins cannot meet your business needs, you can extend large language model capabilities by creating custom plugins. This document guides you through the entire process—from creation and debugging to usage—enabling seamless integration of required APIs.
Workflow
- Create or Import a Plugin: Define basic plugin information, or import directly from Alibaba Cloud Marketplace.
- Add Tools (not required for imported plugins): Configure specific API endpoints, request parameters, and response data for the plugin.
- Debug and Publish: Test API connectivity online; publish only after confirming full functionality.
- Use in Applications: Associate the plugin with an agent and invoke it via chat testing or API integration.
Creating a Custom Plugin
Step 1: Create a Plugin
1
Access the Plugin Page
Navigate to the Plugins page and click Create Plugin.
2
Fill in Plugin Information
-
Plugin Name: Enter a semantically meaningful name (supports Chinese and English).
Example: Dormitory Rules Lookup Tool test
-
Plugin Description: A brief natural-language description of the plugin’s functionality and use cases. This helps the LLM determine whether to invoke the plugin for a given task.
Example: Retrieves dormitory rules content based on an input numeric index.
-
Plugin URL: The endpoint URL for accessing the plugin. Different paths under the same domain are treated as separate APIs (i.e., tool paths).
Example:
https://domitorgreement-plugin-example-icohrkdjxy.cn-beijing.fcapp.run
| Parameter | Description |
|---|---|
| Header List (optional) | When authentication is needed, custom headers may be used to pass authentication credentials. |
| Authentication Required (optional) | Determines whether Alibaba Cloud Bailian applications must authenticate when calling your custom plugin. Whether authentication is required depends on your API provider’s security policy. |
| Authentication Type | Supports two modes: Service-level Authentication and User-level Authentication. Location supports Header or Query; Type supports basic, bearer, and appcode. |
3
Confirm Creation
After completing the form, click Confirm Creation & Create Tool, or click Continue Adding Tools.
Step 2: Create a Tool
1
Fill in Tool Information and Configure Parameters
Tool Information:
Configure Input Parameters:Click Add Input Parameter, then configure each parameter:
| Parameter | Description |
|---|---|
| Tool Name | Enter a semantically meaningful name (supports Chinese and English). |
| Tool Description | A concise, accurate natural-language description of the tool’s function and use case—helps the LLM decide whether to invoke this tool. |
| Tool Path | Relative path to the plugin URL; must begin with a forward slash (/). |
| HTTP Method | Select GET or POST, depending on your API requirements. |
| Content-Type | Choose application/json or application/x-www-form-urlencoded. |
- Parameter Name: Use descriptive names to help the LLM understand what value should be extracted (e.g.,
city). - Parameter Description: Briefly and precisely describe the purpose and format of the parameter (e.g.,
date, described as “date inyyyy-MM-ddformat”). - Type: Specifies the data type of the parameter.
- Pass-through Mode:
- LLM Extraction: Indicates that the LLM must extract this parameter’s value from user input.
- Business Pass-through: Indicates that the value is passed directly from external systems without modification.
2
Save Draft
After configuration, click Save Draft.
3
Online Debugging
Click Test Tool, enter authentication details (if enabled) and sample input values, then click Run.
If the test fails, adjust configurations based on error messages in the result, then retest until successful.
4
Publish the Tool
Once testing passes, click Publish. Only published tools can be invoked within applications.
Importing Plugins from Alibaba Cloud Marketplace
Alibaba Cloud Marketplace provides numerous ready-to-use APIs. You can activate required APIs there and import them into your Alibaba Cloud Bailian plugin list.
1
Navigate to Import Page
Go to the Plugins page and click Import from Marketplace. First-time imports require service-linked role authorization.
2
Activate Marketplace API
In the Import Marketplace Plugin dialog, click View Details to navigate to Alibaba Cloud Marketplace and activate the desired API. Wait until its status shows Activated.
3
Import Plugin
After activation, return to the Alibaba Cloud Bailian console, click Import from Marketplace, select the activated API, and click OK.
4
Test and Publish
Plugins imported from Marketplace start as drafts—you must test and publish before using them:
- Click Debug in the corresponding tool row to open the tool test page.
- Enter parameters and click Run.
- After successful execution, return to the tool editing page and click Publish.
When importing from Marketplace, the system auto-fills input/output parameters—but some fields may be missing. During publishing, review any error messages and resolve issues per guidance.
Using Plugins
Managing Custom Plugins and Tools
Deleting a Plugin
In the Plugin List, locate the target plugin and click ... > Delete.
Editing a Plugin
- In the Plugin List, locate the target plugin and click View Details.
- Click Edit Plugin in the top-right corner, update plugin information, and save.
Editing a Tool
After modifying tool information, you must retest and republish for changes to take effect.
- In the Plugin List, locate the plugin containing the target tool and click View Details.
- Click Edit in the tool’s row, update tool information, and click Save Draft.
- Click Test Tool to debug online.
- After successful execution, click Publish.
Deleting a Tool
- In the Plugin List, locate the plugin containing the target tool and click View Details.
- Click Delete in the tool’s row.
Error Codes
Common errors during tool publishing are listed below:
| Error Code | Error Message | Description |
|---|---|---|
| 130040 | Missing description for parameter xx | Cause: Description is missing for parameter xx. Solution: Add the parameter description and republish the tool. |
| 130022 | Failed to save tool information / Please verify example parameters | Possible Cause 1: An Object-type input or output parameter has empty sub-properties. Solution: Click the icon at the end of the object row to add required sub-properties. Possible Cause 2: HTTP method is set to GET, but an Object-type parameter is configured in inputs. Solution: GET requests do not support Object-type input parameters—use another type instead. |