ollama/server/images_test.go
Bruce MacDonald e03fbf558d chat mode
- add messages as alternative to prompt/response format
- remove deprecated context and template generate parameters from docs
- context and template are still supported for the time being and will continue to work as expected
2023-11-20 12:13:48 -05:00

23 lines
307 B
Go

package server
import (
"testing"
)
func TestModelPrompt(t *testing.T) {
m := Model{
Template: "a{{ .Prompt }}b",
}
s, err := m.Prompt(&PromptVars{
First: true,
Prompt: "<h1>",
})
if err != nil {
t.Fatal(err)
}
want := "a<h1>b"
if s != want {
t.Errorf("got %q, want %q", s, want)
}
}