10 changed files with 376 additions and 3 deletions
@ -0,0 +1,308 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using LINGYUN.Abp.MicroService.AIService; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.Migrations |
|||
{ |
|||
[DbContext(typeof(AIServiceMigrationsDbContext))] |
|||
[Migration("20260313010418_Add-Workspace-To-Conversation-Record")] |
|||
partial class AddWorkspaceToConversationRecord |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) |
|||
.HasAnnotation("ProductVersion", "10.0.0") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 63); |
|||
|
|||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Chats.ConversationRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("uuid"); |
|||
|
|||
b.Property<DateTime>("CreatedAt") |
|||
.HasColumnType("timestamp with time zone"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("timestamp with time zone") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<DateTime>("ExpiredAt") |
|||
.HasColumnType("timestamp with time zone"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("timestamp with time zone") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(50) |
|||
.HasColumnType("character varying(50)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<DateTime?>("UpdateAt") |
|||
.HasColumnType("timestamp with time zone"); |
|||
|
|||
b.Property<string>("Workspace") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("character varying(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpAIConversations", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Chats.TextChatMessageRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("uuid"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("character varying(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("Content") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("character varying(1024)"); |
|||
|
|||
b.Property<Guid?>("ConversationId") |
|||
.HasColumnType("uuid"); |
|||
|
|||
b.Property<DateTime>("CreatedAt") |
|||
.HasColumnType("timestamp with time zone"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("timestamp with time zone") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("text") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("timestamp with time zone") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<DateTime?>("ReplyAt") |
|||
.HasColumnType("timestamp with time zone"); |
|||
|
|||
b.Property<string>("ReplyMessage") |
|||
.HasColumnType("text"); |
|||
|
|||
b.Property<string>("Role") |
|||
.IsRequired() |
|||
.HasMaxLength(20) |
|||
.HasColumnType("character varying(20)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<Guid?>("UserId") |
|||
.HasColumnType("uuid"); |
|||
|
|||
b.Property<string>("Workspace") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("character varying(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "ConversationId"); |
|||
|
|||
b.ToTable("AbpAITextChatMessages", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Tokens.TokenUsageRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("uuid"); |
|||
|
|||
b.Property<long?>("CachedInputTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<Guid?>("ConversationId") |
|||
.HasColumnType("uuid"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("timestamp with time zone") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<long?>("InputTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("timestamp with time zone") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<Guid?>("MessageId") |
|||
.HasColumnType("uuid"); |
|||
|
|||
b.Property<long?>("OutputTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<long?>("ReasoningTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<long?>("TotalTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "ConversationId"); |
|||
|
|||
b.ToTable("AbpAITokenUsages", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Workspaces.WorkspaceDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("uuid"); |
|||
|
|||
b.Property<string>("ApiBaseUrl") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("character varying(128)"); |
|||
|
|||
b.Property<string>("ApiKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("character varying(64)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("character varying(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("timestamp with time zone") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("character varying(128)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("character varying(128)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("text") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<float?>("FrequencyPenalty") |
|||
.HasColumnType("real"); |
|||
|
|||
b.Property<string>("Instructions") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("character varying(512)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("boolean"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("timestamp with time zone") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("uuid") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<int?>("MaxOutputTokens") |
|||
.HasColumnType("integer"); |
|||
|
|||
b.Property<string>("ModelName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("character varying(64)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("character varying(64)"); |
|||
|
|||
b.Property<float?>("PresencePenalty") |
|||
.HasColumnType("real"); |
|||
|
|||
b.Property<string>("Provider") |
|||
.IsRequired() |
|||
.HasMaxLength(20) |
|||
.HasColumnType("character varying(20)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("character varying(256)"); |
|||
|
|||
b.Property<string>("SystemPrompt") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("character varying(512)"); |
|||
|
|||
b.Property<float?>("Temperature") |
|||
.HasColumnType("real"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpAIWorkspaceDefinitions", (string)null); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class AddWorkspaceToConversationRecord : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Workspace", |
|||
table: "AbpAIConversations", |
|||
type: "character varying(64)", |
|||
maxLength: 64, |
|||
nullable: false, |
|||
defaultValue: ""); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "Workspace", |
|||
table: "AbpAIConversations"); |
|||
} |
|||
} |
|||
} |
|||
@ -1,8 +1,15 @@ |
|||
using Volo.Abp.Validation; |
|||
using LINGYUN.Abp.AIManagement.Workspaces; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace LINGYUN.Abp.AIManagement.Chats.Dtos; |
|||
public class ConversationCreateDto |
|||
{ |
|||
[DynamicStringLength(typeof(ConversationRecordConsts), nameof(ConversationRecordConsts.MaxNameLength))] |
|||
public string? Name { get; set; } |
|||
|
|||
[Required] |
|||
[DynamicStringLength(typeof(WorkspaceDefinitionRecordConsts), nameof(WorkspaceDefinitionRecordConsts.MaxNameLength))] |
|||
public string Workspace { get; set; } |
|||
|
|||
} |
|||
|
|||
Loading…
Reference in new issue