Model Studio provides a variety of official plug-ins, including Image Generation, Calculator, and Python Code Interpreter, to enhance the features and broaden the application scenarios of large language models (LLMs).
First visit to Plug-ins page
To visit the Plug-ins page, the Alibaba Cloud account or RAM user must have the AliyunServiceRoleForSFMAccessCloudAPI role permission. You can follow the steps below to authorize.
Alibaba Cloud account
If you log on to Model Studio with the Alibaba Cloud account, review the agreement on the Plug-ins page and click Authorize and Enter.
RAM user
If you log on to Model Studio as a RAM user, review the agreement on the Plug-ins page and click Authorize and Enter. At this time, you may see an error message that says The user is not granted the permissions to create a service-linked role
.
You must first follow the steps below to grant the RAM user the permission to create a service-linked role. Once authorized, the RAM user will be able to access Plug-ins page.
Grant the permission to create a service-linked role.
Log on to the RAM console with the Alibaba Cloud account.
In the left-side navigation pane, click Permissions > Policies.
Click Create Policy.
On the JSON tab, enter the following content into
Effect
,Action
,Resource
, andCondition
.{ "Action": [ "ram:CreateServiceLinkedRole" ], "Resource": "*", "Effect": "Allow", "Condition": { "StringEquals": { "ram:ServiceName": "cloundapi-access.sfm.aliyuncs.com" } } }
Click OK.
Name the policy and click OK.
In the left-side navigation pane, click
.Find the RAM user and click Add Permissions in the Actions column.
Select the newly created policy from the list and click Grant permissions.
The RAM user is now authorized to create a service-linked role.
Go back to the Plug-ins page, review the agreement, and click Authorize and Enter.
Official plug-ins
Plug-ins page offers pre-installed official plug-ins from Model Studio. You can use them directly without configuring input and output parameters.
Name | Tool ID | Description | Billing |
code_interpreter | Allows the LLM to execute Python code snippets, such as mathematical calculations, data analysis and visualization, and data processing. | Free | |
calculator | Allows the LLM to perform complex mathematical calculations, such as “12313×13232”. | Free | |
text_to_image | Allows the LLM to generate images based on text, such as “please draw a smiling puppy”. | Free for a limited period. You must apply for the plug-in first. |
Python Code Interpreter
Calculator
Image Generation
Combined use of plug-ins
Use official plug-ins
Step 1: To use official plug-ins in a sub-workspace, you must first authorize the sub-workspace. This step is not required if you use the default workspace.
Go to Plug-ins, find the desired plug-in and click View Details.
Click Authorization, select the sub-workspace to be authorized, and click OK.
Step 2: Call the plug-in.
Call the plug-in
Method 1: On the Plug-ins page, add a tool to your agent application.
Official plug-ins can only be added to agent applications in the same workspace.
Find the desired plug-in and click Add to Agent.
Select a tool and click Next.
Select the agent application and click Confirm Add.
On the application configuration page, you can find the tool added automatically.
You can click + Plug-in to add up to 10 tools. The agent application will select and call one or more appropriate tools based on the user input.
Test the plug-in to ensure it meets your requirements.
After testing, publish the application.
Method 2: In My Applications, add the tool to an agent or workflow application, test the plug-in, and publish the application. For more information, see Plug-ins: More efficiency tools and Workflow application.
Obtain tool ID
The tool ID uniquely identifies a specific tool. When calling the tool through the API, you must accurately pass the tool ID.
On the Plug-ins page, find the desired plug-in and click View Details.
View the tool ID.
Reference
Apart from official plug-ins, Model Studio also supports custom plug-ins. For more information, see Custom plug-in.