mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-20 10:38:10 +08:00
feat(openai): 新增 v2 版机器人对话相关接口
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
|
||||
{
|
||||
public class TestCase_ApiExecuteBotTests
|
||||
{
|
||||
[Fact(DisplayName = "测试用例:调用 API [POST] /v2/bot/query")]
|
||||
public async Task TestExecuteTokenV2()
|
||||
{
|
||||
var request = new Models.BotQueryV2Request()
|
||||
{
|
||||
QueryString = "我叫我妈妈的姐姐叫什么?",
|
||||
Environment = "debug",
|
||||
UserId = "TEST_USERID",
|
||||
UserName = "TEST_USERNAME",
|
||||
AccessToken = TestConfigs.WechatAccessToken
|
||||
};
|
||||
var response = await TestClients.OpenAIInstance.ExecuteBotQueryV2Async(request);
|
||||
|
||||
Assert.NotNull(response.Data);
|
||||
Assert.NotNull(response.Data.MessageId);
|
||||
Assert.NotNull(response.Data.AnswerType);
|
||||
Assert.NotNull(response.Data.Answer);
|
||||
Assert.NotNull(response.Data.Status);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user