关于adk/retry_chatmodel.go中log输出的问题
- Dominant language
- Go
- Stars
- 13k
- Forks
- 1.1k
- Avg merge
- 4h 6m
- Merged PRs (30d)
- 41
Description
当前`adk/retry_chatmodel.go`直接使用内置log来输出日志,这样会干扰用户终端的输出。
建议:
1. 注入 Logger 接口
```go
// 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
}
```
2. 直接移除
Contributor guide
Research direction
Read adk/retry_chatmodel.go and trace where the built-in log is called during retry handling. Decide between the proposed Logger injection and removing the output, then verify that retry behavior no longer writes to the user's terminal and that the chosen configuration is covered by the existing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- ai, backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100