Avatar: Ctrl+V paste + serverseitige Skalierung auf max 256px; Tool-Boxes: Diff-View für edit/write_file, Foldout für alle Tools, stop_reason im Chat; ImageSharp 3.1.12
This commit is contained in:
1 parent
18b2feef4a
commit
e662548d79
13 files changed
+416
-42
No files matched your search
@@ -229,7 +229,7 @@ public class DatabaseService
|
||||
new { sessionId, now = DateTime.UtcNow.ToString("o") });
|
||||
}
|
||||
|
||||
public async Task UpdateSession(string sessionId, System.Text.Json.JsonElement body)
|
||||
public async Task UpdateSession(string sessionId, System.Text.Json.JsonElement body, ImageService imageService = null)
|
||||
{
|
||||
using var conn = CreateConnection();
|
||||
var sets = new List<string> { "updated_at = @now" };
|
||||
@@ -239,7 +239,13 @@ public class DatabaseService
|
||||
|
||||
if (body.TryGetProperty("name", out var n)) { sets.Add("name = @name"); p.Add("name", n.GetString()); }
|
||||
if (body.TryGetProperty("description", out var d)) { sets.Add("description = @desc"); p.Add("desc", d.GetString()); }
|
||||
if (body.TryGetProperty("image", out var img)) { sets.Add("image = @image"); p.Add("image", img.GetString()); }
|
||||
if (body.TryGetProperty("image", out var img))
|
||||
{
|
||||
var imageData = img.GetString();
|
||||
if (imageService != null) imageData = imageService.ResizeDataUrl(imageData);
|
||||
sets.Add("image = @image");
|
||||
p.Add("image", imageData);
|
||||
}
|
||||
if (body.TryGetProperty("agentId", out var a)) { sets.Add("agent_id = @agentId2"); p.Add("agentId2", a.GetString()); }
|
||||
if (body.TryGetProperty("workspace", out var w)) { sets.Add("workspace = @workspace"); p.Add("workspace", w.GetString()); }
|
||||
if (body.TryGetProperty("context", out var ctx)) { sets.Add("context = @context"); p.Add("context", ctx.GetString()); }
|
||||
|
||||
Reference in new issue
Block a user