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)
| 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. |
| 138 | func 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. |
| 155 | func sendNotification(options *domain.ChatOptions, patternName, result string) error { |
no outgoing calls
no test coverage detected