Skip to content

Commit

Permalink
Update to support Genkit version 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tanabee committed Nov 15, 2024
1 parent 56f28a9 commit 8f77302
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 36 deletions.
13 changes: 4 additions & 9 deletions docs/codelab-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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.`
Expand Down
13 changes: 4 additions & 9 deletions docs/codelab-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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 文字以内で説明してください。`
Expand Down
2 changes: 1 addition & 1 deletion docs/en/codelab.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 4 additions & 8 deletions docs/en/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ <h2 is-upgraded>Prerequisites</h2>
<p>Run the following commands to initialize the project.</p>
<pre><code language="language-sh" class="language-sh">mkdir hello-genkit &amp;&amp; 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 &amp;&amp; touch src/index.ts
</code></pre>
<p>Set the Gemini API key you obtained earlier as an environment variable.</p>
Expand All @@ -88,13 +88,9 @@ <h2 is-upgraded>Prerequisites</h2>

ai.startFlowServer({ flows: [mainFlow] })
</code></pre>
<p>以下のコマンドで Genkit を起動します。</p>
<pre><code language="language-sh" class="language-sh">% npx genkit start -- npx tsx --watch src/index.ts
&gt; [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
<p>Genkit will start with the following command, and Developer Tools will automatically launch.</p>
<pre><code language="language-sh" class="language-sh">% npx genkit start -o -- npx tsx --watch src/index.ts
</code></pre>
<p>You can access Genkit Developer Tools by opening the URL displayed in the terminal after <code>Genkit Developer UI:</code>.</p>
<p>In the Flows menu, select <code>mainFlow</code> defined in the code above. Enter a string and select the <code>Run</code> button to send a prompt to Gemini.</p>
<ul>
<li>Prompt: <code>Explain Firebase in under 100 words.</code></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/codelab.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"format": "html",
"prefix": "https://storage.googleapis.com",
"mainga": "UA-49880327-14",
"updated": "2024-11-14T15:34:19+09:00",
"updated": "2024-11-15T10:16:43+09:00",
"id": "ja",
"duration": 17,
"title": "Genkit Hands-on",
Expand Down
12 changes: 4 additions & 8 deletions docs/ja/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ <h2 is-upgraded>前提条件</h2>
<p>以下のコマンドを実行してプロジェクトの初期設定を行います。</p>
<pre><code language="language-sh" class="language-sh">mkdir hello-genkit &amp;&amp; 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 &amp;&amp; touch src/index.ts
</code></pre>
<p>先ほど取得した Gemini の API キーを環境変数にセットします。</p>
Expand All @@ -88,13 +88,9 @@ <h2 is-upgraded>前提条件</h2>

ai.startFlowServer({ flows: [mainFlow] })
</code></pre>
<p>以下のコマンドで Genkit を起動します。</p>
<pre><code language="language-sh" class="language-sh">% npx genkit start -- npx tsx --watch src/index.ts
&gt; [Telemetry Server] initialized local file trace store at root: ~~~
Telemetry API running on http://localhost:4033
Genkit Developer UI: http://localhost:4000
<p>以下のコマンドで Genkit が起動し、 Developer Tools が自動的に立ち上がります。</p>
<pre><code language="language-sh" class="language-sh">% npx genkit start -o -- npx tsx --watch src/index.ts
</code></pre>
<p>ターミナルで <code>Genkit Developer UI:</code> の後ろに表示されている URL にアクセスすると Genkit Developer Tools にアクセスできます。</p>
<p>Flows メニューに上記のコードで指定した <code>mainFlow</code> を選択します。文字列を入力し <code>Run</code> ボタンを選択すると Gemini に対してプロンプトを投げることができます。</p>
<ul>
<li>プロンプト例: <code>Firebase を 200 文字以内で説明してください。</code></li>
Expand Down

0 comments on commit 8f77302

Please sign in to comment.