ckanaction/docs/lib/get-llm-text.ts
2026-06-11 18:11:00 -04:00

11 lines
No EOL
325 B
TypeScript

import type { source } from "@/lib/source";
export async function getLLMText(page: (typeof source)['$inferPage']) {
if (page.type === 'openapi') return JSON.stringify(page.data.getSchema(), null, 2);
const processed = await page.data.getText('processed');
return `# ${page.data.title} (${page.url})
${processed}`;
}