Skip to main content

Skill Plugin Development

Overview

In SERVICEME, skill plugins refer to optional capabilities for Agents. Besides the built-in system plugins, skill plugins can be extended through development to empower Agents with more abilities.

Skill Plugin

Built-in System Skill Plugins

No.PluginPlugin TypePurpose
SearchKnowledgebaseSearch KnowledgebaseAPI PluginProvides private domain knowledge retrieval functionality
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, supporting bar charts, line charts, and pie charts
DocumentReaderDocument ReadingAPI PluginProvides document summary information for a single or selected document
QuestionContactQuestion ContactAPI PluginReturns the contact person for the domain related to the question

Type Description

TypeDescription
API PluginSkill plugin manifests as a backend API, where the Agent is responsible for filling the API input parameters based on context and parsing the API return values

API Skill Plugins

Supported Authentication Methods

Currently, only fixed Header authentication or no authentication is supported for interface calls.

TypeDescription
Fixed HeaderInterface authentication via a fixed key specified in the request header, similar to OpenAI api_key

Plugin Development

To facilitate understanding of this process, we take an API plugin that queries time zone information by time zone code as an example.

Step 1: Provide an API that returns 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 into the system

Add a skill plugin and fill in the following information

Register Plugin

Field Description

  • Code: The plugin code, a unique identifier for the plugin in the system, preferably a meaningful description.
  • Name: The display name of the plugin, which the Agent will show during thinking and execution. Pay attention to multilingual completeness.
  • Description: Description of the plugin, explaining its function, displayed in the Agent's skill plugin addition interface.
  • Request Header: Used to input necessary Header parameters for calling the plugin, such as API_KEY
  • 【Important】OpenAPI / Swagger Schema ( JSON ): Description of the API body. This information determines whether the Agent can properly understand when to call this skill and how each parameter should be filled.

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"
}
}
]
}
}
}
}

Notes

  • Info/Title: The plugin title here helps the Agent understand the plugin's function.
  • Paths/[api path]/Get/OperationId: Can be used in the Agent Prompt with backticks `%OperationId%` to specify API calls in particular scenarios, see the example in step four below.
  • Paths/[api path]/Get/Description: Helps the Agent understand when to call this specific API.
  • Paths/[api path]/Get/Parameters: Should be consistent with the actual API, e.g., if here is query, the API should get parameters from query. If it is another type (e.g., json body), the API should be consistent. Parameter descriptions help improve filling success.
  • Servers/Url: The API BaseURL, must be correctly filled to successfully call.
  • 【Optional】After plugin configuration, debugging can be done via the DEBUG feature.

Step 3: Add skill plugins to the Agent

In the Agent settings interface, add plugins via the [Skill Plugins] tab.

Add Skill

After saving the settings, test by conversing with the expert.

Use Skill

Step 4: 【Optional】Add necessary instructions in the Agent's Prompt 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 determine the execution timing and parameter filling based on the information in the OpenAPI Schema.