From 0acea5be057a6225d033d874824a5ccd097d0fe9 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 23 Dec 2024 08:41:54 +0000 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20simplify=20cac?= =?UTF-8?q?he=20control=20logic=20and=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/promptdom.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/core/src/promptdom.ts b/packages/core/src/promptdom.ts index 856c0a5ea..c54053bf3 100644 --- a/packages/core/src/promptdom.ts +++ b/packages/core/src/promptdom.ts @@ -330,7 +330,6 @@ async function renderDefDataNode(n: PromptDefDataNode): Promise { const { name, headers, priority, ephemeral, query } = n let data = n.resolved let format = n.format - const cacheControl = n.cacheControl ?? (ephemeral ? "ephemeral" : undefined) if ( !format && Array.isArray(data) && @@ -356,11 +355,10 @@ async function renderDefDataNode(n: PromptDefDataNode): Promise { } const value = lang - ? `${name}: -\`\`\`${lang} + ? `<${name} format="${lang}"> ${trimNewlines(text)} -\`\`\` -` +<${name}> +F` : `${name}: ${trimNewlines(text)} `