# Plugins

## 1. Manage plugins

### 1.1 **Plug-in positioning**

Enable robots to have real-time data query capabilities during conversations between users and robots.

### 1.2 Plugin creation order

Space Plugin Library "Create Plugin - > Robot" Plugin Management "Bind the Plugin.

<figure><img src="https://1886561579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXbXiJN0Eq6xgdmU34Ktv%2Fuploads%2FIW9Z8iB9aiW3LB0u5Md3%2Fimage.png?alt=media&#x26;token=6a1de337-bc47-42f5-98aa-1033245c153b" alt=""><figcaption></figcaption></figure>

### 1.3 Plugin parameter configuration

A plugin includes: basic information (avatar, name, introduction), method collection (calling method, endEntry, method description, request parameters).\
**Information required for configuring plugins:**

<figure><img src="https://1886561579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXbXiJN0Eq6xgdmU34Ktv%2Fuploads%2FcPCFWmyWNVBlguuJLyGN%2Fimage.png?alt=media&#x26;token=006ecbb5-103d-4d47-843b-c77d423c6efe" alt=""><figcaption></figcaption></figure>

* \
  Plugin name - the name of the plugin (does not affect plugin retrieval)Comment
* Introduction - Introduction to the plugin (does not affect plugin retrieval)Comment
* Plugin calling method - whether the system needs to call the plugin directly (default direct call)Comment
* Whether the user needs to confirm before executing the plugin - Whether the user needs to confirm the pop-up window twice before executing the plugin call (not required by default)Comment
* Language, Embedding Model - Select the language environment and embedding model of the plug-in application (choose according to the actual situation, and it can only be bound when it is consistent with the robot language)Comment
* Plugin methods - the required data interface (one plugin can configure one or more calling methods)

  * Method name - English name of data interface (provided by technicians, multiple letters are connected by \_)Comment
  * endEntry - Data interface call address (provided by technicians)Comment
  * Method Description - What is this data interface used for (affecting plugin retrieval, please fill in accurately)Comment
  * Input parameters - Data interface input parameters (provided by technicians)Comment
  * Reference question - possible user questions for this query (optional)Comment
  * Reply Example - When the parameter information provided by the user is incomplete, a reply example can be given to let the robot ask the user for the missing parameters. (optional)

  ⚠️ Note: Custom plugins require technical intervention to define information such as "method name", "endEntry", "method description", "input parameters", etc.Non-technical personnel can test the execution effect of plug-ins in different business scenarios, languages, etc. before plug-in development. It is necessary to involve the tuning of "method description", "reference question", and "reply example".

> **💡Example: Weather forecast plugin**
>
> * Plugin name: Weather Forecast
> * Introduction: This is a weather query plug
> * Plugin calling method: After the call is successful, return the plugin identifier and execute the plugin call
> * Whether user confirmation is required before executing the plugin: Directly execute without user confirmation
> * Language, embedding model: Chinese, execute directly without user confirmation.
> * Plugin method
>   * Method name: query-weather
>   * endEntry：<http://cybertron-plugin/query-weather>
>   * Method description: This is used to query weather forecast information
>   * Input parameters:
>     * Address (address information, string, required)
>     * Day (date information, string, required)
>   * Reference question:
>     * Check today's weather.
>     * Please help me check the weather for tomorrow.
>     * How is the weather in Beijing?
>   * Reply example:
>     * Example 1:
>   * &#x20; `User: What's the weather like in Beijing tomorrow?`  `Assistant: Performing weather query, please wait~ < function_call > {"name": "query-weather", "arguments": {"address": "Beijing", "day": "tomorrow"}} </function_call >`
>   * * Example 2:
>   * &#x20; `Can you help me check the weather?`  `Assistant: To help you check the weather, please provide the necessary parameter information, including "location" information and "date" information`  `User: Query Beijing`  `Assistant: Obtained address information (Beijing), please provide the remaining parameter information, including "date" information`  `User: Today`  `Assistant: Performing a weather query, please wait~ < function_call > {"name": "query-weather", "arguments": {"address": "Beijing", "day": "today"}} </function_call >`

### 1.4 Official plugin Q\&A effect

#### 1.4.1 International Weather

* Sample Queries：What's the weather like in Los Angeles/Beijing today?
* Q\&A Effectiveness:&#x20;

A tabular description of the Main weather, Temperature, Maximum/Minimum temperature, Wind level, and Date.

Summary of text generated at the bottom of the dialog box.

<figure><img src="https://1886561579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXbXiJN0Eq6xgdmU34Ktv%2Fuploads%2Fq0dxo2VTBUuAXyRMI0m3%2Fimage.png?alt=media&#x26;token=556e0b91-659c-475c-9476-15479d21cb41" alt=""><figcaption></figcaption></figure>

#### 1.4.2 The real-time stock price

* Sample Queries：Check XX's (Company Name) stock price today.
* Q\&A Effectiveness:&#x20;

A tabular description of the Stock Symbol, Stock Name, Opening Price today, Closing Price yesterday, Highest Price today, Lowest Price today, Current Price, Bid Price, Ask Price, Trading Volume, Number of Shares Traded, 52-Week High, 52-Week Low, Date and Time.

Summary of text generated at the bottom of the dialog box.

<figure><img src="https://1886561579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXbXiJN0Eq6xgdmU34Ktv%2Fuploads%2FflNDZ56Iz1uQe2q7hzrm%2Fimage.png?alt=media&#x26;token=120b86e2-1ea1-4d68-8059-3d46c7442f68" alt=""><figcaption></figcaption></figure>

#### 1.4.3 Stock price trend

* Sample Queries：What is XX’s(Company Name) stock market trend?
* Q\&A Effectiveness: Visualizing stock price trends, summary of text generated at the bottom of the dialog box.

<figure><img src="https://1886561579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXbXiJN0Eq6xgdmU34Ktv%2Fuploads%2FitfIAyaXAFaWvuHYhEMg%2Fimage.png?alt=media&#x26;token=1cf98904-1327-40d7-ba06-a3b7ab487da0" alt=""><figcaption></figcaption></figure>
