feat(edit): allow to edit agents (#36)

This commit is contained in:
Ettore Di Giacinto
2025-03-11 22:32:13 +01:00
committed by GitHub
parent 9ff2fde44f
commit d451919414
6 changed files with 869 additions and 67 deletions

View File

@@ -102,11 +102,18 @@ func (app *App) registerRoutes(pool *state.AgentPool, webapp *fiber.App) {
}
return c.Render("views/settings", fiber.Map{
// "Character": agent.Character,
"Name": c.Params("name"),
"Status": status,
"Name": c.Params("name"),
"Status": status,
"Actions": services.AvailableActions,
"Connectors": services.AvailableConnectors,
"PromptBlocks": services.AvailableBlockPrompts,
})
})
// New API endpoints for getting and updating agent configuration
webapp.Get("/api/agent/:name/config", app.GetAgentConfig(pool))
webapp.Put("/api/agent/:name/config", app.UpdateAgentConfig(pool))
webapp.Post("/settings/import", app.ImportAgent(pool))
webapp.Get("/settings/export/:name", app.ExportAgent(pool))
}