Skip to content

Commit e94e769

Browse files
committed
update contrib.md
1 parent b61da1f commit e94e769

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ use GitHub pull requests for this purpose. Consult
3232
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
3333
information on using pull requests.
3434

35-
## Environment
35+
## Setup
36+
37+
### Environment
3638

3739
1. [Install node v20](https://nodejs.org/en/download)
3840
2. Run `corepack enable pnpm` to enable pnpm.
3941

4042
Note: We recommend using Node v20 or greater when compiling and running Genkit.
4143
Any older versions of Node may not work properly.
4244

43-
## Quick setup
45+
### Install dependencies
4446

4547
```
4648
pnpm i
@@ -49,15 +51,15 @@ pnpm run setup
4951

5052
This will install all dependencies and build all packages.
5153

52-
## Build it
54+
### Build it
5355

5456
```
5557
pnpm build
5658
```
5759

5860
This will build all packages in this repository. This is recommended the first time you check out a fresh repo or pull new revisions.
5961

60-
## Pack it
62+
### Pack it
6163

6264
Pack packages for testing/distribution.
6365

@@ -69,7 +71,7 @@ pnpm pack:all
6971

7072
This will produce tarballs in the `dist` folder. Also `genkit-dist.zip` -- a zip of all the package tarballs.
7173

72-
## Link it
74+
### Link it
7375

7476
You will need the Genkit CLI to run test apps and the Developer UI (this is done for you with `pnpm run setup`):
7577

@@ -92,7 +94,7 @@ genkit start -- tsx --watch src/index.ts
9294

9395
Point your browser to http://localhost:4000
9496

95-
### Run evaluations
97+
### Run an evaluation
9698

9799
We'll be using the `pdfQA` flow for our example.
98100

@@ -101,24 +103,24 @@ To start, let's make sure we have some context to pull from the vector store.
101103
1. Start the Developer UI
102104

103105
```
104-
cd js/testapps/rag
105-
genkit start -- tsx --watch src/index.ts
106+
cd js/testapps/evals
107+
genkit start -- pnpm genkit:dev
106108
```
107109

108110
2. Click on the `indexPdf` flow in the left nav.
109111
3. Input paths to pdfs you want to index. There's one checked into the directory:
110112

111113
```
112-
"./35650.pdf"
114+
"./docs/cat-handbook.pdf"
113115
```
114116

115-
4. Run the evaluation
117+
4. Run an evaluation on a sample dataset checked into the testapp
116118

117119
```
118-
genkit eval:flow pdfQA '"What's a brief description of MapReduce?"'
120+
genkit eval:flow pdfQA --input ./data/cat_adoption_questions.json
119121
```
120122

121-
5. To see the output, look for the log line `Saving EvalRun` with the path to the json file.
123+
5. Go to the **Evaluations** tab in the Developer UI to view the evaluation results.
122124

123125
## Code it
124126

@@ -146,6 +148,16 @@ pnpm build:watch
146148

147149
in the package that you're editing.
148150

151+
## Document it
152+
153+
If you are contributing to the core Genkit JS SDK (under the `/js` directory), please make sure that all exported members have a valid [JSDoc](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) associated with them.
154+
155+
Use the following command to build and view the new API reference locally.
156+
157+
```
158+
cd js && pnpm build && pnpm typedoc-html && open api-refs-js/index.html
159+
```
160+
149161
## Send it
150162

151163
Once done coding you will want to send a PR. Always do things in a separate branch (by convention name the branch `your_name-feature-something`).

0 commit comments

Comments
 (0)