mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-21 02:58:06 +08:00
feat(openai): 移除 NLP 相关接口及模型
This commit is contained in:
@@ -2,7 +2,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 userEnter 事件的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/thirdkefu/recivemsg.html </para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/confapi/thirdkefu/recivemsg.html </para>
|
||||
/// </summary>
|
||||
public class UserEnterEvent : WechatOpenAIEvent, WechatOpenAIEvent.Serialization.IXmlSerializable
|
||||
{
|
||||
@@ -39,14 +39,14 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Events
|
||||
/// <summary>
|
||||
/// 获取或设置客服接入状态。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("status")]
|
||||
public int Status { get; set; }
|
||||
[System.Xml.Serialization.XmlElement("kfstate")]
|
||||
public int KfState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置渠道。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("channel", IsNullable = true)]
|
||||
public string? Channel { get; set; }
|
||||
[System.Xml.Serialization.XmlElement("channel")]
|
||||
public int Channel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户评价。
|
||||
|
@@ -2,7 +2,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 userQuit 事件的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/thirdkefu/recivemsg.html </para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/confapi/thirdkefu/recivemsg.html </para>
|
||||
/// </summary>
|
||||
public class UserQuitEvent : UserEnterEvent
|
||||
{
|
||||
|
@@ -1,49 +0,0 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI
|
||||
{
|
||||
public static class WechatOpenAIClientExecuteLivingExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /batchreply/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/living/batchreply.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.BatchReplyResponse> ExecuteBatchReplyAsync(this WechatOpenAIClient client, Models.BatchReplyRequest 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, "batchreply", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.BatchReplyResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /generatereport/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/living/setautoreply.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GenerateReportResponse> ExecuteGenerateReportAsync(this WechatOpenAIClient client, Models.GenerateReportRequest 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, "generatereport", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GenerateReportResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,239 +0,0 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI
|
||||
{
|
||||
public static class WechatOpenAIClientExecuteNLPExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/tokenize/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/tokenize.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPTokenizeResponse> ExecuteNLPTokenizeAsync(this WechatOpenAIClient client, Models.NLPTokenizeRequest 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, "nlp", "tokenize", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPTokenizeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/ner/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/ner.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPNERResponse> ExecuteNLPNERAsync(this WechatOpenAIClient client, Models.NLPNERRequest 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, "nlp", "ner", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPNERResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/sentiment/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/sentiment.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPSentimentResponse> ExecuteNLPSentimentAsync(this WechatOpenAIClient client, Models.NLPSentimentRequest 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, "nlp", "sentiment", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPSentimentResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/ner-product/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/nerproduct.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPNERProductResponse> ExecuteNLPNERProductAsync(this WechatOpenAIClient client, Models.NLPNERProductRequest 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, "nlp", "ner-product", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPNERProductResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/sensitive/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/sensitive.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPSensitiveResponse> ExecuteNLPSensitiveAsync(this WechatOpenAIClient client, Models.NLPSensitiveRequest 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, "nlp", "sensitive", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPSensitiveResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/rank/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/rank.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPRankResponse> ExecuteNLPRankAsync(this WechatOpenAIClient client, Models.NLPRankRequest 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, "nlp", "rank", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPRankResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/translate_en2cn/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/translate.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPTranslateEnglish2ChineseResponse> ExecuteNLPTranslateEnglish2ChineseAsync(this WechatOpenAIClient client, Models.NLPTranslateEnglish2ChineseRequest 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, "nlp", "translate_en2cn", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPTranslateEnglish2ChineseResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/translate_cn2en/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/translate.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPTranslateChinese2EnglishResponse> ExecuteNLPTranslateChinese2EnglishAsync(this WechatOpenAIClient client, Models.NLPTranslateChinese2EnglishRequest 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, "nlp", "translate_cn2en", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPTranslateChinese2EnglishResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/get_similar_query/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/similar_recommend.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPGetSimilarQueryResponse> ExecuteNLPGetSimilarQueryAsync(this WechatOpenAIClient client, Models.NLPGetSimilarQueryRequest 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, "nlp", "get_similar_query", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPGetSimilarQueryResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/news-abstraction/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/summarize.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPNewsAbstractionResponse> ExecuteNLPNewsAbstractionAsync(this WechatOpenAIClient client, Models.NLPNewsAbstractionRequest 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, "nlp", "news-abstraction", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPNewsAbstractionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/document_classify/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/summarize.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPDocumentClassifyResponse> ExecuteNLPDocumentClassifyAsync(this WechatOpenAIClient client, Models.NLPDocumentClassifyRequest 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, "nlp", "document_classify", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPDocumentClassifyResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /nlp/recommend_questions/{TOKEN} 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/aispeech/platform/nlp/rec_chat.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NLPRecommendQuestionsResponse> ExecuteNLPRecommendQuestionsAsync(this WechatOpenAIClient client, Models.NLPRecommendQuestionsRequest 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, "nlp", "recommend_questions", client.Credentials.Token!);
|
||||
|
||||
return await client.SendRequestWithUrlEncodedAsync<Models.NLPRecommendQuestionsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
@@ -28,14 +28,14 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
/// <summary>
|
||||
/// 获取或设置相似问题列表。
|
||||
/// </summary>
|
||||
[XmlElement("question")]
|
||||
public List<string> QuestionList { get; set; } = new List<string>();
|
||||
[XmlElement("question", Type = typeof(string))]
|
||||
public IList<string> QuestionList { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置机器人回答列表。
|
||||
/// </summary>
|
||||
[XmlElement("answer")]
|
||||
public List<string> AnswerList { get; set; } = new List<string>();
|
||||
[XmlElement("answer", Type = typeof(string))]
|
||||
public IList<string> AnswerList { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
/// <summary>
|
||||
/// 获取或设置技能列表。
|
||||
/// </summary>
|
||||
[XmlElement("skill")]
|
||||
public List<Types.Skill> SkillList { get; set; } = new List<Types.Skill>();
|
||||
[XmlElement("skill", Type = typeof(Types.Skill))]
|
||||
public IList<Types.Skill> SkillList { get; set; } = new List<Types.Skill>();
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /batchimportskill/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class BatchImportSkillResponse : WechatOpenAIResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("code")]
|
||||
public override int? ReturnCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取微信智能对话 API 返回的错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg")]
|
||||
public string? ReturnMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
@@ -38,6 +38,6 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
/// </summary>
|
||||
[XmlArray("list")]
|
||||
[XmlArrayItem("openid", Type = typeof(string))]
|
||||
public List<string> OpenIdList { get; set; } = new List<string>();
|
||||
public IList<string> OpenIdList { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /label/batchset/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class LabelBatchSetResponse : WechatOpenAIResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("code")]
|
||||
public override int? ReturnCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取微信智能对话 API 返回的错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg")]
|
||||
public string? ReturnMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /publish_progress/{TOKEN} 接口的响应。</para>
|
||||
@@ -24,5 +24,19 @@
|
||||
public int Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("code")]
|
||||
public override int? ReturnCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取微信智能对话 API 返回的错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg")]
|
||||
public string? ReturnMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /publish/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class PublishResponse : WechatOpenAIResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("code")]
|
||||
public override int? ReturnCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取微信智能对话 API 返回的错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg")]
|
||||
public string? ReturnMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
@@ -38,6 +38,6 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
/// </summary>
|
||||
[XmlArray("list")]
|
||||
[XmlArrayItem("question", Type = typeof(string))]
|
||||
public List<string> QuestionList { get; set; } = new List<string>();
|
||||
public IList<string> QuestionList { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /setautoreply/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class SetAutoReplyResponse : WechatOpenAIResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("code")]
|
||||
public override int? ReturnCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取微信智能对话 API 返回的错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg")]
|
||||
public string? ReturnMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -78,13 +78,13 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("code")]
|
||||
public override int? ErrorCode { get; set; }
|
||||
public override int? ReturnCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// 获取微信智能对话 API 返回的错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg")]
|
||||
public override string? ErrorMessage { get; set; }
|
||||
public string? ReturnMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -119,13 +119,13 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("code")]
|
||||
public override int? ErrorCode { get; set; }
|
||||
public override int? ReturnCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// 获取微信智能对话 API 返回的错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg")]
|
||||
public override string? ErrorMessage { get; set; }
|
||||
public string? ReturnMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -1,43 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /batchreply/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
[XmlRoot("xml")]
|
||||
public class BatchReplyRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedXmlable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置直播 ID。
|
||||
/// </summary>
|
||||
[XmlElement("liveid")]
|
||||
public string LiveId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置回复内容。
|
||||
/// </summary>
|
||||
[XmlElement("content")]
|
||||
public string Content { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置希望展示给用户的客服人员的名字。
|
||||
/// </summary>
|
||||
[XmlElement("waitername", IsNullable = true)]
|
||||
public string? WaiterName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置客希望展示给用户的客服人员的头像 URL。
|
||||
/// </summary>
|
||||
[XmlElement("waiteravatar", IsNullable = true)]
|
||||
public string? WaiterAvatarUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置要设置标签的 OpenId 列表。
|
||||
/// </summary>
|
||||
[XmlArray("list")]
|
||||
[XmlArrayItem("openid", Type = typeof(string))]
|
||||
public List<string> OpenIdList { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /batchreply/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class BatchReplyResponse : WechatOpenAIResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,23 +0,0 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /generatereport/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
[XmlRoot("xml")]
|
||||
public class GenerateReportRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedXmlable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置直播 ID。
|
||||
/// </summary>
|
||||
[XmlElement("liveid")]
|
||||
public string LiveId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置房间 ID。
|
||||
/// </summary>
|
||||
[XmlElement("bucket")]
|
||||
public string Bucket { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /generatereport/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GenerateReportResponse : WechatOpenAIResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/document_classify/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPDocumentClassifyRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文章标题。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文章正文内容。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("content")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("content")]
|
||||
public string Content { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/document_classify/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPDocumentClassifyResponse : WechatOpenAIResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置一级分类结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("level1_cls")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("level1_cls")]
|
||||
public string Level1Classification { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置二级分类结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("level2_cls")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("level2_cls")]
|
||||
public string Level2Classification { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置三级分类结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("level3_cls")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("level3_cls")]
|
||||
public string Level3lassification { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文章分类的结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("preds")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("preds")]
|
||||
public Types.Result Result { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/get_similar_query/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPGetSimilarQueryRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置输入文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("query")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("query")]
|
||||
public string QueryString { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,49 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/get_similar_query/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPGetSimilarQueryResponse : WechatOpenAIResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置相似问题信息项。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("question")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("question")]
|
||||
public string Sentiment { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分值(范围:0~1)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("score")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("score")]
|
||||
public double Score { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("source")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("source")]
|
||||
public string Source { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Result[] ResultList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置耗时(单位:毫秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("costime")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("costime")]
|
||||
public int CostTime { get; set; }
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/ner-product/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPNERProductRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置输入文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("q")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("q")]
|
||||
public string QueryString { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,254 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/ner-product/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPNERProductResponse : WechatOpenAIResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ProductProperty
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商品属性名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品属性值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string Value { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置起始字符位置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int StartIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结束字符位置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int EndIndex { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.ResponsePropertyProductPropertyArrayNewtonsoftJsonConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(Converters.ResponsePropertyProductPropertyArraySystemTextJsonConverter))]
|
||||
public Types.ProductProperty[] ProductPropertyList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
internal static class Converters
|
||||
{
|
||||
internal class ResponsePropertyProductPropertyArrayNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter<Types.Result.Types.ProductProperty[]?>
|
||||
{
|
||||
public override bool CanRead
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanWrite
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override Types.Result.Types.ProductProperty[]? ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, Types.Result.Types.ProductProperty[]? existingValue, bool hasExistingValue, Newtonsoft.Json.JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == Newtonsoft.Json.JsonToken.Null)
|
||||
{
|
||||
return existingValue;
|
||||
}
|
||||
else if (reader.TokenType == Newtonsoft.Json.JsonToken.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
var tmpList = new List<Types.Result.Types.ProductProperty>();
|
||||
|
||||
while (reader.TokenType != Newtonsoft.Json.JsonToken.EndArray)
|
||||
{
|
||||
if (reader.TokenType == Newtonsoft.Json.JsonToken.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
int offset = 0;
|
||||
var tmpItem = new Types.Result.Types.ProductProperty();
|
||||
|
||||
while (reader.TokenType != Newtonsoft.Json.JsonToken.EndArray)
|
||||
{
|
||||
if (offset == 0)
|
||||
{
|
||||
tmpItem.Value = serializer.Deserialize<string>(reader)!;
|
||||
}
|
||||
else if (offset == 1)
|
||||
{
|
||||
tmpItem.Name = serializer.Deserialize<string>(reader)!;
|
||||
}
|
||||
else if (offset == 2)
|
||||
{
|
||||
tmpItem.StartIndex = serializer.Deserialize<int>(reader);
|
||||
}
|
||||
else if (offset == 3)
|
||||
{
|
||||
tmpItem.EndIndex = serializer.Deserialize<int>(reader);
|
||||
}
|
||||
|
||||
offset++;
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
tmpList.Add(tmpItem);
|
||||
}
|
||||
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
return tmpList.ToArray();
|
||||
}
|
||||
|
||||
throw new Newtonsoft.Json.JsonReaderException();
|
||||
}
|
||||
|
||||
public override void WriteJson(Newtonsoft.Json.JsonWriter writer, Types.Result.Types.ProductProperty[]? value, Newtonsoft.Json.JsonSerializer serializer)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
|
||||
foreach (var item in value)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
writer.WriteValue(item.Value);
|
||||
writer.WriteValue(item.Name);
|
||||
writer.WriteValue(item.StartIndex);
|
||||
writer.WriteValue(item.EndIndex);
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteNull();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class ResponsePropertyProductPropertyArraySystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter<Types.Result.Types.ProductProperty[]?>
|
||||
{
|
||||
public override Types.Result.Types.ProductProperty[]? Read(ref System.Text.Json.Utf8JsonReader reader, Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType == System.Text.Json.JsonTokenType.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (reader.TokenType == System.Text.Json.JsonTokenType.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
var tmpList = new List<Types.Result.Types.ProductProperty>();
|
||||
var tmpOptions = new System.Text.Json.JsonSerializerOptions(options);
|
||||
|
||||
while (reader.TokenType != System.Text.Json.JsonTokenType.EndArray)
|
||||
{
|
||||
if (reader.TokenType == System.Text.Json.JsonTokenType.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
int offset = 0;
|
||||
var tmpItem = new Types.Result.Types.ProductProperty();
|
||||
|
||||
while (reader.TokenType != System.Text.Json.JsonTokenType.EndArray)
|
||||
{
|
||||
if (offset == 0)
|
||||
{
|
||||
tmpItem.Value = System.Text.Json.JsonSerializer.Deserialize<string>(ref reader, tmpOptions)!;
|
||||
}
|
||||
else if (offset == 1)
|
||||
{
|
||||
tmpItem.Name = System.Text.Json.JsonSerializer.Deserialize<string>(ref reader, tmpOptions)!;
|
||||
}
|
||||
else if (offset == 2)
|
||||
{
|
||||
tmpItem.StartIndex = System.Text.Json.JsonSerializer.Deserialize<int>(ref reader, tmpOptions);
|
||||
}
|
||||
else if (offset == 3)
|
||||
{
|
||||
tmpItem.EndIndex = System.Text.Json.JsonSerializer.Deserialize<int>(ref reader, tmpOptions);
|
||||
}
|
||||
|
||||
offset++;
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
tmpList.Add(tmpItem);
|
||||
}
|
||||
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
return tmpList.ToArray();
|
||||
}
|
||||
|
||||
throw new System.Text.Json.JsonException();
|
||||
}
|
||||
|
||||
public override void Write(System.Text.Json.Utf8JsonWriter writer, Types.Result.Types.ProductProperty[]? value, System.Text.Json.JsonSerializerOptions options)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
|
||||
foreach (var item in value)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
writer.WriteStringValue(item.Value);
|
||||
writer.WriteStringValue(item.Name);
|
||||
writer.WriteNumberValue(item.StartIndex);
|
||||
writer.WriteNumberValue(item.EndIndex);
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteNullValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置预处理后的文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("preprocessed_text")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("preprocessed_text")]
|
||||
public string PreprocessedText { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置抽取结果信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("entities")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("entities")]
|
||||
public Types.Result Result { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/ner/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPNERRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置输入文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("q")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("q")]
|
||||
public string QueryString { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,50 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/ner/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPNERResponse : WechatOpenAIResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置结果类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置范围列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("span")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("span")]
|
||||
public int[] SpanList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("text")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("text")]
|
||||
public string Text { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置范数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("norm")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("norm")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.DynamicObjectConverter))]
|
||||
public dynamic Norm { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result")]
|
||||
public Types.Result[] ResultList { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -1,56 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/news-abstraction/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPNewsAbstractionRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置新闻标题。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置新闻正文内容。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("content")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("content")]
|
||||
public string Content { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置新闻所属的一级类别标签。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("category")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("category")]
|
||||
public string? Category { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否在提取摘要前先进行新闻分类标志。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("do_news_classify")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("do_news_classify")]
|
||||
public bool? RequireDoNewsClassify { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/news-abstraction/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPNewsAbstractionResponse : WechatOpenAIResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置摘要提取的结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("abstraction")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("abstraction")]
|
||||
public string Result { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否适合提取摘要的分类标签。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("classification")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("classification")]
|
||||
public bool HasClassification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分值(范围:0~1)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("prob")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("prob")]
|
||||
public double Score { get; set; }
|
||||
}
|
||||
}
|
@@ -1,57 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/rank/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPRankRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Candidate
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置候选词。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("text")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("text")]
|
||||
public string Text { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置输入文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("query")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("query")]
|
||||
public string QueryString { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置候选词列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("candidates")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("candidates")]
|
||||
public IList<Types.Candidate> CandidateList { get; set; } = new List<Types.Candidate>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/rank/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPRankResponse : WechatOpenAIResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置候选词信息项。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("question")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("question")]
|
||||
public string Sentiment { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分值(范围:0~1)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("score")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("score")]
|
||||
public double Score { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("results")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("results")]
|
||||
public Types.Result[] ResultList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否有 Exact Match 候选。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exact_match")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exact_match")]
|
||||
public bool HasExactMatch { get; set; }
|
||||
}
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/recommend_questions/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPRecommendQuestionsRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/recommend_questions/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPRecommendQuestionsResponse : WechatOpenAIResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置推荐的结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("results")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("results")]
|
||||
public string[] ResultList { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/sensitive/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPSensitiveRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置输入文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("q")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("q")]
|
||||
public string QueryString { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("model")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("model")]
|
||||
public string? Model { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,200 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/sensitive/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPSensitiveResponse : WechatOpenAIResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置敏感信息项。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string Sensitive { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分值(范围:0~1)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public double Score { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
internal static class Converters
|
||||
{
|
||||
internal class ResponsePropertyResultArrayNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter<Types.Result[]?>
|
||||
{
|
||||
public override bool CanRead
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanWrite
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override Types.Result[]? ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, Types.Result[]? existingValue, bool hasExistingValue, Newtonsoft.Json.JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == Newtonsoft.Json.JsonToken.Null)
|
||||
{
|
||||
return existingValue;
|
||||
}
|
||||
else if (reader.TokenType == Newtonsoft.Json.JsonToken.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
var tmpList = new List<Types.Result>();
|
||||
|
||||
while (reader.TokenType != Newtonsoft.Json.JsonToken.EndArray)
|
||||
{
|
||||
if (reader.TokenType == Newtonsoft.Json.JsonToken.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
int offset = 0;
|
||||
var tmpItem = new Types.Result();
|
||||
|
||||
while (reader.TokenType != Newtonsoft.Json.JsonToken.EndArray)
|
||||
{
|
||||
if (offset == 0)
|
||||
{
|
||||
tmpItem.Sensitive = serializer.Deserialize<string>(reader)!;
|
||||
}
|
||||
else if (offset == 1)
|
||||
{
|
||||
tmpItem.Score = serializer.Deserialize<double>(reader);
|
||||
}
|
||||
|
||||
offset++;
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
tmpList.Add(tmpItem);
|
||||
}
|
||||
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
return tmpList.ToArray();
|
||||
}
|
||||
|
||||
throw new Newtonsoft.Json.JsonReaderException();
|
||||
}
|
||||
|
||||
public override void WriteJson(Newtonsoft.Json.JsonWriter writer, Types.Result[]? value, Newtonsoft.Json.JsonSerializer serializer)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
|
||||
foreach (var item in value)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
writer.WriteValue(item.Sensitive);
|
||||
writer.WriteValue(item.Score);
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteNull();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class ResponsePropertyResultArraySystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter<Types.Result[]?>
|
||||
{
|
||||
public override Types.Result[]? Read(ref System.Text.Json.Utf8JsonReader reader, Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType == System.Text.Json.JsonTokenType.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (reader.TokenType == System.Text.Json.JsonTokenType.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
var tmpList = new List<Types.Result>();
|
||||
var tmpOptions = new System.Text.Json.JsonSerializerOptions(options);
|
||||
|
||||
while (reader.TokenType != System.Text.Json.JsonTokenType.EndArray)
|
||||
{
|
||||
if (reader.TokenType == System.Text.Json.JsonTokenType.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
int offset = 0;
|
||||
var tmpItem = new Types.Result();
|
||||
|
||||
while (reader.TokenType != System.Text.Json.JsonTokenType.EndArray)
|
||||
{
|
||||
if (offset == 0)
|
||||
{
|
||||
tmpItem.Sensitive = System.Text.Json.JsonSerializer.Deserialize<string>(ref reader, tmpOptions)!;
|
||||
}
|
||||
else if (offset == 1)
|
||||
{
|
||||
tmpItem.Score = System.Text.Json.JsonSerializer.Deserialize<double>(ref reader, tmpOptions);
|
||||
}
|
||||
|
||||
offset++;
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
tmpList.Add(tmpItem);
|
||||
}
|
||||
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
return tmpList.ToArray();
|
||||
}
|
||||
|
||||
throw new System.Text.Json.JsonException();
|
||||
}
|
||||
|
||||
public override void Write(System.Text.Json.Utf8JsonWriter writer, Types.Result[]? value, System.Text.Json.JsonSerializerOptions options)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
|
||||
foreach (var item in value)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
writer.WriteStringValue(item.Sensitive);
|
||||
writer.WriteNumberValue(item.Score);
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteNullValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.ResponsePropertyResultArrayNewtonsoftJsonConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(Converters.ResponsePropertyResultArraySystemTextJsonConverter))]
|
||||
public Types.Result[] ResultList { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/sentiment/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPSentimentRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置输入文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("q")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("q")]
|
||||
public string QueryString { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模式。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mode")]
|
||||
public string? Mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,200 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/sentiment/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPSentimentResponse : WechatOpenAIResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置情感信息项。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string Sentiment { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分值(范围:0~1)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public double Score { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
internal static class Converters
|
||||
{
|
||||
internal class ResponsePropertyResultArrayNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter<Types.Result[]?>
|
||||
{
|
||||
public override bool CanRead
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanWrite
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override Types.Result[]? ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, Types.Result[]? existingValue, bool hasExistingValue, Newtonsoft.Json.JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == Newtonsoft.Json.JsonToken.Null)
|
||||
{
|
||||
return existingValue;
|
||||
}
|
||||
else if (reader.TokenType == Newtonsoft.Json.JsonToken.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
var tmpList = new List<Types.Result>();
|
||||
|
||||
while (reader.TokenType != Newtonsoft.Json.JsonToken.EndArray)
|
||||
{
|
||||
if (reader.TokenType == Newtonsoft.Json.JsonToken.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
int offset = 0;
|
||||
var tmpItem = new Types.Result();
|
||||
|
||||
while (reader.TokenType != Newtonsoft.Json.JsonToken.EndArray)
|
||||
{
|
||||
if (offset == 0)
|
||||
{
|
||||
tmpItem.Sentiment = serializer.Deserialize<string>(reader)!;
|
||||
}
|
||||
else if (offset == 1)
|
||||
{
|
||||
tmpItem.Score = serializer.Deserialize<double>(reader);
|
||||
}
|
||||
|
||||
offset++;
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
tmpList.Add(tmpItem);
|
||||
}
|
||||
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
return tmpList.ToArray();
|
||||
}
|
||||
|
||||
throw new Newtonsoft.Json.JsonReaderException();
|
||||
}
|
||||
|
||||
public override void WriteJson(Newtonsoft.Json.JsonWriter writer, Types.Result[]? value, Newtonsoft.Json.JsonSerializer serializer)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
|
||||
foreach (var item in value)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
writer.WriteValue(item.Sentiment);
|
||||
writer.WriteValue(item.Score);
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteNull();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class ResponsePropertyResultArraySystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter<Types.Result[]?>
|
||||
{
|
||||
public override Types.Result[]? Read(ref System.Text.Json.Utf8JsonReader reader, Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType == System.Text.Json.JsonTokenType.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (reader.TokenType == System.Text.Json.JsonTokenType.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
var tmpList = new List<Types.Result>();
|
||||
var tmpOptions = new System.Text.Json.JsonSerializerOptions(options);
|
||||
|
||||
while (reader.TokenType != System.Text.Json.JsonTokenType.EndArray)
|
||||
{
|
||||
if (reader.TokenType == System.Text.Json.JsonTokenType.StartArray)
|
||||
{
|
||||
reader.Read();
|
||||
|
||||
int offset = 0;
|
||||
var tmpItem = new Types.Result();
|
||||
|
||||
while (reader.TokenType != System.Text.Json.JsonTokenType.EndArray)
|
||||
{
|
||||
if (offset == 0)
|
||||
{
|
||||
tmpItem.Sentiment = System.Text.Json.JsonSerializer.Deserialize<string>(ref reader, tmpOptions)!;
|
||||
}
|
||||
else if (offset == 1)
|
||||
{
|
||||
tmpItem.Score = System.Text.Json.JsonSerializer.Deserialize<double>(ref reader, tmpOptions);
|
||||
}
|
||||
|
||||
offset++;
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
tmpList.Add(tmpItem);
|
||||
}
|
||||
|
||||
reader.Read();
|
||||
}
|
||||
|
||||
return tmpList.ToArray();
|
||||
}
|
||||
|
||||
throw new System.Text.Json.JsonException();
|
||||
}
|
||||
|
||||
public override void Write(System.Text.Json.Utf8JsonWriter writer, Types.Result[]? value, System.Text.Json.JsonSerializerOptions options)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
|
||||
foreach (var item in value)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
writer.WriteStringValue(item.Sentiment);
|
||||
writer.WriteNumberValue(item.Score);
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteNullValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.ResponsePropertyResultArrayNewtonsoftJsonConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(Converters.ResponsePropertyResultArraySystemTextJsonConverter))]
|
||||
public Types.Result[] ResultList { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/tokenize/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPTokenizeRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置输入文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("q")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("q")]
|
||||
public string QueryString { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,50 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/tokenize/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPTokenizeResponse : WechatOpenAIResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置常规粒度分词结果列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("words")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("words")]
|
||||
public string[] WordList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置常规粒度词性标签列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("POSs")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("POSs")]
|
||||
public int[] POSList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置混合粒度分词结果列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("words_mix")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("words_mix")]
|
||||
public string[] WordMixList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置混合粒度词性标签列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("POSs_mix")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("POSs_mix")]
|
||||
public int[] POSMixList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置短语提取结果列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("entities")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("entities")]
|
||||
public string[] EntityList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置短语类型标签列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("entity_types")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("entity_types")]
|
||||
public int[] EntityTypeList { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/translate_cn2en/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPTranslateChinese2EnglishRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置输入文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("q")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("q")]
|
||||
public string QueryString { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/translate_cn2en/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPTranslateChinese2EnglishResponse : WechatOpenAIResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result")]
|
||||
public string Result { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/translate_en2cn/{TOKEN} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class NLPTranslateEnglish2ChineseRequest : WechatOpenAIRequest, WechatOpenAIRequest.Serialization.IEncryptedUrlEncoded
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置输入文本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("q")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("q")]
|
||||
public string QueryString { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = new Types.Data();
|
||||
}
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /nlp/translate_en2cn/{TOKEN} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class NLPTranslateEnglish2ChineseResponse : WechatOpenAIResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result")]
|
||||
public string Result { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -24,7 +24,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
/// 获取或设置客服接入状态。
|
||||
/// </summary>
|
||||
[XmlElement("kefustate")]
|
||||
public string State { get; set; } = string.Empty;
|
||||
public string KfState { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置有效期(单位:秒)。
|
||||
|
@@ -10,7 +10,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("kefustate")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("kefustate")]
|
||||
public string State { get; set; } = default!;
|
||||
public string KfState { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置人工客服接入状态。
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<xml>
|
||||
<xml>
|
||||
<userid>用户的唯一ID,(通常为用户在微信的openid)</userid>
|
||||
<appid>应用的appid</appid>
|
||||
<content>
|
||||
@@ -6,8 +6,8 @@
|
||||
</content>
|
||||
<event>userEnter</event>
|
||||
<from>0</from>
|
||||
<status>0</status>
|
||||
<channel>渠0</channel>
|
||||
<kfstate>0</kfstate>
|
||||
<channel>0</channel>
|
||||
<assessment>0</assessment>
|
||||
<createtime>1234567890</createtime>
|
||||
</xml>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<xml>
|
||||
<xml>
|
||||
<userid>用户的唯一ID,(通常为用户在微信的openid)</userid>
|
||||
<appid>应用的appid</appid>
|
||||
<event>userQuit</event>
|
||||
<from>0</from>
|
||||
<status>0</status>
|
||||
<channel>渠0</channel>
|
||||
<kfstate>0</kfstate>
|
||||
<channel>0</channel>
|
||||
<assessment>0</assessment>
|
||||
<createtime>1234567890</createtime>
|
||||
</xml>
|
||||
|
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"uid": "xjlsj33lasfaf",
|
||||
"data": {
|
||||
"title": "东北地区今日开启升温之旅 华南西南气温将创新低",
|
||||
"content": "中国天气网讯 预计今天(6日),东南一带的降水将有所收敛,但是仍有助于缓和当地的气象干旱。气温方面,东北地区今天开始将开启升温之旅,而华南、西南一带最低气温还会创新低。随后而来的周末将会是今年晴天范围最大、降水最少的周末,公众可以提前安排户外活动,迎接温暖的阳光。"
|
||||
}
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"preds": {
|
||||
"level1_cls": "天气",
|
||||
"level2_cls": "其他",
|
||||
"level3_cls": "其他"
|
||||
}
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"uid": "xjlsj33lasfaf",
|
||||
"data": {
|
||||
"query": "你好吗"
|
||||
}
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"question": "你还好吗",
|
||||
"score": 0.9911637194339746,
|
||||
"source": "generation"
|
||||
},
|
||||
{
|
||||
"question": "你怎么样",
|
||||
"score": 0.8547977341846155,
|
||||
"source": "generation"
|
||||
},
|
||||
{
|
||||
"question": "你怎么样啊",
|
||||
"score": 0.8517300445116354,
|
||||
"source": "generation"
|
||||
}
|
||||
],
|
||||
"costime": 1394
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"uid": "xjlsj33lasfaf",
|
||||
"data": {
|
||||
"q": "帮我订两张后天上午的火车票"
|
||||
}
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"result": [
|
||||
{
|
||||
"type": "number",
|
||||
"span": [3, 4],
|
||||
"text": "两",
|
||||
"norm": "2"
|
||||
},
|
||||
{
|
||||
"type": "datetime_interval",
|
||||
"span": [5, 9],
|
||||
"text": "后天上午",
|
||||
"norm": "2019-10-30 08:00:00~2019-10-30 11:59:59"
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"uid": "xjlsj33lasfaf",
|
||||
"data": {
|
||||
"title": "大标题: 周杰伦透露孩子性格像自己",
|
||||
"content": "自侃:在家地位不高周杰伦晒与儿子\\r\\n周杰伦与妻子昆凌\\r\\n新浪娱乐讯据台湾媒体报道,周杰伦今受邀出席公益篮球活动,许久没公开亮相的他坦言:“大家看我的社交网站就知道,现在玩乐和陪家人是最重要的。”他预计10月将启动全新巡演,但聊到新专辑,他笑说:“目前已经做好5首,但包括上次做好的2首。”进度严重落后,巡演前能否来得及推出仍是未知数。\r\\n周杰伦曾被“老萧”萧敬腾与五月天阿信调侃:“巴黎铁塔好像是他家一样”,周杰伦也坦言有考虑在法国置产,地点属意:“有巴黎铁塔蛮重要的”,他感叹身处欧洲比较可以自由自在走在街上,就算被粉丝认出,打个招呼就滑着滑板溜走,不用跑得太狼狈。\\r\\n今天他与小朋友共享篮球时光,但聊到自己的一双儿女,他说:“小朋友个性像自己,比较顽固一点,小朋友都是这样、比较讲不听,严格来说我扮黑脸也是没什么用,在家里地位不是很高。”他形容女儿就像自己“另个女朋友”,有时候想和她和好还被拒绝,一直被闹别扭,周杰伦无奈说:“我还不知道怎么对待一个女儿。”倒是儿子比较怕他,只要一出声就会低头认错,“像他会画在桌子上,家里很多画,就会教他看画手要放在后面,不要摸”严父模样只有儿子会买单。\\r\\n阿信曾夸周杰伦是“华人音乐圈精神领袖”,周杰伦赞阿信是“心目中真正的音乐人”,曾邀阿信到家中作客,2人畅谈音乐,阿信还精辟分析他专辑,“发现他是实际有在听我歌曲的人”,但问到每次打球都只邀萧敬腾,周杰伦笑说有透过社交网站约阿信打球,每次却只被回表情符号,忍不住说:“他说他以前打曲棍球,我是不太相信的。”\\r\\n周杰伦将于10月启动全新巡演,谈到近期的困扰,就是还没想到一个很威的名字,“想不到比‘地表最强’更好的,但这次跟(出道)20年有关,会比较欢乐,不是走自己多强势的感觉”。\\r\\n(责编:漠er凡)\\r\\n",
|
||||
"category": "娱乐",
|
||||
"do_news_classify": true
|
||||
}
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"abstraction": "新浪娱乐讯据台湾媒体报道,周杰伦今受邀出席公益篮球活动,许久没公开亮相的他坦言:“大家看我的社交网站就知道,现在玩乐和陪家人是最重要的。”他预计10月将启动全新巡演,但聊到新专辑,他笑说:“目前已经做好5首,但包括上次做好的2首。”进度严重落后,巡演前能否来得及推出仍是未知数。",
|
||||
"classification": true,
|
||||
"prob": 0.999969363213
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"uid": "xjlsj33lasfaf",
|
||||
"data": {
|
||||
"query": "北京到上海的火车票",
|
||||
"candidates": [
|
||||
{ "text": "上海到北京的火车票" },
|
||||
{ "text": "北京到上海的飞机票" },
|
||||
{ "text": "北京到上海的高铁票" }
|
||||
]
|
||||
}
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"question": "北京到上海的高铁票",
|
||||
"score": 0.9875847458814624
|
||||
},
|
||||
{
|
||||
"question": "北京到上海的飞机票",
|
||||
"score": 0.9707289708500416
|
||||
},
|
||||
{
|
||||
"question": "上海到北京的火车票",
|
||||
"score": 0.9169014875286918
|
||||
}
|
||||
],
|
||||
"exact_match": false
|
||||
}
|
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"uid": "xjlsj33lasfaf",
|
||||
"data": {}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"results": [
|
||||
"在微信H5支付中,如何在服务端判断支付成功?",
|
||||
"交易资金与结算资金不一致",
|
||||
"修改结算账户",
|
||||
"数据查看",
|
||||
"微信支付商户自查违规指引"
|
||||
]
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"uid": "xjlsj33lasfaf",
|
||||
"data": {
|
||||
"q": "楼主真垃圾,祝你早日死全家",
|
||||
"model": "cnnn"
|
||||
}
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"result": [
|
||||
["dirty_curse", 0.9999999900000001],
|
||||
["other", 9.9999999e-9],
|
||||
["dirty_politics", 0.0],
|
||||
["dirty_porno", 0.0]
|
||||
]
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"uid": "xjlsj33lasfaf",
|
||||
"data": {
|
||||
"q": "恭喜小张脱单成功",
|
||||
"mode": "3class"
|
||||
}
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"result": [
|
||||
["正面", 0.9593541622161865],
|
||||
["无情感", 0.0400625541806221],
|
||||
["负面", 0.000583284127060324]
|
||||
]
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"uid": "xjlsj33lasfaf",
|
||||
"data": {
|
||||
"q": "在微信智言与微信智聆两大技术的支持下,微信AI团队推出了“微信对话开放平台”和“腾讯小微”智能硬件两大核心产品。微信支付团队最新发布的“微信青蛙Pro”在现场设置了体验区,让大家感受AI认脸的本事。"
|
||||
}
|
||||
}
|
@@ -1,151 +0,0 @@
|
||||
{
|
||||
"words": [
|
||||
"在",
|
||||
"微信",
|
||||
"智",
|
||||
"言",
|
||||
"与",
|
||||
"微信",
|
||||
"智",
|
||||
"聆",
|
||||
"两",
|
||||
"大",
|
||||
"技术",
|
||||
"的",
|
||||
"支持",
|
||||
"下",
|
||||
",",
|
||||
"微信",
|
||||
"ai",
|
||||
"团队",
|
||||
"推出",
|
||||
"了",
|
||||
"“",
|
||||
"微信",
|
||||
"对话",
|
||||
"开放",
|
||||
"平台",
|
||||
"”",
|
||||
"和",
|
||||
"“",
|
||||
"腾讯",
|
||||
"小",
|
||||
"微",
|
||||
"”",
|
||||
"智能",
|
||||
"硬件",
|
||||
"两",
|
||||
"大",
|
||||
"核心",
|
||||
"产品",
|
||||
"。",
|
||||
"微信",
|
||||
"支付",
|
||||
"团队",
|
||||
"最新",
|
||||
"发布",
|
||||
"的",
|
||||
"“",
|
||||
"微信",
|
||||
"青蛙",
|
||||
"pro",
|
||||
"”",
|
||||
"在",
|
||||
"现场",
|
||||
"设置",
|
||||
"了",
|
||||
"体验",
|
||||
"区",
|
||||
",",
|
||||
"让",
|
||||
"大家",
|
||||
"感受",
|
||||
"ai",
|
||||
"认",
|
||||
"脸",
|
||||
"的",
|
||||
"本事",
|
||||
"。"
|
||||
],
|
||||
"POSs": [
|
||||
25, 16, 16, 46, 25, 16, 16, 46, 15, 1, 16, 30, 33, 8, 34, 31, 23, 16,
|
||||
31, 36, 34, 16, 33, 33, 16, 34, 5, 34, 6, 1, 38, 34, 16, 16, 15, 1, 16,
|
||||
16, 34, 6, 31, 16, 1, 31, 30, 34, 31, 16, 23, 34, 25, 28, 31, 30, 33,
|
||||
16, 34, 31, 27, 31, 23, 31, 16, 30, 16, 34
|
||||
],
|
||||
"words_mix": [
|
||||
"在",
|
||||
"微信",
|
||||
"智",
|
||||
"言",
|
||||
"与",
|
||||
"微信",
|
||||
"智",
|
||||
"聆",
|
||||
"两",
|
||||
"大",
|
||||
"技术",
|
||||
"的",
|
||||
"支持",
|
||||
"下",
|
||||
",",
|
||||
"微信",
|
||||
"ai",
|
||||
"团队",
|
||||
"推出",
|
||||
"了",
|
||||
"“",
|
||||
"微信",
|
||||
"对话",
|
||||
"开放",
|
||||
"平台",
|
||||
"”",
|
||||
"和",
|
||||
"“",
|
||||
"腾讯",
|
||||
"小微",
|
||||
"”",
|
||||
"智能",
|
||||
"硬件",
|
||||
"两",
|
||||
"大",
|
||||
"核心",
|
||||
"产品",
|
||||
"。",
|
||||
"微信",
|
||||
"支付",
|
||||
"团队",
|
||||
"最新",
|
||||
"发布",
|
||||
"的",
|
||||
"“",
|
||||
"微信",
|
||||
"青蛙",
|
||||
"pro",
|
||||
"”",
|
||||
"在",
|
||||
"现场",
|
||||
"设置",
|
||||
"了",
|
||||
"体验",
|
||||
"区",
|
||||
",",
|
||||
"让",
|
||||
"大家",
|
||||
"感受",
|
||||
"ai",
|
||||
"认",
|
||||
"脸",
|
||||
"的",
|
||||
"本事",
|
||||
"。"
|
||||
],
|
||||
"POSs_mix": [
|
||||
25, 16, 16, 46, 25, 16, 16, 46, 15, 1, 16, 30, 33, 8, 34, 31, 23, 16,
|
||||
31, 36, 34, 16, 33, 33, 16, 34, 5, 34, 6, 16, 34, 16, 16, 15, 1, 16, 16,
|
||||
34, 6, 31, 16, 1, 31, 30, 34, 31, 16, 23, 34, 25, 28, 31, 30, 33, 16,
|
||||
34, 31, 27, 31, 23, 31, 16, 30, 16, 34
|
||||
],
|
||||
"entities": ["腾讯", "小微", "最新发布"],
|
||||
"entity_types": [100000013, 0, 0]
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"uid": "xjlsj33lasfaf",
|
||||
"data": {
|
||||
"q": "北京的天气怎么样?"
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"result": "What about the weather in Beijing?"
|
||||
}
|
Reference in New Issue
Block a user