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

Method Add

internal/appapi/providers.go:167–176  ·  view source on GitHub ↗

Add inserts a new provider.

(ctx context.Context, input ProviderInput)

Source from the content-addressed store, hash-verified

165
166// Add inserts a new provider.
167func (api ProviderAPI) Add(ctx context.Context, input ProviderInput) (Provider, error) {
168 if err := api.prepareProviderOperation(); err != nil {
169 return Provider{}, err
170 }
171 endpoint := endpointFromInput(input)
172 if err := api.store().AddProvider(ctx, input.Name, endpoint); err != nil {
173 return Provider{}, err
174 }
175 return providerFromEndpoint(input.Name, endpoint, api.getenv()), nil
176}
177
178// Update applies a sparse provider patch.
179func (api ProviderAPI) Update(ctx context.Context, name string, patch ProviderPatch) (Provider, error) {

Calls 6

storeMethod · 0.95
getenvMethod · 0.95
endpointFromInputFunction · 0.85
providerFromEndpointFunction · 0.85
AddProviderMethod · 0.80