Sessions: Sidebar, Session-Wechsel, Archivieren-Button, alles session-bezogen
This commit is contained in:
1 parent
8ddee38032
commit
25f07caf83
15 files changed
+442
-78
No files matched your search
@@ -50,16 +50,27 @@ public static class ChatEndpoint
|
||||
res.Headers["Cache-Control"] = "no-cache";
|
||||
res.Headers["Connection"] = "keep-alive";
|
||||
|
||||
var sessionId = body.SessionId;
|
||||
if (string.IsNullOrEmpty(sessionId))
|
||||
{
|
||||
res.StatusCode = 400;
|
||||
await res.WriteAsJsonAsync(new { error = "sessionId required" });
|
||||
return;
|
||||
}
|
||||
|
||||
var chainId = Guid.NewGuid().ToString("N");
|
||||
|
||||
// Chain zuerst anlegen (FK für messages)
|
||||
await db.CreateChain(new ChainRecord
|
||||
{
|
||||
ChainId = chainId,
|
||||
SessionId = sessionId,
|
||||
Model = modelId,
|
||||
SystemPrompt = body.SystemPrompt
|
||||
});
|
||||
|
||||
// Session-Timestamp aktualisieren
|
||||
await db.UpdateSessionTimestamp(sessionId);
|
||||
|
||||
var messages = new List<object>();
|
||||
foreach (var msg in body.Messages)
|
||||
messages.Add(new { role = msg.Role, content = msg.Content });
|
||||
|
||||
Reference in new issue
Block a user