Skip to content

Commit

Permalink
Update Function Calling prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
tanabee committed Nov 17, 2024
1 parent 97d3e80 commit f5247ab
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/codelab-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Set the Gemini API key you obtained earlier as an environment variable.
export GOOGLE_GENAI_API_KEY=<your API key>
```

Create a file called `src/index.ts` and paste the following code:
Please paste the following code into the `src/index.ts` file.

```javaScript
import { genkit, z } from 'genkit'
Expand Down Expand Up @@ -204,7 +204,7 @@ The content of the URL was extracted. In Genkit Developer Tools, you can test to

Next, select mainFlow from the Flow menu. Enter the following prompt and execute it.

Prompt: `Summarize the content of the following URL in less than 200 characters. https://medium.com/firebase-developers/implementing-function-calling-using-genkit-0c03f6cb9179`
Prompt: `First, fetch the content inside URL. Next, summarize the content in less than 200 words. https://medium.com/firebase-developers/implementing-function-calling-using-genkit-0c03f6cb9179`

You can see that the content has been summarized based on the extracted content.

Expand Down
2 changes: 1 addition & 1 deletion docs/codelab-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mkdir src && touch src/index.ts
export GOOGLE_GENAI_API_KEY=<your API key>
```

`src/index.ts` ファイルを作成し、以下のコードを貼り付けます
`src/index.ts` に以下のコードを貼り付けます

```JavaScript
import { genkit, z } from 'genkit'
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-17T10:52:58+09:00",
"updated": "2024-11-17T14:41:26+09:00",
"id": "en",
"duration": 17,
"title": "Genkit Hands-on",
Expand Down
4 changes: 2 additions & 2 deletions docs/en/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2 is-upgraded>Prerequisites</h2>
<p>Set the Gemini API key you obtained earlier as an environment variable.</p>
<pre><code language="language-sh" class="language-sh">export GOOGLE_GENAI_API_KEY=&lt;your API key&gt;
</code></pre>
<p>Create a file called <code>src/index.ts</code> and paste the following code:</p>
<p>Please paste the following code into the <code>src/index.ts</code> file.</p>
<pre><code language="language-javaScript" class="language-javaScript">import { genkit, z } from &#39;genkit&#39;
import { googleAI, gemini15Flash } from &#39;@genkit-ai/googleai&#39;
import { logger } from &#39;genkit/logging&#39;
Expand Down Expand Up @@ -181,7 +181,7 @@ <h2 is-upgraded>Challenge</h2>
<p class="image-container"><img alt="Function Calling | Tool" src="img/86295bf724e12421.png"></p>
<p>The content of the URL was extracted. In Genkit Developer Tools, you can test tools individually to verify their functionality before incorporating them into a Flow, making development more efficient.</p>
<p>Next, select mainFlow from the Flow menu. Enter the following prompt and execute it.</p>
<p>Prompt: <code>Summarize the content of the following URL in less than 200 characters. https://medium.com/firebase-developers/implementing-function-calling-using-genkit-0c03f6cb9179</code></p>
<p>Prompt: <code>First, fetch the content inside URL. Next, summarize the content in less than 200 words. https://medium.com/firebase-developers/implementing-function-calling-using-genkit-0c03f6cb9179</code></p>
<p>You can see that the content has been summarized based on the extracted content.</p>
<p class="image-container"><img alt="Function Calling | Flow" src="img/e3d499998dc1343c.png"></p>
<p>Look at the View trace. You&#39;ll see that while two requests were made to the Gemini API, webLoader was called in between, confirming that the tool was indeed called.</p>
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-17T10:52:29+09:00",
"updated": "2024-11-17T14:41:43+09:00",
"id": "ja",
"duration": 17,
"title": "Genkit Hands-on",
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2 is-upgraded>前提条件</h2>
<p>先ほど取得した Gemini の API キーを環境変数にセットします。</p>
<pre><code language="language-sh" class="language-sh">export GOOGLE_GENAI_API_KEY=&lt;your API key&gt;
</code></pre>
<p><code>src/index.ts</code> ファイルを作成し、以下のコードを貼り付けます</p>
<p><code>src/index.ts</code> に以下のコードを貼り付けます</p>
<pre><code language="language-JavaScript" class="language-JavaScript">import { genkit, z } from &#39;genkit&#39;
import { googleAI, gemini15Flash } from &#39;@genkit-ai/googleai&#39;
import { logger } from &#39;genkit/logging&#39;
Expand Down

0 comments on commit f5247ab

Please sign in to comment.