(endpoint providers.Endpoint)
| 597 | } |
| 598 | |
| 599 | func providerPatchFromEndpoint(endpoint providers.Endpoint) appapi.ProviderPatch { |
| 600 | endpointURL := endpoint.Endpoint |
| 601 | apiKey := endpoint.APIKey |
| 602 | apiKeyEnv := endpoint.APIKeyEnv |
| 603 | supportedClient := endpoint.SupportedClient |
| 604 | listModelsCmd := endpoint.ListModelsCmd |
| 605 | description := endpoint.Description |
| 606 | keepProxyConfig := endpoint.KeepProxyConfig |
| 607 | useProxy := endpoint.UseProxy |
| 608 | models := providers.ListPatch{Op: providers.ListOpReplace, Items: append([]string(nil), endpoint.Models...)} |
| 609 | return appapi.ProviderPatch{ |
| 610 | Endpoint: &endpointURL, |
| 611 | APIKey: &apiKey, |
| 612 | APIKeyEnv: &apiKeyEnv, |
| 613 | SupportedClient: &supportedClient, |
| 614 | Models: &models, |
| 615 | ListModelsCmd: &listModelsCmd, |
| 616 | KeepProxyConfig: &keepProxyConfig, |
| 617 | UseProxy: &useProxy, |
| 618 | Enabled: endpoint.Enabled, |
| 619 | Description: &description, |
| 620 | } |
| 621 | } |
| 622 | |
| 623 | // writeJSON pretty-prints v as 2-space indented JSON with a trailing newline. |
| 624 | func writeJSON(out io.Writer, v any) error { |
no outgoing calls
no test coverage detected