MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / Pick

Method Pick

sdk/cliproxy/auth/selector.go:294–303  ·  view source on GitHub ↗

Pick selects the first available auth for the provider in a deterministic manner.

(ctx context.Context, provider, model string, opts cliproxyexecutor.Options, auths []*Auth)

Source from the content-addressed store, hash-verified

292
293// Pick selects the first available auth for the provider in a deterministic manner.
294func (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
305func isAuthBlockedForModel(auth *Auth, model string, now time.Time) (bool, blockReason, time.Time) {
306 if auth == nil {

Calls 2

getAvailableAuthsFunction · 0.85