mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-16 16:50:43 +08:00
feat(openai): 新增技能相关接口
This commit is contained in:
parent
f54b655efc
commit
3e63bdd247
@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI
|
||||
{
|
||||
public static class WechatOpenAIClientExecuteSkillExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /v2/skill/save 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/openapi/api/v2/skill/save.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.SkillSaveResponse> ExecuteSkillSaveAsync(this WechatOpenAIClient client, Models.SkillSaveRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "v2", "skill", "save");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.SkillSaveResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /v2/skill/get_list 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/openapi/api/v2/skill/get_list.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.SkillGetListResponse> ExecuteSkillGetListAsync(this WechatOpenAIClient client, Models.SkillGetListRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "v2", "skill", "get_list");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.SkillGetListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /v2/skill/get_detail 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/openapi/api/v2/skill/get_detail.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.SkillGetDetailResponse> ExecuteSkillGetDetailAsync(this WechatOpenAIClient client, Models.SkillGetDetailRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "v2", "skill", "get_detail");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.SkillGetDetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /v2/skill/delete 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/openapi/api/v2/skill/delete.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.SkillDeleteResponse> ExecuteSkillDeleteAsync(this WechatOpenAIClient client, Models.SkillDeleteRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "v2", "skill", "delete");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.SkillDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /v2/skill/delete 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class SkillDeleteRequest : WechatOpenAIRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置技能 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public IList<long> SkillIdList { get; set; } = new List<long>();
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /v2/skill/delete 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class SkillDeleteResponse : WechatOpenAIResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /v2/skill/get_detail 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class SkillGetDetailRequest : WechatOpenAIRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键字。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("keyword")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("keyword")]
|
||||
public string? Keyword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置技能 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("skill_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("skill_id")]
|
||||
public long SkillId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页页数。
|
||||
/// <para>默认值:1</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page")]
|
||||
public int Page { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// <para>默认值:10</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("size")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("size")]
|
||||
public int Limit { get; set; } = 10;
|
||||
}
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /v2/skill/get_detail 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class SkillGetDetailResponse : WechatOpenAIResponse<SkillGetDetailResponse.Types.Data>
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Skill : SkillGetListResponse.Types.Data.Types.Skill
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置技能开关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("switch")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("switch")]
|
||||
public bool Switch { get; set; }
|
||||
}
|
||||
|
||||
public class IntentItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置意图 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public long IntentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置意图名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置技能 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("skill_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("skill_id")]
|
||||
public long SkillId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优先级。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("rank_level")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("rank_level")]
|
||||
public double RankLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置相似度。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("threshold")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("threshold")]
|
||||
public double Threshold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置意图开关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("switch")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("switch")]
|
||||
public bool Switch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置创建时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("created_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("created_time")]
|
||||
public long CreateTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置修改时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("updated_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("updated_time")]
|
||||
public long UpdateTimestamp { get; set; }
|
||||
}
|
||||
|
||||
public class IntentList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置意图列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("list")]
|
||||
public IntentItem[] Items { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置意图数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("count")]
|
||||
public int Count { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置技能信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("skill")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("skill")]
|
||||
public Types.Skill Skill { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置意图列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("intents")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("intents")]
|
||||
public Types.IntentList IntentList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /v2/skill/get_list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class SkillGetListRequest : WechatOpenAIRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键字。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("keyword")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("keyword")]
|
||||
public string? Keyword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置技能类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("skill_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("skill_type")]
|
||||
public int? SkillType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页页数。
|
||||
/// <para>默认值:1</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page")]
|
||||
public int Page { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// <para>默认值:10</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("size")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("size")]
|
||||
public int Limit { get; set; } = 10;
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /v2/skill/get_list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class SkillGetListResponse : WechatOpenAIResponse<SkillGetListResponse.Types.Data>
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Skill
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置技能 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public long SkillId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置技能名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置技能类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int SkillType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置意图数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("intent_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("intent_count")]
|
||||
public int IntentCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置未配置回答的意图数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("no_answer_intent_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("no_answer_intent_count")]
|
||||
public int NoAnswerIntentCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置场景存活的最大轮数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("max_round")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("max_round")]
|
||||
public int MaxRound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置唤醒开关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wake_open")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wake_open")]
|
||||
public bool WakeSwitch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置唤醒热词。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("awaken_word")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("awaken_word")]
|
||||
public string? AwakeWord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置唤醒的回复语句列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("awaken_answer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("awaken_answer")]
|
||||
public string[]? AwakeAnswerList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退出热词。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exist_word")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exist_word")]
|
||||
public string? ExistWord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退出的回复语句列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exist_answer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exist_answer")]
|
||||
public string[]? ExitAnswerList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置取消意图操作。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cancel_intent_operation")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cancel_intent_operation")]
|
||||
public bool CancelIntentOperation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置取消操作的回复列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cancel_answer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cancel_answer")]
|
||||
public string[]? CancelAnswerList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置没有可取消意图时的回复列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("no_cancel_answer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("no_cancel_answer")]
|
||||
public string[]? NoCancelAnswerList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置技能列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("list")]
|
||||
public Types.Skill[] SkillList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置技能总数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("count")]
|
||||
public int TotalCount { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /v2/skill/save 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class SkillSaveRequest : WechatOpenAIRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置技能 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public long? SkillId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置技能名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置技能类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int? SkillType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置场景存活的最大轮数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("max_round")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("max_round")]
|
||||
public int? MaxRound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置唤醒开关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wake_open")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wake_open")]
|
||||
public bool? WakeSwitch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置唤醒热词。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("awaken_word")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("awaken_word")]
|
||||
public string? AwakeWord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置唤醒的回复语句列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("awaken_answer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("awaken_answer")]
|
||||
public IList<string>? AwakeAnswerList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退出热词。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exist_word")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exist_word")]
|
||||
public string? ExistWord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退出的回复语句列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exist_answer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exist_answer")]
|
||||
public IList<string>? ExitAnswerList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置取消意图操作。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cancel_intent_operation")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cancel_intent_operation")]
|
||||
public bool? CancelIntentOperation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置取消操作的回复列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cancel_answer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cancel_answer")]
|
||||
public IList<string>? CancelAnswerList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置没有可取消意图时的回复列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("no_cancel_answer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("no_cancel_answer")]
|
||||
public IList<string>? NoCancelAnswerList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /v2/skill/save 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class SkillSaveResponse : WechatOpenAIResponse<SkillSaveResponse.Types.Data>
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置技能 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public long SkillId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -20,7 +20,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("class_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("class_id")]
|
||||
public int ClassId { get; set; }
|
||||
public long ClassId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置排序方式。
|
||||
|
@ -21,7 +21,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public int ClassId { get; set; }
|
||||
public long ClassId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置话术名称。
|
||||
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"id": [ 1205880 ]
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "请求成功",
|
||||
"request_id": "255i0ug8-l9q4-3801-44ft-w7csjn9e5142"
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"skill_id": 1243671,
|
||||
"keyword": "",
|
||||
"page": 1,
|
||||
"size": 1
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
{
|
||||
"code": 0,
|
||||
"data": {
|
||||
"intents": {
|
||||
"count": 4559,
|
||||
"list": [
|
||||
{
|
||||
"created_time": 1604308818,
|
||||
"id": 7541523,
|
||||
"name": "什么是正教?",
|
||||
"rank_level": 0.8,
|
||||
"skill_id": 1243671,
|
||||
"switch": true,
|
||||
"threshold": 0.8,
|
||||
"updated_time": 1604309309
|
||||
}
|
||||
]
|
||||
},
|
||||
"skill": {
|
||||
"awaken_answer": [],
|
||||
"awaken_word": "",
|
||||
"cancel_answer": [],
|
||||
"cancel_intent_operation": false,
|
||||
"exist_answer": [],
|
||||
"exist_word": "",
|
||||
"id": 1243671,
|
||||
"intent_count": 0,
|
||||
"max_round": 10,
|
||||
"name": "知识图谱",
|
||||
"no_cancel_answer": [],
|
||||
"switch": true,
|
||||
"type": 0,
|
||||
"wake_open": false
|
||||
}
|
||||
},
|
||||
"msg": "success",
|
||||
"request_id": "255i0ug8-l9q4-3801-44ft-w7csjn9e5142"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"skill_type": 0,
|
||||
"keyword": "天气"
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
{
|
||||
"code": 0,
|
||||
"data": {
|
||||
"count": 2,
|
||||
"list": [
|
||||
{
|
||||
"id": 1205880,
|
||||
"intent_count": 0,
|
||||
"no_answer_intent_count": 0,
|
||||
"type": 1,
|
||||
"name": "天气询问",
|
||||
"max_round": 10,
|
||||
"wake_open": true,
|
||||
"awaken_word": "你好",
|
||||
"awaken_answer": [ "有什么可以帮忙的吗" ],
|
||||
"exist_word": "再见",
|
||||
"exist_answer": [ "祝您好运" ],
|
||||
"cancel_intent_operation": true,
|
||||
"cancel_answer": [ "已取消" ],
|
||||
"no_cancel_answer": [ "没有可以取消的内容" ]
|
||||
}
|
||||
]
|
||||
},
|
||||
"msg": "请求成功",
|
||||
"request_id": "255i0ug8-l9q4-3801-44ft-w7csjn9e5142"
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
{
|
||||
"id": 1205880,
|
||||
"type": 1,
|
||||
"name": "天气询问",
|
||||
"max_round": 10,
|
||||
"wake_open": true,
|
||||
"awaken_word": "你好",
|
||||
"awaken_answer": [
|
||||
"有什么可以帮忙的吗"
|
||||
],
|
||||
"exist_word": "再见",
|
||||
"exist_answer": [
|
||||
"祝您好运"
|
||||
],
|
||||
"cancel_intent_operation": true,
|
||||
"cancel_answer": [
|
||||
"已取消"
|
||||
],
|
||||
"no_cancel_answer": [
|
||||
"没有可以取消的内容"
|
||||
]
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "请求成功",
|
||||
"request_id": "255i0ug8-l9q4-3801-44ft-w7csjn9e5142",
|
||||
"data": {
|
||||
"id": 1205882
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user