49 lines
1.6 KiB
C#
49 lines
1.6 KiB
C#
using Newtonsoft.Json;
|
|
using System.Collections.Generic;
|
|
|
|
namespace DailyDigestWorker.Models.Gemini
|
|
{
|
|
public class GeminiResponseDto
|
|
{
|
|
[JsonProperty("candidates")]
|
|
public List<CandidateDto>? Candidates { get; set; }
|
|
|
|
[JsonProperty("promptFeedback", NullValueHandling = NullValueHandling.Ignore)]
|
|
public PromptFeedbackDto? PromptFeedback { get; set; }
|
|
}
|
|
|
|
public class CandidateDto
|
|
{
|
|
[JsonProperty("content")]
|
|
public ContentDto? Content { get; set; }
|
|
|
|
[JsonProperty("finishReason", NullValueHandling = NullValueHandling.Ignore)]
|
|
public string? FinishReason { get; set; } // e.g., "STOP", "MAX_TOKENS", "SAFETY"
|
|
|
|
[JsonProperty("safetyRatings", NullValueHandling = NullValueHandling.Ignore)]
|
|
public List<SafetyRatingDto>? SafetyRatings { get; set; }
|
|
}
|
|
|
|
// ContentDto и PartDto используются и в запросе, и в ответе
|
|
|
|
public class PromptFeedbackDto
|
|
{
|
|
[JsonProperty("blockReason", NullValueHandling = NullValueHandling.Ignore)]
|
|
public string? BlockReason { get; set; }
|
|
|
|
[JsonProperty("safetyRatings", NullValueHandling = NullValueHandling.Ignore)]
|
|
public List<SafetyRatingDto>? SafetyRatings { get; set; }
|
|
}
|
|
|
|
public class SafetyRatingDto
|
|
{
|
|
[JsonProperty("category")]
|
|
public string? Category { get; set; }
|
|
|
|
[JsonProperty("probability")]
|
|
public string? Probability { get; set; } // e.g., "NEGLIGIBLE", "LOW", "MEDIUM", "HIGH"
|
|
|
|
[JsonProperty("blocked", NullValueHandling = NullValueHandling.Ignore)]
|
|
public bool? Blocked { get; set; }
|
|
}
|
|
} |