MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / providerPatchFromEndpoint

Function providerPatchFromEndpoint

internal/cli/provider_cmd.go:599–621  ·  view source on GitHub ↗
(endpoint providers.Endpoint)

Source from the content-addressed store, hash-verified

597}
598
599func 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.
624func writeJSON(out io.Writer, v any) error {

Callers 1

providerUpdateCommandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected