Skip to content

Commit b1db743

Browse files
codercatdevMiriad
authored andcommitted
fix: move infographic instructions to Sanity contentConfig singleton
Moves hardcoded INFOGRAPHIC_INSTRUCTIONS to contentConfig.infographicInstructions array field. Alex can now add/remove/reorder prompts in Sanity Studio.
1 parent 547803b commit b1db743

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

app/api/cron/check-research/route.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ async function buildStuckThresholds(): Promise<Record<string, number>> {
109109
/** Max docs to process per status per run — keeps total time well under 60s */
110110
const MAX_DOCS_PER_STATUS = 2;
111111

112-
/** Infographic instructions for visual variety */
113-
const INFOGRAPHIC_INSTRUCTIONS = [
112+
import { getConfigValue } from "@/lib/config";
113+
114+
/** Default infographic instructions — used when content_config singleton doesn't exist yet */
115+
const DEFAULT_INFOGRAPHIC_INSTRUCTIONS = [
114116
'Create a high-level architecture overview diagram',
115117
'Create a comparison chart of key features and alternatives',
116118
'Create a step-by-step workflow diagram',
@@ -261,9 +263,14 @@ async function stepResearchComplete(
261263
const sourceIds = await nbClient.getSourceIds(notebookId);
262264
console.log(`[check-research] Found ${sourceIds.length} source IDs`);
263265

264-
// Start all 5 infographic generations
266+
// Start all infographic generations (instructions from Sanity config)
267+
const infographicInstructions = await getConfigValue(
268+
"content_config",
269+
"infographicInstructions",
270+
DEFAULT_INFOGRAPHIC_INSTRUCTIONS,
271+
);
265272
const artifactIds: string[] = [];
266-
for (const instruction of INFOGRAPHIC_INSTRUCTIONS) {
273+
for (const instruction of infographicInstructions) {
267274
try {
268275
const result = await nbClient.generateInfographic(notebookId, {
269276
sourceIds,

sanity/schemas/singletons/contentConfig.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ export default defineType({
113113
initialValue: 90,
114114
validation: (Rule) => Rule.min(0).max(365),
115115
}),
116+
defineField({
117+
name: "infographicInstructions",
118+
title: "Infographic Instructions",
119+
type: "array",
120+
description: "Prompts sent to NotebookLM for infographic generation. Each instruction produces one infographic per research run. Reorder, add, or remove to control visual output.",
121+
of: [{ type: "string" }],
122+
initialValue: [
123+
"Create a high-level architecture overview diagram",
124+
"Create a comparison chart of key features and alternatives",
125+
"Create a step-by-step workflow diagram",
126+
"Create a timeline of key developments and milestones",
127+
"Create a pros and cons visual summary",
128+
],
129+
}),
116130
],
117131
preview: {
118132
prepare() {

0 commit comments

Comments
 (0)