()
| 48 | |
| 49 | let _app: ReturnType<typeof betterAgent> | null = null; |
| 50 | function getApp() { |
| 51 | if (_app) return _app; |
| 52 | const agent = defineAgent({ |
| 53 | name: 'weekly-narrative', |
| 54 | description: 'Writes a weekly digest intro paragraph (one-shot).', |
| 55 | model: narrativeModel(), |
| 56 | contextSchema: z.object({}), |
| 57 | outputSchema: { |
| 58 | schema: narrativeOutputJsonSchema, |
| 59 | name: 'weekly_narrative', |
| 60 | strict: true, |
| 61 | }, |
| 62 | instruction: () => INSTRUCTION, |
| 63 | tools: () => [], |
| 64 | maxSteps: 1, |
| 65 | // biome-ignore lint/suspicious/noExplicitAny: same dodge as enrich.ts |
| 66 | } as any); |
| 67 | _app = betterAgent({ agents: [agent] }); |
| 68 | return _app; |
| 69 | } |
| 70 | |
| 71 | export async function generateWeeklyNarrative( |
| 72 | input: WeeklyNarrativeInput, |
no test coverage detected