# Official and third-party plugins

> While large language models have powerful natural language processing capabilities, they may need additional features for specific tasks, such as performing web searches or processing images. Model Studio provides a range of official and third-party plugins. You can select plugins to enhance the model's capabilities and expand its use cases.

## First-time access to the plugins page <span id="521f5f92e6tfs" />

If your Alibaba Cloud account or RAM user (sub-account) does not have the AliyunServiceRoleForSFMAccessCloudAPI role, you cannot access plugins. Follow these instructions to grant the required permissions.

<Tabs>
  <Tab title="Alibaba Cloud account">
    If you log in to Model Studio with an Alibaba Cloud account, go to the [<strong>Plugins</strong>](https://modelstudio.console.alibabacloud.com/#/plugin-market) page, select the checkbox to agree to the terms, and click <strong>Authorize and Enter</strong>.

    The authorization page creates the service-linked role `AliyunServiceRoleForSFMAccessCloudAPI`, which is associated with the `AliyunServiceRolePolicyForSFMAccessCloudAPI` policy. This role authorizes Model Studio to access your Alibaba Cloud Marketplace products and make API calls based on the plugin configuration.
  </Tab>

  <Tab title="RAM user (sub-account)">
    If you log in to Model Studio with a RAM user (sub-account), go to the [<strong>Plugins</strong>](https://modelstudio.console.alibabacloud.com/#/plugin-market) page, select the checkbox to agree to the terms, and click <strong>Authorize and Enter</strong>. The following prompt appears:

    A dialog box for the <strong>Cloud Marketplace service-linked role</strong> appears, displaying error code 140052 and the service-linked role name `AliyunServiceRoleForSFMAccessCloudAPI`.

    This error occurs because the RAM user does not have permission to create a service-linked role. Follow the steps below to grant this permission to the RAM user. After you grant this permission, the RAM user can access the <strong>Plug-in</strong> page.

    1. Grant the RAM user the permission to create a service-linked role.

       1. Log in to the [RAM console](https://ram.console.alibabacloud.com/) with your Alibaba Cloud account.
       2. In the left-side navigation pane, choose <strong>Permissions>Policy</strong>.
       3. Click <strong>Create Policy</strong>.
       4. On the <strong>Script Editor</strong> tab, enter the following content in the `Effect`, `Action`, `Resource`, and `Condition` fields.

    ```plaintext
    {
        "Action": [
            "ram:CreateServiceLinkedRole"
        ],
        "Resource": "*",
        "Effect": "Allow",
        "Condition": {
            "StringEquals": {
                "ram:ServiceName": "cloundapi-access.sfm.aliyuncs.com"
            }
        }
    }
    ```

    5. Click <strong>OK</strong>.
    6. Set a name for the policy and click <strong>OK</strong>.

       For example, enter the name `service-linked role`.
    7. In the left-side navigation pane, choose <strong>Identities > Users</strong>.
    8. Find the RAM user to authorize and, in the <strong>Actions</strong> column, click <strong>Add Permission</strong>.
    9. Select the policy that you created and click <strong>OK</strong>.

       The RAM user can now create service-linked roles.

       From the policy type drop-down list, select <strong>Custom Policy</strong> to filter the list. Then, find and select your target policy.
    10. Return to the [<strong>Plugins</strong>](https://modelstudio.console.alibabacloud.com/#/plugin-market) page, select the checkbox to agree to the terms, and click <strong>Authorize and Enter</strong>.
  </Tab>
</Tabs>

## Official plugins <span id="00edef12dc50q" />

The <strong>Component Market</strong> provides pre-built official plugins from Model Studio. You can call them directly without configuring their input and output parameters.

<table style={{ display: "table", tableLayout: "fixed", width: "100%" }}>
  <colgroup>
    <col style={{ width: "22.18%" }} />

    <col style={{ width: "18.35%" }} />

    <col style={{ width: "44.65%" }} />

    <col style={{ width: "14.82%" }} />
  </colgroup>

  <thead>
    <tr>
      <th>
        <strong>Plugin name</strong>
      </th>

      <th>
        <strong>Tool ID</strong>
      </th>

      <th>
        <strong>Description</strong>
      </th>

      <th>
        <strong>Billing</strong>
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        [Python Code Interpreter](/help/en/model-studio/plugins)
      </td>

      <td>
        code\_interpreter
      </td>

      <td>
        Enables the model to run Python code for tasks like mathematical calculations, data analysis, visualization, and data processing.
      </td>

      <td>
        Free
      </td>
    </tr>

    <tr>
      <td>
        [Calculator](/help/en/model-studio/plugins)
      </td>

      <td>
        calculator
      </td>

      <td>
        Lets the model perform complex mathematical calculations, such as "12313 \* 13232".
      </td>

      <td>
        Free
      </td>
    </tr>

    <tr>
      <td>
        [Image Generation](/help/en/model-studio/plugins)
      </td>

      <td>
        text\_to\_image
      </td>

      <td>
        Lets the model generate images from text, such as "Draw a smiling dog."
      </td>

      <td>
        Free for a limited time. Activation is required.
      </td>
    </tr>

    <tr>
      <td>
        [Quark Search](/help/en/model-studio/plugins)
      </td>

      <td>
        quark\_search
      </td>

      <td>
        Lets the model search online for real-time information and public knowledge, such as "What's the weather in Hangzhou today?"

        > The Quark Search plugin currently retrieves webpage titles, keywords, and summaries, but does not support accessing full webpage content.
      </td>

      <td>
        Free for a limited time. Activation is required.
      </td>
    </tr>

    <tr>
      <td>
        [Generate QR Code](/help/en/model-studio/plugins)
      </td>

      <td>
        generate\_qrcode
      </td>

      <td>
        Lets the model generate a QR code from a website URL, such as "Generate a QR code for the Model Studio introduction document: <a href="https://www.alibabacloud.com/help/model-studio/getting-started/what-is-model-studio">[https://www.alibabacloud.com/help/model-studio/getting-started/what-is-model-studio](https://www.alibabacloud.com/help/model-studio/getting-started/what-is-model-studio)</a>".
      </td>

      <td>
        Free
      </td>
    </tr>

    <tr>
      <td>
        [GitHub Search](/help/en/model-studio/plugins)
      </td>

      <td>
        github\_search
      </td>

      <td>
        Lets the model search for projects on GitHub, for example, "GitHub Search: Qianwen".
      </td>

      <td>
        Free
      </td>
    </tr>
  </tbody>
</table>

<Accordion title="Python Code Interpreter">
  <table style={{ display: "table", tableLayout: "fixed", width: "100%" }}>
    <colgroup>
      <col style={{ width: "33.37%" }} />

      <col style={{ width: "33.37%" }} />

      <col style={{ width: "33.26%" }} />
    </colgroup>

    <thead>
      <tr>
        <th>
          <strong>Sample input</strong>
        </th>

        <th>
          <strong>Output without plugin</strong>
        </th>

        <th>
          <strong>Output with plugin</strong>
        </th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td rowSpan={2}>
          ```python
          import matplotlib.pyplot as plt
          import numpy as np

          x = np.linspace(-2, 2, 100)
          y1 = np.sqrt(1 + x**2)
          y2 = -np.sqrt(1 + x**2)

          plt.plot(x, y1, label='y = sqrt(1 + x^2)')
          plt.plot(x, y2, label='y = -sqrt(1 + x^2)')
          plt.xlabel('x')
          plt.ylabel('y')
          plt.title('Hyperbola')
          plt.legend()
          plt.show()
          ```
        </td>

        <td>
          The agent application cannot execute Python code; it can only provide a text description of the code.
        </td>

        <td>
          The agent application can execute Python code for data visualization and analysis.
        </td>
      </tr>

      <tr>
        <td>
          <Image src="https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/6861762371/p834102.jpeg" alt="python不插.jpeg" className="inline" noZoom height={400} />
        </td>

        <td>
          <Image src="https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/2561762371/p834103.jpeg" alt="python插.jpeg" className="inline" noZoom height={400} />
        </td>
      </tr>
    </tbody>
  </table>

  > The Python Code Interpreter plugin does not support accessing external networks or uploading local files. The available dependencies are: json5\~=0.9.6, jupyter\_client\~=8.1.0, ipykernel\~=6.25.0, seaborn, sympy, pydantic\~=1.10.8, pillow\~=9.4.0, fastapi\~=0.101.1, dynaconf\~=3.2.1, oss2\~=2.18.1, matplotlib, starlette\~=0.27.0, uvicorn\~=0.23.2, requests\~=2.31.0, scipy, html2text, pandas, pdf2image, pdfminer-six, pypdf, python-pptx, and wordcloud.
</Accordion>

<Accordion title="Calculator">
  <table style={{ display: "table", tableLayout: "fixed", width: "100%" }}><colgroup><col style={{ width: "33.37%" }} /><col style={{ width: "33.37%" }} /><col style={{ width: "33.26%" }} /></colgroup><thead><tr><th><p><strong>Sample input</strong></p></th><th><p><strong>Output without plugin</strong></p></th><th><p><strong>Output with plugin</strong></p></th></tr></thead><tbody><tr><td><p>12313\*13232</p></td><td><p>The agent application cannot reliably solve complex math problems and may return incorrect results. The correct answer is 162,925,616.</p></td><td><p>The agent application has strong calculation capabilities and can generate accurate results.</p></td></tr></tbody></table>
</Accordion>

<Accordion title="Image Generation">
  <table style={{ display: "table", tableLayout: "fixed", width: "100%" }}><colgroup><col style={{ width: "33.37%" }} /><col style={{ width: "33.37%" }} /><col style={{ width: "33.26%" }} /></colgroup><thead><tr><th><p><strong>Sample input</strong></p></th><th><p><strong>Output without plugin</strong></p></th><th><p><strong>Output with plugin</strong></p></th></tr></thead><tbody><tr><td rowSpan={2}><p>Draw a smiling dog.</p></td><td><p>The agent application cannot draw images or graphics directly and can only describe the scene in text.</p></td><td><p>The agent application can draw images directly and can generate a picture of a dog based on the instructions.</p></td></tr><tr><td><p><Image src="https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/1722067371/p834097.jpeg" alt="图文.jpeg" className="inline" noZoom height={400} /></p></td><td><p><Image src="https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/6861762371/p834098.jpeg" alt="图文插.jpeg" className="inline" noZoom height={400} /></p></td></tr></tbody></table>
</Accordion>

<Accordion title="Quark Search">
  <table style={{ display: "table", tableLayout: "fixed", width: "100%" }}><colgroup><col style={{ width: "33.37%" }} /><col style={{ width: "33.37%" }} /><col style={{ width: "33.26%" }} /></colgroup><thead><tr><th><p><strong>Sample input</strong></p></th><th><p><strong>Output without plugin</strong></p></th><th><p><strong>Output with plugin</strong></p></th></tr></thead><tbody><tr><td><p>What is the weather in Hangzhou today?</p></td><td><p>The agent application cannot access real-time information, so it cannot answer questions about the current weather.</p></td><td><p>The agent application has web search capabilities to access real-time information and can answer questions about the current weather.</p> <p>In <strong>Output Parameters</strong>, you can view the webpages that the model referenced to generate its answer.</p></td></tr></tbody></table>
</Accordion>

<Accordion title="Generate QR Code">
  <table style={{ display: "table", tableLayout: "fixed", width: "100%" }}><colgroup><col style={{ width: "33.37%" }} /><col style={{ width: "33.37%" }} /><col style={{ width: "33.26%" }} /></colgroup><thead><tr><th><p><strong>Sample input</strong></p></th><th><p><strong>Output without plugin</strong></p></th><th><p><strong>Output with plugin</strong></p></th></tr></thead><tbody><tr><td><p>Generate a QR code for the Model Studio introduction document: [https://www.alibabacloud.com/help/zh/model-studio/getting-started/what-is-model-studio](https://www.alibabacloud.com/help/zh/model-studio/getting-started/what-is-model-studio)</p></td><td><p>The agent application cannot generate QR codes directly. Instead, it provides instructions on how to convert a link into a QR code.</p></td><td><p>The agent application can generate a QR code based on the URL of the Model Studio introduction document.</p></td></tr></tbody></table>
</Accordion>

<Accordion title="GitHub Search">
  <table style={{ display: "table", tableLayout: "fixed", width: "100%" }}>
    <colgroup>
      <col style={{ width: "33.37%" }} />

      <col style={{ width: "33.37%" }} />

      <col style={{ width: "33.26%" }} />
    </colgroup>

    <thead>
      <tr>
        <th>
          <strong>Sample input</strong>
        </th>

        <th>
          <strong>Output without plugin</strong>
        </th>

        <th>
          <strong>Output with plugin</strong>
        </th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          GitHub Search: Tongyi Qianwen
        </td>

        <td>
          The agent application cannot query GitHub directly. Instead, it provides instructions on how to search on GitHub.
        </td>

        <td>
          The agent application can query GitHub projects and provide a list of projects related to Qianwen.

          > The GitHub Search plugin currently retrieves project titles, links, and summaries. It does not support accessing project details.
        </td>
      </tr>
    </tbody>
  </table>
</Accordion>

<Accordion title="Combine plugins">
  Model Studio allows you to call multiple tools in a single task, as shown in the following example. You can select plugins to suit your needs.

  <table style={{ display: "table", tableLayout: "fixed", width: "100%" }}><colgroup><col style={{ width: "33.37%" }} /><col style={{ width: "33.37%" }} /><col style={{ width: "33.26%" }} /></colgroup><thead><tr><th><p><strong>Plugins</strong></p></th><th><p><strong>Sample input</strong></p></th><th><p><strong>Application output</strong></p></th></tr></thead><tbody><tr><td style={{ verticalAlign: "top" }}><p><strong>Quark Search</strong> + <strong>Image Generation</strong> + <strong>Generate QR Code</strong></p></td><td style={{ verticalAlign: "top" }}><p>Draw a picture based on today's weather in Hangzhou and generate a QR code for the image URL.</p></td><td style={{ verticalAlign: "top" }}><p><Image src="https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/6101857771/p836940.png" alt="三插件.png" className="inline" noZoom width={300} /></p> <p>Scan the QR code to download the image:</p> <p><Image src="https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/6101857771/p836944.png" alt="35efefdb-753e-4594-a96d-b33d0aa1bee3-1.png" className="inline" noZoom width={300} /></p></td></tr></tbody></table>
</Accordion>

### Call official plugins <span id="045b5789e2cw4" />

<strong>Step 1. Authorize the workspace (if required).</strong> You must authorize an official plugin before you can use it in a sub-workspace. This step is not required for the default workspace.

1. Go to the [<strong>Plugins</strong>](https://modelstudio.console.alibabacloud.com/#/plugin-market) page, find the target plugin, and click <strong>View Details</strong>.
2. Click <strong>Authorization</strong>, select the sub-workspace to authorize, and click <strong>OK</strong> to complete the authorization.

<strong>Step 2.</strong>[Call a plugin](/help/en/model-studio/plugins#55bb7f428fczt)<strong>.</strong>

## Third-party plugins <span id="02c6291938c81" />

Third-party plugins cover multiple domains, such as business services, image and video, and education. They are quality-tested and can be called directly after activation without further configuration.

### Call third-party plugins <span id="ba83f8998ahkf" />

<strong>Step 1. Activate the third-party plugin.</strong>

1. Go to the [<strong>Plugins</strong>](https://modelstudio.console.alibabacloud.com/#/plugin-market) page, find the target plugin, and click <strong>View Details</strong>.
2. Select a package, click <strong>Free Trial</strong> or <strong>Buy Now</strong>, and follow the on-screen instructions to activate the plugin.

   After successful activation, the plugin details card displays an <strong>Activated</strong> status tag.

<strong>Step 2.</strong>[Call a plugin](/help/en/model-studio/plugins#55bb7f428fczt)<strong>.</strong>

## Call a plugin <span id="55bb7f428fczt" />

- <strong>Method 1</strong>: From the <strong>Plug-in</strong> page, add a tool to an agent application.

  > An official plugin can only be added to an <strong>Agent Application</strong> in the <strong>same workspace</strong>.

  1. Find the target plugin and click <strong>Add to Agent</strong>.
  2. Select the tool and click <strong>Next</strong>.
  3. Select an agent application and click <strong>Confirm Add</strong>.
  4. On the application details page, the tool now appears automatically.

     > You can also click <strong>Select Plug-in</strong> to add more tools. You can add up to 10 tools. The agent application selects and calls one or more tools based on the input.
  5. Test the tool by interacting with the model in the input box.
  6. After testing, publish the application.
- <strong>Method 2</strong>: Go to the [<strong>Apps</strong>](https://modelstudio.console.alibabacloud.com/#/app-center) page. In a specific agent or workflow application, add the plugin, test its functionality, and then <strong>Publish</strong> the application. For more information, see [Agent application plugin capabilities](/help/en/model-studio/single-agent-application#d1da8df94a98c) and [Workflow application plugin node](/help/en/model-studio/workflow-application).
- <strong>Method 3</strong>: Call tools by using the Assistant API. In the [Assistant API documentation](/help/en/model-studio/quick-start-of-assistant-api), search for the `tools` keyword to see how to call tools by using the API.

## Get the tool ID <span id="8d39e710057ka" />

A tool ID identifies a specific tool. You must provide the correct tool ID when calling a tool by using an API.

1. On the <strong>Plug-in</strong> page, find the target plugin and click <strong>View Details</strong>.
2. Under <strong>Plug-in Tool</strong>, get the tool ID.

   In this example, the tool ID is `calculator`.

## Related documentation <span id="ac8ec37244rb2" />

In addition to official and third-party plugins, Model Studio supports custom plugins. For more information, see [Custom plugins](/help/en/model-studio/custom-plug-ins).

## FAQ <span id="03f8232c62z4w" />

<strong>What is the difference between Quark Search and web search (enable\_search)?</strong>

- When the Quark Search plugin is enabled, the model directly calls the plugin to perform a search and returns the results as text, which can be directly used to generate the final output. The Quark Search plugin currently retrieves webpage titles, keywords, and summaries, but does not support accessing full webpage content.
- The web search (enable\_search) feature is also based on Quark Search. When web search is enabled, the model uses information from the internet to enrich its response, but it does not simply return raw search results.