mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-11 00:07:07 +00:00
preserve last assistant message (#5802)
This commit is contained in:
@@ -260,6 +260,26 @@ func TestExecuteWithMessages(t *testing.T) {
|
||||
|
||||
Hello friend![/INST] Hello human![INST] What is your name?[/INST] `,
|
||||
},
|
||||
{
|
||||
"mistral assistant",
|
||||
[]template{
|
||||
{"no response", `[INST] {{ .Prompt }}[/INST] `},
|
||||
{"response", `[INST] {{ .Prompt }}[/INST] {{ .Response }}`},
|
||||
{"messages", `
|
||||
{{- range $i, $m := .Messages }}
|
||||
{{- if eq .Role "user" }}[INST] {{ .Content }}[/INST] {{ else if eq .Role "assistant" }}{{ .Content }}{{ end }}
|
||||
{{- end }}`},
|
||||
},
|
||||
Values{
|
||||
Messages: []api.Message{
|
||||
{Role: "user", Content: "Hello friend!"},
|
||||
{Role: "assistant", Content: "Hello human!"},
|
||||
{Role: "user", Content: "What is your name?"},
|
||||
{Role: "assistant", Content: "My name is Ollama and I"},
|
||||
},
|
||||
},
|
||||
`[INST] Hello friend![/INST] Hello human![INST] What is your name?[/INST] My name is Ollama and I`,
|
||||
},
|
||||
{
|
||||
"chatml",
|
||||
[]template{
|
||||
|
||||
Reference in New Issue
Block a user