Skip to main content

Skill Plugin Development

Overview

In SERVICEME, skill plugins refer to optional capabilities for Agents. In addition to the built-in plugins, you can also extend skill plugins through development, granting Agents more abilities.

Skill Plugin

System Built-in Skill Plugins

IDPluginPlugin TypePurpose
SearchKnowledgebaseSearch Knowledge BaseAPI PluginProvides retrieval of private domain knowledge
ImageGenerationImage GenerationAPI PluginGenerates images based on text descriptions
BrowsingWeb BrowsingAPI PluginProvides web browsing to search for real-time information
ChartsChartsAPI PluginGenerates corresponding charts based on provided data, supports bar, line, and pie charts
DocumentReaderDocument ReaderAPI PluginProvides document summary information for a single or selected document
QuestionContactQuestion ContactAPI PluginReturns the contact person for the corresponding field based on the question's domain

Type Description

TypeDescription
API PluginThe skill plugin is presented as a backend API. The Agent is responsible for filling in the API input parameters based on context and parsing the API response.

API Skill Plugin

Supported Authentication Methods

Currently, only fixed Header authentication or interfaces that do not require authentication are supported.

TypeDescription
Fixed HeaderInterface authentication is performed by specifying a fixed key in the request header, similar to the OpenAI api_key method.

Plugin Development

To facilitate understanding of this process, let's use an API plugin that queries the time zone by time zone code as an example.

Step 1: First, provide an API that can return time zone information based on the time zone code.

API Example

using Microsoft.AspNetCore.Mvc;
using System;

namespace WorldTimeApi.Controllers
{
[ApiController]
[Route("api/[controller]")]
public class TimeController : ControllerBase
{
[HttpGet("current/zone")]
public IActionResult GetTimeByZone([FromQuery] string timeZone)
{
if (string.IsNullOrEmpty(timeZone))
{
return BadRequest("Missing required parameter: timeZone");
}

try
{
// 查找时区信息
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(timeZone);

// 获取指定时区的当前时间
var currentTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, timeZoneInfo);

// 返回结果
return Ok(new
{
TimeZone = timeZone,
CurrentTime = currentTime.ToString("yyyy-MM-ddTHH:mm:ss")
});
}
catch (TimeZoneNotFoundException)
{
return NotFound("Time zone not found");
}
catch (InvalidTimeZoneException)
{
return BadRequest("Invalid time zone");
}
catch (Exception ex)
{
return StatusCode(500, $"Internal server error: {ex.Message}");
}
}
}
}

Step 2: Register this plugin in the system

Add the skill plugin and fill in the following information

Register Plugin

Field Description

  • Code: The code of the plugin, a unique identifier for the plugin in the system. Try to use a meaningful description.
  • Name: The display name of the plugin. The Agent will display the plugin name it uses during reasoning and execution. Pay attention to the completeness of multilingual support.
  • Description: The description of the plugin, used to explain the function of the plugin. It will be displayed on the interface for adding skill plugins to the Agent.
  • Request Header: Used to input necessary Header parameters for calling the plugin, such as API_KEY.
  • [Important] OpenAPI / Swagger Schema (JSON): The description of the API body. The information here determines whether the Agent can properly understand when to call this skill and how to fill in each parameter.

OpenAPI Schema (JSON) Example

Get time zone
{
"Openapi": "3.0.0",
"Info": {
"Title": "World Time",
"Description": "Getting world time",
"Version": "v1.0.0"
},
"Servers": [
{
"Url": "https://www.timeapi.io"
}
],
"Paths": {
"/api/Time/current/zone": {
"Get": {
"OperationId": "zone",
"Description": "Get world time by timezone name",
"Deprecated": false,
"Parameters": [
{
"Name": "timeZone",
"In": "query",
"Required": true,
"Description": "Full IANA time zone names.",
"Schema": {
"Type": "string"
}
}
]
}
}
}
}

Note

  • Info/Title: The plugin title filled in here helps the Agent understand the function of this plugin.
  • Paths/[api path]/Get/OperationId: You can use backticks `%OperationId%` in the Agent Prompt to specify the API to be called in a particular scenario. See the example in Step 4 below.
  • Paths/[api path]/Get/Description: Helps the Agent understand and affects when the Agent will call a specific API.
  • Paths/[api path]/Get/Parameters: Make sure it is consistent with the actual API. For example, if it is query here, the API should get parameters from the query. If it is another type (such as JSON body), the API should also be consistent. The parameter name description helps improve the success rate of filling.
  • Servers/Url: This is the API's BaseURL. It must be filled in correctly for successful calls.
  • [Optional] After the plugin configuration is complete, you can debug it using the DEBUG function.

Step 3: Add the skill plugin to the Agent

In the Agent settings interface, add the plugin through the [Skill Plugin] tab.

Add Skill

After saving the settings, test it by chatting with the expert.

Use Skill

Step 4: [Optional] In the Agent's Prompt, add necessary instructions to guide the Agent to better execute this skill.

Example

Guide the browser plugin to search on specific sites
### Skill 3: Web Searching
- You can access web site by `Browsering` toolkit and looking for HR infomation from following sites: (site:*.linkedin.com; site:*.zhipin.com)
- Using result to fulfill users request and list up reference link at end of your response.

Note: In most cases, the Agent will automatically determine when to execute and how to fill parameters based on the information in the OpenAPI Schema.