Skip to content

Commit 68ecd12

Browse files
authored
chore: update prompts to 1.0, renames to js-prompts to match other samples (#1796)
1 parent d55e41b commit 68ecd12

File tree

7 files changed

+131
-105
lines changed

7 files changed

+131
-105
lines changed

samples/idx-template.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"options": {
1717
"js-character-generator": "Simple Character Generator",
1818
"js-coffee-shop": "Coffeeshop w Several types of Prompt",
19-
"js-schoolAgent": "A Multi-Agent School Assistant"
19+
"js-schoolAgent": "A Multi-Agent School Assistant",
20+
"js-prompts": "A sample with various prompt styles"
2021
}
2122
}
2223
]

samples/js-prompts/.idx/dev.nix

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## Default Nix Environment for Typescript + Gemini Examples
2+
## Requires the sample to be started with npx run genkit:dev
3+
4+
# To learn more about how to use Nix to configure your environment
5+
# see: https://developers.google.com/idx/guides/customize-idx-env
6+
{ pkgs, ... }: {
7+
# Which nixpkgs channel to use.
8+
channel = "stable-24.05"; # or "unstable"
9+
# Use https://search.nixos.org/packages to find packages
10+
packages = [
11+
pkgs.nodejs_20
12+
pkgs.util-linux
13+
];
14+
# Sets environment variables in the workspace
15+
env = {
16+
#TODO Get a API key from https://g.co/ai/idxGetGeminiKey
17+
GOOGLE_GENAI_API_KEY = "";
18+
};
19+
idx = {
20+
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
21+
extensions = [
22+
];
23+
24+
# Workspace lifecycle hooks
25+
workspace = {
26+
# Runs when a workspace is first created
27+
onCreate = {
28+
npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing";
29+
default.openFiles = [ "README.md" "src/index.ts" ];
30+
};
31+
# Runs when the workspace is (re)started
32+
onStart = {
33+
run-server = "if [ -z \"\${GOOGLE_GENAI_API_KEY}\" ]; then \
34+
echo 'No Gemini API key detected, enter a Gemini API key from https://aistudio.google.com/app/apikey:' && \
35+
read -s GOOGLE_GENAI_API_KEY && \
36+
echo 'You can also set the key in .idx/dev.nix to automatically add to your workspace'
37+
export GOOGLE_GENAI_API_KEY; \
38+
fi && \
39+
npm run genkit:dev";
40+
};
41+
};
42+
};
43+
}
File renamed without changes.

samples/prompts/package-lock.json samples/js-prompts/package-lock.json

+73-99
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)