Skip to content

Adding experimental flows streaming client library#230

Merged
pavelgj merged 9 commits into
mainfrom
pavelj/flowClient
Jun 28, 2024
Merged

Adding experimental flows streaming client library#230
pavelgj merged 9 commits into
mainfrom
pavelj/flowClient

Conversation

@pavelgj
Copy link
Copy Markdown
Member

@pavelgj pavelgj commented May 23, 2024

For example in your client web app (angular, etc) you can do this:

import { streamFlow } from '@genkit-ai/flow/client';

const response = streamFlow({
  url: 'https://my-flow-deployed-url',
  input: 'foo',
});
for await (const chunk of response.stream()) {
  console.log(chunk);
}
console.log(await response.output());

@pavelgj pavelgj requested review from MichaelDoyle and tagboola May 23, 2024 17:35
@pavelgj pavelgj marked this pull request as ready for review May 23, 2024 17:36
Copy link
Copy Markdown
Contributor

@tagboola tagboola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

Comment thread js/flow/src/client/client.ts
@pavelgj pavelgj marked this pull request as draft May 24, 2024 20:05
@pavelgj pavelgj marked this pull request as ready for review June 28, 2024 19:25
@pavelgj pavelgj merged commit 8cf20f3 into main Jun 28, 2024
@pavelgj pavelgj deleted the pavelj/flowClient branch June 28, 2024 19:48
@lazakrisz
Copy link
Copy Markdown

super cool! 🔥 thank you Pavel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants