Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b10882d06 | |||
| f066e50482 | |||
| fd8c882792 | |||
| d89ebe0261 | |||
| 968feb32cd | |||
| 43f6f56c5b | |||
| b2364dc5ba | |||
| 67f4db8501 | |||
| e4151a8b02 | |||
| 4d4cd8ac6b | |||
| 4fc001c8de | |||
| cf675bdc7a | |||
| 660b831b9e | |||
| ad85bd0b46 | |||
| 18ec1f2f61 | |||
| b0fbd8b5c8 | |||
| c0dfc8c641 | |||
| a8d3fa68a1 | |||
| f9470c470a | |||
| 95a5cc6ee1 | |||
| 487782cd98 | |||
| 58e65d399e | |||
| fdad3d66ac | |||
| a6db5dd29b | |||
| 7b684c4480 | |||
| c66868a98a | |||
| 14cc9ebe59 | |||
| 396b1e1474 | |||
| 69f3095424 | |||
| dc8bd5ea92 | |||
| 4af9a77d8b |
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
"chat-ui": patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Add example using chat-ui components
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
"@llamaindex/community": patch
|
|
||||||
---
|
|
||||||
|
|
||||||
feat: added support for Haiku 3.5 via Bedrock
|
|
||||||
@@ -119,7 +119,7 @@ jobs:
|
|||||||
run: pnpm run build
|
run: pnpm run build
|
||||||
- name: Build ${{ matrix.packages }}
|
- name: Build ${{ matrix.packages }}
|
||||||
run: pnpm run build
|
run: pnpm run build
|
||||||
working-directory: packages/llamaindex/e2e/examples/${{ matrix.packages }}
|
working-directory: e2e/examples/${{ matrix.packages }}
|
||||||
|
|
||||||
typecheck-examples:
|
typecheck-examples:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -2,86 +2,58 @@
|
|||||||
|
|
||||||
## Structure
|
## Structure
|
||||||
|
|
||||||
This is a monorepo built with Turborepo
|
LlamaIndex.TS uses pnpm monorepo.
|
||||||
|
|
||||||
Right now, for first-time contributors, these three packages are of the highest importance:
|
We recommend you to understand the basics of Node.js, TypeScript, pnpm, and of course, LLM before contributing.
|
||||||
|
|
||||||
- `packages/llamaindex` which is the main NPM library `llamaindex`
|
There are some important folders in the repository:
|
||||||
- `examples` is where the demo code lives
|
|
||||||
- `apps/docs` is where the code for the documentation of https://ts.llamaindex.ai/ is located
|
|
||||||
|
|
||||||
### Turborepo docs
|
- `packages/*`: Contains the source code of the packages. Each package is a separate npm package.
|
||||||
|
- `llamaindex`: The starter package for LlamaIndex.TS, which contains the all sub-packages.
|
||||||
You can checkout how Turborepo works using the default [README-turborepo.md](/README-turborepo.md)
|
- `core`: The core package of LlamaIndex.TS, which contains the abstract classes and interfaces. It is designed for
|
||||||
|
all JS runtime environments.
|
||||||
|
- `env`: The environment package of LlamaIndex.TS, which contains the environment-specific classes and interfaces. It
|
||||||
|
includes compatibility layers for Node.js, Deno, Vercel Edge Runtime, Cloudflare Workers...
|
||||||
|
- `apps/*`: The applications based on LlamaIndex.TS.
|
||||||
|
- `next`: Our documentation website based on Next.js.
|
||||||
|
- `examples`: The code examples of LlamaIndex.TS using Node.js.
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
Install NodeJS. Preferably v18 using nvm or n.
|
Make sure you have Node.js LIS (Long-term Support) installed. You can check your Node.js version by running:
|
||||||
|
|
||||||
Inside the LlamaIndexTS directory:
|
|
||||||
|
|
||||||
|
```shell
|
||||||
|
node -v
|
||||||
|
# v20.x.x
|
||||||
```
|
```
|
||||||
npm i -g pnpm ts-node
|
|
||||||
|
### Use pnpm
|
||||||
|
|
||||||
|
```shell
|
||||||
|
corepack enable
|
||||||
|
```
|
||||||
|
|
||||||
|
### Install dependencies
|
||||||
|
|
||||||
|
```shell
|
||||||
pnpm install
|
pnpm install
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: we use pnpm in this repo, which has a lot of the same functionality and CLI options as npm but it does do some things better in a monorepo, like centralizing dependencies and caching.
|
### Build the packages
|
||||||
|
|
||||||
PNPM's has documentation on its [workspace feature](https://pnpm.io/workspaces) and Turborepo had some [useful documentation also](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks).
|
```shell
|
||||||
|
# Build all packages
|
||||||
### Running Typescript
|
turbo build --filter "./packages/*"
|
||||||
|
|
||||||
When we publish to NPM we will have a tsc compiled version of the library in JS. For now, the easiest thing to do is use ts-node.
|
|
||||||
|
|
||||||
### Test cases
|
|
||||||
|
|
||||||
To run them, run
|
|
||||||
|
|
||||||
```
|
|
||||||
pnpm run test
|
|
||||||
```
|
|
||||||
|
|
||||||
To write new test cases write them in [packages/llamaindex/tests](/packages/llamaindex/tests)
|
|
||||||
|
|
||||||
We use Vitest https://vitest.dev to write our test cases. Vitest comes with a bunch of built-in assertions using the expect function: https://vitest.dev/api/expect.html#expect
|
|
||||||
|
|
||||||
### Demo applications
|
|
||||||
|
|
||||||
There is an existing ["example"](/examples/README.md) demos folder with mainly NodeJS scripts. Feel free to add additional demos to that folder. If you would like to try out your changes in the `llamaindex` package with a new demo, you need to run the build command in the README.
|
|
||||||
|
|
||||||
You can create new demo applications in the apps folder. Just run pnpm init in the folder after you create it to create its own package.json
|
|
||||||
|
|
||||||
### Installing packages
|
|
||||||
|
|
||||||
To install packages for a specific package or demo application, run
|
|
||||||
|
|
||||||
```
|
|
||||||
pnpm add [NPM Package] --filter [package or application i.e. llamaindex or docs]
|
|
||||||
```
|
|
||||||
|
|
||||||
To install packages for every package or application run
|
|
||||||
|
|
||||||
```
|
|
||||||
pnpm add -w [NPM Package]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docs
|
### Docs
|
||||||
|
|
||||||
To contribute to the docs, go to the docs website folder and run the Docusaurus instance.
|
See the [docs](./apps/next/README.md) for more information.
|
||||||
|
|
||||||
```bash
|
|
||||||
cd apps/docs
|
|
||||||
pnpm install
|
|
||||||
pnpm start
|
|
||||||
```
|
|
||||||
|
|
||||||
That should start a webserver which will serve the docs on https://localhost:3000
|
|
||||||
|
|
||||||
Any changes you make should be reflected in the browser. If you need to regenerate the API docs and find that your TSDoc isn't getting the updates, feel free to remove apps/docs/api. It will automatically regenerate itself when you run pnpm start again.
|
|
||||||
|
|
||||||
## Changeset
|
## Changeset
|
||||||
|
|
||||||
We use [changesets](https://github.com/changesets/changesets) for managing versions and changelogs. To create a new changeset, run in the root folder:
|
We use [changesets](https://github.com/changesets/changesets) for managing versions and changelogs. To create a new
|
||||||
|
changeset, run in the root folder:
|
||||||
|
|
||||||
```
|
```
|
||||||
pnpm changeset
|
pnpm changeset
|
||||||
@@ -95,6 +67,6 @@ The [Release Github Action](.github/workflows/release.yml) is automatically gene
|
|||||||
PR called "Release {version}".
|
PR called "Release {version}".
|
||||||
|
|
||||||
This PR will update the `package.json` and `CHANGELOG.md` files of each package according to
|
This PR will update the `package.json` and `CHANGELOG.md` files of each package according to
|
||||||
the current changesets in the [.changeset](.changeset/) folder.
|
the current changesets in the [.changeset](.changeset) folder.
|
||||||
|
|
||||||
If this PR is merged it will automatically add version tags to the repository and publish the updated packages to NPM.
|
If this PR is merged it will automatically add version tags to the repository and publish the updated packages to NPM.
|
||||||
|
|||||||
@@ -1,5 +1,51 @@
|
|||||||
# docs
|
# docs
|
||||||
|
|
||||||
|
## 0.0.114
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [f066e50]
|
||||||
|
- llamaindex@0.8.10
|
||||||
|
- @llamaindex/examples@0.0.14
|
||||||
|
|
||||||
|
## 0.0.113
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4fc001c]
|
||||||
|
- Updated dependencies [4d4cd8a]
|
||||||
|
- llamaindex@0.8.9
|
||||||
|
|
||||||
|
## 0.0.112
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ad85bd0]
|
||||||
|
- llamaindex@0.8.8
|
||||||
|
- @llamaindex/examples@0.0.13
|
||||||
|
|
||||||
|
## 0.0.111
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- llamaindex@0.8.7
|
||||||
|
|
||||||
|
## 0.0.110
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [95a5cc6]
|
||||||
|
- llamaindex@0.8.6
|
||||||
|
|
||||||
|
## 0.0.109
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [14cc9eb]
|
||||||
|
- Updated dependencies [a6db5dd]
|
||||||
|
- Updated dependencies [396b1e1]
|
||||||
|
- llamaindex@0.8.5
|
||||||
|
|
||||||
## 0.0.108
|
## 0.0.108
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "docs",
|
"name": "docs",
|
||||||
"version": "0.0.108",
|
"version": "0.0.114",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"docusaurus": "docusaurus",
|
"docusaurus": "docusaurus",
|
||||||
|
|||||||
@@ -1,5 +1,84 @@
|
|||||||
# @llamaindex/doc
|
# @llamaindex/doc
|
||||||
|
|
||||||
|
## 0.0.12
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [f066e50]
|
||||||
|
- Updated dependencies [d89ebe0]
|
||||||
|
- Updated dependencies [fd8c882]
|
||||||
|
- Updated dependencies [fd8c882]
|
||||||
|
- llamaindex@0.8.10
|
||||||
|
- @llamaindex/core@0.4.7
|
||||||
|
- @llamaindex/workflow@0.0.4
|
||||||
|
- @llamaindex/cloud@2.0.7
|
||||||
|
- @llamaindex/node-parser@0.0.8
|
||||||
|
- @llamaindex/openai@0.1.32
|
||||||
|
- @llamaindex/readers@1.0.8
|
||||||
|
|
||||||
|
## 0.0.11
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4fc001c]
|
||||||
|
- Updated dependencies [4d4cd8a]
|
||||||
|
- llamaindex@0.8.9
|
||||||
|
- @llamaindex/cloud@2.0.6
|
||||||
|
- @llamaindex/core@0.4.6
|
||||||
|
- @llamaindex/node-parser@0.0.7
|
||||||
|
- @llamaindex/openai@0.1.31
|
||||||
|
- @llamaindex/readers@1.0.7
|
||||||
|
|
||||||
|
## 0.0.10
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ad85bd0]
|
||||||
|
- @llamaindex/core@0.4.5
|
||||||
|
- llamaindex@0.8.8
|
||||||
|
- @llamaindex/node-parser@0.0.6
|
||||||
|
- @llamaindex/workflow@0.0.3
|
||||||
|
- @llamaindex/cloud@2.0.5
|
||||||
|
- @llamaindex/openai@0.1.30
|
||||||
|
- @llamaindex/readers@1.0.6
|
||||||
|
|
||||||
|
## 0.0.9
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @llamaindex/cloud@2.0.4
|
||||||
|
- @llamaindex/core@0.4.4
|
||||||
|
- llamaindex@0.8.7
|
||||||
|
- @llamaindex/node-parser@0.0.5
|
||||||
|
- @llamaindex/openai@0.1.29
|
||||||
|
- @llamaindex/readers@1.0.5
|
||||||
|
|
||||||
|
## 0.0.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [95a5cc6]
|
||||||
|
- @llamaindex/core@0.4.3
|
||||||
|
- llamaindex@0.8.6
|
||||||
|
- @llamaindex/cloud@2.0.3
|
||||||
|
- @llamaindex/node-parser@0.0.4
|
||||||
|
- @llamaindex/openai@0.1.28
|
||||||
|
- @llamaindex/readers@1.0.4
|
||||||
|
|
||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [14cc9eb]
|
||||||
|
- Updated dependencies [a6db5dd]
|
||||||
|
- Updated dependencies [396b1e1]
|
||||||
|
- llamaindex@0.8.5
|
||||||
|
- @llamaindex/cloud@2.0.2
|
||||||
|
- @llamaindex/core@0.4.2
|
||||||
|
- @llamaindex/node-parser@0.0.3
|
||||||
|
- @llamaindex/openai@0.1.27
|
||||||
|
- @llamaindex/readers@1.0.3
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# next
|
# Docs
|
||||||
|
|
||||||
This is a Next.js application generated with
|
This is a Next.js application generated with
|
||||||
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).
|
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).
|
||||||
@@ -6,15 +6,10 @@ This is a Next.js application generated with
|
|||||||
Run development server:
|
Run development server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
turbo run dev
|
||||||
# or
|
# turbo will build all required packages before running the dev server
|
||||||
pnpm dev
|
|
||||||
# or
|
|
||||||
yarn dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Open http://localhost:3000 with your browser to see the result.
|
|
||||||
|
|
||||||
## Learn More
|
## Learn More
|
||||||
|
|
||||||
To learn more about Next.js and Fumadocs, take a look at the following
|
To learn more about Next.js and Fumadocs, take a look at the following
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@llamaindex/doc",
|
"name": "@llamaindex/doc",
|
||||||
"version": "0.0.6",
|
"version": "0.0.12",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm run build:docs && next build",
|
"build": "pnpm run build:docs && next build",
|
||||||
|
|||||||
@@ -25,15 +25,16 @@ export default function HomePage() {
|
|||||||
return (
|
return (
|
||||||
<main className="container mx-auto px-4 py-12">
|
<main className="container mx-auto px-4 py-12">
|
||||||
<h1 className="text-4xl md:text-6xl font-bold text-center mb-4">
|
<h1 className="text-4xl md:text-6xl font-bold text-center mb-4">
|
||||||
Build RAG Web App using
|
Build context-augmented web apps using
|
||||||
<br /> <span className="text-blue-500">LlamaIndex.TS</span>
|
<br /> <span className="text-blue-500">LlamaIndex.TS</span>
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-xl text-center text-fd-muted-foreground mb-12 ">
|
<p className="text-xl text-center text-fd-muted-foreground mb-12 ">
|
||||||
LlamaIndex.TS is the JS/TS library from our popular Python library
|
LlamaIndex.TS is the JS/TS version of{" "}
|
||||||
llama-index for building LLM applications
|
<a href="https://llamaindex.ai">LlamaIndex</a>, the framework for
|
||||||
|
building agentic generative AI applications connected to your data.
|
||||||
</p>
|
</p>
|
||||||
<div className="text-center text-lg text-fd-muted-foreground mb-12">
|
<div className="text-center text-lg text-fd-muted-foreground mb-12">
|
||||||
<span>Designed for building web applications under </span>
|
<span>Designed for building web applications in </span>
|
||||||
<TextEffect />
|
<TextEffect />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -58,8 +59,8 @@ export default function HomePage() {
|
|||||||
<Feature
|
<Feature
|
||||||
icon={Footprints}
|
icon={Footprints}
|
||||||
subheading="Progressive"
|
subheading="Progressive"
|
||||||
heading="Adding AI feature from simple to complex"
|
heading="From the simplest to the most complex"
|
||||||
description="LlamaIndex.TS is designed to be simple to start with and can be extended to build complex AI applications."
|
description="LlamaIndex.TS is designed to be simple to get started, but powerful enough to build complex, agentic AI applications."
|
||||||
>
|
>
|
||||||
<Suspense
|
<Suspense
|
||||||
fallback={
|
fallback={
|
||||||
@@ -113,9 +114,9 @@ const response = await agent.chat({
|
|||||||
</Feature>
|
</Feature>
|
||||||
<Feature
|
<Feature
|
||||||
icon={Bot}
|
icon={Bot}
|
||||||
subheading="Agent"
|
subheading="Agents"
|
||||||
heading="Build agent for RAG"
|
heading="Build agentic RAG applications"
|
||||||
description="Build agents for RAG using LlamaIndex.TS. Agents are the core building blocks of RAG applications."
|
description="Truly powerful retrieval-augmented generation applications use agentic techniques, and LlamaIndex.TS makes it easy to build them."
|
||||||
>
|
>
|
||||||
<CodeBlock
|
<CodeBlock
|
||||||
code={`import { FunctionTool } from "llamaindex";
|
code={`import { FunctionTool } from "llamaindex";
|
||||||
@@ -137,19 +138,19 @@ await agent.chat('...');`}
|
|||||||
<Feature
|
<Feature
|
||||||
icon={Blocks}
|
icon={Blocks}
|
||||||
subheading="Providers"
|
subheading="Providers"
|
||||||
heading="LLM / Data Loader / Vector Store"
|
heading="LLMs, Data Loaders, Vector Stores and more!"
|
||||||
description="LlamaIndex.TS provides various providers to turn your data into valuable insights."
|
description="LlamaIndex.TS has hundreds of integrations to connect to your data, index it, and query it with LLMs."
|
||||||
>
|
>
|
||||||
<div className="mt-8 flex flex-col gap-8">
|
<div className="mt-8 flex flex-col gap-8">
|
||||||
<div>
|
<div>
|
||||||
<h3 className="text-lg font-semibold text-fd-muted-foreground mb-2">
|
<h3 className="text-lg font-semibold text-fd-muted-foreground mb-2">
|
||||||
LLM
|
LLMs
|
||||||
</h3>
|
</h3>
|
||||||
<InfiniteLLMProviders />
|
<InfiniteLLMProviders />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h3 className="text-lg font-semibold text-fd-muted-foreground mb-2">
|
<h3 className="text-lg font-semibold text-fd-muted-foreground mb-2">
|
||||||
Vector Store
|
Vector Stores
|
||||||
</h3>
|
</h3>
|
||||||
<InfiniteVectorStoreProviders />
|
<InfiniteVectorStoreProviders />
|
||||||
</div>
|
</div>
|
||||||
@@ -157,8 +158,8 @@ await agent.chat('...');`}
|
|||||||
</Feature>
|
</Feature>
|
||||||
<Feature
|
<Feature
|
||||||
icon={Terminal}
|
icon={Terminal}
|
||||||
subheading="Create Llama CLI"
|
subheading="create-llama CLI"
|
||||||
heading="CLI for starting RAG app with one line"
|
heading="Build a RAG app with a single command"
|
||||||
description="A command line tool to generate LlamaIndex apps, the easiest way to get started with LlamaIndex."
|
description="A command line tool to generate LlamaIndex apps, the easiest way to get started with LlamaIndex."
|
||||||
>
|
>
|
||||||
<div className="my-6">
|
<div className="my-6">
|
||||||
|
|||||||
@@ -7,9 +7,8 @@ import { ReactElement } from "react";
|
|||||||
export function Contributing(): ReactElement {
|
export function Contributing(): ReactElement {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center border-x border-t px-4 py-16 text-center">
|
<div className="flex flex-col items-center border-x border-t px-4 py-16 text-center">
|
||||||
<Heart className="mb-4" />
|
|
||||||
<h2 className="mb-4 text-xl font-semibold sm:text-2xl">
|
<h2 className="mb-4 text-xl font-semibold sm:text-2xl">
|
||||||
Made Possible by You.
|
Made possible by you <Heart className="inline align-middle" />
|
||||||
</h2>
|
</h2>
|
||||||
<p className="mb-4 text-fd-muted-foreground">
|
<p className="mb-4 text-fd-muted-foreground">
|
||||||
LlamaIndex.TS is powered by the open source community.
|
LlamaIndex.TS is powered by the open source community.
|
||||||
|
|||||||
@@ -53,9 +53,6 @@ export default async function ContributorCounter({
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="text-center text-sm text-fd-muted-foreground">
|
|
||||||
Some of our best contributors.
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,35 @@ See more about [moduleResolution](https://www.typescriptlang.org/docs/handbook/m
|
|||||||
</Accordion>
|
</Accordion>
|
||||||
</Accordions>
|
</Accordions>
|
||||||
|
|
||||||
|
## Enable AsyncIterable for `Web Stream` API
|
||||||
|
|
||||||
|
Some modules uses `Web Stream` API like `ReadableStream` and `WritableStream`, you need to enable `DOM.AsyncIterable` in your `tsconfig.json`.
|
||||||
|
|
||||||
|
```json5
|
||||||
|
{
|
||||||
|
compilerOptions: {
|
||||||
|
// ⬇️ add this lib to your tsconfig.json
|
||||||
|
lib: ["DOM.AsyncIterable"],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```ts twoslash
|
||||||
|
import { OpenAIAgent } from '@llamaindex/openai'
|
||||||
|
|
||||||
|
const agent = new OpenAIAgent({
|
||||||
|
tools: []
|
||||||
|
})
|
||||||
|
|
||||||
|
const response = await agent.chat({
|
||||||
|
message: 'Hello, how are you?',
|
||||||
|
stream: true
|
||||||
|
})
|
||||||
|
for await (const _ of response) {
|
||||||
|
//^?
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Run TypeScript Script in Node.js
|
## Run TypeScript Script in Node.js
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"extends": ["//"],
|
||||||
|
"tasks": {
|
||||||
|
"build": {
|
||||||
|
"outputs": [
|
||||||
|
".next",
|
||||||
|
".source",
|
||||||
|
"next-env.d.ts",
|
||||||
|
"src/content/docs/cloud/api/**"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dev": {
|
||||||
|
"dependsOn": ["^build"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,49 @@
|
|||||||
# @llamaindex/cloudflare-worker-agent-test
|
# @llamaindex/cloudflare-worker-agent-test
|
||||||
|
|
||||||
|
## 0.0.106
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [f066e50]
|
||||||
|
- llamaindex@0.8.10
|
||||||
|
|
||||||
|
## 0.0.105
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4fc001c]
|
||||||
|
- Updated dependencies [4d4cd8a]
|
||||||
|
- llamaindex@0.8.9
|
||||||
|
|
||||||
|
## 0.0.104
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ad85bd0]
|
||||||
|
- llamaindex@0.8.8
|
||||||
|
|
||||||
|
## 0.0.103
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- llamaindex@0.8.7
|
||||||
|
|
||||||
|
## 0.0.102
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [95a5cc6]
|
||||||
|
- llamaindex@0.8.6
|
||||||
|
|
||||||
|
## 0.0.101
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [14cc9eb]
|
||||||
|
- Updated dependencies [a6db5dd]
|
||||||
|
- Updated dependencies [396b1e1]
|
||||||
|
- llamaindex@0.8.5
|
||||||
|
|
||||||
## 0.0.100
|
## 0.0.100
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@llamaindex/cloudflare-worker-agent-test",
|
"name": "@llamaindex/cloudflare-worker-agent-test",
|
||||||
"version": "0.0.100",
|
"version": "0.0.106",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -1,5 +1,41 @@
|
|||||||
# @llamaindex/llama-parse-browser-test
|
# @llamaindex/llama-parse-browser-test
|
||||||
|
|
||||||
|
## 0.0.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @llamaindex/cloud@2.0.7
|
||||||
|
|
||||||
|
## 0.0.26
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @llamaindex/cloud@2.0.6
|
||||||
|
|
||||||
|
## 0.0.25
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @llamaindex/cloud@2.0.5
|
||||||
|
|
||||||
|
## 0.0.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @llamaindex/cloud@2.0.4
|
||||||
|
|
||||||
|
## 0.0.23
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @llamaindex/cloud@2.0.3
|
||||||
|
|
||||||
|
## 0.0.22
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @llamaindex/cloud@2.0.2
|
||||||
|
|
||||||
## 0.0.21
|
## 0.0.21
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@llamaindex/llama-parse-browser-test",
|
"name": "@llamaindex/llama-parse-browser-test",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.21",
|
"version": "0.0.27",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../../../../tsconfig.json",
|
"extends": "../../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"target": "ES2020",
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
},
|
},
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"path": "../../../../cloud/tsconfig.json"
|
"path": "../../../packages/cloud/tsconfig.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,49 @@
|
|||||||
# @llamaindex/next-agent-test
|
# @llamaindex/next-agent-test
|
||||||
|
|
||||||
|
## 0.1.106
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [f066e50]
|
||||||
|
- llamaindex@0.8.10
|
||||||
|
|
||||||
|
## 0.1.105
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4fc001c]
|
||||||
|
- Updated dependencies [4d4cd8a]
|
||||||
|
- llamaindex@0.8.9
|
||||||
|
|
||||||
|
## 0.1.104
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ad85bd0]
|
||||||
|
- llamaindex@0.8.8
|
||||||
|
|
||||||
|
## 0.1.103
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- llamaindex@0.8.7
|
||||||
|
|
||||||
|
## 0.1.102
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [95a5cc6]
|
||||||
|
- llamaindex@0.8.6
|
||||||
|
|
||||||
|
## 0.1.101
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [14cc9eb]
|
||||||
|
- Updated dependencies [a6db5dd]
|
||||||
|
- Updated dependencies [396b1e1]
|
||||||
|
- llamaindex@0.8.5
|
||||||
|
|
||||||
## 0.1.100
|
## 0.1.100
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@llamaindex/next-agent-test",
|
"name": "@llamaindex/next-agent-test",
|
||||||
"version": "0.1.100",
|
"version": "0.1.106",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 629 B After Width: | Height: | Size: 629 B |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../../../../tsconfig.json",
|
"extends": "../../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": ["dom", "dom.iterable", "esnext"],
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
@@ -1,5 +1,49 @@
|
|||||||
# test-edge-runtime
|
# test-edge-runtime
|
||||||
|
|
||||||
|
## 0.1.105
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [f066e50]
|
||||||
|
- llamaindex@0.8.10
|
||||||
|
|
||||||
|
## 0.1.104
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4fc001c]
|
||||||
|
- Updated dependencies [4d4cd8a]
|
||||||
|
- llamaindex@0.8.9
|
||||||
|
|
||||||
|
## 0.1.103
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ad85bd0]
|
||||||
|
- llamaindex@0.8.8
|
||||||
|
|
||||||
|
## 0.1.102
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- llamaindex@0.8.7
|
||||||
|
|
||||||
|
## 0.1.101
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [95a5cc6]
|
||||||
|
- llamaindex@0.8.6
|
||||||
|
|
||||||
|
## 0.1.100
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [14cc9eb]
|
||||||
|
- Updated dependencies [a6db5dd]
|
||||||
|
- Updated dependencies [396b1e1]
|
||||||
|
- llamaindex@0.8.5
|
||||||
|
|
||||||
## 0.1.99
|
## 0.1.99
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@llamaindex/nextjs-edge-runtime-test",
|
"name": "@llamaindex/nextjs-edge-runtime-test",
|
||||||
"version": "0.1.99",
|
"version": "0.1.105",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 629 B After Width: | Height: | Size: 629 B |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
@@ -1,5 +1,49 @@
|
|||||||
# @llamaindex/next-node-runtime
|
# @llamaindex/next-node-runtime
|
||||||
|
|
||||||
|
## 0.0.87
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [f066e50]
|
||||||
|
- llamaindex@0.8.10
|
||||||
|
|
||||||
|
## 0.0.86
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4fc001c]
|
||||||
|
- Updated dependencies [4d4cd8a]
|
||||||
|
- llamaindex@0.8.9
|
||||||
|
|
||||||
|
## 0.0.85
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ad85bd0]
|
||||||
|
- llamaindex@0.8.8
|
||||||
|
|
||||||
|
## 0.0.84
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- llamaindex@0.8.7
|
||||||
|
|
||||||
|
## 0.0.83
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [95a5cc6]
|
||||||
|
- llamaindex@0.8.6
|
||||||
|
|
||||||
|
## 0.0.82
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [14cc9eb]
|
||||||
|
- Updated dependencies [a6db5dd]
|
||||||
|
- Updated dependencies [396b1e1]
|
||||||
|
- llamaindex@0.8.5
|
||||||
|
|
||||||
## 0.0.81
|
## 0.0.81
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@llamaindex/next-node-runtime-test",
|
"name": "@llamaindex/next-node-runtime-test",
|
||||||
"version": "0.0.81",
|
"version": "0.0.87",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 629 B After Width: | Height: | Size: 629 B |
@@ -15,7 +15,6 @@ Settings.llm = new OpenAI({
|
|||||||
});
|
});
|
||||||
Settings.embedModel = new HuggingFaceEmbedding({
|
Settings.embedModel = new HuggingFaceEmbedding({
|
||||||
modelType: "BAAI/bge-small-en-v1.5",
|
modelType: "BAAI/bge-small-en-v1.5",
|
||||||
quantized: false,
|
|
||||||
});
|
});
|
||||||
Settings.callbackManager.on("llm-tool-call", (event) => {
|
Settings.callbackManager.on("llm-tool-call", (event) => {
|
||||||
console.log(event.detail);
|
console.log(event.detail);
|
||||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
@@ -1,5 +1,5 @@
|
|||||||
// test runtime
|
// test runtime
|
||||||
import { Tokenizers, tokenizers } from "@llamaindex/env";
|
import { Tokenizers, tokenizers } from "@llamaindex/env/tokenizers";
|
||||||
import "llamaindex";
|
import "llamaindex";
|
||||||
|
|
||||||
// @ts-expect-error EdgeRuntime is not defined in type
|
// @ts-expect-error EdgeRuntime is not defined in type
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../../../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": ["dom", "dom.iterable", "esnext"],
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
@@ -1,5 +1,49 @@
|
|||||||
# @llamaindex/waku-query-engine-test
|
# @llamaindex/waku-query-engine-test
|
||||||
|
|
||||||
|
## 0.0.106
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [f066e50]
|
||||||
|
- llamaindex@0.8.10
|
||||||
|
|
||||||
|
## 0.0.105
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4fc001c]
|
||||||
|
- Updated dependencies [4d4cd8a]
|
||||||
|
- llamaindex@0.8.9
|
||||||
|
|
||||||
|
## 0.0.104
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ad85bd0]
|
||||||
|
- llamaindex@0.8.8
|
||||||
|
|
||||||
|
## 0.0.103
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- llamaindex@0.8.7
|
||||||
|
|
||||||
|
## 0.0.102
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [95a5cc6]
|
||||||
|
- llamaindex@0.8.6
|
||||||
|
|
||||||
|
## 0.0.101
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [14cc9eb]
|
||||||
|
- Updated dependencies [a6db5dd]
|
||||||
|
- Updated dependencies [396b1e1]
|
||||||
|
- llamaindex@0.8.5
|
||||||
|
|
||||||
## 0.0.100
|
## 0.0.100
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@llamaindex/waku-query-engine-test",
|
"name": "@llamaindex/waku-query-engine-test",
|
||||||
"version": "0.0.100",
|
"version": "0.0.106",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
@@ -0,0 +1,3 @@
|
|||||||
|
import { OpenAI } from "./openai.js";
|
||||||
|
|
||||||
|
export class Ollama extends OpenAI {}
|
||||||