mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-14 22:08:27 +00:00
Added the Model Comparison assistant for blind comparisons of two models (#1009)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
12f26445ba
commit
b7255694cd
221 files changed
+19989
-90
No files matched your search
@@ -0,0 +1,57 @@
|
||||
namespace AIStudio.Chat.Embedded;
|
||||
|
||||
/// <summary>
|
||||
/// An embedded chat as EmbeddedChatService keeps it, with whether the model answers in it right now.
|
||||
/// </summary>
|
||||
public sealed class EmbeddedConversation
|
||||
{
|
||||
/// <summary>
|
||||
/// The ID of the chat.
|
||||
/// </summary>
|
||||
public required Guid ChatId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The assistant which shows the chat. Its requests register in AssistantSessionService under it.
|
||||
/// </summary>
|
||||
public required Tools.Components Component { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Where the chat lives.
|
||||
/// </summary>
|
||||
public required IEmbeddedChatStore Store { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The thread of the chat, or null when this version cannot open the stored one.
|
||||
/// </summary>
|
||||
public ChatThread? Thread { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the model answers in the chat right now.
|
||||
/// </summary>
|
||||
public bool IsRunning { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the chat could be opened.
|
||||
/// </summary>
|
||||
public bool IsAvailable => this.Thread is not null;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the chat holds any message the user sees.
|
||||
/// </summary>
|
||||
public bool HasVisibleMessages => this.Thread?.Blocks.Any(block => !block.HideFromUser) ?? false;
|
||||
|
||||
/// <summary>
|
||||
/// How many messages the user wrote in the chat, those the user does not see left aside.
|
||||
/// </summary>
|
||||
public int UserMessageCount => this.Thread?.Blocks.Count(block => block is { Role: ChatRole.USER, HideFromUser: false }) ?? 0;
|
||||
|
||||
/// <summary>
|
||||
/// The first message of the user which the user sees, or null before it.
|
||||
/// </summary>
|
||||
public ContentBlock? FirstUserMessage => this.Thread?.Blocks.FirstOrDefault(block => block is { Role: ChatRole.USER, HideFromUser: false });
|
||||
|
||||
/// <summary>
|
||||
/// Whether the chat holds an answer of the model which the user sees.
|
||||
/// </summary>
|
||||
public bool HasAnswer => this.Thread?.Blocks.Any(block => block is { Role: ChatRole.AI, HideFromUser: false }) ?? false;
|
||||
}
|
||||
Reference in new issue
Block a user