From 60b4db63890d84e1f6711e037455f76b2228fc54 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Wed, 19 Jul 2023 23:22:19 -0700 Subject: [PATCH] add .First --- server/images.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/images.go b/server/images.go index 9be2c68b..1ac5b74b 100644 --- a/server/images.go +++ b/server/images.go @@ -37,6 +37,7 @@ func (m *Model) Prompt(request api.GenerateRequest) (string, error) { } var vars struct { + First bool System string Prompt string @@ -44,8 +45,10 @@ func (m *Model) Prompt(request api.GenerateRequest) (string, error) { Context []int } + vars.First = len(vars.Context) == 0 vars.System = m.System vars.Prompt = request.Prompt + vars.Context = request.Context var sb strings.Builder if err := tmpl.Execute(&sb, vars); err != nil {