feat: Auto-Context im Frontend anzeigen und in DB persistieren
- recalled_context-Header verstärkt (klare Nutzungs-Anweisung statt passivem Hinweis) - SSE-Event 'auto_context' ans Frontend senden für Live-Anzeige - Auto-Context als Message (type=auto_context) in DB speichern - Aufklappbare Auto-Context-Box im Chat-Stream und History-Rendering Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
3f2baa1639
commit
9fe6bed59b
6 files changed
+67
-1
No files matched your search
@@ -64,7 +64,17 @@ public partial class AnthropicService
|
||||
{
|
||||
var autoCtx = await BuildAutoContextAsync(messages, chainId, agentId);
|
||||
if (autoCtx != null)
|
||||
{
|
||||
systemPrompt.Add(new { type = "text", text = autoCtx });
|
||||
await SseHelper.TryWriteSse(response, "auto_context", new { context = autoCtx }, sseCt);
|
||||
await _db.SaveMessage(new MessageRecord
|
||||
{
|
||||
ChainId = chainId,
|
||||
Role = "system",
|
||||
Type = "auto_context",
|
||||
Content = autoCtx
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user