namespace GreenHome.Domain;
///
/// AI Query record - stores questions, answers and token usage
///
public class AIQuery
{
///
/// Unique identifier
///
public int Id { get; set; }
///
/// Device ID associated with the query (optional)
///
public int? DeviceId { get; set; }
///
/// Navigation property to Device
///
public Device? Device { get; set; }
///
/// User's question
///
public required string Question { get; set; }
///
/// AI's answer
///
public required string Answer { get; set; }
///
/// Number of prompt tokens used
///
public int PromptTokens { get; set; }
///
/// Number of completion tokens used
///
public int CompletionTokens { get; set; }
///
/// Total tokens used (prompt + completion)
///
public int TotalTokens { get; set; }
///
/// Model used for the query
///
public string? Model { get; set; }
///
/// AI profile used for this query
///
public int? ProfileId { get; set; }
///
/// Navigation property to AIProfile
///
public AIProfile? Profile { get; set; }
///
/// Estimated cost of the query in USD (0 = not calculable)
///
public decimal CostUsd { get; set; }
///
/// Temperature parameter used
///
public double? Temperature { get; set; }
///
/// When the query was created
///
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
///
/// Response time in milliseconds
///
public long? ResponseTimeMs { get; set; }
///
/// User ID (if authenticated)
///
public int? UserId { get; set; }
///
/// Navigation property to User
///
public User? User { get; set; }
}