Move models in separate projects
Build and Push Docker Images / build (push) Failing after 27s

This commit is contained in:
2026-05-06 17:11:44 +03:00
parent c02cf1c754
commit 64b0219038
80 changed files with 166 additions and 89 deletions
+10
View File
@@ -0,0 +1,10 @@
namespace Rag.Models
{
public sealed class DocumentClassification
{
public required string DocumentType { get; init; }
public double Confidence { get; init; }
public required string Title { get; init; }
public Dictionary<string, string> Metadata { get; init; } = new Dictionary<string, string>();
}
}
+11
View File
@@ -0,0 +1,11 @@
namespace Rag.Models
{
public sealed class RagChunkRecord
{
public required string Id { get; init; }
public required string DocumentId { get; init; }
public int ChunkIndex { get; init; }
public required string Text { get; init; }
public required float[] Embedding { get; init; }
}
}
+13
View File
@@ -0,0 +1,13 @@
namespace Rag.Models
{
public sealed class RagDocumentDetails
{
public required string Id { get; init; }
public required string DocumentType { get; init; }
public required string Title { get; init; }
public string? SourceUrl { get; init; }
public required string Text { get; init; }
public required string TextHash { get; init; }
public DateTimeOffset CreatedAt { get; init; }
}
}
+15
View File
@@ -0,0 +1,15 @@
namespace Rag.Models
{
public sealed class RagDocumentRecord
{
public required string Id { get; init; }
public required string DocumentType { get; init; }
public required string Title { get; init; }
public string? SourceUrl { get; init; }
public required string Text { get; init; }
public required string TextHash { get; init; }
public double TypeConfidence { get; init; }
public string MetadataJson { get; init; } = "{}";
public DateTimeOffset CreatedAt { get; init; }
}
}
@@ -0,0 +1,11 @@
namespace Rag.Models.Requests
{
public sealed class IndexDocumentRequest
{
public string? Text { get; set; }
public string? SourceUrl { get; set; }
public string? DocumentType { get; set; }
public string? Title { get; set; }
public Dictionary<string, string>? Metadata { get; set; }
}
}
+9
View File
@@ -0,0 +1,9 @@
namespace Rag.Models.Requests
{
public sealed class SearchRequest
{
public required string QueryText { get; init; }
public IReadOnlyList<string>? TargetDocumentTypes { get; init; }
public int? TopK { get; init; }
}
}
@@ -0,0 +1,14 @@
namespace Rag.Models.Responses
{
public sealed class IndexDocumentResponse
{
public required string DocumentId { get; init; }
public required string TextHash { get; init; }
public required string DocumentType { get; init; }
public double DocumentTypeConfidence { get; init; }
public required string Title { get; init; }
public int Chunks { get; init; }
public int Characters { get; init; }
public bool Cached { get; init; }
}
}
@@ -0,0 +1,25 @@
namespace Rag.Models.Responses
{
public sealed class SearchResponse
{
public IReadOnlyList<SearchDocumentResult> Results { get; init; } = System.Array.Empty<SearchDocumentResult>();
}
public sealed class SearchDocumentResult
{
public required string DocumentId { get; init; }
public required string DocumentType { get; init; }
public required string Title { get; init; }
public string? SourceUrl { get; init; }
public double Score { get; init; }
public IReadOnlyList<SearchChunkResult> MatchedChunks { get; init; } = System.Array.Empty<SearchChunkResult>();
}
public sealed class SearchChunkResult
{
public required string ChunkId { get; init; }
public int ChunkIndex { get; init; }
public required string Text { get; init; }
public double Score { get; init; }
}
}
+9
View File
@@ -0,0 +1,9 @@
namespace Rag.Models
{
public sealed class SearchCandidateChunk
{
public required RagDocumentRecord Document { get; init; }
public required RagChunkRecord Chunk { get; init; }
public double Score { get; init; }
}
}
+8
View File
@@ -0,0 +1,8 @@
namespace Rag.Models.Settings;
public sealed class AiSettings
{
public string Provider { get; set; } = "OpenAI";
public OpenAiProviderSettings OpenAI { get; set; } = new();
public OllamaProviderSettings Ollama { get; set; } = new();
}
@@ -0,0 +1,7 @@
namespace Rag.Models.Settings;
public sealed class InternalApiSettings
{
public string ApiKey { get; set; } = string.Empty;
public bool RequireApiKey { get; set; } = false;
}
@@ -0,0 +1,9 @@
namespace Rag.Models.Settings;
public sealed class OllamaProviderSettings
{
public string BaseUrl { get; set; } = "http://localhost:11434";
public string ChatModel { get; set; } = "llama3.1:8b";
public string EmbeddingModel { get; set; } = "nomic-embed-text";
public int TimeoutSeconds { get; set; } = 180;
}
@@ -0,0 +1,9 @@
namespace Rag.Models.Settings;
public sealed class OpenAiProviderSettings
{
public string ApiKey { get; set; } = string.Empty;
public string ChatModel { get; set; } = "gpt-4o-mini";
public string EmbeddingModel { get; set; } = "text-embedding-3-small";
public int TimeoutSeconds { get; set; } = 90;
}
+12
View File
@@ -0,0 +1,12 @@
namespace Rag.Models.Settings;
public sealed class RagSettings
{
public int MaxFileSizeMb { get; set; } = 8;
public int ChunkSize { get; set; } = 900;
public int ChunkOverlap { get; set; } = 150;
public int MaxTextChars { get; set; } = 60000;
public int DefaultTopK { get; set; } = 20;
public int MaxTopK { get; set; } = 50;
public bool ClassifyWithAi { get; set; } = false;
}
+10
View File
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>Rag.Models</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>