Skip to content
Snippets Groups Projects
Unverified Commit 9b5b012f authored by Alex Yang's avatar Alex Yang Committed by GitHub
Browse files

feat: new doc (#1374)

parent a5a75f61
No related branches found
No related tags found
No related merge requests found
Showing
with 295 additions and 0 deletions
...@@ -4,3 +4,4 @@ pnpm-lock.yaml ...@@ -4,3 +4,4 @@ pnpm-lock.yaml
lib/ lib/
dist/ dist/
.docusaurus/ .docusaurus/
.source/
# deps
/node_modules
# generated content
.contentlayer
.content-collections
.source
# test & build
/coverage
/.next/
/out/
/build
*.tsbuildinfo
# misc
.DS_Store
*.pem
/.pnp
.pnp.js
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# others
.env*.local
.vercel
next-env.d.ts
\ No newline at end of file
# next
This is a Next.js application generated with
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).
Run development server:
```bash
npm run dev
# or
pnpm dev
# or
yarn dev
```
Open http://localhost:3000 with your browser to see the result.
## Learn More
To learn more about Next.js and Fumadocs, take a look at the following
resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "app/global.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
import { createMDX } from "fumadocs-mdx/next";
const withMDX = createMDX();
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
};
export default withMDX(config);
{
"name": "@llamaindex/doc",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"start": "next start",
"postinstall": "fumadocs-mdx"
},
"dependencies": {
"@icons-pack/react-simple-icons": "^10.1.0",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-slot": "^1.1.0",
"class-variance-authority": "^0.7.0",
"clsx": "2.1.1",
"foxact": "^0.2.39",
"fumadocs-core": "14.0.2",
"fumadocs-mdx": "11.0.0",
"fumadocs-ui": "14.0.2",
"hast-util-to-jsx-runtime": "^2.3.2",
"lucide-react": "^0.436.0",
"next": "15.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-text-transition": "^3.1.0",
"shiki": "^1.22.0",
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@types/mdx": "^2.0.13",
"@types/node": "22.7.8",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3"
}
}
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
apps/next/public/android-chrome-192x192.png

10.6 KiB

apps/next/public/android-chrome-256x256.png

15.1 KiB

apps/next/public/apple-touch-icon.png

9.78 KiB

apps/next/public/favicon-16x16.png

867 B

apps/next/public/favicon-32x32.png

1.54 KiB

apps/next/public/favicon.ico

14.7 KiB

This diff is collapsed.
apps/next/public/logo-large.png

7.43 KiB

apps/next/public/logo.png

2.18 KiB

import { defineConfig, defineDocs } from "fumadocs-mdx/config";
export const { docs, meta } = defineDocs({
dir: "./src/content/docs",
});
export default defineConfig();
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/website/Footer";
import { HomeLayout } from "fumadocs-ui/layouts/home";
import type { ReactNode } from "react";
export default function Layout({
children,
}: {
children: ReactNode;
}): React.ReactElement {
return (
<HomeLayout {...baseOptions}>
{children}
<div className="container">
<Footer />
</div>
</HomeLayout>
);
}
import { CodeBlock } from "@/components/code-block";
import { Contributing } from "@/components/contribution";
import { Feature } from "@/components/feature";
import { NpmInstall } from "@/components/npm-install";
import { TextEffect } from "@/components/text-effect";
import { Button } from "@/components/ui/button";
import { SiStackblitz } from "@icons-pack/react-simple-icons";
import { Bot, Terminal } from "lucide-react";
import Link from "next/link";
export default function HomePage() {
return (
<main className="container mx-auto px-4 py-12">
<h1 className="text-4xl md:text-6xl font-bold text-center mb-4">
Build RAG Web App using
<br /> <span className="text-blue-500">LlamaIndex.TS</span>
</h1>
<p className="text-xl text-center text-gray-600 mb-12">
LlamaIndex.TS is the JS/TS library from our popular Python library
llama-index for building LLM applications
</p>
<div className="text-center text-lg text-gray-600 mb-12">
<span>Designed for building web applications under </span>
<TextEffect />
</div>
<div className="flex flex-wrap justify-center gap-4">
<Link href="/docs">
<Button className="bg-black text-white">Get Started</Button>
</Link>
<NpmInstall />
<Link
href="https://stackblitz.com/github/run-llama/LlamaIndexTS/tree/main/examples"
target="_blank"
rel="noreferrer noopener"
>
<Button className="bg-blue-500 text-white hover:bg-blue-600">
<SiStackblitz />
Playground
</Button>
</Link>
</div>
<div className="mt-4" />
<div className="grid grid-cols-1 border-r md:grid-cols-2">
<Feature
icon={Bot}
subheading="Agent"
heading="Build agent for RAG"
description="Build agents for RAG using LlamaIndex.TS. Agents are the core building blocks of RAG applications."
>
<CodeBlock
code={`
import { FunctionTool } from "llamaindex";
import { OpenAIAgent } from "@llamaindex/openai";
const interpreterTool = FunctionTool.from(...);
const systemPrompt = \`...\`;
const agent = new OpenAIAgent({
llm,
tools: [interpreterTool],
systemPrompt,
});
await agent.chat('...');`}
lang="ts"
/>
</Feature>
<Feature
icon={Terminal}
subheading="Create Llama CLI"
heading="CLI for starting RAG app with one line"
description="A command line tool to generate LlamaIndex apps, the easiest way to get started with LlamaIndex."
>
<CodeBlock
code="npx create-llama@latest"
lang="bash"
wrapper={{
title: "Terminal",
allowCopy: true,
}}
/>
<pre className="grid grid-cols-1 rounded-lg border bg-card p-4 text-xs leading-loose">
<code>
<div>? What app do you want to build?</div>
<ul>
<li>❯ Agentic RAG</li>
<li> Data Scientist</li>
<li> Financial Report Generator (using Workflows)</li>
<li> Code Artifact Agent</li>
<li> Structured extraction</li>
</ul>
</code>
<code>
? What language do you want to use?
<ul>
<li>❯ TypeScript</li>
<li> Python</li>
</ul>
</code>
<code className="text-muted-foreground">{`Initializing project with template...`}</code>
<code className="text-green-500">
Success! Created app at /path/to/app
</code>
</pre>
</Feature>
</div>
<Contributing />
<div className="border-b" />
</main>
);
}
import { source } from "@/lib/source";
import { createFromSource } from "fumadocs-core/search/server";
export const { GET } = createFromSource(source);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment