Skip to content

Commit 286aa94

Browse files
authored
docs: Update titles and headings to be more consistent (#394)
1 parent 1bf4a8e commit 286aa94

File tree

8 files changed

+98
-52
lines changed

8 files changed

+98
-52
lines changed

third_party/docsite/src/components/docs/TableofContents.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { class: className } = Astro.props;
1313
{
1414
hasToC && (
1515
<div class:list={["relative", className]}>
16-
<h2 class="text-xl border-none">On This Page</h2>
16+
<h2 class="text-xl border-none">On this page</h2>
1717
<ul class="list-none m-0">
1818
{toc.map((heading) => (
1919
<li class=`${heading.depth === 2 ? "font-semibold" : "text-muted-foreground"}${heading.depth > 3 ? " pl-4" : ""}`>

third_party/docsite/src/content/docs/getting-started.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Getting Started
2+
title: Get started
33
hide_breadcrumbs: true
44
---
55
import Callout from "@/components/Callout.astro";
@@ -24,9 +24,9 @@ An executable prompt template is a file that contains not only the text of a pro
2424

2525
This combination of features makes it possible to treat a Dotprompt file as an executable unit, streamlining the process of working with AI models and ensuring consistency across different uses of the same prompt.
2626

27-
## Example `.prompt` file
27+
## Example file
2828

29-
Here's an example of a Dotprompt file that extracts structured data from provided text:
29+
Here's an example of a Dotprompt file that extracts structured data from the provided text:
3030

3131
```handlebars
3232
---
@@ -39,7 +39,7 @@ output:
3939
schema:
4040
title?: string, the title of the article if it has one
4141
summary: string, a 3-sentence summary of the text
42-
tags?(array, a list of string tag category for the text): string,
42+
tags?(array, a list of string tag category for the text): string,
4343
---
4444
4545
Extract the requested information from the given text. If a piece of information is not present, omit that field from the output.
@@ -57,7 +57,7 @@ This Dotprompt file:
5757

5858
When executed, this prompt would take a text input, analyze it using the specified AI model, and return a structured JSON object with the extracted information.
5959

60-
## Installation
60+
## Install and set up
6161

6262
The remainder of this getting started guide will use the reference Dotprompt implementation included as part of the [Firebase Genkit](https://github.com/firebase/genkit) GenAI framework. To use other implementations of Dotprompt, see the [list of Implementations](/implementations).
6363

third_party/docsite/src/content/docs/implementors.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Implementing the Dotprompt spec consists of two primary areas of work:
1010

1111
## 🚧 Under Construction 🚧
1212

13-
This page is under construction, check back soon!
13+
This page is under construction, check back soon!

third_party/docsite/src/content/docs/reference.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Reference Docs
2+
title: Reference docs
33
---
44

55
A Dotprompt template format is made up of four parts:
@@ -15,9 +15,9 @@ output:
1515
{{! (3) the Template Content goes here }}
1616
```
1717

18-
When executed, a Dotprompt template renders into (4) Common Model Interface.
18+
When executed, a Dotprompt template renders into (4) Common Model Interface.
1919

20-
## Reference Docs
20+
## Reference docs
2121

2222
1. **[Prompt Frontmatter](/reference/frontmatter):** Included at the start of a Dotprompt template, frontmatter includes model configuration, input/output formatList, and tooling MediaMetadata.
2323
2. **[Picoschema](/reference/picoschema):** The compact, YAML-optimized schema representation used for describing structured data in a Dotprompt template.

third_party/docsite/src/content/docs/reference/frontmatter.mdx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Prompt Frontmatter
2+
title: Prompt frontmatter
33
sort_order: 1
44
---
55

@@ -17,7 +17,7 @@ Prompt template goes here.
1717

1818
All frontmatter fields are considered optional in a given `.prompt` file, as Dotprompt implementations may provide default values for any or all of them. If no frontmatter fields need to be specified in a given file, the frontmatter may be omitted entirely and only a prompt template provided.
1919

20-
## Full Example
20+
## Full example
2121

2222
Here's an example of a Dotprompt frontmatter:
2323

@@ -26,7 +26,7 @@ Here's an example of a Dotprompt frontmatter:
2626
name: greetingPrompt
2727
variant: formal
2828
model: googleai/gemini-1.5-flash
29-
tools:
29+
tools:
3030
- timeOfDay
3131
config:
3232
version: gemini-1.5-flash-latest
@@ -52,25 +52,30 @@ metadata:
5252
---
5353
```
5454

55-
## Available Fields
55+
## Available fields
5656

5757
### `name`
58+
5859
- **Type:** `string`
5960
- **Description:** The name of the prompt. If unspecified, inferred by the filename of the loaded prompt (e.g. `myPrompt.prompt` has an inferred name of `myPrompt`).
6061

6162
### `variant`
63+
6264
- **Type:** `string`
6365
- **Description:** The variant name for the prompt. If unspecified, inferred by the filename of the loaded prompt (e.g. `myPrompt.variant1.prompt` has inferred name of `myPrompt` and inferred variant of `variant1`).
6466

6567
### `model`
68+
6669
- **Type:** `string` or `ModelArgument<Options>`
6770
- **Description:** The name of the model to use for this prompt, e.g., `googleai/gemini-1.5-flash-latest`. The Dotprompt implementation is responsible for resolving a string model name to an executable model.
6871

6972
### `tools`
73+
7074
- **Type:** `string[]`
7175
- **Description:** Names of tools (registered in the Dotprompt implementation) to allow use of in this prompt.
7276

7377
### `config`
78+
7479
- **Type:** `object`
7580
- **Description:** Configuration to be passed to the model implementation as a `Map<string,any>`. The specific configuration options vary depending on the model implementation.
7681
- **Common Config:** Model implementations should respect the following config properties where applicable:
@@ -107,6 +112,7 @@ metadata:
107112
- **Example:** `["END", "\n\n", "User:"]`
108113

109114
### `input`
115+
110116
- **Type:** `object`
111117
- **Description:** Defines the input variables the prompt. If `input` is not specified, the implementation should accept any `Map<string,any>` values as input and pass them to the prompt template.
112118
- **Properties:**
@@ -118,22 +124,24 @@ metadata:
118124
- **Description:** Schema representing the input values for the prompt. Must correspond to a JSON Schema `object` type.
119125

120126
### `output`
127+
121128
- **Type:** `object`
122129
- **Description:** Defines the expected model output format.
123130
- **Properties:**
124131
- `format`:
125132
- **Type:** `string`
126133
- **Common Values:** `json`, `text`
127-
- **Description:** Desired output format for this prompt. Output formats are implementation-specific, but
134+
- **Description:** Desired output format for this prompt. Output formats are implementation-specific, but
128135
- `schema`:
129136
- **Type:** [Schema](schema)
130137
- **Description:** Schema representing the expected output from the prompt. Must correspond to a JSON Schema `object` type.
131138

132139
### `metadata`
140+
133141
- **Type:** `Map<string, any>`
134142
- **Description:** Arbitrary metadata to be used by code, tools, and libraries.
135143

136-
## Frontmatter Extensions
144+
## Frontmatter extensions
137145

138146
In the frontmatter, Dotprompt implementations will automatically collect namespaced fields (i.e. fields with a `.` in them) into a special `ext` property on the resulting metadata. For example, the following frontmatter:
139147

@@ -169,4 +177,4 @@ Would be parsed into this equivalent metadata:
169177
}
170178
```
171179

172-
Note that nested namespaces are flattened into dotted keys to avoid conflicts between nested properties and nested namespaces.
180+
Note that nested namespaces are flattened into dotted keys to avoid conflicts between nested properties and nested namespaces.

third_party/docsite/src/content/docs/reference/model.mdx

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Dotprompt implementations are not required to conform to any specific structured
77

88
In the future, a Dotprompt "spec test" will be made available that exercises the various parts of Dotprompt and compares the results to this common model request format.
99

10-
## GenerateRequest
10+
## `GenerateRequest`
1111

12-
### Full Example
12+
### Full example
1313

1414
```json
1515
{
@@ -113,132 +113,159 @@ In the future, a Dotprompt "spec test" will be made available that exercises the
113113
]
114114
}
115115
```
116+
116117
### Properties
117118

118119
#### `messages`
120+
119121
- **Type:** `array` of [Message](#message) objects.
120122
- **Description:** The conversation history and current prompt.
121123

122124
#### `config`
125+
123126
- **Type:** [ModelConfig](#modelconfig)
124127
- **Description:** Configuration options for the model.
125128

126129
#### `tools`
130+
127131
- **Type:** `array` of [ToolDefinition](#tooldefinition)
128132
- **Description:** Definitions of tools available to the model.
129133

130134
#### `output`
135+
131136
- **Type:** [Output](#output)
132137
- **Description:** Specification for the desired output format.
133138

134139
#### `context`
140+
135141
- **Type:** `array` of [Document](#document)
136142
- **Description:** Grounding context documents for the model.
137143

138-
## Message
144+
## `Message`
139145

140146
A message represents a single "turn" in a multi-turn conversation. Each message must have a role and specified content.
141147

142148
### Properties
143149

144150
#### `role`
151+
145152
- **Type:** `string`
146153
- **Description:** The role of the message sender. Can be "system", "user", "model", or "tool".
147154

148155
#### `content`
156+
149157
- **Type:** `array` of [Part](#part)
150158
- **Description:** The content of the message, which can include text, media, tool requests, and tool responses.
151159

152160
#### `metadata`
161+
153162
- **Type:** `object`
154163
- **Description:** Optional. Additional metadata for the message.
155164

156-
## Part
165+
## `Part`
157166

158167
A `Part` object can be one of the following types:
159168

160-
### TextPart
169+
### `TextPart`
161170

162171
#### `text`
172+
163173
- **Type:** `string`
164174
- **Description:** The text content of the message.
165175

166-
### MediaPart
176+
### `MediaPart`
167177

168178
#### `media`
179+
169180
- **Type:** `object`
170181
- **Description:** Contains media information.
171182

172183
#### `media.contentType`
184+
173185
- **Type:** `string`
174186
- **Description:** Optional. The media content type. Inferred from data URI if not provided.
175187

176188
#### `media.url`
189+
177190
- **Type:** `string`
178191
- **Description:** A `data:` or `https:` URI containing the media content.
179192

180-
### ToolRequestPart
193+
### `ToolRequestPart`
181194

182195
#### `toolRequest`
196+
183197
- **Type:** `object`
184198
- **Description:** A request for a tool to be executed.
185199

186200
#### `toolRequest.ref`
201+
187202
- **Type:** `string`
188203
- **Description:** Optional. The call ID or reference for a specific request.
189204

190205
#### `toolRequest.name`
206+
191207
- **Type:** `string`
192208
- **Description:** The name of the tool to call.
193209

194210
#### `toolRequest.input`
211+
195212
- **Type:** `any`
196213
- **Description:** Optional. The input parameters for the tool, usually a JSON object.
197214

198-
### ToolResponsePart
215+
### `ToolResponsePart`
199216

200217
#### `toolResponse`
218+
201219
- **Type:** `object`
202220
- **Description:** A provided response to a tool call.
203221

204222
#### `toolResponse.ref`
223+
205224
- **Type:** `string`
206225
- **Description:** Optional. The call ID or reference for a specific request.
207226

208227
#### `toolResponse.name`
228+
209229
- **Type:** `string`
210230
- **Description:** The name of the tool.
211231

212232
#### `toolResponse.output`
233+
213234
- **Type:** `any`
214235
- **Description:** Optional. The output data returned from the tool, usually a JSON object.
215236

216-
## ModelConfig
237+
## `ModelConfig`
217238

218239
`ModelConfig` is an arbitrary `Map<string,any>` that depends on the specific implementation of the underlying model. However, the following common configuration options should be respected in implementation whenever applicable:
219240

220-
### Common Config Properties
241+
### Common config properties
242+
221243
#### `temperature`
244+
222245
- **Type:** `number`
223246
- **Description:** Optional. Controls the randomness of the model's output.
224247

225248
#### `maxOutputTokens`
249+
226250
- **Type:** `number`
227251
- **Description:** Optional. Limits the maximum number of tokens in the model's response.
228252

229253
#### `topK`
254+
230255
- **Type:** `number`
231256
- **Description:** Optional. Limits the number of highest probability vocabulary tokens to consider at each step.
232257

233258
#### `topP`
259+
234260
- **Type:** `number`
235261
- **Description:** Optional. Sets a probability threshold for token selection.
236262

237263
#### `stopSequences`
264+
238265
- **Type:** `array` of `string`
239266
- **Description:** Optional. Sequences that, if encountered, will cause the model to stop generating further output.
240267

241-
## Tool Object
268+
## `Tool` object
242269

243270
### `name`
244271
- **Type:** `string`
@@ -256,27 +283,32 @@ A `Part` object can be one of the following types:
256283
- **Type:** `object`
257284
- **Description:** Optional. A JSON Schema object describing the expected output from the tool.
258285

259-
## Output Object
286+
## `OutputOptions` object
260287

261288
### `format`
289+
262290
- **Type:** `string`
263291
- **Description:** Optional. The desired output format. All implementations should support `json` and `text` at a minimum.
264292

265293
### `schema`
294+
266295
- **Type:** `object`
267296
- **Description:** Optional. A JSON Schema object describing the expected structure of the output.
268297

269-
## Document Object
298+
## `Document` Object
270299

271300
### `id`
301+
272302
- **Type:** `string`
273303
- **Description:** A unique identifier for the document.
274304

275305
### `content`
306+
276307
- **Type:** `string`
277308
- **Description:** The text content of the document.
278309

279310
### `metadata`
311+
280312
- **Type:** `object`
281313
- **Description:** Optional. Additional metadata for the document.
282314

@@ -289,4 +321,4 @@ A `Part` object can be one of the following types:
289321
- The `context` array provides additional information that may be relevant to the task but isn't part of the direct conversation history.
290322
- The `candidates` field determines how many alternative responses the model should generate.
291323

292-
This interface provides a flexible and powerful way to interact with GenAI models, supporting various types of inputs, outputs, and model configurations.
324+
This interface provides a flexible and powerful way to interact with GenAI models, supporting various types of inputs, outputs, and model configurations.

0 commit comments

Comments
 (0)