From 8f77302a979827b0035c3f37f04fb63a629bed5e Mon Sep 17 00:00:00 2001 From: tanabee Date: Fri, 15 Nov 2024 10:17:41 +0900 Subject: [PATCH] Update to support Genkit version 0.9.0 --- docs/codelab-en.md | 13 ++++--------- docs/codelab-ja.md | 13 ++++--------- docs/en/codelab.json | 2 +- docs/en/index.html | 12 ++++-------- docs/ja/codelab.json | 2 +- docs/ja/index.html | 12 ++++-------- 6 files changed, 18 insertions(+), 36 deletions(-) diff --git a/docs/codelab-en.md b/docs/codelab-en.md index 5aa8d78..a87cd61 100644 --- a/docs/codelab-en.md +++ b/docs/codelab-en.md @@ -48,8 +48,8 @@ Run the following commands to initialize the project. ```sh mkdir hello-genkit && cd hello-genkit npm init -y -npm i --save-dev genkit-cli tsx typescript -npm i --save genkit @genkit-ai/googleai +npm i -D genkit-cli +npm i genkit @genkit-ai/googleai mkdir src && touch src/index.ts ``` @@ -81,17 +81,12 @@ const mainFlow = ai.defineFlow({ ai.startFlowServer({ flows: [mainFlow] }) ``` -以下のコマンドで Genkit を起動します。 +Genkit will start with the following command, and Developer Tools will automatically launch. ```sh -% npx genkit start -- npx tsx --watch src/index.ts -> [Telemetry Server] initialized local file trace store at root: /Users/yuki.tanabe/dev/samples/genkit/0.9-test/.genkit/traces -Telemetry API running on http://localhost:4033 -Genkit Developer UI: http://localhost:4000 +% npx genkit start -o -- npx tsx --watch src/index.ts ``` -You can access Genkit Developer Tools by opening the URL displayed in the terminal after `Genkit Developer UI:`. - In the Flows menu, select `mainFlow` defined in the code above. Enter a string and select the `Run` button to send a prompt to Gemini. * Prompt: `Explain Firebase in under 100 words.` diff --git a/docs/codelab-ja.md b/docs/codelab-ja.md index 583c3f6..50adf63 100644 --- a/docs/codelab-ja.md +++ b/docs/codelab-ja.md @@ -48,8 +48,8 @@ Duration: 0:05:00 ```sh mkdir hello-genkit && cd hello-genkit npm init -y -npm i --save-dev genkit-cli tsx typescript -npm i --save genkit @genkit-ai/googleai +npm i -D genkit-cli +npm i genkit @genkit-ai/googleai mkdir src && touch src/index.ts ``` @@ -81,17 +81,12 @@ const mainFlow = ai.defineFlow({ ai.startFlowServer({ flows: [mainFlow] }) ``` -以下のコマンドで Genkit を起動します。 +以下のコマンドで Genkit が起動し、 Developer Tools が自動的に立ち上がります。 ```sh -% npx genkit start -- npx tsx --watch src/index.ts -> [Telemetry Server] initialized local file trace store at root: ~~~ -Telemetry API running on http://localhost:4033 -Genkit Developer UI: http://localhost:4000 +% npx genkit start -o -- npx tsx --watch src/index.ts ``` -ターミナルで `Genkit Developer UI:` の後ろに表示されている URL にアクセスすると Genkit Developer Tools にアクセスできます。 - Flows メニューに上記のコードで指定した `mainFlow` を選択します。文字列を入力し `Run` ボタンを選択すると Gemini に対してプロンプトを投げることができます。 * プロンプト例: `Firebase を 200 文字以内で説明してください。` diff --git a/docs/en/codelab.json b/docs/en/codelab.json index 644377a..68a0ea8 100644 --- a/docs/en/codelab.json +++ b/docs/en/codelab.json @@ -3,7 +3,7 @@ "format": "html", "prefix": "https://storage.googleapis.com", "mainga": "UA-49880327-14", - "updated": "2024-11-14T15:34:14+09:00", + "updated": "2024-11-15T10:15:30+09:00", "id": "en", "duration": 17, "title": "Genkit Hands-on", diff --git a/docs/en/index.html b/docs/en/index.html index 5eb2650..2313a7e 100644 --- a/docs/en/index.html +++ b/docs/en/index.html @@ -62,8 +62,8 @@

Prerequisites

Run the following commands to initialize the project.

mkdir hello-genkit && cd hello-genkit
 npm init -y
-npm i --save-dev genkit-cli tsx typescript
-npm i --save genkit @genkit-ai/googleai
+npm i -D genkit-cli
+npm i genkit @genkit-ai/googleai
 mkdir src && touch src/index.ts
 

Set the Gemini API key you obtained earlier as an environment variable.

@@ -88,13 +88,9 @@

Prerequisites

ai.startFlowServer({ flows: [mainFlow] }) -

以下のコマンドで Genkit を起動します。

-
% npx genkit start -- npx tsx --watch src/index.ts
-> [Telemetry Server] initialized local file trace store at root: /Users/yuki.tanabe/dev/samples/genkit/0.9-test/.genkit/traces
-Telemetry API running on http://localhost:4033
-Genkit Developer UI: http://localhost:4000
+

Genkit will start with the following command, and Developer Tools will automatically launch.

+
% npx genkit start -o -- npx tsx --watch src/index.ts
 
-

You can access Genkit Developer Tools by opening the URL displayed in the terminal after Genkit Developer UI:.

In the Flows menu, select mainFlow defined in the code above. Enter a string and select the Run button to send a prompt to Gemini.

-

以下のコマンドで Genkit を起動します。

-
% npx genkit start -- npx tsx --watch src/index.ts
-> [Telemetry Server] initialized local file trace store at root: ~~~ 
-Telemetry API running on http://localhost:4033
-Genkit Developer UI: http://localhost:4000
+

以下のコマンドで Genkit が起動し、 Developer Tools が自動的に立ち上がります。

+
% npx genkit start -o -- npx tsx --watch src/index.ts
 
-

ターミナルで Genkit Developer UI: の後ろに表示されている URL にアクセスすると Genkit Developer Tools にアクセスできます。

Flows メニューに上記のコードで指定した mainFlow を選択します。文字列を入力し Run ボタンを選択すると Gemini に対してプロンプトを投げることができます。

  • プロンプト例: Firebase を 200 文字以内で説明してください。