(t *testing.T)
| 68 | } |
| 69 | |
| 70 | func TestAppendKnowledgeRound(t *testing.T) { |
| 71 | hist, prompt := appendKnowledgeRound( |
| 72 | []models.Message{{Role: "system", Content: "sys"}}, |
| 73 | "user question", `{"cmd":"search"}`, "the passages") |
| 74 | if len(hist) != 3 || hist[1].Content != "user question" || !strings.Contains(hist[2].Content, `{"cmd":"search"}`) { |
| 75 | t.Fatalf("history shape wrong: %+v", hist) |
| 76 | } |
| 77 | if !strings.Contains(prompt, "the passages") || !strings.Contains(prompt, "cite source paths") { |
| 78 | t.Errorf("follow-up prompt = %q", prompt) |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | func TestChatKnowledgeXMLInstruction_HasFormat(t *testing.T) { |
| 83 | s := chatKnowledgeXMLInstruction() |
nothing calls this directly
no test coverage detected