Compare commits

...

115 Commits

Author SHA1 Message Date
Yi Ding f7cc69b5ec have docs show up on the domain root 2023-07-24 10:55:57 -07:00
Logan 3e85a90b92 Merge pull request #25 from run-llama/logan/agolia_search 2023-07-24 09:41:49 -06:00
Logan Markewich 74ab98ddec add agolia search 2023-07-24 09:38:38 -06:00
Logan bff788b484 Merge pull request #24 from run-llama/logan/patch_storage_docs
fix storage example
2023-07-24 08:12:07 -06:00
Logan Markewich 3e1abd2c6c fix storage example 2023-07-24 08:11:27 -06:00
Yi Ding 79c76ea9d7 0.0.10 2023-07-24 06:03:35 -07:00
Yi Ding 6f2cb31d41 fixed tokenizer decoder 2023-07-24 06:02:16 -07:00
Yi Ding cc88141772 version 0.0.9 2023-07-24 05:29:42 -07:00
Yi Ding 02d9bb0518 the ESM export is causing issues with edge functions
Looks like there's another issue with axios. Will turn ESM bundles back
on once we fix it and the PDF issue
2023-07-24 05:22:14 -07:00
Yi Ding 5321fb3135 0.0.8 2023-07-24 05:19:46 -07:00
Yi Ding ea5038e4b7 disable PDF reader for now
Looks like it causes an issue with the esm package
2023-07-24 05:10:39 -07:00
Yi Ding b012207764 version 0.0.7
Also updated examples package.json to latest
2023-07-24 04:10:02 -07:00
Yi Ding 9fa6d4a8a7 make second arg in fromDocuments optional 2023-07-24 04:06:46 -07:00
yisding c77dd18f2d Merge pull request #22 from run-llama/logan/fix_persistance
fix persistance, align fromDocuments
2023-07-23 21:01:22 -07:00
Yi Ding bb7c0d7deb v0.0.6 2023-07-23 21:00:49 -07:00
Yi Ding 80d3fc9482 copy examples back to app/simple and tested them 2023-07-23 20:58:27 -07:00
Logan Markewich 79a721226d use proper camelCase for indexId 2023-07-23 21:22:10 -06:00
Logan Markewich ed36d41024 better type checking 2023-07-23 21:20:48 -06:00
Logan Markewich 9a15c8ece0 update storage example 2023-07-23 20:14:35 -06:00
Logan Markewich 9c5220ce75 fix tests 2023-07-23 19:28:14 -06:00
Logan Markewich 8c67635041 fix persistance, update fromDocuments 2023-07-23 19:26:17 -06:00
yisding fc7f35141a Merge pull request #21 from run-llama/logan/storage_demo
initial storage examples attempt
2023-07-21 15:54:26 -07:00
Logan Markewich fc65e6b97d initial storage examples attempt 2023-07-21 16:04:43 -06:00
Yi Ding 629bd3239a logan's fix 2023-07-21 11:48:49 -07:00
Yi Ding 31c99baf1c Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-07-21 11:47:56 -07:00
Yi Ding b2810777ef copied simple examples outside of the apps folder
Makes it easier to get started although now they have to use npm instead
of pnpm
2023-07-21 11:47:00 -07:00
Logan 805d6fb81d Merge pull request #20 from run-llama/logan/patch_llama2
patch import for llamaduece
2023-07-21 12:06:54 -06:00
Logan Markewich 9c566b0530 patch import 2023-07-21 12:06:22 -06:00
Yi Ding daa14b8a5f Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-07-21 11:03:29 -07:00
Yi Ding ed4fe4ac22 add pnpm install to the examples README 2023-07-21 11:02:48 -07:00
Simon Suo b76562061e Merge pull request #19 from run-llama/suo/update_docs_title_and_desc
Update docs title and meta description
2023-07-21 10:58:00 -07:00
Simon Suo baa91540cf wip 2023-07-21 10:57:08 -07:00
Simon Suo a594e22d2d Merge pull request #18 from run-llama/suo/update_github_link
Update Github link on docs
2023-07-21 10:50:28 -07:00
Simon Suo 91615a6602 update 2023-07-21 10:49:30 -07:00
Simon Suo 43144ae782 wip 2023-07-21 10:47:49 -07:00
Logan e927fc1800 Merge pull request #17 from run-llama/logan/starter_patch
replace -- chars
2023-07-21 11:31:14 -06:00
Logan Markewich a08e904834 replace -- chars 2023-07-21 11:30:30 -06:00
Logan 90429ab63d Merge pull request #16 from run-llama/logan/add_links_to_docs
patch various links
2023-07-21 11:24:55 -06:00
Logan Markewich abaab0caca patch links 2023-07-21 11:23:45 -06:00
Simon Suo bc5c2e5c7b Merge pull request #15 from run-llama/Disiok-patch-2
Update README.md
2023-07-21 10:17:09 -07:00
Simon Suo c3e4b37414 Update README.md 2023-07-21 10:16:59 -07:00
Simon Suo 63906798e8 Merge pull request #14 from run-llama/Disiok-patch-1
Update README.md
2023-07-21 10:12:17 -07:00
Simon Suo d7c2453c7d Update README.md 2023-07-21 10:11:40 -07:00
Yi Ding 6a61ea46bf publish 0.0.5 2023-07-21 09:33:00 -07:00
Yi Ding 5a765aa1d6 updated README 2023-07-21 09:32:23 -07:00
Yi Ding 3cab956f94 publish 0.0.4 2023-07-21 09:16:27 -07:00
Yi Ding c65d671ddb changeset 2023-07-21 09:15:39 -07:00
Yi Ding 985f3b52bb add README and CONTRIBUTING to dir and remove .turbo 2023-07-21 09:14:38 -07:00
Yi Ding 4636a763b0 removed gitignore from packages/core 2023-07-21 09:11:32 -07:00
Yi Ding f4ddf89b51 published 0.0.3 2023-07-21 09:08:30 -07:00
Yi Ding ca9410f702 try changeset 2023-07-21 09:07:38 -07:00
Yi Ding 50c0b04017 v0.0.2 2023-07-21 08:16:12 -07:00
Yi Ding 41464386d6 getting ready to publish 2023-07-21 08:13:09 -07:00
Yi Ding a07a94108d more persistence 2023-07-21 07:49:00 -07:00
Yi Ding a7cc8020db persistence and packaging 2023-07-21 07:32:36 -07:00
Yi Ding 761fa4d836 switch back to cjs default 2023-07-20 22:29:43 -07:00
Yi Ding ade5587a15 build stuff 2023-07-20 22:15:51 -07:00
Yi Ding 2db8a8c2e3 updated packages 2023-07-20 21:22:37 -07:00
Yi Ding 3ad826e358 doc build works thanks Logan! 2023-07-20 21:07:38 -07:00
Logan Markewich 87925a36e6 fix searchbar dependencies 2023-07-20 21:48:43 -06:00
Yi Ding fc6ff47fd2 replace all instances of yarn in docusaurus with pnpm 2023-07-20 20:37:49 -07:00
Yi Ding 17b22f4673 a few updates for the README 2023-07-20 19:48:55 -07:00
Yi Ding b033d0fbe9 Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-07-20 18:19:34 -07:00
Yi Ding 122ab88fa5 missed a chatRepl 2023-07-20 18:17:35 -07:00
Logan Markewich 73c188761f fix some docs usage 2023-07-20 19:08:59 -06:00
Logan Markewich 0fbf7b4ace update examples and docs 2023-07-20 19:08:59 -06:00
Yi Ding f9394ebb22 missing package in pnpm-lock 2023-07-20 17:29:24 -07:00
Yi Ding 05f2f388d9 Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-07-20 17:28:54 -07:00
Yi Ding d489a2120f allow asQueryEngine and asRetriever to take options 2023-07-20 17:15:11 -07:00
Logan Markewich 8954a80e04 add search bar 2023-07-20 17:06:39 -06:00
Logan Markewich f264211550 link to llama2 demo 2023-07-20 16:38:12 -06:00
Logan Markewich 4d990d012c remove some 'a' methods 2023-07-20 16:35:47 -06:00
Logan Markewich 2683121ee1 Update sidebar ordering, add storagecontext docs 2023-07-20 16:34:27 -06:00
Yi Ding 08c2d4620f removed ChatGPTLLMPredictor class 2023-07-19 21:25:51 -07:00
Yi Ding 643ad626cd deuce LLM class 2023-07-19 09:17:01 -07:00
Yi Ding 2619d4175d Fixed the context window issue.
Putting in a max tokens into the request was a mistake.
2023-07-18 23:17:44 -07:00
Yi Ding b00821dbe9 missing package in lockfile 2023-07-18 21:20:13 -07:00
Yi Ding b0a742c3e6 api docs updated with latest 2023-07-18 21:06:24 -07:00
yisding 9d0cadfc5f Merge pull request #13 from run-llama/logan/docs_finish
Finish Docs
2023-07-18 20:58:33 -07:00
Yi Ding 4ea034082b changed default response synthesizer to compact 2023-07-18 20:58:01 -07:00
Logan Markewich 2298f42c18 remove advanced concepts section 2023-07-18 20:35:37 -06:00
Logan Markewich a67bfe26ed fix link to node_parser 2023-07-18 19:58:34 -06:00
Logan Markewich d73ac8e718 Update high-level concetps 2023-07-18 19:54:06 -06:00
Logan Markewich 213a68bb0f round out low level modules 2023-07-18 19:13:05 -06:00
Logan Markewich 5bba0de1f3 reorder 2023-07-18 16:44:28 -06:00
Logan Markewich f1d609df5f docs re-generate 2023-07-18 13:57:05 -06:00
Logan Markewich f9f6dc6985 link in modules index 2023-07-18 13:13:42 -06:00
Logan Markewich 4ae690612a flesh out more 2023-07-18 13:09:07 -06:00
Logan Markewich dc74b40c7a add end-to-end examples 2023-07-18 11:48:53 -06:00
Logan Markewich b6b2598119 better org 2023-07-18 09:31:51 -06:00
Yi Ding 5cd54e2f98 few more fixes 2023-07-17 21:55:59 -07:00
Yi Ding 8b7a94f8c5 fix 2023-07-17 21:51:14 -07:00
Yi Ding 44ab4d838f no more a-prefix 2023-07-17 21:49:45 -07:00
Yi Ding 372ac1a24b move all indexes into indices folder 2023-07-17 21:32:29 -07:00
Yi Ding 09f02ff9b3 pnpm upgrade 2023-07-17 21:31:28 -07:00
yisding 9dc30f5385 Merge pull request #12 from run-llama/li_fix
ListIndex fix
2023-07-17 20:43:01 -07:00
Sourabh Desai 5871959c15 remove console log 2023-07-18 02:49:20 +00:00
Logan Markewich e108757255 add more structure 2023-07-17 20:48:48 -06:00
Logan Markewich 3cdc7e3feb re-org top level 2023-07-17 20:48:36 -06:00
Logan Markewich bc1a0fe651 undo organization 2023-07-17 20:48:27 -06:00
Logan Markewich 5752fb6921 organize modules 2023-07-17 20:48:19 -06:00
Logan Markewich f36f4b2dae Revert "organize modules"
This reverts commit 1a3940376a.
2023-07-17 20:46:37 -06:00
Logan Markewich 8ee5503505 Revert "undo organization"
This reverts commit abafa6014c.
2023-07-17 20:46:37 -06:00
Logan Markewich da7199b3e9 Revert "re-org top level"
This reverts commit 452b678450.
2023-07-17 20:46:37 -06:00
Logan Markewich 67be6f373a Revert "add more structure"
This reverts commit d5cbaa9ec7.
2023-07-17 20:46:37 -06:00
Logan Markewich d5cbaa9ec7 add more structure 2023-07-17 20:42:26 -06:00
Sourabh Desai e7206a7dea simplify test 2023-07-18 02:20:49 +00:00
Sourabh Desai 5cdab4e311 make ListIndex query engine use CompactAndRefine response builder by default 2023-07-18 02:08:22 +00:00
Sourabh Desai ee293da4f6 update test 2023-07-18 01:41:27 +00:00
Sourabh Desai 5a50ed2dfe udpate ListIndex.fromDocuments method signature 2023-07-18 01:39:20 +00:00
Logan Markewich 452b678450 re-org top level 2023-07-17 16:53:57 -06:00
Logan Markewich abafa6014c undo organization 2023-07-17 16:53:22 -06:00
Logan Markewich 1a3940376a organize modules 2023-07-17 16:30:32 -06:00
Yi Ding 775be4da64 add next as a dev dep on lint rules 2023-07-17 15:02:40 -07:00
yisding fcd70abc1f Merge pull request #11 from run-llama/docs
doc site
2023-07-17 10:43:26 -07:00
188 changed files with 6832 additions and 3094 deletions
+8
View File
@@ -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)
+11
View File
@@ -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": []
}
+2
View File
@@ -36,3 +36,5 @@ yarn-error.log*
.vercel
storage/
dist/
+1 -1
View File
@@ -18,7 +18,7 @@ You can checkout how Turborepo works using the built in [README-turborepo.md](RE
Install NodeJS. Preferably v18 using nvm or n.
Inside the llamascript directory:
Inside the LlamaIndexTS directory:
```
npm i -g pnpm ts-node
+19 -8
View File
@@ -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.
@@ -14,8 +18,11 @@ 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
pnpm init
pnpm install typescript
pnpm exec tsc -init # if needed
pnpm install llamaindex
pnpm install @types/node
```
Create the file example.ts
@@ -40,34 +47,38 @@ 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:
## Core concepts for getting started:
- [Document](packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
- [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.
- Indexes: indexes store the Nodes and the embeddings of those nodes.
- [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.
- [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.
- [Indices](packages/core/src/indices/): Indices store the Nodes and the embeddings of those nodes. QueryEngines retrieve Nodes from these Indices using embedding similarity.
- [ChatEngine](packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indexes.
- [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.
- [SimplePrompt](packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
- [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.
## Contributing:
+11 -5
View File
@@ -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.
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+1 -1
View File
@@ -1,2 +1,2 @@
label: "API"
position: 4
position: 6
+7 -7
View File
@@ -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:206](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L206)
___
### 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:205](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L205)
___
@@ -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:197](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L197)
+44 -11
View File
@@ -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:104](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L104)
## 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:99](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L99)
___
@@ -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:101](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L101)
___
@@ -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:102](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L102)
___
@@ -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:97](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L97)
___
@@ -93,7 +93,7 @@ ___
#### Defined in
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
[indices/BaseIndex.ts:98](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L98)
___
@@ -103,13 +103,46 @@ ___
#### Defined in
[BaseIndex.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L76)
[indices/BaseIndex.ts:100](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L100)
## 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:124](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L124)
___
### 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,4 @@ ___
#### Defined in
[BaseIndex.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L89)
[indices/BaseIndex.ts:117](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L117)
+20 -20
View File
@@ -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:48](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L48)
## 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:39](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L39)
___
@@ -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:43](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L43)
___
@@ -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:44](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L44)
___
@@ -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:46](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L46)
___
@@ -78,7 +78,7 @@ ___
#### Defined in
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L38)
___
@@ -88,7 +88,7 @@ ___
#### Defined in
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L42)
___
@@ -98,7 +98,7 @@ ___
#### Defined in
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L45)
## Accessors
@@ -112,7 +112,7 @@ ___
#### Defined in
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L104)
___
@@ -126,7 +126,7 @@ ___
#### Defined in
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L84)
___
@@ -140,7 +140,7 @@ ___
#### Defined in
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L58)
___
@@ -154,7 +154,7 @@ ___
#### Defined in
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L94)
___
@@ -168,7 +168,7 @@ ___
#### Defined in
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L72)
___
@@ -182,7 +182,7 @@ ___
#### Defined in
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L62)
## Methods
@@ -196,7 +196,7 @@ ___
#### Defined in
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L124)
___
@@ -216,7 +216,7 @@ ___
#### Defined in
[Node.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L54)
[Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L54)
___
@@ -230,7 +230,7 @@ ___
#### Defined in
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L116)
___
@@ -250,7 +250,7 @@ ___
#### Defined in
[Node.ts:55](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L55)
[Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L55)
___
@@ -264,7 +264,7 @@ ___
#### Defined in
[Node.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L52)
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L52)
___
@@ -284,4 +284,4 @@ ___
#### Defined in
[Node.ts:56](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L56)
[Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L56)
@@ -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:68](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L68)
## 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:65](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L65)
___
@@ -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:66](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L66)
@@ -26,7 +26,7 @@ ChatGPTLLMPredictor is a predictor that uses GPT.
#### Defined in
[LLMPredictor.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L26)
[LLMPredictor.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/9d0cadf/packages/core/src/LLMPredictor.ts#L26)
## Properties
@@ -36,7 +36,7 @@ ChatGPTLLMPredictor is a predictor that uses GPT.
#### Defined in
[LLMPredictor.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L24)
[LLMPredictor.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/9d0cadf/packages/core/src/LLMPredictor.ts#L24)
___
@@ -46,7 +46,7 @@ ___
#### Defined in
[LLMPredictor.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L23)
[LLMPredictor.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/9d0cadf/packages/core/src/LLMPredictor.ts#L23)
___
@@ -56,7 +56,7 @@ ___
#### Defined in
[LLMPredictor.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L21)
[LLMPredictor.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/9d0cadf/packages/core/src/LLMPredictor.ts#L21)
___
@@ -66,36 +66,10 @@ ___
#### Defined in
[LLMPredictor.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L22)
[LLMPredictor.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/9d0cadf/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`\>
@@ -110,4 +84,31 @@ ___
#### Defined in
[LLMPredictor.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L45)
[LLMPredictor.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/9d0cadf/packages/core/src/LLMPredictor.ts#L45)
___
### predict
▸ **predict**(`prompt`, `input?`, `parentEvent?`, `logProgress?`): `Promise`<`string`\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `prompt` | `string` \| [`SimplePrompt`](../modules.md#simpleprompt) | `undefined` |
| `input?` | `Record`<`string`, `string`\> | `undefined` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) | `undefined` |
| `logProgress` | `boolean` | `false` |
#### Returns
`Promise`<`string`\>
#### Implementation of
[BaseLLMPredictor](../interfaces/BaseLLMPredictor.md).[predict](../interfaces/BaseLLMPredictor.md#predict)
#### Defined in
[LLMPredictor.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/9d0cadf/packages/core/src/LLMPredictor.ts#L49)
+10 -9
View File
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/ChatEngine.ts#L182)
+28 -28
View File
@@ -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:216](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L216)
## 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:39](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L39)
___
@@ -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:139](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L139)
___
@@ -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:43](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L43)
___
@@ -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:44](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L44)
___
@@ -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:46](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L46)
___
@@ -116,7 +116,7 @@ ___
#### Defined in
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L38)
___
@@ -130,7 +130,7 @@ ___
#### Defined in
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L42)
___
@@ -144,7 +144,7 @@ ___
#### Defined in
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
[Node.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L142)
___
@@ -158,7 +158,7 @@ ___
#### Defined in
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L45)
___
@@ -172,7 +172,7 @@ ___
#### Defined in
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
[Node.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L138)
___
@@ -186,7 +186,7 @@ ___
#### Defined in
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
[Node.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L137)
## Accessors
@@ -204,7 +204,7 @@ TextNode.childNodes
#### Defined in
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L104)
___
@@ -218,7 +218,7 @@ ___
#### Defined in
[Node.ts:225](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L225)
[Node.ts:225](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L225)
___
@@ -236,7 +236,7 @@ TextNode.nextNode
#### Defined in
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L84)
___
@@ -254,7 +254,7 @@ TextNode.nodeId
#### Defined in
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L58)
___
@@ -272,7 +272,7 @@ TextNode.parentNode
#### Defined in
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L94)
___
@@ -290,7 +290,7 @@ TextNode.prevNode
#### Defined in
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L72)
___
@@ -308,7 +308,7 @@ TextNode.sourceNode
#### Defined in
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L62)
## Methods
@@ -326,7 +326,7 @@ TextNode.sourceNode
#### Defined in
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L124)
___
@@ -344,7 +344,7 @@ ___
#### Defined in
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
[Node.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L149)
___
@@ -368,7 +368,7 @@ ___
#### Defined in
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L157)
___
@@ -386,7 +386,7 @@ ___
#### Defined in
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L116)
___
@@ -410,7 +410,7 @@ ___
#### Defined in
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
[Node.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L162)
___
@@ -433,7 +433,7 @@ ___
#### Defined in
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L187)
___
@@ -451,7 +451,7 @@ ___
#### Defined in
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L191)
___
@@ -469,7 +469,7 @@ ___
#### Defined in
[Node.ts:221](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L221)
[Node.ts:221](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L221)
___
@@ -493,4 +493,4 @@ ___
#### Defined in
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L183)
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/storage/FileSystem.ts#L27)
+35 -7
View File
@@ -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:20](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L20)
## Properties
@@ -43,7 +43,7 @@ The underlying structure of each index.
#### Defined in
[BaseIndex.ts:36](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L36)
[indices/BaseIndex.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L42)
___
@@ -57,7 +57,7 @@ ___
#### Defined in
[BaseIndex.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L18)
[indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L17)
___
@@ -67,7 +67,7 @@ ___
#### Defined in
[BaseIndex.ts:35](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L35)
[indices/BaseIndex.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L41)
___
@@ -81,7 +81,17 @@ ___
#### Defined in
[BaseIndex.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L19)
[indices/BaseIndex.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L18)
___
### type
**type**: `IndexStructType` = `IndexStructType.SIMPLE_DICT`
#### Defined in
[indices/BaseIndex.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L43)
## Methods
@@ -102,7 +112,7 @@ ___
#### Defined in
[BaseIndex.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L45)
[indices/BaseIndex.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L52)
___
@@ -120,4 +130,22 @@ ___
#### Defined in
[BaseIndex.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L38)
[indices/BaseIndex.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L45)
___
### toJson
**toJson**(): `Record`<`string`, `unknown`\>
#### Returns
`Record`<`string`, `unknown`\>
#### Overrides
[IndexStruct](IndexStruct.md).[toJson](IndexStruct.md#tojson)
#### Defined in
[indices/BaseIndex.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L57)
+34 -6
View File
@@ -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:20](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L20)
## 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:17](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L17)
___
@@ -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:67](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L67)
___
@@ -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:18](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L18)
___
### type
**type**: `IndexStructType` = `IndexStructType.LIST`
#### Defined in
[indices/BaseIndex.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L68)
## 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:70](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L70)
___
@@ -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:32](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L32)
___
### toJson
**toJson**(): `Record`<`string`, `unknown`\>
#### Returns
`Record`<`string`, `unknown`\>
#### Overrides
[IndexStruct](IndexStruct.md).[toJson](IndexStruct.md#tojson)
#### Defined in
[indices/BaseIndex.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L74)
+28 -28
View File
@@ -32,7 +32,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:144](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L144)
## 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:39](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L39)
___
@@ -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:139](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L139)
___
@@ -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:43](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L43)
___
@@ -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:44](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L44)
___
@@ -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:46](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L46)
___
@@ -116,7 +116,7 @@ ___
#### Defined in
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L38)
___
@@ -126,7 +126,7 @@ ___
#### Defined in
[Node.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L205)
[Node.ts:205](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L205)
___
@@ -140,7 +140,7 @@ ___
#### Defined in
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L42)
___
@@ -154,7 +154,7 @@ ___
#### Defined in
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
[Node.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L142)
___
@@ -168,7 +168,7 @@ ___
#### Defined in
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L45)
___
@@ -182,7 +182,7 @@ ___
#### Defined in
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
[Node.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L138)
___
@@ -196,7 +196,7 @@ ___
#### Defined in
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
[Node.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L137)
## Accessors
@@ -214,7 +214,7 @@ TextNode.childNodes
#### Defined in
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L104)
___
@@ -232,7 +232,7 @@ TextNode.nextNode
#### Defined in
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L84)
___
@@ -250,7 +250,7 @@ TextNode.nodeId
#### Defined in
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L58)
___
@@ -268,7 +268,7 @@ TextNode.parentNode
#### Defined in
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L94)
___
@@ -286,7 +286,7 @@ TextNode.prevNode
#### Defined in
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L72)
___
@@ -304,7 +304,7 @@ TextNode.sourceNode
#### Defined in
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L62)
## Methods
@@ -322,7 +322,7 @@ TextNode.sourceNode
#### Defined in
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L124)
___
@@ -340,7 +340,7 @@ ___
#### Defined in
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
[Node.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L149)
___
@@ -364,7 +364,7 @@ ___
#### Defined in
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L157)
___
@@ -382,7 +382,7 @@ ___
#### Defined in
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L116)
___
@@ -406,7 +406,7 @@ ___
#### Defined in
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
[Node.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L162)
___
@@ -429,7 +429,7 @@ ___
#### Defined in
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L187)
___
@@ -447,7 +447,7 @@ ___
#### Defined in
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L191)
___
@@ -465,7 +465,7 @@ ___
#### Defined in
[Node.ts:207](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L207)
[Node.ts:207](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L207)
___
@@ -489,4 +489,4 @@ ___
#### Defined in
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L183)
+18 -4
View File
@@ -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:20](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L20)
## 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:17](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L17)
___
@@ -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:18](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L18)
## 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:32](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L32)
___
### toJson
**toJson**(): `Record`<`string`, `unknown`\>
#### Returns
`Record`<`string`, `unknown`\>
#### Defined in
[indices/BaseIndex.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L25)
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/QuestionGenerator.ts#L40)
+38 -25
View File
@@ -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:43](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L43)
## 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:99](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L99)
___
@@ -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:101](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L101)
___
@@ -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:102](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L102)
___
@@ -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:97](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L97)
___
@@ -102,7 +102,7 @@ ___
#### Defined in
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
[indices/BaseIndex.ts:98](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L98)
___
@@ -116,7 +116,7 @@ ___
#### Defined in
[BaseIndex.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L76)
[indices/BaseIndex.ts:100](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L100)
## Methods
@@ -136,7 +136,7 @@ ___
#### Defined in
[index/list/ListIndex.ts:140](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L140)
[indices/list/ListIndex.ts:193](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L193)
___
@@ -156,39 +156,51 @@ ___
#### Defined in
[index/list/ListIndex.ts:134](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L134)
[indices/list/ListIndex.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L187)
___
### 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:151](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L151)
___
### 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 +212,7 @@ ___
#### 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:138](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L138)
___
@@ -214,7 +226,7 @@ ___
#### 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:199](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L199)
___
@@ -236,21 +248,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:172](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L172)
___
### 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 +271,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:112](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L112)
___
@@ -278,4 +291,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:47](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L47)
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/indices/list/ListIndexRetriever.ts#L26)
+143
View File
@@ -0,0 +1,143 @@
---
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:179](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L179)
## Properties
### maxTokens
`Optional` **maxTokens**: `number`
#### Defined in
[llm/LLM.ts:176](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L176)
___
### model
**model**: ``"Llama-2-70b-chat"`` \| ``"Llama-2-13b-chat"`` \| ``"Llama-2-7b-chat"``
#### Defined in
[llm/LLM.ts:174](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L174)
___
### replicateSession
• **replicateSession**: `ReplicateSession`
#### Defined in
[llm/LLM.ts:177](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L177)
___
### temperature
• **temperature**: `number`
#### Defined in
[llm/LLM.ts:175](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L175)
## 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:199](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L199)
___
### 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:224](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L224)
___
### mapMessageType
▸ **mapMessageType**(`messageType`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| `messageType` | `MessageType` |
#### Returns
`string`
#### Defined in
[llm/LLM.ts:186](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L186)
+20 -30
View File
@@ -26,7 +26,7 @@ OpenAI LLM implementation
#### Defined in
[LLM.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L76)
[llm/LLM.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L75)
## Properties
@@ -36,7 +36,7 @@ OpenAI LLM implementation
#### Defined in
[LLM.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L74)
[llm/LLM.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L73)
___
@@ -46,7 +46,7 @@ ___
#### Defined in
[LLM.ts:69](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L69)
[llm/LLM.ts:71](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L71)
___
@@ -56,7 +56,7 @@ ___
#### Defined in
[LLM.ts:71](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L71)
[llm/LLM.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L69)
___
@@ -66,7 +66,7 @@ ___
#### Defined in
[LLM.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L66)
[llm/LLM.ts:66](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L66)
___
@@ -76,17 +76,7 @@ ___
#### 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)
[llm/LLM.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L68)
___
@@ -96,7 +86,7 @@ ___
#### Defined in
[LLM.ts:68](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L68)
[llm/LLM.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L72)
___
@@ -106,7 +96,7 @@ ___
#### Defined in
[LLM.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L73)
[llm/LLM.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L70)
___
@@ -116,13 +106,13 @@ ___
#### Defined in
[LLM.ts:67](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L67)
[llm/LLM.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L67)
## 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 +129,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:102](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L102)
___
### 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,23 +156,23 @@ 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:144](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L144)
___
### mapMessageType
▸ **mapMessageType**(`type`): `ChatCompletionRequestMessageRoleEnum`
▸ **mapMessageType**(`messageType`): `ChatCompletionRequestMessageRoleEnum`
#### Parameters
| Name | Type |
| :------ | :------ |
| `type` | `MessageType` |
| `messageType` | `MessageType` |
#### Returns
@@ -190,4 +180,4 @@ ___
#### Defined in
[LLM.ts:88](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L88)
[llm/LLM.ts:85](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L85)
+15 -15
View File
@@ -24,7 +24,7 @@ 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:217](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L217)
## Properties
@@ -34,7 +34,7 @@ custom_edit_url: null
#### Defined in
[Embedding.ts:215](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L215)
[Embedding.ts:215](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L215)
___
@@ -44,13 +44,13 @@ ___
#### Defined in
[Embedding.ts:214](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L214)
[Embedding.ts:214](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L214)
## Methods
### \_aGetOpenAIEmbedding
### getOpenAIEmbedding
`Private` **_aGetOpenAIEmbedding**(`input`): `Promise`<`number`[]\>
`Private` **getOpenAIEmbedding**(`input`): `Promise`<`number`[]\>
#### Parameters
@@ -64,13 +64,13 @@ ___
#### Defined in
[Embedding.ts:224](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L224)
[Embedding.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L224)
___
### aGetQueryEmbedding
### getQueryEmbedding
**aGetQueryEmbedding**(`query`): `Promise`<`number`[]\>
**getQueryEmbedding**(`query`): `Promise`<`number`[]\>
#### Parameters
@@ -84,17 +84,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:240](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L240)
___
### aGetTextEmbedding
### getTextEmbedding
**aGetTextEmbedding**(`text`): `Promise`<`number`[]\>
**getTextEmbedding**(`text`): `Promise`<`number`[]\>
#### Parameters
@@ -108,11 +108,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:236](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L236)
___
@@ -138,4 +138,4 @@ ___
#### Defined in
[Embedding.ts:197](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L197)
[Embedding.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L197)
+44
View File
@@ -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/3e85a90/packages/core/src/readers/PDFReader.ts#L11)
+16 -13
View File
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/ResponseSynthesizer.ts#L149)
+5 -5
View File
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/QueryEngine.ts#L45)
+14 -14
View File
@@ -27,7 +27,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:33](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L33)
## Properties
@@ -37,7 +37,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:26](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L26)
___
@@ -47,7 +47,7 @@ ___
#### Defined in
[TextSplitter.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L25)
[TextSplitter.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L25)
___
@@ -57,7 +57,7 @@ ___
#### Defined in
[TextSplitter.ts:30](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L30)
[TextSplitter.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L30)
___
@@ -67,7 +67,7 @@ ___
#### Defined in
[TextSplitter.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L29)
[TextSplitter.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L29)
___
@@ -77,7 +77,7 @@ ___
#### Defined in
[TextSplitter.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L27)
[TextSplitter.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L27)
___
@@ -87,7 +87,7 @@ ___
#### Defined in
[TextSplitter.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L28)
[TextSplitter.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L28)
## Methods
@@ -108,7 +108,7 @@ ___
#### Defined in
[TextSplitter.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L153)
[TextSplitter.ts:153](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L153)
___
@@ -128,7 +128,7 @@ ___
#### Defined in
[TextSplitter.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L72)
[TextSplitter.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L72)
___
@@ -149,7 +149,7 @@ ___
#### Defined in
[TextSplitter.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L89)
[TextSplitter.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L89)
___
@@ -170,7 +170,7 @@ ___
#### Defined in
[TextSplitter.ts:115](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L115)
[TextSplitter.ts:115](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L115)
___
@@ -191,7 +191,7 @@ ___
#### Defined in
[TextSplitter.ts:128](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L128)
[TextSplitter.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L128)
___
@@ -212,7 +212,7 @@ ___
#### Defined in
[TextSplitter.ts:233](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L233)
[TextSplitter.ts:233](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L233)
___
@@ -233,4 +233,4 @@ ___
#### Defined in
[TextSplitter.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L205)
[TextSplitter.ts:205](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/TextSplitter.ts#L205)
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/readers/SimpleDirectoryReader.ts#L37)
@@ -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:64](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/NodeParser.ts#L64)
## Properties
@@ -41,7 +41,7 @@ SimpleNodeParser is the default NodeParser. It splits documents into TextNodes u
#### Defined in
[NodeParser.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L61)
[NodeParser.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/NodeParser.ts#L61)
___
@@ -51,7 +51,7 @@ ___
#### Defined in
[NodeParser.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L62)
[NodeParser.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/NodeParser.ts#L62)
___
@@ -61,7 +61,7 @@ ___
#### Defined in
[NodeParser.ts:60](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L60)
[NodeParser.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/NodeParser.ts#L60)
## Methods
@@ -87,7 +87,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:95](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/NodeParser.ts#L95)
___
@@ -111,4 +111,4 @@ ___
#### Defined in
[NodeParser.ts:82](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L82)
[NodeParser.ts:82](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/NodeParser.ts#L82)
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/ResponseSynthesizer.ts#L54)
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/QueryEngine.ts#L82)
+1 -1
View File
@@ -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/3e85a90/packages/core/src/readers/SimpleDirectoryReader.ts#L12)
+27 -27
View File
@@ -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:144](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L144)
## 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:39](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L39)
___
@@ -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:139](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L139)
___
@@ -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:43](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L43)
___
@@ -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:44](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L44)
___
@@ -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:46](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L46)
___
@@ -116,7 +116,7 @@ ___
#### Defined in
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L38)
___
@@ -130,7 +130,7 @@ ___
#### Defined in
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L42)
___
@@ -140,7 +140,7 @@ ___
#### Defined in
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
[Node.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L142)
___
@@ -154,7 +154,7 @@ ___
#### Defined in
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L45)
___
@@ -164,7 +164,7 @@ ___
#### Defined in
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
[Node.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L138)
___
@@ -174,7 +174,7 @@ ___
#### Defined in
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
[Node.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L137)
## Accessors
@@ -192,7 +192,7 @@ BaseNode.childNodes
#### Defined in
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L104)
___
@@ -210,7 +210,7 @@ BaseNode.nextNode
#### Defined in
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L84)
___
@@ -228,7 +228,7 @@ BaseNode.nodeId
#### Defined in
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L58)
___
@@ -246,7 +246,7 @@ BaseNode.parentNode
#### Defined in
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L94)
___
@@ -264,7 +264,7 @@ BaseNode.prevNode
#### Defined in
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L72)
___
@@ -282,7 +282,7 @@ BaseNode.sourceNode
#### Defined in
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L62)
## Methods
@@ -300,7 +300,7 @@ BaseNode.sourceNode
#### Defined in
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L124)
___
@@ -314,7 +314,7 @@ ___
#### Defined in
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
[Node.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L149)
___
@@ -338,7 +338,7 @@ ___
#### Defined in
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L157)
___
@@ -356,7 +356,7 @@ ___
#### Defined in
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L116)
___
@@ -380,7 +380,7 @@ ___
#### Defined in
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
[Node.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L162)
___
@@ -399,7 +399,7 @@ ___
#### Defined in
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L187)
___
@@ -413,7 +413,7 @@ ___
#### Defined in
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L191)
___
@@ -431,7 +431,7 @@ ___
#### Defined in
[Node.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L153)
[Node.ts:153](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L153)
___
@@ -455,4 +455,4 @@ ___
#### Defined in
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L183)
+7 -6
View File
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L35)
+88 -70
View File
@@ -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/3e85a90/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:99](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L99)
___
@@ -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:101](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L101)
___
@@ -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:102](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L102)
___
@@ -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:97](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L97)
___
@@ -102,7 +102,7 @@ ___
#### Defined in
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
[indices/BaseIndex.ts:98](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L98)
___
@@ -116,55 +116,118 @@ ___
#### 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/3e85a90/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:215](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L215)
___
### 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:211](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L211)
___
### agetNodeEmbeddingResults
### buildIndexFromNodes
`Static` **agetNodeEmbeddingResults**(`nodes`, `serviceContext`, `logProgress?`): `Promise`<[`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[]\>
`Static` **buildIndexFromNodes**(`nodes`, `serviceContext`, `vectorStore`, `docStore`): `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` |
| `docStore` | `BaseDocumentStore` |
#### Returns
`Promise`<[`IndexDict`](IndexDict.md)\>
#### Defined in
[indices/vectorStore/VectorStoreIndex.ts:151](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L151)
___
### 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:186](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L186)
___
### getNodeEmbeddingResults
`Static` **getNodeEmbeddingResults**(`nodes`, `serviceContext`, `logProgress?`): `Promise`<[`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[]\>
Get the embeddings for nodes.
@@ -182,55 +245,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:123](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L123)
___
@@ -238,6 +253,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 +268,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/3e85a90/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L47)
@@ -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:26](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L26)
___
@@ -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:28](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/list/ListIndex.ts#L28)
+4 -4
View File
@@ -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:19](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L19)
___
@@ -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:20](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L20)
___
@@ -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:21](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L21)
___
@@ -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:22](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L22)
+5 -5
View File
@@ -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:8](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L8)
___
@@ -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:6](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L6)
___
@@ -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:7](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L7)
___
@@ -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:5](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L5)
___
@@ -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:4](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L4)
+4 -4
View File
@@ -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:15](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L15)
___
@@ -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:13](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L13)
___
@@ -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:14](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L14)
___
@@ -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:12](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L12)
+3 -3
View File
@@ -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:10](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L10)
___
@@ -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:11](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L11)
___
@@ -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:12](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L12)
+10 -6
View File
@@ -48,13 +48,15 @@ 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
@@ -63,19 +65,21 @@ Then you can run it using
npx ts-node example.ts
```
## Core concepts:
## Core concepts for getting started:
- [Document](packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
- [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.
- Indexes: indexes store the Nodes and the embeddings of those nodes.
- [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.
- [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.
- [Indices](packages/core/src/indices/): Indices store the Nodes and the embeddings of those nodes. QueryEngines retrieve Nodes from these Indices using embedding similarity.
- [ChatEngine](packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indexes.
- [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.
- [SimplePrompt](packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
- [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.
## Contributing:
+12 -6
View File
@@ -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:86](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L86)
___
@@ -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:88](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L88)
___
@@ -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:89](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L89)
___
@@ -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:84](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L84)
___
@@ -60,7 +66,7 @@ ___
#### Defined in
[BaseIndex.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L61)
[indices/BaseIndex.ts:85](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L85)
___
@@ -70,4 +76,4 @@ ___
#### Defined in
[BaseIndex.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L63)
[indices/BaseIndex.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L87)
@@ -14,9 +14,23 @@ LLM Predictors are an abstraction to predict the response to a prompt.
## Methods
### apredict
### getLlmMetadata
**apredict**(`prompt`, `input?`, `parentEvent?`): `Promise`<`string`\>
**getLlmMetadata**(): `Promise`<`any`\>
#### Returns
`Promise`<`any`\>
#### Defined in
[LLMPredictor.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/9d0cadf/packages/core/src/LLMPredictor.ts#L9)
___
### predict
**predict**(`prompt`, `input?`, `parentEvent?`): `Promise`<`string`\>
#### Parameters
@@ -32,18 +46,4 @@ LLM Predictors are an abstraction to predict the response to a prompt.
#### 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)
[LLMPredictor.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9d0cadf/packages/core/src/LLMPredictor.ts#L10)
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/QuestionGenerator.ts#L23)
+3 -1
View File
@@ -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/3e85a90/packages/core/src/readers/base.ts#L7)
+17 -17
View File
@@ -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/3e85a90/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/3e85a90/packages/core/src/Retriever.ts#L9)
+1 -1
View File
@@ -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/3e85a90/packages/core/src/Tool.ts#L12)
+4 -4
View File
@@ -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/3e85a90/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/3e85a90/packages/core/src/ChatEngine.ts#L30)
+2 -2
View File
@@ -14,7 +14,7 @@ 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:14](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L14)
___
@@ -24,4 +24,4 @@ ___
#### Defined in
[LLM.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L15)
[llm/LLM.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L15)
@@ -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:21](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L21)
___
@@ -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:19](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L19)
___
@@ -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:20](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L20)
+4 -4
View File
@@ -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:14](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L14)
___
@@ -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:17](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L17)
___
@@ -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:16](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L16)
___
@@ -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:15](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L15)
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/storage/FileSystem.ts#L10)
+9 -6
View File
@@ -10,13 +10,14 @@ Unified language model interface
## Implemented by
- [`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 +26,7 @@ Get a chat response from the LLM
| Name | Type |
| :------ | :------ |
| `messages` | [`ChatMessage`](ChatMessage.md)[] |
| `parentEvent?` | [`Event`](Event.md) |
#### Returns
@@ -32,13 +34,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:35](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L35)
___
### acomplete
### complete
**acomplete**(`prompt`): `Promise`<[`ChatResponse`](ChatResponse.md)\>
**complete**(`prompt`, `parentEvent?`): `Promise`<[`ChatResponse`](ChatResponse.md)\>
Get a prompt completion from the LLM
@@ -47,6 +49,7 @@ Get a prompt completion from the LLM
| Name | Type | Description |
| :------ | :------ | :------ |
| `prompt` | `string` | the prompt to complete |
| `parentEvent?` | [`Event`](Event.md) | - |
#### Returns
@@ -54,4 +57,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:41](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L41)
+1 -1
View File
@@ -30,4 +30,4 @@ A node parser generates TextNodes from Documents
#### Defined in
[NodeParser.ts:53](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L53)
[NodeParser.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/NodeParser.ts#L53)
@@ -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:247](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L247)
___
@@ -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:246](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L246)
@@ -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:238](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L238)
___
@@ -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:239](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L239)
@@ -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/3e85a90/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/3e85a90/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:29](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L29)
___
@@ -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:28](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L28)
___
@@ -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:26](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L26)
___
@@ -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:27](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L27)
@@ -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:21](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L21)
___
@@ -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:47](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L47)
___
@@ -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:46](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L46)
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/ServiceContext.ts#L26)
___
@@ -44,7 +44,7 @@ ___
#### 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/3e85a90/packages/core/src/ServiceContext.ts#L22)
___
@@ -54,17 +54,7 @@ ___
#### 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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/storage/StorageContext.ts#L15)
___
@@ -24,7 +24,7 @@ ___
#### 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/3e85a90/packages/core/src/storage/StorageContext.ts#L16)
___
@@ -34,4 +34,4 @@ ___
#### 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/3e85a90/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:21](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L21)
___
@@ -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:40](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L40)
___
@@ -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:41](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L41)
___
@@ -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:42](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L42)
+5 -5
View File
@@ -14,7 +14,7 @@ custom_edit_url: null
#### Defined in
[callbacks/CallbackManager.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L29)
[callbacks/CallbackManager.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L29)
___
@@ -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:27](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L27)
___
@@ -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:25](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L25)
___
@@ -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:28](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L28)
___
@@ -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:26](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L26)
@@ -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/3e85a90/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/3e85a90/packages/core/src/OutputParser.ts#L15)
+2 -2
View File
@@ -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/3e85a90/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/3e85a90/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/3e85a90/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/3e85a90/packages/core/src/Tool.ts#L5)
@@ -0,0 +1,97 @@
---
id: "VectorIndexConstructorProps"
title: "Interface: VectorIndexConstructorProps"
sidebar_label: "VectorIndexConstructorProps"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`BaseIndexInit`](BaseIndexInit.md)<[`IndexDict`](../classes/IndexDict.md)\>
**`VectorIndexConstructorProps`**
## Properties
### docStore
**docStore**: `BaseDocumentStore`
#### Inherited from
[BaseIndexInit](BaseIndexInit.md).[docStore](BaseIndexInit.md#docstore)
#### Defined in
[indices/BaseIndex.ts:86](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L86)
___
### indexStore
`Optional` **indexStore**: `BaseIndexStore`
#### Inherited from
[BaseIndexInit](BaseIndexInit.md).[indexStore](BaseIndexInit.md#indexstore)
#### Defined in
[indices/BaseIndex.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L88)
___
### indexStruct
**indexStruct**: [`IndexDict`](../classes/IndexDict.md)
#### Inherited from
[BaseIndexInit](BaseIndexInit.md).[indexStruct](BaseIndexInit.md#indexstruct)
#### Defined in
[indices/BaseIndex.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L89)
___
### serviceContext
**serviceContext**: [`ServiceContext`](ServiceContext.md)
#### Inherited from
[BaseIndexInit](BaseIndexInit.md).[serviceContext](BaseIndexInit.md#servicecontext)
#### Defined in
[indices/BaseIndex.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L84)
___
### storageContext
**storageContext**: [`StorageContext`](StorageContext.md)
#### Inherited from
[BaseIndexInit](BaseIndexInit.md).[storageContext](BaseIndexInit.md#storagecontext)
#### Defined in
[indices/BaseIndex.ts:85](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L85)
___
### vectorStore
**vectorStore**: `VectorStore`
#### Overrides
[BaseIndexInit](BaseIndexInit.md).[vectorStore](BaseIndexInit.md#vectorstore)
#### Defined in
[indices/BaseIndex.ts:139](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L139)
@@ -8,13 +8,23 @@ custom_edit_url: null
## Properties
### indexId
`Optional` **indexId**: `string`
#### Defined in
[indices/BaseIndex.ts:133](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L133)
___
### indexStruct
`Optional` **indexStruct**: [`IndexDict`](../classes/IndexDict.md)
#### Defined in
[BaseIndex.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L94)
[indices/BaseIndex.ts:132](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L132)
___
@@ -24,7 +34,7 @@ ___
#### Defined in
[BaseIndex.ts:93](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L93)
[indices/BaseIndex.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L131)
___
@@ -34,7 +44,7 @@ ___
#### Defined in
[BaseIndex.ts:95](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L95)
[indices/BaseIndex.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L134)
___
@@ -44,4 +54,4 @@ ___
#### Defined in
[BaseIndex.ts:96](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L96)
[indices/BaseIndex.ts:135](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/indices/BaseIndex.ts#L135)
@@ -24,7 +24,7 @@ custom_edit_url: null
#### Defined in
[storage/FileSystem.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L17)
[storage/FileSystem.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/FileSystem.ts#L17)
___
@@ -44,4 +44,4 @@ ___
#### Defined in
[storage/FileSystem.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L18)
[storage/FileSystem.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/FileSystem.ts#L18)
+100 -65
View File
@@ -20,7 +20,6 @@ custom_edit_url: null
- [BaseIndex](classes/BaseIndex.md)
- [BaseNode](classes/BaseNode.md)
- [CallbackManager](classes/CallbackManager.md)
- [ChatGPTLLMPredictor](classes/ChatGPTLLMPredictor.md)
- [CompactAndRefine](classes/CompactAndRefine.md)
- [CondenseQuestionChatEngine](classes/CondenseQuestionChatEngine.md)
- [ContextChatEngine](classes/ContextChatEngine.md)
@@ -34,14 +33,17 @@ custom_edit_url: null
- [ListIndex](classes/ListIndex.md)
- [ListIndexLLMRetriever](classes/ListIndexLLMRetriever.md)
- [ListIndexRetriever](classes/ListIndexRetriever.md)
- [LlamaDeuce](classes/LlamaDeuce.md)
- [OpenAI](classes/OpenAI.md)
- [OpenAIEmbedding](classes/OpenAIEmbedding.md)
- [PDFReader](classes/PDFReader.md)
- [Refine](classes/Refine.md)
- [Response](classes/Response.md)
- [ResponseSynthesizer](classes/ResponseSynthesizer.md)
- [RetrieverQueryEngine](classes/RetrieverQueryEngine.md)
- [SentenceSplitter](classes/SentenceSplitter.md)
- [SimpleChatEngine](classes/SimpleChatEngine.md)
- [SimpleDirectoryReader](classes/SimpleDirectoryReader.md)
- [SimpleNodeParser](classes/SimpleNodeParser.md)
- [SimpleResponseBuilder](classes/SimpleResponseBuilder.md)
- [SubQuestionOutputParser](classes/SubQuestionOutputParser.md)
@@ -55,7 +57,6 @@ custom_edit_url: null
## Interfaces
- [BaseIndexInit](interfaces/BaseIndexInit.md)
- [BaseLLMPredictor](interfaces/BaseLLMPredictor.md)
- [BaseOutputParser](interfaces/BaseOutputParser.md)
- [BaseQueryEngine](interfaces/BaseQueryEngine.md)
- [BaseQuestionGenerator](interfaces/BaseQuestionGenerator.md)
@@ -82,6 +83,7 @@ custom_edit_url: null
- [StructuredOutput](interfaces/StructuredOutput.md)
- [SubQuestion](interfaces/SubQuestion.md)
- [ToolMetadata](interfaces/ToolMetadata.md)
- [VectorIndexConstructorProps](interfaces/VectorIndexConstructorProps.md)
- [VectorIndexOptions](interfaces/VectorIndexOptions.md)
- [WalkableFileSystem](interfaces/WalkableFileSystem.md)
@@ -93,7 +95,7 @@ custom_edit_url: null
#### Defined in
[storage/FileSystem.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L49)
[storage/FileSystem.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/FileSystem.ts#L49)
___
@@ -103,7 +105,7 @@ ___
#### Defined in
[LLM.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L25)
[llm/LLM.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L25)
___
@@ -113,7 +115,7 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L11)
[callbacks/CallbackManager.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L11)
___
@@ -123,7 +125,7 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L12)
[callbacks/CallbackManager.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/callbacks/CallbackManager.ts#L12)
___
@@ -133,7 +135,7 @@ ___
#### Defined in
[Node.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L32)
[Node.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Node.ts#L32)
___
@@ -152,7 +154,7 @@ ___
#### Defined in
[readers/SimpleDirectoryReader.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/readers/SimpleDirectoryReader.ts#L26)
[readers/SimpleDirectoryReader.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/readers/SimpleDirectoryReader.ts#L26)
___
@@ -180,13 +182,37 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Prompt.ts#L10)
## Variables
### ALL\_AVAILABLE\_MODELS
### ALL\_AVAILABLE\_LLAMADEUCE\_MODELS
• `Const` **ALL\_AVAILABLE\_MODELS**: `Object`
• `Const` **ALL\_AVAILABLE\_LLAMADEUCE\_MODELS**: `Object`
#### Type declaration
| Name | Type |
| :------ | :------ |
| `Llama-2-13b-chat` | { `contextWindow`: `number` = 4096; `replicateApi`: `string` = "a16z-infra/llama13b-v2-chat:df7690f1994d94e96ad9d568eac121aecf50684a0b0963b25a41cc40061269e5" } |
| `Llama-2-13b-chat.contextWindow` | `number` |
| `Llama-2-13b-chat.replicateApi` | `string` |
| `Llama-2-70b-chat` | { `contextWindow`: `number` = 4096; `replicateApi`: `string` = "replicate/llama70b-v2-chat:e951f18578850b652510200860fc4ea62b3b16fac280f83ff32282f87bbd2e48" } |
| `Llama-2-70b-chat.contextWindow` | `number` |
| `Llama-2-70b-chat.replicateApi` | `string` |
| `Llama-2-7b-chat` | { `contextWindow`: `number` = 4096; `replicateApi`: `string` = "a16z-infra/llama7b-v2-chat:4f0a4744c7295c024a1de15e1a63c880d3da035fa1f49bfd344fe076074c8eea" } |
| `Llama-2-7b-chat.contextWindow` | `number` |
| `Llama-2-7b-chat.replicateApi` | `string` |
#### Defined in
[llm/LLM.ts:152](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L152)
___
### ALL\_AVAILABLE\_OPENAI\_MODELS
• `Const` **ALL\_AVAILABLE\_OPENAI\_MODELS**: `Object`
We currently support GPT-3.5 and GPT-4 models
@@ -194,14 +220,18 @@ We currently support GPT-3.5 and GPT-4 models
| Name | Type |
| :------ | :------ |
| `gpt-3.5-turbo` | `number` |
| `gpt-3.5-turbo-16k` | `number` |
| `gpt-4` | `number` |
| `gpt-4-32k` | `number` |
| `gpt-3.5-turbo` | { `contextWindow`: `number` = 4097 } |
| `gpt-3.5-turbo.contextWindow` | `number` |
| `gpt-3.5-turbo-16k` | { `contextWindow`: `number` = 16384 } |
| `gpt-3.5-turbo-16k.contextWindow` | `number` |
| `gpt-4` | { `contextWindow`: `number` = 8192 } |
| `gpt-4.contextWindow` | `number` |
| `gpt-4-32k` | { `contextWindow`: `number` = 32768 } |
| `gpt-4-32k.contextWindow` | `number` |
#### Defined in
[LLM.ts:57](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L57)
[llm/LLM.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L57)
___
@@ -211,7 +241,7 @@ ___
#### Defined in
[constants.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L5)
[constants.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/constants.ts#L5)
___
@@ -221,7 +251,7 @@ ___
#### Defined in
[constants.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L6)
[constants.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/constants.ts#L6)
___
@@ -231,7 +261,7 @@ ___
#### Defined in
[constants.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L4)
[constants.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/constants.ts#L4)
___
@@ -241,7 +271,7 @@ ___
#### Defined in
[storage/constants.ts:1](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L1)
[storage/constants.ts:1](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/constants.ts#L1)
___
@@ -251,7 +281,7 @@ ___
#### Defined in
[constants.ts:1](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L1)
[constants.ts:1](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/constants.ts#L1)
___
@@ -261,7 +291,7 @@ ___
#### Defined in
[storage/constants.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L4)
[storage/constants.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/constants.ts#L4)
___
@@ -271,7 +301,7 @@ ___
#### Defined in
[constants.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L10)
[constants.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/constants.ts#L10)
___
@@ -281,7 +311,7 @@ ___
#### Defined in
[storage/FileSystem.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L62)
[storage/FileSystem.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/FileSystem.ts#L62)
___
@@ -291,7 +321,7 @@ ___
#### Defined in
[storage/constants.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L6)
[storage/constants.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/constants.ts#L6)
___
@@ -301,7 +331,7 @@ ___
#### Defined in
[storage/constants.ts:3](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L3)
[storage/constants.ts:3](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/constants.ts#L3)
___
@@ -311,7 +341,7 @@ ___
#### Defined in
[storage/constants.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L7)
[storage/constants.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/constants.ts#L7)
___
@@ -321,7 +351,7 @@ ___
#### Defined in
[constants.ts:2](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L2)
[constants.ts:2](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/constants.ts#L2)
___
@@ -331,7 +361,7 @@ ___
#### Defined in
[constants.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L11)
[constants.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/constants.ts#L11)
___
@@ -341,7 +371,7 @@ ___
#### Defined in
[storage/constants.ts:2](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L2)
[storage/constants.ts:2](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/constants.ts#L2)
___
@@ -351,7 +381,7 @@ ___
#### Defined in
[constants.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L7)
[constants.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/constants.ts#L7)
___
@@ -361,7 +391,7 @@ ___
#### Defined in
[storage/constants.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L5)
[storage/constants.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/constants.ts#L5)
___
@@ -373,12 +403,14 @@ ___
| Name | Type |
| :------ | :------ |
| `gpt-4` | `number` |
| `gpt-4-32k` | `number` |
| `gpt-4` | { `contextWindow`: `number` = 8192 } |
| `gpt-4.contextWindow` | `number` |
| `gpt-4-32k` | { `contextWindow`: `number` = 32768 } |
| `gpt-4-32k.contextWindow` | `number` |
#### Defined in
[LLM.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L44)
[llm/LLM.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L44)
___
@@ -390,12 +422,14 @@ ___
| Name | Type |
| :------ | :------ |
| `gpt-3.5-turbo` | `number` |
| `gpt-3.5-turbo-16k` | `number` |
| `gpt-3.5-turbo` | { `contextWindow`: `number` = 4097 } |
| `gpt-3.5-turbo.contextWindow` | `number` |
| `gpt-3.5-turbo-16k` | { `contextWindow`: `number` = 16384 } |
| `gpt-3.5-turbo-16k.contextWindow` | `number` |
#### Defined in
[LLM.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L49)
[llm/LLM.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/llm/LLM.ts#L49)
___
@@ -405,7 +439,7 @@ ___
#### Defined in
[GlobalsHelper.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/GlobalsHelper.ts#L42)
[GlobalsHelper.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/GlobalsHelper.ts#L50)
## Functions
@@ -425,7 +459,7 @@ ___
#### Defined in
[Prompt.ts:198](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L198)
[Prompt.ts:198](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Prompt.ts#L198)
___
@@ -449,7 +483,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Prompt.ts#L10)
___
@@ -473,7 +507,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Prompt.ts#L10)
___
@@ -497,7 +531,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Prompt.ts#L10)
___
@@ -521,7 +555,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Prompt.ts#L10)
___
@@ -545,7 +579,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Prompt.ts#L10)
___
@@ -569,7 +603,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Prompt.ts#L10)
___
@@ -593,7 +627,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Prompt.ts#L10)
___
@@ -619,7 +653,7 @@ A promise that resolves to true if the file exists, false otherwise.
#### Defined in
[storage/FileSystem.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L74)
[storage/FileSystem.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/FileSystem.ts#L74)
___
@@ -633,7 +667,7 @@ ___
#### Defined in
[storage/FileSystem.ts:51](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L51)
[storage/FileSystem.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/FileSystem.ts#L51)
___
@@ -656,27 +690,28 @@ ___
#### Defined in
[NodeParser.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L15)
[NodeParser.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/NodeParser.ts#L15)
___
### getResponseBuilder
▸ **getResponseBuilder**(`serviceContext?`): [`SimpleResponseBuilder`](classes/SimpleResponseBuilder.md)
▸ **getResponseBuilder**(`serviceContext`, `responseMode?`): `BaseResponseBuilder`
#### Parameters
| Name | Type |
| :------ | :------ |
| `serviceContext?` | [`ServiceContext`](interfaces/ServiceContext.md) |
| `serviceContext` | [`ServiceContext`](interfaces/ServiceContext.md) |
| `responseMode?` | `ResponseMode` |
#### Returns
[`SimpleResponseBuilder`](classes/SimpleResponseBuilder.md)
`BaseResponseBuilder`
#### Defined in
[ResponseSynthesizer.ts:212](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L212)
[ResponseSynthesizer.ts:262](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/ResponseSynthesizer.ts#L262)
___
@@ -697,7 +732,7 @@ ___
#### Defined in
[NodeParser.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L5)
[NodeParser.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/NodeParser.ts#L5)
___
@@ -723,7 +758,7 @@ Get the top K embeddings from a list of embeddings ordered by similarity to the
#### Defined in
[Embedding.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L77)
[Embedding.ts:77](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L77)
___
@@ -747,7 +782,7 @@ ___
#### Defined in
[Embedding.ts:119](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L119)
[Embedding.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L119)
___
@@ -773,7 +808,7 @@ ___
#### Defined in
[Embedding.ts:131](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L131)
[Embedding.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L131)
___
@@ -793,7 +828,7 @@ ___
#### Defined in
[Prompt.ts:300](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L300)
[Prompt.ts:300](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Prompt.ts#L300)
___
@@ -813,7 +848,7 @@ ___
#### Defined in
[ServiceContext.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L32)
[ServiceContext.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/ServiceContext.ts#L30)
___
@@ -836,13 +871,13 @@ ___
| :------ | :------ |
| `callbackManager` | [`CallbackManager`](classes/CallbackManager.md) |
| `embedModel` | [`BaseEmbedding`](classes/BaseEmbedding.md) |
| `llmPredictor` | [`BaseLLMPredictor`](interfaces/BaseLLMPredictor.md) |
| `llm` | [`LLM`](interfaces/LLM.md) |
| `nodeParser` | [`NodeParser`](interfaces/NodeParser.md) |
| `promptHelper` | `PromptHelper` |
#### Defined in
[ServiceContext.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L52)
[ServiceContext.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/ServiceContext.ts#L48)
___
@@ -868,7 +903,7 @@ similartiy score with higher numbers meaning the two embeddings are more similar
#### Defined in
[Embedding.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L22)
[Embedding.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/Embedding.ts#L22)
___
@@ -888,7 +923,7 @@ ___
#### Defined in
[storage/StorageContext.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L28)
[storage/StorageContext.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/StorageContext.ts#L28)
___
@@ -911,4 +946,4 @@ Recursively traverses a directory and yields all the paths to the files in it.
#### Defined in
[storage/FileSystem.ts:91](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L91)
[storage/FileSystem.ts:91](https://github.com/run-llama/LlamaIndexTS/blob/3e85a90/packages/core/src/storage/FileSystem.ts#L91)
+59 -16
View File
@@ -1,33 +1,76 @@
---
sidebar_position: 2
sidebar_position: 3
---
# Concepts
# High-Level Concepts
## High Level API
LlamaIndex.TS helps you build LLM-powered applications (e.g. Q&A, chatbot) over custom data.
- Document: A document represents a text file, PDF file or other contiguous piece of data.
In this high-level concepts guide, you will learn:
- Node: 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.
* how an LLM can answer questions using your own data.
* key concepts and modules in LlamaIndex.TS for composing your own query pipeline.
- Indexes: indexes store the Nodes and the embeddings of those nodes.
## Answering Questions Across Your Data
- QueryEngine: 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.
LlamaIndex uses a two stage method when using an LLM with your data:
- ChatEngine: A ChatEngine helps you build a chatbot that will interact with your Indexes.
1) **indexing stage**: preparing a knowledge base, and
2) **querying stage**: retrieving relevant context from the knowledge to assist the LLM in responding to a question
## Low Level API
![](./_static/concepts/rag.jpg)
- SimplePrompt: A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
This process is also known as Retrieval Augmented Generation (RAG).
- LLM: The LLM class is a unified interface over a large language model provider such as OpenAI GPT-4, Anthropic Claude, or Meta LLaMA. You can subclass it to write a connector to your own large language model.
LlamaIndex.TS provides the essential toolkit for making both steps super easy.
- Embedding: An embedding is represented as a vector of floating point numbers. OpenAI's text-embedding-ada-002 is our default embedding model and each embedding it generates consists of 1,536 floating point numbers. Another popular embedding model is BERT which uses 768 floating point numbers to represent each Node. We provide a number of utilities to work with embeddings including 3 similarity calculation options and Maximum Marginal Relevance
Let's explore each stage in detail.
- Reader/Loader: A reader or loader is something that takes in a document in the real world and transforms into a Document class that can then be used in your Index and queries. We currently support plain text files and PDFs with many many more to come.
### Indexing Stage
LlamaIndex.TS help you prepare the knowledge base with a suite of data connectors and indexes.
- TextSplitter: Text splitting strategies are incredibly important to the overall efficacy of the embedding search. Currently, while we do have a default, there's no one size fits all solution. Depending on the source documents, you may want to use different splitting sizes and strategies. Currently we support spliltting by fixed size, splitting by fixed size with overlapping sections, splitting by sentence, and splitting by paragraph.
![](./_static/concepts/indexing.jpg)
- Retriever: The Retriever is what actually chooses the Nodes to retrieve from the index. Here, you may wish to try retrieving more or fewer Nodes per query, changing your similarity function, or creating your own retriever for each individual use case in your application. For example, you may wish to have a separate retriever for code content vs. text content.
[**Data Loaders**](./modules/high_level/data_loader.md):
A data connector (i.e. `Reader`) ingest data from different data sources and data formats into a simple `Document` representation (text and simple metadata).
- Storage: At some point you're going to want to store your indexes, data and vectors instead of re-running the embedding models every time. IndexStore, DocStore, VectorStore, and KVStore are abstractions that let you do that. Combined, they form the StorageContext. Currently, we allow you to persist your embeddings in files on the filesystem (or a virtual in memory file system), but we are also actively adding integrations to Vector Databases.
[**Documents / Nodes**](./modules/high_level/documents_and_nodes.md): A `Document` is a generic container around any data source - for instance, a PDF, an API output, or retrieved data from a database. A `Node` is the atomic unit of data in LlamaIndex and represents a "chunk" of a source `Document`. It's a rich representation that includes metadata and relationships (to other nodes) to enable accurate and expressive retrieval operations.
[**Data Indexes**](./modules/high_level/data_index.md):
Once you've ingested your data, LlamaIndex helps you index data into a format that's easy to retrieve.
Under the hood, LlamaIndex parses the raw documents into intermediate representations, calculates vector embeddings, and stores your data in-memory or to disk.
### Querying Stage
In the querying stage, the query pipeline retrieves the most relevant context given a user query,
and pass that to the LLM (along with the query) to synthesize a response.
This gives the LLM up-to-date knowledge that is not in its original training data,
(also reducing hallucination).
The key challenge in the querying stage is retrieval, orchestration, and reasoning over (potentially many) knowledge bases.
LlamaIndex provides composable modules that help you build and integrate RAG pipelines for Q&A (query engine), chatbot (chat engine), or as part of an agent.
These building blocks can be customized to reflect ranking preferences, as well as composed to reason over multiple knowledge bases in a structured way.
![](./_static/concepts/querying.jpg)
#### Building Blocks
[**Retrievers**](./modules/low_level/retriever.md):
A retriever defines how to efficiently retrieve relevant context from a knowledge base (i.e. index) when given a query.
The specific retrieval logic differs for difference indices, the most popular being dense retrieval against a vector index.
[**Response Synthesizers**](./modules/low_level/response_synthesizer.md):
A response synthesizer generates a response from an LLM, using a user query and a given set of retrieved text chunks.
#### Pipelines
[**Query Engines**](./modules/high_level/query_engine.md):
A query engine is an end-to-end pipeline that allow you to ask question over your data.
It takes in a natural language query, and returns a response, along with reference context retrieved and passed to the LLM.
[**Chat Engines**](./modules/high_level/chat_engine.md):
A chat engine is an end-to-end pipeline for having a conversation with your data
(multiple back-and-forth instead of a single question & answer).
+43
View File
@@ -0,0 +1,43 @@
---
sidebar_position: 4
---
# End to End Examples
We include several end-to-end examples using LlamaIndex.TS in the repository
## [Chat Engine](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/chatEngine.ts)
Read a file and chat about it with the LLM.
## [List Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/listIndex.ts)
Create a list index and query it. This example also use the `LLMRetriever`, which will use the LLM to select the best nodes to use when generating answer.
## [Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/vectorIndex.ts)
Create a vector index and query it. The vector index will use embeddings to fetch the top k most relevant nodes. By default, the top k is 2.
## [Save / Load an Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/storageContext.ts)
Create and load a vector index. Persistance to disk in LlamaIndex.TS happens automatically once a storage context object is created.
## [Customized Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/vectorIndexCustomize.ts)
Create a vector index and query it, while also configuring the the `LLM`, the `ServiceContext`, and the `similarity_top_k`.
## [OpenAI LLM](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/openai.ts)
Create an OpenAI LLM and directly use it for chat.
## [Llama2 DeuceLLM](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/llamadeuce.ts)
Create a Llama-2 LLM and directly use it for chat.
## [SubQuestionQueryEngine](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/subquestion.ts)
Uses the `SubQuestionQueryEngine`, which breaks complex queries into multiple questions, and then aggreates a response across the answers to all sub-questions.
## [Low Level Modules](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/lowlevel.ts)
This example uses several low-level components, which removes the need for an actual query engine. These components can be used anywhere, in any application, or customized and sub-classed to meet your own needs.
+1 -1
View File
@@ -1,5 +1,5 @@
---
sidebar_position: 0
sidebar_position: 1
---
# Installation and Setup
+56
View File
@@ -0,0 +1,56 @@
---
sidebar_position: 0
slug: /
---
# What is LlamaIndex.TS?
LlamaIndex.TS is a data framework for LLM applications to ingest, structure, and access private or domain-specific data. While a python package is also available (see [here](https://gpt-index.readthedocs.io/en/latest/)), LlamaIndex.TS offers core features in a simple package, optimized for usage with TypeScript.
## 🚀 Why LlamaIndex.TS?
At their core, LLMs offer a natural language interface between humans and inferred data. Widely available models come pre-trained on huge amounts of publicly available data, from Wikipedia and mailing lists to textbooks and source code.
Applications built on top of LLMs often require augmenting these models with private or domain-specific data. Unfortunately, that data can be distributed across siloed applications and data stores. It's behind APIs, in SQL databases, or trapped in PDFs and slide decks.
That's where **LlamaIndex.TS** comes in.
## 🦙 How can LlamaIndex.TS help?
LlamaIndex.TS provides the following tools:
- **Data loading** ingest your existing `txt` and `pdf` data directly
- **Data indexes** structure your data in intermediate representations that are easy and performant for LLMs to consume.
- **Engines** provide natural language access to your data. For example:
- Query engines are powerful retrieval interfaces for knowledge-augmented output.
- Chat engines are conversational interfaces for multi-message, "back and forth" interactions with your data.
## 👨‍👩‍👧‍👦 Who is LlamaIndex for?
LlamaIndex.TS provides a core set of tools, essential for anyone building LLM apps with JavaScript and TypeScript.
Our high-level API allows beginner users to use LlamaIndex.TS to ingest and query their data.
For more complex applications, our lower-level APIs allow advanced users to customize and extend any module—data connectors, indices, retrievers, and query engines, to fit their needs.
## Getting Started
`npm install llamaindex`
Our documentation includes [Installation Instructions](./installation.md) and a [Starter Tutorial](./starter.md) to build your first application.
Once you're up and running, [High-Level Concepts](./concepts.md) has an overview of LlamaIndex's modular architecture. For more hands-on practical examples, look through our [End-to-End Tutorials](./end_to_end.md).
## 🗺️ Ecosystem
To download or contribute, find LlamaIndex on:
- Github: https://github.com/run-llama/LlamaIndexTS
- NPM: https://www.npmjs.com/package/llamaindex
## Community
Need help? Have a feature suggestion? Join the LlamaIndex community:
- Twitter: https://twitter.com/llama_index
- Discord https://discord.gg/dGcwcsnxhU
+3
View File
@@ -0,0 +1,3 @@
label: "Modules"
collapsed: false
position: 5
@@ -0,0 +1 @@
label: High-Level Modules
@@ -0,0 +1,20 @@
---
sidebar_position: 4
---
# ChatEngine
The chat engine is a quick and simple way to chat with the data in your index.
```typescript
const retriever = index.asRetriever();
const chatEngine = new ContextChatEngine({ retriever });
// start chatting
const response = await chatEngine.chat(query);
```
## Api References
- [ContextChatEngine](../../api/classes/ContextChatEngine.md)
- [CondenseQuestionChatEngine](../../api/classes/ContextChatEngine.md)
@@ -0,0 +1,28 @@
---
sidebar_position: 2
---
# Index
An index is the basic container and organization for your data. LlamaIndex.TS supports two indexes:
- `ListIndex` - will send every `Node` in the index to the LLM in order to generate a response
- `VectorStoreIndex` - will send the top-k `Node`s to the LLM when generating a response. The default top-k is 2.
```typescript
import {
Document,
VectorStoreIndex,
} from "llamaindex";
const document = new Document({ text: "test" });
const index = await VectorStoreIndex.fromDocuments(
[document]
);
```
## API Reference
- [ListIndex](../../api/classes/ListIndex.md)
- [VectorStoreIndex](../../api/classes/VectorStoreIndex.md)
@@ -0,0 +1,17 @@
---
sidebar_position: 1
---
# Reader / Loader
LlamaIndex.TS supports easy loading of files from folders using the `SimpleDirectoryReader` class. Currently, `.txt` and `.pdf` files are supported, with more planned in the future!
```typescript
import { SimpleDirectoryReader } from "llamaindex";
documents = new SimpleDirectoryReader().loadData("./data");
```
## API Reference
- [SimpleDirectoryReader](../../api/classes/SimpleDirectoryReader.md)
@@ -0,0 +1,18 @@
---
sidebar_position: 0
---
# Documents and Nodes
`Document`s and `Node`s are the basic building blocks of any index. While the API for these objects is similar, `Document` objects represent entire files, while `Node`s are smaller pieces of that original document, that are suitable for an LLM and Q&A.
```typescript
import { Document } from "llamaindex";
document = new Document({ text: "text", metadata: { "key": "val" }});
```
## API Reference
- [Document](../../api/classes/Document.md)
- [TextNode](../../api/classes/TextNode.md)
@@ -2,7 +2,14 @@
sidebar_position: 3
---
# Advanced Features
# QueryEngine
A query engine wraps a `Retriever` and a `ResponseSynthesizer` into a pipeline, that will use the query string to fetech nodes and then send them to the LLM to generate a response.
```typescript
const queryEngine = index.asQueryEngine();
const response = await queryEngine.query("query string");
```
## Sub Question Query Engine
@@ -10,7 +17,7 @@ The basic concept of the Sub Question Query Engine is that it splits a single qu
### Getting Started
The easiest way to start trying the Sub Question Query Engine is running the subquestion.ts file in apps/simple.
The easiest way to start trying the Sub Question Query Engine is running the subquestion.ts file in [apps/simple](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/subquestion.ts).
```bash
npx ts-node subquestion.ts
@@ -21,3 +28,9 @@ npx ts-node subquestion.ts
SubQuestionQueryEngine is implemented with Tools. The basic idea of Tools is that they are executable options for the large language model. In this case, our SubQuestionQueryEngine relies on QueryEngineTool, which as you guessed it is a tool to run queries on a QueryEngine. This allows us to give the model an option to query different documents for different questions for example. You could also imagine that the SubQuestionQueryEngine could use a Tool that searches for something on the web or gets an answer using Wolfram Alpha.
You can learn more about Tools by taking a look at the LlamaIndex Python documentation https://gpt-index.readthedocs.io/en/latest/core_modules/agent_modules/tools/root.html
## API Reference
- [RetrieverQueryEngine](../../api/classes/RetrieverQueryEngine.md)
- [SubQuestionQueryEngine](../../api/classes/SubQuestionQueryEngine.md)
- [QueryEngineTool](../../api/interfaces/QueryEngineTool.md)
+31
View File
@@ -0,0 +1,31 @@
# Core Modules
LlamaIndex.TS offers several core modules, seperated into high-level modules for quickly getting started, and low-level modules for customizing key components as you need.
## High-Level Modules
- [**Document**](./high_level/documents_and_nodes.md): A document represents a text file, PDF file or other contiguous piece of data.
- [**Node**](./high_level/documents_and_nodes.md): 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.
- [**Reader/Loader**](./high_level/data_loader.md): A reader or loader is something that takes in a document in the real world and transforms into a Document class that can then be used in your Index and queries. We currently support plain text files and PDFs with many many more to come.
- [**Indexes**](./high_level/data_index.md): indexes store the Nodes and the embeddings of those nodes.
- [**QueryEngine**](./high_level/query_engine.md): 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**](./high_level/chat_engine.md): A ChatEngine helps you build a chatbot that will interact with your Indexes.
## Low Level Module
- [**LLM**](./low_level/llm.md): The LLM class is a unified interface over a large language model provider such as OpenAI GPT-4, Anthropic Claude, or Meta LLaMA. You can subclass it to write a connector to your own large language model.
- [**Embedding**](./low_level/embedding.md): An embedding is represented as a vector of floating point numbers. OpenAI's text-embedding-ada-002 is our default embedding model and each embedding it generates consists of 1,536 floating point numbers. Another popular embedding model is BERT which uses 768 floating point numbers to represent each Node. We provide a number of utilities to work with embeddings including 3 similarity calculation options and Maximum Marginal Relevance
- [**TextSplitter/NodeParser**](./low_level/node_parser.md): Text splitting strategies are incredibly important to the overall efficacy of the embedding search. Currently, while we do have a default, there's no one size fits all solution. Depending on the source documents, you may want to use different splitting sizes and strategies. Currently we support spliltting by fixed size, splitting by fixed size with overlapping sections, splitting by sentence, and splitting by paragraph. The text splitter is used by the NodeParser when splitting `Document`s into `Node`s.
- [**Retriever**](./low_level/retriever.md): The Retriever is what actually chooses the Nodes to retrieve from the index. Here, you may wish to try retrieving more or fewer Nodes per query, changing your similarity function, or creating your own retriever for each individual use case in your application. For example, you may wish to have a separate retriever for code content vs. text content.
- [**ResponseSynthesizer**](./low_level/response_synthesizer.md): The ResponseSynthesizer is responsible for taking a query string, and using a list of `Node`s to generate a response. This can take many forms, like iterating over all the context and refining an answer, or building a tree of summaries and returning the root summary.
- [**Storage**](./low_level/storage.md): At some point you're going to want to store your indexes, data and vectors instead of re-running the embedding models every time. IndexStore, DocStore, VectorStore, and KVStore are abstractions that let you do that. Combined, they form the StorageContext. Currently, we allow you to persist your embeddings in files on the filesystem (or a virtual in memory file system), but we are also actively adding integrations to Vector Databases.
@@ -0,0 +1 @@
label: Low-Level Modules
@@ -0,0 +1,22 @@
---
sidebar_position: 1
---
# Embedding
The embedding model in LlamaIndex is responsible for creating numerical representations of text. By default, LlamaIndex will use the `text-embedding-ada-002` model from OpenAI.
This can be explicitly set in the `ServiceContext` object.
```typescript
import { OpenAIEmbedding, serviceContextFromDefaults } from "llamaindex";
const openaiEmbeds = new OpenAIEmbedding();
const serviceContext = serviceContextFromDefaults({ embedModel: openaiEmbeds });
```
## API Reference
- [OpenAIEmbedding](../../api/classes/OpenAIEmbedding.md)
- [ServiceContext](../../api/interfaces/ServiceContext.md)

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