genkit icon indicating copy to clipboard operation
genkit copied to clipboard

[Go] Missing support for multi-message dotprompt

Open jannwitt opened this issue 1 year ago • 1 comments

It looks like prompt.Execute() does not support multi-message .prompt files in the Go SDK, despite documentation suggesting this is possible. I get this error parts template must produce only one message when i try to execute a multi-message prompt.

To Reproduce example.prompt file:

---
model: vertexai/gemini-2.0-flash
---
{{ role "system" }}

You are a great AI assistant.

{{ role "user" }}

Say hi

Go code:

p := genkit.LookupPrompt(g, "example")
resp, err := p.Execute(ctx, nil)
if err != nil {
	log.Fatal(err)
}

Expected behavior Both messages should be sent to the model in sequence (system + user).

Runtime (please complete the following information): • OS: macOS with ARM64 • Version: 15.5

Go version go1.24.4

If someone could help me out with a workaround or fix that would be 🔥

jannwitt avatar Aug 01 '25 10:08 jannwitt

Hi @jannwitt, I'll take a look at this, thanks for the report

hugoaguirre avatar Aug 07 '25 19:08 hugoaguirre