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

Method SetOAuthModelAlias

sdk/cliproxy/auth/oauth_model_alias.go:83–93  ·  view source on GitHub ↗

SetOAuthModelAlias updates the OAuth model name alias table used during execution. The alias is applied per-auth channel to resolve the upstream model name while keeping the client-visible model name unchanged for translation/response formatting.

(aliases map[string][]internalconfig.OAuthModelAlias)

Source from the content-addressed store, hash-verified

81// The alias is applied per-auth channel to resolve the upstream model name while keeping the
82// client-visible model name unchanged for translation/response formatting.
83func (m *Manager) SetOAuthModelAlias(aliases map[string][]internalconfig.OAuthModelAlias) {
84 if m == nil {
85 return
86 }
87 table := compileOAuthModelAliasTable(aliases)
88 // atomic.Value requires non-nil store values.
89 if table == nil {
90 table = &oauthModelAliasTable{}
91 }
92 m.oauthModelAlias.Store(table)
93}
94
95// applyOAuthModelAlias resolves the upstream model from OAuth model alias.
96// If an alias exists, the returned model is the upstream model.

Calls 1