Skip to content

fix(prompt): prompt metadata for middleware and tools#5216

Open
MichaelDoyle wants to merge 2 commits intomainfrom
md/go/prompt-metadata
Open

fix(prompt): prompt metadata for middleware and tools#5216
MichaelDoyle wants to merge 2 commits intomainfrom
md/go/prompt-metadata

Conversation

@MichaelDoyle
Copy link
Copy Markdown
Contributor

Description here... Help the reviewer by:

  • linking to an issue that includes more details
  • if it's a new feature include samples of how to use the new feature
  • (optional if issue link is provided) if you fixed a bug include basic bug details

Checklist (if applicable):

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances prompt metadata by capturing tool choice and middleware configurations during prompt definition and loading. It introduces a helper function to extract middleware names and configurations into a standardized format. Feedback suggests improving consistency in this helper by omitting the 'config' key when it is empty or null, matching the logic used for other input types.

Comment thread go/ai/prompt.go Outdated
@MichaelDoyle MichaelDoyle force-pushed the md/go/prompt-metadata branch 3 times, most recently from d423770 to 5f8760e Compare April 30, 2026 15:26
@MichaelDoyle MichaelDoyle force-pushed the md/go/prompt-metadata branch from 5f8760e to 2192ece Compare April 30, 2026 15:34
Comment thread go/ai/prompt.go
if variant != "" {
promptMetadata["variant"] = variant
}
promptMetadata["name"] = name
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These mostly get overwritten with maps.Copy() in DefinePrompt, no? Only some survive because they're not set there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants