Better types and naming closer to style.
This commit is contained in:
parent
49a5483139
commit
b0c216584c
1 changed files with 5 additions and 5 deletions
|
@ -187,9 +187,9 @@ func (s *Server) GenerateHandler(c *gin.Context) {
|
||||||
values.Messages = append(msgs, api.Message{Role: "user", Content: req.Prompt})
|
values.Messages = append(msgs, api.Message{Role: "user", Content: req.Prompt})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var s string
|
||||||
var b bytes.Buffer
|
var b bytes.Buffer
|
||||||
var t bytes.Buffer
|
if err := tmpl.Execute(&b, values); err != nil {
|
||||||
if err := tmpl.Execute(&t, values); err != nil {
|
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -200,11 +200,11 @@ func (s *Server) GenerateHandler(c *gin.Context) {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
b.WriteString(prev)
|
s += prev
|
||||||
}
|
}
|
||||||
|
|
||||||
b.WriteString(t.String());
|
s += b.String();
|
||||||
prompt = b.String()
|
prompt = s
|
||||||
}
|
}
|
||||||
|
|
||||||
slog.Debug("generate request", "prompt", prompt, "images", images)
|
slog.Debug("generate request", "prompt", prompt, "images", images)
|
||||||
|
|
Loading…
Reference in a new issue