Parse a document
This example demonstrates how to parse a document.
Parse a document Example
Parse a document Example
import 'dotenv/config';
import {Langbase} from 'langbase';
const langbase = new Langbase({
apiKey: process.env.LANGBASE_API_KEY!,
});
async function main() {
const content = "Langbase is the most powerful serverless AI platform for building AI agents with memory. Build, deploy, and scale AI agents with tools and memory (RAG). Simple AI primitives with a world-class developer experience without using any frameworks."
const document_bytes = Buffer.from(content, 'utf-8')
const results = await langbase.parser({
document: document_bytes,
documentName: 'langbase.md',
contentType: 'text/plain',
});
console.log(results);
}
main();