-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
135 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,86 @@ | ||
# Plugin usage examples | ||
|
||
- [Requirements](#requirements) | ||
- [Setup](#setup) | ||
- [Evaluation](#evaluation) | ||
- [Making Changes](#making-changes) | ||
|
||
## Requirements | ||
|
||
Before you start, make sure you have these installed: | ||
|
||
- **Node.js** version 22 or later | ||
- **npm** | ||
- **Genkit** | ||
|
||
For Genkit installation, see the [official guide](https://firebase.google.com/docs/genkit/get-started). | ||
|
||
Check your installations by running: | ||
|
||
```bash | ||
$ node --version # the below version is on my environment | ||
v22.7.0 | ||
$ npm --version # the below version is on my environment | ||
10.8.2 | ||
$ genkit --version # the below version is on my environment | ||
0.5.10 | ||
``` | ||
|
||
## Setup | ||
|
||
1. Install Project Dependencies: Open your terminal, navigate to this project's folder, and run: | ||
|
||
```bash | ||
$ npm install | ||
$ export GOOGLE_GENAI_API_KEY=your_gemini_api_key | ||
``` | ||
|
||
2. Authentication and Google Cloud project configuration. Make sure Vertex AI is enabled on your project. | ||
|
||
Follow these steps to login and configure the project: | ||
|
||
```bash | ||
$ gcloud auth application-default login | ||
$ gcloud config set core/project [your-project-id] | ||
``` | ||
|
||
## Evaluation | ||
|
||
To evaluate your flow, run the following command: | ||
|
||
```bash | ||
$ genkit eval:flow menuSuggestionFlow --input data/testInputs.json | ||
``` | ||
|
||
To view the evaluation results, run the following command and automatically opens your default web browser to http://localhost:4000. | ||
|
||
```bash | ||
$ genkit start -o | ||
``` | ||
|
||
## Making Changes | ||
|
||
### Building the Project | ||
|
||
After making changes, you might need to build the project to see your changes in action: | ||
|
||
```bash | ||
$ npm run build | ||
``` | ||
|
||
### Formatting and Linting | ||
|
||
To ensure your code follows the project's coding standards, run the formatting and linting tools: | ||
|
||
```bash | ||
$ npm run typecheck # type check without modifying files | ||
$ npm run check # scan without modifying files | ||
$ npm run fix # modify files | ||
``` | ||
|
||
### Kill Existing Processes | ||
|
||
Sometimes existing processes are still running, preventing you from running genkit locally because the ports are already in use. In that case, run the following command to kill the processes tied to the ports: | ||
|
||
```bash | ||
$ npm run kill | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"correctness": { | ||
"noUnusedImports": "error" | ||
} | ||
} | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentWidth": 2, | ||
"lineWidth": 80, | ||
"indentStyle": "space" | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"trailingCommas": "es5", | ||
"semicolons": "always", | ||
"quoteStyle": "single", | ||
"bracketSameLine": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["Japanese"] | ||
["Cheese"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters