using System.Text.Json.Serialization;
namespace OASystem.API.OAMethodLib.DeepSeekAPI
{
    public class DeepSeekModels
    {
    }
    /// 
    /// 基础信息
    /// 
    public class DeepSeek
    {
        /// 
        /// ApiKey
        /// 
        public string ApiKey { get; set; }
        /// 
        /// BaseAddress
        /// 
        public string BaseAddress { get; set; }
    }
    /// 
    /// 文件上传到DeepSeek API的请求参数
    /// 
    public class DeepSeekFileUploadRequest
    {
        /// 
        /// 要上传的文件列表
        /// 
        public List Files { get; set; } = new List();
        /// 
        /// 用途描述(可选)
        /// 
        public string Purpose { get; set; } = "assistants";
        /// 
        /// 模型名称,默认为 deepseek-chat
        /// 
        public string Model { get; set; } = "deepseek-chat";
        /// 
        /// 是否等待文件处理完成
        /// 
        public bool WaitForProcessing { get; set; } = true;
    }
    /// 
    /// 使用已上传文件提问的请求参数
    /// 
    public class AskWithFilesRequest
    {
        /// 
        /// 已上传的文件ID列表
        /// 
        public List FileIds { get; set; } = new List();
        /// 
        /// 问题描述
        /// 
        public string Question { get; set; }
        /// 
        /// 模型名称
        /// 
        public string Model { get; set; } = "deepseek-chat";
        /// 
        /// 温度参数
        /// 
        public float Temperature { get; set; } = 0.7f;
        /// 
        /// 最大token数
        /// 
        public int MaxTokens { get; set; } = 4000;
    }
    /// 
    /// DeepSeek 文件上传响应
    /// 
    public class DeepSeekFileUploadResponse
    {
        /// 
        /// 文件ID
        /// 
        [JsonPropertyName("id")]
        public string Id { get; set; }
        /// 
        /// 对象类型
        /// 
        [JsonPropertyName("object")]
        public string Object { get; set; }
        /// 
        /// 文件大小(字节)
        /// 
        [JsonPropertyName("bytes")]
        public long Bytes { get; set; }
        /// 
        /// 创建时间戳
        /// 
        [JsonPropertyName("created_at")]
        public long CreatedAt { get; set; }
        /// 
        /// 文件名
        /// 
        [JsonPropertyName("filename")]
        public string Filename { get; set; }
        /// 
        /// 文件用途
        /// 
        [JsonPropertyName("purpose")]
        public string Purpose { get; set; }
        /// 
        /// 文件状态
        /// 
        [JsonPropertyName("status")]
        public string Status { get; set; }
        /// 
        /// 状态详情
        /// 
        [JsonPropertyName("status_details")]
        public object StatusDetails { get; set; }
    }
    /// 
    /// 文件列表响应
    /// 
    public class DeepSeekFileListResponse
    {
        /// 
        /// 对象类型
        /// 
        [JsonPropertyName("object")]
        public string Object { get; set; }
        /// 
        /// 文件数据列表
        /// 
        [JsonPropertyName("data")]
        public List Data { get; set; }
    }
    /// 
    /// 使用文件进行聊天的请求
    /// 
    public class DeepSeekChatWithFilesRequest
    {
        /// 
        /// 模型名称
        /// 
        [JsonPropertyName("model")]
        public string Model { get; set; }
        /// 
        /// 消息列表
        /// 
        [JsonPropertyName("messages")]
        public List Messages { get; set; }
        /// 
        /// 温度参数
        /// 
        [JsonPropertyName("temperature")]
        public float Temperature { get; set; }
        /// 
        /// 最大token数
        /// 
        [JsonPropertyName("max_tokens")]
        public int MaxTokens { get; set; }
    }
    /// 
    /// 包含文件引用的消息
    /// 
    public class FileMessage
    {
        /// 
        /// 消息角色
        /// 
        [JsonPropertyName("role")]
        public string Role { get; set; }
        /// 
        /// 消息内容
        /// 
        [JsonPropertyName("content")]
        public object Content { get; set; }
    }
    /// 
    /// 文件内容块
    /// 
    public class FileContent
    {
        /// 
        /// 内容类型
        /// 
        [JsonPropertyName("type")]
        public string Type { get; set; } = "text";
        /// 
        /// 文本内容
        /// 
        [JsonPropertyName("text")]
        public string Text { get; set; }
    }
    /// 
    /// API响应结果
    /// 
    public class ApiResponse
    {
        /// 
        /// 是否成功
        /// 
        public bool Success { get; set; }
        /// 
        /// 响应消息
        /// 
        public string Message { get; set; }
        /// 
        /// 文件上传结果
        /// 
        public List FileResults { get; set; } = new List();
        /// 
        /// 回答内容(如果包含提问)
        /// 
        public string Answer { get; set; }
        /// 
        /// 使用的token数量
        /// 
        public int TokensUsed { get; set; }
    }
    /// 
    /// 文件上传结果
    /// 
    public class FileUploadResult
    {
        /// 
        /// 文件名
        /// 
        public string FileName { get; set; }
        /// 
        /// 文件ID
        /// 
        public string FileId { get; set; }
        /// 
        /// 文件大小
        /// 
        public long FileSize { get; set; }
        /// 
        /// 是否上传成功
        /// 
        public bool Success { get; set; }
        /// 
        /// 状态消息
        /// 
        public string Message { get; set; }
        /// 
        /// 文件状态
        /// 
        public string Status { get; set; }
    }
    /// 
    /// 文件删除请求
    /// 
    public class DeleteFileRequest
    {
        /// 
        /// 要删除的文件ID
        /// 
        public string FileId { get; set; }
    }
    /// 
    /// 项目文件读取请求
    /// 
    public class ProjectFileReadRequest
    {
        /// 
        /// 要读取的文件相对路径列表(相对于项目根目录)
        /// 
        public List FilePaths { get; set; } = new List();
        /// 
        /// 是否递归读取子目录
        /// 
        public bool Recursive { get; set; } = false;
        /// 
        /// 文件搜索模式(例如:*.cs)
        /// 
        public string SearchPattern { get; set; } = "*.cs";
        /// 
        /// 文件用途
        /// 
        public string Purpose { get; set; } = "assistants";
    }
    /// 
    /// 项目文件信息
    /// 
    public class ProjectFileInfo
    {
        /// 
        /// 文件相对路径
        /// 
        public string RelativePath { get; set; }
        /// 
        /// 文件完整路径
        /// 
        public string FullPath { get; set; }
        /// 
        /// 文件大小(字节)
        /// 
        public long FileSize { get; set; }
        /// 
        /// 最后修改时间
        /// 
        public DateTime LastModified { get; set; }
        /// 
        /// 是否成功读取
        /// 
        public bool Success { get; set; }
        /// 
        /// 错误信息(如果有)
        /// 
        public string ErrorMessage { get; set; }
        /// 
        /// 转换后的IFormFile(如果成功)
        /// 
        public IFormFile FormFile { get; set; }
    }
    /// 
    /// 项目文件读取响应
    /// 
    public class ProjectFileReadResponse
    {
        /// 
        /// 是否成功
        /// 
        public bool Success { get; set; }
        /// 
        /// 响应消息
        /// 
        public string Message { get; set; }
        /// 
        /// 读取的文件信息列表
        /// 
        public List FileInfos { get; set; } = new List();
        /// 
        /// 成功读取的文件数量
        /// 
        public int SuccessCount => FileInfos.Count(f => f.Success);
        /// 
        /// 失败的文件数量
        /// 
        public int FailureCount => FileInfos.Count(f => !f.Success);
    }
}