mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 01:58:14 +08:00
feat(openai): 新增 v2 版机器人对话相关接口
This commit is contained in:
@@ -12,23 +12,6 @@
|
||||
"intent_confirm_status": "",
|
||||
"is_default_answer": false,
|
||||
"list_options": false,
|
||||
"msg": [
|
||||
{
|
||||
"ans_node_id": 17130001,
|
||||
"ans_node_name": "猜拳",
|
||||
"confidence": 1,
|
||||
"content": "2",
|
||||
"debug_info": "",
|
||||
"event": "",
|
||||
"list_options": false,
|
||||
"msg_type": "text",
|
||||
"resp_title": "开始猜拳",
|
||||
"scene_status": "",
|
||||
"session_id": "",
|
||||
"status": "FAQ",
|
||||
"take_options_only": false
|
||||
}
|
||||
],
|
||||
"msg_id": "31904d53",
|
||||
"ret": 0,
|
||||
"scene_status": "",
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"query": "我叫我妈妈的姐姐叫什么?",
|
||||
"env": "online",
|
||||
"first_priority_skills": [],
|
||||
"second_priority_skills": [],
|
||||
"user_name": "测试用户名",
|
||||
"avatar": "https://example.com/img/avatar.png",
|
||||
"userid": "123"
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"code": 0,
|
||||
"data": {
|
||||
"answer": "姨妈",
|
||||
"answer_type": "text",
|
||||
"intent_name": "亲戚关系问询",
|
||||
"msg_id": "212140c2-b358-4d72-8049-cd4f9053fcc7",
|
||||
"options": null,
|
||||
"skill_name": "亲戚关系",
|
||||
"slots": [
|
||||
{
|
||||
"name": "亲戚称呼1",
|
||||
"norm": "妈妈",
|
||||
"value": "妈妈"
|
||||
},
|
||||
{
|
||||
"name": "亲戚称呼2",
|
||||
"norm": "姐姐",
|
||||
"value": "姐姐"
|
||||
}
|
||||
],
|
||||
"status": "GENERAL_FAQ"
|
||||
},
|
||||
"msg": "success",
|
||||
"request_id": "212140c2-b358-4d72-8049-cd4f9053fcc7"
|
||||
}
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@@ -11,7 +11,8 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
|
||||
var request = new Models.TokenV2Request() { AccountId = TestConfigs.WechatAccountId };
|
||||
var response = await TestClients.OpenAIInstance.ExecuteTokenV2Async(request);
|
||||
|
||||
Assert.NotNull(response.Data?.AccessToken);
|
||||
Assert.NotNull(response.Data);
|
||||
Assert.NotNull(response.Data.AccessToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user