Add LLM text retrieval route

### Summary of Changes
- Introduced a new `GET` function in `route.ts` to aggregate and return LLM texts from both local and API sources.
- Set `revalidate` to false to optimize static content delivery.
- Implemented response formatting to return plain text with appropriate headers.

This addition enhances the LLM functionality by consolidating text retrieval into a single endpoint, improving efficiency and usability.
This commit is contained in:
mantrakp04 2026-03-23 12:06:20 -07:00
parent adbbe44dbf
commit ac2029b4af

View File

@ -0,0 +1,15 @@
import { getLLMText } from '../../../lib/get-llm-text';
import { apiSource, source } from '../../../lib/source';
export const revalidate = false;
export async function GET() {
const pages = [...source.getPages(), ...apiSource.getPages()];
const texts = await Promise.all(pages.map(getLLMText));
return new Response(texts.join('\n\n'), {
headers: {
'Content-Type': 'text/plain; charset=utf-8',
},
});
}