fix(singleagent): shortcmd without default value (#1881)

main
junwen-lee 2 months ago committed by GitHub
parent 3bd7340d46
commit 305f1cb62f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      backend/application/singleagent/single_agent.go

@ -730,15 +730,18 @@ func (s *SingleAgentApplicationService) getAgentInfo(ctx context.Context, botID
AgentID: ptr.Of(si.ObjectID),
Command: si.ShortcutCommand,
Components: slices.Transform(si.Components, func(i *playground.Components) *bot_common.ShortcutCommandComponent {
return &bot_common.ShortcutCommandComponent{
sc := &bot_common.ShortcutCommandComponent{
Name: i.Name,
Description: i.Description,
Type: i.InputType.String(),
ToolParameter: ptr.Of(i.Parameter),
Options: i.Options,
DefaultValue: ptr.Of(i.DefaultValue.Value),
IsHide: i.Hide,
}
if i.DefaultValue != nil {
sc.DefaultValue = ptr.Of(i.DefaultValue.Value)
}
return sc
}),
}
})

Loading…
Cancel
Save