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:
committed by
GitHub
parent
43a46ad1fb
commit
d7cfa7f0b2
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/go-telegram/bot"
|
||||
"github.com/go-telegram/bot/models"
|
||||
"github.com/mudler/LocalAgent/core/agent"
|
||||
"github.com/mudler/LocalAgent/pkg/metaform"
|
||||
)
|
||||
|
||||
type Telegram struct {
|
||||
@@ -37,6 +38,20 @@ func (t *Telegram) AgentReasoningCallback() func(state agent.ActionCurrentState)
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Telegram) ConfigForm() metaform.Form {
|
||||
return metaform.Form{
|
||||
Fields: []metaform.Field{
|
||||
{
|
||||
Kind: metaform.FieldString,
|
||||
Name: "token",
|
||||
Label: "Bot Token",
|
||||
Required: true,
|
||||
Placeholder: "Your Telegram bot token from @BotFather",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Telegram) Start(a *agent.Agent) {
|
||||
ctx, cancel := signal.NotifyContext(a.Context(), os.Interrupt)
|
||||
defer cancel()
|
||||
|
||||
Reference in New Issue
Block a user