Files
AdPlatform-Server/Creative/Configuration/CreativeConfig.cs
2026-03-14 13:50:09 -07:00

75 lines
2.3 KiB
C#

namespace Creative.Configuration;
/// <summary>
/// Configuration for the Creative service.
/// Bound from appsettings.json section "Creative".
/// Override via environment variables: Creative__OpenAiApiKey, etc.
/// </summary>
public class CreativeConfig
{
public const string SectionName = "Creative";
/// <summary>
/// When false, returns emulated/mock creative assets.
/// When true, calls OpenAI and performs real URL scraping.
/// </summary>
public bool EnableRealApi { get; set; } = false;
/// <summary>
/// OpenAI API key for copy generation.
/// </summary>
public string? OpenAiApiKey { get; set; }
/// <summary>
/// OpenAI model to use. Default: gpt-4o-mini.
/// </summary>
public string OpenAiModel { get; set; } = "gpt-4o-mini";
/// <summary>
/// Max tokens for OpenAI responses.
/// </summary>
public int OpenAiMaxTokens { get; set; } = 1000;
/// <summary>
/// Timeout in seconds for URL scraping.
/// </summary>
public int ScrapeTimeoutSeconds { get; set; } = 15;
/// <summary>
/// Timeout in seconds for OpenAI API calls.
/// </summary>
public int OpenAiTimeoutSeconds { get; set; } = 30;
// ── Image Provider ──────────────────────────────────────
/// <summary>
/// Image provider: "emulated" | "unsplash" | "dalle".
/// Default: emulated (placeholder images).
/// </summary>
public string ImageProvider { get; set; } = "emulated";
/// <summary>
/// Unsplash Access Key (optional - basic search works without it,
/// but rate limits are generous with a free key from unsplash.com/developers).
/// </summary>
public string? UnsplashAccessKey { get; set; }
/// <summary>
/// Number of images to return per draft. Default: 3
/// (landscape, square, portrait for responsive display ads).
/// </summary>
public int ImageCount { get; set; } = 3;
/// <summary>
/// DALL-E model to use when ImageProvider=dalle.
/// Default: dall-e-3.
/// </summary>
public string DalleModel { get; set; } = "dall-e-3";
/// <summary>
/// DALL-E image size. Default: 1024x1024.
/// Options: 1024x1024, 1792x1024, 1024x1792.
/// </summary>
public string DalleSize { get; set; } = "1024x1024";
}