·
3 commits
to main
since this release
import { StreamToIterable } from '@axflow/models/shared';
import { GoogleGenerateContent } from '@axflow/models/google/generate-content';
const stream = await GoogleGenerateContent.stream(
{
model: 'gemini-pro',
contents: [
{
parts: [
{
text: 'Write a two sentence story about a magic backpack',
},
],
},
],
},
{
apiKey: process.env.GOOGLE_API_KEY,
}
);
for await (const chunk of StreamToIterable(stream)) {
console.log(chunk);
}