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

Enhance generateContentStream with streamCallbacks support. Fixes #322 #401

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cestercian
Copy link

@cestercian cestercian commented Mar 8, 2025

  • Adds streamCallbacks as an optional argument to generateContentStream.
  • Enables users to receive text responses via callbacks without handling Node.js streams.
  • Includes test cases for the new functionality.

Example Usage:

await model.generateContentStream("Tell me a joke", {}, {
   onData: (chunk: string) => process.stdout.write(chunk),  
   onDone: (fullText: string) => console.log("\nFinal output:", fullText),
});

@demoncoder-crypto
Copy link

I am working on this issue let me know if its up to expectation

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.

2 participants