Skip to content

[Go] Missing support for multi-message dotprompt #3361

@jannwitt

Description

@jannwitt

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 🔥

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggo

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions