This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Shared.Models.Requests
|
||||
{
|
||||
public class UploadFileRequest
|
||||
{
|
||||
[Required]
|
||||
public IFormFile File { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Shared.Models.Responses;
|
||||
|
||||
public sealed class ErrorResponse
|
||||
{
|
||||
public string Error { get; init; } = string.Empty;
|
||||
public string? Code { get; init; }
|
||||
public string? Detail { get; init; }
|
||||
public double? Score { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Shared.Models.Settings
|
||||
{
|
||||
public class AiSettings
|
||||
{
|
||||
public string Provider { get; set; } = "OpenAI";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Shared.Models.Settings
|
||||
{
|
||||
public class DatabaseSettings
|
||||
{
|
||||
public string Host { get; set; } = "";
|
||||
public int Port { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
public string User { get; set; } = "";
|
||||
public string Password { get; set; } = "";
|
||||
public bool TrustServerCertificate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Shared.Models.Settings
|
||||
{
|
||||
public class InternalApiSettings
|
||||
{
|
||||
public string ApiKey { get; set; } = string.Empty;
|
||||
public bool RequireApiKey { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Shared.Models.Settings
|
||||
{
|
||||
public class OllamaSettings
|
||||
{
|
||||
public string BaseUrl { get; set; } = "http://localhost:11434";
|
||||
public string ChatModel { get; set; } = "llama3.1:8b";
|
||||
public int TimeoutSeconds { get; set; } = 180;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Shared.Models.Settings
|
||||
{
|
||||
public class OpenAiSettings
|
||||
{
|
||||
public string ApiKey { get; set; } = string.Empty;
|
||||
public string ChatModel { get; set; } = "gpt-4o-mini";
|
||||
public int TimeoutSeconds { get; set; } = 90;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace Shared.Models.Settings
|
||||
{
|
||||
public class RateLimitingSettings
|
||||
{
|
||||
public RateLimitPolicySettings Global { get; set; } = new();
|
||||
public Dictionary<string, RateLimitPolicySettings> Policies { get; set; } = new();
|
||||
}
|
||||
|
||||
public class RateLimitPolicySettings
|
||||
{
|
||||
public int PermitLimit { get; set; } = 100;
|
||||
|
||||
// Bound from configuration strings like "00:01:00" (1 minute) or "00:10:00" (10 minutes).
|
||||
public TimeSpan Window { get; set; } = TimeSpan.FromMinutes(1);
|
||||
|
||||
public int QueueLimit { get; set; } = 0;
|
||||
|
||||
public bool AutoReplenishment { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<RootNamespace>Shared.Models</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user