style: correct format by goimports (#2289)

This commit is contained in:
skynono
2025-09-28 16:17:53 +08:00
committed by GitHub
parent fa16cddfd2
commit 5915d49940
4 changed files with 10 additions and 11 deletions

View File

@ -183,9 +183,9 @@ func parseChatflowParameters(ctx context.Context, ar *run.ChatV3Request) (map[st
if err := json.Unmarshal([]byte(*ar.Parameters), &parameters); err != nil {
return nil, errors.New("parameters field should be an object, not a string")
}
return parameters,nil
return parameters, nil
}
return parameters,nil
return parameters, nil
}
func (a *OpenapiAgentRunApplication) buildTools(ctx context.Context, shortcmd *run.ShortcutCommandDetail) ([]*entity.Tool, error) {

View File

@ -58,10 +58,10 @@ func (c *impl) buildSingleAgentStreamExecuteReq(ctx context.Context, agentRuntim
) *model.ExecuteRequest {
return &model.ExecuteRequest{
Identity: c.buildIdentity(agentRuntime),
Input: agentRuntime.Input,
History: agentRuntime.HistoryMsg,
UserID: agentRuntime.UserID,
Identity: c.buildIdentity(agentRuntime),
Input: agentRuntime.Input,
History: agentRuntime.HistoryMsg,
UserID: agentRuntime.UserID,
CustomVariables: agentRuntime.CustomVariables,
PreCallTools: slices.Transform(agentRuntime.PreRetrieveTools, func(tool *agentrun.Tool) *agentrun.ToolsRetriever {
return &agentrun.ToolsRetriever{

View File

@ -43,8 +43,7 @@ type Config struct {
ModelFactory chatmodel.Factory
CPStore compose.CheckPointStore
CustomVariables map[string]string
CustomVariables map[string]string
ConversationID int64
}
@ -75,7 +74,7 @@ func BuildAgent(ctx context.Context, conf *Config) (r *AgentRunner, err error) {
return nil, err
}
if conf.CustomVariables != nil {
for k,v := range conf.CustomVariables {
for k, v := range conf.CustomVariables {
avs[k] = v
}
}

View File

@ -82,11 +82,11 @@ func (art *AgentRuntime) ChatflowRun(ctx context.Context, imagex imagex.ImageX)
"USER_INPUT": concatWfInput(art),
}
if art.GetRunMeta().ChatflowParameters != nil {
for k,v := range art.GetRunMeta().ChatflowParameters {
for k, v := range art.GetRunMeta().ChatflowParameters {
chatInput[k] = v
}
}
wfStreamer, err = crossworkflow.DefaultSVC().StreamExecute(ctx, executeConfig, chatInput)
wfStreamer, err = crossworkflow.DefaultSVC().StreamExecute(ctx, executeConfig, chatInput)
}
if err != nil {
return err