This commit is contained in:
Leonid Pershin
2025-10-17 02:39:43 +03:00
parent 5ce7219703
commit 655b46a186
5 changed files with 41 additions and 5 deletions

View File

@@ -6,6 +6,7 @@
<UserSecretsId>dotnet-ChatBot-90278280-a615-4c51-af59-878577c2c7b1</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetEnv" Version="3.1.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
<PackageReference Include="OllamaSharp" Version="5.4.7" />
<PackageReference Include="Telegram.Bot" Version="22.7.2" />

View File

@@ -9,11 +9,15 @@ using ChatBot.Services.Interfaces;
using ChatBot.Services.Telegram.Commands;
using ChatBot.Services.Telegram.Interfaces;
using ChatBot.Services.Telegram.Services;
using DotNetEnv;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Serilog;
using Telegram.Bot;
// Загружаем переменные окружения из .env файла
Env.Load();
var builder = Host.CreateApplicationBuilder(args);
// Настройка Serilog

View File

@@ -31,11 +31,11 @@
"Enrich": ["FromLogContext", "WithMachineName", "WithThreadId"]
},
"TelegramBot": {
"BotToken": "8461762778:AAEk1wHMqd84_I_loL9FQPciZakGYe557KA"
"BotToken": "${TELEGRAM_BOT_TOKEN}"
},
"Ollama": {
"Url": "https://ai.api.home/",
"DefaultModel": "gemma3:4b"
"Url": "${OLLAMA_URL}",
"DefaultModel": "${OLLAMA_DEFAULT_MODEL}"
},
"AI": {
"Temperature": 0.9,
@@ -54,7 +54,7 @@
"StatusCheckTimeoutSeconds": 10
},
"Database": {
"ConnectionString": "Host=localhost;Port=5432;Database=chatbot;Username=postgres;Password=postgres",
"ConnectionString": "Host=${DB_HOST};Port=${DB_PORT};Database=${DB_NAME};Username=${DB_USER};Password=${DB_PASSWORD}",
"EnableSensitiveDataLogging": false,
"CommandTimeout": 30
}