INNER CODE UNIT · TypeScript
blogContent
miantiao-me/hacker-podcast · workflow/index.ts:98
const blogContent = await step.do(stepNames.generateBlogArticle, thinkingModelRetryConfig, async ({ attempt }) => {
const { text, usage, finishReason } = await generateText({
model: ctx.openai(getContentGenerationModel(ctx, attempt)),
system: summarizeBlogPrompt,
prompt: `<stories>${JSON.stringify(stories)}</stories>\n\n---\n\n${allStories.join('\n\n---\n\n')}`,
maxOutputTokens: ctx.maxTokens,
maxRetries: 0,
})
console.info(`create hacker daily blog content success`, { text, usage, finishReason })
return text
})
console.info('blog content:\n', ctx.isDev ? blogContent : blogContent.slice(0, 100))
await step.sleep(stepNames.pauseAfterBlogArticle, ctx.breakTime)