mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 09:07:22 +00:00
Added a way to read what the AI received from your sources (#1100)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
e0d8e18f34
commit
cbc4ce5413
229 files changed
+12739
-1269
No files matched your search
+43
@@ -0,0 +1,43 @@
|
||||
#nullable disable
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace AIStudio.Tools.Databases.ProvenanceStore.Migrations;
|
||||
|
||||
/// <summary>
|
||||
/// Creates the table provenance, which holds what chats received besides their messages.
|
||||
/// </summary>
|
||||
[DbContext(typeof(ProvenanceStoreDbContext))]
|
||||
[Migration("20261024000000_InitialProvenanceStore")]
|
||||
public partial class InitialProvenanceStore : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "provenance",
|
||||
columns: table => new
|
||||
{
|
||||
chat_id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
kind = table.Column<string>(type: "TEXT", nullable: false),
|
||||
content = table.Column<string>(type: "TEXT", nullable: false),
|
||||
surrounding_content = table.Column<string>(type: "TEXT", nullable: true),
|
||||
created_at_utc = table.Column<string>(type: "TEXT", nullable: false),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_provenance", entry => new { entry.chat_id, entry.id });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "idx_provenance_id",
|
||||
table: "provenance",
|
||||
column: "id");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(name: "provenance");
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
#nullable disable
|
||||
|
||||
using AIStudio.Tools.Databases.IndexStore;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
|
||||
namespace AIStudio.Tools.Databases.ProvenanceStore.Migrations;
|
||||
|
||||
// EF Core writes this file and declares the type as partial. Dropping the keyword would only
|
||||
// last until the next migration is added, so the inspection is silenced instead.
|
||||
// ReSharper disable once PartialTypeWithSinglePart
|
||||
[DbContext(typeof(ProvenanceStoreDbContext))]
|
||||
partial class ProvenanceStoreDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.18");
|
||||
var utcDateTimeOffsetConverter = new IndexStoreDateTimeOffsetConverter();
|
||||
|
||||
modelBuilder.Entity("AIStudio.Tools.Databases.ProvenanceStore.ProvenanceEntity", entity =>
|
||||
{
|
||||
entity.Property<string>("ChatId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("chat_id");
|
||||
|
||||
entity.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
entity.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("content");
|
||||
|
||||
entity.Property<DateTimeOffset>("CreatedAtUtc")
|
||||
.HasConversion(utcDateTimeOffsetConverter)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at_utc");
|
||||
|
||||
entity.Property<string>("Kind")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("kind");
|
||||
|
||||
entity.Property<string>("SurroundingContent")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("surrounding_content");
|
||||
|
||||
entity.HasKey("ChatId", "Id");
|
||||
|
||||
entity.HasIndex("Id")
|
||||
.HasDatabaseName("idx_provenance_id");
|
||||
|
||||
entity.ToTable("provenance");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user