Skip to content

Commit

Permalink
feat(templates): add sprig to multimodal templates
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
  • Loading branch information
mudler committed Oct 17, 2024
1 parent 54c0f15 commit 0309bfb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/templates/multimodal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package templates
import (
"bytes"
"text/template"

"github.com/Masterminds/sprig/v3"
)

func TemplateMultiModal(templateString string, templateID int, text string) (string, error) {
// compile the template
tmpl, err := template.New("template").Parse(templateString)
tmpl, err := template.New("template").Funcs(sprig.FuncMap()).Parse(templateString)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 0309bfb

Please sign in to comment.