- Neuer Menüpunkt 'Mein Profil' statt 'Logout' - Profil-Page: Anzeigename, Persona (Freitext), Passwort ändern, Logout - ProfileEndpoint: GET/PUT /api/profile, PUT /api/profile/password - User-Persona im System-Prompt statt USER.md (Fallback: Anzeigename/Username) - SystemPromptBuilder: dataDir-Parameter entfernt, userPersona-Parameter hinzugefügt - DB-Migration: persona-Spalte in users-Tabelle
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System;
|
|
using System.IO;
|
|
using Gott.Endpoints;
|
|
using Gott.Middleware;
|
|
using Gott.Services;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
builder.Services.AddHttpClient();
|
|
|
|
var dataDir = Path.Combine(AppContext.BaseDirectory, "data");
|
|
|
|
var authService = new AuthService();
|
|
var dbService = new DatabaseService(Path.Combine(dataDir, "gott.db"));
|
|
dbService.EnsureDefaultUser(authService);
|
|
|
|
builder.Services.AddSingleton(authService);
|
|
builder.Services.AddSingleton(dbService);
|
|
builder.Services.AddSingleton(new ToolService());
|
|
builder.Services.AddSingleton(new ImageService());
|
|
builder.Services.AddSingleton(new StreamingTracker());
|
|
builder.Services.AddSingleton(new MemoryService(dataDir));
|
|
builder.Services.AddSingleton(new SkillService(dataDir));
|
|
|
|
var app = builder.Build();
|
|
app.UseDefaultFiles();
|
|
app.UseStaticFiles();
|
|
app.UseMiddleware<AuthMiddleware>();
|
|
|
|
app.MapAuthEndpoints();
|
|
app.MapChatEndpoint();
|
|
app.MapHistoryEndpoint();
|
|
app.MapSessionEndpoints();
|
|
app.MapAgentEndpoints();
|
|
app.MapWorkspaceEndpoint();
|
|
app.MapInfoEndpoint();
|
|
app.MapBackupEndpoint();
|
|
app.MapSkillEndpoints();
|
|
app.MapProfileEndpoints();
|
|
|
|
app.Run("http://0.0.0.0:19000");
|