Skip to main content

Skill Plugin Development

Overview

In SERVICEME, a skill plugin refers to an optional capability for the Copilot. Beyond the system's built-in plugins, skill plugins can be expanded through development, enabling the Copilot with more functions.

Skill Plugin

System Built-in Skill Plugins

IDPluginTypePurpose
SearchKnowledgebaseKnowledge Base SearchAPI PluginProvides retrieval capabilities for private knowledge
ImageGenerationImage GenerationAPI PluginGenerates images based on text descriptions
BrowsingWeb BrowsingAPI PluginEnables web browsing for real-time information search
ChartsChartsAPI PluginGenerates corresponding charts (bar, line, pie) based on provided data
DocumentReaderDocument ReaderAPI PluginProvides summary information for single or selected documents
QuestionContactQuestion ContactAPI PluginReturns the contact person for the relevant field based on the topic of the question

Type Description

TypeDescription
API PluginSkill plugins that function as backend APIs, where the Copilot fills API input parameters based on context and parses the API response

API Skill Plugin

Supported Authentication Methods

Currently, only fixed Header authentication or no-authentication API calls are supported.

TypeDescription
Fixed HeaderUses a fixed key in the request header for API authentication, similar to the OpenAI api_key format

Plugin Development

To illustrate this process, let's take an API plugin that retrieves time zone information based on a time zone code as an example.

Step 1: First, provide an API that returns time zone information based on a 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
{
// Retrieve time zone information
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(timeZone);

// Get current time in the specified time zone
var currentTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, timeZoneInfo);

// Return result
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 a skill plugin and fill in the following information:

Register Plugin

Field Descriptions

  • Code: The unique identifier for the plugin within the system; try to use meaningful descriptors.
  • Name: The display name of the plugin, which will be shown by Copilot during reasoning and execution. Ensure full language support.
  • Description: The purpose of the plugin, which will be shown on the skill plugin addition page in Copilot.
  • Request Header: Input any necessary Header parameters for calling the plugin, e.g., API_KEY.
  • Important: OpenAPI / Swagger Schema (JSON): The main API description, which helps Copilot understand when and how to use this skill and fill in parameters.

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: This plugin title helps Copilot understand the plugin's purpose.
  • Paths/[api path]/Get/OperationId: Use \%OperationId%`` in Copilot Prompts to specify API calls in certain scenarios, as demonstrated in step four below.
  • Paths/[api path]/Get/Description: Helps Copilot understand when to trigger this API.
  • Paths/[api path]/Get/Parameters: Ensure consistency with the actual API, such as query parameters, and describe parameter names to increase fill success rates.
  • Servers/Url: The base URL of the API; must be correct for successful calls.
  • Optional: After configuring the plugin, use the DEBUG function for testing.

Step 3: Add the skill plugin to Copilot

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

Add Skill

After saving, test by conversing with an expert.

Use Skill

Step 4: Optional - Add guidance in Copilot's Prompt to improve skill execution

Example

Guide browser plugin to search on specific sites
### Skill 3: Web Searching
- You can access web site by `Browsing` toolkit and look for HR information from the following sites: (site:*.linkedin.com; site:*.zhipin.com)
- Use results to fulfill the user's request and list reference links at the end of your response.

Note: In most cases, Copilot will determine the execution timing and parameter filling based on the information in the OpenAPI Schema.