(name string, endpoint providers.Endpoint, getenv func(string) string)
| 262 | return providers.ResolveModels(endpoint, name, api.cacheTTL(), filepath.Join(pathutil.CacheDir(), "models"), api.getenv()) |
| 263 | } |
| 264 | func providerFromEndpoint(name string, endpoint providers.Endpoint, getenv func(string) string) Provider { |
| 265 | return Provider{ |
| 266 | Name: name, |
| 267 | Endpoint: endpoint.Endpoint, |
| 268 | APIKey: endpoint.APIKey, |
| 269 | APIKeyEnv: endpoint.APIKeyEnv, |
| 270 | SupportedClient: endpoint.SupportedClient, |
| 271 | Clients: endpoint.Clients(), |
| 272 | Models: append([]string(nil), endpoint.Models...), |
| 273 | KeepProxyConfig: endpoint.KeepProxyConfig, |
| 274 | UseProxy: endpoint.UseProxy, |
| 275 | Enabled: endpoint.IsEnabled(), |
| 276 | Description: endpoint.Description, |
| 277 | ListModelsCmd: endpoint.ListModelsCmd, |
| 278 | MaskedAPIKey: providers.MaskedAPIKey(providers.ResolveAPIKey(endpoint, getenv)), |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | func endpointFromInput(input ProviderInput) providers.Endpoint { |
| 283 | supportedClient := input.SupportedClient |
no test coverage detected