feat: 新增openai对接接口
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Yi.Framework.ChatHub.Domain.Shared.Enums
|
||||
public enum MessageTypeEnum
|
||||
{
|
||||
|
||||
|
||||
Ai,
|
||||
Personal,
|
||||
Group,
|
||||
All
|
||||
|
||||
@@ -41,6 +41,12 @@ namespace Yi.Framework.ChatHub.Domain.Shared.Model
|
||||
return new MessageContext() { MessageType = MessageTypeEnum.Personal, Content = content, ReceiveId = userId, SendUserId = sendUserId };
|
||||
}
|
||||
|
||||
|
||||
public static MessageContext CreateAi(string content, Guid receiveId)
|
||||
{
|
||||
return new MessageContext() { MessageType = MessageTypeEnum.Ai, Content = content, ReceiveId = receiveId };
|
||||
}
|
||||
|
||||
public static MessageContext CreateAll(string content, Guid sendUserId)
|
||||
{
|
||||
return new MessageContext() { MessageType = MessageTypeEnum.All, Content = content, SendUserId = sendUserId };
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Yi.Framework.ChatHub.Domain.Shared.Options
|
||||
{
|
||||
public class AiOptions
|
||||
{
|
||||
public string ApiKey { get; set; }
|
||||
public string BaseDomain { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,20 @@
|
||||
using Volo.Abp.Domain;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Volo.Abp.Domain;
|
||||
using Yi.Framework.Bbs.Domain.Shared;
|
||||
using Yi.Framework.ChatHub.Domain.Shared.Options;
|
||||
|
||||
namespace Yi.Framework.ChatHub.Domain.Shared
|
||||
{
|
||||
[DependsOn(
|
||||
typeof(AbpDddDomainSharedModule),
|
||||
|
||||
|
||||
typeof(YiFrameworkBbsDomainSharedModule))]
|
||||
public class YiFrameworkChatHubDomainSharedModule : AbpModule
|
||||
{
|
||||
|
||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
||||
{
|
||||
var configuration = context.Services.GetConfiguration();
|
||||
Configure<AiOptions>(configuration.GetSection("AiOptions"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user