Skip to content
Merged
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
17 changes: 17 additions & 0 deletions samples/js-gemini/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,23 @@ ai.defineFlow(
}
);

// Gemini reasoning example.
ai.defineFlow('reasoning', async (_, { sendChunk }) => {
const { message } = await ai.generate({
prompt: 'what is heavier, one kilo of steel or one kilo of feathers',
model: googleAI.model('gemini-2.5-pro'),
config: {
thinkingConfig: {
thinkingBudget: 1024,
includeThoughts: true,
},
},
onChunk: sendChunk,
});

return message;
});

// Image generation with Gemini.
ai.defineFlow('gemini-image-generation', async (_, { sendChunk }) => {
const { media } = await ai.generate({
Expand Down