Compare commits

..

15 Commits

Author SHA1 Message Date
thucpn 4a520e05ff Merge branch 'feat/integrate-postgresql-datasource' of github.com:run-llama/LlamaIndexTS into feat/integrate-postgresql-datasource 2024-01-04 15:37:12 +07:00
thucpn b6c109baa5 chore: resolve conflict 2024-01-04 15:36:58 +07:00
Thuc Pham a89534b704 feat: use connection string for create llama 2024-01-04 15:36:21 +07:00
Thuc Pham 9132d3c23e feat: integrate create-llama with postgresql on cloud 2024-01-04 15:36:21 +07:00
Thuc Pham e78eece82d feat: update document to use timescale postgresql 2024-01-04 15:36:20 +07:00
thucpn 29b0f078ed fix: add await to connect db 2024-01-04 15:36:20 +07:00
thucpn 4ba9a6cbe5 docs: update question and log 2024-01-04 15:36:20 +07:00
thucpn 0e4290e525 feat: integrate postgresql datasource 2024-01-04 15:35:44 +07:00
thucpn 1ea126bb5b chore: resolve conflict 2024-01-04 15:33:02 +07:00
Thuc Pham 426eb43b41 feat: use connection string for create llama 2024-01-04 07:47:03 +00:00
Thuc Pham 47f706bbd5 feat: integrate create-llama with postgresql on cloud 2024-01-03 10:29:41 +00:00
Thuc Pham 55fc9c6beb feat: update document to use timescale postgresql 2024-01-03 09:13:42 +00:00
thucpn 9a42038a71 fix: add await to connect db 2023-12-26 17:23:24 +07:00
thucpn c4b43e5afb docs: update question and log 2023-12-26 17:10:19 +07:00
thucpn 03e302f6b1 feat: integrate postgresql datasource 2023-12-21 11:10:37 +07:00
437 changed files with 6698 additions and 10988 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": true,
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
+5
View File
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---
Use compromise as sentence tokenizer
+5
View File
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---
Removed pdf-parse, and directly use latest pdf.js
-5
View File
@@ -1,5 +0,0 @@
---
"create-llama": patch
---
Add node_modules to gitignore in Express backends
+5
View File
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---
Added pinecone vector DB
+2 -2
View File
@@ -4,6 +4,6 @@
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers-contrib/features/turborepo-npm:1": {},
"ghcr.io/devcontainers-contrib/features/typescript:2": {},
"ghcr.io/devcontainers-contrib/features/pnpm:2": {},
},
"ghcr.io/devcontainers-contrib/features/pnpm:2": {}
}
}
-4
View File
@@ -7,8 +7,4 @@ module.exports = {
rootDir: ["apps/*/"],
},
},
rules: {
"max-params": ["error", 4],
},
ignorePatterns: ["dist/"],
};
-15
View File
@@ -8,9 +8,6 @@ on:
- ".github/workflows/e2e.yml"
branches: [main]
env:
POETRY_VERSION: "1.6.1"
jobs:
e2e:
name: create-llama
@@ -19,22 +16,10 @@ jobs:
fail-fast: true
matrix:
node-version: [18, 20]
python-version: ["3.11"]
os: [macos-latest, windows-latest]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
- uses: pnpm/action-setup@v2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
@@ -14,8 +14,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Setup Node.js
uses: actions/setup-node@v4
with:
-18
View File
@@ -18,21 +18,3 @@ jobs:
run: pnpm install
- name: Run tests
run: pnpm run test
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
working-directory: ./packages/core
- name: Run Type Check
run: pnpm run type-check
+3 -1
View File
@@ -37,7 +37,9 @@ yarn-error.log*
.vercel
dist/
lib/
# vs code
.vscode/launch.json
.cache
test-results/
-1
View File
@@ -1,2 +1 @@
auto-install-peers = true
enable-pre-post-scripts = true
+1 -4
View File
@@ -1,6 +1,3 @@
apps/docs/i18n
apps/docs/docs/api
pnpm-lock.yaml
lib/
dist/
.docusaurus/
-17
View File
@@ -1,17 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Example",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "pnpm",
"cwd": "${workspaceFolder}/examples",
"runtimeArgs": ["ts-node", "${fileBasename}"]
}
]
}
+7 -12
View File
@@ -1,20 +1,11 @@
# LlamaIndex.TS
[![NPM Version](https://img.shields.io/npm/v/llamaindex)](https://www.npmjs.com/package/llamaindex)
[![NPM License](https://img.shields.io/npm/l/llamaindex)](https://www.npmjs.com/package/llamaindex)
[![NPM Downloads](https://img.shields.io/npm/dm/llamaindex)](https://www.npmjs.com/package/llamaindex)
[![Discord](https://img.shields.io/discord/1059199217496772688)](https://discord.com/invite/eN6D2HQ4aX)
LlamaIndex is a data framework for your LLM application.
Use your own data with large language models (LLMs, OpenAI ChatGPT and others) in Typescript and Javascript.
Documentation: https://ts.llamaindex.ai/
Try examples online:
[![Open in Stackblitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/run-llama/LlamaIndexTS/tree/main/examples)
## What is LlamaIndex.TS?
LlamaIndex.TS aims to be a lightweight, easy to use set of libraries to help you integrate large language models into your applications with your own data.
@@ -56,9 +47,9 @@ async function main() {
// Query the index
const queryEngine = index.asQueryEngine();
const response = await queryEngine.query({
query: "What did the author do in college?",
});
const response = await queryEngine.query(
"What did the author do in college?",
);
// Output response
console.log(response.toString());
@@ -110,9 +101,13 @@ const nextConfig = {
...config.resolve.alias,
sharp$: false,
"onnxruntime-node$": false,
mongodb$: false,
};
return config;
},
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Puts pdf-parse in actual NodeJS mode with NextJS App Router
},
};
module.exports = nextConfig;
-1
View File
@@ -7,7 +7,6 @@
# Generated files
.docusaurus
.cache-loader
lib
# Misc
.DS_Store
-7
View File
@@ -1,7 +0,0 @@
# docs
## 0.0.1
### Patch Changes
- 3154f52: chore: add qdrant readme
@@ -2,7 +2,7 @@
sidebar_position: 3
---
# Concepts
# High-Level Concepts
LlamaIndex.TS helps you build LLM-powered applications (e.g. Q&A, chatbot) over custom data.
@@ -18,7 +18,7 @@ LlamaIndex uses a two stage method when using an LLM with your data:
1. **indexing stage**: preparing a knowledge base, and
2. **querying stage**: retrieving relevant context from the knowledge to assist the LLM in responding to a question
![](../_static/concepts/rag.jpg)
![](./_static/concepts/rag.jpg)
This process is also known as Retrieval Augmented Generation (RAG).
@@ -30,7 +30,7 @@ Let's explore each stage in detail.
LlamaIndex.TS help you prepare the knowledge base with a suite of data connectors and indexes.
![](../_static/concepts/indexing.jpg)
![](./_static/concepts/indexing.jpg)
[**Data Loaders**](./modules/high_level/data_loader.md):
A data connector (i.e. `Reader`) ingest data from different data sources and data formats into a simple `Document` representation (text and simple metadata).
@@ -56,7 +56,7 @@ LlamaIndex provides composable modules that help you build and integrate RAG pip
These building blocks can be customized to reflect ranking preferences, as well as composed to reason over multiple knowledge bases in a structured way.
![](../_static/concepts/querying.jpg)
![](./_static/concepts/querying.jpg)
#### Building Blocks
+49
View File
@@ -0,0 +1,49 @@
---
sidebar_position: 4
---
# End to End Examples
We include several end-to-end examples using LlamaIndex.TS in the repository
Check out the examples below or try them out and complete them in minutes with interactive Github Codespace tutorials provided by Dev-Docs [here](https://codespaces.new/team-dev-docs/lits-dev-docs-playground?devcontainer_path=.devcontainer%2Fjavascript_ltsquickstart%2Fdevcontainer.json):
## [Chat Engine](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/chatEngine.ts)
Read a file and chat about it with the LLM.
## [Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/vectorIndex.ts)
Create a vector index and query it. The vector index will use embeddings to fetch the top k most relevant nodes. By default, the top k is 2.
## [Summary Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/summaryIndex.ts)
Create a list index and query it. This example also use the `LLMRetriever`, which will use the LLM to select the best nodes to use when generating answer.
## [Save / Load an Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/storageContext.ts)
Create and load a vector index. Persistance to disk in LlamaIndex.TS happens automatically once a storage context object is created.
## [Customized Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/vectorIndexCustomize.ts)
Create a vector index and query it, while also configuring the the `LLM`, the `ServiceContext`, and the `similarity_top_k`.
## [OpenAI LLM](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/openai.ts)
Create an OpenAI LLM and directly use it for chat.
## [Llama2 DeuceLLM](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/llamadeuce.ts)
Create a Llama-2 LLM and directly use it for chat.
## [SubQuestionQueryEngine](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/subquestion.ts)
Uses the `SubQuestionQueryEngine`, which breaks complex queries into multiple questions, and then aggreates a response across the answers to all sub-questions.
## [Low Level Modules](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/lowlevel.ts)
This example uses several low-level components, which removes the need for an actual query engine. These components can be used anywhere, in any application, or customized and sub-classed to meet your own needs.
## [JSON Entity Extraction](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/jsonExtract.ts)
Features OpenAI's chat API (using [`json_mode`](https://platform.openai.com/docs/guides/text-generation/json-mode)) to extract a JSON object from a sales call transcript.
+29
View File
@@ -0,0 +1,29 @@
---
sidebar_position: 5
---
# Environments
LlamaIndex currently officially supports NodeJS 18 and NodeJS 20.
## NextJS App Router
If you're using NextJS App Router route handlers/serverless functions, you'll need to use the NodeJS mode:
```js
export const runtime = "nodejs"; // default
```
and you'll need to add an exception for pdf-parse in your next.config.js
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Puts pdf-parse in actual NodeJS mode with NextJS App Router
},
};
module.exports = nextConfig;
```
-2
View File
@@ -1,2 +0,0 @@
label: Examples
position: 2
-12
View File
@@ -1,12 +0,0 @@
---
sidebar_position: 1
---
import CodeBlock from "@theme/CodeBlock";
import CodeSource from "!raw-loader!../../../../examples/chatEngine";
# Chat Engine
Chat Engine is a class that allows you to create a chatbot from a retriever. It is a wrapper around a retriever that allows you to chat with it in a conversational manner.
<CodeBlock language="ts">{CodeSource}</CodeBlock>
@@ -1,7 +0,0 @@
---
sidebar_position: 5
---
# More examples
You can check out more examples in the [examples](https://github.com/run-llama/LlamaIndexTS/tree/main/examples) folder of the repository.
@@ -1,10 +0,0 @@
---
sidebar_position: 4
---
import CodeBlock from "@theme/CodeBlock";
import CodeSource from "!raw-loader!../../../../examples/storageContext";
# Save/Load an Index
<CodeBlock language="ts">{CodeSource}</CodeBlock>
-10
View File
@@ -1,10 +0,0 @@
---
sidebar_position: 3
---
import CodeBlock from "@theme/CodeBlock";
import CodeSource from "!raw-loader!../../../../examples/summaryIndex";
# Summary Index
<CodeBlock language="ts">{CodeSource}</CodeBlock>
-10
View File
@@ -1,10 +0,0 @@
---
sidebar_position: 2
---
import CodeBlock from "@theme/CodeBlock";
import CodeSource from "!raw-loader!../../../../examples/vectorIndex";
# Vector Index
<CodeBlock language="ts">{CodeSource}</CodeBlock>
@@ -1,2 +0,0 @@
label: Getting Started
position: 1
@@ -1,15 +0,0 @@
---
sidebar_position: 2
---
# Environments
LlamaIndex currently officially supports NodeJS 18 and NodeJS 20.
## NextJS App Router
If you're using NextJS App Router route handlers/serverless functions, you'll need to use the NodeJS mode:
```js
export const runtime = "nodejs"; // default
```
@@ -1,5 +1,5 @@
---
sidebar_position: 0
sidebar_position: 1
---
# Installation and Setup
+1 -1
View File
@@ -39,7 +39,7 @@ For more complex applications, our lower-level APIs allow advanced users to cust
Our documentation includes [Installation Instructions](./installation.mdx) and a [Starter Tutorial](./starter.md) to build your first application.
Once you're up and running, [High-Level Concepts](./getting_started/concepts.md) has an overview of LlamaIndex's modular architecture. For more hands-on practical examples, look through our [End-to-End Tutorials](./end_to_end.md).
Once you're up and running, [High-Level Concepts](./concepts.md) has an overview of LlamaIndex's modular architecture. For more hands-on practical examples, look through our [End-to-End Tutorials](./end_to_end.md).
## 🗺️ Ecosystem
@@ -0,0 +1 @@
label: High-Level Modules
@@ -11,16 +11,7 @@ const retriever = index.asRetriever();
const chatEngine = new ContextChatEngine({ retriever });
// start chatting
const response = await chatEngine.chat({ message: query });
```
The `chat` function also supports streaming, just add `stream: true` as an option:
```typescript
const stream = await chatEngine.chat({ message: query, stream: true });
for await (const chunk of stream) {
process.stdout.write(chunk.response);
}
const response = await chatEngine.chat(query);
```
## Api References
@@ -1,5 +1,5 @@
---
sidebar_position: 1
sidebar_position: 0
---
# Documents and Nodes
@@ -8,16 +8,7 @@ A query engine wraps a `Retriever` and a `ResponseSynthesizer` into a pipeline,
```typescript
const queryEngine = index.asQueryEngine();
const response = await queryEngine.query({ query: "query string" });
```
The `query` function also supports streaming, just add `stream: true` as an option:
```typescript
const stream = await queryEngine.query({ query: "query string", stream: true });
for await (const chunk of stream) {
process.stdout.write(chunk.response);
}
const response = await queryEngine.query("query string");
```
## Sub Question Query Engine
@@ -0,0 +1 @@
label: Low-Level Modules
@@ -1,5 +1,5 @@
---
sidebar_position: 1
sidebar_position: 0
---
# LLM
@@ -35,26 +35,13 @@ const nodesWithScore: NodeWithScore[] = [
},
];
const response = await responseSynthesizer.synthesize({
query: "What age am I?",
const response = await responseSynthesizer.synthesize(
"What age am I?",
nodesWithScore,
});
);
console.log(response.response);
```
The `synthesize` function also supports streaming, just add `stream: true` as an option:
```typescript
const stream = await responseSynthesizer.synthesize({
query: "What age am I?",
nodesWithScore,
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.response);
}
```
## API Reference
- [ResponseSynthesizer](../../api/classes/ResponseSynthesizer.md)
@@ -1,2 +0,0 @@
label: "Vector Stores"
position: 0
@@ -1,88 +0,0 @@
# Qdrant Vector Store
To run this example, you need to have a Qdrant instance running. You can run it with Docker:
```bash
docker pull qdrant/qdrant
docker run -p 6333:6333 qdrant/qdrant
```
## Importing the modules
```ts
import fs from "node:fs/promises";
import { Document, VectorStoreIndex, QdrantVectorStore } from "llamaindex";
```
## Load the documents
```ts
const path = "node_modules/llamaindex/examples/abramov.txt";
const essay = await fs.readFile(path, "utf-8");
```
## Setup Qdrant
```ts
const vectorStore = new QdrantVectorStore({
url: "http://localhost:6333",
port: 6333,
});
```
## Setup the index
```ts
const document = new Document({ text: essay, id_: path });
const index = await VectorStoreIndex.fromDocuments([document], {
vectorStore,
});
```
## Query the index
```ts
const queryEngine = index.asQueryEngine();
const response = await queryEngine.query({
query: "What did the author do in college?",
});
// Output response
console.log(response.toString());
```
## Full code
```ts
import fs from "node:fs/promises";
import { Document, VectorStoreIndex, QdrantVectorStore } from "llamaindex";
async function main() {
const path = "node_modules/llamaindex/examples/abramov.txt";
const essay = await fs.readFile(path, "utf-8");
const vectorStore = new QdrantVectorStore({
url: "http://localhost:6333",
port: 6333,
});
const document = new Document({ text: essay, id_: path });
const index = await VectorStoreIndex.fromDocuments([document], {
vectorStore,
});
const queryEngine = index.asQueryEngine();
const response = await queryEngine.query({
query: "What did the author do in college?",
});
// Output response
console.log(response.toString());
}
main().catch(console.error);
```
@@ -1,2 +0,0 @@
label: Observability
position: 5
-35
View File
@@ -1,35 +0,0 @@
# Observability
LlamaIndex provides **one-click observability** 🔭 to allow you to build principled LLM applications in a production setting.
A key requirement for principled development of LLM applications over your data (RAG systems, agents) is being able to observe, debug, and evaluate
your system - both as a whole and for each component.
This feature allows you to seamlessly integrate the LlamaIndex library with powerful observability/evaluation tools offered by our partners.
Configure a variable once, and you'll be able to do things like the following:
- View LLM/prompt inputs/outputs
- Ensure that the outputs of any component (LLMs, embeddings) are performing as expected
- View call traces for both indexing and querying
Each provider has similarities and differences. Take a look below for the full set of guides for each one!
## OpenLLMetry
[OpenLLMetry](https://github.com/traceloop/openllmetry-js) is an open-source project based on OpenTelemetry for tracing and monitoring
LLM applications. It connects to [all major observability platforms](https://www.traceloop.com/docs/openllmetry/integrations/introduction) and installs in minutes.
### Usage Pattern
```bash
npm install @traceloop/node-server-sdk
```
```js
import * as traceloop from "@traceloop/node-server-sdk";
traceloop.initialize({
apiKey: process.env.TRACELOOP_API_KEY,
disableBatch: true,
});
```
@@ -1,5 +1,5 @@
---
sidebar_position: 1
sidebar_position: 2
---
# Starter Tutorial
+3 -8
View File
@@ -1,9 +1,8 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const renderer = require("prism-react-renderer");
const lightCodeTheme = renderer.themes.github;
const darkCodeTheme = renderer.themes.dracula;
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
/** @type {import('@docusaurus/types').Config} */
const config = {
@@ -51,11 +50,10 @@ const config = {
presets: [
[
"@docusaurus/preset-classic",
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: "docs",
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
@@ -173,9 +171,6 @@ const config = {
},
],
],
markdown: {
format: "detect",
},
};
module.exports = config;
@@ -1 +0,0 @@
../../../../docs/api
@@ -0,0 +1 @@
../../../../docs/api
@@ -15,3 +15,17 @@ sidebar_position: 5
```js
export const runtime = "nodejs"; // الافتراضي
```
وستحتاج أيضًا إلى إضافة استثناء لـ pdf-parse في next.config.js الخاص بك
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // يضع pdf-parse في وضع NodeJS الفعلي مع NextJS App Router
},
};
module.exports = nextConfig;
```
@@ -2,12 +2,15 @@
sidebar_position: 1
---
# التثبيت والإعداد
`تمت ترجمة هذه الوثيقة تلقائيًا وقد تحتوي على أخطاء. لا تتردد في فتح طلب سحب لاقتراح تغييرات.`
```تمت ترجمة هذه الوثيقة تلقائيًا وقد تحتوي على أخطاء. لا تتردد في فتح طلب سحب لاقتراح تغييرات.```
تأكد من أن لديك NodeJS v18 أو أحدث.
## باستخدام create-llama
أسهل طريقة للبدء مع LlamaIndex هي باستخدام `create-llama`. هذه الأداة سطر الأوامر تمكنك من بدء بناء تطبيق LlamaIndex جديد بسرعة، مع كل شيء معد لك.
@@ -45,13 +48,13 @@ npm run dev
```
لبدء خادم التطوير. يمكنك ثم زيارة [http://localhost:3000](http://localhost:3000) لرؤية تطبيقك.
## التثبيت من NPM
```bash npm2yarn
npm install llamaindex
```
### المتغيرات البيئية
تستخدم أمثلتنا OpenAI افتراضيًا. ستحتاج إلى إعداد مفتاح Open AI الخاص بك على النحو التالي:
@@ -64,4 +67,5 @@ export OPENAI_API_KEY="sk-......" # استبدله بالمفتاح الخاص
تحذير: لا تقم بإضافة مفتاح OpenAI الخاص بك إلى نظام التحكم في الإصدارات.
"
@@ -41,7 +41,7 @@ LlamaIndex.TS هو إطار بيانات لتطبيقات LLM لاستيعاب
تتضمن وثائقنا [تعليمات التثبيت](./installation.mdx) و[دليل البداية](./starter.md) لبناء تطبيقك الأول.
بمجرد أن تكون جاهزًا وتعمل ، يحتوي [مفاهيم عالية المستوى](./getting_started/concepts.md) على نظرة عامة على الهندسة المعمارية المتعددة المستويات لـ LlamaIndex. لمزيد من الأمثلة العملية التفصيلية ، يمكنك الاطلاع على [دروس النهاية إلى النهاية](./end_to_end.md).
بمجرد أن تكون جاهزًا وتعمل ، يحتوي [مفاهيم عالية المستوى](./concepts.md) على نظرة عامة على الهندسة المعمارية المتعددة المستويات لـ LlamaIndex. لمزيد من الأمثلة العملية التفصيلية ، يمكنك الاطلاع على [دروس النهاية إلى النهاية](./end_to_end.md).
## 🗺️ النظام البيئي
@@ -1 +0,0 @@
../../../../docs/api
@@ -0,0 +1 @@
../../../../docs/api
@@ -15,3 +15,17 @@ LlamaIndex в момента официално поддържа NodeJS 18 и No
```js
export const runtime = "nodejs"; // по подразбиране
```
и ще трябва да добавите изключение за pdf-parse във вашия next.config.js
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Поставя pdf-parse в реален режим на NodeJS с NextJS App Router
},
};
module.exports = nextConfig;
```
@@ -2,12 +2,15 @@
sidebar_position: 1
---
# Инсталация и настройка
`Тази документация е преведена автоматично и може да съдържа грешки. Не се колебайте да отворите Pull Request, за да предложите промени.`
```Тази документация е преведена автоматично и може да съдържа грешки. Не се колебайте да отворите Pull Request, за да предложите промени.```
Уверете се, че имате NodeJS v18 или по-нова версия.
## Използване на create-llama
Най-лесният начин да започнете с LlamaIndex е чрез използването на `create-llama`. Този инструмент с команден ред ви позволява бързо да започнете да създавате ново приложение LlamaIndex, като всичко е настроено за вас.
@@ -45,13 +48,13 @@ npm run dev
```
за да стартирате сървъра за разработка. След това можете да посетите [http://localhost:3000](http://localhost:3000), за да видите вашето приложение.
## Инсталация от NPM
```bash npm2yarn
npm install llamaindex
```
### Променливи на средата
Нашият пример използва OpenAI по подразбиране. Ще трябва да настроите вашия Open AI ключ по следния начин:
@@ -43,7 +43,7 @@ LlamaIndex.TS предоставя основен набор от инструм
Документацията ни включва [Инструкции за инсталиране](./installation.mdx) и [Урок за начинаещи](./starter.md), за да построите първото си приложение.
След като сте готови, [Високо ниво концепции](./getting_started/concepts.md) представя общ преглед на модулната архитектура на LlamaIndex. За повече практически примери, разгледайте нашите [Уроци от начало до край](./end_to_end.md).
След като сте готови, [Високо ниво концепции](./concepts.md) представя общ преглед на модулната архитектура на LlamaIndex. За повече практически примери, разгледайте нашите [Уроци от начало до край](./end_to_end.md).
## 🗺️ Екосистема
@@ -1 +0,0 @@
../../../../docs/api
@@ -0,0 +1 @@
../../../../docs/api
@@ -15,3 +15,17 @@ Si utilitzeu els gestors de rutes/funcions sense servidor de l'enrutador d'aplic
```js
export const runtime = "nodejs"; // per defecte
```
i haureu d'afegir una excepció per a pdf-parse al vostre next.config.js
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Posiciona pdf-parse en el mode NodeJS real amb l'enrutador d'aplicacions NextJS
},
};
module.exports = nextConfig;
```
@@ -2,12 +2,15 @@
sidebar_position: 1
---
# Instal·lació i configuració
`Aquesta documentació s'ha traduït automàticament i pot contenir errors. No dubteu a obrir una Pull Request per suggerir canvis.`
```Aquesta documentació s'ha traduït automàticament i pot contenir errors. No dubteu a obrir una Pull Request per suggerir canvis.```
Assegureu-vos de tenir NodeJS v18 o superior.
## Utilitzant create-llama
La manera més senzilla de començar amb LlamaIndex és utilitzant `create-llama`. Aquesta eina de línia de comandes us permet començar ràpidament a construir una nova aplicació LlamaIndex, amb tot configurat per a vosaltres.
@@ -45,13 +48,13 @@ npm run dev
```
per iniciar el servidor de desenvolupament. A continuació, podeu visitar [http://localhost:3000](http://localhost:3000) per veure la vostra aplicació.
## Instal·lació des de NPM
```bash npm2yarn
npm install llamaindex
```
### Variables d'entorn
Els nostres exemples utilitzen OpenAI per defecte. Hauràs de configurar la teva clau d'Open AI de la següent manera:
@@ -41,7 +41,7 @@ Per a aplicacions més complexes, les nostres API de nivell inferior permeten al
La nostra documentació inclou [Instruccions d'Instal·lació](./installation.mdx) i un [Tutorial d'Inici](./starter.md) per a construir la vostra primera aplicació.
Un cop tingueu tot a punt, [Conceptes de Nivell Alt](./getting_started/concepts.md) ofereix una visió general de l'arquitectura modular de LlamaIndex. Per a més exemples pràctics, consulteu els nostres [Tutorials de Principi a Fi](./end_to_end.md).
Un cop tingueu tot a punt, [Conceptes de Nivell Alt](./concepts.md) ofereix una visió general de l'arquitectura modular de LlamaIndex. Per a més exemples pràctics, consulteu els nostres [Tutorials de Principi a Fi](./end_to_end.md).
## 🗺️ Ecosistema
@@ -1 +0,0 @@
../../../../docs/api
@@ -0,0 +1 @@
../../../../docs/api
@@ -15,3 +15,17 @@ Pokud používáte NextJS App Router pro zpracování tras/route a serverless fu
```js
export const runtime = "nodejs"; // výchozí hodnota
```
a budete muset přidat výjimku pro pdf-parse ve vašem next.config.js
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Přepne pdf-parse do režimu NodeJS s NextJS App Router
},
};
module.exports = nextConfig;
```
@@ -2,12 +2,15 @@
sidebar_position: 1
---
# Instalace a nastavení
`Tato dokumentace byla automaticky přeložena a může obsahovat chyby. Neváhejte otevřít Pull Request pro navrhování změn.`
```Tato dokumentace byla automaticky přeložena a může obsahovat chyby. Neváhejte otevřít Pull Request pro navrhování změn.```
Ujistěte se, že máte nainstalovaný NodeJS ve verzi 18 nebo vyšší.
## Použití create-llama
Nejjednodušší způsob, jak začít s LlamaIndexem, je použití `create-llama`. Tento nástroj příkazového řádku vám umožní rychle začít s vytvářením nové aplikace LlamaIndex s přednastaveným prostředím.
@@ -45,13 +48,13 @@ npm run dev
```
pro spuštění vývojového serveru. Poté můžete navštívit [http://localhost:3000](http://localhost:3000), abyste viděli vaši aplikaci.
## Instalace pomocí NPM
```bash npm2yarn
npm install llamaindex
```
### Proměnné prostředí
Naše příklady výchozí používají OpenAI. Budete potřebovat nastavit svůj Open AI klíč následovně:
@@ -41,7 +41,7 @@ Pro složitější aplikace naše API na nižší úrovni umožňuje pokročilý
Naše dokumentace obsahuje [Návod k instalaci](./installation.mdx) a [Úvodní tutoriál](./starter.md) pro vytvoření vaší první aplikace.
Jakmile jste připraveni, [Vysokoúrovňové koncepty](./getting_started/concepts.md) poskytují přehled o modulární architektuře LlamaIndexu. Pro více praktických příkladů se podívejte na naše [Tutoriály od začátku do konce](./end_to_end.md).
Jakmile jste připraveni, [Vysokoúrovňové koncepty](./concepts.md) poskytují přehled o modulární architektuře LlamaIndexu. Pro více praktických příkladů se podívejte na naše [Tutoriály od začátku do konce](./end_to_end.md).
## 🗺️ Ekosystém
@@ -1 +0,0 @@
../../../../docs/api
@@ -0,0 +1 @@
../../../../docs/api
@@ -15,3 +15,17 @@ Hvis du bruger NextJS App Router route handlers/serverless functions, skal du br
```js
export const runtime = "nodejs"; // standard
```
og du skal tilføje en undtagelse for pdf-parse i din next.config.js
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Sætter pdf-parse i faktisk NodeJS-tilstand med NextJS App Router
},
};
module.exports = nextConfig;
```
@@ -2,12 +2,15 @@
sidebar_position: 1
---
# Installation og opsætning
`Denne dokumentation er blevet automatisk oversat og kan indeholde fejl. Tøv ikke med at åbne en Pull Request for at foreslå ændringer.`
```Denne dokumentation er blevet automatisk oversat og kan indeholde fejl. Tøv ikke med at åbne en Pull Request for at foreslå ændringer.```
Sørg for at have NodeJS v18 eller nyere.
## Brug af create-llama
Den nemmeste måde at komme i gang med LlamaIndex er ved at bruge `create-llama`. Dette CLI-værktøj gør det muligt for dig at hurtigt starte med at bygge en ny LlamaIndex-applikation, hvor alt er sat op for dig.
@@ -45,13 +48,13 @@ npm run dev
```
for at starte udviklingsserveren. Du kan derefter besøge [http://localhost:3000](http://localhost:3000) for at se din app.
## Installation fra NPM
```bash npm2yarn
npm install llamaindex
```
### Miljøvariabler
Vores eksempler bruger som standard OpenAI. Du skal konfigurere din Open AI-nøgle som følger:
@@ -41,7 +41,7 @@ Til mere komplekse applikationer giver vores API'er på lavere niveau avancerede
Vores dokumentation inkluderer [Installationsinstruktioner](./installation.mdx) og en [Starter Tutorial](./starter.md) til at bygge din første applikation.
Når du er i gang, giver [Højniveaukoncepter](./getting_started/concepts.md) et overblik over LlamaIndex's modulære arkitektur. For flere praktiske eksempler, kan du kigge igennem vores [End-to-End Tutorials](./end_to_end.md).
Når du er i gang, giver [Højniveaukoncepter](./concepts.md) et overblik over LlamaIndex's modulære arkitektur. For flere praktiske eksempler, kan du kigge igennem vores [End-to-End Tutorials](./end_to_end.md).
## 🗺️ Økosystem
@@ -1 +0,0 @@
../../../../docs/api
@@ -0,0 +1 @@
../../../../docs/api
@@ -15,3 +15,17 @@ Wenn Sie den NextJS App Router für Routen-Handler/Serverless-Funktionen verwend
```js
export const runtime = "nodejs"; // Standardwert
```
und Sie müssen eine Ausnahme für pdf-parse in Ihrer next.config.js hinzufügen:
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Setzt pdf-parse in den tatsächlichen NodeJS-Modus mit NextJS App Router
},
};
module.exports = nextConfig;
```
@@ -2,12 +2,15 @@
sidebar_position: 1
---
# Installation und Einrichtung
`Diese Dokumentation wurde automatisch übersetzt und kann Fehler enthalten. Zögern Sie nicht, einen Pull Request zu öffnen, um Änderungen vorzuschlagen.`
```Diese Dokumentation wurde automatisch übersetzt und kann Fehler enthalten. Zögern Sie nicht, einen Pull Request zu öffnen, um Änderungen vorzuschlagen.```
Stellen Sie sicher, dass Sie NodeJS Version 18 oder höher installiert haben.
## Verwendung von create-llama
Der einfachste Weg, um mit LlamaIndex zu beginnen, besteht darin, `create-llama` zu verwenden. Dieses CLI-Tool ermöglicht es Ihnen, schnell eine neue LlamaIndex-Anwendung zu erstellen, bei der alles für Sie eingerichtet ist.
@@ -45,13 +48,13 @@ npm run dev
```
um den Entwicklungsserver zu starten. Sie können dann [http://localhost:3000](http://localhost:3000) besuchen, um Ihre App zu sehen.
## Installation über NPM
```bash npm2yarn
npm install llamaindex
```
### Umgebungsvariablen
Unsere Beispiele verwenden standardmäßig OpenAI. Sie müssen Ihren OpenAI-Schlüssel wie folgt einrichten:
@@ -41,7 +41,7 @@ Für komplexere Anwendungen ermöglichen unsere APIs auf niedrigerer Ebene fortg
Unsere Dokumentation enthält [Installationsanweisungen](./installation.mdx) und ein [Einführungstutorial](./starter.md), um Ihre erste Anwendung zu erstellen.
Sobald Sie bereit sind, bietet [High-Level-Konzepte](./getting_started/concepts.md) einen Überblick über die modulare Architektur von LlamaIndex. Für praktische Beispiele schauen Sie sich unsere [End-to-End-Tutorials](./end_to_end.md) an.
Sobald Sie bereit sind, bietet [High-Level-Konzepte](./concepts.md) einen Überblick über die modulare Architektur von LlamaIndex. Für praktische Beispiele schauen Sie sich unsere [End-to-End-Tutorials](./end_to_end.md) an.
## 🗺️ Ökosystem
@@ -1 +0,0 @@
../../../../docs/api
@@ -0,0 +1 @@
../../../../docs/api
@@ -15,3 +15,17 @@ sidebar_position: 5
```js
export const runtime = "nodejs"; // προεπιλογή
```
και θα πρέπει να προσθέσετε μια εξαίρεση για το pdf-parse στο next.config.js σας
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Βάζει το pdf-parse σε πραγματική λειτουργία NodeJS με τον δρομολογητή NextJS App
},
};
module.exports = nextConfig;
```
@@ -2,12 +2,15 @@
sidebar_position: 1
---
# Εγκατάσταση και Ρύθμιση
`Αυτό το έγγραφο έχει μεταφραστεί αυτόματα και μπορεί να περιέχει λάθη. Μη διστάσετε να ανοίξετε ένα Pull Request για να προτείνετε αλλαγές.`
```Αυτό το έγγραφο έχει μεταφραστεί αυτόματα και μπορεί να περιέχει λάθη. Μη διστάσετε να ανοίξετε ένα Pull Request για να προτείνετε αλλαγές.```
Βεβαιωθείτε ότι έχετε το NodeJS v18 ή νεότερη έκδοση.
## Χρήση του create-llama
Ο ευκολότερος τρόπος για να ξεκινήσετε με το LlamaIndex είναι να χρησιμοποιήσετε το `create-llama`. Αυτό το εργαλείο γραμμής εντολών σας επιτρέπει να ξεκινήσετε γρήγορα τη δημιουργία μιας νέας εφαρμογής LlamaIndex, με όλα τα απαραίτητα προεπιλεγμένα ρυθμισμένα για εσάς.
@@ -45,13 +48,13 @@ npm run dev
```
για να ξεκινήσετε τον διακομιστή ανάπτυξης. Στη συνέχεια, μπορείτε να επισκεφθείτε τη διεύθυνση [http://localhost:3000](http://localhost:3000) για να δείτε την εφαρμογή σας.
## Εγκατάσταση από το NPM
```bash npm2yarn
npm install llamaindex
```
### Μεταβλητές περιβάλλοντος
Τα παραδείγματά μας χρησιμοποιούν το OpenAI από προεπιλογή. Θα πρέπει να ρυθμίσετε το κλειδί σας για το Open AI ως εξής:
@@ -43,7 +43,7 @@ slug: /
Η τεκμηρίωσή μας περιλαμβάνει [Οδηγίες Εγκατάστασης](./installation.mdx) και ένα [Εισαγωγικό Εκπαιδευτικό Πρόγραμμα](./starter.md) για να δημιουργήσετε την πρώτη σας εφαρμογή.
Αφού ξεκινήσετε, οι [Υψηλού Επιπέδου Έννοιες](./getting_started/concepts.md) παρέχουν μια επισκόπηση της μοντουλαρισμένης αρχιτεκτονικής του LlamaIndex. Για περισσότερα πρακτικά παραδείγματα, ρίξτε μια ματιά στα [Ολοκληρωμένα Εκπαιδευτικά Προγράμματα](./end_to_end.md).
Αφού ξεκινήσετε, οι [Υψηλού Επιπέδου Έννοιες](./concepts.md) παρέχουν μια επισκόπηση της μοντουλαρισμένης αρχιτεκτονικής του LlamaIndex. Για περισσότερα πρακτικά παραδείγματα, ρίξτε μια ματιά στα [Ολοκληρωμένα Εκπαιδευτικά Προγράμματα](./end_to_end.md).
## 🗺️ Οικοσύστημα
@@ -1 +0,0 @@
../../../../docs/api
@@ -0,0 +1 @@
../../../../docs/api
@@ -15,3 +15,17 @@ Si estás utilizando los controladores de ruta/funciones sin servidor del enruta
```js
export const runtime = "nodejs"; // por defecto
```
y deberás agregar una excepción para pdf-parse en tu archivo next.config.js
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Pone pdf-parse en el modo NodeJS real con el enrutador de aplicaciones NextJS
},
};
module.exports = nextConfig;
```
@@ -2,12 +2,15 @@
sidebar_position: 1
---
# Instalación y Configuración
`Esta documentación ha sido traducida automáticamente y puede contener errores. No dudes en abrir una Pull Request para sugerir cambios.`
```Esta documentación ha sido traducida automáticamente y puede contener errores. No dudes en abrir una Pull Request para sugerir cambios.```
Asegúrese de tener NodeJS v18 o superior.
## Usando create-llama
La forma más fácil de comenzar con LlamaIndex es usando `create-llama`. Esta herramienta de línea de comandos te permite comenzar rápidamente a construir una nueva aplicación LlamaIndex, con todo configurado para ti.
@@ -45,13 +48,13 @@ npm run dev
```
para iniciar el servidor de desarrollo. Luego puedes visitar [http://localhost:3000](http://localhost:3000) para ver tu aplicación.
## Instalación desde NPM
```bash npm2yarn
npm install llamaindex
```
### Variables de entorno
Nuestros ejemplos utilizan OpenAI de forma predeterminada. Deberá configurar su clave de Open AI de la siguiente manera:
@@ -41,7 +41,7 @@ Para aplicaciones más complejas, nuestras API de nivel inferior permiten a los
Nuestra documentación incluye [Instrucciones de instalación](./installation.mdx) y un [Tutorial de inicio](./starter.md) para construir tu primera aplicación.
Una vez que estés en funcionamiento, [Conceptos de alto nivel](./getting_started/concepts.md) ofrece una visión general de la arquitectura modular de LlamaIndex. Para obtener ejemplos prácticos más detallados, consulta nuestros [Tutoriales de extremo a extremo](./end_to_end.md).
Una vez que estés en funcionamiento, [Conceptos de alto nivel](./concepts.md) ofrece una visión general de la arquitectura modular de LlamaIndex. Para obtener ejemplos prácticos más detallados, consulta nuestros [Tutoriales de extremo a extremo](./end_to_end.md).
## 🗺️ Ecosistema
@@ -1 +0,0 @@
../../../../docs/api
@@ -0,0 +1 @@
../../../../docs/api
@@ -15,3 +15,17 @@ Kui kasutate NextJS rakenduse marsruuteri marsruutide käsitlejaid/serverita fun
```js
export const runtime = "nodejs"; // vaikimisi
```
ja peate lisama erandi pdf-parse jaoks oma next.config.js failis
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Paneb pdf-parse tegelikult NodeJS režiimi koos NextJS rakenduse marsruuteriga
},
};
module.exports = nextConfig;
```
@@ -2,12 +2,15 @@
sidebar_position: 1
---
# Paigaldamine ja seadistamine
`See dokumentatsioon on tõlgitud automaatselt ja võib sisaldada vigu. Ärge kartke avada Pull Request, et pakkuda muudatusi.`
```See dokumentatsioon on tõlgitud automaatselt ja võib sisaldada vigu. Ärge kartke avada Pull Request, et pakkuda muudatusi.```
Veenduge, et teil oleks NodeJS versioon 18 või uuem.
## Kasutades create-llama
Lihtsaim viis LlamaIndexiga alustamiseks on kasutada `create-llama` tööriista. See käsurea tööriist võimaldab teil kiiresti alustada uue LlamaIndex rakenduse loomist, kõik on juba teie jaoks seadistatud.
@@ -45,13 +48,13 @@ npm run dev
```
arendusserveri käivitamiseks. Seejärel saate külastada [http://localhost:3000](http://localhost:3000), et näha oma rakendust.
## Paigaldamine NPM-ist
```bash npm2yarn
npm install llamaindex
```
### Keskkonnamuutujad
Meie näidetes kasutatakse vaikimisi OpenAI-d. Peate oma Open AI võtme seadistama järgmiselt:
@@ -41,7 +41,7 @@ Täpsemate rakenduste jaoks võimaldavad meie madalama taseme API-d edasijõudnu
Meie dokumentatsioonis on [paigaldusjuhised](./installation.mdx) ja [algõpetus](./starter.md) oma esimese rakenduse loomiseks.
Kui olete valmis ja töötate, siis [kõrgtasemel kontseptsioonid](./getting_started/concepts.md) annavad ülevaate LlamaIndexi moodularhitektuurist. Praktiliste näidete jaoks vaadake läbi meie [otsast lõpuni õpetused](./end_to_end.md).
Kui olete valmis ja töötate, siis [kõrgtasemel kontseptsioonid](./concepts.md) annavad ülevaate LlamaIndexi moodularhitektuurist. Praktiliste näidete jaoks vaadake läbi meie [otsast lõpuni õpetused](./end_to_end.md).
## 🗺️ Ökosüsteem
@@ -1 +0,0 @@
../../../../docs/api
@@ -0,0 +1 @@
../../../../docs/api
@@ -15,3 +15,17 @@ LlamaIndex در حال حاضر به طور رسمی NodeJS 18 و NodeJS 20 را
```js
export const runtime = "nodejs"; // پیش فرض
```
و برای pdf-parse باید یک استثناء در next.config.js اضافه کنید
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // pdf-parse را در حالت واقعی NodeJS با مسیریاب برنامه NextJS قرار می دهد
},
};
module.exports = nextConfig;
```
@@ -2,12 +2,15 @@
sidebar_position: 1
---
# نصب و راه‌اندازی
`undefined`
```undefined```
اطمینان حاصل کنید که NodeJS نسخه 18 یا بالاتر را دارید.
## استفاده از create-llama
ساده‌ترین راه برای شروع با LlamaIndex استفاده از `create-llama` است. این ابزار CLI به شما امکان می‌دهد به سرعت یک برنامه جدید LlamaIndex راه‌اندازی کنید و همه چیز برای شما تنظیم شده باشد.
@@ -45,13 +48,13 @@ npm run dev
```
برای راه‌اندازی سرور توسعه. سپس می‌توانید به [http://localhost:3000](http://localhost:3000) بروید تا برنامه خود را مشاهده کنید.
## نصب از NPM
```bash npm2yarn
npm install llamaindex
```
### متغیرهای محیطی
مثال‌های ما به طور پیش فرض از OpenAI استفاده می‌کنند. برای اینکه بتوانید از آن استفاده کنید، باید کلید Open AI خود را به صورت زیر تنظیم کنید:
@@ -64,4 +67,5 @@ export OPENAI_API_KEY="sk-......" # جایگزین کنید با کلید خود
هشدار: کلید OpenAI خود را در کنترل نسخه گذاری قرار ندهید.
"
@@ -43,7 +43,7 @@ API سطح بالای ما به کاربران مبتدی امکان استفا
مستندات ما شامل [دستورالعمل نصب](./installation.mdx) و [آموزش شروع کار](./starter.md) برای ساخت اولین برنامه شما است.
با راه اندازی و اجرا شدن، [مفاهیم سطح بالا](./getting_started/concepts.md) یک نمای کلی از معماری ماژولار لاماایندکس را ارائه می دهد. برای مثال های عملی بیشتر، به [آموزش های پایان به پایان](./end_to_end.md) مراجعه کنید.
با راه اندازی و اجرا شدن، [مفاهیم سطح بالا](./concepts.md) یک نمای کلی از معماری ماژولار لاماایندکس را ارائه می دهد. برای مثال های عملی بیشتر، به [آموزش های پایان به پایان](./end_to_end.md) مراجعه کنید.
"
@@ -1 +0,0 @@
../../../../docs/api

Some files were not shown because too many files have changed in this diff Show More