diff --git a/compose/chain/main.go b/compose/chain/main.go index 7023fa7..d4a71f3 100644 --- a/compose/chain/main.go +++ b/compose/chain/main.go @@ -40,7 +40,7 @@ func main() { ctx := context.Background() // build branch func const randLimit = 2 - branchCond := func(ctx context.Context, input map[string]any) (string, error) { // nolint: byted_all_nil_return + branchCond := func(ctx context.Context, input map[string]any) (string, error) { if rand.Intn(randLimit) == 1 { return "b1", nil } @@ -110,7 +110,7 @@ func main() { logs.Infof("in view lambda: %v", kvs) return kvs, nil })). - AppendBranch(compose.NewChainBranch(branchCond).AddLambda("b1", b1).AddLambda("b2", b2)). // nolint: byted_use_receiver_without_nilcheck + AppendBranch(compose.NewChainBranch(branchCond).AddLambda("b1", b1).AddLambda("b2", b2)). AppendPassthrough(). AppendParallel(parallel). AppendGraph(rolePlayerChain). diff --git a/compose/graph/state/state_graph.go b/compose/graph/state/state_graph.go index 26bdd91..07567fd 100644 --- a/compose/graph/state/state_graph.go +++ b/compose/graph/state/state_graph.go @@ -71,7 +71,6 @@ func main() { sr, sw := schema.Pipe[string](utf8.RuneCountInString(outStr)) - // nolint: byted_goroutine_recover go func() { for _, field := range strings.Fields(outStr) { sw.Send(field+" ", nil) diff --git a/flow/agent/deer-go/biz/eino/coder.go b/flow/agent/deer-go/biz/eino/coder.go index 19afc58..415e865 100644 --- a/flow/agent/deer-go/biz/eino/coder.go +++ b/flow/agent/deer-go/biz/eino/coder.go @@ -71,7 +71,7 @@ func loadCoderMsg(ctx context.Context, name string, opts ...any) (output []*sche "CURRENT_TIME": time.Now().Format("2006-01-02 15:04:05"), "user_input": msg, } - output, err = promptTemp.Format(context.Background(), variables) + output, err = promptTemp.Format(ctx, variables) return err }) return output, err diff --git a/flow/agent/deer-go/biz/eino/coordinator.go b/flow/agent/deer-go/biz/eino/coordinator.go index 030a07d..f4d513d 100644 --- a/flow/agent/deer-go/biz/eino/coordinator.go +++ b/flow/agent/deer-go/biz/eino/coordinator.go @@ -51,7 +51,7 @@ func loadMsg(ctx context.Context, name string, opts ...any) (output []*schema.Me "CURRENT_TIME": time.Now().Format("2006-01-02 15:04:05"), "user_input": state.Messages, } - output, err = promptTemp.Format(context.Background(), variables) + output, err = promptTemp.Format(ctx, variables) return err }) return output, err diff --git a/flow/agent/deer-go/biz/eino/planner.go b/flow/agent/deer-go/biz/eino/planner.go index 80561ee..818bbc9 100644 --- a/flow/agent/deer-go/biz/eino/planner.go +++ b/flow/agent/deer-go/biz/eino/planner.go @@ -61,7 +61,7 @@ func loadPlannerMsg(ctx context.Context, name string, opts ...any) (output []*sc "CURRENT_TIME": time.Now().Format("2006-01-02 15:04:05"), "user_input": state.Messages, } - output, err = promptTemp.Format(context.Background(), variables) + output, err = promptTemp.Format(ctx, variables) return err }) return output, err diff --git a/flow/agent/deer-go/biz/eino/reporter.go b/flow/agent/deer-go/biz/eino/reporter.go index 385cddc..d77e115 100644 --- a/flow/agent/deer-go/biz/eino/reporter.go +++ b/flow/agent/deer-go/biz/eino/reporter.go @@ -58,7 +58,7 @@ func loadReporterMsg(ctx context.Context, name string, opts ...any) (output []*s "CURRENT_TIME": time.Now().Format("2006-01-02 15:04:05"), "user_input": msg, } - output, err = promptTemp.Format(context.Background(), variables) + output, err = promptTemp.Format(ctx, variables) return err }) return output, err diff --git a/flow/agent/deer-go/biz/eino/researcher.go b/flow/agent/deer-go/biz/eino/researcher.go index a364cfb..650577c 100644 --- a/flow/agent/deer-go/biz/eino/researcher.go +++ b/flow/agent/deer-go/biz/eino/researcher.go @@ -73,7 +73,7 @@ func loadResearcherMsg(ctx context.Context, name string, opts ...any) (output [] "CURRENT_TIME": time.Now().Format("2006-01-02 15:04:05"), "user_input": msg, } - output, err = promptTemp.Format(context.Background(), variables) + output, err = promptTemp.Format(ctx, variables) return err }) return output, err diff --git a/flow/agent/deer-go/biz/infra/logger.go b/flow/agent/deer-go/biz/infra/logger.go index 0311a7a..dbf7da3 100644 --- a/flow/agent/deer-go/biz/infra/logger.go +++ b/flow/agent/deer-go/biz/infra/logger.go @@ -136,7 +136,7 @@ func (cb *LoggerCallback) OnStart(ctx context.Context, info *callbacks.RunInfo, func (cb *LoggerCallback) OnEnd(ctx context.Context, info *callbacks.RunInfo, output callbacks.CallbackOutput) context.Context { //fmt.Println("=========[OnEnd]=========", info.Name, "|", info.Component, "|", info.Type) - //outputStr, _ := json.MarshalIndent(output, "", " ") // nolint: byted_s_returned_err_check + //outputStr, _ := json.MarshalIndent(output, "", " ") //if len(outputStr) > 200 { // outputStr = outputStr[:200] //} diff --git a/flow/agent/react/react.go b/flow/agent/react/react.go index 94779a7..c6984d2 100644 --- a/flow/agent/react/react.go +++ b/flow/agent/react/react.go @@ -169,14 +169,14 @@ type LoggerCallback struct { func (cb *LoggerCallback) OnStart(ctx context.Context, info *callbacks.RunInfo, input callbacks.CallbackInput) context.Context { fmt.Println("==================") - inputStr, _ := json.MarshalIndent(input, "", " ") // nolint: byted_s_returned_err_check + inputStr, _ := json.MarshalIndent(input, "", " ") fmt.Printf("[OnStart] %s\n", string(inputStr)) return ctx } func (cb *LoggerCallback) OnEnd(ctx context.Context, info *callbacks.RunInfo, output callbacks.CallbackOutput) context.Context { fmt.Println("=========[OnEnd]=========") - outputStr, _ := json.MarshalIndent(output, "", " ") // nolint: byted_s_returned_err_check + outputStr, _ := json.MarshalIndent(output, "", " ") fmt.Println(string(outputStr)) return ctx } diff --git a/flow/agent/react/tools/service.go b/flow/agent/react/tools/service.go index 3007059..1688df6 100644 --- a/flow/agent/react/tools/service.go +++ b/flow/agent/react/tools/service.go @@ -144,7 +144,7 @@ func (rd *restaurantDatabase) GetDishesByRestaurant(ctx context.Context, restaur return res, nil } -func getData() map[string][]restaurantDataItem { // nolint: byted_s_too_many_lines_in_func +func getData() map[string][]restaurantDataItem { return map[string][]restaurantDataItem{ "北京": { {