Pick selects the first available auth for the provider in a deterministic manner.
(ctx context.Context, provider, model string, opts cliproxyexecutor.Options, auths []*Auth)
| 292 | |
| 293 | // Pick selects the first available auth for the provider in a deterministic manner. |
| 294 | func (s *FillFirstSelector) Pick(ctx context.Context, provider, model string, opts cliproxyexecutor.Options, auths []*Auth) (*Auth, error) { |
| 295 | _ = opts |
| 296 | now := time.Now() |
| 297 | available, err := getAvailableAuths(auths, provider, model, now) |
| 298 | if err != nil { |
| 299 | return nil, err |
| 300 | } |
| 301 | available = preferCodexWebsocketAuths(ctx, provider, available) |
| 302 | return available[0], nil |
| 303 | } |
| 304 | |
| 305 | func isAuthBlockedForModel(auth *Auth, model string, now time.Time) (bool, blockReason, time.Time) { |
| 306 | if auth == nil { |