27 lines
978 B
C#
27 lines
978 B
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace DramaLing.Api.Models.Configuration;
|
|
|
|
public class GeminiOptions
|
|
{
|
|
public const string SectionName = "Gemini";
|
|
|
|
[Required(ErrorMessage = "Gemini API Key is required")]
|
|
public string ApiKey { get; set; } = string.Empty;
|
|
|
|
[Range(1, 120, ErrorMessage = "Timeout must be between 1 and 120 seconds")]
|
|
public int TimeoutSeconds { get; set; } = 30;
|
|
|
|
[Range(1, 10, ErrorMessage = "Max retries must be between 1 and 10")]
|
|
public int MaxRetries { get; set; } = 3;
|
|
|
|
[Range(100, 10000, ErrorMessage = "Max tokens must be between 100 and 10000")]
|
|
public int MaxOutputTokens { get; set; } = 2000;
|
|
|
|
[Range(0.0, 2.0, ErrorMessage = "Temperature must be between 0 and 2")]
|
|
public double Temperature { get; set; } = 0.7;
|
|
|
|
public string Model { get; set; } = "gemini-1.5-flash";
|
|
|
|
public string BaseUrl { get; set; } = "https://generativelanguage.googleapis.com";
|
|
} |