Skip to content

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