daily_digest/Models/Gemini/GeminiRequestDto.cs
2025-04-12 00:27:03 +07:00

49 lines
1.6 KiB
C#

using Newtonsoft.Json;
using System.Collections.Generic;
namespace DailyDigestWorker.Models.Gemini
{
public class GeminiRequestDto
{
[JsonProperty("contents")]
public List<ContentDto> Contents { get; set; } = new List<ContentDto>();
// Опциональные параметры для контроля генерации
[JsonProperty("generationConfig", NullValueHandling = NullValueHandling.Ignore)]
public GenerationConfigDto? GenerationConfig { get; set; }
// Опциональные параметры безопасности
[JsonProperty("safetySettings", NullValueHandling = NullValueHandling.Ignore)]
public List<SafetySettingDto>? SafetySettings { get; set; }
}
public class ContentDto
{
[JsonProperty("parts")]
public List<PartDto> Parts { get; set; } = new List<PartDto>();
}
public class PartDto
{
[JsonProperty("text")]
public string Text { get; set; } = string.Empty;
}
public class GenerationConfigDto
{
[JsonProperty("temperature", NullValueHandling = NullValueHandling.Ignore)]
public float? Temperature { get; set; } // 0.0 - 1.0
[JsonProperty("maxOutputTokens", NullValueHandling = NullValueHandling.Ignore)]
public int? MaxOutputTokens { get; set; }
}
public class SafetySettingDto
{
[JsonProperty("category")]
public string Category { get; set; } = string.Empty; // e.g., "HARM_CATEGORY_HARASSMENT"
[JsonProperty("threshold")]
public string Threshold { get; set; } = string.Empty; // e.g., "BLOCK_MEDIUM_AND_ABOVE"
}
}