use image id

This commit is contained in:
Michael Yang 2024-02-01 11:52:42 -08:00
parent e49dc9f3d8
commit f3761405c8

View file

@ -182,9 +182,10 @@ func (m *Model) ChatPrompts(msgs []api.Message) (*ChatHistory, error) {
currentVars.Prompt = msg.Content
for i := range msg.Images {
currentVars.Prompt += fmt.Sprintf(" [img-%d]", len(images)+i)
id := len(images) + i
currentVars.Prompt += fmt.Sprintf(" [img-%d]", id)
currentVars.Images = append(currentVars.Images, llm.ImageData{
ID: len(images) + i,
ID: id,
Data: msg.Images[i],
})
}