mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-10 15:53:42 -04:00
Compare commits
86 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b145db3ff3 | |||
| e8952f3753 | |||
| 09d19b99ba | |||
| 7ad30dc660 | |||
| 5c1702c527 | |||
| f1063d58ae | |||
| eee39221c4 | |||
| 4303961948 | |||
| e2790dabc8 | |||
| ba42aa592c | |||
| e1deba1222 | |||
| f9c2dd1b3a | |||
| 8bf0a41926 | |||
| 5c89aa54c4 | |||
| 69484526e6 | |||
| bfc84384ea | |||
| cce3b792db | |||
| bff40f27c5 | |||
| c3e3b598bb | |||
| fa17f7e352 | |||
| 3aed922a3b | |||
| 7c4e37c5cd | |||
| 2d8845b084 | |||
| 47f21796e0 | |||
| eb6de99fcb | |||
| 2bfc8f3161 | |||
| bcacf88e55 | |||
| 13766a82b2 | |||
| 34d7ca66f5 | |||
| 17a803bb17 | |||
| 1bd47969b3 | |||
| 5fec0f1135 | |||
| a73942ddea | |||
| 34a26e5e4d | |||
| f74dea5fae | |||
| ee3eb7d8e2 | |||
| 75f94eea1b | |||
| b737bda40d | |||
| d99b1d61d7 | |||
| 844029d8e5 | |||
| 9492cc64b5 | |||
| 5773f97e88 | |||
| 0784dc3a0a | |||
| 7993be7d0d | |||
| f22ce6e757 | |||
| 3c4347b247 | |||
| 977f2840b9 | |||
| 5d3bb6642e | |||
| 2001eb7ffb | |||
| f18c9f69d4 | |||
| 8e124e5b63 | |||
| 4ed5e544b0 | |||
| b185bda5b1 | |||
| d79804e271 | |||
| 2b356c8613 | |||
| 2e6b36ef4b | |||
| edd0f66234 | |||
| 2da407d66c | |||
| fa574f709e | |||
| 1e6171521b | |||
| 3f3e4eca66 | |||
| 648482b0f1 | |||
| bb46afe33d | |||
| 80f5914abf | |||
| 1c4e7f9c3e | |||
| e4ae6e9076 | |||
| f93efa2ea1 | |||
| 7d79365262 | |||
| 555692207e | |||
| fcc06b227a | |||
| 08a39790e4 | |||
| a8270082a0 | |||
| 85da798538 | |||
| b68d8697df | |||
| 7704df5042 | |||
| 16f04c7e7e | |||
| 7c6b3117bf | |||
| 7def68fb37 | |||
| 03ed2b4129 | |||
| 733d62a699 | |||
| f76e1d0796 | |||
| 88d42ccd8d | |||
| a0686fb1f2 | |||
| 3d198d94a6 | |||
| 036c00db73 | |||
| 548f0687f1 |
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
feat(qdrant): Add Qdrant Vector DB
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"commit": true,
|
||||
"fixed": [],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Use compromise as sentence tokenizer
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Preview: Add ingestion pipeline (incl. different strategies to handle doc store duplicates)
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Removed pdf-parse, and directly use latest pdf.js
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"create-llama": patch
|
||||
---
|
||||
|
||||
Add an option that allows the user to run the generated app
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
feat: use conditional exports
|
||||
|
||||
The benefit of conditional exports is we split the llamaindex into different files. This will improve the tree shake if you are building web apps.
|
||||
|
||||
This also requires node16 (see https://nodejs.org/api/packages.html#conditional-exports).
|
||||
|
||||
If you are seeing typescript issue `TS2724`('llamaindex' has no exported member named XXX):
|
||||
|
||||
1. update `moduleResolution` to `bundler` in `tsconfig.json`, more for the web applications like Next.js, and vite, but still works for ts-node or tsx.
|
||||
2. consider the ES module in your project, add `"type": "module"` into `package.json` and update `moduleResolution` to `node16` or `nodenext` in `tsconfig.json`.
|
||||
|
||||
We still support both cjs and esm, but you should update `tsconfig.json` to make the typescript happy.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Added pinecone vector DB
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
feat(extractors): add keyword extractor and base extractor
|
||||
@@ -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": {},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -7,4 +7,8 @@ module.exports = {
|
||||
rootDir: ["apps/*/"],
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"max-params": ["error", 4],
|
||||
},
|
||||
ignorePatterns: ["dist/"],
|
||||
};
|
||||
|
||||
@@ -8,6 +8,9 @@ on:
|
||||
- ".github/workflows/e2e.yml"
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
POETRY_VERSION: "1.6.1"
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
name: create-llama
|
||||
@@ -16,10 +19,22 @@ 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,6 +14,8 @@ 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,3 +18,21 @@ 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
|
||||
|
||||
+1
-3
@@ -37,9 +37,7 @@ yarn-error.log*
|
||||
.vercel
|
||||
|
||||
dist/
|
||||
|
||||
# vs code
|
||||
.vscode/launch.json
|
||||
lib/
|
||||
|
||||
.cache
|
||||
test-results/
|
||||
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
apps/docs/i18n
|
||||
pnpm-lock.yaml
|
||||
|
||||
lib/
|
||||
dist/
|
||||
.docusaurus/
|
||||
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
// 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}"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,11 +1,20 @@
|
||||
# LlamaIndex.TS
|
||||
|
||||
[](https://www.npmjs.com/package/llamaindex)
|
||||
[](https://www.npmjs.com/package/llamaindex)
|
||||
[](https://www.npmjs.com/package/llamaindex)
|
||||
[](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:
|
||||
|
||||
[](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.
|
||||
@@ -47,9 +56,9 @@ async function main() {
|
||||
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?",
|
||||
);
|
||||
const response = await queryEngine.query({
|
||||
query: "What did the author do in college?",
|
||||
});
|
||||
|
||||
// Output response
|
||||
console.log(response.toString());
|
||||
@@ -101,13 +110,9 @@ 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;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
# Generated files
|
||||
.docusaurus
|
||||
.cache-loader
|
||||
lib
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
|
||||
@@ -26,7 +26,7 @@ Create and load a vector index. Persistance to disk in LlamaIndex.TS happens aut
|
||||
|
||||
## [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`.
|
||||
Create a vector index and query it, while also configuring the `LLM`, the `ServiceContext`, and the `similarity_top_k`.
|
||||
|
||||
## [OpenAI LLM](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/openai.ts)
|
||||
|
||||
|
||||
@@ -13,17 +13,3 @@ If you're using NextJS App Router route handlers/serverless functions, you'll ne
|
||||
```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;
|
||||
```
|
||||
|
||||
@@ -11,7 +11,16 @@ const retriever = index.asRetriever();
|
||||
const chatEngine = new ContextChatEngine({ retriever });
|
||||
|
||||
// start chatting
|
||||
const response = await chatEngine.chat(query);
|
||||
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);
|
||||
}
|
||||
```
|
||||
|
||||
## Api References
|
||||
|
||||
@@ -8,7 +8,16 @@ A query engine wraps a `Retriever` and a `ResponseSynthesizer` into a pipeline,
|
||||
|
||||
```typescript
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query("query string");
|
||||
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);
|
||||
}
|
||||
```
|
||||
|
||||
## Sub Question Query Engine
|
||||
|
||||
@@ -35,13 +35,26 @@ const nodesWithScore: NodeWithScore[] = [
|
||||
},
|
||||
];
|
||||
|
||||
const response = await responseSynthesizer.synthesize(
|
||||
"What age am I?",
|
||||
const response = await responseSynthesizer.synthesize({
|
||||
query: "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)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
label: Observability
|
||||
@@ -0,0 +1,35 @@
|
||||
# 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,8 +1,9 @@
|
||||
// @ts-check
|
||||
// Note: type annotations allow type checking and IDEs autocompletion
|
||||
|
||||
const lightCodeTheme = require("prism-react-renderer/themes/github");
|
||||
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
|
||||
const renderer = require("prism-react-renderer");
|
||||
const lightCodeTheme = renderer.themes.github;
|
||||
const darkCodeTheme = renderer.themes.dracula;
|
||||
|
||||
/** @type {import('@docusaurus/types').Config} */
|
||||
const config = {
|
||||
@@ -50,10 +51,11 @@ const config = {
|
||||
|
||||
presets: [
|
||||
[
|
||||
"classic",
|
||||
"@docusaurus/preset-classic",
|
||||
/** @type {import('@docusaurus/preset-classic').Options} */
|
||||
({
|
||||
docs: {
|
||||
path: "docs",
|
||||
routeBasePath: "/",
|
||||
sidebarPath: require.resolve("./sidebars.js"),
|
||||
// Please change this to your repo.
|
||||
@@ -171,6 +173,9 @@ const config = {
|
||||
},
|
||||
],
|
||||
],
|
||||
markdown: {
|
||||
format: "detect",
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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,15 +2,12 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
|
||||
# التثبيت والإعداد
|
||||
|
||||
```تمت ترجمة هذه الوثيقة تلقائيًا وقد تحتوي على أخطاء. لا تتردد في فتح طلب سحب لاقتراح تغييرات.```
|
||||
|
||||
`تمت ترجمة هذه الوثيقة تلقائيًا وقد تحتوي على أخطاء. لا تتردد في فتح طلب سحب لاقتراح تغييرات.`
|
||||
|
||||
تأكد من أن لديك NodeJS v18 أو أحدث.
|
||||
|
||||
|
||||
## باستخدام create-llama
|
||||
|
||||
أسهل طريقة للبدء مع LlamaIndex هي باستخدام `create-llama`. هذه الأداة سطر الأوامر تمكنك من بدء بناء تطبيق LlamaIndex جديد بسرعة، مع كل شيء معد لك.
|
||||
@@ -48,13 +45,13 @@ npm run dev
|
||||
```
|
||||
|
||||
لبدء خادم التطوير. يمكنك ثم زيارة [http://localhost:3000](http://localhost:3000) لرؤية تطبيقك.
|
||||
|
||||
## التثبيت من NPM
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
|
||||
### المتغيرات البيئية
|
||||
|
||||
تستخدم أمثلتنا OpenAI افتراضيًا. ستحتاج إلى إعداد مفتاح Open AI الخاص بك على النحو التالي:
|
||||
@@ -67,5 +64,4 @@ export OPENAI_API_KEY="sk-......" # استبدله بالمفتاح الخاص
|
||||
|
||||
تحذير: لا تقم بإضافة مفتاح OpenAI الخاص بك إلى نظام التحكم في الإصدارات.
|
||||
|
||||
|
||||
"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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,15 +2,12 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
|
||||
# Инсталация и настройка
|
||||
|
||||
```Тази документация е преведена автоматично и може да съдържа грешки. Не се колебайте да отворите Pull Request, за да предложите промени.```
|
||||
|
||||
`Тази документация е преведена автоматично и може да съдържа грешки. Не се колебайте да отворите Pull Request, за да предложите промени.`
|
||||
|
||||
Уверете се, че имате NodeJS v18 или по-нова версия.
|
||||
|
||||
|
||||
## Използване на create-llama
|
||||
|
||||
Най-лесният начин да започнете с LlamaIndex е чрез използването на `create-llama`. Този инструмент с команден ред ви позволява бързо да започнете да създавате ново приложение LlamaIndex, като всичко е настроено за вас.
|
||||
@@ -48,13 +45,13 @@ npm run dev
|
||||
```
|
||||
|
||||
за да стартирате сървъра за разработка. След това можете да посетите [http://localhost:3000](http://localhost:3000), за да видите вашето приложение.
|
||||
|
||||
## Инсталация от NPM
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
|
||||
### Променливи на средата
|
||||
|
||||
Нашият пример използва OpenAI по подразбиране. Ще трябва да настроите вашия Open AI ключ по следния начин:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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,15 +2,12 @@
|
||||
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.
|
||||
@@ -48,13 +45,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:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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,15 +2,12 @@
|
||||
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.
|
||||
@@ -48,13 +45,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ě:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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,15 +2,12 @@
|
||||
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.
|
||||
@@ -48,13 +45,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:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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,15 +2,12 @@
|
||||
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.
|
||||
@@ -48,13 +45,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:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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,15 +2,12 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
|
||||
# Εγκατάσταση και Ρύθμιση
|
||||
|
||||
```Αυτό το έγγραφο έχει μεταφραστεί αυτόματα και μπορεί να περιέχει λάθη. Μη διστάσετε να ανοίξετε ένα Pull Request για να προτείνετε αλλαγές.```
|
||||
|
||||
`Αυτό το έγγραφο έχει μεταφραστεί αυτόματα και μπορεί να περιέχει λάθη. Μη διστάσετε να ανοίξετε ένα Pull Request για να προτείνετε αλλαγές.`
|
||||
|
||||
Βεβαιωθείτε ότι έχετε το NodeJS v18 ή νεότερη έκδοση.
|
||||
|
||||
|
||||
## Χρήση του create-llama
|
||||
|
||||
Ο ευκολότερος τρόπος για να ξεκινήσετε με το LlamaIndex είναι να χρησιμοποιήσετε το `create-llama`. Αυτό το εργαλείο γραμμής εντολών σας επιτρέπει να ξεκινήσετε γρήγορα τη δημιουργία μιας νέας εφαρμογής LlamaIndex, με όλα τα απαραίτητα προεπιλεγμένα ρυθμισμένα για εσάς.
|
||||
@@ -48,13 +45,13 @@ npm run dev
|
||||
```
|
||||
|
||||
για να ξεκινήσετε τον διακομιστή ανάπτυξης. Στη συνέχεια, μπορείτε να επισκεφθείτε τη διεύθυνση [http://localhost:3000](http://localhost:3000) για να δείτε την εφαρμογή σας.
|
||||
|
||||
## Εγκατάσταση από το NPM
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
|
||||
### Μεταβλητές περιβάλλοντος
|
||||
|
||||
Τα παραδείγματά μας χρησιμοποιούν το OpenAI από προεπιλογή. Θα πρέπει να ρυθμίσετε το κλειδί σας για το Open AI ως εξής:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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,15 +2,12 @@
|
||||
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.
|
||||
@@ -48,13 +45,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:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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,15 +2,12 @@
|
||||
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.
|
||||
@@ -48,13 +45,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:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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,15 +2,12 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
|
||||
# نصب و راهاندازی
|
||||
|
||||
```undefined```
|
||||
|
||||
`undefined`
|
||||
|
||||
اطمینان حاصل کنید که NodeJS نسخه 18 یا بالاتر را دارید.
|
||||
|
||||
|
||||
## استفاده از create-llama
|
||||
|
||||
سادهترین راه برای شروع با LlamaIndex استفاده از `create-llama` است. این ابزار CLI به شما امکان میدهد به سرعت یک برنامه جدید LlamaIndex راهاندازی کنید و همه چیز برای شما تنظیم شده باشد.
|
||||
@@ -48,13 +45,13 @@ npm run dev
|
||||
```
|
||||
|
||||
برای راهاندازی سرور توسعه. سپس میتوانید به [http://localhost:3000](http://localhost:3000) بروید تا برنامه خود را مشاهده کنید.
|
||||
|
||||
## نصب از NPM
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
|
||||
### متغیرهای محیطی
|
||||
|
||||
مثالهای ما به طور پیش فرض از OpenAI استفاده میکنند. برای اینکه بتوانید از آن استفاده کنید، باید کلید Open AI خود را به صورت زیر تنظیم کنید:
|
||||
@@ -67,5 +64,4 @@ export OPENAI_API_KEY="sk-......" # جایگزین کنید با کلید خود
|
||||
|
||||
هشدار: کلید OpenAI خود را در کنترل نسخه گذاری قرار ندهید.
|
||||
|
||||
|
||||
"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ Jos käytät NextJS-sovelluksen reitittimen reitinkäsittelijöitä/palveluttomi
|
||||
```js
|
||||
export const runtime = "nodejs"; // oletusarvo
|
||||
```
|
||||
|
||||
ja sinun tulee lisätä poikkeus pdf-parse:lle next.config.js-tiedostossasi
|
||||
|
||||
```js
|
||||
// next.config.js
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: ["pdf-parse"], // Asettaa pdf-parsen todelliseen NodeJS-tilaan NextJS-sovelluksen reitittimen kanssa
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
```
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
|
||||
# Asennus ja asetukset
|
||||
|
||||
```Tämä dokumentaatio on käännetty automaattisesti ja se saattaa sisältää virheitä. Älä epäröi avata Pull Requestia ehdottaaksesi muutoksia.```
|
||||
|
||||
`Tämä dokumentaatio on käännetty automaattisesti ja se saattaa sisältää virheitä. Älä epäröi avata Pull Requestia ehdottaaksesi muutoksia.`
|
||||
|
||||
Varmista, että sinulla on NodeJS v18 tai uudempi.
|
||||
|
||||
|
||||
## Käyttäen create-llamaa
|
||||
|
||||
Helpoin tapa aloittaa LlamaIndexin käyttö on käyttää `create-llama` -työkalua. Tämä komentorivityökalu mahdollistaa uuden LlamaIndex-sovelluksen nopean rakentamisen, kaikki tarvittava on valmiiksi asennettu.
|
||||
@@ -48,13 +45,13 @@ npm run dev
|
||||
```
|
||||
|
||||
käynnistääksesi kehityspalvelimen. Voit sitten käydä osoitteessa [http://localhost:3000](http://localhost:3000) nähdäksesi sovelluksesi.
|
||||
|
||||
## Asennus NPM:stä
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
|
||||
### Ympäristömuuttujat
|
||||
|
||||
Esimerkkimme käyttävät oletuksena OpenAI:ta. Sinun täytyy asettaa Open AI -avain seuraavasti:
|
||||
@@ -67,5 +64,4 @@ Jos haluat, että se ladataan automaattisesti joka kerta, lisää se .zshrc/.bas
|
||||
|
||||
VAROITUS: Älä tallenna OpenAI-avaintasi versionhallintaan.
|
||||
|
||||
|
||||
"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/_static
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
@@ -1,2 +1,2 @@
|
||||
label: "API"
|
||||
position: 6
|
||||
position: 6
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
label: "Classes"
|
||||
position: 3
|
||||
position: 3
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
label: "Enumerations"
|
||||
position: 2
|
||||
position: 2
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
label: "Interfaces"
|
||||
position: 4
|
||||
position: 4
|
||||
|
||||
@@ -13,17 +13,3 @@ Si vous utilisez des gestionnaires de route du routeur d'application NextJS ou d
|
||||
```js
|
||||
export const runtime = "nodejs"; // par défaut
|
||||
```
|
||||
|
||||
et vous devrez ajouter une exception pour pdf-parse dans votre fichier next.config.js
|
||||
|
||||
```js
|
||||
// next.config.js
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: ["pdf-parse"], // Met pdf-parse en mode NodeJS réel avec le routeur d'application NextJS
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
```
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
|
||||
# Installation et configuration
|
||||
|
||||
Assurez-vous d'avoir NodeJS v18 ou une version supérieure.
|
||||
|
||||
|
||||
|
||||
## Utilisation de create-llama
|
||||
|
||||
La manière la plus simple de commencer avec LlamaIndex est d'utiliser `create-llama`. Cet outil CLI vous permet de démarrer rapidement la construction d'une nouvelle application LlamaIndex, avec tout configuré pour vous.
|
||||
@@ -53,8 +50,6 @@ pour démarrer le serveur de développement. Vous pouvez ensuite visiter [http:/
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Variables d'environnement
|
||||
|
||||
Nos exemples utilisent OpenAI par défaut. Vous devrez configurer votre clé OpenAI comme ceci :
|
||||
@@ -66,4 +61,3 @@ export OPENAI_API_KEY="sk-......" # Remplacez par votre clé depuis https://plat
|
||||
Si vous souhaitez le charger automatiquement à chaque fois, ajoutez-le à votre .zshrc/.bashrc.
|
||||
|
||||
ATTENTION : ne publiez pas votre clé OpenAI dans le contrôle de version.
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ 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 App
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
```
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
|
||||
# התקנה והגדרה
|
||||
|
||||
```התיעוד הזה תורגם באופן אוטומטי ועשוי להכיל טעויות. אל תהסס לפתוח בקשת משיכה כדי להציע שינויים.```
|
||||
|
||||
`התיעוד הזה תורגם באופן אוטומטי ועשוי להכיל טעויות. אל תהסס לפתוח בקשת משיכה כדי להציע שינויים.`
|
||||
|
||||
ודא שיש לך את NodeJS v18 או גרסה גבוהה יותר.
|
||||
|
||||
|
||||
## באמצעות create-llama
|
||||
|
||||
הדרך הקלה ביותר להתחיל עם LlamaIndex היא באמצעות `create-llama`. כלי זה מאפשר לך להתחיל בניית אפליקציה חדשה של LlamaIndex בצורה מהירה, עם הכל מוגדר עבורך.
|
||||
@@ -48,13 +45,13 @@ npm run dev
|
||||
```
|
||||
|
||||
כדי להתחיל את שרת הפיתוח. אתה יכול לבקר ב-[http://localhost:3000](http://localhost:3000) כדי לראות את האפליקציה שלך.
|
||||
|
||||
## התקנה מ-NPM
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
|
||||
### משתנים סביבתיים
|
||||
|
||||
הדוגמאות שלנו משתמשות ב-OpenAI כברירת מחדל. יהיה עליך להגדיר את מפתח ה-Open AI שלך כך:
|
||||
@@ -67,5 +64,4 @@ export OPENAI_API_KEY="sk-......" # החלף עם המפתח שלך מ-https://p
|
||||
|
||||
אזהרה: אל תכלול את מפתח ה-OpenAI שלך בבקרת גרסה.
|
||||
|
||||
|
||||
"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ LlamaIndex वर्तमान में NodeJS 18 और NodeJS 20 का आ
|
||||
```js
|
||||
export const runtime = "nodejs"; // डिफ़ॉल्ट
|
||||
```
|
||||
|
||||
और आपको अपने next.config.js में pdf-parse के लिए एक अपवाद जोड़ने की आवश्यकता होगी
|
||||
|
||||
```js
|
||||
// next.config.js
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: ["pdf-parse"], // NextJS ऐप राउटर में pdf-parse को वास्तविक NodeJS मोड में रखता है
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
```
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
|
||||
# स्थापना और सेटअप
|
||||
|
||||
```इस दस्तावेज़ का अनुवाद स्वचालित रूप से किया गया है और इसमें त्रुटियाँ हो सकती हैं। परिवर्तन सुझाने के लिए पुल रिक्वेस्ट खोलने में संकोच न करें।```
|
||||
|
||||
`इस दस्तावेज़ का अनुवाद स्वचालित रूप से किया गया है और इसमें त्रुटियाँ हो सकती हैं। परिवर्तन सुझाने के लिए पुल रिक्वेस्ट खोलने में संकोच न करें।`
|
||||
|
||||
सुनिश्चित करें कि आपके पास NodeJS v18 या उच्चतर संस्करण है।
|
||||
|
||||
|
||||
## create-llama का उपयोग करें
|
||||
|
||||
LlamaIndex के साथ शुरू होने का सबसे आसान तरीका `create-llama` का उपयोग करके है। यह CLI टूल आपको त्वरित रूप से एक नया LlamaIndex एप्लिकेशन बनाने की सुविधा प्रदान करता है, जिसमें सब कुछ आपके लिए सेटअप किया जाता है।
|
||||
@@ -49,15 +46,14 @@ npm run dev
|
||||
|
||||
विकास सर्वर चालू करने के लिए। फिर आप [http://localhost:3000](http://localhost:3000) पर अपना ऐप देख सकते हैं।
|
||||
|
||||
|
||||
"
|
||||
|
||||
## NPM से स्थापना
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
|
||||
### पर्यावरण चर
|
||||
|
||||
हमारे उदाहरण डिफ़ॉल्ट रूप से OpenAI का उपयोग करते हैं। आपको निम्नलिखित तरीके से अपनी Open AI कुंजी को सेटअप करने की आवश्यकता होगी:
|
||||
@@ -70,5 +66,4 @@ export OPENAI_API_KEY="sk-......" # अपनी कुंजी के सा
|
||||
|
||||
चेतावनी: अपनी OpenAI कुंजी को संस्करण नियंत्रण में न देखें।
|
||||
|
||||
|
||||
"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
label: "API"
|
||||
position: 6
|
||||
position: 6
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
label: "Classes"
|
||||
position: 3
|
||||
position: 3
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
label: "Enumerations"
|
||||
position: 2
|
||||
position: 2
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
label: "Interfaces"
|
||||
position: 4
|
||||
position: 4
|
||||
|
||||
@@ -15,17 +15,3 @@ Ako koristite NextJS App Router rukovatelje rutama/serverless funkcije, trebat
|
||||
```js
|
||||
export const runtime = "nodejs"; // zadano
|
||||
```
|
||||
|
||||
i trebat ćete dodati iznimku za pdf-parse u vašem next.config.js
|
||||
|
||||
```js
|
||||
// next.config.js
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: ["pdf-parse"], // Stavlja pdf-parse u stvarni NodeJS način rada s NextJS App Routerom
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
```
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
|
||||
# Instalacija i postavljanje
|
||||
|
||||
```Ova dokumentacija je automatski prevedena i može sadržavati greške. Ne ustručavajte se otvoriti Pull Request za predlaganje promjena.```
|
||||
|
||||
`Ova dokumentacija je automatski prevedena i može sadržavati greške. Ne ustručavajte se otvoriti Pull Request za predlaganje promjena.`
|
||||
|
||||
Provjerite imate li NodeJS verziju 18 ili noviju.
|
||||
|
||||
|
||||
## Korištenje create-llama
|
||||
|
||||
Najlakši način za početak rada s LlamaIndexom je korištenje `create-llama`. Ovaj CLI alat omogućuje vam brzo pokretanje izrade nove aplikacije LlamaIndex, s već postavljenim svime što vam je potrebno.
|
||||
@@ -48,13 +45,13 @@ npm run dev
|
||||
```
|
||||
|
||||
za pokretanje razvojnog poslužitelja. Zatim možete posjetiti [http://localhost:3000](http://localhost:3000) da biste vidjeli svoju aplikaciju.
|
||||
|
||||
## Instalacija putem NPM-a
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
|
||||
### Varijable okruženja
|
||||
|
||||
Naši primjeri koriste OpenAI prema zadanim postavkama. Morat ćete postaviti svoj OpenAI ključ na sljedeći način:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/api
|
||||
@@ -15,17 +15,3 @@ Ha a NextJS alkalmazás útválasztó útválasztó kezelőket/szerver nélküli
|
||||
```js
|
||||
export const runtime = "nodejs"; // alapértelmezett
|
||||
```
|
||||
|
||||
és hozzá kell adnia egy kivételt a pdf-parse-hez a next.config.js fájlban
|
||||
|
||||
```js
|
||||
// next.config.js
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: ["pdf-parse"], // A pdf-parse-t valódi NodeJS módban helyezi el a NextJS alkalmazás útválasztó
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
```
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
|
||||
# Telepítés és Beállítás
|
||||
|
||||
```Ezt a dokumentációt automatikusan fordították le, és tartalmazhat hibákat. Ne habozzon nyitni egy Pull Requestet a változtatások javasolására.```
|
||||
|
||||
`Ezt a dokumentációt automatikusan fordították le, és tartalmazhat hibákat. Ne habozzon nyitni egy Pull Requestet a változtatások javasolására.`
|
||||
|
||||
Győződjön meg róla, hogy rendelkezik a NodeJS v18 vagy annál újabb verziójával.
|
||||
|
||||
|
||||
## A create-llama használata
|
||||
|
||||
A LlamaIndex leggyorsabb módja a kezdéshez a `create-llama` használata. Ez a CLI eszköz lehetővé teszi, hogy gyorsan elkezdjen egy új LlamaIndex alkalmazást építeni, minden szükséges beállítással.
|
||||
@@ -48,13 +45,13 @@ npm run dev
|
||||
```
|
||||
|
||||
a fejlesztői szerver indításához. Ezután meglátogathatja a [http://localhost:3000](http://localhost:3000) címet az alkalmazás megtekintéséhez.
|
||||
|
||||
## Telepítés az NPM-ről
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
|
||||
### Környezeti változók
|
||||
|
||||
Példáink alapértelmezetten az OpenAI-t használják. A következőképpen kell beállítania az Open AI kulcsát:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../docs/api
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user