feat(openai): 新增 v2 版机器人配置相关接口

This commit is contained in:
Fu Diwei
2024-06-05 17:49:28 +08:00
parent a92a602a71
commit ea25c0bf24
25 changed files with 546 additions and 19 deletions

View File

@@ -0,0 +1,3 @@
{
"task_id": "fad7576d7562429d9c5d8568dc35a41b"
}

View File

@@ -0,0 +1,28 @@
{
"code": 0,
"data": {
"end": 1711088874,
"fail_count": 0,
"fail_skill_info": null,
"progress": 100,
"start": 1711088873,
"state": 2,
"success_count": 1,
"success_skill_info": [
{
"id": 2098207,
"intents": [
{
"id": 47147532,
"name": "BBC"
}
],
"name": "AAA"
}
],
"total_count": 1,
"url": ""
},
"msg": "success",
"request_id": "test123"
}

View File

@@ -0,0 +1,10 @@
{
"code": 0,
"data": {
"end_time": "",
"progress": 100,
"status": 1
},
"msg": "success",
"request_id": "7df42cb2-e776-40ac-b0c4-8542aad2b0ec"
}

View File

@@ -0,0 +1,18 @@
{
"mode": 0,
"data": [
{
"skill": "AAA",
"intent": "BBC",
"threshold": "0.9",
"disable": true,
"questions": [
"q",
"q2"
],
"answers": [
"a"
]
}
]
}

View File

@@ -0,0 +1,8 @@
{
"code": 0,
"data": {
"task_id": "179ba14fae5f4028b7c00a180cf709e3"
},
"msg": "",
"request_id": "test123"
}

View File

@@ -8,7 +8,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
[Fact(DisplayName = "测试用例:调用 API [POST] /v2/token")]
public async Task TestExecuteTokenV2()
{
var request = new Models.TokenV2Request() { Account = "TEST_ACCOUNTID" };
var request = new Models.TokenV2Request() { AccountId = TestConfigs.WechatAccountId };
var response = await TestClients.OpenAIInstance.ExecuteTokenV2Async(request);
Assert.NotNull(response.Data?.AccessToken);

View File

@@ -21,6 +21,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
WechatAppId = config.GetProperty("AppId").GetString()!;
WechatToken = config.GetProperty("Token").GetString()!;
WechatEncodingAESKey = config.GetProperty("EncodingAESKey").GetString()!;
WechatAccountId = config.GetProperty("AccountId").GetString()!;
WechatAccessToken = config.GetProperty("AccessToken").GetString()!;
}
catch (Exception ex)
@@ -32,6 +33,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
public static readonly string WechatAppId;
public static readonly string WechatToken;
public static readonly string WechatEncodingAESKey;
public static readonly string WechatAccountId;
public static readonly string WechatAccessToken;
}
}

View File

@@ -3,6 +3,7 @@
"AppId": "请在此填写用于测试的微信智能对话 AppId",
"Token": "请在此填写用于测试的微信智能对话 Token",
"EncodingAESKey": "请在此填写用于测试的微信智能对话 EncodingAESKey",
"AccountId": "请在此填写用于测试的微信智能对话管理员账号 ID",
"AccessToken": "请在此填写用于测试的微信智能对话 AccessToken"
}
}