MCPcopy Create free account
hub / github.com/docker/docker-agent / parseModelShorthand

Function parseModelShorthand

cmd/root/flags.go:151–159  ·  view source on GitHub ↗

parseModelShorthand parses "provider/model" into a ModelConfig

(s string)

Source from the content-addressed store, hash-verified

149
150// parseModelShorthand parses "provider/model" into a ModelConfig
151func parseModelShorthand(s string) *latest.ModelConfig {
152 if idx := strings.Index(s, "/"); idx > 0 && idx < len(s)-1 {
153 return &latest.ModelConfig{
154 Provider: s[:idx],
155 Model: s[idx+1:],
156 }
157 }
158 return nil
159}
160
161// newListener creates a TCP listener and returns a cleanup function that
162// must be deferred by the caller. The cleanup function closes the listener.

Callers 1

addGatewayFlagsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected