summarizer/AppSettings.cs

57 lines
1.8 KiB
C#

namespace YoutubeSummarizer.Configuration;
/// <summary>
/// Root configuration object bound from appsettings.json.
/// Only OpenAI and Summarizer sections are required.
/// </summary>
public sealed class AppSettings
{
public LlmSettings LLM { get; init; } = new();
public SummarizerSettings Summarizer { get; init; } = new();
}
/// <summary>
/// Settings for the LLM API (OpenAI or Ollama).
/// </summary>
public sealed class LlmSettings
{
/// <summary>
/// Base URL for the API.
/// For OpenAI: https://api.openai.com/v1
/// For Ollama: http://localhost:11434/v1
/// </summary>
public string BaseUrl { get; init; } = "https://api.openai.com/v1";
/// <summary>Your API key. (For Ollama, any value works).</summary>
public string ApiKey { get; init; } = string.Empty;
/// <summary>
/// Model to use.
/// OpenAI: gpt-4o-mini, gpt-4o
/// Ollama: qwen3:14b, llama3.1
/// </summary>
public string Model { get; init; } = "gpt-4o-mini";
/// <summary>Max tokens for the summary response (not the input).</summary>
public int MaxTokens { get; init; } = 1500;
/// <summary>Timeout in seconds for API calls.</summary>
public int TimeoutSeconds { get; init; } = 100;
}
/// <summary>
/// Controls summarization behavior.
/// </summary>
public sealed class SummarizerSettings
{
/// <summary>
/// Approximate word count at which we split a long transcript into chunks
/// before doing a final "summary of summaries" pass. This keeps individual
/// API calls within model context limits.
/// </summary>
public int ChunkWordLimit { get; init; } = 3000;
/// <summary>When true, prints the full transcript text before summarizing.</summary>
public bool ShowTranscript { get; init; } = false;
}