Skip to content

[Go]There is no list of tools after loading the prompt。 #3499

@eric642

Description

@eric642

Describe the bug
There is no list of tools after loading the prompt。

To Reproduce

func Run1(ctx context.Context, query string) (string, error) {
	g := genkit.Init(
		ctx,
		genkit.WithPlugins(&anthropic.Anthropic{}),
		genkit.WithDefaultModel("claude-4-opus-20250514"),
		genkit.WithPromptDir(aicommon.WorkDirWith("prompts")),
	)
	prompt := genkit.LookupPrompt(g, "ex")
	if prompt == nil {
		return "", fmt.Errorf("lookup prompt failed")
	}
	ac, err := prompt.Render(ctx, map[string]any{
		"date":     time.Now().Format(time.DateTime),
		"question": query,
		"location": "chian",
	})
	if err != nil {
		return "", err
	}
        // ac.Tools is nil
	log.Info().Any("ac", ac).Msg("render")
	return "", nil
}

The content of my prompt file

---
system: "Answer questions using the tools you have."
tools: 
 - getWeather
input:
  schema:
    location: string
---

What is the weather in {{location}}?

Screenshots
Image

Runtime (please complete the following information):

  • OS: [e.g. Linux, MacOS]
  • Version [e.g. 22]

** Go version
go version
go version go1.24.6 darwin/arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggo

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions