Skip to content

关于adk/retry_chatmodel.go中log输出的问题 #938

@wsshow

Description

@wsshow

当前adk/retry_chatmodel.go直接使用内置log来输出日志,这样会干扰用户终端的输出。

建议:

  1. 注入 Logger 接口
// Logger is the interface for logging retry events.
// If not set, retry events are silently dropped.
type Logger interface {
    Printf(format string, args ...any)
}

// ModelRetryConfig configures retry behavior for the ChatModel node.
type ModelRetryConfig struct {
    MaxRetries  int
    IsRetryAble func(ctx context.Context, err error) bool
    BackoffFunc func(ctx context.Context, attempt int) time.Duration

    // Logger is used to log retry events.
    // If nil, retry events are silently dropped.
    Logger Logger
}
  1. 直接移除

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions