1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Fix storing prompts article (#55721)

This commit is contained in:
Siara
2025-05-19 15:25:03 -07:00
committed by GitHub
parent 3ac258d472
commit 101c4dcb10

View File

@@ -18,27 +18,36 @@ Prompts can be stored as files directly within GitHub repositories. This unlocks
## Supported file format ## Supported file format
Store prompts in markdown files with optional YAML front matter. Store prompts in YAML files.
The file can be located anywhere in your repository, but it **must have the extension `.prompt.md`**. The file can be located anywhere in your repository, but _must have the extension `.prompt.yml` or `.prompt.yaml`._
Example: Example:
```yaml ``` yaml copy
--- name: Text Summarizer
name: Summarizer description: Summarizes input text concisely
description: Summarizes a given text model: gpt-4o-mini
model: openai/gpt-4o modelParameters:
model_parameters:
temperature: 0.5 temperature: 0.5
--- messages:
system: - role: system
You are a text summarizer. Your only job is to summarize a given text to you. content: You are a text summarizer. Your only job is to summarize text given to you.
user: - role: user
Summarize the given text: content: |
<text> Summarize the given text, beginning with "Summary -":
{% raw %}{{text}}{% endraw %} <text>
</text> {% raw %}{{input}}{% endraw %}
</text>
testData:
- input: |
The quick brown fox jumped over the lazy dog.
The dog was too tired to react.
expected: Summary - A fox jumped over a lazy, unresponsive dog.
evaluators:
- name: Output should start with 'Summary -'
string:
startsWith: 'Summary -'
``` ```
## Prompt structure ## Prompt structure
@@ -46,11 +55,12 @@ Summarize the given text:
Prompts have two key parts: Prompts have two key parts:
* **Runtime information** (required) * **Runtime information** (required)
* Prompt templates (system, user, etc.) using simple {{variable}} placeholders * Prompt templates (system, user, etc.) using simple {% raw %}`{{variable}}`{% endraw %} placeholders
* **Development information** (optional) * **Development information** (optional)
* Human-readable name and description * Human-readable name and description
* Model identifier and parameters * Model identifier and parameters
* Sample data for testing and evaluations * Sample data for testing and evaluations
* Data describing the evaluators themselves
## Limitations ## Limitations