mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-16 07:14:29 -04:00
Compare commits
81 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ea5038e4b7 | |||
| b012207764 | |||
| 9fa6d4a8a7 | |||
| c77dd18f2d | |||
| bb7c0d7deb | |||
| 80d3fc9482 | |||
| 79a721226d | |||
| ed36d41024 | |||
| 9a15c8ece0 | |||
| 9c5220ce75 | |||
| 8c67635041 | |||
| fc7f35141a | |||
| fc65e6b97d | |||
| 629bd3239a | |||
| 31c99baf1c | |||
| b2810777ef | |||
| 805d6fb81d | |||
| 9c566b0530 | |||
| daa14b8a5f | |||
| ed4fe4ac22 | |||
| b76562061e | |||
| baa91540cf | |||
| a594e22d2d | |||
| 91615a6602 | |||
| 43144ae782 | |||
| e927fc1800 | |||
| a08e904834 | |||
| 90429ab63d | |||
| abaab0caca | |||
| bc5c2e5c7b | |||
| c3e4b37414 | |||
| 63906798e8 | |||
| d7c2453c7d | |||
| 6a61ea46bf | |||
| 5a765aa1d6 | |||
| 3cab956f94 | |||
| c65d671ddb | |||
| 985f3b52bb | |||
| 4636a763b0 | |||
| f4ddf89b51 | |||
| ca9410f702 | |||
| 50c0b04017 | |||
| 41464386d6 | |||
| a07a94108d | |||
| a7cc8020db | |||
| 761fa4d836 | |||
| ade5587a15 | |||
| 2db8a8c2e3 | |||
| 3ad826e358 | |||
| 87925a36e6 | |||
| fc6ff47fd2 | |||
| 17b22f4673 | |||
| b033d0fbe9 | |||
| 122ab88fa5 | |||
| 73c188761f | |||
| 0fbf7b4ace | |||
| f9394ebb22 | |||
| 05f2f388d9 | |||
| d489a2120f | |||
| 8954a80e04 | |||
| f264211550 | |||
| 4d990d012c | |||
| 2683121ee1 | |||
| 08c2d4620f | |||
| 643ad626cd | |||
| 2619d4175d | |||
| b00821dbe9 | |||
| b0a742c3e6 | |||
| 9d0cadfc5f | |||
| 4ea034082b | |||
| 5cd54e2f98 | |||
| 8b7a94f8c5 | |||
| 44ab4d838f | |||
| 372ac1a24b | |||
| 09f02ff9b3 | |||
| 9dc30f5385 | |||
| 5871959c15 | |||
| e7206a7dea | |||
| 5cdab4e311 | |||
| ee293da4f6 | |||
| 5a50ed2dfe |
@@ -0,0 +1,8 @@
|
||||
# Changesets
|
||||
|
||||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
||||
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
||||
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
||||
|
||||
We have a quick list of common questions to get you started engaging with this project in
|
||||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"fixed": [],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": []
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Disabling PDF loader for now to fix module import
|
||||
@@ -36,3 +36,5 @@ yarn-error.log*
|
||||
.vercel
|
||||
|
||||
storage/
|
||||
|
||||
dist/
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
label: "API"
|
||||
position: 4
|
||||
position: 6
|
||||
@@ -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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L206)
|
||||
[Embedding.ts:206](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L205)
|
||||
[Embedding.ts:205](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L205)
|
||||
|
||||
___
|
||||
|
||||
@@ -78,4 +78,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L197)
|
||||
[Embedding.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L197)
|
||||
|
||||
@@ -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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L80)
|
||||
[indices/BaseIndex.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L75)
|
||||
[indices/BaseIndex.ts:99](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L99)
|
||||
|
||||
___
|
||||
|
||||
@@ -63,7 +63,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:77](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L77)
|
||||
[indices/BaseIndex.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L101)
|
||||
|
||||
___
|
||||
|
||||
@@ -73,7 +73,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L78)
|
||||
[indices/BaseIndex.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L102)
|
||||
|
||||
___
|
||||
|
||||
@@ -83,7 +83,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L73)
|
||||
[indices/BaseIndex.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -93,7 +93,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L74)
|
||||
[indices/BaseIndex.ts:98](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L98)
|
||||
|
||||
___
|
||||
|
||||
@@ -103,13 +103,46 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L76)
|
||||
[indices/BaseIndex.ts:100](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L89)
|
||||
[indices/BaseIndex.ts:117](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L117)
|
||||
|
||||
@@ -28,7 +28,7 @@ Generic abstract class for retrievable nodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L48)
|
||||
[Node.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,7 +48,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
@@ -58,7 +58,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
@@ -68,7 +68,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -78,7 +78,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
@@ -98,7 +98,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L45)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -112,7 +112,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L104)
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
@@ -126,7 +126,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L84)
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
@@ -140,7 +140,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +154,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
@@ -168,7 +168,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
@@ -182,7 +182,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -196,7 +196,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
@@ -216,7 +216,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L54)
|
||||
[Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L54)
|
||||
|
||||
___
|
||||
|
||||
@@ -230,7 +230,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
@@ -250,7 +250,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L55)
|
||||
[Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L55)
|
||||
|
||||
___
|
||||
|
||||
@@ -264,7 +264,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L52)
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -284,4 +284,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L56)
|
||||
[Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L68)
|
||||
[callbacks/CallbackManager.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L65)
|
||||
[callbacks/CallbackManager.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
@@ -80,4 +80,4 @@ CallbackManagerMethods.onRetrieve
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:66](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L66)
|
||||
[callbacks/CallbackManager.ts:66](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLMPredictor.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### getLlmMetadata
|
||||
|
||||
▸ **getLlmMetadata**(): `Promise`<`void`\>
|
||||
@@ -110,4 +84,31 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/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)
|
||||
|
||||
@@ -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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L66)
|
||||
[ResponseSynthesizer.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L64)
|
||||
[ResponseSynthesizer.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ResponseSynthesizer.ts#L76)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,7 +62,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L62)
|
||||
[ResponseSynthesizer.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ResponseSynthesizer.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,13 +76,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L63)
|
||||
[ResponseSynthesizer.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L152)
|
||||
[ResponseSynthesizer.ts:181](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L75)
|
||||
[ChatEngine.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L71)
|
||||
[ChatEngine.ts:71](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ChatEngine.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
@@ -57,7 +57,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L73)
|
||||
[ChatEngine.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ChatEngine.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
@@ -67,7 +67,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L70)
|
||||
[ChatEngine.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ChatEngine.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
@@ -77,13 +77,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L72)
|
||||
[ChatEngine.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L104)
|
||||
[ChatEngine.ts:100](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L89)
|
||||
[ChatEngine.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L123)
|
||||
[ChatEngine.ts:118](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L138)
|
||||
[ChatEngine.ts:133](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L136)
|
||||
[ChatEngine.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ChatEngine.ts#L131)
|
||||
|
||||
___
|
||||
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:135](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L135)
|
||||
[ChatEngine.ts:130](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ChatEngine.ts#L130)
|
||||
|
||||
___
|
||||
|
||||
@@ -61,13 +61,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L134)
|
||||
[ChatEngine.ts:129](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
### chatRepl
|
||||
|
||||
▸ **chatRepl**(): `void`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L149)
|
||||
[ChatEngine.ts:144](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L191)
|
||||
[ChatEngine.ts:182](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ChatEngine.ts#L182)
|
||||
|
||||
@@ -32,7 +32,7 @@ A document is just a special text node with a docId.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:216](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L216)
|
||||
[Node.ts:216](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:139](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L139)
|
||||
[Node.ts:139](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L139)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,7 +116,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
@@ -130,7 +130,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
@@ -144,7 +144,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L142)
|
||||
[Node.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L142)
|
||||
|
||||
___
|
||||
|
||||
@@ -158,7 +158,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -172,7 +172,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L138)
|
||||
[Node.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L138)
|
||||
|
||||
___
|
||||
|
||||
@@ -186,7 +186,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L137)
|
||||
[Node.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L137)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -204,7 +204,7 @@ TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L104)
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
@@ -218,7 +218,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:225](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L225)
|
||||
[Node.ts:225](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L225)
|
||||
|
||||
___
|
||||
|
||||
@@ -236,7 +236,7 @@ TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L84)
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
@@ -254,7 +254,7 @@ TextNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
@@ -272,7 +272,7 @@ TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
@@ -290,7 +290,7 @@ TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
@@ -308,7 +308,7 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -326,7 +326,7 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
@@ -344,7 +344,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L149)
|
||||
[Node.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L149)
|
||||
|
||||
___
|
||||
|
||||
@@ -368,7 +368,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L157)
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L157)
|
||||
|
||||
___
|
||||
|
||||
@@ -386,7 +386,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
@@ -410,7 +410,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L162)
|
||||
[Node.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L162)
|
||||
|
||||
___
|
||||
|
||||
@@ -433,7 +433,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L187)
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
@@ -451,7 +451,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L191)
|
||||
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L191)
|
||||
|
||||
___
|
||||
|
||||
@@ -469,7 +469,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:221](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L221)
|
||||
[Node.ts:221](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L221)
|
||||
|
||||
___
|
||||
|
||||
@@ -493,4 +493,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L183)
|
||||
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L25)
|
||||
[storage/FileSystem.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L38)
|
||||
[storage/FileSystem.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
@@ -75,7 +75,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L44)
|
||||
[storage/FileSystem.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
@@ -100,7 +100,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L31)
|
||||
[storage/FileSystem.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
@@ -126,4 +126,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L27)
|
||||
[storage/FileSystem.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L27)
|
||||
|
||||
@@ -33,7 +33,7 @@ The underlying structure of each index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L21)
|
||||
[indices/BaseIndex.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L36)
|
||||
[indices/BaseIndex.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
@@ -57,7 +57,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L18)
|
||||
[indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
@@ -67,7 +67,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L35)
|
||||
[indices/BaseIndex.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
@@ -81,7 +81,17 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L19)
|
||||
[indices/BaseIndex.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L43)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -102,7 +112,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L45)
|
||||
[indices/BaseIndex.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -120,4 +130,22 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L38)
|
||||
[indices/BaseIndex.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L57)
|
||||
|
||||
@@ -33,7 +33,7 @@ The underlying structure of each index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L21)
|
||||
[indices/BaseIndex.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L18)
|
||||
[indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
@@ -57,7 +57,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L52)
|
||||
[indices/BaseIndex.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L67)
|
||||
|
||||
___
|
||||
|
||||
@@ -71,7 +71,17 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L19)
|
||||
[indices/BaseIndex.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L68)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -91,7 +101,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L54)
|
||||
[indices/BaseIndex.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
@@ -109,4 +119,22 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L26)
|
||||
[indices/BaseIndex.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L74)
|
||||
|
||||
@@ -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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L144)
|
||||
[Node.ts:144](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:139](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L139)
|
||||
[Node.ts:139](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L139)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,7 +116,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
@@ -126,7 +126,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:205](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L205)
|
||||
[Node.ts:205](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L205)
|
||||
|
||||
___
|
||||
|
||||
@@ -140,7 +140,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +154,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L142)
|
||||
[Node.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L142)
|
||||
|
||||
___
|
||||
|
||||
@@ -168,7 +168,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -182,7 +182,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L138)
|
||||
[Node.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L138)
|
||||
|
||||
___
|
||||
|
||||
@@ -196,7 +196,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L137)
|
||||
[Node.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L137)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -214,7 +214,7 @@ TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L104)
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
@@ -232,7 +232,7 @@ TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L84)
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
@@ -250,7 +250,7 @@ TextNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
@@ -268,7 +268,7 @@ TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
@@ -286,7 +286,7 @@ TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
@@ -304,7 +304,7 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -322,7 +322,7 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
@@ -340,7 +340,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L149)
|
||||
[Node.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L149)
|
||||
|
||||
___
|
||||
|
||||
@@ -364,7 +364,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L157)
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L157)
|
||||
|
||||
___
|
||||
|
||||
@@ -382,7 +382,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
@@ -406,7 +406,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L162)
|
||||
[Node.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L162)
|
||||
|
||||
___
|
||||
|
||||
@@ -429,7 +429,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L187)
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
@@ -447,7 +447,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L191)
|
||||
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L191)
|
||||
|
||||
___
|
||||
|
||||
@@ -465,7 +465,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:207](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L207)
|
||||
[Node.ts:207](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L207)
|
||||
|
||||
___
|
||||
|
||||
@@ -489,4 +489,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L183)
|
||||
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L183)
|
||||
|
||||
@@ -31,7 +31,7 @@ The underlying structure of each index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L21)
|
||||
[indices/BaseIndex.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L18)
|
||||
[indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L19)
|
||||
[indices/BaseIndex.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L18)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -65,4 +65,18 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L26)
|
||||
[indices/BaseIndex.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QuestionGenerator.ts#L34)
|
||||
[QuestionGenerator.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QuestionGenerator.ts#L30)
|
||||
[QuestionGenerator.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QuestionGenerator.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/QuestionGenerator.ts#L32)
|
||||
[QuestionGenerator.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QuestionGenerator.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,13 +56,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/QuestionGenerator.ts#L31)
|
||||
[QuestionGenerator.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QuestionGenerator.ts#L40)
|
||||
[QuestionGenerator.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QuestionGenerator.ts#L40)
|
||||
|
||||
@@ -32,7 +32,7 @@ A ListIndex keeps nodes in a sequential list structure
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L37)
|
||||
[indices/list/ListIndex.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L75)
|
||||
[indices/BaseIndex.ts:99](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L99)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:77](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L77)
|
||||
[indices/BaseIndex.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L101)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L78)
|
||||
[indices/BaseIndex.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L102)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L73)
|
||||
[indices/BaseIndex.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L74)
|
||||
[indices/BaseIndex.ts:98](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L98)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,7 +116,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L76)
|
||||
[indices/BaseIndex.ts:100](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L100)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -136,7 +136,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:140](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L140)
|
||||
[indices/list/ListIndex.ts:193](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndex.ts#L193)
|
||||
|
||||
___
|
||||
|
||||
@@ -156,39 +156,51 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L134)
|
||||
[indices/list/ListIndex.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L113)
|
||||
[indices/list/ListIndex.ts:151](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L100)
|
||||
[indices/list/ListIndex.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndex.ts#L138)
|
||||
|
||||
___
|
||||
|
||||
@@ -214,7 +226,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L146)
|
||||
[indices/list/ListIndex.ts:199](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndex.ts#L199)
|
||||
|
||||
___
|
||||
|
||||
@@ -236,21 +248,22 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L119)
|
||||
[indices/list/ListIndex.ts:172](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L77)
|
||||
[indices/list/ListIndex.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndex.ts#L112)
|
||||
|
||||
___
|
||||
|
||||
@@ -278,4 +291,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L41)
|
||||
[indices/list/ListIndex.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L67)
|
||||
[indices/list/ListIndexRetriever.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L62)
|
||||
[indices/list/ListIndexRetriever.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndexRetriever.ts#L59)
|
||||
|
||||
___
|
||||
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L61)
|
||||
[indices/list/ListIndexRetriever.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndexRetriever.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
@@ -61,7 +61,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L63)
|
||||
[indices/list/ListIndexRetriever.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndexRetriever.ts#L60)
|
||||
|
||||
___
|
||||
|
||||
@@ -71,7 +71,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L60)
|
||||
[indices/list/ListIndexRetriever.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndexRetriever.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
@@ -81,7 +81,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L64)
|
||||
[indices/list/ListIndexRetriever.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndexRetriever.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
@@ -91,35 +91,10 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L65)
|
||||
[indices/list/ListIndexRetriever.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L134)
|
||||
[indices/list/ListIndexRetriever.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L22)
|
||||
[indices/list/ListIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L20)
|
||||
[indices/list/ListIndexRetriever.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndexRetriever.ts#L51)
|
||||
[indices/list/ListIndexRetriever.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/packages/core/src/indices/list/ListIndexRetriever.ts#L26)
|
||||
|
||||
@@ -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/9fa6d4a/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/9fa6d4a/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/9fa6d4a/packages/core/src/llm/LLM.ts#L174)
|
||||
|
||||
___
|
||||
|
||||
### replicateSession
|
||||
|
||||
• **replicateSession**: `ReplicateSession`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:177](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L177)
|
||||
|
||||
___
|
||||
|
||||
### temperature
|
||||
|
||||
• **temperature**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:175](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/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/9fa6d4a/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/9fa6d4a/packages/core/src/llm/LLM.ts#L186)
|
||||
@@ -26,7 +26,7 @@ OpenAI LLM implementation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L76)
|
||||
[llm/LLM.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L74)
|
||||
[llm/LLM.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L69)
|
||||
[llm/LLM.ts:71](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:71](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L71)
|
||||
[llm/LLM.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L69)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:66](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L66)
|
||||
[llm/LLM.ts:66](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L66)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,17 +76,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
### openAIKey
|
||||
|
||||
• **openAIKey**: ``null`` \| `string` = `null`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L72)
|
||||
[llm/LLM.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,7 +86,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L68)
|
||||
[llm/LLM.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
@@ -106,7 +96,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L73)
|
||||
[llm/LLM.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,13 +106,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L67)
|
||||
[llm/LLM.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L103)
|
||||
[llm/LLM.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L145)
|
||||
[llm/LLM.ts:144](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L88)
|
||||
[llm/LLM.ts:85](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L85)
|
||||
|
||||
@@ -24,7 +24,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:217](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L217)
|
||||
[Embedding.ts:217](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L215)
|
||||
[Embedding.ts:215](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L215)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,13 +44,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:214](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L214)
|
||||
[Embedding.ts:214](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L224)
|
||||
[Embedding.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L240)
|
||||
[Embedding.ts:240](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L236)
|
||||
[Embedding.ts:236](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L236)
|
||||
|
||||
___
|
||||
|
||||
@@ -138,4 +138,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L197)
|
||||
[Embedding.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L197)
|
||||
|
||||
@@ -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:12](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/readers/PDFReader.ts#L12)
|
||||
@@ -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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L66)
|
||||
[ResponseSynthesizer.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L64)
|
||||
[ResponseSynthesizer.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ResponseSynthesizer.ts#L76)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L62)
|
||||
[ResponseSynthesizer.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ResponseSynthesizer.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,13 +64,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L63)
|
||||
[ResponseSynthesizer.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L76)
|
||||
[ResponseSynthesizer.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L95)
|
||||
[ResponseSynthesizer.ts:113](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L123)
|
||||
[ResponseSynthesizer.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ResponseSynthesizer.ts#L149)
|
||||
|
||||
@@ -23,7 +23,7 @@ Respone is the output of a LLM
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Response.ts#L10)
|
||||
[Response.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Response.ts#L7)
|
||||
[Response.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Response.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
@@ -43,7 +43,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Response.ts#L8)
|
||||
[Response.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Response.ts#L8)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -57,7 +57,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Response.ts#L15)
|
||||
[Response.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Response.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -71,4 +71,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Response.ts#L19)
|
||||
[Response.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L225)
|
||||
[ResponseSynthesizer.ts:285](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L222)
|
||||
[ResponseSynthesizer.ts:282](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L223)
|
||||
[ResponseSynthesizer.ts:283](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L237)
|
||||
[ResponseSynthesizer.ts:297](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L29)
|
||||
[QueryEngine.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L27)
|
||||
[QueryEngine.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QueryEngine.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,13 +47,15 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L26)
|
||||
[QueryEngine.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L36)
|
||||
[QueryEngine.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QueryEngine.ts#L45)
|
||||
|
||||
@@ -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/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L33)
|
||||
[TextSplitter.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L26)
|
||||
[TextSplitter.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
@@ -47,7 +47,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L25)
|
||||
[TextSplitter.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
@@ -57,7 +57,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L30)
|
||||
[TextSplitter.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -67,7 +67,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L29)
|
||||
[TextSplitter.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
@@ -77,7 +77,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L27)
|
||||
[TextSplitter.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -87,7 +87,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L28)
|
||||
[TextSplitter.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L28)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -108,7 +108,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:153](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L153)
|
||||
[TextSplitter.ts:153](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
@@ -128,7 +128,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L72)
|
||||
[TextSplitter.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
@@ -149,7 +149,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L89)
|
||||
[TextSplitter.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L89)
|
||||
|
||||
___
|
||||
|
||||
@@ -170,7 +170,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:115](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L115)
|
||||
[TextSplitter.ts:115](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L115)
|
||||
|
||||
___
|
||||
|
||||
@@ -191,7 +191,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L128)
|
||||
[TextSplitter.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
@@ -212,7 +212,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:233](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L233)
|
||||
[TextSplitter.ts:233](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/TextSplitter.ts#L233)
|
||||
|
||||
___
|
||||
|
||||
@@ -233,4 +233,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:205](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/TextSplitter.ts#L205)
|
||||
[TextSplitter.ts:205](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L40)
|
||||
[ChatEngine.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L37)
|
||||
[ChatEngine.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ChatEngine.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,13 +46,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L38)
|
||||
[ChatEngine.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L45)
|
||||
[ChatEngine.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L54)
|
||||
[ChatEngine.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/NodeParser.ts#L64)
|
||||
[NodeParser.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/NodeParser.ts#L61)
|
||||
[NodeParser.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/NodeParser.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/NodeParser.ts#L62)
|
||||
[NodeParser.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/NodeParser.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
@@ -61,7 +61,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/NodeParser.ts#L60)
|
||||
[NodeParser.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/NodeParser.ts#L95)
|
||||
[NodeParser.ts:95](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/NodeParser.ts#L95)
|
||||
|
||||
___
|
||||
|
||||
@@ -111,4 +111,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:82](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/NodeParser.ts#L82)
|
||||
[NodeParser.ts:82](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L37)
|
||||
[ResponseSynthesizer.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L34)
|
||||
[ResponseSynthesizer.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ResponseSynthesizer.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,13 +46,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L35)
|
||||
[ResponseSynthesizer.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L43)
|
||||
[ResponseSynthesizer.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/OutputParser.ts#L97)
|
||||
[OutputParser.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/OutputParser.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,4 +64,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[OutputParser.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/OutputParser.ts#L89)
|
||||
[OutputParser.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L56)
|
||||
[QueryEngine.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L54)
|
||||
[QueryEngine.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QueryEngine.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
@@ -49,7 +49,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L53)
|
||||
[QueryEngine.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QueryEngine.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
@@ -59,7 +59,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L52)
|
||||
[QueryEngine.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QueryEngine.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
@@ -69,13 +69,15 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L51)
|
||||
[QueryEngine.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L97)
|
||||
[QueryEngine.ts:106](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L128)
|
||||
[QueryEngine.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QueryEngine.ts#L134)
|
||||
|
||||
___
|
||||
|
||||
@@ -138,4 +140,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L73)
|
||||
[QueryEngine.ts:82](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QueryEngine.ts#L82)
|
||||
|
||||
@@ -41,4 +41,4 @@ Read a .txt file
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/SimpleDirectoryReader.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/readers/SimpleDirectoryReader.ts#L12)
|
||||
[readers/SimpleDirectoryReader.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/readers/SimpleDirectoryReader.ts#L12)
|
||||
|
||||
@@ -36,7 +36,7 @@ TextNode is the default node type for text. Most common node type in LlamaIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:144](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L144)
|
||||
[Node.ts:144](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:139](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L139)
|
||||
[Node.ts:139](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L139)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,7 +116,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
@@ -130,7 +130,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
@@ -140,7 +140,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L142)
|
||||
[Node.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L142)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +154,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -164,7 +164,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L138)
|
||||
[Node.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L138)
|
||||
|
||||
___
|
||||
|
||||
@@ -174,7 +174,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L137)
|
||||
[Node.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L137)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -192,7 +192,7 @@ BaseNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L104)
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
@@ -210,7 +210,7 @@ BaseNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L84)
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
@@ -228,7 +228,7 @@ BaseNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
@@ -246,7 +246,7 @@ BaseNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
@@ -264,7 +264,7 @@ BaseNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
@@ -282,7 +282,7 @@ BaseNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -300,7 +300,7 @@ BaseNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
@@ -314,7 +314,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L149)
|
||||
[Node.ts:149](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L149)
|
||||
|
||||
___
|
||||
|
||||
@@ -338,7 +338,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L157)
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L157)
|
||||
|
||||
___
|
||||
|
||||
@@ -356,7 +356,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
@@ -380,7 +380,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L162)
|
||||
[Node.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L162)
|
||||
|
||||
___
|
||||
|
||||
@@ -399,7 +399,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L187)
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
@@ -413,7 +413,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L191)
|
||||
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L191)
|
||||
|
||||
___
|
||||
|
||||
@@ -431,7 +431,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:153](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L153)
|
||||
[Node.ts:153](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
@@ -455,4 +455,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L183)
|
||||
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L183)
|
||||
|
||||
@@ -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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L177)
|
||||
[ResponseSynthesizer.ts:212](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L175)
|
||||
[ResponseSynthesizer.ts:210](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L181)
|
||||
[ResponseSynthesizer.ts:216](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Retriever.ts#L28)
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Retriever.ts#L24)
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,45 +48,20 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Retriever.ts#L26)
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Retriever.ts#L25)
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Retriever.ts#L70)
|
||||
[indices/vectorStore/VectorIndexRetriever.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L35)
|
||||
|
||||
@@ -24,7 +24,7 @@ The VectorStoreIndex, an index that stores the nodes only according to their vec
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init` | `VectorIndexConstructorProps` |
|
||||
| `init` | [`VectorIndexConstructorProps`](../interfaces/VectorIndexConstructorProps.md) |
|
||||
|
||||
#### Overrides
|
||||
|
||||
@@ -32,7 +32,7 @@ The VectorStoreIndex, an index that stores the nodes only according to their vec
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:109](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L109)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L75)
|
||||
[indices/BaseIndex.ts:99](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L99)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:77](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L77)
|
||||
[indices/BaseIndex.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L101)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L78)
|
||||
[indices/BaseIndex.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L102)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L73)
|
||||
[indices/BaseIndex.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L74)
|
||||
[indices/BaseIndex.ts:98](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L98)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,55 +116,118 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L107)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L252)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:215](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L242)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:211](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/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/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L214)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L114)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L21)
|
||||
[indices/list/ListIndex.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndex.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,4 +24,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/index/list/ListIndex.ts#L23)
|
||||
[indices/list/ListIndex.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/list/ListIndex.ts#L28)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L19)
|
||||
[Node.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L19)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L20)
|
||||
[Node.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L21)
|
||||
[Node.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L22)
|
||||
[Node.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L22)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L8)
|
||||
[Node.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L6)
|
||||
[Node.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L6)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L7)
|
||||
[Node.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L5)
|
||||
[Node.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L5)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,4 +54,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L4)
|
||||
[Node.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L4)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L15)
|
||||
[Node.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L13)
|
||||
[Node.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L14)
|
||||
[Node.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L12)
|
||||
[Node.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L12)
|
||||
|
||||
@@ -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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L10)
|
||||
[Embedding.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
@@ -27,7 +27,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L11)
|
||||
[Embedding.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
@@ -37,4 +37,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L12)
|
||||
[Embedding.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L12)
|
||||
|
||||
@@ -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,18 +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.
|
||||
|
||||
- [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 +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/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L62)
|
||||
[indices/BaseIndex.ts:86](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L86)
|
||||
|
||||
___
|
||||
|
||||
@@ -30,7 +36,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L64)
|
||||
[indices/BaseIndex.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
@@ -40,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L65)
|
||||
[indices/BaseIndex.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L89)
|
||||
|
||||
___
|
||||
|
||||
@@ -50,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L60)
|
||||
[indices/BaseIndex.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L61)
|
||||
[indices/BaseIndex.ts:85](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L85)
|
||||
|
||||
___
|
||||
|
||||
@@ -70,4 +76,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L63)
|
||||
[indices/BaseIndex.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLMPredictor.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### getLlmMetadata
|
||||
|
||||
▸ **getLlmMetadata**(): `Promise`<`any`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/OutputParser.ts#L8)
|
||||
[OutputParser.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/OutputParser.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,4 +56,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[OutputParser.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/OutputParser.ts#L7)
|
||||
[OutputParser.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QueryEngine.ts#L19)
|
||||
[QueryEngine.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/QuestionGenerator.ts#L23)
|
||||
[QuestionGenerator.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QuestionGenerator.ts#L23)
|
||||
|
||||
@@ -10,6 +10,8 @@ A reader takes imports data into Document objects.
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`PDFReader`](../classes/PDFReader.md)
|
||||
- [`SimpleDirectoryReader`](../classes/SimpleDirectoryReader.md)
|
||||
- [`TextFileReader`](../classes/TextFileReader.md)
|
||||
|
||||
## Methods
|
||||
@@ -30,4 +32,4 @@ A reader takes imports data into Document objects.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/base.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/readers/base.ts#L7)
|
||||
[readers/base.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/readers/base.ts#L7)
|
||||
|
||||
@@ -16,9 +16,23 @@ Retrievers retrieve the nodes that most closely match our query in similarity.
|
||||
|
||||
## Methods
|
||||
|
||||
### aretrieve
|
||||
### getServiceContext
|
||||
|
||||
▸ **aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](NodeWithScore.md)[]\>
|
||||
▸ **getServiceContext**(): [`ServiceContext`](ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Retriever.ts#L17)
|
||||
[Retriever.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Retriever.ts#L9)
|
||||
|
||||
@@ -22,4 +22,4 @@ Simple Tool interface. Likely to change.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Tool.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Tool.ts#L12)
|
||||
[Tool.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Tool.ts#L12)
|
||||
|
||||
@@ -16,9 +16,9 @@ A ChatEngine is used to handle back and forth chats between the application and
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
### chat
|
||||
|
||||
▸ **achat**(`message`, `chatHistory?`): `Promise`<[`Response`](../classes/Response.md)\>
|
||||
▸ **chat**(`message`, `chatHistory?`): `Promise`<[`Response`](../classes/Response.md)\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
@@ -35,7 +35,7 @@ Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L25)
|
||||
[ChatEngine.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ChatEngine.ts#L30)
|
||||
[ChatEngine.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ChatEngine.ts#L30)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L14)
|
||||
[llm/LLM.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,4 +24,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L15)
|
||||
[llm/LLM.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L21)
|
||||
[llm/LLM.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L19)
|
||||
[llm/LLM.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L19)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,4 +34,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L20)
|
||||
[llm/LLM.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L20)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L14)
|
||||
[callbacks/CallbackManager.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L17)
|
||||
[callbacks/CallbackManager.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L16)
|
||||
[callbacks/CallbackManager.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L15)
|
||||
[callbacks/CallbackManager.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L15)
|
||||
|
||||
@@ -33,7 +33,7 @@ browsers.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L12)
|
||||
[storage/FileSystem.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L13)
|
||||
[storage/FileSystem.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
@@ -75,7 +75,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L11)
|
||||
[storage/FileSystem.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
@@ -97,4 +97,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L10)
|
||||
[storage/FileSystem.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L10)
|
||||
|
||||
@@ -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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L35)
|
||||
[llm/LLM.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L41)
|
||||
[llm/LLM.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L41)
|
||||
|
||||
@@ -30,4 +30,4 @@ A node parser generates TextNodes from Documents
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/NodeParser.ts#L53)
|
||||
[NodeParser.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L247)
|
||||
[Node.ts:247](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L247)
|
||||
|
||||
___
|
||||
|
||||
@@ -26,4 +26,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:246](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L246)
|
||||
[Node.ts:246](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L238)
|
||||
[Node.ts:238](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L238)
|
||||
|
||||
___
|
||||
|
||||
@@ -26,4 +26,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:239](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L239)
|
||||
[Node.ts:239](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Tool.ts#L12)
|
||||
[Tool.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Tool.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
@@ -36,4 +36,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Tool.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Tool.ts#L19)
|
||||
[Tool.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Tool.ts#L19)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L29)
|
||||
[Node.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L28)
|
||||
[Node.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L26)
|
||||
[Node.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L27)
|
||||
[Node.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L27)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseCallbackResponse.event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L21)
|
||||
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L47)
|
||||
[callbacks/CallbackManager.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L47)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L46)
|
||||
[callbacks/CallbackManager.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L16)
|
||||
[ServiceContext.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ServiceContext.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -26,17 +26,17 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L14)
|
||||
[ServiceContext.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L12)
|
||||
[ServiceContext.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ServiceContext.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L15)
|
||||
[ServiceContext.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ServiceContext.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,4 +56,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L13)
|
||||
[ServiceContext.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ServiceContext.ts#L12)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L26)
|
||||
[ServiceContext.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ServiceContext.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L29)
|
||||
[ServiceContext.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ServiceContext.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L28)
|
||||
[ServiceContext.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ServiceContext.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L24)
|
||||
[ServiceContext.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ServiceContext.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,17 +54,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### llmPredictor
|
||||
|
||||
• `Optional` **llmPredictor**: [`BaseLLMPredictor`](BaseLLMPredictor.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L21)
|
||||
[ServiceContext.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ServiceContext.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +64,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L25)
|
||||
[ServiceContext.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ServiceContext.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
@@ -84,4 +74,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L23)
|
||||
[ServiceContext.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/StorageContext.ts#L15)
|
||||
[storage/StorageContext.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/StorageContext.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/StorageContext.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/StorageContext.ts#L16)
|
||||
[storage/StorageContext.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/StorageContext.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,4 +34,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/StorageContext.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/StorageContext.ts#L17)
|
||||
[storage/StorageContext.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/StorageContext.ts#L17)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseCallbackResponse.event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L21)
|
||||
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L40)
|
||||
[callbacks/CallbackManager.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L41)
|
||||
[callbacks/CallbackManager.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,4 +54,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L42)
|
||||
[callbacks/CallbackManager.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L42)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L29)
|
||||
[callbacks/CallbackManager.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L27)
|
||||
[callbacks/CallbackManager.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L25)
|
||||
[callbacks/CallbackManager.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L28)
|
||||
[callbacks/CallbackManager.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,4 +54,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L26)
|
||||
[callbacks/CallbackManager.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/OutputParser.ts#L16)
|
||||
[OutputParser.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/OutputParser.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -32,4 +32,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[OutputParser.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/OutputParser.ts#L15)
|
||||
[OutputParser.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/OutputParser.ts#L15)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/QuestionGenerator.ts#L15)
|
||||
[QuestionGenerator.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QuestionGenerator.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,4 +24,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/QuestionGenerator.ts#L16)
|
||||
[QuestionGenerator.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/QuestionGenerator.ts#L16)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Tool.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Tool.ts#L4)
|
||||
[Tool.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Tool.ts#L4)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,4 +24,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Tool.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Tool.ts#L5)
|
||||
[Tool.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/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/9fa6d4a/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/9fa6d4a/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/9fa6d4a/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/9fa6d4a/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/9fa6d4a/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/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L133)
|
||||
|
||||
___
|
||||
|
||||
### indexStruct
|
||||
|
||||
• `Optional` **indexStruct**: [`IndexDict`](../classes/IndexDict.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L94)
|
||||
[indices/BaseIndex.ts:132](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L132)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:93](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L93)
|
||||
[indices/BaseIndex.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L131)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:95](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L95)
|
||||
[indices/BaseIndex.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/indices/BaseIndex.ts#L134)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +54,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:96](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/BaseIndex.ts#L96)
|
||||
[indices/BaseIndex.ts:135](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L17)
|
||||
[storage/FileSystem.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L18)
|
||||
[storage/FileSystem.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L18)
|
||||
|
||||
+100
-65
@@ -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/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L49)
|
||||
[storage/FileSystem.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -103,7 +105,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L25)
|
||||
[llm/LLM.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
@@ -113,7 +115,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L11)
|
||||
[callbacks/CallbackManager.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
@@ -123,7 +125,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/callbacks/CallbackManager.ts#L12)
|
||||
[callbacks/CallbackManager.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/callbacks/CallbackManager.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
@@ -133,7 +135,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Node.ts#L32)
|
||||
[Node.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Node.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
@@ -152,7 +154,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/SimpleDirectoryReader.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/readers/SimpleDirectoryReader.ts#L26)
|
||||
[readers/SimpleDirectoryReader.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Prompt.ts#L10)
|
||||
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L57)
|
||||
[llm/LLM.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
@@ -211,7 +241,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/constants.ts#L5)
|
||||
[constants.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/constants.ts#L5)
|
||||
|
||||
___
|
||||
|
||||
@@ -221,7 +251,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/constants.ts#L6)
|
||||
[constants.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/constants.ts#L6)
|
||||
|
||||
___
|
||||
|
||||
@@ -231,7 +261,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/constants.ts#L4)
|
||||
[constants.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/constants.ts#L4)
|
||||
|
||||
___
|
||||
|
||||
@@ -241,7 +271,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:1](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/constants.ts#L1)
|
||||
[storage/constants.ts:1](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/constants.ts#L1)
|
||||
|
||||
___
|
||||
|
||||
@@ -251,7 +281,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:1](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/constants.ts#L1)
|
||||
[constants.ts:1](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/constants.ts#L1)
|
||||
|
||||
___
|
||||
|
||||
@@ -261,7 +291,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/constants.ts#L4)
|
||||
[storage/constants.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/constants.ts#L4)
|
||||
|
||||
___
|
||||
|
||||
@@ -271,7 +301,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/constants.ts#L10)
|
||||
[constants.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/constants.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
@@ -281,7 +311,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L62)
|
||||
[storage/FileSystem.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
@@ -291,7 +321,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/constants.ts#L6)
|
||||
[storage/constants.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/constants.ts#L6)
|
||||
|
||||
___
|
||||
|
||||
@@ -301,7 +331,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:3](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/constants.ts#L3)
|
||||
[storage/constants.ts:3](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/constants.ts#L3)
|
||||
|
||||
___
|
||||
|
||||
@@ -311,7 +341,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/constants.ts#L7)
|
||||
[storage/constants.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/constants.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
@@ -321,7 +351,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:2](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/constants.ts#L2)
|
||||
[constants.ts:2](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/constants.ts#L2)
|
||||
|
||||
___
|
||||
|
||||
@@ -331,7 +361,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/constants.ts#L11)
|
||||
[constants.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/constants.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
@@ -341,7 +371,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:2](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/constants.ts#L2)
|
||||
[storage/constants.ts:2](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/constants.ts#L2)
|
||||
|
||||
___
|
||||
|
||||
@@ -351,7 +381,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/constants.ts#L7)
|
||||
[constants.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/constants.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
@@ -361,7 +391,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/constants.ts#L5)
|
||||
[storage/constants.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L44)
|
||||
[llm/LLM.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/LLM.ts#L49)
|
||||
[llm/LLM.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/llm/LLM.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -405,7 +439,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[GlobalsHelper.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/GlobalsHelper.ts#L42)
|
||||
[GlobalsHelper.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/GlobalsHelper.ts#L42)
|
||||
|
||||
## Functions
|
||||
|
||||
@@ -425,7 +459,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:198](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Prompt.ts#L198)
|
||||
[Prompt.ts:198](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Prompt.ts#L10)
|
||||
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Prompt.ts#L10)
|
||||
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Prompt.ts#L10)
|
||||
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Prompt.ts#L10)
|
||||
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Prompt.ts#L10)
|
||||
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Prompt.ts#L10)
|
||||
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Prompt.ts#L10)
|
||||
[Prompt.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L74)
|
||||
[storage/FileSystem.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
@@ -633,7 +667,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L51)
|
||||
[storage/FileSystem.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -656,27 +690,28 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/NodeParser.ts#L15)
|
||||
[NodeParser.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ResponseSynthesizer.ts#L212)
|
||||
[ResponseSynthesizer.ts:262](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/ResponseSynthesizer.ts#L262)
|
||||
|
||||
___
|
||||
|
||||
@@ -697,7 +732,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/NodeParser.ts#L5)
|
||||
[NodeParser.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L77)
|
||||
[Embedding.ts:77](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
@@ -747,7 +782,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L119)
|
||||
[Embedding.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L119)
|
||||
|
||||
___
|
||||
|
||||
@@ -773,7 +808,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L131)
|
||||
[Embedding.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L131)
|
||||
|
||||
___
|
||||
|
||||
@@ -793,7 +828,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:300](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/Prompt.ts#L300)
|
||||
[Prompt.ts:300](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Prompt.ts#L300)
|
||||
|
||||
___
|
||||
|
||||
@@ -813,7 +848,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L32)
|
||||
[ServiceContext.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/ServiceContext.ts#L52)
|
||||
[ServiceContext.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/Embedding.ts#L22)
|
||||
[Embedding.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/Embedding.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
@@ -888,7 +923,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/StorageContext.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/StorageContext.ts#L28)
|
||||
[storage/StorageContext.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/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/LlamaIndexTS/blob/d73ac8e/packages/core/src/storage/FileSystem.ts#L91)
|
||||
[storage/FileSystem.ts:91](https://github.com/run-llama/LlamaIndexTS/blob/9fa6d4a/packages/core/src/storage/FileSystem.ts#L91)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# End to End Examples
|
||||
@@ -18,10 +18,22 @@ Create a list index and query it. This example also use the `LLMRetriever`, whic
|
||||
|
||||
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.
|
||||
|
||||
@@ -37,15 +37,14 @@ For more complex applications, our lower-level APIs allow advanced users to cust
|
||||
|
||||
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](LINK TO EXAMPLES FOLDER).
|
||||
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/jerryjliu/llama_index
|
||||
- LlamaIndex (NPM): LINK TO NPM PACKAGE
|
||||
- LlamaIndex (Python): https://pypi.org/project/llama-index/.
|
||||
- Github: https://github.com/run-llama/LlamaIndexTS
|
||||
- NPM: https://www.npmjs.com/package/llamaindex
|
||||
|
||||
## Community
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
label: "Modules"
|
||||
collapsed: false
|
||||
position: 4
|
||||
position: 5
|
||||
@@ -8,7 +8,7 @@ A query engine wraps a `Retriever` and a `ResponseSynthesizer` into a pipeline,
|
||||
|
||||
```typescript
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = queryEngine.query("query string");
|
||||
const response = await queryEngine.query("query string");
|
||||
```
|
||||
|
||||
## Sub Question Query Engine
|
||||
|
||||
@@ -12,7 +12,7 @@ LlamaIndex.TS offers several core modules, seperated into high-level modules for
|
||||
|
||||
- [**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.
|
||||
- [**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.
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ The embedding model in LlamaIndex is responsible for creating numerical represen
|
||||
This can be explicitly set in the `ServiceContext` object.
|
||||
|
||||
```typescript
|
||||
import { OpenAIEmbedding, ServiceContext } from "llamaindex";
|
||||
import { OpenAIEmbedding, serviceContextFromDefaults } from "llamaindex";
|
||||
|
||||
const openaiEmbeds = new OpenAIEmbedding();
|
||||
|
||||
const serviceContext = new ServiceContext({ embedModel: openaiEmbeds });
|
||||
const serviceContext = serviceContextFromDefaults({ embedModel: openaiEmbeds });
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
@@ -9,14 +9,14 @@ The LLM is responsible for reading text and generating natural language response
|
||||
The LLM can be explicitly set in the `ServiceContext` object.
|
||||
|
||||
```typescript
|
||||
import { ChatGPTLLMPredictor, ServiceContext } from "llamaindex";
|
||||
import { OpenAI, serviceContextFromDefaults } from "llamaindex";
|
||||
|
||||
const openaiLLM = new ChatGPTLLMPredictor({ model: "gpt-3.5-turbo" });
|
||||
const openaiLLM = new OpenAI({ model: "gpt-3.5-turbo", temperature: 0 });
|
||||
|
||||
const serviceContext = new ServiceContext({ llmPredictor: openaiLLM });
|
||||
const serviceContext = serviceContextFromDefaults({ llm: openaiLLM });
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
- [ChatGPTLLMPredictor](../../api/classes/ChatGPTLLMPredictor.md)
|
||||
- [OpenAI](../../api/classes/OpenAI.md)
|
||||
- [ServiceContext](../../api/interfaces/ServiceContext.md)
|
||||
@@ -40,7 +40,7 @@ const nodesWithScore: NodeWithScore[] = [
|
||||
},
|
||||
];
|
||||
|
||||
const response = await responseSynthesizer.asynthesize(
|
||||
const response = await responseSynthesizer.synthesize(
|
||||
"What age am I?",
|
||||
nodesWithScore
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ const retriever = vector_index.asRetriever()
|
||||
retriever.similarityTopK = 3;
|
||||
|
||||
// Fetch nodes!
|
||||
const nodesWithScore = await retriever.aretrieve("query string");
|
||||
const nodesWithScore = await retriever.retrieve("query string");
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
@@ -4,7 +4,18 @@ sidebar_position: 7
|
||||
|
||||
# Storage
|
||||
|
||||
Todo: Find out how this works.
|
||||
Storage in LlamaIndex.TS works automatically once you've configured a `StorageContext` object. Just configure the `persistDir` and attach it to an index.
|
||||
|
||||
Right now, only saving and loading from disk is supported, with future integrations planned!
|
||||
|
||||
```typescript
|
||||
import { Document, VectorStoreIndex, storageContextFromDefaults } from "./src";
|
||||
|
||||
const storageContext = await storageContextFromDefaults({ persistDir: "./storage" });
|
||||
|
||||
const document = new Document({ text: "Test Text" });
|
||||
const index = await VectorStoreIndex.fromDocuments([document], storageContext);
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
|
||||
@@ -8,8 +8,10 @@ Once you have installed LlamaIndex.TS using NPM and set up your OpenAI key, you'
|
||||
|
||||
In a new folder:
|
||||
|
||||
```bash
|
||||
npx tsc –-init # if needed
|
||||
```bash npm2yarn
|
||||
npm install typescript
|
||||
npm install @types/node
|
||||
npx tsc --init # if needed
|
||||
```
|
||||
|
||||
Create the file `example.ts`. This code will load some example data, create a document, index it (which creates embeddings using OpenAI), and then creates query engine to answer questions about the data.
|
||||
@@ -34,13 +36,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
|
||||
|
||||
@@ -21,7 +21,7 @@ const config = {
|
||||
organizationName: "run-llama", // Usually your GitHub org/user name.
|
||||
projectName: "LlamaIndex.TS", // Usually your repo name.
|
||||
|
||||
onBrokenLinks: "throw",
|
||||
onBrokenLinks: "warn",
|
||||
onBrokenMarkdownLinks: "warn",
|
||||
|
||||
// Even if you don't use internalization, you can use this field to set useful
|
||||
@@ -119,13 +119,14 @@ const config = {
|
||||
},
|
||||
}),
|
||||
plugins: [
|
||||
[require.resolve('docusaurus-lunr-search'), {}],
|
||||
[
|
||||
"docusaurus-plugin-typedoc",
|
||||
{
|
||||
entryPoints: ["../../packages/core/src/index.ts"],
|
||||
tsconfig: "../../packages/core/tsconfig.json",
|
||||
sidebar: {
|
||||
position: 4,
|
||||
position: 6,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -19,8 +19,13 @@
|
||||
"@docusaurus/preset-classic": "2.4.1",
|
||||
"@docusaurus/remark-plugin-npm2yarn": "^2.4.1",
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"autocomplete.js": "^0.38.1",
|
||||
"classnames": "^2.3.2",
|
||||
"clsx": "^1.2.1",
|
||||
"postcss": "^8.4.25",
|
||||
"docusaurus-lunr-search": "^2.3.2",
|
||||
"hogan.js": "^3.0.2",
|
||||
"lunr": "^2.3.9",
|
||||
"postcss": "^8.4.26",
|
||||
"prism-react-renderer": "^1.3.5",
|
||||
"raw-loader": "^4.0.2",
|
||||
"react": "^17.0.2",
|
||||
@@ -29,11 +34,11 @@
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.4.1",
|
||||
"@docusaurus/types": "^2.4.1",
|
||||
"@tsconfig/docusaurus": "^1.0.5",
|
||||
"@tsconfig/docusaurus": "^1.0.7",
|
||||
"docusaurus-plugin-typedoc": "^0.19.2",
|
||||
"typedoc": "^0.24.8",
|
||||
"typedoc-plugin-markdown": "^3.15.3",
|
||||
"typescript": "^4.7.4"
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
|
||||
@@ -24,8 +24,8 @@ export default function Home(): JSX.Element {
|
||||
const { siteConfig } = useDocusaurusContext();
|
||||
return (
|
||||
<Layout
|
||||
title={`Hello from ${siteConfig.title}`}
|
||||
description="Description will go into a meta tag in <head />"
|
||||
title={`${siteConfig.title}`}
|
||||
description="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."
|
||||
>
|
||||
<HomepageHeader />
|
||||
<main>
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
import Hogan from "hogan.js";
|
||||
import LunrSearchAdapter from "./lunar-search";
|
||||
import autocomplete from "autocomplete.js";
|
||||
import templates from "./templates";
|
||||
import utils from "./utils";
|
||||
import $ from "autocomplete.js/zepto";
|
||||
|
||||
class DocSearch {
|
||||
constructor({
|
||||
searchDocs,
|
||||
searchIndex,
|
||||
inputSelector,
|
||||
debug = false,
|
||||
baseUrl = '/',
|
||||
queryDataCallback = null,
|
||||
autocompleteOptions = {
|
||||
debug: false,
|
||||
hint: false,
|
||||
autoselect: true
|
||||
},
|
||||
transformData = false,
|
||||
queryHook = false,
|
||||
handleSelected = false,
|
||||
enhancedSearchInput = false,
|
||||
layout = "collumns"
|
||||
}) {
|
||||
this.input = DocSearch.getInputFromSelector(inputSelector);
|
||||
this.queryDataCallback = queryDataCallback || null;
|
||||
const autocompleteOptionsDebug =
|
||||
autocompleteOptions && autocompleteOptions.debug
|
||||
? autocompleteOptions.debug
|
||||
: false;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
autocompleteOptions.debug = debug || autocompleteOptionsDebug;
|
||||
this.autocompleteOptions = autocompleteOptions;
|
||||
this.autocompleteOptions.cssClasses =
|
||||
this.autocompleteOptions.cssClasses || {};
|
||||
this.autocompleteOptions.cssClasses.prefix =
|
||||
this.autocompleteOptions.cssClasses.prefix || "ds";
|
||||
const inputAriaLabel =
|
||||
this.input &&
|
||||
typeof this.input.attr === "function" &&
|
||||
this.input.attr("aria-label");
|
||||
this.autocompleteOptions.ariaLabel =
|
||||
this.autocompleteOptions.ariaLabel || inputAriaLabel || "search input";
|
||||
|
||||
this.isSimpleLayout = layout === "simple";
|
||||
|
||||
this.client = new LunrSearchAdapter(searchDocs, searchIndex, baseUrl);
|
||||
|
||||
if (enhancedSearchInput) {
|
||||
this.input = DocSearch.injectSearchBox(this.input);
|
||||
}
|
||||
this.autocomplete = autocomplete(this.input, autocompleteOptions, [
|
||||
{
|
||||
source: this.getAutocompleteSource(transformData, queryHook),
|
||||
templates: {
|
||||
suggestion: DocSearch.getSuggestionTemplate(this.isSimpleLayout),
|
||||
footer: templates.footer,
|
||||
empty: DocSearch.getEmptyTemplate()
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
const customHandleSelected = handleSelected;
|
||||
this.handleSelected = customHandleSelected || this.handleSelected;
|
||||
|
||||
// We prevent default link clicking if a custom handleSelected is defined
|
||||
if (customHandleSelected) {
|
||||
$(".algolia-autocomplete").on("click", ".ds-suggestions a", event => {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
this.autocomplete.on(
|
||||
"autocomplete:selected",
|
||||
this.handleSelected.bind(null, this.autocomplete.autocomplete)
|
||||
);
|
||||
|
||||
this.autocomplete.on(
|
||||
"autocomplete:shown",
|
||||
this.handleShown.bind(null, this.input)
|
||||
);
|
||||
|
||||
if (enhancedSearchInput) {
|
||||
DocSearch.bindSearchBoxEvent();
|
||||
}
|
||||
}
|
||||
|
||||
static injectSearchBox(input) {
|
||||
input.before(templates.searchBox);
|
||||
const newInput = input
|
||||
.prev()
|
||||
.prev()
|
||||
.find("input");
|
||||
input.remove();
|
||||
return newInput;
|
||||
}
|
||||
|
||||
static bindSearchBoxEvent() {
|
||||
$('.searchbox [type="reset"]').on("click", function () {
|
||||
$("input#docsearch").focus();
|
||||
$(this).addClass("hide");
|
||||
autocomplete.autocomplete.setVal("");
|
||||
});
|
||||
|
||||
$("input#docsearch").on("keyup", () => {
|
||||
const searchbox = document.querySelector("input#docsearch");
|
||||
const reset = document.querySelector('.searchbox [type="reset"]');
|
||||
reset.className = "searchbox__reset";
|
||||
if (searchbox.value.length === 0) {
|
||||
reset.className += " hide";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the matching input from a CSS selector, null if none matches
|
||||
* @function getInputFromSelector
|
||||
* @param {string} selector CSS selector that matches the search
|
||||
* input of the page
|
||||
* @returns {void}
|
||||
*/
|
||||
static getInputFromSelector(selector) {
|
||||
const input = $(selector).filter("input");
|
||||
return input.length ? $(input[0]) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the `source` method to be passed to autocomplete.js. It will query
|
||||
* the Algolia index and call the callbacks with the formatted hits.
|
||||
* @function getAutocompleteSource
|
||||
* @param {function} transformData An optional function to transform the hits
|
||||
* @param {function} queryHook An optional function to transform the query
|
||||
* @returns {function} Method to be passed as the `source` option of
|
||||
* autocomplete
|
||||
*/
|
||||
getAutocompleteSource(transformData, queryHook) {
|
||||
return (query, callback) => {
|
||||
if (queryHook) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
query = queryHook(query) || query;
|
||||
}
|
||||
this.client.search(query).then(hits => {
|
||||
if (
|
||||
this.queryDataCallback &&
|
||||
typeof this.queryDataCallback == "function"
|
||||
) {
|
||||
this.queryDataCallback(hits);
|
||||
}
|
||||
if (transformData) {
|
||||
hits = transformData(hits) || hits;
|
||||
}
|
||||
callback(DocSearch.formatHits(hits));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// Given a list of hits returned by the API, will reformat them to be used in
|
||||
// a Hogan template
|
||||
static formatHits(receivedHits) {
|
||||
const clonedHits = utils.deepClone(receivedHits);
|
||||
const hits = clonedHits.map(hit => {
|
||||
if (hit._highlightResult) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
hit._highlightResult = utils.mergeKeyWithParent(
|
||||
hit._highlightResult,
|
||||
"hierarchy"
|
||||
);
|
||||
}
|
||||
return utils.mergeKeyWithParent(hit, "hierarchy");
|
||||
});
|
||||
|
||||
// Group hits by category / subcategory
|
||||
let groupedHits = utils.groupBy(hits, "lvl0");
|
||||
$.each(groupedHits, (level, collection) => {
|
||||
const groupedHitsByLvl1 = utils.groupBy(collection, "lvl1");
|
||||
const flattenedHits = utils.flattenAndFlagFirst(
|
||||
groupedHitsByLvl1,
|
||||
"isSubCategoryHeader"
|
||||
);
|
||||
groupedHits[level] = flattenedHits;
|
||||
});
|
||||
groupedHits = utils.flattenAndFlagFirst(groupedHits, "isCategoryHeader");
|
||||
|
||||
// Translate hits into smaller objects to be send to the template
|
||||
return groupedHits.map(hit => {
|
||||
const url = DocSearch.formatURL(hit);
|
||||
const category = utils.getHighlightedValue(hit, "lvl0");
|
||||
const subcategory = utils.getHighlightedValue(hit, "lvl1") || category;
|
||||
const displayTitle = utils
|
||||
.compact([
|
||||
utils.getHighlightedValue(hit, "lvl2") || subcategory,
|
||||
utils.getHighlightedValue(hit, "lvl3"),
|
||||
utils.getHighlightedValue(hit, "lvl4"),
|
||||
utils.getHighlightedValue(hit, "lvl5"),
|
||||
utils.getHighlightedValue(hit, "lvl6")
|
||||
])
|
||||
.join(
|
||||
'<span class="aa-suggestion-title-separator" aria-hidden="true"> › </span>'
|
||||
);
|
||||
const text = utils.getSnippetedValue(hit, "content");
|
||||
const isTextOrSubcategoryNonEmpty =
|
||||
(subcategory && subcategory !== "") ||
|
||||
(displayTitle && displayTitle !== "");
|
||||
const isLvl1EmptyOrDuplicate =
|
||||
!subcategory || subcategory === "" || subcategory === category;
|
||||
const isLvl2 =
|
||||
displayTitle && displayTitle !== "" && displayTitle !== subcategory;
|
||||
const isLvl1 =
|
||||
!isLvl2 &&
|
||||
(subcategory && subcategory !== "" && subcategory !== category);
|
||||
const isLvl0 = !isLvl1 && !isLvl2;
|
||||
|
||||
return {
|
||||
isLvl0,
|
||||
isLvl1,
|
||||
isLvl2,
|
||||
isLvl1EmptyOrDuplicate,
|
||||
isCategoryHeader: hit.isCategoryHeader,
|
||||
isSubCategoryHeader: hit.isSubCategoryHeader,
|
||||
isTextOrSubcategoryNonEmpty,
|
||||
category,
|
||||
subcategory,
|
||||
title: displayTitle,
|
||||
text,
|
||||
url
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
static formatURL(hit) {
|
||||
const { url, anchor } = hit;
|
||||
if (url) {
|
||||
const containsAnchor = url.indexOf("#") !== -1;
|
||||
if (containsAnchor) return url;
|
||||
else if (anchor) return `${hit.url}#${hit.anchor}`;
|
||||
return url;
|
||||
} else if (anchor) return `#${hit.anchor}`;
|
||||
/* eslint-disable */
|
||||
console.warn("no anchor nor url for : ", JSON.stringify(hit));
|
||||
/* eslint-enable */
|
||||
return null;
|
||||
}
|
||||
|
||||
static getEmptyTemplate() {
|
||||
return args => Hogan.compile(templates.empty).render(args);
|
||||
}
|
||||
|
||||
static getSuggestionTemplate(isSimpleLayout) {
|
||||
const stringTemplate = isSimpleLayout
|
||||
? templates.suggestionSimple
|
||||
: templates.suggestion;
|
||||
const template = Hogan.compile(stringTemplate);
|
||||
return suggestion => template.render(suggestion);
|
||||
}
|
||||
|
||||
handleSelected(input, event, suggestion, datasetNumber, context = {}) {
|
||||
// Do nothing if click on the suggestion, as it's already a <a href>, the
|
||||
// browser will take care of it. This allow Ctrl-Clicking on results and not
|
||||
// having the main window being redirected as well
|
||||
if (context.selectionMethod === "click") {
|
||||
return;
|
||||
}
|
||||
|
||||
input.setVal("");
|
||||
window.location.assign(suggestion.url);
|
||||
}
|
||||
|
||||
handleShown(input) {
|
||||
const middleOfInput = input.offset().left + input.width() / 2;
|
||||
let middleOfWindow = $(document).width() / 2;
|
||||
|
||||
if (isNaN(middleOfWindow)) {
|
||||
middleOfWindow = 900;
|
||||
}
|
||||
|
||||
const alignClass =
|
||||
middleOfInput - middleOfWindow >= 0
|
||||
? "algolia-autocomplete-right"
|
||||
: "algolia-autocomplete-left";
|
||||
const otherAlignClass =
|
||||
middleOfInput - middleOfWindow < 0
|
||||
? "algolia-autocomplete-right"
|
||||
: "algolia-autocomplete-left";
|
||||
const autocompleteWrapper = $(".algolia-autocomplete");
|
||||
if (!autocompleteWrapper.hasClass(alignClass)) {
|
||||
autocompleteWrapper.addClass(alignClass);
|
||||
}
|
||||
|
||||
if (autocompleteWrapper.hasClass(otherAlignClass)) {
|
||||
autocompleteWrapper.removeClass(otherAlignClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default DocSearch;
|
||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user