@@ -1,8 +1,9 @@
|
|||||||
|
using Shared.Models.Settings;
|
||||||
|
|
||||||
namespace CvMatcher.Models.Settings;
|
namespace CvMatcher.Models.Settings;
|
||||||
|
|
||||||
public sealed class AiSettings
|
public sealed class AiSettings : Shared.Models.Settings.AiSettings
|
||||||
{
|
{
|
||||||
public string Provider { get; set; } = "OpenAI";
|
|
||||||
public OpenAiSettings OpenAI { get; set; } = new();
|
public OpenAiSettings OpenAI { get; set; } = new();
|
||||||
public OllamaSettings Ollama { get; set; } = new();
|
public OllamaSettings Ollama { get; set; } = new();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace CvMatcher.Models.Settings;
|
|
||||||
|
|
||||||
public sealed class InternalApiSettings
|
|
||||||
{
|
|
||||||
public string ApiKey { get; set; } = string.Empty;
|
|
||||||
public bool RequireApiKey { get; set; } = false;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
namespace CvMatcher.Models.Settings;
|
|
||||||
|
|
||||||
public sealed class OllamaSettings
|
|
||||||
{
|
|
||||||
public string BaseUrl { get; set; } = "http://localhost:11434";
|
|
||||||
public string ChatModel { get; set; } = "llama3.1:8b";
|
|
||||||
public int TimeoutSeconds { get; set; } = 180;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
namespace CvMatcher.Models.Settings;
|
|
||||||
|
|
||||||
public sealed class OpenAiSettings
|
|
||||||
{
|
|
||||||
public string ApiKey { get; set; } = string.Empty;
|
|
||||||
public string ChatModel { get; set; } = "gpt-4o-mini";
|
|
||||||
public int TimeoutSeconds { get; set; } = 90;
|
|
||||||
}
|
|
||||||
@@ -7,4 +7,8 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\shared-models\shared-models.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ using Api.Clients.Api.Contracts;
|
|||||||
using Api.Clients.Ai;
|
using Api.Clients.Ai;
|
||||||
using Api.Clients.Ai.Contracts;
|
using Api.Clients.Ai.Contracts;
|
||||||
using CvMatcher.Models.Settings;
|
using CvMatcher.Models.Settings;
|
||||||
|
using Shared.Models.Settings;
|
||||||
|
|
||||||
DotNetEnv.Env.Load();
|
DotNetEnv.Env.Load();
|
||||||
|
|
||||||
@@ -73,7 +74,7 @@ try
|
|||||||
|
|
||||||
builder.Services.Configure<RagApiSettings>(builder.Configuration.GetSection("RagApi"));
|
builder.Services.Configure<RagApiSettings>(builder.Configuration.GetSection("RagApi"));
|
||||||
builder.Services.Configure<InternalApiSettings>(builder.Configuration.GetSection("InternalApi"));
|
builder.Services.Configure<InternalApiSettings>(builder.Configuration.GetSection("InternalApi"));
|
||||||
builder.Services.Configure<AiSettings>(builder.Configuration.GetSection("Ai"));
|
builder.Services.Configure<CvMatcher.Models.Settings.AiSettings>(builder.Configuration.GetSection("Ai"));
|
||||||
builder.Services.Configure<MatcherSettings>(builder.Configuration.GetSection("Matcher"));
|
builder.Services.Configure<MatcherSettings>(builder.Configuration.GetSection("Matcher"));
|
||||||
builder.Services.Configure<SmtpSettings>(builder.Configuration.GetSection("Smtp"));
|
builder.Services.Configure<SmtpSettings>(builder.Configuration.GetSection("Smtp"));
|
||||||
|
|
||||||
|
|||||||
@@ -78,5 +78,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\cv-matcher-api-models\cv-matcher-api-models.csproj" />
|
<ProjectReference Include="..\cv-matcher-api-models\cv-matcher-api-models.csproj" />
|
||||||
|
<ProjectReference Include="..\shared-models\shared-models.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api-models", "api-models\ap
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "rag-api-models", "rag-api-models\rag-api-models.csproj", "{6A1ADA81-28E9-4A64-A32D-0755876D5EB7}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "rag-api-models", "rag-api-models\rag-api-models.csproj", "{6A1ADA81-28E9-4A64-A32D-0755876D5EB7}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "shared-models", "shared-models\shared-models.csproj", "{185A8BB0-344A-4856-AEB4-213866EB2EE7}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -60,6 +62,10 @@ Global
|
|||||||
{6A1ADA81-28E9-4A64-A32D-0755876D5EB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{6A1ADA81-28E9-4A64-A32D-0755876D5EB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{6A1ADA81-28E9-4A64-A32D-0755876D5EB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6A1ADA81-28E9-4A64-A32D-0755876D5EB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{6A1ADA81-28E9-4A64-A32D-0755876D5EB7}.Release|Any CPU.Build.0 = Release|Any CPU
|
{6A1ADA81-28E9-4A64-A32D-0755876D5EB7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{185A8BB0-344A-4856-AEB4-213866EB2EE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{185A8BB0-344A-4856-AEB4-213866EB2EE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{185A8BB0-344A-4856-AEB4-213866EB2EE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{185A8BB0-344A-4856-AEB4-213866EB2EE7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -71,6 +77,7 @@ Global
|
|||||||
{D09DA1C2-3DC5-48E7-9F5B-739CA41174F1} = {E08A1D43-24A3-4F93-B66A-4230FD8261BA}
|
{D09DA1C2-3DC5-48E7-9F5B-739CA41174F1} = {E08A1D43-24A3-4F93-B66A-4230FD8261BA}
|
||||||
{FB5EAA9E-1B83-41E4-A3BC-F4B7D1AA0769} = {E08A1D43-24A3-4F93-B66A-4230FD8261BA}
|
{FB5EAA9E-1B83-41E4-A3BC-F4B7D1AA0769} = {E08A1D43-24A3-4F93-B66A-4230FD8261BA}
|
||||||
{6A1ADA81-28E9-4A64-A32D-0755876D5EB7} = {E08A1D43-24A3-4F93-B66A-4230FD8261BA}
|
{6A1ADA81-28E9-4A64-A32D-0755876D5EB7} = {E08A1D43-24A3-4F93-B66A-4230FD8261BA}
|
||||||
|
{185A8BB0-344A-4856-AEB4-213866EB2EE7} = {E08A1D43-24A3-4F93-B66A-4230FD8261BA}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {6246A67B-299E-4E64-8DBE-1A66771E7C67}
|
SolutionGuid = {6246A67B-299E-4E64-8DBE-1A66771E7C67}
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ namespace Rag.Models.Settings;
|
|||||||
public sealed class AiSettings
|
public sealed class AiSettings
|
||||||
{
|
{
|
||||||
public string Provider { get; set; } = "OpenAI";
|
public string Provider { get; set; } = "OpenAI";
|
||||||
public OpenAiProviderSettings OpenAI { get; set; } = new();
|
public OpenAiSettings OpenAI { get; set; } = new();
|
||||||
public OllamaProviderSettings Ollama { get; set; } = new();
|
public OllamaSettings Ollama { get; set; } = new();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace Rag.Models.Settings;
|
|
||||||
|
|
||||||
public sealed class InternalApiSettings
|
|
||||||
{
|
|
||||||
public string ApiKey { get; set; } = string.Empty;
|
|
||||||
public bool RequireApiKey { get; set; } = false;
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
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,6 @@
|
|||||||
|
namespace Rag.Models.Settings;
|
||||||
|
|
||||||
|
public sealed class OllamaSettings : Shared.Models.Settings.OllamaSettings
|
||||||
|
{
|
||||||
|
public string EmbeddingModel { get; set; } = "nomic-embed-text";
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Rag.Models.Settings;
|
||||||
|
|
||||||
|
public sealed class OpenAiSettings: Shared.Models.Settings.OpenAiSettings
|
||||||
|
{
|
||||||
|
public string EmbeddingModel { get; set; } = "text-embedding-3-small";
|
||||||
|
}
|
||||||
@@ -7,4 +7,8 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\shared-models\shared-models.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+2
-1
@@ -11,6 +11,7 @@ using Api.Data.Repositories.Contracts;
|
|||||||
using Api.Data.Repositories;
|
using Api.Data.Repositories;
|
||||||
using Api.Clients.Ai.Contracts;
|
using Api.Clients.Ai.Contracts;
|
||||||
using Api.Clients.Ai;
|
using Api.Clients.Ai;
|
||||||
|
using Shared.Models.Settings;
|
||||||
|
|
||||||
DotNetEnv.Env.Load();
|
DotNetEnv.Env.Load();
|
||||||
|
|
||||||
@@ -67,7 +68,7 @@ try
|
|||||||
}
|
}
|
||||||
|
|
||||||
builder.Services.Configure<RagSettings>(builder.Configuration.GetSection("Rag"));
|
builder.Services.Configure<RagSettings>(builder.Configuration.GetSection("Rag"));
|
||||||
builder.Services.Configure<AiSettings>(builder.Configuration.GetSection("Ai"));
|
builder.Services.Configure<Rag.Models.Settings.AiSettings>(builder.Configuration.GetSection("Ai"));
|
||||||
builder.Services.Configure<InternalApiSettings>(builder.Configuration.GetSection("InternalApi"));
|
builder.Services.Configure<InternalApiSettings>(builder.Configuration.GetSection("InternalApi"));
|
||||||
|
|
||||||
builder.Services.AddDbContext<RagDbContext>(options =>
|
builder.Services.AddDbContext<RagDbContext>(options =>
|
||||||
|
|||||||
@@ -78,5 +78,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\rag-api-models\rag-api-models.csproj" />
|
<ProjectReference Include="..\rag-api-models\rag-api-models.csproj" />
|
||||||
|
<ProjectReference Include="..\shared-models\shared-models.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Shared.Models.Settings
|
||||||
|
{
|
||||||
|
public class AiSettings
|
||||||
|
{
|
||||||
|
public string Provider { get; set; } = "OpenAI";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<RootNamespace>Shared.Models</RootNamespace>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user