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

Function oauthModelAliasToInternal

sdk/pluginhost/host.go:190–213  ·  view source on GitHub ↗
(in map[string][]OAuthModelAlias)

Source from the content-addressed store, hash-verified

188}
189
190func oauthModelAliasToInternal(in map[string][]OAuthModelAlias) map[string][]internalconfig.OAuthModelAlias {
191 if len(in) == 0 {
192 return nil
193 }
194 out := make(map[string][]internalconfig.OAuthModelAlias, len(in))
195 for provider, aliases := range in {
196 if len(aliases) == 0 {
197 continue
198 }
199 items := make([]internalconfig.OAuthModelAlias, 0, len(aliases))
200 for _, alias := range aliases {
201 items = append(items, internalconfig.OAuthModelAlias{
202 Name: alias.Name,
203 Alias: alias.Alias,
204 Fork: alias.Fork,
205 })
206 }
207 out[provider] = items
208 }
209 if len(out) == 0 {
210 return nil
211 }
212 return out
213}
214
215func registryModelsToPluginModels(models []*internalregistry.ModelInfo) []ModelInfo {
216 if len(models) == 0 {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected