Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(js/client): moved client to beta namespace #1782

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/genkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"import": "./lib/plugin.mjs",
"default": "./lib/plugin.js"
},
"./client": {
"./beta/client": {
"types": "./lib/client/index.d.ts",
"require": "./lib/client/index.js",
"import": "./lib/client/index.mjs",
Expand Down Expand Up @@ -214,7 +214,7 @@
"plugin": [
"lib/plugin"
],
"client": [
"beta/client": [
"lib/client/index"
]
}
Expand Down
2 changes: 1 addition & 1 deletion js/genkit/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const __flowStreamDelimiter = '\n\n';
* For example:
*
* ```js
* import { streamFlow } from 'genkit/client';
* import { streamFlow } from 'genkit/beta/client';
*
* const response = streamFlow({
* url: 'https://my-flow-deployed-url',
Expand Down
4 changes: 2 additions & 2 deletions js/plugins/express/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ app.post(
);
```

Flows and actions exposed using the `expressHandler` function can be accessed using `genkit/client` library:
Flows and actions exposed using the `expressHandler` function can be accessed using `genkit/beta/client` library:

```ts
import { runFlow, streamFlow } from 'genkit/client';
import { runFlow, streamFlow } from 'genkit/beta/client';

const result = await runFlow({
url: `http://localhost:${port}/simpleFlow`,
Expand Down
2 changes: 1 addition & 1 deletion js/plugins/express/tests/express_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import * as assert from 'assert';
import express from 'express';
import { GenerateResponseData, Genkit, genkit, z } from 'genkit';
import { runFlow, streamFlow } from 'genkit/client';
import { runFlow, streamFlow } from 'genkit/beta/client';
import { GenerateResponseChunkData, ModelAction } from 'genkit/model';
import getPort from 'get-port';
import * as http from 'http';
Expand Down
2 changes: 1 addition & 1 deletion js/plugins/firebase/tests/functions_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as express from 'express';
import { initializeApp } from 'firebase/app';
import { getFunctions, httpsCallableFromURL } from 'firebase/functions';
import { Genkit, genkit } from 'genkit';
import { runFlow, streamFlow } from 'genkit/client';
import { runFlow, streamFlow } from 'genkit/beta/client';
import * as getPort from 'get-port';
import * as http from 'http';
import { RequestWithAuth, noAuth, onFlow } from '../lib/functions.js';
Expand Down
2 changes: 1 addition & 1 deletion js/plugins/next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { appRoute } from '@genkit-ai/nextjs';
export const POST = appRoute(simpleFlow);
```

APIs can be called with the generic `genkit/client` library, or `@genkit-ai/nextjs/client`
APIs can be called with the generic `genkit/beta/client` library, or `@genkit-ai/nextjs/client`

```ts
import { runFlow, streamFlow } from '@genkit-ai/nextjs/client';
Expand Down
2 changes: 1 addition & 1 deletion js/plugins/next/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Action } from '@genkit-ai/core';
import {
runFlow as baseRunFlow,
streamFlow as baseStreamFlow,
} from 'genkit/client';
} from 'genkit/beta/client';

type Input<A extends Action> =
A extends Action<infer I, any, any> ? I['_output'] : never;
Expand Down
2 changes: 1 addition & 1 deletion tests/src/flow_server_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { readFileSync } from 'fs';
import { streamFlow } from 'genkit/client';
import { streamFlow } from 'genkit/beta/client';
import * as yaml from 'yaml';
import { retriable, runTestsForApp } from './utils.js';

Expand Down
Loading