using AIStudio.Chat;
namespace AIStudio.Assistants.BeyondFactsLab;
///
/// A chat of the BeyondFacts Lab, as BflConversationService keeps it while the app runs.
///
///
/// The service keeps it beyond the page, so that an answer goes on while the person looks at another page, and the
/// page shows it again when it comes back.
///
public sealed class BflConversation
{
///
/// Gets where the chat belongs, e.g., to a step of a preparation.
///
public required BflThreadLocation Location { get; init; }
///
/// Gets or sets the chat, or null when this version cannot open the stored one.
///
public ChatThread? Thread { get; set; }
///
/// Gets or sets whether the model answers right now.
///
public bool IsRunning { get; set; }
///
/// Gets whether the chat can be shown and continued.
///
public bool IsAvailable => this.Thread is not null;
///
/// Gets whether the chat has a message the person sees.
///
public bool HasVisibleMessages => this.Thread?.Blocks.Any(block => !block.HideFromUser) ?? false;
}