feat(openai): 重命名 "WechatOpenAI" → "WechatChatbot"

This commit is contained in:
Fu Diwei
2024-06-04 19:56:01 +08:00
parent 7909b8615b
commit ad9b5a1641
82 changed files with 143 additions and 194 deletions

View File

@@ -19,11 +19,15 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
{
var options = new TypeDeclarationAnalyzerOptions()
{
SdkAssembly = Assembly.GetAssembly(typeof(WechatOpenAIClient))!,
SdkAssembly = Assembly.GetAssembly(typeof(WechatChatbotClient))!,
SdkRequestModelDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.OpenAI.Models",
SdkResponseModelDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.OpenAI.Models",
SdkExecutingExtensionDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.OpenAI",
SdkWebhookEventDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.OpenAI.Events",
IgnoreRequestModelTypes = (type) => !typeof(WechatChatbotRequest).IsAssignableFrom(type),
IgnoreResponseModelTypes = (type) => !typeof(WechatChatbotResponse).IsAssignableFrom(type),
IgnoreExecutingExtensionTypes = (type) => !type.Name.StartsWith(nameof(WechatChatbotClient)),
IgnoreWebhookEventTypes = (type) => !typeof(WechatChatbotEvent).IsAssignableFrom(type),
ThrowOnNotFoundRequestModelTypes = true,
ThrowOnNotFoundResponseModelTypes = true,
ThrowOnNotFoundExecutingExtensionTypes = true,
@@ -39,12 +43,18 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
var options = new SourceFileAnalyzerOptions()
{
SdkAssembly = Assembly.GetAssembly(typeof(WechatOpenAIClient))!,
SdkAssembly = Assembly.GetAssembly(typeof(WechatChatbotClient))!,
SdkRequestModelDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.OpenAI.Models",
SdkResponseModelDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.OpenAI.Models",
SdkWebhookEventDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.OpenAI.Events",
ProjectSourceRootDirectory = Path.Combine(projdir, "./src/SKIT.FlurlHttpClient.Wechat.OpenAI/"),
ProjectTestRootDirectory = Path.Combine(projdir, "./test/SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests/"),
ProjectSourceRequestModelClassCodeSubDirectory = "Models/Chatbot/",
ProjectSourceResponseModelClassCodeSubDirectory = "Models/Chatbot/",
ProjectSourceWebhookEventClassCodeSubDirectory = "Events/Chatbot/",
ProjectTestRequestModelSerializationSampleSubDirectory = "ModelSamples/Chatbot/",
ProjectTestResponseModelSerializationSampleSubDirectory = "ModelSamples/Chatbot/",
ProjectTestWebhookEventSerializationSampleSubDirectory = "EventSamples/Chatbot/",
ThrowOnNotFoundRequestModelClassCodeFiles = true,
ThrowOnNotFoundResponseModelClassCodeFiles = true,
ThrowOnNotFoundExecutingExtensionClassCodeFiles = true,

View File

@@ -1,17 +0,0 @@
using System.Threading.Tasks;
using Xunit;
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
{
public class TestCase_ApiExecuteMpTests
{
[Fact(DisplayName = "测试用例:调用 API [POST] /getbindlink/{TOKEN}")]
public async Task TestExecuteSign()
{
var request = new Models.GetBindLinkRequest() { RedirectUrl = "https://example.com" };
var response = await TestClients.Instance.ExecuteGetBindLinkAsync(request);
Assert.NotNull(response.LinkUrl);
}
}
}

View File

@@ -1,5 +1,3 @@
using System;
using System.Text;
using Xunit;
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests

View File

@@ -4,7 +4,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
{
static TestClients()
{
Instance = new WechatOpenAIClient(new WechatOpenAIClientOptions()
Instance = new WechatChatbotClient(new WechatChatbotClientOptions()
{
AppId = TestConfigs.WechatAppId,
Token = TestConfigs.WechatToken,
@@ -12,6 +12,6 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
});
}
public static readonly WechatOpenAIClient Instance;
public static readonly WechatChatbotClient Instance;
}
}