Agents: CRUD, DB table, session binding, replace model picker
- agents table with name, avatar, description, model, persona, instructions, soft-delete - AgentEndpoint (GET/POST/PUT/DELETE /api/agents) - sessions + chains now reference agent_id - ChatEndpoint resolves agent from session (no agent = no chat) - system prompt built from agent persona + instructions - frontend: agent editor with avatar upload, agent cards on dashboard - session: agent dropdown replaces model picker, choice persisted
This commit is contained in:
1 parent
0cd2d51d32
commit
449c872296
16 files changed
+552
-46
No files matched your search
@@ -0,0 +1,16 @@
|
||||
namespace Gott.Models;
|
||||
|
||||
public class AgentRecord
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string AgentId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Avatar { get; set; } // base64 data url
|
||||
public string Description { get; set; }
|
||||
public string Model { get; set; } // sonnet, opus
|
||||
public string Persona { get; set; }
|
||||
public string Instructions { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
public string CreatedAt { get; set; }
|
||||
public string UpdatedAt { get; set; }
|
||||
}
|
||||
@@ -5,6 +5,7 @@ public class ChainRecord
|
||||
public long Id { get; set; }
|
||||
public string ChainId { get; set; }
|
||||
public string SessionId { get; set; }
|
||||
public string AgentId { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string SystemPrompt { get; set; }
|
||||
public long InputTokens { get; set; }
|
||||
|
||||
@@ -14,9 +14,6 @@ public class ChatMessage
|
||||
|
||||
public class ChatRequest
|
||||
{
|
||||
[JsonPropertyName("model")]
|
||||
public string Model { get; set; } = "sonnet";
|
||||
|
||||
[JsonPropertyName("messages")]
|
||||
public List<ChatMessage> Messages { get; set; } = new();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ public class SessionRecord
|
||||
public long Id { get; set; }
|
||||
public string SessionId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string AgentId { get; set; }
|
||||
public string CreatedAt { get; set; }
|
||||
public string UpdatedAt { get; set; }
|
||||
}
|
||||
Reference in new issue
Block a user