yqcloud-function-calling
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYQCloud 自定义 Function Calling 格式说明
YQCloud Custom Function Calling Format Specification
本 skill 描述了一套自定义的 function calling 格式,用于 ITSM(IT服务管理)场景下的工单操作。
This skill describes a set of custom function calling formats for ticket operations in ITSM (IT Service Management) scenarios.
格式结构说明
Format Structure Description
每个函数定义包含两层结构:
- 外层:标准的函数描述(name、description、parameters)
- 内层 字段:执行配置(type、url、headers 等)
function
Each function definition contains two layers of structure:
- Outer layer: Standard function description (name, description, parameters)
- Inner field: Execution configuration (type, url, headers, etc.)
function
函数类型(function.type)
Function Type (function.type)
| 类型 | 说明 |
|---|---|
| 手动处理,由前端/系统自行实现逻辑,不发起 HTTP 请求 |
| 自动发起 HTTP 请求到指定 URL |
| Type | Description |
|---|---|
| Manual processing, the logic is implemented by the frontend/system itself, no HTTP request is initiated |
| Automatically initiate an HTTP request to the specified URL |
通用字段
Common Fields
- :调用函数后是否停止 AI 继续生成(true=停止,false=继续)
stopAfterFunctionCall - :国际化配置,包含
intl和zh_CNen_US - :JavaScript 代码字符串,
requestParser为 AI 函数调用参数的 JSON 字符串(需data解析)JSON.parse(data) - :JavaScript 代码字符串,
responseParser为响应体对象,可使用data(lodash)_
- : Whether to stop the AI from continuing to generate after calling the function (true = stop, false = continue)
stopAfterFunctionCall - : Internationalization configuration, including
intlandzh_CNen_US - : JavaScript code string,
requestParseris the JSON string of AI function call parameters (needs to be parsed withdata)JSON.parse(data) - : JavaScript code string,
responseParseris the response body object,data(lodash) can be used_
变量占位符
Variable Placeholders
- :YQCloud 服务基础地址
${STATIC#yqcloud_url} - :当前租户 ID
${tenantId} - :当前用户访问令牌
${yqAccessToken}
- : YQCloud service base address
${STATIC#yqcloud_url} - : Current tenant ID
${tenantId} - : Current user access token
${yqAccessToken}
函数列表
Function List
1. createTicket — 创建工单
1. createTicket — Create Ticket
- 类型:(前端自行处理,不发 HTTP 请求)
manual - stopAfterFunctionCall:
true - 参数:,接受任意字段
additionalProperties: true - 调用时机:已获取表单 Schema 并从用户处收集完所有字段后调用
- Type: (handled by the frontend itself, no HTTP request is sent)
manual - stopAfterFunctionCall:
true - Parameters: , accepts any fields
additionalProperties: true - Calling timing: Called after obtaining the form Schema and collecting all fields from the user
2. getCreateTicketParamJsonSchema — 获取工单参数 Schema
2. getCreateTicketParamJsonSchema — Get Ticket Parameter Schema
- 类型:,GET 请求
call_url - URL:
${STATIC#yqcloud_url}/ai/v1/${tenantId}/itsmScene/getServiceItemSchema - stopAfterFunctionCall:
false - 必填参数:(string,服务项 ID)
id - 调用时机:确定服务项后立即调用,根据返回的 Schema 向用户逐一收集字段
- Type: , GET request
call_url - URL:
${STATIC#yqcloud_url}/ai/v1/${tenantId}/itsmScene/getServiceItemSchema - stopAfterFunctionCall:
false - Required parameter: (string, service item ID)
id - Calling timing: Called immediately after the service item is confirmed, collect fields from the user one by one according to the returned Schema
3. getAllServiceItem — 获取全部服务项
3. getAllServiceItem — Get All Service Items
- 类型:,GET 请求
call_url - URL:
${STATIC#yqcloud_url}/itsm/v1/${tenantId}/service_items/catalog/page/all?serviceCatalogFlag=true&page=0&size=9999 - 参数:无必填参数
- responseParser:过滤 ,只保留
type === 'SERVICE' || type === 'RECORD'、id、name、shortDescription,返回description{ allServiceItemList: [...] } - 调用时机:用户提出任何工单相关需求后第一步调用
- Type: , GET request
call_url - URL:
${STATIC#yqcloud_url}/itsm/v1/${tenantId}/service_items/catalog/page/all?serviceCatalogFlag=true&page=0&size=9999 - Parameters: No required parameters
- responseParser: Filter , only retain
type === 'SERVICE' || type === 'RECORD',id,name,shortDescription, returndescription{ allServiceItemList: [...] } - Calling timing: First step call after the user puts forward any ticket-related requirements
4. requestUserSelectServiceItem — 请求用户选择服务项
4. requestUserSelectServiceItem — Request User to Select Service Item
- 类型:,POST 请求,URL:
call_url/transparent - stopAfterFunctionCall:
true - 必填参数:(array,最多传 1 个最可能匹配的服务项)
serviceItemList - responseParser:
return data?.serviceItemList ? data : {result: 'no data'} - 调用时机:AI 无法确定具体服务项时调用
- Type: , POST request, URL:
call_url/transparent - stopAfterFunctionCall:
true - Required parameter: (array, max 1 most likely matching service item is allowed to be passed)
serviceItemList - responseParser:
return data?.serviceItemList ? data : {result: 'no data'} - Calling timing: Called when AI cannot determine the specific service item
典型调用流程
Typical Calling Process
用户提出工单需求
↓
调用 getAllServiceItem
↓
AI 分析匹配服务项
├─ 能确定 → getCreateTicketParamJsonSchema → 收集字段 → createTicket
└─ 无法确定 → requestUserSelectServiceItem → 用户选择后重新进入流程User submits ticket request
↓
Call getAllServiceItem
↓
AI analyzes and matches service items
├─ Match confirmed → getCreateTicketParamJsonSchema → Collect fields → createTicket
└─ Match unconfirmed → requestUserSelectServiceItem → Re-enter the process after user selection注意事项
Notes
- 实际无必填参数,直接调用即可
getAllServiceItem - 的
requestUserSelectServiceItem最多传 1 个服务项serviceItemList - 是
createTicket类型,实际创建逻辑由前端实现manual - 的函数调用后 AI 不会继续输出
stopAfterFunctionCall: true
- actually has no required parameters, you can call it directly
getAllServiceItem - The parameter of
serviceItemListcan pass at most 1 service itemrequestUserSelectServiceItem - is of
createTickettype, the actual creation logic is implemented by the frontendmanual - After calling a function with , the AI will not continue to output
stopAfterFunctionCall: true