Generate connector form based on meta-data (#62)

* Ignore volumes and exe

* Export form meta-data

* use dynamic metaform for connectors

* fix populating form
This commit is contained in:
Richard Palethorpe
2025-03-20 15:00:37 +00:00
committed by GitHub
parent 43a46ad1fb
commit d7cfa7f0b2
15 changed files with 630 additions and 78 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/bwmarrin/discordgo"
"github.com/mudler/LocalAgent/core/agent"
"github.com/mudler/LocalAgent/pkg/metaform"
"github.com/mudler/LocalAgent/pkg/xlog"
)
@@ -37,6 +38,27 @@ func (d *Discord) AgentReasoningCallback() func(state agent.ActionCurrentState)
}
}
func (d *Discord) ConfigForm() metaform.Form {
return metaform.Form{
Fields: []metaform.Field{
{
Kind: metaform.FieldString,
Name: "token",
Label: "Bot Token",
Required: true,
Placeholder: "Your Discord bot token",
},
{
Kind: metaform.FieldString,
Name: "defaultChannel",
Label: "Default Channel",
Required: true,
Placeholder: "The default channel for the bot to join",
},
},
}
}
func (d *Discord) Start(a *agent.Agent) {
Token := d.token