MCPcopy Create free account
hub / github.com/compozy/agh / cloneProviderModelConfigs

Function cloneProviderModelConfigs

internal/workspace/clone.go:274–295  ·  view source on GitHub ↗
(src []aghconfig.ProviderModelConfig)

Source from the content-addressed store, hash-verified

272}
273
274func cloneProviderModelConfigs(src []aghconfig.ProviderModelConfig) []aghconfig.ProviderModelConfig {
275 if src == nil {
276 return nil
277 }
278 cloned := make([]aghconfig.ProviderModelConfig, len(src))
279 for idx, model := range src {
280 cloned[idx] = aghconfig.ProviderModelConfig{
281 ID: model.ID,
282 DisplayName: model.DisplayName,
283 ContextWindow: cloneInt64Ptr(model.ContextWindow),
284 MaxInputTokens: cloneInt64Ptr(model.MaxInputTokens),
285 MaxOutputTokens: cloneInt64Ptr(model.MaxOutputTokens),
286 SupportsTools: cloneBoolPtr(model.SupportsTools),
287 SupportsReasoning: cloneBoolPtr(model.SupportsReasoning),
288 ReasoningEfforts: append([]string(nil), model.ReasoningEfforts...),
289 DefaultReasoningEffort: model.DefaultReasoningEffort,
290 CostInputPerMillion: cloneFloat64Ptr(model.CostInputPerMillion),
291 CostOutputPerMillion: cloneFloat64Ptr(model.CostOutputPerMillion),
292 }
293 }
294 return cloned
295}
296
297func cloneModelCatalogConfig(src aghconfig.ModelCatalogConfig) aghconfig.ModelCatalogConfig {
298 return aghconfig.ModelCatalogConfig{

Callers 1

Calls 4

appendFunction · 0.85
cloneInt64PtrFunction · 0.70
cloneBoolPtrFunction · 0.70
cloneFloat64PtrFunction · 0.70

Tested by

no test coverage detected