|
1 | 1 | // Experimental upcoming beta AI primitve. |
2 | 2 | // Please refer to the documentation for more information: https://langbase.com/docs for more information. |
3 | 3 | import 'dotenv/config'; |
4 | | -import fs from 'fs'; |
5 | 4 | import {Langbase} from 'langbase'; |
6 | | -import path from 'path'; |
7 | 5 |
|
8 | 6 | const langbase = new Langbase({ |
9 | 7 | apiKey: process.env.LANGBASE_API_KEY!, |
10 | 8 | }); |
11 | 9 |
|
12 | 10 | async function main() { |
13 | | - const documentPath = path.join(process.cwd(), 'chunk', 'index.ts'); |
14 | | - |
15 | 11 | const results = await langbase.chunk({ |
16 | | - document: fs.readFileSync(documentPath), |
17 | | - documentName: 'chunk.txt', |
18 | | - contentType: 'text/plain', |
19 | | - chunkMaxLength: '1024', |
20 | | - chunkOverlap: '256', |
| 12 | + content: `Langbase is the most powerful serverless AI platform for building AI agents with memory. |
| 13 | +Build, deploy, and scale AI agents with tools and memory (RAG). Simple AI primitives with a world-class developer experience without using any frameworks. |
| 14 | +
|
| 15 | +Compared to complex AI frameworks, Langbase is serverless and the first composable AI platform. |
| 16 | +
|
| 17 | +Build AI agents without any bloated frameworks. You write the logic, we handle the logistics. |
| 18 | +
|
| 19 | +Start by building simple AI agents (pipes) |
| 20 | +Then train serverless semantic Memory agents (RAG) to get accurate and trusted results |
| 21 | +Langbase provides several options to get started: |
| 22 | +
|
| 23 | +AI Studio: Build, collaborate, and deploy AI Agents with tools and Memory (RAG). |
| 24 | +Langbase SDK: Easiest wasy to build AI Agents with TypeScript. (recommended) |
| 25 | +HTTP API: Build AI agents with any language (Python, Go, PHP, etc.). |
| 26 | +or BaseAI.dev: Local-first, open-source web AI framework.`, |
| 27 | + chunkOverlap: 256, |
| 28 | + chunkMaxLength: 1024, |
21 | 29 | }); |
22 | 30 |
|
23 | 31 | console.log(results); |
|
0 commit comments