Backend:
- is_active komplett entfernt, durch is_public (Admin-Toggle) ersetzt
- Neues selected_api_key_id auf users-Tabelle
- AnthropicService: globaler _token entfernt, apiToken pro Request
- Token-Durchreichung: StreamChat → ProcessStream → RunAgentChat →
RunPreparer/RunReview/RunFinalizer, ExecuteTool, send_to_session
- ChatEndpoint: User-Key aus DB laden, an StreamChat übergeben
- TelegramService: Key per bot.UserId auflösen
- CronjobService: Key per job.UserId auflösen
- Neue Endpoints: GET /api/api-keys/available, PUT /api/api-keys/select/{keyId},
GET /api/api-keys/selected, PUT /api/admin/api-keys/{keyId}/public,
POST /api/admin/api-keys/check-all
- Program.cs: AnthropicService ohne Token-Parameter
Frontend:
- API-Keys-Page: Public-Toggle (Globe/Lock) statt Activate/Deactivate
- Alle prüfen Button für Batch-Key-Check
- Chat: Key-Auswahl für alle User (nicht nur Admin)
- Dummy-Badge wenn kein Key ausgewählt
- Fallback-Badge bei Key ohne Usage-Daten
- Key-Switch-Modal: apiGetAvailableKeys + apiSelectApiKey
53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
using System.Collections.Generic;
|
|
using Gott.Services;
|
|
|
|
namespace Gott.Models;
|
|
|
|
public class ChatContext
|
|
{
|
|
public string ChainId { get; set; }
|
|
public string SessionId { get; set; }
|
|
public string ModelId { get; set; }
|
|
public string Provider { get; set; } // "" = Anthropic, "nvidia" = OpenAI-kompatibler Provider
|
|
public string Workspace { get; set; }
|
|
public string AgentId { get; set; }
|
|
public string SystemPromptText { get; set; }
|
|
public List<object> SystemPrompt { get; set; }
|
|
public List<PromptBlock> PromptBlocks { get; set; }
|
|
public string ToolChoice { get; set; }
|
|
public bool UseMemory { get; set; }
|
|
public string WebSearchVersion { get; set; }
|
|
public int MaxIterations { get; set; }
|
|
public AgentRecord Agent { get; set; }
|
|
public SessionRecord Session { get; set; }
|
|
public bool PlanMode { get; set; }
|
|
public string ApiToken { get; set; }
|
|
|
|
// Preparer-Agent (vor dem Worker)
|
|
public SubAgentContext Preparer { get; set; }
|
|
|
|
// Review-Agent
|
|
public SubAgentContext Review { get; set; }
|
|
|
|
// Finalizer-Agent
|
|
public SubAgentContext Finalizer { get; set; }
|
|
}
|
|
|
|
public class SubAgentContext
|
|
{
|
|
public string ModelId { get; set; }
|
|
public List<object> SystemPrompt { get; set; }
|
|
public string AgentId { get; set; }
|
|
public string Workspace { get; set; }
|
|
public bool UseMemory { get; set; }
|
|
public string WebSearchVersion { get; set; }
|
|
public string ToolChoice { get; set; }
|
|
public AgentRecord Agent { get; set; }
|
|
|
|
// Preparer-spezifisch
|
|
public bool AllowUserChoice { get; set; }
|
|
|
|
// Review-spezifisch
|
|
public int MaxReviewIterations { get; set; }
|
|
}
|