MCPcopy Create free account
hub / github.com/danielmiessler/Fabric / applyPatternModel

Function applyPatternModel

internal/cli/chat.go:138–152  ·  view source on GitHub ↗

applyPatternModel applies FABRIC_MODEL_ when no model is set. The value is a "vendor|model" pair or a model name for one pattern.

(currentFlags *Flags)

Source from the content-addressed store, hash-verified

136// applyPatternModel applies FABRIC_MODEL_<PATTERN> when no model is set.
137// The value is a "vendor|model" pair or a model name for one pattern.
138func applyPatternModel(currentFlags *Flags) {
139 if currentFlags.Pattern == "" || currentFlags.Model != "" {
140 return
141 }
142 envVar := "FABRIC_MODEL_" + strings.ToUpper(strings.ReplaceAll(currentFlags.Pattern, "-", "_"))
143 if modelSpec := os.Getenv(envVar); modelSpec != "" {
144 parts := strings.SplitN(modelSpec, "|", 2)
145 if len(parts) == 2 {
146 currentFlags.Vendor = parts[0]
147 currentFlags.Model = parts[1]
148 } else {
149 currentFlags.Model = modelSpec
150 }
151 }
152}
153
154// sendNotification runs the custom notification command, or the built-in notifier when none is set.
155func sendNotification(options *domain.ChatOptions, patternName, result string) error {

Callers 2

renderPromptExportFunction · 0.85
handleChatProcessingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected