Skip to content

Commit bb48deb

Browse files
authored
Merge branch 'main' into main
2 parents 6f6bb96 + 7231ddb commit bb48deb

File tree

472 files changed

+13453
-8740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

472 files changed

+13453
-8740
lines changed

.changeset/bright-tips-develop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-llama": patch
3+
---
4+
5+
Add an option to provide an URL and chat with the website data

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
33
"changelog": "@changesets/cli/changelog",
4-
"commit": false,
4+
"commit": true,
55
"fixed": [],
66
"linked": [],
77
"access": "public",

.changeset/loud-files-do.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/moody-berries-reflect.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/small-paws-sneeze.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/warm-monkeys-check.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"llamaindex": patch
3+
---
4+
5+
feat: allow `SimpleDirectoryReader` to get a string

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"ghcr.io/devcontainers/features/node:1": {},
55
"ghcr.io/devcontainers-contrib/features/turborepo-npm:1": {},
66
"ghcr.io/devcontainers-contrib/features/typescript:2": {},
7-
"ghcr.io/devcontainers-contrib/features/pnpm:2": {}
8-
}
7+
"ghcr.io/devcontainers-contrib/features/pnpm:2": {},
8+
},
99
}

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ module.exports = {
77
rootDir: ["apps/*/"],
88
},
99
},
10+
rules: {
11+
"max-params": ["error", 4],
12+
},
13+
ignorePatterns: ["dist/"],
1014
};

.github/workflows/e2e.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- ".github/workflows/e2e.yml"
99
branches: [main]
1010

11+
env:
12+
POETRY_VERSION: "1.6.1"
13+
1114
jobs:
1215
e2e:
1316
name: create-llama
@@ -16,10 +19,22 @@ jobs:
1619
fail-fast: true
1720
matrix:
1821
node-version: [18, 20]
22+
python-version: ["3.11"]
1923
os: [macos-latest, windows-latest]
24+
defaults:
25+
run:
26+
shell: bash
2027
runs-on: ${{ matrix.os }}
2128
steps:
2229
- uses: actions/checkout@v4
30+
- name: Set up python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Install Poetry
35+
uses: snok/install-poetry@v1
36+
with:
37+
version: ${{ env.POETRY_VERSION }}
2338
- uses: pnpm/action-setup@v2
2439
- name: Setup Node.js ${{ matrix.node-version }}
2540
uses: actions/setup-node@v4

