Skip to main content
Glama
by microsoft
chunk.genai.mjs846 B
script({ files: "src/rag/loremipsum.pdf", tests: {}, }) const chunks = await tokenizers.chunk(env.files[0], { chunkSize: 256, chunkOverlap: 42, lineNumbers: true, }) let summary = "" for (const chunk of chunks) { const { text } = await runPrompt( (ctx) => { ctx.$`Summarize the content in CHUNK. Use the content in SUMMARY_SO_FAR as a starting point (but do not repeat it). Answer in plain text.`.role( "system" ) ctx.def("CHUNK", chunk, { lineNumbers: false }) ctx.def("SUMMARY_SO_FAR", summary, { ignoreEmpty: true, lineNumbers: false, }) }, { model: "small", label: chunk.content.slice(0, 42) + "...", } ) summary = text } console.log(summary)

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/microsoft/genaiscript'

If you have feedback or need assistance with the MCP directory API, please join our Discord server