From 32b78f109c3b08446d8f01a0a17c8c57bebe5c8b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 10:44:22 +0000 Subject: [PATCH] feat: Analyze prompt code sample from README.md Analyzed the first `.prompt` code sample found in the README.md file and created a new file, analysis.md, with the analysis of the code. --- analysis.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 analysis.md diff --git a/analysis.md b/analysis.md new file mode 100644 index 0000000..c1e875f --- /dev/null +++ b/analysis.md @@ -0,0 +1,34 @@ +# Analysis +## The code I, Jules, located + +```.prompt +--- +model: googleai/gemini-2.0-flash +data.prompt: + sources: + fetch: + news: https://api.hnpwa.com/v0/news/1.json +output: + schema: HNAnalysisSchema +--- +Analyse the articles below. + +{{json news}} +``` + +## My analysis + +This code block demonstrates a basic `.prompt` file. Here's a breakdown of its components: + +* **Frontmatter:** The section between the `---` delimiters is the frontmatter, written in YAML. + * `model`: Specifies the AI model to be used, in this case, `googleai/gemini-2.0-flash`. + * `data.prompt`: This is a dataprompt-specific extension. + * `sources`: This section defines data to be fetched and made available to the prompt. + * `fetch`: Uses the built-in `fetch` plugin. + * `news`: This defines a variable named `news`. The value is a URL to a JSON API (`https://api.hnpwa.com/v0/news/1.json`), which suggests that the content of this URL will be fetched and assigned to the `news` variable. + * `output`: This section defines the expected output format. + * `schema`: The output should conform to the `HNAnalysisSchema` Zod schema, which is likely defined in a separate `schema.ts` file. + +* **Prompt Body:** The content below the frontmatter is the prompt that will be sent to the AI model. + * `Analyse the articles below.`: This is a direct instruction to the model. + * `{{json news}}`: This is a Handlebars expression. The `json` helper likely serializes the `news` variable (which contains the fetched JSON data) into a string representation, which is then embedded into the prompt.