MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getApp

Function getApp

packages/ai/src/enrich.ts:85–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83
84let _app: ReturnType<typeof betterAgent> | null = null;
85function getApp() {
86 if (_app) return _app;
87 const agent = defineAgent({
88 name: 'insight-enrich',
89 description:
90 'Scores and summarizes analytics insights (one-shot, no persistence).',
91 model: enrichModel(),
92 contextSchema: z.object({}),
93 outputSchema: {
94 schema: enrichmentOutputJsonSchema,
95 name: 'insight_enrichment',
96 strict: true,
97 },
98 instruction: () => INSTRUCTION,
99 tools: () => [],
100 maxSteps: 1,
101 // biome-ignore lint/suspicious/noExplicitAny: same dodge as filter-command.ts
102 } as any);
103 _app = betterAgent({ agents: [agent] });
104 return _app;
105}
106
107/**
108 * Enrich a batch of insights in a single model call. Returns one entry per

Callers 1

enrichInsightsFunction · 0.70

Calls 1

enrichModelFunction · 0.85

Tested by

no test coverage detected