fix(journaling): optimize serper video search queries to prevent MDX hallucination
Some checks failed
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 1s
Monorepo Pipeline / 🧪 Test (push) Successful in 59s
Monorepo Pipeline / 🧹 Lint (push) Failing after 2m0s
Monorepo Pipeline / 🏗️ Build (push) Successful in 5m9s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
Some checks failed
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 1s
Monorepo Pipeline / 🧪 Test (push) Successful in 59s
Monorepo Pipeline / 🧹 Lint (push) Failing after 2m0s
Monorepo Pipeline / 🏗️ Build (push) Successful in 5m9s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
This commit is contained in:
@@ -190,11 +190,21 @@ Return JSON: { "facts": [ { "statement": "...", "source": "Organization Name Onl
|
||||
messages: [
|
||||
{
|
||||
role: "system",
|
||||
content: `Generate a YouTube search query to find a high-quality, professional educational video about: "${topic}".
|
||||
Prefer official tech channels or well-known developers (e.g., Google Chrome Developers, Vercel, Theo - t3.gg, Fireship, etc.).
|
||||
Return a JSON object with a single string field "query". Example: {"query": "core web vitals explanation google developers"}.
|
||||
DO NOT USE QUOTES IN THE QUERY ITSELF.`,
|
||||
content: `You generate ultra-short, highly relevant YouTube search queries based on a given text context.
|
||||
|
||||
RULES:
|
||||
1. Extract only the 2-4 most important technical or business keywords from the provided text.
|
||||
2. Ignore all markdown syntax, frontmatter (---), titles, and descriptions.
|
||||
3. Keep the query generic enough to find popular educational tech videos.
|
||||
4. DO NOT append specific channel names (e.g., "Fireship", "Vercel") to the query.
|
||||
5. DO NOT USE QUOTES IN THE QUERY.
|
||||
|
||||
Return a JSON object with a single string field "query". Example: {"query": "core web vitals performance"}`,
|
||||
},
|
||||
{
|
||||
role: "user",
|
||||
content: `CONTEXT: ${topic}`,
|
||||
}
|
||||
],
|
||||
response_format: { type: "json_object" },
|
||||
});
|
||||
@@ -289,7 +299,7 @@ CRITICAL: Do NOT provide more than 2 trendsKeywords. Keep it extremely focused.`
|
||||
try {
|
||||
let parsed = JSON.parse(
|
||||
response.choices[0].message.content ||
|
||||
'{"trendsKeywords": [], "dcVariables": []}',
|
||||
'{"trendsKeywords": [], "dcVariables": []}',
|
||||
);
|
||||
if (Array.isArray(parsed)) {
|
||||
parsed = parsed[0] || { trendsKeywords: [], dcVariables: [] };
|
||||
|
||||
Reference in New Issue
Block a user