.github/workflows/lint_on_push_or_pull.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616
- uses: pnpm/action-setup@v2
17+
with:
18+
version: latest
1719
- name: Setup Node.js
1820
uses: actions/setup-node@v4
1921
with:

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,49 @@ jobs:
1818
run: pnpm install
1919
- name: Run tests
2020
run: pnpm run test
21+
typecheck:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: pnpm/action-setup@v2
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version-file: ".nvmrc"
31+
cache: "pnpm"
32+
- name: Install dependencies
33+
run: pnpm install
34+
- name: Build
35+
run: pnpm run build --filter llamaindex
36+
- name: Run Type Check
37+
run: pnpm run type-check
38+
- name: Run Circular Dependency Check
39+
run: pnpm run circular-check
40+
working-directory: ./packages/core
41+
typecheck-examples:
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: pnpm/action-setup@v2
47+
- name: Setup Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version-file: ".nvmrc"
51+
cache: "pnpm"
52+
- name: Install dependencies
53+
run: pnpm install
54+
- name: Build
55+
run: pnpm run build --filter llamaindex
56+
- name: Copy examples
57+
run: rsync -rv --exclude=node_modules ./examples ${{ runner.temp }}
58+
- name: Pack
59+
run: pnpm pack --pack-destination ${{ runner.temp }}
60+
working-directory: packages/core
61+
- name: Install llamaindex
62+
run: npm add ${{ runner.temp }}/*.tgz
63+
working-directory: ${{ runner.temp }}/examples
64+
- name: Run Type Check
65+
run: npx tsc --project ./tsconfig.json
66+
working-directory: ${{ runner.temp }}/examples

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ yarn-error.log*
3737
.vercel
3838

3939
dist/
40-
41-
# vs code
42-
.vscode/launch.json
40+
lib/
4341

4442
.cache
4543
test-results/

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
pnpm format
52
pnpm lint
63
npx lint-staged

.husky/pre-push

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
pnpm test

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
auto-install-peers = true
2+
enable-pre-post-scripts = true

.prettierignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
apps/docs/i18n
2+
apps/docs/docs/api
23
pnpm-lock.yaml
3-
4+
lib/
5+
dist/
6+
.docusaurus/

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Debug Example",
11+
"skipFiles": ["<node_internals>/**"],
12+
"runtimeExecutable": "pnpm",
13+
"cwd": "${workspaceFolder}/examples",
14+
"runtimeArgs": ["ts-node", "${fileBasename}"]
15+
}
16+
]
17+
}

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
# LlamaIndex.TS
22

3+
[![NPM Version](https://img.shields.io/npm/v/llamaindex)](https://www.npmjs.com/package/llamaindex)
4+
[![NPM License](https://img.shields.io/npm/l/llamaindex)](https://www.npmjs.com/package/llamaindex)
5+
[![NPM Downloads](https://img.shields.io/npm/dm/llamaindex)](https://www.npmjs.com/package/llamaindex)
6+
[![Discord](https://img.shields.io/discord/1059199217496772688)](https://discord.com/invite/eN6D2HQ4aX)
7+
38
LlamaIndex is a data framework for your LLM application.
49

510
Use your own data with large language models (LLMs, OpenAI ChatGPT and others) in Typescript and Javascript.
611

712
Documentation: https://ts.llamaindex.ai/
813

14+
Try examples online:
15+
16+
[![Open in Stackblitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/run-llama/LlamaIndexTS/tree/main/examples)
17+
918
## What is LlamaIndex.TS?
1019

1120
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() {
4756

4857
// Query the index
4958
const queryEngine = index.asQueryEngine();
50-
const response = await queryEngine.query(
51-
"What did the author do in college?",
52-
);
59+
const response = await queryEngine.query({
60+
query: "What did the author do in college?",
61+
});
5362

5463
// Output response
5564
console.log(response.toString());
@@ -96,18 +105,17 @@ export const runtime = "nodejs"; // default
96105
// next.config.js
97106
/** @type {import('next').NextConfig} */
98107
const nextConfig = {
108+
experimental: {
109+
serverComponentsExternalPackages: ["pdf2json"],
110+
},
99111
webpack: (config) => {
100112
config.resolve.alias = {
101113
...config.resolve.alias,
102114
sharp$: false,
103115
"onnxruntime-node$": false,
104-
mongodb$: false,
105116
};
106117
return config;
107118
},
108-
experimental: {
109-
serverComponentsExternalPackages: ["pdf-parse"], // Puts pdf-parse in actual NodeJS mode with NextJS App Router
110-
},
111119
};
112120

113121
module.exports = nextConfig;

apps/docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Generated files
88
.docusaurus
99
.cache-loader
10+
lib
1011

1112
# Misc
1213
.DS_Store

apps/docs/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# docs
2+
3+
## 0.0.1
4+
5+
### Patch Changes
6+
7+
- 3154f52: chore: add qdrant readme

apps/docs/docs/end_to_end.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

apps/docs/docs/environments.md

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
label: Examples
2+
position: 2
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
import CodeBlock from "@theme/CodeBlock";
6+
import CodeSource from "!raw-loader!../../../../examples/chatEngine";
7+
8+
# Chat Engine
9+
10+
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.
11+
12+
<CodeBlock language="ts">{CodeSource}</CodeBlock>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# More examples
6+
7+
You can check out more examples in the [examples](https://github.com/run-llama/LlamaIndexTS/tree/main/examples) folder of the repository.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
import CodeBlock from "@theme/CodeBlock";
6+
import CodeSource from "!raw-loader!../../../../examples/storageContext";
7+
8+
# Save/Load an Index
9+
10+
<CodeBlock language="ts">{CodeSource}</CodeBlock>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
import CodeBlock from "@theme/CodeBlock";
6+
import CodeSource from "!raw-loader!../../../../examples/summaryIndex";
7+
8+
# Summary Index
9+
10+
<CodeBlock language="ts">{CodeSource}</CodeBlock>

0 commit comments

Comments
 (0)