@genkit-ai/fetch 0.5.0 → 0.6.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
This plugin provides utilities for exposing Genkit actions (flows, models, etc.) over the **Web Fetch API** (`Request` / `Response`). Use it with any runtime or framework that supports the standard Fetch API (such as Hono, Bun, Cloudflare Workers, Deno, Node (18+), Vercel Edge, Netlify Edge, Elysia, SvelteKit, etc). Express-like API: pass the action first, then call the returned handler with the request.
|
|
4
4
|
|
|
5
|
+
> **Building with a coding agent? Install the Genkit JS skill first.**
|
|
6
|
+
>
|
|
7
|
+
> ```bash
|
|
8
|
+
> npx skills add genkit-ai/skills --skill developing-genkit-js
|
|
9
|
+
> ```
|
|
10
|
+
>
|
|
11
|
+
> It teaches your agent the current Genkit JS APIs and common gotchas.
|
|
12
|
+
> Source, manual install and skills for other languages:
|
|
13
|
+
> [genkit-ai/skills](https://github.com/genkit-ai/skills).
|
|
14
|
+
|
|
5
15
|
No framework-specific dependencies; only `genkit` and the standard Web APIs.
|
|
6
16
|
|
|
7
17
|
## Installation
|
|
@@ -20,7 +30,7 @@ import { Hono } from 'hono';
|
|
|
20
30
|
|
|
21
31
|
const simpleFlow = ai.defineFlow('simpleFlow', async (input, { sendChunk }) => {
|
|
22
32
|
const { text } = await ai.generate({
|
|
23
|
-
model: googleAI.model('gemini-
|
|
33
|
+
model: googleAI.model('gemini-flash-latest'),
|
|
24
34
|
prompt: input,
|
|
25
35
|
onChunk: (c) => sendChunk(c.text),
|
|
26
36
|
});
|
|
@@ -35,7 +45,7 @@ For a model, resolve it from the plugin then pass to `fetchHandler`:
|
|
|
35
45
|
|
|
36
46
|
```ts
|
|
37
47
|
const gai = googleAI();
|
|
38
|
-
const model = await gai.model('gemini-
|
|
48
|
+
const model = await gai.model('gemini-flash-latest');
|
|
39
49
|
app.post('/models/gemini-flash', (c) => fetchHandler(model)(c.req.raw));
|
|
40
50
|
```
|
|
41
51
|
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"bun",
|
|
17
17
|
"deno"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.
|
|
19
|
+
"version": "0.6.0-rc.0",
|
|
20
20
|
"type": "commonjs",
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"author": "genkit",
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"genkit": "^1.
|
|
29
|
+
"genkit": "^1.43.0-rc.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"get-port": "^5.1.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"tsup": "^8.3.5",
|
|
37
37
|
"tsx": "^4.19.2",
|
|
38
38
|
"typescript": "^5.9.3",
|
|
39
|
-
"genkit": "1.
|
|
39
|
+
"genkit": "1.43.0-rc.0"
|
|
40
40
|
},
|
|
41
41
|
"types": "./lib/index.d.ts",
|
|
42
42
|
"exports": {
|