Document llm NewClient logger help
This commit is contained in:
@@ -58,7 +58,8 @@ type Client struct {
|
||||
}
|
||||
|
||||
// NewClient creates a client from cfg. If cfg.Timeout is empty, requests have a
|
||||
// five-minute timeout. log must be non-nil.
|
||||
// five-minute timeout. log must be non-nil; pass
|
||||
// slog.New(slog.DiscardHandler) to run without logs.
|
||||
func NewClient(cfg Config, log *slog.Logger) (*Client, error) {
|
||||
if err := cfg.Validate(); err != nil {
|
||||
return nil, fmt.Errorf("invalid config: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user