
import { StorageFile } from "../storage/storage.schema";
import { User } from "../users/users.model";
import { Language } from "src/shared/language/language.interface";
import { ICapabilityHandler } from "./ai-models/ai-models.model";

export interface ILocalizedText {
	[Language.EN]: string;
	[Language.HB]: string;
}

export interface IAiModel {
	id: string;
	name: string;
	description: ILocalizedText;
	isSubscription: boolean;
	providerKey: string;
	icon?: StorageFile;
	isSupportedTemperature: boolean;
	contextWindow?: number;
	maxOutputTokens?: number;
	isActive?: boolean;
	// Capability Handlers
	textHandler?: ICapabilityHandler;
	imageHandler?: ICapabilityHandler;
	imageReadingHandler?: ICapabilityHandler;
	audioHandler?: ICapabilityHandler;
	maxReadImages?: number;
	// Legacy capability flags (computed from handlers for backward compatibility)
	canGenerateText?: boolean;
	canGenerateImage?: boolean;
	canReadImage?: boolean;
	// Visibility
	showInChat?: boolean;
	showInTextToImg?: boolean;
	showInImgToImg?: boolean;
	// Tool Settings
	isSupportTools?: boolean;
	toolCreateImageModelId?: string;
	toolReadImageModelId?: string;
}

export interface IAiModelGroup {
	id: string;
	name: string;
	icon?: StorageFile;
	models: IAiModel[];
}

export interface IAppConfigData {
	aiModels: IAiModelGroup[];
	text: {
		UPGRADE_PLAN_TITLE: ILocalizedText;
		UPGRADE_PLAN_CONTENT: ILocalizedText;
		UPGRADE_PLAN_BUTTON_TEXT: ILocalizedText;
		UPGRADE_MODEL_SUCCESS: ILocalizedText;
		UPGRADE_BUTTON_TEXT: ILocalizedText;
		POWERED_BY_TEXT: ILocalizedText;
		CHOOSE_YOUR_AI_MODEL_TEXT: ILocalizedText;
		selectedText: ILocalizedText;
		selectText: ILocalizedText;
	};
	user: User | null;
	config?: {
		freeModels?: boolean;
	};
}
