[FA-misc] Translation engine work
Some checks failed
CI / build-backend (pull_request) Failing after 1m48s
CI / build-frontend (pull_request) Successful in 1m27s

This commit is contained in:
gamer147
2026-08-25 10:38:27 -04:00
parent 327c03c098
commit d5a9529d6f
14 changed files with 641 additions and 19 deletions

View File

@@ -0,0 +1,24 @@
using System.Text.Json.Serialization;
namespace FictionArchive.Service.TranslationService.Services.TranslationEngines.NanoGpt;
public sealed record NanoGptMessage(
[property: JsonPropertyName("role")] string Role,
[property: JsonPropertyName("content")] string Content);
public sealed record NanoGptChatRequest(
[property: JsonPropertyName("model")] string Model,
[property: JsonPropertyName("messages")] IReadOnlyList<NanoGptMessage> Messages,
[property: JsonPropertyName("temperature")] double Temperature);
public sealed record NanoGptChatResponse(
[property: JsonPropertyName("choices")] IReadOnlyList<NanoGptChoice> Choices,
[property: JsonPropertyName("usage")] NanoGptUsage Usage);
public sealed record NanoGptChoice(
[property: JsonPropertyName("message")] NanoGptMessage Message);
public sealed record NanoGptUsage(
[property: JsonPropertyName("prompt_tokens")] int PromptTokens,
[property: JsonPropertyName("completion_tokens")] int CompletionTokens,
[property: JsonPropertyName("total_tokens")] int TotalTokens);