diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceConsts.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionRecordConsts.cs similarity index 92% rename from aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceConsts.cs rename to aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionRecordConsts.cs index c1dc19dc7..f8a2e6bd1 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceConsts.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionRecordConsts.cs @@ -1,5 +1,5 @@ namespace LINGYUN.Abp.AIManagement.Workspaces; -public static class WorkspaceConsts +public static class WorkspaceDefinitionRecordConsts { public static int MaxNameLength { get; set; } = 64; public static int MaxProviderLength { get; set; } = 20; diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStore.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStore.cs index 6c7225b8f..4550973af 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStore.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStore.cs @@ -16,7 +16,7 @@ namespace LINGYUN.Abp.AIManagement.Workspaces; [Dependency(ReplaceServices = true)] public class DynamicWorkspaceDefinitionStore : IDynamicWorkspaceDefinitionStore, ITransientDependency { - protected IWorkspaceRepository WorkspaceRepository { get; } + protected IWorkspaceDefinitionRecordRepository WorkspaceDefinitionRecordRepository { get; } protected IWorkspaceDefinitionSerializer WorkspaceDefinitionSerializer { get; } protected IDynamicWorkspaceDefinitionStoreInMemoryCache StoreCache { get; } protected IDistributedCache DistributedCache { get; } @@ -25,7 +25,7 @@ public class DynamicWorkspaceDefinitionStore : IDynamicWorkspaceDefinitionStore, protected AbpDistributedCacheOptions CacheOptions { get; } public DynamicWorkspaceDefinitionStore( - IWorkspaceRepository workspaceRepository, + IWorkspaceDefinitionRecordRepository workspaceRepository, IWorkspaceDefinitionSerializer workspaceDefinitionSerializer, IDynamicWorkspaceDefinitionStoreInMemoryCache storeCache, IDistributedCache distributedCache, @@ -33,7 +33,7 @@ public class DynamicWorkspaceDefinitionStore : IDynamicWorkspaceDefinitionStore, IOptions aiManagementOptions, IAbpDistributedLock distributedLock) { - WorkspaceRepository = workspaceRepository; + WorkspaceDefinitionRecordRepository = workspaceRepository; WorkspaceDefinitionSerializer = workspaceDefinitionSerializer; StoreCache = storeCache; DistributedCache = distributedCache; @@ -103,7 +103,7 @@ public class DynamicWorkspaceDefinitionStore : IDynamicWorkspaceDefinitionStore, protected virtual async Task UpdateInMemoryStoreCache() { - var workspaces = await WorkspaceRepository.GetListAsync(); + var workspaces = await WorkspaceDefinitionRecordRepository.GetListAsync(); await StoreCache.FillAsync(workspaces); } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStoreInMemoryCache.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStoreInMemoryCache.cs index 43314dfed..478ededa9 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStoreInMemoryCache.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStoreInMemoryCache.cs @@ -30,7 +30,7 @@ public class DynamicWorkspaceDefinitionStoreInMemoryCache : IDynamicWorkspaceDef WorkspaceDefinitions = new Dictionary(); } - public Task FillAsync(List workspaces) + public Task FillAsync(List workspaces) { WorkspaceDefinitions.Clear(); diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IDynamicWorkspaceDefinitionStoreInMemoryCache.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IDynamicWorkspaceDefinitionStoreInMemoryCache.cs index c2d2a4b12..ec3c6b82b 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IDynamicWorkspaceDefinitionStoreInMemoryCache.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IDynamicWorkspaceDefinitionStoreInMemoryCache.cs @@ -14,7 +14,7 @@ public interface IDynamicWorkspaceDefinitionStoreInMemoryCache DateTime? LastCheckTime { get; set; } - Task FillAsync(List permissions); + Task FillAsync(List permissions); WorkspaceDefinition? GetWorkspaceOrNull(string name); diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IWorkspaceRepository.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IWorkspaceDefinitionRecordRepository.cs similarity index 59% rename from aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IWorkspaceRepository.cs rename to aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IWorkspaceDefinitionRecordRepository.cs index db729e5a5..e4b566cee 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IWorkspaceRepository.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IWorkspaceDefinitionRecordRepository.cs @@ -4,9 +4,9 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; namespace LINGYUN.Abp.AIManagement.Workspaces; -public interface IWorkspaceRepository : IBasicRepository +public interface IWorkspaceDefinitionRecordRepository : IBasicRepository { - Task FindByNameAsync( + Task FindByNameAsync( string name, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IWorkspaceDefinitionSerializer.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IWorkspaceDefinitionSerializer.cs index fd1106fcd..f2e186875 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IWorkspaceDefinitionSerializer.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IWorkspaceDefinitionSerializer.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; namespace LINGYUN.Abp.AIManagement.Workspaces; public interface IWorkspaceDefinitionSerializer { - Task SerializeAsync(IEnumerable definitions); + Task SerializeAsync(IEnumerable definitions); - Task SerializeAsync(WorkspaceDefinition definition); + Task SerializeAsync(WorkspaceDefinition definition); } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/StaticWorkspaceSaver.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/StaticWorkspaceSaver.cs index df306125c..255d65e41 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/StaticWorkspaceSaver.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/StaticWorkspaceSaver.cs @@ -22,7 +22,7 @@ namespace LINGYUN.Abp.AIManagement.Workspaces; public class StaticWorkspaceSaver : IStaticWorkspaceSaver, ITransientDependency { protected IStaticWorkspaceDefinitionStore StaticStore { get; } - protected IWorkspaceRepository WorkspaceRepository { get; } + protected IWorkspaceDefinitionRecordRepository WorkspaceRepository { get; } protected IWorkspaceDefinitionSerializer WorkspaceSerializer { get; } protected IDistributedCache Cache { get; } protected IApplicationInfoAccessor ApplicationInfoAccessor { get; } @@ -35,7 +35,7 @@ public class StaticWorkspaceSaver : IStaticWorkspaceSaver, ITransientDependency public StaticWorkspaceSaver( IStaticWorkspaceDefinitionStore staticStore, - IWorkspaceRepository workspaceRepository, + IWorkspaceDefinitionRecordRepository workspaceRepository, IWorkspaceDefinitionSerializer workspaceSerializer, IDistributedCache cache, IOptions cacheOptions, @@ -140,10 +140,10 @@ public class StaticWorkspaceSaver : IStaticWorkspaceSaver, ITransientDependency ); } - private async Task UpdateChangedWorkspacesAsync(Workspace[] workspaces) + private async Task UpdateChangedWorkspacesAsync(WorkspaceDefinitionRecord[] workspaces) { - var newRecords = new List(); - var changedRecords = new List(); + var newRecords = new List(); + var changedRecords = new List(); var workspaceRecordsInDatabase = (await WorkspaceRepository.GetListAsync()).ToDictionary(x => x.Name); @@ -169,7 +169,7 @@ public class StaticWorkspaceSaver : IStaticWorkspaceSaver, ITransientDependency } /* Deleted */ - var deletedRecords = new List(); + var deletedRecords = new List(); if (AIOptions.DeletedWorkspaces.Any()) { @@ -214,7 +214,7 @@ public class StaticWorkspaceSaver : IStaticWorkspaceSaver, ITransientDependency return $"{CacheOptions.KeyPrefix}_AbpInMemoryWorkspaceCacheStamp"; } - private string CalculateHash(Workspace[] workspaces, IEnumerable deletedWorkspaces) + private string CalculateHash(WorkspaceDefinitionRecord[] workspaces, IEnumerable deletedWorkspaces) { var jsonSerializerOptions = new JsonSerializerOptions { @@ -222,7 +222,7 @@ public class StaticWorkspaceSaver : IStaticWorkspaceSaver, ITransientDependency { Modifiers = { - new AbpIgnorePropertiesModifiers().CreateModifyAction(x => x.Id), + new AbpIgnorePropertiesModifiers().CreateModifyAction(x => x.Id), } } }; diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/Workspace.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionRecord.cs similarity index 86% rename from aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/Workspace.cs rename to aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionRecord.cs index bb09b2f0f..1e75cba0b 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/Workspace.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionRecord.cs @@ -4,7 +4,7 @@ using Volo.Abp.Data; using Volo.Abp.Domain.Entities.Auditing; namespace LINGYUN.Abp.AIManagement.Workspaces; -public class Workspace : AuditedAggregateRoot +public class WorkspaceDefinitionRecord : AuditedAggregateRoot { public string Name { get; private set; } @@ -36,13 +36,13 @@ public class Workspace : AuditedAggregateRoot public string? StateCheckers { get; set; } - protected Workspace() + protected WorkspaceDefinitionRecord() { ExtraProperties = new ExtraPropertyDictionary(); this.SetDefaultsForExtraProperties(); } - public Workspace( + public WorkspaceDefinitionRecord( Guid id, string name, string provider, @@ -60,16 +60,16 @@ public class Workspace : AuditedAggregateRoot string? stateCheckers = null) : base(id) { - Name = Check.NotNullOrWhiteSpace(name, nameof(name), WorkspaceConsts.MaxNameLength); - Provider = Check.NotNullOrWhiteSpace(provider, nameof(provider), WorkspaceConsts.MaxProviderLength); - ModelName = Check.NotNullOrWhiteSpace(modelName, nameof(modelName), WorkspaceConsts.MaxModelNameLength); - DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), WorkspaceConsts.MaxDisplayNameLength); - Description = Check.Length(description, nameof(description), WorkspaceConsts.MaxDescriptionLength); - ApiKey = Check.Length(apiKey, nameof(apiKey), WorkspaceConsts.MaxApiKeyLength); - ApiBaseUrl = Check.Length(apiBaseUrl, nameof(apiBaseUrl), WorkspaceConsts.MaxApiBaseUrlLength); - SystemPrompt = Check.Length(systemPrompt, nameof(systemPrompt), WorkspaceConsts.MaxSystemPromptLength); - Instructions = Check.Length(instructions, nameof(instructions), WorkspaceConsts.MaxInstructionsLength); - StateCheckers = Check.Length(stateCheckers, nameof(stateCheckers), WorkspaceConsts.MaxStateCheckersLength); + Name = Check.NotNullOrWhiteSpace(name, nameof(name), WorkspaceDefinitionRecordConsts.MaxNameLength); + Provider = Check.NotNullOrWhiteSpace(provider, nameof(provider), WorkspaceDefinitionRecordConsts.MaxProviderLength); + ModelName = Check.NotNullOrWhiteSpace(modelName, nameof(modelName), WorkspaceDefinitionRecordConsts.MaxModelNameLength); + DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), WorkspaceDefinitionRecordConsts.MaxDisplayNameLength); + Description = Check.Length(description, nameof(description), WorkspaceDefinitionRecordConsts.MaxDescriptionLength); + ApiKey = Check.Length(apiKey, nameof(apiKey), WorkspaceDefinitionRecordConsts.MaxApiKeyLength); + ApiBaseUrl = Check.Length(apiBaseUrl, nameof(apiBaseUrl), WorkspaceDefinitionRecordConsts.MaxApiBaseUrlLength); + SystemPrompt = Check.Length(systemPrompt, nameof(systemPrompt), WorkspaceDefinitionRecordConsts.MaxSystemPromptLength); + Instructions = Check.Length(instructions, nameof(instructions), WorkspaceDefinitionRecordConsts.MaxInstructionsLength); + StateCheckers = Check.Length(stateCheckers, nameof(stateCheckers), WorkspaceDefinitionRecordConsts.MaxStateCheckersLength); Temperature = temperature; MaxOutputTokens = maxOutputTokens; FrequencyPenalty = frequencyPenalty; @@ -80,7 +80,7 @@ public class Workspace : AuditedAggregateRoot this.SetDefaultsForExtraProperties(); } - public bool HasSameData(Workspace otherWorkspace) + public bool HasSameData(WorkspaceDefinitionRecord otherWorkspace) { if (Name != otherWorkspace.Name) { @@ -165,7 +165,7 @@ public class Workspace : AuditedAggregateRoot return true; } - public void Patch(Workspace otherWorkspace) + public void Patch(WorkspaceDefinitionRecord otherWorkspace) { if (Name != otherWorkspace.Name) { diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionSerializer.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionSerializer.cs index 351ffa6ca..3c69f73fd 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionSerializer.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionSerializer.cs @@ -25,9 +25,9 @@ public class WorkspaceDefinitionSerializer : IWorkspaceDefinitionSerializer, ITr LocalizableStringSerializer = localizableStringSerializer; } - public async virtual Task SerializeAsync(IEnumerable definitions) + public async virtual Task SerializeAsync(IEnumerable definitions) { - var records = new List(); + var records = new List(); foreach (var workspaceDef in definitions) { records.Add(await SerializeAsync(workspaceDef)); @@ -36,11 +36,11 @@ public class WorkspaceDefinitionSerializer : IWorkspaceDefinitionSerializer, ITr return records.ToArray(); } - public virtual Task SerializeAsync(WorkspaceDefinition definition) + public virtual Task SerializeAsync(WorkspaceDefinition definition) { using (CultureHelper.Use(CultureInfo.InvariantCulture)) { - var workspace = new Workspace( + var workspace = new WorkspaceDefinitionRecord( GuidGenerator.Create(), definition.Name, definition.Provider, diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AIManagementDbContext.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AIManagementDbContext.cs index 823e7cc71..790174fb2 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AIManagementDbContext.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AIManagementDbContext.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.AIManagement.EntityFrameworkCore; [ConnectionStringName(AbpAIManagementDbProperties.ConnectionStringName)] public class AIManagementDbContext : AbpDbContext, IAIManagementDbContext { - public DbSet Workspaces { get; set; } + public DbSet Workspaces { get; set; } public AIManagementDbContext( DbContextOptions options) : base(options) { diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AIManagementDbContextModelBuilderExtensions.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AIManagementDbContextModelBuilderExtensions.cs index 8512e2199..7496ce829 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AIManagementDbContextModelBuilderExtensions.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AIManagementDbContextModelBuilderExtensions.cs @@ -17,22 +17,22 @@ public static class AIManagementDbContextModelBuilderExtensions return; } - builder.Entity(b => + builder.Entity(b => { - b.ToTable(AbpAIManagementDbProperties.DbTablePrefix + "Workspaces", AbpAIManagementDbProperties.DbSchema); + b.ToTable(AbpAIManagementDbProperties.DbTablePrefix + "WorkspaceDefinitions", AbpAIManagementDbProperties.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(WorkspaceConsts.MaxNameLength).IsRequired(); - b.Property(x => x.Provider).HasMaxLength(WorkspaceConsts.MaxProviderLength).IsRequired(); - b.Property(x => x.ModelName).HasMaxLength(WorkspaceConsts.MaxModelNameLength).IsRequired(); - b.Property(x => x.DisplayName).HasMaxLength(WorkspaceConsts.MaxDisplayNameLength).IsRequired(); - b.Property(x => x.Description).HasMaxLength(WorkspaceConsts.MaxDescriptionLength); - b.Property(x => x.ApiKey).HasMaxLength(WorkspaceConsts.MaxApiKeyLength); - b.Property(x => x.ApiBaseUrl).HasMaxLength(WorkspaceConsts.MaxApiKeyLength); - b.Property(x => x.SystemPrompt).HasMaxLength(WorkspaceConsts.MaxSystemPromptLength); - b.Property(x => x.Instructions).HasMaxLength(WorkspaceConsts.MaxInstructionsLength); - b.Property(x => x.StateCheckers).HasMaxLength(WorkspaceConsts.MaxStateCheckersLength); + b.Property(x => x.Name).HasMaxLength(WorkspaceDefinitionRecordConsts.MaxNameLength).IsRequired(); + b.Property(x => x.Provider).HasMaxLength(WorkspaceDefinitionRecordConsts.MaxProviderLength).IsRequired(); + b.Property(x => x.ModelName).HasMaxLength(WorkspaceDefinitionRecordConsts.MaxModelNameLength).IsRequired(); + b.Property(x => x.DisplayName).HasMaxLength(WorkspaceDefinitionRecordConsts.MaxDisplayNameLength).IsRequired(); + b.Property(x => x.Description).HasMaxLength(WorkspaceDefinitionRecordConsts.MaxDescriptionLength); + b.Property(x => x.ApiKey).HasMaxLength(WorkspaceDefinitionRecordConsts.MaxApiKeyLength); + b.Property(x => x.ApiBaseUrl).HasMaxLength(WorkspaceDefinitionRecordConsts.MaxApiKeyLength); + b.Property(x => x.SystemPrompt).HasMaxLength(WorkspaceDefinitionRecordConsts.MaxSystemPromptLength); + b.Property(x => x.Instructions).HasMaxLength(WorkspaceDefinitionRecordConsts.MaxInstructionsLength); + b.Property(x => x.StateCheckers).HasMaxLength(WorkspaceDefinitionRecordConsts.MaxStateCheckersLength); b.HasIndex(x => new { x.Name }).IsUnique(); diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AbpAIManagementEntityFrameworkCoreModule.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AbpAIManagementEntityFrameworkCoreModule.cs index 566db1fc1..870cad669 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AbpAIManagementEntityFrameworkCoreModule.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/AbpAIManagementEntityFrameworkCoreModule.cs @@ -16,7 +16,7 @@ public class AbpAIManagementEntityFrameworkCoreModule : AbpModule { options.AddDefaultRepositories(); - options.AddRepository(); + options.AddRepository(); }); } } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/EfCoreWorkspaceRepository.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/EfCoreWorkspaceDefinitionRecordRepository.cs similarity index 64% rename from aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/EfCoreWorkspaceRepository.cs rename to aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/EfCoreWorkspaceDefinitionRecordRepository.cs index c0fcc2cb9..7c0bcd3b5 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/EfCoreWorkspaceRepository.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/EfCoreWorkspaceDefinitionRecordRepository.cs @@ -9,15 +9,15 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; namespace LINGYUN.Abp.AIManagement.EntityFrameworkCore; -public class EfCoreWorkspaceRepository : EfCoreRepository, IWorkspaceRepository +public class EfCoreWorkspaceDefinitionRecordRepository : EfCoreRepository, IWorkspaceDefinitionRecordRepository { - public EfCoreWorkspaceRepository( + public EfCoreWorkspaceDefinitionRecordRepository( IDbContextProvider dbContextProvider) : base(dbContextProvider) { } - public async virtual Task FindByNameAsync(string name, CancellationToken cancellationToken = default) + public async virtual Task FindByNameAsync(string name, CancellationToken cancellationToken = default) { return await (await GetQueryableAsync()) .Where(x => x.Name == name) diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/IAIManagementDbContext.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/IAIManagementDbContext.cs index 234148a27..8a6f5fa6f 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/IAIManagementDbContext.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN/Abp/AIManagement/EntityFrameworkCore/IAIManagementDbContext.cs @@ -8,5 +8,5 @@ namespace LINGYUN.Abp.AIManagement.EntityFrameworkCore; [ConnectionStringName(AbpAIManagementDbProperties.ConnectionStringName)] public interface IAIManagementDbContext : IEfCoreDbContext { - DbSet Workspaces { get; } + DbSet Workspaces { get; } }