プロンプトは、GitHub リポジトリ内にファイルとして直接格納できます。 これにより、整った UI でプロンプトを表示したり、技術系以外の利害関係者と共有したり、モデルとプロンプトの調整でシームレスな反復と比較を実行したりできるようになります。
メリット
- GitHub 上で直接、新しい AI 開発ツール スイートと簡単に統合できる。
- 簡単なユース ケースから複雑なユース ケースまでシンプルでスケーラブル。
- 既存のツールと互換性のある、広くサポートされている形式の使用。
サポートされているファイル形式
プロンプトを YAML ファイルに格納します。
ファイルはリポジトリ内のどこにでも配置できますが、"拡張子は .prompt.yml
または .prompt.yaml
である必要があります"。__
例:
name: Text Summarizer description: Summarizes input text concisely model: openai/gpt-4o-mini modelParameters: temperature: 0.5 messages: - role: system content: You are a text summarizer. Your only job is to summarize text given to you. - role: user content: | Summarize the given text, beginning with "Summary -": <text> {{input}} </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 -'
name: Text Summarizer
description: Summarizes input text concisely
model: openai/gpt-4o-mini
modelParameters:
temperature: 0.5
messages:
- role: system
content: You are a text summarizer. Your only job is to summarize text given to you.
- role: user
content: |
Summarize the given text, beginning with "Summary -":
<text>
{{input}}
</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 -'
プロンプトの構造
プロンプトには、2 つの主要な部分があります。
- ランタイム情報 (必須)
- 簡単な
{{variable}}
プレースホルダーを用いたプロンプト テンプレート (システム、ユーザーなど)
- 簡単な
- 開発情報 (省略可能)
- 人間が判読できる名前と説明
- モデル識別子とパラメーター
- テストと評価のためのサンプル データ
- エバリュエータ自体を記述するデータ
制限事項
以下に対するプロンプトを格納することはできません。
- 複雑なテンプレート言語
- 独自または複雑なファイル形式 (
.ghprompt
、.prompty
など)