import { IFullUser } from "../users/users.interface";
import { ChatCompletionCreateParamsBase } from "openai/resources/chat/completions";
import { TAIModel } from "../subscriptions/subscriptions.interface";
import { Types } from "mongoose";
import { CreateConversationDto, RegenerateConversationDto } from "./chat-history.validation";
interface IChatHistoryPart {
    _id?: string | Types.ObjectId;
    role: 'user' | 'system';
    content: string;
    type: 'text' | 'image' | 'url' | 'file';
    blockedReason?: string[];
    model: TAIModel;
    status?: 'completed' | 'loading' | 'error' | 'aborted';
    createdAt: Date;
}
export interface IChatHistory {
    _id?: string | Types.ObjectId;
    role: 'user' | 'system';
    content: string;
    type: 'text' | 'image' | 'url' | 'file';
    blockedReason?: string[];
    model?: TAIModel;
    parts?: IChatHistoryPart[];
    isRetryAllowed: boolean;
    status?: 'completed' | 'loading' | 'error' | 'aborted';
    createdAt: Date;
}
export type TChatType = IChatHistory['type'];
export interface IChat {
    _id: string | Types.ObjectId;
    user: string | Types.ObjectId;
    title: string;
    history: IChatHistory[];
    createdAt: Date;
    updatedAt: Date;
}
export interface IHandleChat {
    sendToUser: boolean;
    regenerate: boolean;
    edit: boolean;
    messageId?: string;
}
export interface IGenerateTextMessagePayload {
    user: IFullUser;
    prompt: string;
    previousMessages: ChatCompletionCreateParamsBase['messages'];
}
export interface IGenerateTextMessageResponse {
    success: boolean;
    message: string;
    translatedMessage?: string;
    errorText?: string;
}
export interface IGptHttpResponseFormat {
    choices: [
        {
            index: number;
            message: {
                role: string;
                content: string;
                function_call: {
                    name: string;
                    arguments: string;
                };
            };
            logprobs: any;
            finish_reason: string;
        }
    ];
}
export interface IChatDataToReturn {
    chatHistory: IChatHistory;
    newResponse: IChatHistory;
}
export type IConversationDto = RegenerateConversationDto | CreateConversationDto;
export {};
