Skip to content

Commit

Permalink
fix: dotprompt docs (#1833)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrutip90 authored Feb 4, 2025
1 parent 4f09d78 commit dcacadc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/dotprompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Before reading this page, you should be familiar with the content covered on the
[Generating content with AI models](models) page.

If you want to run the code examples on this page, first complete the steps in
the [Getting started](get-started) guide. All of the examples assume that you
the [Get started](get-started) guide. All of the examples assume that you
have already installed Genkit as a dependency in your project.

## Creating prompt files
Expand Down Expand Up @@ -364,7 +364,7 @@ your prompt's input schema.
You already saw this in action in the section on input and output schemas:

```handlebars
{% includecode github_path="firebase/genkit/js/doc-snippets/src/dotprompt/prompts/ex03.prompt" %}
{% includecode github_path="firebase/genkit/js/doc-snippets/src/dotprompt/prompts/ex04.prompt" %}
```

In this example, the Handlebars expression, `{{theme}}`,
Expand Down
12 changes: 6 additions & 6 deletions js/doc-snippets/src/dotprompt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ async function fn04() {
// [START outSchema]
// [START inSchema]
const menuPrompt = ai.prompt('menu');
const { data } = await menuPrompt({ theme: 'medieval' });
const { output } = await menuPrompt({ theme: 'medieval' });
// [END inSchema]

const dishName = data['dishname'];
const description = data['description'];
const dishName = output['dishname'];
const description = output['description'];
// [END outSchema]
}

Expand All @@ -107,11 +107,11 @@ async function fn05() {
typeof MenuItemSchema, // Output schema
z.ZodTypeAny // Custom options schema
>('menu');
const { data } = await menuPrompt({ theme: 'medieval' });
const { output } = await menuPrompt({ theme: 'medieval' });

// Now data is strongly typed as MenuItemSchema:
const dishName = data?.dishname;
const description = data?.description;
const dishName = output?.dishname;
const description = output?.description;
// [END outSchema2]
}

Expand Down

0 comments on commit dcacadc

Please sign in to comment.