MCPcopy
hub / github.com/docker/docker-agent / ResolveModelConfig

Function ResolveModelConfig

pkg/rag/strategy/helpers.go:214–229  ·  view source on GitHub ↗

ResolveModelConfig resolves a model reference into a ModelConfig. Supports "provider/model" inline references or named references into the models map.

(ref string, models map[string]latest.ModelConfig)

Source from the content-addressed store, hash-verified

212// ResolveModelConfig resolves a model reference into a ModelConfig.
213// Supports "provider/model" inline references or named references into the models map.
214func ResolveModelConfig(ref string, models map[string]latest.ModelConfig) (latest.ModelConfig, error) {
215 // Try inline "provider/model" format first
216 if parts := strings.SplitN(ref, "/", 2); len(parts) == 2 {
217 return latest.ModelConfig{
218 Provider: parts[0],
219 Model: parts[1],
220 }, nil
221 }
222
223 // Try named reference
224 if cfg, ok := models[ref]; ok {
225 return cfg, nil
226 }
227
228 return latest.ModelConfig{}, fmt.Errorf("model %q not found", ref)
229}
230
231// ParseChunkingConfig extracts chunking configuration from RAGStrategyConfig.
232func ParseChunkingConfig(cfg latest.RAGStrategyConfig) ChunkingConfig {

Callers 3

buildRerankingConfigFunction · 0.92
CreateEmbeddingProviderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected