mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-17 19:37:35 +08:00
chore(openai): 调整目录结构
This commit is contained in:
parent
e4981f164e
commit
922e70f8db
@ -7,26 +7,6 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class WechatOpenAIPlatformClientEventExtensions
|
public static class WechatOpenAIPlatformClientEventExtensions
|
||||||
{
|
{
|
||||||
private class EncryptedWechatOpenAIEvent
|
|
||||||
{
|
|
||||||
[Newtonsoft.Json.JsonProperty("Encrypt")]
|
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("Encrypt")]
|
|
||||||
public string EncryptedData { get; set; } = default!;
|
|
||||||
|
|
||||||
[Newtonsoft.Json.JsonProperty("TimeStamp")]
|
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("TimeStamp")]
|
|
||||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringConverter))]
|
|
||||||
public string Timestamp { get; set; } = default!;
|
|
||||||
|
|
||||||
[Newtonsoft.Json.JsonProperty("Nonce")]
|
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("Nonce")]
|
|
||||||
public string Nonce { get; set; } = default!;
|
|
||||||
|
|
||||||
[Newtonsoft.Json.JsonProperty("MsgSignature")]
|
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("MsgSignature")]
|
|
||||||
public string Signature { get; set; } = default!;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static TEvent InnerDeserializeEventFromXml<TEvent>(this WechatOpenAIPlatformClient client, string callbackXml)
|
private static TEvent InnerDeserializeEventFromXml<TEvent>(this WechatOpenAIPlatformClient client, string callbackXml)
|
||||||
where TEvent : WechatOpenAIPlatformEvent
|
where TEvent : WechatOpenAIPlatformEvent
|
||||||
{
|
{
|
||||||
@ -96,7 +76,6 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
|
|||||||
throw new Exceptions.WechatOpenAIEventSerializationException("Serialize event failed. Please see the `InnerException` for more details.", ex);
|
throw new Exceptions.WechatOpenAIEventSerializationException("Serialize event failed. Please see the `InnerException` for more details.", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(client.Credentials.EncodingAESKey))
|
if (string.IsNullOrEmpty(client.Credentials.EncodingAESKey))
|
||||||
throw new Exceptions.WechatOpenAIEventSerializationException("Encrypt event failed, because there is no encoding AES key.");
|
throw new Exceptions.WechatOpenAIEventSerializationException("Encrypt event failed, because there is no encoding AES key.");
|
||||||
if (string.IsNullOrEmpty(client.Credentials.Token))
|
if (string.IsNullOrEmpty(client.Credentials.Token))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -6,7 +6,7 @@ using Flurl.Http;
|
|||||||
|
|
||||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI
|
namespace SKIT.FlurlHttpClient.Wechat.OpenAI
|
||||||
{
|
{
|
||||||
public static class WechatOpenAIPlatformClientExecuteQueryExtensions
|
public static class WechatOpenAIPlatformClientExecuteDialogExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>异步调用 [POST] /sign/{TOKEN} 接口。</para>
|
/// <para>异步调用 [POST] /sign/{TOKEN} 接口。</para>
|
||||||
@ -48,7 +48,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>异步调用 [POST] /gethotquerylist/{TOKEN} 接口。</para>
|
/// <para>异步调用 [POST] /gethotquerylist/{TOKEN} 接口。</para>
|
||||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/api/gethotquerylist.html </para>
|
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/confapi/dialog/gethotquerylist.html </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="client"></param>
|
/// <param name="client"></param>
|
||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
@ -0,0 +1,67 @@
|
|||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /gethotquerydetail/{TOKEN} 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
[XmlRoot("xml")]
|
||||||
|
public class GetHotQueryDetailRequest : WechatOpenAIPlatformRequest, WechatOpenAIPlatformRequest.Serialization.IEncryptedXmlable
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置分页页数。
|
||||||
|
/// <para>默认值:1</para>
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("pageNo")]
|
||||||
|
public int Page { get; set; } = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置分页每页数量。
|
||||||
|
/// <para>默认值:10</para>
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("pageSize")]
|
||||||
|
public int Limit { get; set; } = 10;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置命中类型。
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("matchType", IsNullable = true)]
|
||||||
|
public int? MatchType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置问题类型。
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("cluesType", IsNullable = true)]
|
||||||
|
public int? ClueType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置报告类型。
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("reportType", IsNullable = true)]
|
||||||
|
public int? ReportType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置日期字符串(格式:yyyy-MM-dd)。
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("date")]
|
||||||
|
public string DateString { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置开发者的 OpenId。
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("openid")]
|
||||||
|
public string OpenId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置聚类结果类别 ID。
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("clusterId")]
|
||||||
|
public string ClusterId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置聚类结果。
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("hotQuesCluster", IsNullable = true)]
|
||||||
|
public string? HotQuestionCluster { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /gethotquerydetail/{TOKEN} 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class GetHotQueryDetailResponse : WechatOpenAIPlatformResponse<GetHotQueryDetailResponse.Types.Data>
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class Data
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class HotQuery
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置提问总数。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("askCount")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("askCount")]
|
||||||
|
public int AskCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置提问用户数。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("askUserCount")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("askUserCount")]
|
||||||
|
public int AskUserCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置命中的技能。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("hitIntent")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("hitIntent")]
|
||||||
|
public string? HitIntent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置相似问题。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("ques")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("ques")]
|
||||||
|
public string Question { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置问题得分。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("score")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("score")]
|
||||||
|
public double Score { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置问题数量。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("count")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("count")]
|
||||||
|
public int HotQuestionCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置分页总页数。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("totalPages")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("totalPages")]
|
||||||
|
public int TotalPageCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置热问列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("list")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("list")]
|
||||||
|
public Types.HotQuery[] HotQueryList { get; set; } = default!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <inheritdoc/>
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("code")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("code")]
|
||||||
|
public override int? ErrorCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <inheritdoc/>
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("msg")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("msg")]
|
||||||
|
public override string? ErrorMessage { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>表示 [POST] /gethotquerylist/{TOKEN} 接口的响应。</para>
|
/// <para>表示 [POST] /gethotquerylist/{TOKEN} 接口的响应。</para>
|
||||||
@ -25,11 +25,11 @@
|
|||||||
public string Question { get; set; } = default!;
|
public string Question { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置分数
|
/// 获取或设置问题得分。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("score")]
|
[Newtonsoft.Json.JsonProperty("score")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("score")]
|
[System.Text.Json.Serialization.JsonPropertyName("score")]
|
||||||
public int Score { get; set; }
|
public double Score { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,8 +50,8 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置问法总数。
|
/// 获取或设置问法总数。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("askUserCount")]
|
[Newtonsoft.Json.JsonProperty("quesCount")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("askUserCount")]
|
[System.Text.Json.Serialization.JsonPropertyName("quesCount")]
|
||||||
public int QuestionCount { get; set; }
|
public int QuestionCount { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -61,6 +61,20 @@
|
|||||||
[System.Text.Json.Serialization.JsonPropertyName("cluesType")]
|
[System.Text.Json.Serialization.JsonPropertyName("cluesType")]
|
||||||
public int ClueType { get; set; }
|
public int ClueType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置聚类结果类别 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("clusterId")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("clusterId")]
|
||||||
|
public string ClusterId { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置聚类结果。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("hotQuesCluster")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("hotQuesCluster")]
|
||||||
|
public string? HotQuestionCluster { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置示例列表
|
/// 获取或设置示例列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -99,5 +113,19 @@
|
|||||||
public Types.HotQuery[] HotQueryList { get; set; } = default!;
|
public Types.HotQuery[] HotQueryList { get; set; } = default!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <inheritdoc/>
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("code")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("code")]
|
||||||
|
public override int? ErrorCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <inheritdoc/>
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("msg")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("msg")]
|
||||||
|
public override string? ErrorMessage { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>表示 [POST] /nlp/recommend_questions/{TOKEN} 接口的请求。</para>
|
/// <para>表示 [POST] /nlp/recommend_questions/{TOKEN} 接口的请求。</para>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
||||||
{
|
{
|
||||||
@ -28,9 +28,8 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置有效期(单位:秒)。
|
/// 获取或设置有效期(单位:秒)。
|
||||||
/// <para>默认值:1800</para>
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[XmlElement("expires")]
|
[XmlElement("expires", IsNullable = true)]
|
||||||
public int ExpiresIn { get; set; } = 1800;
|
public int? ExpiresIn { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
||||||
{
|
{
|
||||||
@ -19,5 +19,11 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[XmlElement("openid")]
|
[XmlElement("openid")]
|
||||||
public string OpenId { get; set; } = string.Empty;
|
public string OpenId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置获取类型。
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("type", IsNullable = true)]
|
||||||
|
public int? Type { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>表示 [POST] /kefustate/get/{TOKEN} 接口的响应。</para>
|
/// <para>表示 [POST] /kefustate/get/{TOKEN} 接口的响应。</para>
|
||||||
@ -6,10 +6,17 @@
|
|||||||
public class KefuStateGetResponse : WechatOpenAIPlatformResponse
|
public class KefuStateGetResponse : WechatOpenAIPlatformResponse
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置客户接入状态。
|
/// 获取或设置客服接入状态。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("kefustate")]
|
[Newtonsoft.Json.JsonProperty("kefustate")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("kefustate")]
|
[System.Text.Json.Serialization.JsonPropertyName("kefustate")]
|
||||||
public string State { get; set; } = default!;
|
public string State { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置人工客服接入状态。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("status")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||||
|
public string Status { get; set; } = default!;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
||||||
{
|
{
|
||||||
@ -49,5 +49,11 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models.Platform
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[XmlElement("kefuavatar", IsNullable = true)]
|
[XmlElement("kefuavatar", IsNullable = true)]
|
||||||
public string? KfAvatarUrl { get; set; }
|
public string? KfAvatarUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置分类或技能名称。
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("ans_node_name", IsNullable = true)]
|
||||||
|
public string? AnswerNodeName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"msg": "",
|
||||||
|
"data": {
|
||||||
|
"count": 0,
|
||||||
|
"totalPages": 0,
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"ques": "",
|
||||||
|
"score": 0,
|
||||||
|
"hitIntent": "",
|
||||||
|
"askCount": 0,
|
||||||
|
"askUserCount": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"msg": "",
|
||||||
|
"data": {
|
||||||
|
"hotQuesClusterCount": 0,
|
||||||
|
"hotQuesCount": 0,
|
||||||
|
"totalPages": 0,
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"askCount": 0,
|
||||||
|
"askUserCount": 0,
|
||||||
|
"quesCount": 0,
|
||||||
|
"cluesType": 0,
|
||||||
|
"clusterId": "",
|
||||||
|
"hotQuesCluster": "",
|
||||||
|
"exampleQues": [
|
||||||
|
{
|
||||||
|
"ques": "",
|
||||||
|
"score": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user