writePartialClassifierModel writes a classifier model that has the outer Chat template but no ChatMessage — exercises the newTemplateRenderer "refuse partial templating" branch, which makes buildClassifier reject the router with a missing-template error.
(modelDir, name string)
| 527 | // newTemplateRenderer "refuse partial templating" branch, which makes |
| 528 | // buildClassifier reject the router with a missing-template error. |
| 529 | func writePartialClassifierModel(modelDir, name string) { |
| 530 | body := `name: ` + name + ` |
| 531 | backend: llama-cpp |
| 532 | known_usecases: |
| 533 | - score |
| 534 | stopwords: |
| 535 | - <|im_end|> |
| 536 | template: |
| 537 | chat: | |
| 538 | {{.Input -}} |
| 539 | <|im_start|>assistant |
| 540 | ` |
| 541 | Expect(os.WriteFile(filepath.Join(modelDir, name+".yaml"), []byte(body), 0o644)).To(Succeed()) |
| 542 | } |