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)
| 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. |
| 83 | func (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. |