Skip to content

Commit

Permalink
refactor: ♻️ simplify cache control logic and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Dec 23, 2024
1 parent 143af5d commit 0acea5b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/core/src/promptdom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ async function renderDefDataNode(n: PromptDefDataNode): Promise<string> {
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) &&
Expand All @@ -356,11 +355,10 @@ async function renderDefDataNode(n: PromptDefDataNode): Promise<string> {
}

const value = lang
? `${name}:
\`\`\`${lang}
? `<${name} format="${lang}">
${trimNewlines(text)}
\`\`\`
`
<${name}>
F`
: `${name}:
${trimNewlines(text)}
`
Expand Down

0 comments on commit 0acea5b

Please sign in to comment.