Add workspaces & persistent chats (#23)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-07-13 10:37:57 +02:00
1 parent 29263660fc
commit 59d0321625
43 files changed
+1392 -66

No files matched your search

+16 -10
View File
@@ -3,29 +3,35 @@ namespace AIStudio.Chat;
/// <summary>
/// Data structure for a chat thread.
/// </summary>
/// <param name="name">The name of the chat thread.</param>
/// <param name="seed">The seed for the chat thread. Some providers use this to generate deterministic results.</param>
/// <param name="systemPrompt">The system prompt for the chat thread.</param>
/// <param name="blocks">The content blocks of the chat thread.</param>
public sealed class ChatThread(string name, int seed, string systemPrompt, IEnumerable<ContentBlock> blocks)
public sealed class ChatThread
{
/// <summary>
/// The unique identifier of the chat thread.
/// </summary>
public Guid ChatId { get; init; }
/// <summary>
/// The unique identifier of the workspace.
/// </summary>
public Guid WorkspaceId { get; set; }
/// <summary>
/// The name of the chat thread. Usually generated by an AI model or manually edited by the user.
/// </summary>
public string Name { get; set; } = name;
public string Name { get; set; } = string.Empty;
/// <summary>
/// The seed for the chat thread. Some providers use this to generate deterministic results.
/// </summary>
public int Seed { get; set; } = seed;
public int Seed { get; init; }
/// <summary>
/// The current system prompt for the chat thread.
/// </summary>
public string SystemPrompt { get; set; } = systemPrompt;
public string SystemPrompt { get; init; } = string.Empty;
/// <summary>
/// The content blocks of the chat thread.
/// </summary>
public List<ContentBlock> Blocks { get; init; } = blocks.ToList();
public List<ContentBlock> Blocks { get; init; } = [];
}