mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-01 22:14:03 -04:00
Compare commits
207 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 824c13cb85 | |||
| 0904d3dc5d | |||
| 18b8915f22 | |||
| 9bbfc2414e | |||
| 9487aa1ed5 | |||
| fd74c52fe8 | |||
| 0d2bf51a2e | |||
| 551c0edadf | |||
| f80b06293b | |||
| b3fec86413 | |||
| ab886a34d7 | |||
| 1ec9da120e | |||
| 817178272d | |||
| 3316c6b41c | |||
| 9214b0669d | |||
| b3d659b9af | |||
| 05b0fca610 | |||
| 64b909f436 | |||
| a2e6299aaa | |||
| 1fbfcab55e | |||
| 7db567ea74 | |||
| 6354c16776 | |||
| eb4c3dd3c7 | |||
| 8a4330132c | |||
| f2d4f828d4 | |||
| fe8030a9ad | |||
| ec12633ae0 | |||
| 5e24733e41 | |||
| a13911435f | |||
| 857bb4596a | |||
| 1359de75b5 | |||
| f9d1a6e013 | |||
| b18e1228a8 | |||
| b501eb5a19 | |||
| bfab1d407b | |||
| 4ef334a70f | |||
| af60503115 | |||
| b3a7a9df2c | |||
| 6b90e4c1b3 | |||
| 108634b94f | |||
| 4bb92be1e4 | |||
| 7678d319f2 | |||
| aaff02bc4b | |||
| 34f5398f41 | |||
| c06d1e5b09 | |||
| 0af7773c40 | |||
| a44ee19114 | |||
| 2726e375ea | |||
| b599813600 | |||
| bea4af984f | |||
| 5dbbb7d4c1 | |||
| c8ea424c7a | |||
| 8de110e577 | |||
| 7e82b89f36 | |||
| 669483699f | |||
| 672dde6e58 | |||
| 31a1a4b4d0 | |||
| f12a8d8006 | |||
| 03ea3af58c | |||
| cc2585360b | |||
| ff59660585 | |||
| 6063ce22fd | |||
| bc7cf343cc | |||
| 938eaf5d2d | |||
| a0bf44addb | |||
| 8d7e1624c7 | |||
| d1c9f30dfc | |||
| e57eb0caa3 | |||
| 7699f5432d | |||
| fe3b1f4f50 | |||
| 35f3030db6 | |||
| c0f31bbef2 | |||
| 0f654ae04b | |||
| be2dc5df28 | |||
| d6aeedd0e3 | |||
| dc91f5fdf7 | |||
| 4f6f245006 | |||
| ac69adba7a | |||
| b0bb4108a8 | |||
| 6ff932a055 | |||
| c850e7578b | |||
| 577534813d | |||
| 7d2fe9c69f | |||
| 68bdaaa657 | |||
| 7db9bc0c63 | |||
| cd8d22b33f | |||
| 802860050f | |||
| 3fda1deece | |||
| fb7fb760a0 | |||
| a4d6d7bc7d | |||
| f7cc69b5ec | |||
| 74b34a3730 | |||
| fc2a1b527e | |||
| 3e85a90b92 | |||
| 74ab98ddec | |||
| bff788b484 | |||
| 3e1abd2c6c | |||
| 79c76ea9d7 | |||
| 6f2cb31d41 | |||
| cc88141772 | |||
| 02d9bb0518 | |||
| 5321fb3135 | |||
| ea5038e4b7 | |||
| b012207764 | |||
| 9fa6d4a8a7 | |||
| c77dd18f2d | |||
| bb7c0d7deb | |||
| 80d3fc9482 | |||
| 79a721226d | |||
| ed36d41024 | |||
| 9a15c8ece0 | |||
| 9c5220ce75 | |||
| 8c67635041 | |||
| fc7f35141a | |||
| fc65e6b97d | |||
| 629bd3239a | |||
| 31c99baf1c | |||
| b2810777ef | |||
| 805d6fb81d | |||
| 9c566b0530 | |||
| daa14b8a5f | |||
| ed4fe4ac22 | |||
| b76562061e | |||
| baa91540cf | |||
| a594e22d2d | |||
| 91615a6602 | |||
| 43144ae782 | |||
| e927fc1800 | |||
| a08e904834 | |||
| 90429ab63d | |||
| abaab0caca | |||
| bc5c2e5c7b | |||
| c3e4b37414 | |||
| 63906798e8 | |||
| d7c2453c7d | |||
| 6a61ea46bf | |||
| 5a765aa1d6 | |||
| 3cab956f94 | |||
| c65d671ddb | |||
| 985f3b52bb | |||
| 4636a763b0 | |||
| f4ddf89b51 | |||
| ca9410f702 | |||
| 50c0b04017 | |||
| 41464386d6 | |||
| a07a94108d | |||
| a7cc8020db | |||
| 761fa4d836 | |||
| ade5587a15 | |||
| 2db8a8c2e3 | |||
| 3ad826e358 | |||
| 87925a36e6 | |||
| fc6ff47fd2 | |||
| 17b22f4673 | |||
| b033d0fbe9 | |||
| 122ab88fa5 | |||
| 73c188761f | |||
| 0fbf7b4ace | |||
| f9394ebb22 | |||
| 05f2f388d9 | |||
| d489a2120f | |||
| 8954a80e04 | |||
| f264211550 | |||
| 4d990d012c | |||
| 2683121ee1 | |||
| 08c2d4620f | |||
| 643ad626cd | |||
| 2619d4175d | |||
| b00821dbe9 | |||
| b0a742c3e6 | |||
| 9d0cadfc5f | |||
| 4ea034082b | |||
| 2298f42c18 | |||
| a67bfe26ed | |||
| d73ac8e718 | |||
| 213a68bb0f | |||
| 5bba0de1f3 | |||
| f1d609df5f | |||
| f9f6dc6985 | |||
| 4ae690612a | |||
| dc74b40c7a | |||
| b6b2598119 | |||
| 5cd54e2f98 | |||
| 8b7a94f8c5 | |||
| 44ab4d838f | |||
| 372ac1a24b | |||
| 09f02ff9b3 | |||
| 9dc30f5385 | |||
| 5871959c15 | |||
| e108757255 | |||
| 3cdc7e3feb | |||
| bc1a0fe651 | |||
| 5752fb6921 | |||
| f36f4b2dae | |||
| 8ee5503505 | |||
| da7199b3e9 | |||
| 67be6f373a | |||
| d5cbaa9ec7 | |||
| e7206a7dea | |||
| 5cdab4e311 | |||
| ee293da4f6 | |||
| 5a50ed2dfe | |||
| 452b678450 | |||
| abafa6014c | |||
| 1a3940376a | |||
| 775be4da64 | |||
| fcd70abc1f |
@@ -0,0 +1,8 @@
|
||||
# Changesets
|
||||
|
||||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
||||
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
||||
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
||||
|
||||
We have a quick list of common questions to get you started engaging with this project in
|
||||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Breaking: allow documents to be reimported with hash checking.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Update storage exports (thanks @TomPenguin)
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"fixed": [],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": []
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Breaking: removed nodeId and docId. Just use id\_
|
||||
@@ -0,0 +1,11 @@
|
||||
name: Bugfix
|
||||
title: 'Sweep: '
|
||||
description: Write something like "We notice ... behavior when ... happens instead of ...""
|
||||
labels: sweep
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Details
|
||||
description: More details about the bug
|
||||
placeholder: The bug might be in ... file
|
||||
@@ -0,0 +1,11 @@
|
||||
name: Feature Request
|
||||
title: 'Sweep: '
|
||||
description: Write something like "Write an api endpoint that does "..." in the "..." file"
|
||||
labels: sweep
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Details
|
||||
description: More details for Sweep
|
||||
placeholder: The new endpoint should use the ... class from ... file because it contains ... logic
|
||||
@@ -0,0 +1,11 @@
|
||||
name: Refactor
|
||||
title: 'Sweep: '
|
||||
description: Write something like "Modify the ... api endpoint to use ... version and ... framework"
|
||||
labels: sweep
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Details
|
||||
description: More details for Sweep
|
||||
placeholder: We are migrating this function to ... version because ...
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Lint on push or pull request
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Run lint
|
||||
run: pnpm run lint
|
||||
@@ -0,0 +1,24 @@
|
||||
name: Run Tests
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '18'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm i -g pnpm
|
||||
pnpm install
|
||||
|
||||
- name: Run tests
|
||||
run: pnpm run test
|
||||
+1
-1
@@ -35,4 +35,4 @@ yarn-error.log*
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
storage/
|
||||
dist/
|
||||
|
||||
+5
-3
@@ -12,13 +12,13 @@ apps/simple is where the demo code lives
|
||||
|
||||
### Turborepo docs
|
||||
|
||||
You can checkout how Turborepo works using the built in [README-turborepo.md](README-turborepo.md)
|
||||
You can checkout how Turborepo works using the default [README-turborepo.md](/README-turborepo.md)
|
||||
|
||||
## Getting Started
|
||||
|
||||
Install NodeJS. Preferably v18 using nvm or n.
|
||||
|
||||
Inside the llamascript directory:
|
||||
Inside the LlamaIndexTS directory:
|
||||
|
||||
```
|
||||
npm i -g pnpm ts-node
|
||||
@@ -41,12 +41,14 @@ To run them, run
|
||||
pnpm run test
|
||||
```
|
||||
|
||||
To write new test cases write them in packages/core/src/tests
|
||||
To write new test cases write them in [packages/core/src/tests](/packages/core/src/tests)
|
||||
|
||||
We use Jest https://jestjs.io/ to write our test cases. Jest comes with a bunch of built in assertions using the expect function: https://jestjs.io/docs/expect
|
||||
|
||||
### Demo applications
|
||||
|
||||
There is an existing ["simple"](/apps/simple/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 core 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
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
# LlamaIndex.TS
|
||||
|
||||
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/
|
||||
|
||||
## 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.
|
||||
@@ -13,9 +17,12 @@ LlamaIndex.TS requries Node v18 or higher. You can download it from https://node
|
||||
In a new folder:
|
||||
|
||||
```bash
|
||||
export OPEN_AI_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
|
||||
npx tsc –-init # if needed
|
||||
export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
|
||||
pnpm init
|
||||
pnpm install typescript
|
||||
pnpm exec tsc –-init # if needed
|
||||
pnpm install llamaindex
|
||||
pnpm install @types/node
|
||||
```
|
||||
|
||||
Create the file example.ts
|
||||
@@ -40,38 +47,52 @@ async function main() {
|
||||
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.aquery(
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?"
|
||||
);
|
||||
|
||||
// Output response
|
||||
console.log(response.toString());
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
||||
Then you can run it using
|
||||
|
||||
```bash
|
||||
npx ts-node example.ts
|
||||
pnpm dlx ts-node example.ts
|
||||
```
|
||||
|
||||
## Core concepts:
|
||||
## Playground
|
||||
|
||||
- [Document](packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
|
||||
Check out our NextJS playground at https://llama-playground.vercel.app/. The source is available at https://github.com/run-llama/ts-playground
|
||||
|
||||
- [Node](packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
|
||||
## Core concepts for getting started:
|
||||
|
||||
- Indexes: indexes store the Nodes and the embeddings of those nodes.
|
||||
- [Document](/packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
|
||||
|
||||
- [QueryEngine](packages/core/src/QueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected nodes from your Index to give the LLM the context it needs to answer your query.
|
||||
- [Node](/packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
|
||||
|
||||
- [ChatEngine](packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indexes.
|
||||
- [Embedding](/packages/core/src/Embedding.ts): Embeddings are sets of floating point numbers which represent the data in a Node. By comparing the similarity of embeddings, we can derive an understanding of the similarity of two pieces of data. One use case is to compare the embedding of a question with the embeddings of our Nodes to see which Nodes may contain the data needed to answer that quesiton.
|
||||
|
||||
- [SimplePrompt](packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
|
||||
- [Indices](/packages/core/src/indices/): Indices store the Nodes and the embeddings of those nodes. QueryEngines retrieve Nodes from these Indices using embedding similarity.
|
||||
|
||||
- [QueryEngine](/packages/core/src/QueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected Nodes from your Index to give the LLM the context it needs to answer your query.
|
||||
|
||||
- [ChatEngine](/packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indices.
|
||||
|
||||
- [SimplePrompt](/packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and formats them in a template literal. SimplePrompts can be specialized using currying and combined using other SimplePrompt functions.
|
||||
|
||||
## Supported LLMs:
|
||||
|
||||
- OpenAI GPT-3.5-turbo and GPT-4
|
||||
- Anthropic Claude Instant and Claude 2
|
||||
- Llama2 Chat LLMs (70B, 13B, and 7B parameters)
|
||||
|
||||
## Contributing:
|
||||
|
||||
We are in the very early days of LlamaIndex.TS. If you’re interested in hacking on it with us check out our [contributing guide](CONTRIBUTING.md)
|
||||
We are in the very early days of LlamaIndex.TS. If you’re interested in hacking on it with us check out our [contributing guide](/CONTRIBUTING.md)
|
||||
|
||||
## Bugs? Questions?
|
||||
|
||||
|
||||
@@ -5,21 +5,27 @@ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern sta
|
||||
### Installation
|
||||
|
||||
```
|
||||
$ yarn
|
||||
$ pnpm
|
||||
```
|
||||
|
||||
### Local Development
|
||||
|
||||
```
|
||||
$ yarn start
|
||||
$ pnpm start
|
||||
```
|
||||
|
||||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
||||
|
||||
However, the searchbar may not function with `yarn start`. Instead, run `yarn build` and launch a server:
|
||||
|
||||
```
|
||||
$ npx http-server ./build
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
```
|
||||
$ yarn build
|
||||
$ pnpm build
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||
@@ -29,13 +35,13 @@ This command generates static content into the `build` directory and can be serv
|
||||
Using SSH:
|
||||
|
||||
```
|
||||
$ USE_SSH=true yarn deploy
|
||||
$ USE_SSH=true pnpm deploy
|
||||
```
|
||||
|
||||
Not using SSH:
|
||||
|
||||
```
|
||||
$ GIT_USER=<Your GitHub username> yarn deploy
|
||||
$ GIT_USER=<Your GitHub username> pnpm deploy
|
||||
```
|
||||
|
||||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
@@ -1,2 +1,2 @@
|
||||
label: "API"
|
||||
position: 4
|
||||
position: 6
|
||||
@@ -0,0 +1,193 @@
|
||||
---
|
||||
id: "Anthropic"
|
||||
title: "Class: Anthropic"
|
||||
sidebar_label: "Anthropic"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Anthropic LLM implementation
|
||||
|
||||
## Implements
|
||||
|
||||
- [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new Anthropic**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`Anthropic`](Anthropic.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:449](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L449)
|
||||
|
||||
## Properties
|
||||
|
||||
### apiKey
|
||||
|
||||
• `Optional` **apiKey**: `string` = `undefined`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:442](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L442)
|
||||
|
||||
___
|
||||
|
||||
### callbackManager
|
||||
|
||||
• `Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:447](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L447)
|
||||
|
||||
___
|
||||
|
||||
### maxRetries
|
||||
|
||||
• **maxRetries**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:443](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L443)
|
||||
|
||||
___
|
||||
|
||||
### maxTokens
|
||||
|
||||
• `Optional` **maxTokens**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:439](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L439)
|
||||
|
||||
___
|
||||
|
||||
### model
|
||||
|
||||
• **model**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:436](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L436)
|
||||
|
||||
___
|
||||
|
||||
### session
|
||||
|
||||
• **session**: `AnthropicSession`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:445](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L445)
|
||||
|
||||
___
|
||||
|
||||
### temperature
|
||||
|
||||
• **temperature**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:437](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L437)
|
||||
|
||||
___
|
||||
|
||||
### timeout
|
||||
|
||||
• `Optional` **timeout**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:444](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L444)
|
||||
|
||||
___
|
||||
|
||||
### topP
|
||||
|
||||
• **topP**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:438](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L438)
|
||||
|
||||
## Methods
|
||||
|
||||
### chat
|
||||
|
||||
▸ **chat**(`messages`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
Get a chat response from the LLM
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:484](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L484)
|
||||
|
||||
___
|
||||
|
||||
### complete
|
||||
|
||||
▸ **complete**(`prompt`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
Get a prompt completion from the LLM
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `prompt` | `string` | the prompt to complete |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:502](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L502)
|
||||
|
||||
___
|
||||
|
||||
### mapMessagesToPrompt
|
||||
|
||||
▸ **mapMessagesToPrompt**(`messages`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:469](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L469)
|
||||
@@ -20,9 +20,9 @@ custom_edit_url: null
|
||||
|
||||
## Methods
|
||||
|
||||
### aGetQueryEmbedding
|
||||
### getQueryEmbedding
|
||||
|
||||
▸ `Abstract` **aGetQueryEmbedding**(`query`): `Promise`<`number`[]\>
|
||||
▸ `Abstract` **getQueryEmbedding**(`query`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -36,13 +36,13 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:206](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L206)
|
||||
[Embedding.ts:213](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L213)
|
||||
|
||||
___
|
||||
|
||||
### aGetTextEmbedding
|
||||
### getTextEmbedding
|
||||
|
||||
▸ `Abstract` **aGetTextEmbedding**(`text`): `Promise`<`number`[]\>
|
||||
▸ `Abstract` **getTextEmbedding**(`text`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L205)
|
||||
[Embedding.ts:212](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L212)
|
||||
|
||||
___
|
||||
|
||||
@@ -78,4 +78,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:197](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L197)
|
||||
[Embedding.ts:204](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L204)
|
||||
|
||||
@@ -19,10 +19,10 @@ they can be retrieved for our queries.
|
||||
|
||||
- **`BaseIndex`**
|
||||
|
||||
↳ [`VectorStoreIndex`](VectorStoreIndex.md)
|
||||
|
||||
↳ [`ListIndex`](ListIndex.md)
|
||||
|
||||
↳ [`VectorStoreIndex`](VectorStoreIndex.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
@@ -43,7 +43,7 @@ they can be retrieved for our queries.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:80](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L80)
|
||||
[indices/BaseIndex.ts:130](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L130)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -53,7 +53,7 @@ they can be retrieved for our queries.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L75)
|
||||
[indices/BaseIndex.ts:125](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L125)
|
||||
|
||||
___
|
||||
|
||||
@@ -63,7 +63,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L77)
|
||||
[indices/BaseIndex.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L127)
|
||||
|
||||
___
|
||||
|
||||
@@ -73,7 +73,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:78](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L78)
|
||||
[indices/BaseIndex.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
@@ -83,7 +83,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L73)
|
||||
[indices/BaseIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L123)
|
||||
|
||||
___
|
||||
|
||||
@@ -93,23 +93,56 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
|
||||
[indices/BaseIndex.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
### vectorStore
|
||||
|
||||
• `Optional` **vectorStore**: `VectorStore`
|
||||
• `Optional` **vectorStore**: [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L76)
|
||||
[indices/BaseIndex.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L126)
|
||||
|
||||
## Methods
|
||||
|
||||
### asQueryEngine
|
||||
|
||||
▸ `Abstract` **asQueryEngine**(`options?`): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
Create a new query engine from the index. It will also create a retriever
|
||||
and response synthezier if they are not provided.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `options?` | `Object` | you can supply your own custom Retriever and ResponseSynthesizer |
|
||||
| `options.responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) | - |
|
||||
| `options.retriever?` | [`BaseRetriever`](../interfaces/BaseRetriever.md) | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L150)
|
||||
|
||||
___
|
||||
|
||||
### asRetriever
|
||||
|
||||
▸ `Abstract` **asRetriever**(): [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
▸ `Abstract` **asRetriever**(`options?`): [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
Create a new retriever from the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -117,4 +150,67 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L89)
|
||||
[indices/BaseIndex.ts:143](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L143)
|
||||
|
||||
___
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ `Abstract` **deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `refDocId` | `string` |
|
||||
| `deleteFromDocStore?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:168](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L168)
|
||||
|
||||
___
|
||||
|
||||
### insert
|
||||
|
||||
▸ **insert**(`document`): `Promise`<`void`\>
|
||||
|
||||
Insert a document into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `document` | [`Document`](Document.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L159)
|
||||
|
||||
___
|
||||
|
||||
### insertNodes
|
||||
|
||||
▸ `Abstract` **insertNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:167](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L167)
|
||||
|
||||
@@ -28,7 +28,7 @@ Generic abstract class for retrievable nodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:48](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L48)
|
||||
[Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L55)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -38,7 +38,7 @@ Generic abstract class for retrievable nodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,7 +48,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
@@ -58,7 +58,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -68,7 +68,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,9 +76,14 @@ ___
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +93,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -98,7 +103,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L52)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -112,7 +117,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
|
||||
[Node.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
@@ -126,21 +131,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +145,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -168,7 +159,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
@@ -182,7 +173,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L65)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -196,7 +187,21 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:129](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ `Abstract` **generateHash**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L119)
|
||||
|
||||
___
|
||||
|
||||
@@ -216,7 +221,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L54)
|
||||
[Node.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
@@ -230,7 +235,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -250,7 +255,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:55](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L55)
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
@@ -264,7 +269,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L52)
|
||||
[Node.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L59)
|
||||
|
||||
___
|
||||
|
||||
@@ -284,4 +289,20 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:56](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L56)
|
||||
[Node.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
### toJSON
|
||||
|
||||
▸ **toJSON**(): `Record`<`string`, `any`\>
|
||||
|
||||
Used with built in JSON.stringify
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:141](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L141)
|
||||
|
||||
@@ -24,7 +24,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:68](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L68)
|
||||
[callbacks/CallbackManager.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L67)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -52,7 +52,7 @@ CallbackManagerMethods.onLLMStream
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:65](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L65)
|
||||
[callbacks/CallbackManager.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L64)
|
||||
|
||||
___
|
||||
|
||||
@@ -80,4 +80,4 @@ CallbackManagerMethods.onRetrieve
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L66)
|
||||
[callbacks/CallbackManager.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L65)
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
---
|
||||
id: "ChatGPTLLMPredictor"
|
||||
title: "Class: ChatGPTLLMPredictor"
|
||||
sidebar_label: "ChatGPTLLMPredictor"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
ChatGPTLLMPredictor is a predictor that uses GPT.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseLLMPredictor`](../interfaces/BaseLLMPredictor.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ChatGPTLLMPredictor**(`props?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `props?` | `Partial`<[`ChatGPTLLMPredictor`](ChatGPTLLMPredictor.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L26)
|
||||
|
||||
## Properties
|
||||
|
||||
### callbackManager
|
||||
|
||||
• `Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### languageModel
|
||||
|
||||
• **languageModel**: [`OpenAI`](OpenAI.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### model
|
||||
|
||||
• **model**: ``"gpt-3.5-turbo"`` \| ``"gpt-3.5-turbo-16k"`` \| ``"gpt-4"`` \| ``"gpt-4-32k"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### retryOnThrottling
|
||||
|
||||
• **retryOnThrottling**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L22)
|
||||
|
||||
## Methods
|
||||
|
||||
### apredict
|
||||
|
||||
▸ **apredict**(`prompt`, `input?`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `prompt` | `string` \| [`SimplePrompt`](../modules.md#simpleprompt) |
|
||||
| `input?` | `Record`<`string`, `string`\> |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseLLMPredictor](../interfaces/BaseLLMPredictor.md).[apredict](../interfaces/BaseLLMPredictor.md#apredict)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### getLlmMetadata
|
||||
|
||||
▸ **getLlmMetadata**(): `Promise`<`void`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseLLMPredictor](../interfaces/BaseLLMPredictor.md).[getLlmMetadata](../interfaces/BaseLLMPredictor.md#getllmmetadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L45)
|
||||
@@ -34,7 +34,7 @@ CompactAndRefine is a slight variation of Refine that first compacts the text ch
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L66)
|
||||
[ResponseSynthesizer.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L78)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -48,7 +48,7 @@ CompactAndRefine is a slight variation of Refine that first compacts the text ch
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L64)
|
||||
[ResponseSynthesizer.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L76)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,7 +62,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L62)
|
||||
[ResponseSynthesizer.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,13 +76,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L63)
|
||||
[ResponseSynthesizer.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L75)
|
||||
|
||||
## Methods
|
||||
|
||||
### agetResponse
|
||||
### getResponse
|
||||
|
||||
▸ **agetResponse**(`query`, `textChunks`, `prevResponse?`): `Promise`<`string`\>
|
||||
▸ **getResponse**(`query`, `textChunks`, `parentEvent?`, `prevResponse?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -90,7 +90,8 @@ ___
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
| `prevResponse?` | `any` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
| `prevResponse?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -98,8 +99,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Refine](Refine.md).[agetResponse](Refine.md#agetresponse)
|
||||
[Refine](Refine.md).[getResponse](Refine.md#getresponse)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:152](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L152)
|
||||
[ResponseSynthesizer.ts:181](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L181)
|
||||
|
||||
@@ -6,7 +6,7 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
CondenseQuestionChatEngine is used in conjunction with a Index (for example VectorIndex).
|
||||
CondenseQuestionChatEngine is used in conjunction with a Index (for example VectorStoreIndex).
|
||||
It does two steps on taking a user's chat message: first, it condenses the chat message
|
||||
with the previous chat history into a question with more context.
|
||||
Then, it queries the underlying Index using the new question with context and returns
|
||||
@@ -37,7 +37,7 @@ data, or are very referential to previous context.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L75)
|
||||
[ChatEngine.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L75)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -47,7 +47,7 @@ data, or are very referential to previous context.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:71](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L71)
|
||||
[ChatEngine.ts:71](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
@@ -57,7 +57,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L73)
|
||||
[ChatEngine.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
@@ -67,7 +67,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:70](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L70)
|
||||
[ChatEngine.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
@@ -77,13 +77,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L72)
|
||||
[ChatEngine.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L72)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
### chat
|
||||
|
||||
▸ **achat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
|
||||
▸ **chat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
@@ -100,17 +100,17 @@ Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[achat](../interfaces/ChatEngine.md#achat)
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[chat](../interfaces/ChatEngine.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L104)
|
||||
[ChatEngine.ts:100](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L100)
|
||||
|
||||
___
|
||||
|
||||
### acondenseQuestion
|
||||
### condenseQuestion
|
||||
|
||||
▸ `Private` **acondenseQuestion**(`chatHistory`, `question`): `Promise`<`string`\>
|
||||
▸ `Private` **condenseQuestion**(`chatHistory`, `question`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -121,11 +121,11 @@ ___
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L89)
|
||||
[ChatEngine.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L89)
|
||||
|
||||
___
|
||||
|
||||
@@ -145,4 +145,4 @@ Resets the chat history so that it's empty.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:123](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L123)
|
||||
[ChatEngine.ts:118](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L118)
|
||||
|
||||
@@ -31,7 +31,7 @@ ideally allowing the appropriate context to be surfaced for each query.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L138)
|
||||
[ChatEngine.ts:133](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L133)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -41,7 +41,7 @@ ideally allowing the appropriate context to be surfaced for each query.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:136](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L136)
|
||||
[ChatEngine.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L131)
|
||||
|
||||
___
|
||||
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:135](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L135)
|
||||
[ChatEngine.ts:130](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L130)
|
||||
|
||||
___
|
||||
|
||||
@@ -61,13 +61,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:134](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L134)
|
||||
[ChatEngine.ts:129](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L129)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
### chat
|
||||
|
||||
▸ **achat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
|
||||
▸ **chat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
@@ -84,25 +84,11 @@ Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[achat](../interfaces/ChatEngine.md#achat)
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[chat](../interfaces/ChatEngine.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
### chatRepl
|
||||
|
||||
▸ **chatRepl**(): `void`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L149)
|
||||
[ChatEngine.ts:144](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L144)
|
||||
|
||||
___
|
||||
|
||||
@@ -122,4 +108,4 @@ Resets the chat history so that it's empty.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L191)
|
||||
[ChatEngine.ts:182](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L182)
|
||||
|
||||
@@ -32,7 +32,7 @@ A document is just a special text node with a docId.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:216](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L216)
|
||||
[Node.ts:257](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L257)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -46,7 +46,7 @@ A document is just a special text node with a docId.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:139](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L139)
|
||||
[Node.ts:152](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L152)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -110,13 +110,18 @@ ___
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[id_](TextNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -130,7 +135,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -144,7 +149,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
|
||||
[Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
@@ -158,7 +163,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -172,7 +177,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
|
||||
[Node.ts:151](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L151)
|
||||
|
||||
___
|
||||
|
||||
@@ -186,7 +191,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
|
||||
[Node.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L150)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -204,21 +209,7 @@ TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
### docId
|
||||
|
||||
• `get` **docId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:225](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L225)
|
||||
[Node.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
@@ -236,25 +227,7 @@ TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
@@ -272,7 +245,7 @@ TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -290,7 +263,7 @@ TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
@@ -308,7 +281,7 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L65)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -326,17 +299,20 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:129](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `void`
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -344,7 +320,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
|
||||
[Node.ts:173](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L173)
|
||||
|
||||
___
|
||||
|
||||
@@ -368,7 +344,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
@@ -386,7 +362,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -410,7 +386,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
|
||||
[Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L192)
|
||||
|
||||
___
|
||||
|
||||
@@ -433,7 +409,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
|
||||
[Node.ts:219](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L219)
|
||||
|
||||
___
|
||||
|
||||
@@ -451,7 +427,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
|
||||
[Node.ts:223](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L223)
|
||||
|
||||
___
|
||||
|
||||
@@ -469,7 +445,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:221](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L221)
|
||||
[Node.ts:266](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L266)
|
||||
|
||||
___
|
||||
|
||||
@@ -493,4 +469,24 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
|
||||
[Node.ts:213](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L213)
|
||||
|
||||
___
|
||||
|
||||
### toJSON
|
||||
|
||||
▸ **toJSON**(): `Record`<`string`, `any`\>
|
||||
|
||||
Used with built in JSON.stringify
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `any`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[toJSON](TextNode.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:141](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L141)
|
||||
|
||||
@@ -26,7 +26,7 @@ A filesystem implementation that stores files in memory.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L25)
|
||||
[storage/FileSystem.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/FileSystem.ts#L25)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -50,7 +50,7 @@ A filesystem implementation that stores files in memory.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L38)
|
||||
[storage/FileSystem.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/FileSystem.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
@@ -75,7 +75,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L44)
|
||||
[storage/FileSystem.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/FileSystem.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
@@ -100,7 +100,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:31](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L31)
|
||||
[storage/FileSystem.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/FileSystem.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
@@ -126,4 +126,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L27)
|
||||
[storage/FileSystem.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/FileSystem.ts#L27)
|
||||
|
||||
@@ -33,20 +33,10 @@ The underlying structure of each index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L21)
|
||||
[indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: `Record`<`string`, [`Document`](Document.md)\> = `{}`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:36](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string`
|
||||
@@ -57,7 +47,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L18)
|
||||
[indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -67,7 +57,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:35](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L35)
|
||||
[indices/BaseIndex.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -81,7 +71,17 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L19)
|
||||
[indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
### type
|
||||
|
||||
• **type**: [`IndexStructType`](../enums/IndexStructType.md) = `IndexStructType.SIMPLE_DICT`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L46)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -102,7 +102,27 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L45)
|
||||
[indices/BaseIndex.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L55)
|
||||
|
||||
___
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`nodeId`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodeId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
@@ -120,4 +140,22 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L38)
|
||||
[indices/BaseIndex.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
### toJson
|
||||
|
||||
▸ **toJson**(): `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `unknown`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[IndexStruct](IndexStruct.md).[toJson](IndexStruct.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L60)
|
||||
|
||||
@@ -33,7 +33,7 @@ The underlying structure of each index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L21)
|
||||
[indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -47,7 +47,7 @@ The underlying structure of each index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L18)
|
||||
[indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -57,7 +57,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L52)
|
||||
[indices/BaseIndex.ts:93](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L93)
|
||||
|
||||
___
|
||||
|
||||
@@ -71,7 +71,17 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L19)
|
||||
[indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
### type
|
||||
|
||||
• **type**: [`IndexStructType`](../enums/IndexStructType.md) = `IndexStructType.LIST`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L94)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -91,7 +101,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L54)
|
||||
[indices/BaseIndex.ts:96](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L96)
|
||||
|
||||
___
|
||||
|
||||
@@ -109,4 +119,22 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L26)
|
||||
[indices/BaseIndex.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
### toJson
|
||||
|
||||
▸ **toJson**(): `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `unknown`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[IndexStruct](IndexStruct.md).[toJson](IndexStruct.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:100](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L100)
|
||||
|
||||
@@ -24,15 +24,15 @@ TextNode is the default node type for text. Most common node type in LlamaIndex.
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`TextNode`](TextNode.md)\> |
|
||||
| `init?` | `Partial`<[`IndexNode`](IndexNode.md)\> |
|
||||
|
||||
#### Inherited from
|
||||
#### Overrides
|
||||
|
||||
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:144](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L144)
|
||||
[Node.ts:239](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L239)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -46,7 +46,7 @@ TextNode is the default node type for text. Most common node type in LlamaIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:139](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L139)
|
||||
[Node.ts:152](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L152)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -110,13 +110,18 @@ ___
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[id_](TextNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -126,7 +131,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L205)
|
||||
[Node.ts:237](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L237)
|
||||
|
||||
___
|
||||
|
||||
@@ -140,7 +145,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +159,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
|
||||
[Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
@@ -168,7 +173,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -182,7 +187,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
|
||||
[Node.ts:151](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L151)
|
||||
|
||||
___
|
||||
|
||||
@@ -196,7 +201,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
|
||||
[Node.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L150)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -214,7 +219,7 @@ TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
|
||||
[Node.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
@@ -232,25 +237,7 @@ TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
@@ -268,7 +255,7 @@ TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -286,7 +273,7 @@ TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
@@ -304,7 +291,7 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L65)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -322,17 +309,20 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:129](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `void`
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -340,7 +330,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
|
||||
[Node.ts:173](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L173)
|
||||
|
||||
___
|
||||
|
||||
@@ -364,7 +354,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
@@ -382,7 +372,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -406,7 +396,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
|
||||
[Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L192)
|
||||
|
||||
___
|
||||
|
||||
@@ -429,7 +419,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
|
||||
[Node.ts:219](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L219)
|
||||
|
||||
___
|
||||
|
||||
@@ -447,7 +437,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
|
||||
[Node.ts:223](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L223)
|
||||
|
||||
___
|
||||
|
||||
@@ -465,7 +455,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:207](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L207)
|
||||
[Node.ts:248](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L248)
|
||||
|
||||
___
|
||||
|
||||
@@ -489,4 +479,24 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
|
||||
[Node.ts:213](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L213)
|
||||
|
||||
___
|
||||
|
||||
### toJSON
|
||||
|
||||
▸ **toJSON**(): `Record`<`string`, `any`\>
|
||||
|
||||
Used with built in JSON.stringify
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `any`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[toJSON](TextNode.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:141](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L141)
|
||||
|
||||
@@ -31,7 +31,7 @@ The underlying structure of each index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L21)
|
||||
[indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -41,7 +41,7 @@ The underlying structure of each index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L18)
|
||||
[indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L19)
|
||||
[indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L17)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -65,4 +65,18 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L26)
|
||||
[indices/BaseIndex.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
### toJson
|
||||
|
||||
▸ **toJson**(): `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L24)
|
||||
|
||||
@@ -26,17 +26,17 @@ LLMQuestionGenerator uses the LLM to generate new questions for the LLM using to
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:34](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L34)
|
||||
[QuestionGenerator.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QuestionGenerator.ts#L34)
|
||||
|
||||
## Properties
|
||||
|
||||
### llmPredictor
|
||||
### llm
|
||||
|
||||
• **llmPredictor**: [`BaseLLMPredictor`](../interfaces/BaseLLMPredictor.md)
|
||||
• **llm**: [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:30](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L30)
|
||||
[QuestionGenerator.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QuestionGenerator.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L32)
|
||||
[QuestionGenerator.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QuestionGenerator.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,13 +56,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:31](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L31)
|
||||
[QuestionGenerator.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QuestionGenerator.ts#L31)
|
||||
|
||||
## Methods
|
||||
|
||||
### agenerate
|
||||
### generate
|
||||
|
||||
▸ **agenerate**(`tools`, `query`): `Promise`<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
|
||||
▸ **generate**(`tools`, `query`): `Promise`<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -77,8 +77,8 @@ ___
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseQuestionGenerator](../interfaces/BaseQuestionGenerator.md).[agenerate](../interfaces/BaseQuestionGenerator.md#agenerate)
|
||||
[BaseQuestionGenerator](../interfaces/BaseQuestionGenerator.md).[generate](../interfaces/BaseQuestionGenerator.md#generate)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:40](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L40)
|
||||
[QuestionGenerator.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QuestionGenerator.ts#L40)
|
||||
|
||||
@@ -32,7 +32,7 @@ A ListIndex keeps nodes in a sequential list structure
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:37](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L37)
|
||||
[indices/list/ListIndex.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L47)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -46,7 +46,7 @@ A ListIndex keeps nodes in a sequential list structure
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L75)
|
||||
[indices/BaseIndex.ts:125](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L125)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L77)
|
||||
[indices/BaseIndex.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L127)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:78](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L78)
|
||||
[indices/BaseIndex.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L73)
|
||||
[indices/BaseIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L123)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,13 +102,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
|
||||
[indices/BaseIndex.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
### vectorStore
|
||||
|
||||
• `Optional` **vectorStore**: `VectorStore`
|
||||
• `Optional` **vectorStore**: [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -116,79 +116,51 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L76)
|
||||
[indices/BaseIndex.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L126)
|
||||
|
||||
## Methods
|
||||
|
||||
### \_deleteNode
|
||||
|
||||
▸ `Protected` **_deleteNode**(`nodeId`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodeId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:140](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L140)
|
||||
|
||||
___
|
||||
|
||||
### \_insert
|
||||
|
||||
▸ `Protected` **_insert**(`nodes`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:134](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L134)
|
||||
|
||||
___
|
||||
|
||||
### asQueryEngine
|
||||
|
||||
▸ **asQueryEngine**(`mode?`): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
▸ **asQueryEngine**(`options?`): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
Create a new query engine from the index. It will also create a retriever
|
||||
and response synthezier if they are not provided.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `mode` | [`ListRetrieverMode`](../enums/ListRetrieverMode.md) | `ListRetrieverMode.DEFAULT` |
|
||||
| `options?` | `Object` | you can supply your own custom Retriever and ResponseSynthesizer |
|
||||
| `options.responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) | - |
|
||||
| `options.retriever?` | [`BaseRetriever`](../interfaces/BaseRetriever.md) | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[asQueryEngine](BaseIndex.md#asqueryengine)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:113](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L113)
|
||||
[indices/list/ListIndex.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
### asRetriever
|
||||
|
||||
▸ **asRetriever**(`mode?`): [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
▸ **asRetriever**(`options?`): [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
Create a new retriever from the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `mode` | [`ListRetrieverMode`](../enums/ListRetrieverMode.md) | `ListRetrieverMode.DEFAULT` |
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options?` | `Object` |
|
||||
| `options.mode` | [`ListRetrieverMode`](../enums/ListRetrieverMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -200,7 +172,53 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:100](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L100)
|
||||
[indices/list/ListIndex.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L142)
|
||||
|
||||
___
|
||||
|
||||
### deleteNodes
|
||||
|
||||
▸ **deleteNodes**(`nodeIds`, `deleteFromDocStore`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodeIds` | `string`[] |
|
||||
| `deleteFromDocStore` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:216](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L216)
|
||||
|
||||
___
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ **deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `refDocId` | `string` |
|
||||
| `deleteFromDocStore?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[deleteRefDoc](BaseIndex.md#deleterefdoc)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L197)
|
||||
|
||||
___
|
||||
|
||||
@@ -214,13 +232,63 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:146](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L146)
|
||||
[indices/list/ListIndex.ts:230](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L230)
|
||||
|
||||
___
|
||||
|
||||
### \_buildIndexFromNodes
|
||||
### insert
|
||||
|
||||
▸ `Static` **_buildIndexFromNodes**(`nodes`, `docStore`, `indexStruct?`): `Promise`<[`IndexList`](IndexList.md)\>
|
||||
▸ **insert**(`document`): `Promise`<`void`\>
|
||||
|
||||
Insert a document into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `document` | [`Document`](Document.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insert](BaseIndex.md#insert)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L159)
|
||||
|
||||
___
|
||||
|
||||
### insertNodes
|
||||
|
||||
▸ **insertNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insertNodes](BaseIndex.md#insertnodes)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L191)
|
||||
|
||||
___
|
||||
|
||||
### buildIndexFromNodes
|
||||
|
||||
▸ `Static` **buildIndexFromNodes**(`nodes`, `docStore`, `indexStruct?`): `Promise`<[`IndexList`](IndexList.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -236,21 +304,22 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:119](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L119)
|
||||
[indices/list/ListIndex.ts:176](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L176)
|
||||
|
||||
___
|
||||
|
||||
### fromDocuments
|
||||
|
||||
▸ `Static` **fromDocuments**(`documents`, `storageContext?`, `serviceContext?`): `Promise`<[`ListIndex`](ListIndex.md)\>
|
||||
▸ `Static` **fromDocuments**(`documents`, `args?`): `Promise`<[`ListIndex`](ListIndex.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `documents` | [`Document`](Document.md)[] |
|
||||
| `storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
|
||||
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `args` | `Object` |
|
||||
| `args.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `args.storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -258,7 +327,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L77)
|
||||
[indices/list/ListIndex.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
@@ -278,4 +347,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:41](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L41)
|
||||
[indices/list/ListIndex.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L51)
|
||||
|
||||
@@ -31,7 +31,7 @@ LLM retriever for ListIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:67](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L67)
|
||||
[indices/list/ListIndexRetriever.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L64)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -41,7 +41,7 @@ LLM retriever for ListIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L62)
|
||||
[indices/list/ListIndexRetriever.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L59)
|
||||
|
||||
___
|
||||
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L61)
|
||||
[indices/list/ListIndexRetriever.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
@@ -61,7 +61,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L63)
|
||||
[indices/list/ListIndexRetriever.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L60)
|
||||
|
||||
___
|
||||
|
||||
@@ -71,7 +71,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:60](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L60)
|
||||
[indices/list/ListIndexRetriever.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
@@ -81,7 +81,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L64)
|
||||
[indices/list/ListIndexRetriever.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
@@ -91,35 +91,10 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:65](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L65)
|
||||
[indices/list/ListIndexRetriever.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
### aretrieve
|
||||
|
||||
▸ **aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[aretrieve](../interfaces/BaseRetriever.md#aretrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
@@ -134,4 +109,29 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:134](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L134)
|
||||
[indices/list/ListIndexRetriever.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L127)
|
||||
|
||||
___
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[retrieve](../interfaces/BaseRetriever.md#retrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndexRetriever.ts:81](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L81)
|
||||
|
||||
@@ -26,7 +26,7 @@ Simple retriever for ListIndex that returns all nodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L22)
|
||||
[indices/list/ListIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L22)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,35 +36,10 @@ Simple retriever for ListIndex that returns all nodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:20](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L20)
|
||||
[indices/list/ListIndexRetriever.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L20)
|
||||
|
||||
## Methods
|
||||
|
||||
### aretrieve
|
||||
|
||||
▸ **aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[aretrieve](../interfaces/BaseRetriever.md#aretrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
@@ -79,4 +54,29 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:51](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L51)
|
||||
[indices/list/ListIndexRetriever.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[retrieve](../interfaces/BaseRetriever.md#retrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndexRetriever.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndexRetriever.ts#L26)
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
---
|
||||
id: "LlamaDeuce"
|
||||
title: "Class: LlamaDeuce"
|
||||
sidebar_label: "LlamaDeuce"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Llama2 LLM implementation
|
||||
|
||||
## Implements
|
||||
|
||||
- [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new LlamaDeuce**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`LlamaDeuce`](LlamaDeuce.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:266](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L266)
|
||||
|
||||
## Properties
|
||||
|
||||
### chatStrategy
|
||||
|
||||
• **chatStrategy**: [`DeuceChatStrategy`](../enums/DeuceChatStrategy.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:260](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L260)
|
||||
|
||||
___
|
||||
|
||||
### maxTokens
|
||||
|
||||
• `Optional` **maxTokens**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:263](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L263)
|
||||
|
||||
___
|
||||
|
||||
### model
|
||||
|
||||
• **model**: ``"Llama-2-70b-chat-old"`` \| ``"Llama-2-70b-chat-4bit"`` \| ``"Llama-2-13b-chat"`` \| ``"Llama-2-13b-chat-4bit"`` \| ``"Llama-2-7b-chat"`` \| ``"Llama-2-7b-chat-4bit"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:259](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L259)
|
||||
|
||||
___
|
||||
|
||||
### replicateSession
|
||||
|
||||
• **replicateSession**: `ReplicateSession`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:264](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L264)
|
||||
|
||||
___
|
||||
|
||||
### temperature
|
||||
|
||||
• **temperature**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:261](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L261)
|
||||
|
||||
___
|
||||
|
||||
### topP
|
||||
|
||||
• **topP**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:262](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L262)
|
||||
|
||||
## Methods
|
||||
|
||||
### chat
|
||||
|
||||
▸ **chat**(`messages`, `_parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
Get a chat response from the LLM
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `_parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:385](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L385)
|
||||
|
||||
___
|
||||
|
||||
### complete
|
||||
|
||||
▸ **complete**(`prompt`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
Get a prompt completion from the LLM
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `prompt` | `string` | the prompt to complete |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:422](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L422)
|
||||
|
||||
___
|
||||
|
||||
### mapMessageTypeA16Z
|
||||
|
||||
▸ **mapMessageTypeA16Z**(`messageType`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messageType` | [`MessageType`](../modules.md#messagetype) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:309](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L309)
|
||||
|
||||
___
|
||||
|
||||
### mapMessagesToPrompt
|
||||
|
||||
▸ **mapMessagesToPrompt**(`messages`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `prompt` | `string` |
|
||||
| `systemPrompt` | `undefined` \| `string` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:281](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L281)
|
||||
|
||||
___
|
||||
|
||||
### mapMessagesToPromptA16Z
|
||||
|
||||
▸ **mapMessagesToPromptA16Z**(`messages`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `prompt` | `string` |
|
||||
| `systemPrompt` | `undefined` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:295](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L295)
|
||||
|
||||
___
|
||||
|
||||
### mapMessagesToPromptMeta
|
||||
|
||||
▸ **mapMessagesToPromptMeta**(`messages`, `opts?`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `opts?` | `Object` |
|
||||
| `opts.replicate4Bit?` | `boolean` |
|
||||
| `opts.withBos?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `prompt` | `string` |
|
||||
| `systemPrompt` | `undefined` \| `string` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:322](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L322)
|
||||
@@ -22,21 +22,31 @@ OpenAI LLM implementation
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`OpenAI`](OpenAI.md)\> |
|
||||
| `init?` | `Partial`<[`OpenAI`](OpenAI.md)\> & { `azure?`: `AzureOpenAIConfig` } |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L76)
|
||||
[llm/LLM.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L94)
|
||||
|
||||
## Properties
|
||||
|
||||
### apiKey
|
||||
|
||||
• `Optional` **apiKey**: `string` = `undefined`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
### callbackManager
|
||||
|
||||
• `Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L74)
|
||||
[llm/LLM.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L92)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:69](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L69)
|
||||
[llm/LLM.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:71](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L71)
|
||||
[llm/LLM.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,37 +76,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L66)
|
||||
|
||||
___
|
||||
|
||||
### n
|
||||
|
||||
• **n**: `number` = `1`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:70](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
### openAIKey
|
||||
|
||||
• **openAIKey**: ``null`` \| `string` = `null`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### requestTimeout
|
||||
|
||||
• **requestTimeout**: ``null`` \| `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:68](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L68)
|
||||
[llm/LLM.ts:81](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L81)
|
||||
|
||||
___
|
||||
|
||||
@@ -106,7 +86,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L73)
|
||||
[llm/LLM.ts:90](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L90)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,13 +96,33 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:67](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L67)
|
||||
[llm/LLM.ts:82](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L82)
|
||||
|
||||
___
|
||||
|
||||
### timeout
|
||||
|
||||
• `Optional` **timeout**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L89)
|
||||
|
||||
___
|
||||
|
||||
### topP
|
||||
|
||||
• **topP**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:83](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L83)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
### chat
|
||||
|
||||
▸ **achat**(`messages`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
▸ **chat**(`messages`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
Get a chat response from the LLM
|
||||
|
||||
@@ -139,17 +139,17 @@ Get a chat response from the LLM
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[achat](../interfaces/LLM.md#achat)
|
||||
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:103](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L103)
|
||||
[llm/LLM.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L157)
|
||||
|
||||
___
|
||||
|
||||
### acomplete
|
||||
### complete
|
||||
|
||||
▸ **acomplete**(`prompt`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
▸ **complete**(`prompt`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
Get a prompt completion from the LLM
|
||||
|
||||
@@ -166,28 +166,28 @@ Get a prompt completion from the LLM
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[acomplete](../interfaces/LLM.md#acomplete)
|
||||
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:145](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L145)
|
||||
[llm/LLM.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L197)
|
||||
|
||||
___
|
||||
|
||||
### mapMessageType
|
||||
|
||||
▸ **mapMessageType**(`type`): `ChatCompletionRequestMessageRoleEnum`
|
||||
▸ **mapMessageType**(`messageType`): ``"function"`` \| ``"user"`` \| ``"assistant"`` \| ``"system"``
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `type` | `MessageType` |
|
||||
| `messageType` | [`MessageType`](../modules.md#messagetype) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`ChatCompletionRequestMessageRoleEnum`
|
||||
``"function"`` \| ``"user"`` \| ``"assistant"`` \| ``"system"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:88](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L88)
|
||||
[llm/LLM.ts:140](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L140)
|
||||
|
||||
@@ -16,7 +16,13 @@ custom_edit_url: null
|
||||
|
||||
### constructor
|
||||
|
||||
• **new OpenAIEmbedding**()
|
||||
• **new OpenAIEmbedding**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`OpenAIEmbedding`](OpenAIEmbedding.md)\> & { `azure?`: `AzureOpenAIConfig` } |
|
||||
|
||||
#### Overrides
|
||||
|
||||
@@ -24,17 +30,37 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:217](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L217)
|
||||
[Embedding.ts:229](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L229)
|
||||
|
||||
## Properties
|
||||
|
||||
### apiKey
|
||||
|
||||
• `Optional` **apiKey**: `string` = `undefined`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L224)
|
||||
|
||||
___
|
||||
|
||||
### maxRetries
|
||||
|
||||
• **maxRetries**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:225](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L225)
|
||||
|
||||
___
|
||||
|
||||
### model
|
||||
|
||||
• **model**: `TEXT_EMBED_ADA_002`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:215](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L215)
|
||||
[Embedding.ts:221](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L221)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,13 +70,23 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:214](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L214)
|
||||
[Embedding.ts:227](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L227)
|
||||
|
||||
___
|
||||
|
||||
### timeout
|
||||
|
||||
• `Optional` **timeout**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:226](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L226)
|
||||
|
||||
## Methods
|
||||
|
||||
### \_aGetOpenAIEmbedding
|
||||
### getOpenAIEmbedding
|
||||
|
||||
▸ `Private` **_aGetOpenAIEmbedding**(`input`): `Promise`<`number`[]\>
|
||||
▸ `Private` **getOpenAIEmbedding**(`input`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -64,13 +100,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:224](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L224)
|
||||
[Embedding.ts:270](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L270)
|
||||
|
||||
___
|
||||
|
||||
### aGetQueryEmbedding
|
||||
### getQueryEmbedding
|
||||
|
||||
▸ **aGetQueryEmbedding**(`query`): `Promise`<`number`[]\>
|
||||
▸ **getQueryEmbedding**(`query`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -84,17 +120,17 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[aGetQueryEmbedding](BaseEmbedding.md#agetqueryembedding)
|
||||
[BaseEmbedding](BaseEmbedding.md).[getQueryEmbedding](BaseEmbedding.md#getqueryembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:240](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L240)
|
||||
[Embedding.ts:286](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L286)
|
||||
|
||||
___
|
||||
|
||||
### aGetTextEmbedding
|
||||
### getTextEmbedding
|
||||
|
||||
▸ **aGetTextEmbedding**(`text`): `Promise`<`number`[]\>
|
||||
▸ **getTextEmbedding**(`text`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -108,11 +144,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[aGetTextEmbedding](BaseEmbedding.md#agettextembedding)
|
||||
[BaseEmbedding](BaseEmbedding.md).[getTextEmbedding](BaseEmbedding.md#gettextembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:236](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L236)
|
||||
[Embedding.ts:282](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L282)
|
||||
|
||||
___
|
||||
|
||||
@@ -138,4 +174,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:197](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L197)
|
||||
[Embedding.ts:204](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L204)
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
id: "PDFReader"
|
||||
title: "Class: PDFReader"
|
||||
sidebar_label: "PDFReader"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Read the text of a PDF
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseReader`](../interfaces/BaseReader.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new PDFReader**()
|
||||
|
||||
## Methods
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `file` | `string` | `undefined` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](Document.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/PDFReader.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/PDFReader.ts#L11)
|
||||
@@ -34,7 +34,7 @@ A response builder that uses the query to ask the LLM generate a better response
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L66)
|
||||
[ResponseSynthesizer.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L78)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -44,7 +44,7 @@ A response builder that uses the query to ask the LLM generate a better response
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L64)
|
||||
[ResponseSynthesizer.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L76)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L62)
|
||||
[ResponseSynthesizer.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,13 +64,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L63)
|
||||
[ResponseSynthesizer.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L75)
|
||||
|
||||
## Methods
|
||||
|
||||
### agetResponse
|
||||
### getResponse
|
||||
|
||||
▸ **agetResponse**(`query`, `textChunks`, `prevResponse?`): `Promise`<`string`\>
|
||||
▸ **getResponse**(`query`, `textChunks`, `parentEvent?`, `prevResponse?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -78,7 +78,8 @@ ___
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
| `prevResponse?` | `any` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
| `prevResponse?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -86,17 +87,17 @@ ___
|
||||
|
||||
#### Implementation of
|
||||
|
||||
BaseResponseBuilder.agetResponse
|
||||
BaseResponseBuilder.getResponse
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L76)
|
||||
[ResponseSynthesizer.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
### giveResponseSingle
|
||||
|
||||
▸ `Private` **giveResponseSingle**(`queryStr`, `textChunk`): `Promise`<`string`\>
|
||||
▸ `Private` **giveResponseSingle**(`queryStr`, `textChunk`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -104,6 +105,7 @@ ___
|
||||
| :------ | :------ |
|
||||
| `queryStr` | `string` |
|
||||
| `textChunk` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -111,13 +113,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:95](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L95)
|
||||
[ResponseSynthesizer.ts:113](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L113)
|
||||
|
||||
___
|
||||
|
||||
### refineResponseSingle
|
||||
|
||||
▸ `Private` **refineResponseSingle**(`response`, `queryStr`, `textChunk`): `Promise`<`string`\>
|
||||
▸ `Private` **refineResponseSingle**(`response`, `queryStr`, `textChunk`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -126,6 +128,7 @@ ___
|
||||
| `response` | `string` |
|
||||
| `queryStr` | `string` |
|
||||
| `textChunk` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -133,4 +136,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:123](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L123)
|
||||
[ResponseSynthesizer.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L149)
|
||||
|
||||
@@ -23,7 +23,7 @@ Respone is the output of a LLM
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L10)
|
||||
[Response.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Response.ts#L10)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -33,7 +33,7 @@ Respone is the output of a LLM
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L7)
|
||||
[Response.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Response.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
@@ -43,7 +43,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:8](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L8)
|
||||
[Response.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Response.ts#L8)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -57,7 +57,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L15)
|
||||
[Response.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Response.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -71,4 +71,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L19)
|
||||
[Response.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Response.ts#L19)
|
||||
|
||||
@@ -24,7 +24,7 @@ A ResponseSynthesizer is used to generate a response from a query and a list of
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:225](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L225)
|
||||
[ResponseSynthesizer.ts:285](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L285)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -34,23 +34,23 @@ A ResponseSynthesizer is used to generate a response from a query and a list of
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:222](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L222)
|
||||
[ResponseSynthesizer.ts:282](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L282)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• `Optional` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:223](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L223)
|
||||
[ResponseSynthesizer.ts:283](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L283)
|
||||
|
||||
## Methods
|
||||
|
||||
### asynthesize
|
||||
### synthesize
|
||||
|
||||
▸ **asynthesize**(`query`, `nodes`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
|
||||
▸ **synthesize**(`query`, `nodes`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -66,4 +66,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:237](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L237)
|
||||
[ResponseSynthesizer.ts:297](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L297)
|
||||
|
||||
@@ -16,17 +16,18 @@ A query engine that uses a retriever to query an index and then synthesizes the
|
||||
|
||||
### constructor
|
||||
|
||||
• **new RetrieverQueryEngine**(`retriever`)
|
||||
• **new RetrieverQueryEngine**(`retriever`, `responseSynthesizer?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
|
||||
| `responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L29)
|
||||
[QueryEngine.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L34)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +37,7 @@ A query engine that uses a retriever to query an index and then synthesizes the
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L27)
|
||||
[QueryEngine.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,13 +47,15 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L26)
|
||||
[QueryEngine.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L31)
|
||||
|
||||
## Methods
|
||||
|
||||
### aquery
|
||||
### query
|
||||
|
||||
▸ **aquery**(`query`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
|
||||
▸ **query**(`query`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
Query the query engine and get a response.
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -67,8 +70,8 @@ ___
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[aquery](../interfaces/BaseQueryEngine.md#aquery)
|
||||
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[query](../interfaces/BaseQueryEngine.md#query)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:36](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L36)
|
||||
[QueryEngine.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L45)
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: null
|
||||
|
||||
SentenceSplitter is our default text splitter that supports splitting into sentences, paragraphs, or fixed length chunks with overlap.
|
||||
|
||||
One of the advantages of SentenceSplitter is that even in the fixed length chunks it will try to keep sentences together.
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
@@ -27,7 +29,7 @@ SentenceSplitter is our default text splitter that supports splitting into sente
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:33](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L33)
|
||||
[TextSplitter.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L35)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -37,7 +39,7 @@ SentenceSplitter is our default text splitter that supports splitting into sente
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L26)
|
||||
[TextSplitter.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
@@ -47,7 +49,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L25)
|
||||
[TextSplitter.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -57,7 +59,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:30](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L30)
|
||||
[TextSplitter.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
@@ -67,7 +69,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L29)
|
||||
[TextSplitter.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
@@ -77,7 +79,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L27)
|
||||
[TextSplitter.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
@@ -87,7 +89,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L28)
|
||||
[TextSplitter.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L30)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -108,7 +110,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L153)
|
||||
[TextSplitter.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
@@ -128,7 +130,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L72)
|
||||
[TextSplitter.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
@@ -149,7 +151,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L89)
|
||||
[TextSplitter.ts:91](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L91)
|
||||
|
||||
___
|
||||
|
||||
@@ -170,7 +172,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:115](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L115)
|
||||
[TextSplitter.ts:117](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L117)
|
||||
|
||||
___
|
||||
|
||||
@@ -191,7 +193,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:128](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L128)
|
||||
[TextSplitter.ts:130](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L130)
|
||||
|
||||
___
|
||||
|
||||
@@ -212,7 +214,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:233](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L233)
|
||||
[TextSplitter.ts:247](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L247)
|
||||
|
||||
___
|
||||
|
||||
@@ -233,4 +235,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L205)
|
||||
[TextSplitter.ts:219](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/TextSplitter.ts#L219)
|
||||
|
||||
@@ -26,7 +26,7 @@ SimpleChatEngine is the simplest possible chat engine. Useful for using your own
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:40](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L40)
|
||||
[ChatEngine.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L40)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ SimpleChatEngine is the simplest possible chat engine. Useful for using your own
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:37](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L37)
|
||||
[ChatEngine.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,13 +46,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L38)
|
||||
[ChatEngine.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L38)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
### chat
|
||||
|
||||
▸ **achat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
|
||||
▸ **chat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
@@ -69,11 +69,11 @@ Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[achat](../interfaces/ChatEngine.md#achat)
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[chat](../interfaces/ChatEngine.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L45)
|
||||
[ChatEngine.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -93,4 +93,4 @@ Resets the chat history so that it's empty.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L54)
|
||||
[ChatEngine.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L54)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
id: "SimpleDirectoryReader"
|
||||
title: "Class: SimpleDirectoryReader"
|
||||
sidebar_label: "SimpleDirectoryReader"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Read all of the documents in a directory. Currently supports PDF and TXT files.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseReader`](../interfaces/BaseReader.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleDirectoryReader**()
|
||||
|
||||
## Methods
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`«destructured»`): `Promise`<[`Document`](Document.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `«destructured»` | [`SimpleDirectoryReaderLoadDataProps`](../modules.md#simpledirectoryreaderloaddataprops) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](Document.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/SimpleDirectoryReader.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/SimpleDirectoryReader.ts#L37)
|
||||
@@ -0,0 +1,480 @@
|
||||
---
|
||||
id: "SimpleDocumentStore"
|
||||
title: "Class: SimpleDocumentStore"
|
||||
sidebar_label: "SimpleDocumentStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `KVDocumentStore`
|
||||
|
||||
↳ **`SimpleDocumentStore`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleDocumentStore**(`kvStore?`, `namespace?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `kvStore?` | `SimpleKVStore` |
|
||||
| `namespace?` | `string` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVDocumentStore.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
### kvStore
|
||||
|
||||
• `Private` **kvStore**: `SimpleKVStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L17)
|
||||
|
||||
## Methods
|
||||
|
||||
### addDocuments
|
||||
|
||||
▸ **addDocuments**(`docs`, `allowUpdate?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `docs` | [`BaseNode`](BaseNode.md)[] | `undefined` |
|
||||
| `allowUpdate` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.addDocuments
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### deleteDocument
|
||||
|
||||
▸ **deleteDocument**(`docId`, `raiseError?`, `removeRefDocNode?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `docId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
| `removeRefDocNode` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.deleteDocument
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L131)
|
||||
|
||||
___
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ **deleteRefDoc**(`refDocId`, `raiseError?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `refDocId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.deleteRefDoc
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:148](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L148)
|
||||
|
||||
___
|
||||
|
||||
### docs
|
||||
|
||||
▸ **docs**(): `Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.docs
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### documentExists
|
||||
|
||||
▸ **documentExists**(`docId`): `Promise`<`boolean`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `docId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.documentExists
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:105](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L105)
|
||||
|
||||
___
|
||||
|
||||
### getAllRefDocInfo
|
||||
|
||||
▸ **getAllRefDocInfo**(): `Promise`<`undefined` \| `Record`<`string`, `RefDocInfo`\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `Record`<`string`, `RefDocInfo`\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getAllRefDocInfo
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:93](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L93)
|
||||
|
||||
___
|
||||
|
||||
### getDocument
|
||||
|
||||
▸ **getDocument**(`docId`, `raiseError?`): `Promise`<`undefined` \| [`BaseNode`](BaseNode.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `docId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`BaseNode`](BaseNode.md)\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getDocument
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### getDocumentHash
|
||||
|
||||
▸ **getDocumentHash**(`docId`): `Promise`<`undefined` \| `string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `docId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `string`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getDocumentHash
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:174](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L174)
|
||||
|
||||
___
|
||||
|
||||
### getNode
|
||||
|
||||
▸ **getNode**(`nodeId`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `nodeId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BaseNode`](BaseNode.md)\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/types.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/types.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
### getNodeDict
|
||||
|
||||
▸ **getNodeDict**(`nodeIdDict`): `Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodeIdDict` | `Object` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getNodeDict
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/types.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/types.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
### getNodes
|
||||
|
||||
▸ **getNodes**(`nodeIds`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `nodeIds` | `string`[] | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BaseNode`](BaseNode.md)[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/types.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/types.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
### getRefDocInfo
|
||||
|
||||
▸ **getRefDocInfo**(`refDocId`): `Promise`<`undefined` \| `RefDocInfo`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `RefDocInfo`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getRefDocInfo
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVDocumentStore.persist
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
### refDocExists
|
||||
|
||||
▸ **refDocExists**(`refDocId`): `Promise`<`boolean`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.refDocExists
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L101)
|
||||
|
||||
___
|
||||
|
||||
### setDocumentHash
|
||||
|
||||
▸ **setDocumentHash**(`docId`, `docHash`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `docId` | `string` |
|
||||
| `docHash` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.setDocumentHash
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:169](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L169)
|
||||
|
||||
___
|
||||
|
||||
### toDict
|
||||
|
||||
▸ **toDict**(): `SaveDict`
|
||||
|
||||
#### Returns
|
||||
|
||||
`SaveDict`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### fromDict
|
||||
|
||||
▸ `Static` **fromDict**(`saveDict`, `namespace?`): [`SimpleDocumentStore`](SimpleDocumentStore.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `saveDict` | `SaveDict` |
|
||||
| `namespace?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleDocumentStore`](SimpleDocumentStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistDir
|
||||
|
||||
▸ `Static` **fromPersistDir**(`persistDir?`, `namespace?`, `fsModule?`): `Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `persistDir` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `namespace?` | `string` | `undefined` |
|
||||
| `fsModule?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `undefined` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`, `namespace?`, `fs?`): `Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `persistPath` | `string` |
|
||||
| `namespace?` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L42)
|
||||
@@ -0,0 +1,234 @@
|
||||
---
|
||||
id: "SimpleIndexStore"
|
||||
title: "Class: SimpleIndexStore"
|
||||
sidebar_label: "SimpleIndexStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `KVIndexStore`
|
||||
|
||||
↳ **`SimpleIndexStore`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleIndexStore**(`kvStore?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `kvStore?` | `BaseInMemoryKVStore` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVIndexStore.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L16)
|
||||
|
||||
## Properties
|
||||
|
||||
### kvStore
|
||||
|
||||
• `Private` **kvStore**: `BaseInMemoryKVStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L14)
|
||||
|
||||
## Methods
|
||||
|
||||
### addIndexStruct
|
||||
|
||||
▸ **addIndexStruct**(`indexStruct`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `indexStruct` | [`IndexStruct`](IndexStruct.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.addIndexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/KVIndexStore.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/KVIndexStore.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
### deleteIndexStruct
|
||||
|
||||
▸ **deleteIndexStruct**(`key`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `key` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.deleteIndexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/KVIndexStore.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/KVIndexStore.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### getIndexStruct
|
||||
|
||||
▸ **getIndexStruct**(`structId?`): `Promise`<`undefined` \| [`IndexStruct`](IndexStruct.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `structId?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`IndexStruct`](IndexStruct.md)\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.getIndexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/KVIndexStore.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/KVIndexStore.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### getIndexStructs
|
||||
|
||||
▸ **getIndexStructs**(): `Promise`<[`IndexStruct`](IndexStruct.md)[]\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`IndexStruct`](IndexStruct.md)[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.getIndexStructs
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/KVIndexStore.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/KVIndexStore.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `persistPath` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVIndexStore.persist
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
### toDict
|
||||
|
||||
▸ **toDict**(): `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### fromDict
|
||||
|
||||
▸ `Static` **fromDict**(`saveDict`): [`SimpleIndexStore`](SimpleIndexStore.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `saveDict` | `DataType` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleIndexStore`](SimpleIndexStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistDir
|
||||
|
||||
▸ `Static` **fromPersistDir**(`persistDir?`, `fs?`): `Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `persistDir` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`, `fs?`): `Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `persistPath` | `string` | `undefined` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L33)
|
||||
@@ -31,7 +31,7 @@ SimpleNodeParser is the default NodeParser. It splits documents into TextNodes u
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L64)
|
||||
[NodeParser.ts:93](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/NodeParser.ts#L93)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -39,9 +39,11 @@ SimpleNodeParser is the default NodeParser. It splits documents into TextNodes u
|
||||
|
||||
• **includeMetadata**: `boolean`
|
||||
|
||||
Whether to include metadata in the nodes.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L61)
|
||||
[NodeParser.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/NodeParser.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
@@ -49,9 +51,11 @@ ___
|
||||
|
||||
• **includePrevNextRel**: `boolean`
|
||||
|
||||
Whether to include previous and next relationships in the nodes.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L62)
|
||||
[NodeParser.ts:91](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/NodeParser.ts#L91)
|
||||
|
||||
___
|
||||
|
||||
@@ -59,9 +63,11 @@ ___
|
||||
|
||||
• **textSplitter**: [`SentenceSplitter`](SentenceSplitter.md)
|
||||
|
||||
The text splitter to use.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:60](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L60)
|
||||
[NodeParser.ts:83](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/NodeParser.ts#L83)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -87,7 +93,7 @@ Generate Node objects from documents
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:95](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L95)
|
||||
[NodeParser.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/NodeParser.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
@@ -111,4 +117,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:82](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L82)
|
||||
[NodeParser.ts:111](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/NodeParser.ts#L111)
|
||||
|
||||
@@ -16,27 +16,27 @@ A response builder that just concatenates responses.
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleResponseBuilder**(`serviceContext?`)
|
||||
• **new SimpleResponseBuilder**(`serviceContext`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:37](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L37)
|
||||
[ResponseSynthesizer.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L49)
|
||||
|
||||
## Properties
|
||||
|
||||
### llmPredictor
|
||||
### llm
|
||||
|
||||
• **llmPredictor**: [`BaseLLMPredictor`](../interfaces/BaseLLMPredictor.md)
|
||||
• **llm**: [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:34](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L34)
|
||||
[ResponseSynthesizer.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,13 +46,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:35](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L35)
|
||||
[ResponseSynthesizer.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L47)
|
||||
|
||||
## Methods
|
||||
|
||||
### agetResponse
|
||||
### getResponse
|
||||
|
||||
▸ **agetResponse**(`query`, `textChunks`, `parentEvent?`): `Promise`<`string`\>
|
||||
▸ **getResponse**(`query`, `textChunks`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -68,8 +68,8 @@ ___
|
||||
|
||||
#### Implementation of
|
||||
|
||||
BaseResponseBuilder.agetResponse
|
||||
BaseResponseBuilder.getResponse
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L43)
|
||||
[ResponseSynthesizer.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L54)
|
||||
|
||||
@@ -0,0 +1,283 @@
|
||||
---
|
||||
id: "SimpleVectorStore"
|
||||
title: "Class: SimpleVectorStore"
|
||||
sidebar_label: "SimpleVectorStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Implements
|
||||
|
||||
- [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleVectorStore**(`data?`, `fs?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `data?` | `SimpleVectorStoreData` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L37)
|
||||
|
||||
## Properties
|
||||
|
||||
### data
|
||||
|
||||
• `Private` **data**: `SimpleVectorStoreData`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### fs
|
||||
|
||||
• `Private` **fs**: [`GenericFileSystem`](../interfaces/GenericFileSystem.md) = `DEFAULT_FS`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### persistPath
|
||||
|
||||
• `Private` **persistPath**: `undefined` \| `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### storesText
|
||||
|
||||
• **storesText**: `boolean` = `false`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[storesText](../interfaces/VectorStore.md#storestext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L32)
|
||||
|
||||
## Accessors
|
||||
|
||||
### client
|
||||
|
||||
• `get` **client**(): `any`
|
||||
|
||||
#### Returns
|
||||
|
||||
`any`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
VectorStore.client
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L50)
|
||||
|
||||
## Methods
|
||||
|
||||
### add
|
||||
|
||||
▸ **add**(`embeddingResults`): `Promise`<`string`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `embeddingResults` | [`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[add](../interfaces/VectorStore.md#add)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`refDocId`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[delete](../interfaces/VectorStore.md#delete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L78)
|
||||
|
||||
___
|
||||
|
||||
### get
|
||||
|
||||
▸ **get**(`textId`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `textId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L54)
|
||||
|
||||
___
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[persist](../interfaces/VectorStore.md#persist)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:147](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L147)
|
||||
|
||||
___
|
||||
|
||||
### query
|
||||
|
||||
▸ **query**(`query`): `Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | [`VectorStoreQuery`](../interfaces/VectorStoreQuery.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[query](../interfaces/VectorStore.md#query)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L89)
|
||||
|
||||
___
|
||||
|
||||
### toDict
|
||||
|
||||
▸ **toDict**(): `SimpleVectorStoreData`
|
||||
|
||||
#### Returns
|
||||
|
||||
`SimpleVectorStoreData`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L197)
|
||||
|
||||
___
|
||||
|
||||
### fromDict
|
||||
|
||||
▸ `Static` **fromDict**(`saveDict`): [`SimpleVectorStore`](SimpleVectorStore.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `saveDict` | `SimpleVectorStoreData` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleVectorStore`](SimpleVectorStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:190](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L190)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistDir
|
||||
|
||||
▸ `Static` **fromPersistDir**(`persistDir?`, `fs?`): `Promise`<[`SimpleVectorStore`](SimpleVectorStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `persistDir` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleVectorStore`](SimpleVectorStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`, `fs?`): `Promise`<[`SimpleVectorStore`](SimpleVectorStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleVectorStore`](SimpleVectorStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:160](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L160)
|
||||
@@ -40,7 +40,7 @@ SubQuestionOutputParser is used to parse the output of the SubQuestionGenerator.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[OutputParser.ts:97](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L97)
|
||||
[OutputParser.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/OutputParser.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,4 +64,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[OutputParser.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L89)
|
||||
[OutputParser.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/OutputParser.ts#L89)
|
||||
|
||||
@@ -29,7 +29,7 @@ SubQuestionQueryEngine decomposes a question into subquestions and then
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:56](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L56)
|
||||
[QueryEngine.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L65)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -39,7 +39,7 @@ SubQuestionQueryEngine decomposes a question into subquestions and then
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L54)
|
||||
[QueryEngine.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
@@ -49,7 +49,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:53](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L53)
|
||||
[QueryEngine.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
@@ -59,7 +59,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L52)
|
||||
[QueryEngine.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
@@ -69,13 +69,15 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:51](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L51)
|
||||
[QueryEngine.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L60)
|
||||
|
||||
## Methods
|
||||
|
||||
### aquery
|
||||
### query
|
||||
|
||||
▸ **aquery**(`query`): `Promise`<[`Response`](Response.md)\>
|
||||
▸ **query**(`query`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
Query the query engine and get a response.
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -89,17 +91,17 @@ ___
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[aquery](../interfaces/BaseQueryEngine.md#aquery)
|
||||
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[query](../interfaces/BaseQueryEngine.md#query)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:97](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L97)
|
||||
[QueryEngine.ts:106](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L106)
|
||||
|
||||
___
|
||||
|
||||
### aquerySubQ
|
||||
### querySubQ
|
||||
|
||||
▸ `Private` **aquerySubQ**(`subQ`, `parentEvent?`): `Promise`<``null`` \| [`NodeWithScore`](../interfaces/NodeWithScore.md)\>
|
||||
▸ `Private` **querySubQ**(`subQ`, `parentEvent?`): `Promise`<``null`` \| [`NodeWithScore`](../interfaces/NodeWithScore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -114,7 +116,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:128](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L128)
|
||||
[QueryEngine.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L134)
|
||||
|
||||
___
|
||||
|
||||
@@ -138,4 +140,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L73)
|
||||
[QueryEngine.ts:82](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L82)
|
||||
|
||||
@@ -41,4 +41,4 @@ Read a .txt file
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/SimpleDirectoryReader.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/readers/SimpleDirectoryReader.ts#L12)
|
||||
[readers/SimpleDirectoryReader.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/SimpleDirectoryReader.ts#L12)
|
||||
|
||||
@@ -36,7 +36,7 @@ TextNode is the default node type for text. Most common node type in LlamaIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:144](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L144)
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L157)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -50,7 +50,7 @@ TextNode is the default node type for text. Most common node type in LlamaIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:139](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L139)
|
||||
[Node.ts:152](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L152)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -110,13 +110,18 @@ ___
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[id_](BaseNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -130,7 +135,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -140,7 +145,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
|
||||
[Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +159,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -164,7 +169,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
|
||||
[Node.ts:151](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L151)
|
||||
|
||||
___
|
||||
|
||||
@@ -174,7 +179,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
|
||||
[Node.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L150)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -192,7 +197,7 @@ BaseNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
|
||||
[Node.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
@@ -210,25 +215,7 @@ BaseNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
@@ -246,7 +233,7 @@ BaseNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -264,7 +251,7 @@ BaseNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
@@ -282,7 +269,7 @@ BaseNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L65)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -300,21 +287,28 @@ BaseNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:129](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `void`
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
`string`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[generateHash](BaseNode.md#generatehash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
|
||||
[Node.ts:173](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L173)
|
||||
|
||||
___
|
||||
|
||||
@@ -338,7 +332,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
@@ -356,7 +350,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -380,7 +374,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
|
||||
[Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L192)
|
||||
|
||||
___
|
||||
|
||||
@@ -399,7 +393,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
|
||||
[Node.ts:219](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L219)
|
||||
|
||||
___
|
||||
|
||||
@@ -413,7 +407,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
|
||||
[Node.ts:223](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L223)
|
||||
|
||||
___
|
||||
|
||||
@@ -431,7 +425,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L153)
|
||||
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L183)
|
||||
|
||||
___
|
||||
|
||||
@@ -455,4 +449,24 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
|
||||
[Node.ts:213](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L213)
|
||||
|
||||
___
|
||||
|
||||
### toJSON
|
||||
|
||||
▸ **toJSON**(): `Record`<`string`, `any`\>
|
||||
|
||||
Used with built in JSON.stringify
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `any`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[toJSON](BaseNode.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:141](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L141)
|
||||
|
||||
@@ -26,7 +26,7 @@ TreeSummarize repacks the text chunks into the smallest possible number of chunk
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:177](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L177)
|
||||
[ResponseSynthesizer.ts:212](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L212)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,13 +36,13 @@ TreeSummarize repacks the text chunks into the smallest possible number of chunk
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:175](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L175)
|
||||
[ResponseSynthesizer.ts:210](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L210)
|
||||
|
||||
## Methods
|
||||
|
||||
### agetResponse
|
||||
### getResponse
|
||||
|
||||
▸ **agetResponse**(`query`, `textChunks`): `Promise`<`string`\>
|
||||
▸ **getResponse**(`query`, `textChunks`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -50,6 +50,7 @@ TreeSummarize repacks the text chunks into the smallest possible number of chunk
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -57,8 +58,8 @@ TreeSummarize repacks the text chunks into the smallest possible number of chunk
|
||||
|
||||
#### Implementation of
|
||||
|
||||
BaseResponseBuilder.agetResponse
|
||||
BaseResponseBuilder.getResponse
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:181](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L181)
|
||||
[ResponseSynthesizer.ts:216](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ResponseSynthesizer.ts#L216)
|
||||
|
||||
@@ -16,17 +16,19 @@ VectorIndexRetriever retrieves nodes from a VectorIndex.
|
||||
|
||||
### constructor
|
||||
|
||||
• **new VectorIndexRetriever**(`index`)
|
||||
• **new VectorIndexRetriever**(`«destructured»`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `index` | [`VectorStoreIndex`](VectorStoreIndex.md) |
|
||||
| `«destructured»` | `Object` |
|
||||
| › `index` | [`VectorStoreIndex`](VectorStoreIndex.md) |
|
||||
| › `similarityTopK?` | `number` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L28)
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L22)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +38,7 @@ VectorIndexRetriever retrieves nodes from a VectorIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L24)
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,45 +48,20 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L26)
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
### similarityTopK
|
||||
|
||||
• **similarityTopK**: `number` = `DEFAULT_SIMILARITY_TOP_K`
|
||||
• **similarityTopK**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L25)
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L19)
|
||||
|
||||
## Methods
|
||||
|
||||
### aretrieve
|
||||
|
||||
▸ **aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[aretrieve](../interfaces/BaseRetriever.md#aretrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:33](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
@@ -99,4 +76,29 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:70](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L70)
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L69)
|
||||
|
||||
___
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[retrieve](../interfaces/BaseRetriever.md#retrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L35)
|
||||
|
||||
@@ -24,7 +24,7 @@ The VectorStoreIndex, an index that stores the nodes only according to their vec
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init` | `VectorIndexConstructorProps` |
|
||||
| `init` | [`VectorIndexConstructorProps`](../interfaces/VectorIndexConstructorProps.md) |
|
||||
|
||||
#### Overrides
|
||||
|
||||
@@ -32,7 +32,7 @@ The VectorStoreIndex, an index that stores the nodes only according to their vec
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:109](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L109)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L36)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -46,7 +46,7 @@ The VectorStoreIndex, an index that stores the nodes only according to their vec
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L75)
|
||||
[indices/BaseIndex.ts:125](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L125)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L77)
|
||||
[indices/BaseIndex.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L127)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:78](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L78)
|
||||
[indices/BaseIndex.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L73)
|
||||
[indices/BaseIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L123)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,13 +102,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
|
||||
[indices/BaseIndex.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
### vectorStore
|
||||
|
||||
• **vectorStore**: `VectorStore`
|
||||
• **vectorStore**: [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
@@ -116,55 +116,194 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:107](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L107)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L34)
|
||||
|
||||
## Methods
|
||||
|
||||
### asQueryEngine
|
||||
|
||||
▸ **asQueryEngine**(): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
▸ **asQueryEngine**(`options?`): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
Get a retriever query engine for this index.
|
||||
Create a new query engine from the index. It will also create a retriever
|
||||
and response synthezier if they are not provided.
|
||||
|
||||
NOTE: if you are using a custom query engine you don't have to use this method.
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `options?` | `Object` | you can supply your own custom Retriever and ResponseSynthesizer |
|
||||
| `options.responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) | - |
|
||||
| `options.retriever?` | [`BaseRetriever`](../interfaces/BaseRetriever.md) | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[asQueryEngine](BaseIndex.md#asqueryengine)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:252](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L252)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:223](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L223)
|
||||
|
||||
___
|
||||
|
||||
### asRetriever
|
||||
|
||||
▸ **asRetriever**(): [`VectorIndexRetriever`](VectorIndexRetriever.md)
|
||||
▸ **asRetriever**(`options?`): [`VectorIndexRetriever`](VectorIndexRetriever.md)
|
||||
|
||||
Get a VectorIndexRetriever for this index.
|
||||
Create a new retriever from the index.
|
||||
|
||||
NOTE: if you want to use a custom retriever you don't have to use this method.
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`VectorIndexRetriever`](VectorIndexRetriever.md)
|
||||
|
||||
retriever for the index
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[asRetriever](BaseIndex.md#asretriever)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:242](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L242)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:219](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L219)
|
||||
|
||||
___
|
||||
|
||||
### agetNodeEmbeddingResults
|
||||
### deleteRefDoc
|
||||
|
||||
▸ `Static` **agetNodeEmbeddingResults**(`nodes`, `serviceContext`, `logProgress?`): `Promise`<[`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[]\>
|
||||
▸ **deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `refDocId` | `string` | `undefined` |
|
||||
| `deleteFromDocStore` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[deleteRefDoc](BaseIndex.md#deleterefdoc)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:259](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L259)
|
||||
|
||||
___
|
||||
|
||||
### insert
|
||||
|
||||
▸ **insert**(`document`): `Promise`<`void`\>
|
||||
|
||||
Insert a document into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `document` | [`Document`](Document.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insert](BaseIndex.md#insert)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L159)
|
||||
|
||||
___
|
||||
|
||||
### insertNodes
|
||||
|
||||
▸ **insertNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insertNodes](BaseIndex.md#insertnodes)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:234](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L234)
|
||||
|
||||
___
|
||||
|
||||
### buildIndexFromNodes
|
||||
|
||||
▸ `Static` **buildIndexFromNodes**(`nodes`, `serviceContext`, `vectorStore`, `docStore`, `indexDict?`): `Promise`<[`IndexDict`](IndexDict.md)\>
|
||||
|
||||
Get embeddings for nodes and place them into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `vectorStore` | [`VectorStore`](../interfaces/VectorStore.md) |
|
||||
| `docStore` | `BaseDocumentStore` |
|
||||
| `indexDict?` | [`IndexDict`](IndexDict.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`IndexDict`](IndexDict.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:147](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L147)
|
||||
|
||||
___
|
||||
|
||||
### fromDocuments
|
||||
|
||||
▸ `Static` **fromDocuments**(`documents`, `args?`): `Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
High level API: split documents, get embeddings, and build index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `documents` | [`Document`](Document.md)[] |
|
||||
| `args` | `Object` |
|
||||
| `args.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `args.storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:194](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L194)
|
||||
|
||||
___
|
||||
|
||||
### getNodeEmbeddingResults
|
||||
|
||||
▸ `Static` **getNodeEmbeddingResults**(`nodes`, `serviceContext`, `logProgress?`): `Promise`<[`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[]\>
|
||||
|
||||
Get the embeddings for nodes.
|
||||
|
||||
@@ -182,55 +321,7 @@ Get the embeddings for nodes.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:159](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L159)
|
||||
|
||||
___
|
||||
|
||||
### buildIndexFromNodes
|
||||
|
||||
▸ `Static` **buildIndexFromNodes**(`nodes`, `serviceContext`, `vectorStore`): `Promise`<[`IndexDict`](IndexDict.md)\>
|
||||
|
||||
Get embeddings for nodes and place them into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `vectorStore` | `VectorStore` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`IndexDict`](IndexDict.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
### fromDocuments
|
||||
|
||||
▸ `Static` **fromDocuments**(`documents`, `storageContext?`, `serviceContext?`): `Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
High level API: split documents, get embeddings, and build index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `documents` | [`Document`](Document.md)[] |
|
||||
| `storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
|
||||
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:214](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L214)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L119)
|
||||
|
||||
___
|
||||
|
||||
@@ -238,6 +329,9 @@ ___
|
||||
|
||||
▸ `Static` **init**(`options`): `Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
The async init function should be called after the constructor.
|
||||
This is needed to handle persistence.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
@@ -250,4 +344,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:114](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L114)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L47)
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
id: "DeuceChatStrategy"
|
||||
title: "Enumeration: DeuceChatStrategy"
|
||||
sidebar_label: "DeuceChatStrategy"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### A16Z
|
||||
|
||||
• **A16Z** = ``"a16z"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:246](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L246)
|
||||
|
||||
___
|
||||
|
||||
### META
|
||||
|
||||
• **META** = ``"meta"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:247](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L247)
|
||||
|
||||
___
|
||||
|
||||
### METAWBOS
|
||||
|
||||
• **METAWBOS** = ``"metawbos"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:248](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L248)
|
||||
|
||||
___
|
||||
|
||||
### REPLICATE4BIT
|
||||
|
||||
• **REPLICATE4BIT** = ``"replicate4bit"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:251](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L251)
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
id: "IndexStructType"
|
||||
title: "Enumeration: IndexStructType"
|
||||
sidebar_label: "IndexStructType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### LIST
|
||||
|
||||
• **LIST** = ``"list"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
### SIMPLE\_DICT
|
||||
|
||||
• **SIMPLE\_DICT** = ``"simple_dict"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L40)
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L21)
|
||||
[indices/list/ListIndex.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,4 +24,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L23)
|
||||
[indices/list/ListIndex.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L32)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L19)
|
||||
[Node.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:20](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L20)
|
||||
[Node.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L21)
|
||||
[Node.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L22)
|
||||
[Node.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L23)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:8](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L8)
|
||||
[Node.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L6)
|
||||
[Node.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L7)
|
||||
[Node.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L5)
|
||||
[Node.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L6)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,4 +54,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L4)
|
||||
[Node.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L5)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L15)
|
||||
[Node.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:13](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L13)
|
||||
[Node.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L14)
|
||||
[Node.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L12)
|
||||
[Node.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L13)
|
||||
|
||||
@@ -17,7 +17,7 @@ Default is cosine similarity. Dot product and negative Euclidean distance are al
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L10)
|
||||
[Embedding.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
@@ -27,7 +27,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L11)
|
||||
[Embedding.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
@@ -37,4 +37,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L12)
|
||||
[Embedding.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L19)
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
---
|
||||
id: "VectorStoreQueryMode"
|
||||
title: "Enumeration: VectorStoreQueryMode"
|
||||
sidebar_label: "VectorStoreQueryMode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### DEFAULT
|
||||
|
||||
• **DEFAULT** = ``"default"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### HYBRID
|
||||
|
||||
• **HYBRID** = ``"hybrid"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
### LINEAR\_REGRESSION
|
||||
|
||||
• **LINEAR\_REGRESSION** = ``"linear_regression"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
### LOGISTIC\_REGRESSION
|
||||
|
||||
• **LOGISTIC\_REGRESSION** = ``"logistic_regression"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
### MMR
|
||||
|
||||
• **MMR** = ``"mmr"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
### SPARSE
|
||||
|
||||
• **SPARSE** = ``"sparse"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### SVM
|
||||
|
||||
• **SVM** = ``"svm"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L16)
|
||||
+33
-12
@@ -8,8 +8,12 @@ custom_edit_url: null
|
||||
|
||||
# LlamaIndex.TS
|
||||
|
||||
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/
|
||||
|
||||
## 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.
|
||||
@@ -21,9 +25,12 @@ LlamaIndex.TS requries Node v18 or higher. You can download it from https://node
|
||||
In a new folder:
|
||||
|
||||
```bash
|
||||
export OPEN_AI_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
|
||||
npx tsc –-init # if needed
|
||||
export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
|
||||
pnpm init
|
||||
pnpm install typescript
|
||||
pnpm exec tsc –-init # if needed
|
||||
pnpm install llamaindex
|
||||
pnpm install @types/node
|
||||
```
|
||||
|
||||
Create the file example.ts
|
||||
@@ -48,38 +55,52 @@ async function main() {
|
||||
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.aquery(
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?"
|
||||
);
|
||||
|
||||
// Output response
|
||||
console.log(response.toString());
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
||||
Then you can run it using
|
||||
|
||||
```bash
|
||||
npx ts-node example.ts
|
||||
pnpm dlx ts-node example.ts
|
||||
```
|
||||
|
||||
## Core concepts:
|
||||
## Playground
|
||||
|
||||
- [Document](packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
|
||||
Check out our NextJS playground at https://llama-playground.vercel.app/. The source is available at https://github.com/run-llama/ts-playground
|
||||
|
||||
- [Node](packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
|
||||
## Core concepts for getting started:
|
||||
|
||||
- Indexes: indexes store the Nodes and the embeddings of those nodes.
|
||||
- [Document](/packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
|
||||
|
||||
- [QueryEngine](packages/core/src/QueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected nodes from your Index to give the LLM the context it needs to answer your query.
|
||||
- [Node](/packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
|
||||
|
||||
- [ChatEngine](packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indexes.
|
||||
- [Embedding](/packages/core/src/Embedding.ts): Embeddings are sets of floating point numbers which represent the data in a Node. By comparing the similarity of embeddings, we can derive an understanding of the similarity of two pieces of data. One use case is to compare the embedding of a question with the embeddings of our Nodes to see which Nodes may contain the data needed to answer that quesiton.
|
||||
|
||||
- [SimplePrompt](packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
|
||||
- [Indices](/packages/core/src/indices/): Indices store the Nodes and the embeddings of those nodes. QueryEngines retrieve Nodes from these Indices using embedding similarity.
|
||||
|
||||
- [QueryEngine](/packages/core/src/QueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected Nodes from your Index to give the LLM the context it needs to answer your query.
|
||||
|
||||
- [ChatEngine](/packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indices.
|
||||
|
||||
- [SimplePrompt](/packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and formats them in a template literal. SimplePrompts can be specialized using currying and combined using other SimplePrompt functions.
|
||||
|
||||
## Supported LLMs:
|
||||
|
||||
- OpenAI GPT-3.5-turbo and GPT-4
|
||||
- Anthropic Claude Instant and Claude 2
|
||||
- Llama2 Chat LLMs (70B, 13B, and 7B parameters)
|
||||
|
||||
## Contributing:
|
||||
|
||||
We are in the very early days of LlamaIndex.TS. If you’re interested in hacking on it with us check out our [contributing guide](CONTRIBUTING.md)
|
||||
We are in the very early days of LlamaIndex.TS. If you’re interested in hacking on it with us check out our [contributing guide](/CONTRIBUTING.md)
|
||||
|
||||
## Bugs? Questions?
|
||||
|
||||
|
||||
@@ -12,6 +12,12 @@ custom_edit_url: null
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`BaseIndexInit`**
|
||||
|
||||
↳ [`VectorIndexConstructorProps`](VectorIndexConstructorProps.md)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
@@ -20,7 +26,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L62)
|
||||
[indices/BaseIndex.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L112)
|
||||
|
||||
___
|
||||
|
||||
@@ -30,7 +36,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L64)
|
||||
[indices/BaseIndex.ts:114](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L114)
|
||||
|
||||
___
|
||||
|
||||
@@ -40,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:65](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L65)
|
||||
[indices/BaseIndex.ts:115](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L115)
|
||||
|
||||
___
|
||||
|
||||
@@ -50,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:60](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L60)
|
||||
[indices/BaseIndex.ts:110](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L110)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,14 +66,14 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L61)
|
||||
[indices/BaseIndex.ts:111](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L111)
|
||||
|
||||
___
|
||||
|
||||
### vectorStore
|
||||
|
||||
• `Optional` **vectorStore**: `VectorStore`
|
||||
• `Optional` **vectorStore**: [`VectorStore`](VectorStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L63)
|
||||
[indices/BaseIndex.ts:113](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L113)
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
id: "BaseLLMPredictor"
|
||||
title: "Interface: BaseLLMPredictor"
|
||||
sidebar_label: "BaseLLMPredictor"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
LLM Predictors are an abstraction to predict the response to a prompt.
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`ChatGPTLLMPredictor`](../classes/ChatGPTLLMPredictor.md)
|
||||
|
||||
## Methods
|
||||
|
||||
### apredict
|
||||
|
||||
▸ **apredict**(`prompt`, `input?`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `prompt` | `string` \| [`SimplePrompt`](../modules.md#simpleprompt) |
|
||||
| `input?` | `Record`<`string`, `string`\> |
|
||||
| `parentEvent?` | [`Event`](Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### getLlmMetadata
|
||||
|
||||
▸ **getLlmMetadata**(): `Promise`<`any`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:9](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L9)
|
||||
@@ -36,7 +36,7 @@ An OutputParser is used to extract structured data from the raw output of the LL
|
||||
|
||||
#### Defined in
|
||||
|
||||
[OutputParser.ts:8](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L8)
|
||||
[OutputParser.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/OutputParser.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,4 +56,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[OutputParser.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L7)
|
||||
[OutputParser.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/OutputParser.ts#L7)
|
||||
|
||||
@@ -15,9 +15,11 @@ A query engine is a question answerer that can use one or more steps.
|
||||
|
||||
## Methods
|
||||
|
||||
### aquery
|
||||
### query
|
||||
|
||||
▸ **aquery**(`query`, `parentEvent?`): `Promise`<[`Response`](../classes/Response.md)\>
|
||||
▸ **query**(`query`, `parentEvent?`): `Promise`<[`Response`](../classes/Response.md)\>
|
||||
|
||||
Query the query engine and get a response.
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -32,4 +34,4 @@ A query engine is a question answerer that can use one or more steps.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L19)
|
||||
[QueryEngine.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QueryEngine.ts#L24)
|
||||
|
||||
@@ -14,9 +14,9 @@ QuestionGenerators generate new questions for the LLM using tools and a user que
|
||||
|
||||
## Methods
|
||||
|
||||
### agenerate
|
||||
### generate
|
||||
|
||||
▸ **agenerate**(`tools`, `query`): `Promise`<[`SubQuestion`](SubQuestion.md)[]\>
|
||||
▸ **generate**(`tools`, `query`): `Promise`<[`SubQuestion`](SubQuestion.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -31,4 +31,4 @@ QuestionGenerators generate new questions for the LLM using tools and a user que
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L23)
|
||||
[QuestionGenerator.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QuestionGenerator.ts#L23)
|
||||
|
||||
@@ -10,6 +10,8 @@ A reader takes imports data into Document objects.
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`PDFReader`](../classes/PDFReader.md)
|
||||
- [`SimpleDirectoryReader`](../classes/SimpleDirectoryReader.md)
|
||||
- [`TextFileReader`](../classes/TextFileReader.md)
|
||||
|
||||
## Methods
|
||||
@@ -30,4 +32,4 @@ A reader takes imports data into Document objects.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/base.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/readers/base.ts#L7)
|
||||
[readers/base.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/base.ts#L7)
|
||||
|
||||
@@ -16,9 +16,23 @@ Retrievers retrieve the nodes that most closely match our query in similarity.
|
||||
|
||||
## Methods
|
||||
|
||||
### aretrieve
|
||||
### getServiceContext
|
||||
|
||||
▸ **aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](NodeWithScore.md)[]\>
|
||||
▸ **getServiceContext**(): [`ServiceContext`](ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Retriever.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -33,18 +47,4 @@ Retrievers retrieve the nodes that most closely match our query in similarity.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L17)
|
||||
[Retriever.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Retriever.ts#L9)
|
||||
|
||||
@@ -22,4 +22,4 @@ Simple Tool interface. Likely to change.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Tool.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L12)
|
||||
[Tool.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Tool.ts#L12)
|
||||
|
||||
@@ -16,9 +16,9 @@ A ChatEngine is used to handle back and forth chats between the application and
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
### chat
|
||||
|
||||
▸ **achat**(`message`, `chatHistory?`): `Promise`<[`Response`](../classes/Response.md)\>
|
||||
▸ **chat**(`message`, `chatHistory?`): `Promise`<[`Response`](../classes/Response.md)\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
@@ -35,7 +35,7 @@ Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L25)
|
||||
[ChatEngine.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
@@ -51,4 +51,4 @@ Resets the chat history so that it's empty.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:30](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L30)
|
||||
[ChatEngine.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ChatEngine.ts#L30)
|
||||
|
||||
@@ -14,14 +14,14 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L14)
|
||||
[llm/LLM.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
### role
|
||||
|
||||
• **role**: `MessageType`
|
||||
• **role**: [`MessageType`](../modules.md#messagetype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L15)
|
||||
[llm/LLM.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L29)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L21)
|
||||
[llm/LLM.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L19)
|
||||
[llm/LLM.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,4 +34,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:20](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L20)
|
||||
[llm/LLM.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L34)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L14)
|
||||
[callbacks/CallbackManager.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L17)
|
||||
[callbacks/CallbackManager.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L16)
|
||||
[callbacks/CallbackManager.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L15)
|
||||
[callbacks/CallbackManager.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L14)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
id: "ExactMatchFilter"
|
||||
title: "Interface: ExactMatchFilter"
|
||||
sidebar_label: "ExactMatchFilter"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### filterType
|
||||
|
||||
• **filterType**: ``"ExactMatch"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### key
|
||||
|
||||
• **key**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
### value
|
||||
|
||||
• **value**: `string` \| `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L26)
|
||||
@@ -33,7 +33,7 @@ browsers.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L12)
|
||||
[storage/FileSystem.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/FileSystem.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:13](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L13)
|
||||
[storage/FileSystem.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/FileSystem.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
@@ -75,7 +75,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L11)
|
||||
[storage/FileSystem.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/FileSystem.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
@@ -97,4 +97,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L10)
|
||||
[storage/FileSystem.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/FileSystem.ts#L10)
|
||||
|
||||
@@ -10,13 +10,15 @@ Unified language model interface
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`Anthropic`](../classes/Anthropic.md)
|
||||
- [`LlamaDeuce`](../classes/LlamaDeuce.md)
|
||||
- [`OpenAI`](../classes/OpenAI.md)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
### chat
|
||||
|
||||
▸ **achat**(`messages`): `Promise`<[`ChatResponse`](ChatResponse.md)\>
|
||||
▸ **chat**(`messages`, `parentEvent?`): `Promise`<[`ChatResponse`](ChatResponse.md)\>
|
||||
|
||||
Get a chat response from the LLM
|
||||
|
||||
@@ -25,6 +27,7 @@ Get a chat response from the LLM
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](ChatMessage.md)[] |
|
||||
| `parentEvent?` | [`Event`](Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -32,13 +35,13 @@ Get a chat response from the LLM
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:35](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L35)
|
||||
[llm/LLM.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### acomplete
|
||||
### complete
|
||||
|
||||
▸ **acomplete**(`prompt`): `Promise`<[`ChatResponse`](ChatResponse.md)\>
|
||||
▸ **complete**(`prompt`, `parentEvent?`): `Promise`<[`ChatResponse`](ChatResponse.md)\>
|
||||
|
||||
Get a prompt completion from the LLM
|
||||
|
||||
@@ -47,6 +50,7 @@ Get a prompt completion from the LLM
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `prompt` | `string` | the prompt to complete |
|
||||
| `parentEvent?` | [`Event`](Event.md) | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -54,4 +58,4 @@ Get a prompt completion from the LLM
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:41](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L41)
|
||||
[llm/LLM.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L55)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
id: "MetadataFilters"
|
||||
title: "Interface: MetadataFilters"
|
||||
sidebar_label: "MetadataFilters"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### filters
|
||||
|
||||
• **filters**: [`ExactMatchFilter`](ExactMatchFilter.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L30)
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
id: "MetadataInfo"
|
||||
title: "Interface: MetadataInfo"
|
||||
sidebar_label: "MetadataInfo"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### description
|
||||
|
||||
• **description**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
|
||||
• **name**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
### type
|
||||
|
||||
• **type**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L41)
|
||||
@@ -6,7 +6,7 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A node parser generates TextNodes from Documents
|
||||
A NodeParser generates TextNodes from Documents
|
||||
|
||||
## Implemented by
|
||||
|
||||
@@ -18,16 +18,20 @@ A node parser generates TextNodes from Documents
|
||||
|
||||
▸ **getNodesFromDocuments**(`documents`): [`TextNode`](../classes/TextNode.md)[]
|
||||
|
||||
Generates an array of nodes from an array of documents.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `documents` | [`Document`](../classes/Document.md)[] |
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `documents` | [`Document`](../classes/Document.md)[] | The documents to generate nodes from. |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`TextNode`](../classes/TextNode.md)[]
|
||||
|
||||
An array of nodes.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:53](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L53)
|
||||
[NodeParser.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/NodeParser.ts#L73)
|
||||
|
||||
@@ -16,7 +16,7 @@ A node with an embedding
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:247](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L247)
|
||||
[Node.ts:305](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L305)
|
||||
|
||||
___
|
||||
|
||||
@@ -26,4 +26,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:246](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L246)
|
||||
[Node.ts:304](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L304)
|
||||
|
||||
@@ -16,7 +16,7 @@ A node with a similarity score
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:238](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L238)
|
||||
[Node.ts:296](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L296)
|
||||
|
||||
___
|
||||
|
||||
@@ -26,4 +26,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:239](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L239)
|
||||
[Node.ts:297](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L297)
|
||||
|
||||
@@ -26,7 +26,7 @@ A Tool that uses a QueryEngine.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Tool.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L12)
|
||||
[Tool.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Tool.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
@@ -36,4 +36,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Tool.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L19)
|
||||
[Tool.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Tool.ts#L19)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L29)
|
||||
[Node.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L28)
|
||||
[Node.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L26)
|
||||
[Node.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L27)
|
||||
[Node.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L28)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseCallbackResponse.event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L21)
|
||||
[callbacks/CallbackManager.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:47](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L47)
|
||||
[callbacks/CallbackManager.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L46)
|
||||
[callbacks/CallbackManager.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L45)
|
||||
|
||||
@@ -16,7 +16,7 @@ The ServiceContext is a collection of components that are used in different part
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L16)
|
||||
[ServiceContext.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -26,17 +26,17 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L14)
|
||||
[ServiceContext.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### llmPredictor
|
||||
### llm
|
||||
|
||||
• **llmPredictor**: [`BaseLLMPredictor`](BaseLLMPredictor.md)
|
||||
• **llm**: [`LLM`](LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L12)
|
||||
[ServiceContext.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L15)
|
||||
[ServiceContext.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,4 +56,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:13](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L13)
|
||||
[ServiceContext.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L12)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L26)
|
||||
[ServiceContext.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L29)
|
||||
[ServiceContext.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L28)
|
||||
[ServiceContext.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,27 +44,17 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L24)
|
||||
[ServiceContext.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### llm
|
||||
|
||||
• `Optional` **llm**: [`OpenAI`](../classes/OpenAI.md)
|
||||
• `Optional` **llm**: [`LLM`](LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### llmPredictor
|
||||
|
||||
• `Optional` **llmPredictor**: [`BaseLLMPredictor`](BaseLLMPredictor.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L21)
|
||||
[ServiceContext.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +64,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L25)
|
||||
[ServiceContext.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
@@ -84,4 +74,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L23)
|
||||
[ServiceContext.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/ServiceContext.ts#L21)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/StorageContext.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L15)
|
||||
[storage/StorageContext.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/StorageContext.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,14 +24,14 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/StorageContext.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L16)
|
||||
[storage/StorageContext.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/StorageContext.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### vectorStore
|
||||
|
||||
• **vectorStore**: `VectorStore`
|
||||
• **vectorStore**: [`VectorStore`](VectorStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/StorageContext.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L17)
|
||||
[storage/StorageContext.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/StorageContext.ts#L17)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseCallbackResponse.event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L21)
|
||||
[callbacks/CallbackManager.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:40](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L40)
|
||||
[callbacks/CallbackManager.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:41](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L41)
|
||||
[callbacks/CallbackManager.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,4 +54,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L42)
|
||||
[callbacks/CallbackManager.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L41)
|
||||
|
||||
@@ -10,11 +10,11 @@ custom_edit_url: null
|
||||
|
||||
### choices
|
||||
|
||||
• **choices**: { `delta`: { `content?`: `string` ; `role?`: `ChatCompletionResponseMessageRoleEnum` } ; `finish_reason`: ``null`` \| `string` ; `index`: `number` }[]
|
||||
• **choices**: { `delta`: { `content?`: ``null`` \| `string` ; `role?`: ``"function"`` \| ``"user"`` \| ``"assistant"`` \| ``"system"`` } ; `finish_reason`: ``null`` \| `string` ; `index`: `number` }[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L29)
|
||||
[callbacks/CallbackManager.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L27)
|
||||
[callbacks/CallbackManager.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L25)
|
||||
[callbacks/CallbackManager.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L28)
|
||||
[callbacks/CallbackManager.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,4 +54,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L26)
|
||||
[callbacks/CallbackManager.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/callbacks/CallbackManager.ts#L25)
|
||||
|
||||
@@ -22,7 +22,7 @@ StructuredOutput is just a combo of the raw output and the parsed output.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[OutputParser.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L16)
|
||||
[OutputParser.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/OutputParser.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -32,4 +32,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[OutputParser.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L15)
|
||||
[OutputParser.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/OutputParser.ts#L15)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L15)
|
||||
[QuestionGenerator.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QuestionGenerator.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,4 +24,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L16)
|
||||
[QuestionGenerator.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/QuestionGenerator.ts#L16)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Tool.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L4)
|
||||
[Tool.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Tool.ts#L4)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,4 +24,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Tool.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L5)
|
||||
[Tool.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Tool.ts#L5)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user