chore(ui): Move some field definitions server side

This commit is contained in:
Richard Palethorpe
2025-03-26 15:56:14 +00:00
parent 7fb99ecf21
commit 319caf8e91
62 changed files with 1534 additions and 1574 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/bwmarrin/discordgo"
"github.com/mudler/LocalAgent/core/agent"
"github.com/mudler/LocalAgent/core/types"
"github.com/mudler/LocalAgent/pkg/config"
"github.com/mudler/LocalAgent/pkg/xlog"
"github.com/sashabaranov/go-openai"
)
@@ -34,6 +35,28 @@ func NewDiscord(config map[string]string) *Discord {
}
}
func DiscordConfigMeta() []config.Field {
return []config.Field{
{
Name: "token",
Label: "Discord Token",
Type: config.FieldTypeText,
Required: true,
},
{
Name: "defaultChannel",
Label: "Default Channel",
Type: config.FieldTypeText,
},
{
Name: "lastMessageDuration",
Label: "Last Message Duration",
Type: config.FieldTypeText,
DefaultValue: "5m",
},
}
}
func (d *Discord) AgentResultCallback() func(state types.ActionState) {
return func(state types.ActionState) {
// Send the result to the bot