From cdc9aa14ed5862fb19ff1620c8d8f7043e00d2f4 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Sun, 3 Sep 2023 18:29:54 -0400 Subject: [PATCH] template extra args --- api/types.go | 11 ++++++----- server/images.go | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/api/types.go b/api/types.go index 8c97a7928..c4da1539a 100644 --- a/api/types.go +++ b/api/types.go @@ -32,11 +32,12 @@ func (e StatusError) Error() string { } type GenerateRequest struct { - Model string `json:"model"` - Prompt string `json:"prompt"` - System string `json:"system"` - Template string `json:"template"` - Context []int `json:"context,omitempty"` + Model string `json:"model"` + Prompt string `json:"prompt"` + System string `json:"system"` + Template string `json:"template"` + Context []int `json:"context,omitempty"` + Args map[string]any `json:"args,omitempty"` Options map[string]interface{} `json:"options"` } diff --git a/server/images.go b/server/images.go index a3b3eb4cc..7930cfe06 100644 --- a/server/images.go +++ b/server/images.go @@ -66,6 +66,7 @@ func (m *Model) Prompt(request api.GenerateRequest, embedding string) (string, e System string Prompt string Embed string + Args map[string]any // deprecated: versions <= 0.0.7 used this to omit the system prompt Context []int @@ -75,6 +76,7 @@ func (m *Model) Prompt(request api.GenerateRequest, embedding string) (string, e vars.System = m.System vars.Prompt = request.Prompt vars.Context = request.Context + vars.Args = request.Args vars.Embed = embedding if request.System != "" {