MCPcopy Create free account
hub / github.com/angular/examples / genImgBlob

Function genImgBlob

genkit-angular-story-generator/src/flows.ts:264–275  ·  view source on GitHub ↗
(story: string, sessionId: string)

Source from the content-addressed store, hash-verified

262);
263
264async function genImgBlob(story: string, sessionId: string): Promise<string> {
265 const session = await ai.loadSession(sessionId, {
266 store: new JsonSessionStore(),
267 });
268 const chat = session.chat({ sessionId, model });
269 const { text: storyImgDescr } = await chat.send(`
270 Describe an image that the captures the essence of this story: ${story}.
271 Do not use any words indicating violence or profanity. Return a string only.
272 Do not return JSON.`);
273 const imgPrompt = createImgPrompt(storyImgDescr);
274 return await imgBlobFlow(imgPrompt);
275}
276
277const imgBlobFlow = ai.defineFlow(
278 {

Callers 1

flows.tsFile · 0.85

Calls 1

createImgPromptFunction · 0.90

Tested by

no test coverage detected