Skip to content

Commit 101c4dc

Browse files
authored
Fix storing prompts article (#55721)
1 parent 3ac258d commit 101c4dc

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

content/github-models/use-github-models/storing-prompts-in-github-repositories.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,49 @@ Prompts can be stored as files directly within GitHub repositories. This unlocks
1818

1919
## Supported file format
2020

21-
Store prompts in markdown files with optional YAML front matter.
21+
Store prompts in YAML files.
2222

23-
The file can be located anywhere in your repository, but it **must have the extension `.prompt.md`**.
23+
The file can be located anywhere in your repository, but _must have the extension `.prompt.yml` or `.prompt.yaml`._
2424

2525
Example:
2626

27-
```yaml
28-
---
29-
name: Summarizer
30-
description: Summarizes a given text
31-
model: openai/gpt-4o
32-
model_parameters:
27+
``` yaml copy
28+
name: Text Summarizer
29+
description: Summarizes input text concisely
30+
model: gpt-4o-mini
31+
modelParameters:
3332
temperature: 0.5
34-
---
35-
system:
36-
You are a text summarizer. Your only job is to summarize a given text to you.
37-
user:
38-
Summarize the given text:
39-
<text>
40-
{% raw %}{{text}}{% endraw %}
41-
</text>
33+
messages:
34+
- role: system
35+
content: You are a text summarizer. Your only job is to summarize text given to you.
36+
- role: user
37+
content: |
38+
Summarize the given text, beginning with "Summary -":
39+
<text>
40+
{% raw %}{{input}}{% endraw %}
41+
</text>
42+
testData:
43+
- input: |
44+
The quick brown fox jumped over the lazy dog.
45+
The dog was too tired to react.
46+
expected: Summary - A fox jumped over a lazy, unresponsive dog.
47+
evaluators:
48+
- name: Output should start with 'Summary -'
49+
string:
50+
startsWith: 'Summary -'
4251
```
4352
4453
## Prompt structure
4554
4655
Prompts have two key parts:
4756
4857
* **Runtime information** (required)
49-
* Prompt templates (system, user, etc.) using simple {{variable}} placeholders
58+
* Prompt templates (system, user, etc.) using simple {% raw %}`{{variable}}`{% endraw %} placeholders
5059
* **Development information** (optional)
5160
* Human-readable name and description
5261
* Model identifier and parameters
5362
* Sample data for testing and evaluations
63+
* Data describing the evaluators themselves
5464

5565
## Limitations
5666

0 commit comments

Comments
 (0)