Skip to content

fix: render prompt metadata along with generateoptions #3400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2025

Conversation

MichaelDoyle
Copy link
Member

It got a little "meta" with all the layers of metadata. Let me know if this looks crazy or not. :)

dotprompt:

---
model: googleai/gemini-1.5-flash
config:
  maxOutputTokens: 2048
  temperature: 0.6
  topK: 16
  topP: 0.95
  stopSequences:
    - STAWP!
  safetySettings:
    - category: HARM_CATEGORY_HATE_SPEECH
      threshold: BLOCK_ONLY_HIGH
    - category: HARM_CATEGORY_DANGEROUS_CONTENT
      threshold: BLOCK_ONLY_HIGH
    - category: HARM_CATEGORY_HARASSMENT
      threshold: BLOCK_ONLY_HIGH
    - category: HARM_CATEGORY_SEXUALLY_EXPLICIT
      threshold: BLOCK_ONLY_HIGH
metadata:
  foo: bar
input:
  schema:
    name: string
    persona?: string
  default:
    persona: Space Pirate
---

Say hello to {{name}} in the voice of a {{persona}}.

"rendered" as:

{
  "model": "googleai/gemini-1.5-flash",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "text": "Say hello to  in the voice of a ."
        }
      ]
    }
  ],
  "output": {},
  "config": {
    "maxOutputTokens": 2048,
    "temperature": 0.6,
    "topK": 16,
    "topP": 0.95,
    "stopSequences": [
      "STAWP!"
    ],
    "safetySettings": [
      {
        "category": "HARM_CATEGORY_HATE_SPEECH",
        "threshold": "BLOCK_ONLY_HIGH"
      },
      {
        "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
        "threshold": "BLOCK_ONLY_HIGH"
      },
      {
        "category": "HARM_CATEGORY_HARASSMENT",
        "threshold": "BLOCK_ONLY_HIGH"
      },
      {
        "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
        "threshold": "BLOCK_ONLY_HIGH"
      }
    ]
  },
  "metadata": {
    "prompt": {
      "foo": "bar"
    }
  }
}

@MichaelDoyle MichaelDoyle requested a review from pavelgj August 12, 2025 02:38
@github-actions github-actions bot added the js label Aug 12, 2025
@MichaelDoyle MichaelDoyle changed the title fix: render n prompt metadata along with generateoptions fix: render prompt metadata along with generateoptions Aug 12, 2025
@MichaelDoyle MichaelDoyle force-pushed the dotprompt-rendered-meta branch from 0f3e628 to c2163af Compare August 12, 2025 02:50
@MichaelDoyle MichaelDoyle force-pushed the dotprompt-rendered-meta branch from c2163af to 19d980f Compare August 12, 2025 14:07
@MichaelDoyle MichaelDoyle merged commit 8c00dfd into main Aug 12, 2025
5 checks passed
@MichaelDoyle MichaelDoyle deleted the dotprompt-rendered-meta branch August 12, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants