This guide explains how to use the custom parameter passing feature when invoking Agent Applications and Workflow Applications in Alibaba Cloud Bailian, primarily for passing parameters to custom plugins and custom nodes.
Passing Parameters to Custom Plugins
This article demonstrates how the API invokes the custom parameter passing feature of an application using the Dormitory Agreement Content Query Tool as an example.
Custom plugin parameters are passed either through an associated Agent Application, or through a Plugin Node within a Workflow Application.
How to Use
Step 1: Create a Custom Plugin Tool
Skip this step if you have already created or imported a plugin.
1
Create a Custom Plugin
Navigate to the Plugins page in the Bailian console, click Add Custom Plugin, fill in the plugin information. If authentication is required, enable the Enable Authentication toggle and provide the corresponding authentication configuration.
Example plugin description: Dormitory Agreement Query Tool — retrieves a specific clause based on the provided numeric index.
Example plugin URL: https://domitorgreement-plugin-example-icohrkdjxy.cn-beijing.fcapp.run
Example authentication configuration: Select User-level Authentication, set Location to Header, and Type to Basic.Note: The Plugin Description is a brief natural-language explanation of the plugin’s purpose, helping the large language model determine whether to invoke it for a given task.2
Create a Tool
Fill in tool information and configure input and output parameters. Note the following:
- The Tool Description helps the large language model better understand the tool’s functionality and usage scenarios. Use natural language and include usage examples where possible.
- Choose meaningful parameter names, which help the model identify what information needs to be extracted.
- The Parameter Description should concisely and accurately describe the function of each input parameter, aiding the model in understanding how to extract values.
- For input parameters, the Parameter Transmission Method must be set to Business Pass-through.
article_index is configured as a business pass-through parameter.Set the tool name to Dormitory Agreement Query Tool, select POST as the request method, and application/json as the content type. Configure the input parameter article_index as type Number, transmission method Body, and mark it as Required. For the output parameter, set the name to article, description to "Dormitory Agreement Content", and type to String.3
Test and Publish
Click Test Tool. Once testing passes, click Publish to deploy the plugin.
Step 2: Associate the Plugin with an Agent Application
A plugin tool can only be associated with an Agent Application residing in the same workspace.
- On the published plugin card, click Add to Agent, then select the target Agent Application.
- Alternatively, inside the Agent Application, click + Plugin, then select the desired custom plugin.
- Finally, click Publish to deploy the updated application.
Step 3: API Invocation
- Without Authentication: To invoke a custom plugin via API, pass plugin-specific parameters using the
user_defined_paramsfield underbiz_params. Replaceyour_plugin_codewith the actual plugin ID, and provide key-value pairs matching the plugin’s configured input parameters.
You can find the plugin ID on its plugin card.In this example, we pass
article_index = 2 to retrieve the second clause of the dormitory agreement and return the correct result.
- With Authentication Required: Add the
user_defined_tokensfield tobiz_paramsto pass authentication tokens. Replaceyour_plugin_codewith your actual plugin ID and provide the required authentication details.