mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-02 20:13:52 -04:00
Compare commits
84 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c0fc9f6e55 | |||
| 72d919566c | |||
| d613bbd358 | |||
| 36f0af5a5d | |||
| 79d7076121 | |||
| 526b3e74bf | |||
| d03dc21e8a | |||
| 42093de872 | |||
| aa48a5d764 | |||
| 1dedca45ac | |||
| 3552de1b45 | |||
| 2b94e36df6 | |||
| d1e1de4a8d | |||
| 23587e17ad | |||
| 213f452f0b | |||
| 27a488539d | |||
| 283da50d33 | |||
| a809085715 | |||
| 67321f1cba | |||
| 7683186470 | |||
| fded43b77e | |||
| 22ff7da4e0 | |||
| 844561b6cc | |||
| 52bc1d8387 | |||
| 8a3ac0c338 | |||
| bb125d7d4f | |||
| a405716847 | |||
| bad6e03095 | |||
| 2330fddfbb | |||
| 61dfd74134 | |||
| 029ff83979 | |||
| dbbc4cb2e1 | |||
| 1cce21cdc2 | |||
| 8b786a51b3 | |||
| ad7537dd84 | |||
| 3bab23172a | |||
| 18c132d494 | |||
| d072353e08 | |||
| c8bbc101cc | |||
| b93f748998 | |||
| ecb100448a | |||
| c749c856b5 | |||
| 0baf278972 | |||
| ae7780266a | |||
| 587960aebe | |||
| 4e1b6784f7 | |||
| 8b381f2640 | |||
| 0dc7fa6c34 | |||
| 2a2bf682bf | |||
| 87526129fb | |||
| 8ed1b7aa46 | |||
| 4084bd0ecc | |||
| d11eaceaf1 | |||
| 1e6986fbc5 | |||
| 11a19bdec7 | |||
| 51064f1b90 | |||
| 3385cd19e8 | |||
| 852f8517df | |||
| bb917f9818 | |||
| 10248fb29f | |||
| 446dc85bdd | |||
| 4aa2c226a9 | |||
| bf9ba8313a | |||
| 444b59c557 | |||
| b2e1df94db | |||
| b4963cabc8 | |||
| 2851024340 | |||
| 7f25a25729 | |||
| acfe23265a | |||
| 2c6fbbd7dd | |||
| f84507f513 | |||
| be6a9e4a48 | |||
| 69e7634619 | |||
| 3e8c923641 | |||
| df5cbe30a6 | |||
| 9e1a536778 | |||
| a1db8833ef | |||
| 95dd0e0158 | |||
| 19f3c857d5 | |||
| 7f3da73aa4 | |||
| c384c2b610 | |||
| dcf358f27d | |||
| 40afc8c0e2 | |||
| b22bc8a799 |
@@ -1,7 +1,6 @@
|
||||
name: Bugfix
|
||||
title: "Sweep: "
|
||||
title: ""
|
||||
description: Write something like "We notice ... behavior when ... happens instead of ...""
|
||||
labels: sweep
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
@@ -1,11 +1,10 @@
|
||||
name: Feature Request
|
||||
title: "Sweep: "
|
||||
description: Write something like "Write an api endpoint that does "..." in the "..." file"
|
||||
labels: sweep
|
||||
title: ""
|
||||
description: Write something like "Write an api endpoint that does "..." in the "..." file". If you would like to use sweep.dev prefix with "Sweep:"
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Details
|
||||
description: More details for Sweep
|
||||
description: More details
|
||||
placeholder: The new endpoint should use the ... class from ... file because it contains ... logic
|
||||
@@ -1,11 +1,10 @@
|
||||
name: Refactor
|
||||
title: "Sweep: "
|
||||
description: Write something like "Modify the ... api endpoint to use ... version and ... framework"
|
||||
labels: sweep
|
||||
title: ""
|
||||
description: Write something like "Modify the ... api endpoint to use ... version and ... framework" If you would like to use sweep.dev prefix with "Sweep:"
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Details
|
||||
description: More details for Sweep
|
||||
description: More details
|
||||
placeholder: We are migrating this function to ... version because ...
|
||||
@@ -12,14 +12,14 @@ jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v2
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: "pnpm"
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Run lint
|
||||
run: pnpm run lint
|
||||
|
||||
@@ -7,18 +7,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v2
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "18"
|
||||
|
||||
node-version-file: '.nvmrc'
|
||||
cache: "pnpm"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm i -g pnpm
|
||||
pnpm install
|
||||
|
||||
run: pnpm install
|
||||
- name: Run tests
|
||||
run: pnpm run test
|
||||
|
||||
Vendored
+3
-2
@@ -4,5 +4,6 @@
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[xml]": {
|
||||
"editor.defaultFormatter": "redhat.vscode-xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"jest.rootPath": "./packages/core"
|
||||
}
|
||||
@@ -8,38 +8,38 @@ We include several end-to-end examples using LlamaIndex.TS in the repository
|
||||
|
||||
Check out the examples below or try them out and complete them in minutes with interactive Github Codespace tutorials provided by Dev-Docs [here](https://codespaces.new/team-dev-docs/lits-dev-docs-playground?devcontainer_path=.devcontainer%2Fjavascript_ltsquickstart%2Fdevcontainer.json):
|
||||
|
||||
## [Chat Engine](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/chatEngine.ts)
|
||||
## [Chat Engine](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/chatEngine.ts)
|
||||
|
||||
Read a file and chat about it with the LLM.
|
||||
|
||||
## [Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/vectorIndex.ts)
|
||||
## [Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/vectorIndex.ts)
|
||||
|
||||
Create a vector index and query it. The vector index will use embeddings to fetch the top k most relevant nodes. By default, the top k is 2.
|
||||
|
||||
## [Summary Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/summaryIndex.ts)
|
||||
## [Summary Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/summaryIndex.ts)
|
||||
|
||||
Create a list index and query it. This example also use the `LLMRetriever`, which will use the LLM to select the best nodes to use when generating answer.
|
||||
|
||||
## [Save / Load an Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/storageContext.ts)
|
||||
## [Save / Load an Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/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)
|
||||
## [Customized Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/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)
|
||||
## [OpenAI LLM](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/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)
|
||||
## [Llama2 DeuceLLM](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/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)
|
||||
## [SubQuestionQueryEngine](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/subquestion.ts)
|
||||
|
||||
Uses the `SubQuestionQueryEngine`, which breaks complex queries into multiple questions, and then aggreates a response across the answers to all sub-questions.
|
||||
|
||||
## [Low Level Modules](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/lowlevel.ts)
|
||||
## [Low Level Modules](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/lowlevel.ts)
|
||||
|
||||
This example uses several low-level components, which removes the need for an actual query engine. These components can be used anywhere, in any application, or customized and sub-classed to meet your own needs.
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Installation and Setup
|
||||
|
||||
## Installation from NPM
|
||||
|
||||
Make sure you have NodeJS v18 or higher.
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
## Environment variables
|
||||
|
||||
Our examples use OpenAI by default. You'll need to set up your Open AI key like so:
|
||||
|
||||
```bash
|
||||
export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
|
||||
```
|
||||
|
||||
If you want to have it automatically loaded every time, add it to your .zshrc/.bashrc.
|
||||
|
||||
WARNING: do not check in your OpenAI key into version control.
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Installation and Setup
|
||||
|
||||
Make sure you have NodeJS v18 or higher.
|
||||
|
||||
## Using create-llama
|
||||
|
||||
The easiest way to get started with LlamaIndex is by using `create-llama`. This CLI tool enables you to quickly start building a new LlamaIndex application, with everything set up for you.
|
||||
|
||||
Just run
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="1" label="npm" default>
|
||||
|
||||
```bash
|
||||
npx create-llama@latest
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="2" label="Yarn">
|
||||
|
||||
```bash
|
||||
yarn create llama
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="3" label="pnpm">
|
||||
|
||||
```bash
|
||||
pnpm create llama@latest
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
to get started. Once your app is generated, run
|
||||
|
||||
```bash npm2yarn
|
||||
npm run dev
|
||||
```
|
||||
|
||||
to start the development server. You can then visit [http://localhost:3000](http://localhost:3000) to see your app
|
||||
|
||||
## Installation from NPM
|
||||
|
||||
```bash npm2yarn
|
||||
npm install llamaindex
|
||||
```
|
||||
|
||||
### Environment variables
|
||||
|
||||
Our examples use OpenAI by default. You'll need to set up your Open AI key like so:
|
||||
|
||||
```bash
|
||||
export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
|
||||
```
|
||||
|
||||
If you want to have it automatically loaded every time, add it to your .zshrc/.bashrc.
|
||||
|
||||
WARNING: do not check in your OpenAI key into version control.
|
||||
@@ -5,7 +5,7 @@ slug: /
|
||||
|
||||
# What is LlamaIndex.TS?
|
||||
|
||||
LlamaIndex.TS is a data framework for LLM applications to ingest, structure, and access private or domain-specific data. While a python package is also available (see [here](https://gpt-index.readthedocs.io/en/latest/)), LlamaIndex.TS offers core features in a simple package, optimized for usage with TypeScript.
|
||||
LlamaIndex.TS is a data framework for LLM applications to ingest, structure, and access private or domain-specific data. While a python package is also available (see [here](https://docs.llamaindex.ai/en/stable/)), LlamaIndex.TS offers core features in a simple package, optimized for usage with TypeScript.
|
||||
|
||||
## 🚀 Why LlamaIndex.TS?
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ The basic concept of the Sub Question Query Engine is that it splits a single qu
|
||||
|
||||
### Getting Started
|
||||
|
||||
The easiest way to start trying the Sub Question Query Engine is running the subquestion.ts file in [apps/simple](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/subquestion.ts).
|
||||
The easiest way to start trying the Sub Question Query Engine is running the subquestion.ts file in [examples](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/subquestion.ts).
|
||||
|
||||
```bash
|
||||
npx ts-node subquestion.ts
|
||||
|
||||
@@ -4,7 +4,7 @@ sidebar_position: 2
|
||||
|
||||
# Starter Tutorial
|
||||
|
||||
Once you have [installed LlamaIndex.TS using NPM](installation.md) and set up your OpenAI key, you're ready to start your first app:
|
||||
Once you have [installed LlamaIndex.TS using NPM](installation) and set up your OpenAI key, you're ready to start your first app:
|
||||
|
||||
In a new folder:
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ const config = {
|
||||
// to replace "en" with "zh-Hans".
|
||||
i18n: {
|
||||
defaultLocale: "en",
|
||||
locales: ["en"],
|
||||
locales: ["en", "fr"],
|
||||
},
|
||||
|
||||
presets: [
|
||||
@@ -71,6 +71,10 @@ const config = {
|
||||
position: "left",
|
||||
label: "Docs",
|
||||
},
|
||||
{
|
||||
type: "localeDropdown",
|
||||
position: "left",
|
||||
},
|
||||
{
|
||||
href: "https://github.com/run-llama/LlamaIndexTS",
|
||||
label: "GitHub",
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
../../../../docs/_static
|
||||
@@ -0,0 +1,2 @@
|
||||
label: "API"
|
||||
position: 6
|
||||
@@ -0,0 +1,318 @@
|
||||
---
|
||||
id: "Anthropic"
|
||||
title: "Class: Anthropic"
|
||||
sidebar_label: "Anthropic"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Anthropic LLM implementation
|
||||
|
||||
## Implements
|
||||
|
||||
- [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new Anthropic**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :-------------------------------------- |
|
||||
| `init?` | `Partial`<[`Anthropic`](Anthropic.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:667](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L667)
|
||||
|
||||
## Properties
|
||||
|
||||
### apiKey
|
||||
|
||||
• `Optional` **apiKey**: `string` = `undefined`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:660](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L660)
|
||||
|
||||
---
|
||||
|
||||
### callbackManager
|
||||
|
||||
• `Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:665](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L665)
|
||||
|
||||
---
|
||||
|
||||
### hasStreaming
|
||||
|
||||
• **hasStreaming**: `boolean` = `true`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[hasStreaming](../interfaces/LLM.md#hasstreaming)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:651](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L651)
|
||||
|
||||
---
|
||||
|
||||
### maxRetries
|
||||
|
||||
• **maxRetries**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:661](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L661)
|
||||
|
||||
---
|
||||
|
||||
### maxTokens
|
||||
|
||||
• `Optional` **maxTokens**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:657](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L657)
|
||||
|
||||
---
|
||||
|
||||
### model
|
||||
|
||||
• **model**: `"claude-2"` \| `"claude-instant-1"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:654](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L654)
|
||||
|
||||
---
|
||||
|
||||
### session
|
||||
|
||||
• **session**: `AnthropicSession`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:663](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L663)
|
||||
|
||||
---
|
||||
|
||||
### temperature
|
||||
|
||||
• **temperature**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:655](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L655)
|
||||
|
||||
---
|
||||
|
||||
### timeout
|
||||
|
||||
• `Optional` **timeout**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:662](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L662)
|
||||
|
||||
---
|
||||
|
||||
### topP
|
||||
|
||||
• **topP**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:656](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L656)
|
||||
|
||||
## Accessors
|
||||
|
||||
### metadata
|
||||
|
||||
• `get` **metadata**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :-------------- | :----------------------------------- |
|
||||
| `contextWindow` | `number` |
|
||||
| `maxTokens` | `undefined` \| `number` |
|
||||
| `model` | `"claude-2"` \| `"claude-instant-1"` |
|
||||
| `temperature` | `number` |
|
||||
| `tokenizer` | `undefined` |
|
||||
| `topP` | `number` |
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[metadata](../interfaces/LLM.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:691](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L691)
|
||||
|
||||
## Methods
|
||||
|
||||
### chat
|
||||
|
||||
▸ **chat**<`T`, `R`\>(`messages`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
Get a chat response from the LLM
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | The return type of chat() and complete() are set by the "streaming" parameter being set to True. |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
| `streaming?` | `T` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:719](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L719)
|
||||
|
||||
---
|
||||
|
||||
### complete
|
||||
|
||||
▸ **complete**<`T`, `R`\>(`prompt`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
Get a prompt completion from the LLM
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :-------------------------------- | :--------------------- |
|
||||
| `prompt` | `string` | the prompt to complete |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
| `streaming?` | `T` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:776](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L776)
|
||||
|
||||
---
|
||||
|
||||
### mapMessagesToPrompt
|
||||
|
||||
▸ **mapMessagesToPrompt**(`messages`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:702](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L702)
|
||||
|
||||
---
|
||||
|
||||
### streamChat
|
||||
|
||||
▸ `Protected` **streamChat**(`messages`, `parentEvent?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:751](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L751)
|
||||
|
||||
---
|
||||
|
||||
### streamComplete
|
||||
|
||||
▸ `Protected` **streamComplete**(`prompt`, `parentEvent?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `prompt` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:794](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L794)
|
||||
|
||||
---
|
||||
|
||||
### tokens
|
||||
|
||||
▸ **tokens**(`messages`): `number`
|
||||
|
||||
Calculates the number of tokens needed for the given chat messages
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[tokens](../interfaces/LLM.md#tokens)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:687](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L687)
|
||||
+289
@@ -0,0 +1,289 @@
|
||||
---
|
||||
id: "BaseDocumentStore"
|
||||
title: "Class: BaseDocumentStore"
|
||||
sidebar_label: "BaseDocumentStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BaseDocumentStore**()
|
||||
|
||||
## Methods
|
||||
|
||||
### addDocuments
|
||||
|
||||
▸ `Abstract` **addDocuments**(`docs`, `allowUpdate`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------------------------------------------------------- |
|
||||
| `docs` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
| `allowUpdate` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L27)
|
||||
|
||||
---
|
||||
|
||||
### deleteDocument
|
||||
|
||||
▸ `Abstract` **deleteDocument**(`docId`, `raiseError`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :-------- |
|
||||
| `docId` | `string` |
|
||||
| `raiseError` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L34)
|
||||
|
||||
---
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ `Abstract` **deleteRefDoc**(`refDocId`, `raiseError`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :-------- |
|
||||
| `refDocId` | `string` |
|
||||
| `raiseError` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L48)
|
||||
|
||||
---
|
||||
|
||||
### docs
|
||||
|
||||
▸ `Abstract` **docs**(): `Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L25)
|
||||
|
||||
---
|
||||
|
||||
### documentExists
|
||||
|
||||
▸ `Abstract` **documentExists**(`docId`): `Promise`<`boolean`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `docId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L36)
|
||||
|
||||
---
|
||||
|
||||
### getAllRefDocInfo
|
||||
|
||||
▸ `Abstract` **getAllRefDocInfo**(): `Promise`<`undefined` \| `Record`<`string`, [`RefDocInfo`](../interfaces/RefDocInfo.md)\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `Record`<`string`, [`RefDocInfo`](../interfaces/RefDocInfo.md)\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L44)
|
||||
|
||||
---
|
||||
|
||||
### getDocument
|
||||
|
||||
▸ `Abstract` **getDocument**(`docId`, `raiseError`): `Promise`<`undefined` \| [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :-------- |
|
||||
| `docId` | `string` |
|
||||
| `raiseError` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L29)
|
||||
|
||||
---
|
||||
|
||||
### getDocumentHash
|
||||
|
||||
▸ `Abstract` **getDocumentHash**(`docId`): `Promise`<`undefined` \| `string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `docId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L41)
|
||||
|
||||
---
|
||||
|
||||
### getNode
|
||||
|
||||
▸ **getNode**(`nodeId`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :-------- | :------------ |
|
||||
| `nodeId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L57)
|
||||
|
||||
---
|
||||
|
||||
### getNodeDict
|
||||
|
||||
▸ **getNodeDict**(`nodeIdDict`): `Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :------- |
|
||||
| `nodeIdDict` | `Object` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L65)
|
||||
|
||||
---
|
||||
|
||||
### getNodes
|
||||
|
||||
▸ **getNodes**(`nodeIds`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :--------- | :------------ |
|
||||
| `nodeIds` | `string`[] | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L51)
|
||||
|
||||
---
|
||||
|
||||
### getRefDocInfo
|
||||
|
||||
▸ `Abstract` **getRefDocInfo**(`refDocId`): `Promise`<`undefined` \| [`RefDocInfo`](../interfaces/RefDocInfo.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :------- |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`RefDocInfo`](../interfaces/RefDocInfo.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L46)
|
||||
|
||||
---
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------ | :-------------------------------------------------------- | :------------------- |
|
||||
| `persistPath` | `string` | `defaultPersistPath` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `undefined` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L17)
|
||||
|
||||
---
|
||||
|
||||
### setDocumentHash
|
||||
|
||||
▸ `Abstract` **setDocumentHash**(`docId`, `docHash`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :------- |
|
||||
| `docId` | `string` |
|
||||
| `docHash` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L39)
|
||||
@@ -0,0 +1,83 @@
|
||||
---
|
||||
id: "BaseEmbedding"
|
||||
title: "Class: BaseEmbedding"
|
||||
sidebar_label: "BaseEmbedding"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`BaseEmbedding`**
|
||||
|
||||
↳ [`MultiModalEmbedding`](MultiModalEmbedding.md)
|
||||
|
||||
↳ [`OpenAIEmbedding`](OpenAIEmbedding.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BaseEmbedding**()
|
||||
|
||||
## Methods
|
||||
|
||||
### getQueryEmbedding
|
||||
|
||||
▸ `Abstract` **getQueryEmbedding**(`query`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L23)
|
||||
|
||||
---
|
||||
|
||||
### getTextEmbedding
|
||||
|
||||
▸ `Abstract` **getTextEmbedding**(`text`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :------- |
|
||||
| `text` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L22)
|
||||
|
||||
---
|
||||
|
||||
### similarity
|
||||
|
||||
▸ **similarity**(`embedding1`, `embedding2`, `mode?`): `number`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :--------------------------------------------- | :----------------------- |
|
||||
| `embedding1` | `number`[] | `undefined` |
|
||||
| `embedding2` | `number`[] | `undefined` |
|
||||
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L14)
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
---
|
||||
id: "BaseInMemoryKVStore"
|
||||
title: "Class: BaseInMemoryKVStore"
|
||||
sidebar_label: "BaseInMemoryKVStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseKVStore`](BaseKVStore.md)
|
||||
|
||||
↳ **`BaseInMemoryKVStore`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BaseInMemoryKVStore**()
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseKVStore](BaseKVStore.md).[constructor](BaseKVStore.md#constructor)
|
||||
|
||||
## Methods
|
||||
|
||||
### delete
|
||||
|
||||
▸ `Abstract` **delete**(`key`, `collection?`): `Promise`<`boolean`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------- |
|
||||
| `key` | `string` |
|
||||
| `collection?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseKVStore](BaseKVStore.md).[delete](BaseKVStore.md#delete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L14)
|
||||
|
||||
---
|
||||
|
||||
### get
|
||||
|
||||
▸ `Abstract` **get**(`key`, `collection?`): `Promise`<`StoredValue`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------- |
|
||||
| `key` | `string` |
|
||||
| `collection?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`StoredValue`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseKVStore](BaseKVStore.md).[get](BaseKVStore.md#get)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/types.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L12)
|
||||
|
||||
---
|
||||
|
||||
### getAll
|
||||
|
||||
▸ `Abstract` **getAll**(`collection?`): `Promise`<`Record`<`string`, `StoredValue`\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------- |
|
||||
| `collection?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, `StoredValue`\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseKVStore](BaseKVStore.md).[getAll](BaseKVStore.md#getall)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/types.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L13)
|
||||
|
||||
---
|
||||
|
||||
### persist
|
||||
|
||||
▸ `Abstract` **persist**(`persistPath`, `fs?`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------------------- |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/types.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L18)
|
||||
|
||||
---
|
||||
|
||||
### put
|
||||
|
||||
▸ `Abstract` **put**(`key`, `val`, `collection?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------------------------- |
|
||||
| `key` | `string` |
|
||||
| `val` | `Record`<`string`, `any`\> |
|
||||
| `collection?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseKVStore](BaseKVStore.md).[put](BaseKVStore.md#put)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/types.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L7)
|
||||
|
||||
---
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`): [`BaseInMemoryKVStore`](BaseInMemoryKVStore.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------- |
|
||||
| `persistPath` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseInMemoryKVStore`](BaseInMemoryKVStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/types.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L19)
|
||||
@@ -0,0 +1,218 @@
|
||||
---
|
||||
id: "BaseIndex"
|
||||
title: "Class: BaseIndex<T>"
|
||||
sidebar_label: "BaseIndex"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Indexes are the data structure that we store our nodes and embeddings in so
|
||||
they can be retrieved for our queries.
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name |
|
||||
| :--- |
|
||||
| `T` |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`BaseIndex`**
|
||||
|
||||
↳ [`KeywordTableIndex`](KeywordTableIndex.md)
|
||||
|
||||
↳ [`SummaryIndex`](SummaryIndex.md)
|
||||
|
||||
↳ [`VectorStoreIndex`](VectorStoreIndex.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BaseIndex**<`T`\>(`init`)
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :--- |
|
||||
| `T` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :------------------------------------------------------ |
|
||||
| `init` | [`BaseIndexInit`](../interfaces/BaseIndexInit.md)<`T`\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:161](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L161)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: [`BaseDocumentStore`](BaseDocumentStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L156)
|
||||
|
||||
---
|
||||
|
||||
### indexStore
|
||||
|
||||
• `Optional` **indexStore**: [`BaseIndexStore`](BaseIndexStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:158](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L158)
|
||||
|
||||
---
|
||||
|
||||
### indexStruct
|
||||
|
||||
• **indexStruct**: `T`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L159)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:154](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L154)
|
||||
|
||||
---
|
||||
|
||||
### storageContext
|
||||
|
||||
• **storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L155)
|
||||
|
||||
---
|
||||
|
||||
### vectorStore
|
||||
|
||||
• `Optional` **vectorStore**: [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L157)
|
||||
|
||||
## 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
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:181](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L181)
|
||||
|
||||
---
|
||||
|
||||
### asRetriever
|
||||
|
||||
▸ `Abstract` **asRetriever**(`options?`): [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
Create a new retriever from the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---- |
|
||||
| `options?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:174](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L174)
|
||||
|
||||
---
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ `Abstract` **deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------------- | :-------- |
|
||||
| `refDocId` | `string` |
|
||||
| `deleteFromDocStore?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:199](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L199)
|
||||
|
||||
---
|
||||
|
||||
### insert
|
||||
|
||||
▸ **insert**(`document`): `Promise`<`void`\>
|
||||
|
||||
Insert a document into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :----------------------------------------------------- |
|
||||
| `document` | [`Document`](Document.md)<[`Metadata`](../#metadata)\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:190](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L190)
|
||||
|
||||
---
|
||||
|
||||
### insertNodes
|
||||
|
||||
▸ `Abstract` **insertNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------- |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:198](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L198)
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
---
|
||||
id: "BaseIndexStore"
|
||||
title: "Class: BaseIndexStore"
|
||||
sidebar_label: "BaseIndexStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BaseIndexStore**()
|
||||
|
||||
## Methods
|
||||
|
||||
### addIndexStruct
|
||||
|
||||
▸ `Abstract` **addIndexStruct**(`indexStruct`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------------------------------ |
|
||||
| `indexStruct` | [`IndexStruct`](IndexStruct.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/types.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/types.ts#L13)
|
||||
|
||||
---
|
||||
|
||||
### deleteIndexStruct
|
||||
|
||||
▸ `Abstract` **deleteIndexStruct**(`key`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---- | :------- |
|
||||
| `key` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/types.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/types.ts#L15)
|
||||
|
||||
---
|
||||
|
||||
### getIndexStruct
|
||||
|
||||
▸ `Abstract` **getIndexStruct**(`structId?`): `Promise`<`undefined` \| [`IndexStruct`](IndexStruct.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---------- | :------- |
|
||||
| `structId?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`IndexStruct`](IndexStruct.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/types.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/types.ts#L17)
|
||||
|
||||
---
|
||||
|
||||
### getIndexStructs
|
||||
|
||||
▸ `Abstract` **getIndexStructs**(): `Promise`<[`IndexStruct`](IndexStruct.md)[]\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`IndexStruct`](IndexStruct.md)[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/types.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/types.ts#L11)
|
||||
|
||||
---
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------ | :-------------------------------------------------------- | :------------------- |
|
||||
| `persistPath` | `string` | `defaultPersistPath` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `undefined` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/types.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/types.ts#L19)
|
||||
@@ -0,0 +1,105 @@
|
||||
---
|
||||
id: "BaseKVStore"
|
||||
title: "Class: BaseKVStore"
|
||||
sidebar_label: "BaseKVStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`BaseKVStore`**
|
||||
|
||||
↳ [`SimpleKVStore`](SimpleKVStore.md)
|
||||
|
||||
↳ [`BaseInMemoryKVStore`](BaseInMemoryKVStore.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BaseKVStore**()
|
||||
|
||||
## Methods
|
||||
|
||||
### delete
|
||||
|
||||
▸ `Abstract` **delete**(`key`, `collection?`): `Promise`<`boolean`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------- |
|
||||
| `key` | `string` |
|
||||
| `collection?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L14)
|
||||
|
||||
---
|
||||
|
||||
### get
|
||||
|
||||
▸ `Abstract` **get**(`key`, `collection?`): `Promise`<`StoredValue`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------- |
|
||||
| `key` | `string` |
|
||||
| `collection?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`StoredValue`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/types.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L12)
|
||||
|
||||
---
|
||||
|
||||
### getAll
|
||||
|
||||
▸ `Abstract` **getAll**(`collection?`): `Promise`<`Record`<`string`, `StoredValue`\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------- |
|
||||
| `collection?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, `StoredValue`\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/types.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L13)
|
||||
|
||||
---
|
||||
|
||||
### put
|
||||
|
||||
▸ `Abstract` **put**(`key`, `val`, `collection?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------------------------- |
|
||||
| `key` | `string` |
|
||||
| `val` | `Record`<`string`, `any`\> |
|
||||
| `collection?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/types.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L7)
|
||||
@@ -0,0 +1,320 @@
|
||||
---
|
||||
id: "BaseNode"
|
||||
title: "Class: BaseNode<T>"
|
||||
sidebar_label: "BaseNode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Generic abstract class for retrievable nodes
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`BaseNode`**
|
||||
|
||||
↳ [`TextNode`](TextNode.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BaseNode**<`T`\>(`init?`)
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------ |
|
||||
| `init?` | `Partial`<[`BaseNode`](BaseNode.md)<`T`\>\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L60)
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• `Optional` **embedding**: `number`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
|
||||
|
||||
---
|
||||
|
||||
### excludedEmbedMetadataKeys
|
||||
|
||||
• **excludedEmbedMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
|
||||
|
||||
---
|
||||
|
||||
### excludedLlmMetadataKeys
|
||||
|
||||
• **excludedLlmMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
|
||||
|
||||
---
|
||||
|
||||
### hash
|
||||
|
||||
• **hash**: `string` = `""`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
|
||||
|
||||
---
|
||||
|
||||
### id\_
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
|
||||
|
||||
---
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `T`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
|
||||
|
||||
---
|
||||
|
||||
### relationships
|
||||
|
||||
• **relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
|
||||
|
||||
## Accessors
|
||||
|
||||
### childNodes
|
||||
|
||||
• `get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
|
||||
|
||||
---
|
||||
|
||||
### nextNode
|
||||
|
||||
• `get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
|
||||
|
||||
---
|
||||
|
||||
### parentNode
|
||||
|
||||
• `get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
|
||||
|
||||
---
|
||||
|
||||
### prevNode
|
||||
|
||||
• `get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
|
||||
|
||||
---
|
||||
|
||||
### sourceNode
|
||||
|
||||
• `get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRelatedNodeInfo
|
||||
|
||||
▸ **asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
|
||||
|
||||
---
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ `Abstract` **generateHash**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L124)
|
||||
|
||||
---
|
||||
|
||||
### getContent
|
||||
|
||||
▸ `Abstract` **getContent**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :----------------------------------------- |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:66](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L66)
|
||||
|
||||
---
|
||||
|
||||
### getEmbedding
|
||||
|
||||
▸ **getEmbedding**(): `number`[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
|
||||
|
||||
---
|
||||
|
||||
### getMetadataStr
|
||||
|
||||
▸ `Abstract` **getMetadataStr**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :----------------------------------------- |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L67)
|
||||
|
||||
---
|
||||
|
||||
### getType
|
||||
|
||||
▸ `Abstract` **getType**(): [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L64)
|
||||
|
||||
---
|
||||
|
||||
### setContent
|
||||
|
||||
▸ `Abstract` **setContent**(`value`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :---- |
|
||||
| `value` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L68)
|
||||
|
||||
---
|
||||
|
||||
### toJSON
|
||||
|
||||
▸ **toJSON**(): `Record`<`string`, `any`\>
|
||||
|
||||
Used with built in JSON.stringify
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
---
|
||||
id: "CallbackManager"
|
||||
title: "Class: CallbackManager"
|
||||
sidebar_label: "CallbackManager"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Implements
|
||||
|
||||
- `CallbackManagerMethods`
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new CallbackManager**(`handlers?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---------- | :----------------------- |
|
||||
| `handlers?` | `CallbackManagerMethods` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/callbacks/CallbackManager.ts:86](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/callbacks/CallbackManager.ts#L86)
|
||||
|
||||
## Properties
|
||||
|
||||
### onLLMStream
|
||||
|
||||
• `Optional` **onLLMStream**: (`params`: [`StreamCallbackResponse`](../interfaces/StreamCallbackResponse.md)) => `void` \| `Promise`<`void`\>
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`params`): `void` \| `Promise`<`void`\>
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :------------------------------------------------------------------ |
|
||||
| `params` | [`StreamCallbackResponse`](../interfaces/StreamCallbackResponse.md) |
|
||||
|
||||
##### Returns
|
||||
|
||||
`void` \| `Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
CallbackManagerMethods.onLLMStream
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/callbacks/CallbackManager.ts:83](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/callbacks/CallbackManager.ts#L83)
|
||||
|
||||
---
|
||||
|
||||
### onRetrieve
|
||||
|
||||
• `Optional` **onRetrieve**: (`params`: [`RetrievalCallbackResponse`](../interfaces/RetrievalCallbackResponse.md)) => `void` \| `Promise`<`void`\>
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`params`): `void` \| `Promise`<`void`\>
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :------------------------------------------------------------------------ |
|
||||
| `params` | [`RetrievalCallbackResponse`](../interfaces/RetrievalCallbackResponse.md) |
|
||||
|
||||
##### Returns
|
||||
|
||||
`void` \| `Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
CallbackManagerMethods.onRetrieve
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/callbacks/CallbackManager.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/callbacks/CallbackManager.ts#L84)
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
---
|
||||
id: "ClipEmbedding"
|
||||
title: "Class: ClipEmbedding"
|
||||
sidebar_label: "ClipEmbedding"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`MultiModalEmbedding`](MultiModalEmbedding.md)
|
||||
|
||||
↳ **`ClipEmbedding`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ClipEmbedding**()
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[MultiModalEmbedding](MultiModalEmbedding.md).[constructor](MultiModalEmbedding.md#constructor)
|
||||
|
||||
## Properties
|
||||
|
||||
### modelType
|
||||
|
||||
• **modelType**: [`ClipEmbeddingModelType`](../enums/ClipEmbeddingModelType.md) = `ClipEmbeddingModelType.XENOVA_CLIP_VIT_BASE_PATCH16`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L11)
|
||||
|
||||
---
|
||||
|
||||
### processor
|
||||
|
||||
• `Private` **processor**: `any`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L15)
|
||||
|
||||
---
|
||||
|
||||
### textModel
|
||||
|
||||
• `Private` **textModel**: `any`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L17)
|
||||
|
||||
---
|
||||
|
||||
### tokenizer
|
||||
|
||||
• `Private` **tokenizer**: `any`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L14)
|
||||
|
||||
---
|
||||
|
||||
### visionModel
|
||||
|
||||
• `Private` **visionModel**: `any`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L16)
|
||||
|
||||
## Methods
|
||||
|
||||
### getImageEmbedding
|
||||
|
||||
▸ **getImageEmbedding**(`image`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :--------------------------- |
|
||||
| `image` | [`ImageType`](../#imagetype) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[MultiModalEmbedding](MultiModalEmbedding.md).[getImageEmbedding](MultiModalEmbedding.md#getimageembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L61)
|
||||
|
||||
---
|
||||
|
||||
### getImageEmbeddings
|
||||
|
||||
▸ **getImageEmbeddings**(`images`): `Promise`<`number`[][]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :----------------------------- |
|
||||
| `images` | [`ImageType`](../#imagetype)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[][]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[MultiModalEmbedding](MultiModalEmbedding.md).[getImageEmbeddings](MultiModalEmbedding.md#getimageembeddings)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/MultiModalEmbedding.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/MultiModalEmbedding.ts#L11)
|
||||
|
||||
---
|
||||
|
||||
### getProcessor
|
||||
|
||||
▸ **getProcessor**(): `Promise`<`any`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L27)
|
||||
|
||||
---
|
||||
|
||||
### getQueryEmbedding
|
||||
|
||||
▸ **getQueryEmbedding**(`query`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[MultiModalEmbedding](MultiModalEmbedding.md).[getQueryEmbedding](MultiModalEmbedding.md#getqueryembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L76)
|
||||
|
||||
---
|
||||
|
||||
### getTextEmbedding
|
||||
|
||||
▸ **getTextEmbedding**(`text`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :------- |
|
||||
| `text` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[MultiModalEmbedding](MultiModalEmbedding.md).[getTextEmbedding](MultiModalEmbedding.md#gettextembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L68)
|
||||
|
||||
---
|
||||
|
||||
### getTextModel
|
||||
|
||||
▸ **getTextModel**(): `Promise`<`any`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L48)
|
||||
|
||||
---
|
||||
|
||||
### getTokenizer
|
||||
|
||||
▸ **getTokenizer**(): `Promise`<`any`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L19)
|
||||
|
||||
---
|
||||
|
||||
### getVisionModel
|
||||
|
||||
▸ **getVisionModel**(): `Promise`<`any`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L35)
|
||||
|
||||
---
|
||||
|
||||
### similarity
|
||||
|
||||
▸ **similarity**(`embedding1`, `embedding2`, `mode?`): `number`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :--------------------------------------------- | :----------------------- |
|
||||
| `embedding1` | `number`[] | `undefined` |
|
||||
| `embedding2` | `number`[] | `undefined` |
|
||||
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[MultiModalEmbedding](MultiModalEmbedding.md).[similarity](MultiModalEmbedding.md#similarity)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L14)
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
---
|
||||
id: "CompactAndRefine"
|
||||
title: "Class: CompactAndRefine"
|
||||
sidebar_label: "CompactAndRefine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
CompactAndRefine is a slight variation of Refine that first compacts the text chunks into the smallest possible number of chunks.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Refine`](Refine.md)
|
||||
|
||||
↳ **`CompactAndRefine`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new CompactAndRefine**(`serviceContext`, `textQATemplate?`, `refineTemplate?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---------------- | :-------------------------------------------------- |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `textQATemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
| `refineTemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Refine](Refine.md).[constructor](Refine.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:82](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L82)
|
||||
|
||||
## Properties
|
||||
|
||||
### refineTemplate
|
||||
|
||||
• **refineTemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Refine](Refine.md).[refineTemplate](Refine.md#refinetemplate)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L80)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Refine](Refine.md).[serviceContext](Refine.md#servicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L78)
|
||||
|
||||
---
|
||||
|
||||
### textQATemplate
|
||||
|
||||
• **textQATemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Refine](Refine.md).[textQATemplate](Refine.md#textqatemplate)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:79](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L79)
|
||||
|
||||
## Methods
|
||||
|
||||
### getResponse
|
||||
|
||||
▸ **getResponse**(`query`, `textChunks`, `parentEvent?`, `prevResponse?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------- | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
| `prevResponse?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Refine](Refine.md).[getResponse](Refine.md#getresponse)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:185](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L185)
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
---
|
||||
id: "CondenseQuestionChatEngine"
|
||||
title: "Class: CondenseQuestionChatEngine"
|
||||
sidebar_label: "CondenseQuestionChatEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
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
|
||||
the response.
|
||||
CondenseQuestionChatEngine performs well when the input is primarily questions about the
|
||||
underlying data. It performs less well when the chat messages are not questions about the
|
||||
data, or are very referential to previous context.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`ChatEngine`](../interfaces/ChatEngine.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new CondenseQuestionChatEngine**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---------------------------- | :---------------------------------------------------- |
|
||||
| `init` | `Object` |
|
||||
| `init.chatHistory` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `init.condenseMessagePrompt?` | (`__namedParameters`: `Object`) => `string` |
|
||||
| `init.queryEngine` | [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md) |
|
||||
| `init.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:122](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L122)
|
||||
|
||||
## Properties
|
||||
|
||||
### chatHistory
|
||||
|
||||
• **chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:118](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L118)
|
||||
|
||||
---
|
||||
|
||||
### condenseMessagePrompt
|
||||
|
||||
• **condenseMessagePrompt**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:120](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L120)
|
||||
|
||||
---
|
||||
|
||||
### queryEngine
|
||||
|
||||
• **queryEngine**: [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:117](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L117)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L119)
|
||||
|
||||
## Methods
|
||||
|
||||
### chat
|
||||
|
||||
▸ **chat**<`T`, `R`\>(`message`, `chatHistory?`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :---------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`Response`](Response.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------- |
|
||||
| `message` | [`MessageContent`](../#messagecontent) | |
|
||||
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
|
||||
| `streaming?` | `T` | optional streaming flag, which auto-sets the return value if True. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[chat](../interfaces/ChatEngine.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:147](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L147)
|
||||
|
||||
---
|
||||
|
||||
### condenseQuestion
|
||||
|
||||
▸ `Private` **condenseQuestion**(`chatHistory`, `question`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :---------------------------------------------- |
|
||||
| `chatHistory` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `question` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:136](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L136)
|
||||
|
||||
---
|
||||
|
||||
### reset
|
||||
|
||||
▸ **reset**(): `void`
|
||||
|
||||
Resets the chat history so that it's empty.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:169](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L169)
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
---
|
||||
id: "ContextChatEngine"
|
||||
title: "Class: ContextChatEngine"
|
||||
sidebar_label: "ContextChatEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
ContextChatEngine uses the Index to get the appropriate context for each query.
|
||||
The context is stored in the system prompt, and the chat history is preserved,
|
||||
ideally allowing the appropriate context to be surfaced for each query.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`ChatEngine`](../interfaces/ChatEngine.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ContextChatEngine**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------------------- | :------------------------------------------------------------------ |
|
||||
| `init` | `Object` |
|
||||
| `init.chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `init.chatModel?` | [`LLM`](../interfaces/LLM.md) |
|
||||
| `init.contextSystemPrompt?` | (`__namedParameters`: `Object`) => `string` |
|
||||
| `init.nodePostprocessors?` | [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[] |
|
||||
| `init.retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:243](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L243)
|
||||
|
||||
## Properties
|
||||
|
||||
### chatHistory
|
||||
|
||||
• **chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:240](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L240)
|
||||
|
||||
---
|
||||
|
||||
### chatModel
|
||||
|
||||
• **chatModel**: [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:239](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L239)
|
||||
|
||||
---
|
||||
|
||||
### contextGenerator
|
||||
|
||||
• **contextGenerator**: [`ContextGenerator`](../interfaces/ContextGenerator.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:241](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L241)
|
||||
|
||||
## Methods
|
||||
|
||||
### chat
|
||||
|
||||
▸ **chat**<`T`, `R`\>(`message`, `chatHistory?`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :---------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`Response`](Response.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------- |
|
||||
| `message` | [`MessageContent`](../#messagecontent) | |
|
||||
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
|
||||
| `streaming?` | `T` | optional streaming flag, which auto-sets the return value if True. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[chat](../interfaces/ChatEngine.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:259](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L259)
|
||||
|
||||
---
|
||||
|
||||
### reset
|
||||
|
||||
▸ **reset**(): `void`
|
||||
|
||||
Resets the chat history so that it's empty.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:336](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L336)
|
||||
|
||||
---
|
||||
|
||||
### streamChat
|
||||
|
||||
▸ `Protected` **streamChat**(`message`, `chatHistory?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :---------------------------------------------- |
|
||||
| `message` | [`MessageContent`](../#messagecontent) |
|
||||
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:300](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L300)
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
---
|
||||
id: "DefaultContextGenerator"
|
||||
title: "Class: DefaultContextGenerator"
|
||||
sidebar_label: "DefaultContextGenerator"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Implements
|
||||
|
||||
- [`ContextGenerator`](../interfaces/ContextGenerator.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new DefaultContextGenerator**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------------------- | :------------------------------------------------------------------ |
|
||||
| `init` | `Object` |
|
||||
| `init.contextSystemPrompt?` | (`__namedParameters`: `Object`) => `string` |
|
||||
| `init.nodePostprocessors?` | [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[] |
|
||||
| `init.retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:188](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L188)
|
||||
|
||||
## Properties
|
||||
|
||||
### contextSystemPrompt
|
||||
|
||||
• **contextSystemPrompt**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:185](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L185)
|
||||
|
||||
---
|
||||
|
||||
### nodePostprocessors
|
||||
|
||||
• **nodePostprocessors**: [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:186](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L186)
|
||||
|
||||
---
|
||||
|
||||
### retriever
|
||||
|
||||
• **retriever**: [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:184](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L184)
|
||||
|
||||
## Methods
|
||||
|
||||
### applyNodePostprocessors
|
||||
|
||||
▸ `Private` **applyNodePostprocessors**(`nodes`): [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------------------------------- |
|
||||
| `nodes` | [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:199](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L199)
|
||||
|
||||
---
|
||||
|
||||
### generate
|
||||
|
||||
▸ **generate**(`message`, `parentEvent?`): `Promise`<[`Context`](../interfaces/Context.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `message` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Context`](../interfaces/Context.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ContextGenerator](../interfaces/ContextGenerator.md).[generate](../interfaces/ContextGenerator.md#generate)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:206](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L206)
|
||||
@@ -0,0 +1,504 @@
|
||||
---
|
||||
id: "Document"
|
||||
title: "Class: Document<T>"
|
||||
sidebar_label: "Document"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A document is just a special text node with a docId.
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`TextNode`](TextNode.md)<`T`\>
|
||||
|
||||
↳ **`Document`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new Document**<`T`\>(`init?`)
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------ |
|
||||
| `init?` | `Partial`<[`Document`](Document.md)<`T`\>\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:254](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L254)
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• `Optional` **embedding**: `number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[embedding](TextNode.md#embedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
|
||||
|
||||
---
|
||||
|
||||
### endCharIdx
|
||||
|
||||
• `Optional` **endCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[endCharIdx](TextNode.md#endcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L157)
|
||||
|
||||
---
|
||||
|
||||
### excludedEmbedMetadataKeys
|
||||
|
||||
• **excludedEmbedMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[excludedEmbedMetadataKeys](TextNode.md#excludedembedmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
|
||||
|
||||
---
|
||||
|
||||
### excludedLlmMetadataKeys
|
||||
|
||||
• **excludedLlmMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[excludedLlmMetadataKeys](TextNode.md#excludedllmmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
|
||||
|
||||
---
|
||||
|
||||
### hash
|
||||
|
||||
• **hash**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[hash](TextNode.md#hash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
|
||||
|
||||
---
|
||||
|
||||
### id\_
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[id\_](TextNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
|
||||
|
||||
---
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `T`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[metadata](TextNode.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
|
||||
|
||||
---
|
||||
|
||||
### metadataSeparator
|
||||
|
||||
• **metadataSeparator**: `string` = `"\n"`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[metadataSeparator](TextNode.md#metadataseparator)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:160](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L160)
|
||||
|
||||
---
|
||||
|
||||
### relationships
|
||||
|
||||
• **relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[relationships](TextNode.md#relationships)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
|
||||
|
||||
---
|
||||
|
||||
### startCharIdx
|
||||
|
||||
• `Optional` **startCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[startCharIdx](TextNode.md#startcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L156)
|
||||
|
||||
---
|
||||
|
||||
### text
|
||||
|
||||
• **text**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[text](TextNode.md#text)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L155)
|
||||
|
||||
## Accessors
|
||||
|
||||
### childNodes
|
||||
|
||||
• `get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
|
||||
|
||||
---
|
||||
|
||||
### nextNode
|
||||
|
||||
• `get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
|
||||
|
||||
---
|
||||
|
||||
### parentNode
|
||||
|
||||
• `get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
|
||||
|
||||
---
|
||||
|
||||
### prevNode
|
||||
|
||||
• `get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
|
||||
|
||||
---
|
||||
|
||||
### sourceNode
|
||||
|
||||
• `get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRelatedNodeInfo
|
||||
|
||||
▸ **asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[asRelatedNodeInfo](TextNode.md#asrelatednodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
|
||||
|
||||
---
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[generateHash](TextNode.md#generatehash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L178)
|
||||
|
||||
---
|
||||
|
||||
### getContent
|
||||
|
||||
▸ **getContent**(`metadataMode?`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------- | :----------------------------------------- | :------------------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getContent](TextNode.md#getcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L192)
|
||||
|
||||
---
|
||||
|
||||
### getEmbedding
|
||||
|
||||
▸ **getEmbedding**(): `number`[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getEmbedding](TextNode.md#getembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
|
||||
|
||||
---
|
||||
|
||||
### getMetadataStr
|
||||
|
||||
▸ **getMetadataStr**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :----------------------------------------- |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getMetadataStr](TextNode.md#getmetadatastr)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L197)
|
||||
|
||||
---
|
||||
|
||||
### getNodeInfo
|
||||
|
||||
▸ **getNodeInfo**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :---------------------- |
|
||||
| `end` | `undefined` \| `number` |
|
||||
| `start` | `undefined` \| `number` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getNodeInfo](TextNode.md#getnodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L224)
|
||||
|
||||
---
|
||||
|
||||
### getText
|
||||
|
||||
▸ **getText**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getText](TextNode.md#gettext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:228](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L228)
|
||||
|
||||
---
|
||||
|
||||
### getType
|
||||
|
||||
▸ **getType**(): [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[TextNode](TextNode.md).[getType](TextNode.md#gettype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:263](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L263)
|
||||
|
||||
---
|
||||
|
||||
### setContent
|
||||
|
||||
▸ **setContent**(`value`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `value` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[setContent](TextNode.md#setcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:218](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L218)
|
||||
|
||||
---
|
||||
|
||||
### toJSON
|
||||
|
||||
▸ **toJSON**(): `Record`<`string`, `any`\>
|
||||
|
||||
Used with built in JSON.stringify
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `any`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[toJSON](TextNode.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
|
||||
@@ -0,0 +1,109 @@
|
||||
---
|
||||
id: "HTMLReader"
|
||||
title: "Class: HTMLReader"
|
||||
sidebar_label: "HTMLReader"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Extract the significant text from an arbitrary HTML document.
|
||||
The contents of any head, script, style, and xml tags are removed completely.
|
||||
The URLs for a[href] tags are extracted, along with the inner text of the tag.
|
||||
All other tags are removed, and the inner text is kept intact.
|
||||
Html entities (e.g., &) are not decoded.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseReader`](../interfaces/BaseReader.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new HTMLReader**()
|
||||
|
||||
## Methods
|
||||
|
||||
### getOptions
|
||||
|
||||
▸ **getOptions**(): `Object`
|
||||
|
||||
Wrapper for our configuration options passed to string-strip-html library
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
An object of options for the underlying library
|
||||
|
||||
| Name | Type |
|
||||
| :------------------------------- | :--------- |
|
||||
| `skipHtmlDecoding` | `boolean` |
|
||||
| `stripTogetherWithTheirContents` | `string`[] |
|
||||
|
||||
**`See`**
|
||||
|
||||
https://codsen.com/os/string-strip-html/examples
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/HTMLReader.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/HTMLReader.ts#L48)
|
||||
|
||||
---
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
Public method for this reader.
|
||||
Required by BaseReader interface.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :----- | :-------------------------------------------------------- | :------------ | :------------------------------------------------- |
|
||||
| `file` | `string` | `undefined` | Path/name of the file to be loaded. |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` | fs wrapper interface for getting the file content. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
Promise<Document[]> A Promise object, eventually yielding zero or one Document parsed from the HTML content of the specified file.
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/HTMLReader.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/HTMLReader.ts#L21)
|
||||
|
||||
---
|
||||
|
||||
### parseContent
|
||||
|
||||
▸ **parseContent**(`html`, `options?`): `Promise`<`string`\>
|
||||
|
||||
Wrapper for string-strip-html usage.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :-------- | :------- | :---------------------------------------------- |
|
||||
| `html` | `string` | Raw HTML content to be parsed. |
|
||||
| `options` | `any` | An object of options for the underlying library |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
The HTML content, stripped of unwanted tags and attributes
|
||||
|
||||
**`See`**
|
||||
|
||||
getOptions
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/HTMLReader.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/HTMLReader.ts#L38)
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
---
|
||||
id: "HistoryChatEngine"
|
||||
title: "Class: HistoryChatEngine"
|
||||
sidebar_label: "HistoryChatEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
HistoryChatEngine is a ChatEngine that uses a `ChatHistory` object
|
||||
to keeps track of chat's message history.
|
||||
A `ChatHistory` object is passed as a parameter for each call to the `chat` method,
|
||||
so the state of the chat engine is preserved between calls.
|
||||
Optionally, a `ContextGenerator` can be used to generate an additional context for each call to `chat`.
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new HistoryChatEngine**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------ |
|
||||
| `init?` | `Partial`<[`HistoryChatEngine`](HistoryChatEngine.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:381](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L381)
|
||||
|
||||
## Properties
|
||||
|
||||
### contextGenerator
|
||||
|
||||
• `Optional` **contextGenerator**: [`ContextGenerator`](../interfaces/ContextGenerator.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:379](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L379)
|
||||
|
||||
---
|
||||
|
||||
### llm
|
||||
|
||||
• **llm**: [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:378](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L378)
|
||||
|
||||
## Methods
|
||||
|
||||
### chat
|
||||
|
||||
▸ **chat**<`T`, `R`\>(`message`, `chatHistory`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :---------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`Response`](Response.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------- |
|
||||
| `message` | [`MessageContent`](../#messagecontent) |
|
||||
| `chatHistory` | [`ChatHistory`](../interfaces/ChatHistory.md) |
|
||||
| `streaming?` | `T` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:386](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L386)
|
||||
|
||||
---
|
||||
|
||||
### prepareRequestMessages
|
||||
|
||||
▸ `Private` **prepareRequestMessages**(`message`, `chatHistory`): `Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------- |
|
||||
| `message` | [`MessageContent`](../#messagecontent) |
|
||||
| `chatHistory` | [`ChatHistory`](../interfaces/ChatHistory.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:433](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L433)
|
||||
|
||||
---
|
||||
|
||||
### streamChat
|
||||
|
||||
▸ `Protected` **streamChat**(`message`, `chatHistory`): `AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------- |
|
||||
| `message` | [`MessageContent`](../#messagecontent) |
|
||||
| `chatHistory` | [`ChatHistory`](../interfaces/ChatHistory.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:407](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L407)
|
||||
+518
@@ -0,0 +1,518 @@
|
||||
---
|
||||
id: "ImageDocument"
|
||||
title: "Class: ImageDocument<T>"
|
||||
sidebar_label: "ImageDocument"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`ImageNode`](ImageNode.md)<`T`\>
|
||||
|
||||
↳ **`ImageDocument`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ImageDocument**<`T`\>(`init`)
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :----------------------------------------------------------------- |
|
||||
| `init` | [`ImageNodeConstructorProps`](../#imagenodeconstructorprops)<`T`\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[ImageNode](ImageNode.md).[constructor](ImageNode.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:310](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L310)
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• `Optional` **embedding**: `number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[embedding](ImageNode.md#embedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
|
||||
|
||||
---
|
||||
|
||||
### endCharIdx
|
||||
|
||||
• `Optional` **endCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[endCharIdx](ImageNode.md#endcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L157)
|
||||
|
||||
---
|
||||
|
||||
### excludedEmbedMetadataKeys
|
||||
|
||||
• **excludedEmbedMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[excludedEmbedMetadataKeys](ImageNode.md#excludedembedmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
|
||||
|
||||
---
|
||||
|
||||
### excludedLlmMetadataKeys
|
||||
|
||||
• **excludedLlmMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[excludedLlmMetadataKeys](ImageNode.md#excludedllmmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
|
||||
|
||||
---
|
||||
|
||||
### hash
|
||||
|
||||
• **hash**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[hash](ImageNode.md#hash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
|
||||
|
||||
---
|
||||
|
||||
### id\_
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[id\_](ImageNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
|
||||
|
||||
---
|
||||
|
||||
### image
|
||||
|
||||
• **image**: [`ImageType`](../#imagetype)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[image](ImageNode.md#image)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:297](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L297)
|
||||
|
||||
---
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `T`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[metadata](ImageNode.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
|
||||
|
||||
---
|
||||
|
||||
### metadataSeparator
|
||||
|
||||
• **metadataSeparator**: `string` = `"\n"`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[metadataSeparator](ImageNode.md#metadataseparator)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:160](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L160)
|
||||
|
||||
---
|
||||
|
||||
### relationships
|
||||
|
||||
• **relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[relationships](ImageNode.md#relationships)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
|
||||
|
||||
---
|
||||
|
||||
### startCharIdx
|
||||
|
||||
• `Optional` **startCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[startCharIdx](ImageNode.md#startcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L156)
|
||||
|
||||
---
|
||||
|
||||
### text
|
||||
|
||||
• **text**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[text](ImageNode.md#text)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L155)
|
||||
|
||||
## Accessors
|
||||
|
||||
### childNodes
|
||||
|
||||
• `get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
ImageNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
|
||||
|
||||
---
|
||||
|
||||
### nextNode
|
||||
|
||||
• `get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
ImageNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
|
||||
|
||||
---
|
||||
|
||||
### parentNode
|
||||
|
||||
• `get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
ImageNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
|
||||
|
||||
---
|
||||
|
||||
### prevNode
|
||||
|
||||
• `get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
ImageNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
|
||||
|
||||
---
|
||||
|
||||
### sourceNode
|
||||
|
||||
• `get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
ImageNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRelatedNodeInfo
|
||||
|
||||
▸ **asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[asRelatedNodeInfo](ImageNode.md#asrelatednodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
|
||||
|
||||
---
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[generateHash](ImageNode.md#generatehash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L178)
|
||||
|
||||
---
|
||||
|
||||
### getContent
|
||||
|
||||
▸ **getContent**(`metadataMode?`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------- | :----------------------------------------- | :------------------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[getContent](ImageNode.md#getcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L192)
|
||||
|
||||
---
|
||||
|
||||
### getEmbedding
|
||||
|
||||
▸ **getEmbedding**(): `number`[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[getEmbedding](ImageNode.md#getembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
|
||||
|
||||
---
|
||||
|
||||
### getMetadataStr
|
||||
|
||||
▸ **getMetadataStr**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :----------------------------------------- |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[getMetadataStr](ImageNode.md#getmetadatastr)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L197)
|
||||
|
||||
---
|
||||
|
||||
### getNodeInfo
|
||||
|
||||
▸ **getNodeInfo**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :---------------------- |
|
||||
| `end` | `undefined` \| `number` |
|
||||
| `start` | `undefined` \| `number` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[getNodeInfo](ImageNode.md#getnodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L224)
|
||||
|
||||
---
|
||||
|
||||
### getText
|
||||
|
||||
▸ **getText**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[getText](ImageNode.md#gettext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:228](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L228)
|
||||
|
||||
---
|
||||
|
||||
### getType
|
||||
|
||||
▸ **getType**(): [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[ImageNode](ImageNode.md).[getType](ImageNode.md#gettype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:318](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L318)
|
||||
|
||||
---
|
||||
|
||||
### setContent
|
||||
|
||||
▸ **setContent**(`value`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `value` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[setContent](ImageNode.md#setcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:218](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L218)
|
||||
|
||||
---
|
||||
|
||||
### toJSON
|
||||
|
||||
▸ **toJSON**(): `Record`<`string`, `any`\>
|
||||
|
||||
Used with built in JSON.stringify
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `any`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[ImageNode](ImageNode.md).[toJSON](ImageNode.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
|
||||
@@ -0,0 +1,516 @@
|
||||
---
|
||||
id: "ImageNode"
|
||||
title: "Class: ImageNode<T>"
|
||||
sidebar_label: "ImageNode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`TextNode`](TextNode.md)<`T`\>
|
||||
|
||||
↳ **`ImageNode`**
|
||||
|
||||
↳↳ [`ImageDocument`](ImageDocument.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ImageNode**<`T`\>(`init`)
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :----------------------------------------------------------------- |
|
||||
| `init` | [`ImageNodeConstructorProps`](../#imagenodeconstructorprops)<`T`\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:299](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L299)
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• `Optional` **embedding**: `number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[embedding](TextNode.md#embedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
|
||||
|
||||
---
|
||||
|
||||
### endCharIdx
|
||||
|
||||
• `Optional` **endCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[endCharIdx](TextNode.md#endcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L157)
|
||||
|
||||
---
|
||||
|
||||
### excludedEmbedMetadataKeys
|
||||
|
||||
• **excludedEmbedMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[excludedEmbedMetadataKeys](TextNode.md#excludedembedmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
|
||||
|
||||
---
|
||||
|
||||
### excludedLlmMetadataKeys
|
||||
|
||||
• **excludedLlmMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[excludedLlmMetadataKeys](TextNode.md#excludedllmmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
|
||||
|
||||
---
|
||||
|
||||
### hash
|
||||
|
||||
• **hash**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[hash](TextNode.md#hash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
|
||||
|
||||
---
|
||||
|
||||
### id\_
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[id\_](TextNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
|
||||
|
||||
---
|
||||
|
||||
### image
|
||||
|
||||
• **image**: [`ImageType`](../#imagetype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:297](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L297)
|
||||
|
||||
---
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `T`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[metadata](TextNode.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
|
||||
|
||||
---
|
||||
|
||||
### metadataSeparator
|
||||
|
||||
• **metadataSeparator**: `string` = `"\n"`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[metadataSeparator](TextNode.md#metadataseparator)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:160](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L160)
|
||||
|
||||
---
|
||||
|
||||
### relationships
|
||||
|
||||
• **relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[relationships](TextNode.md#relationships)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
|
||||
|
||||
---
|
||||
|
||||
### startCharIdx
|
||||
|
||||
• `Optional` **startCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[startCharIdx](TextNode.md#startcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L156)
|
||||
|
||||
---
|
||||
|
||||
### text
|
||||
|
||||
• **text**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[text](TextNode.md#text)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L155)
|
||||
|
||||
## Accessors
|
||||
|
||||
### childNodes
|
||||
|
||||
• `get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
|
||||
|
||||
---
|
||||
|
||||
### nextNode
|
||||
|
||||
• `get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
|
||||
|
||||
---
|
||||
|
||||
### parentNode
|
||||
|
||||
• `get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
|
||||
|
||||
---
|
||||
|
||||
### prevNode
|
||||
|
||||
• `get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
|
||||
|
||||
---
|
||||
|
||||
### sourceNode
|
||||
|
||||
• `get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRelatedNodeInfo
|
||||
|
||||
▸ **asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[asRelatedNodeInfo](TextNode.md#asrelatednodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
|
||||
|
||||
---
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[generateHash](TextNode.md#generatehash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L178)
|
||||
|
||||
---
|
||||
|
||||
### getContent
|
||||
|
||||
▸ **getContent**(`metadataMode?`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------- | :----------------------------------------- | :------------------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getContent](TextNode.md#getcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L192)
|
||||
|
||||
---
|
||||
|
||||
### getEmbedding
|
||||
|
||||
▸ **getEmbedding**(): `number`[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getEmbedding](TextNode.md#getembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
|
||||
|
||||
---
|
||||
|
||||
### getMetadataStr
|
||||
|
||||
▸ **getMetadataStr**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :----------------------------------------- |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getMetadataStr](TextNode.md#getmetadatastr)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L197)
|
||||
|
||||
---
|
||||
|
||||
### getNodeInfo
|
||||
|
||||
▸ **getNodeInfo**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :---------------------- |
|
||||
| `end` | `undefined` \| `number` |
|
||||
| `start` | `undefined` \| `number` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getNodeInfo](TextNode.md#getnodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L224)
|
||||
|
||||
---
|
||||
|
||||
### getText
|
||||
|
||||
▸ **getText**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getText](TextNode.md#gettext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:228](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L228)
|
||||
|
||||
---
|
||||
|
||||
### getType
|
||||
|
||||
▸ **getType**(): [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[TextNode](TextNode.md).[getType](TextNode.md#gettype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:304](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L304)
|
||||
|
||||
---
|
||||
|
||||
### setContent
|
||||
|
||||
▸ **setContent**(`value`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `value` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[setContent](TextNode.md#setcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:218](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L218)
|
||||
|
||||
---
|
||||
|
||||
### toJSON
|
||||
|
||||
▸ **toJSON**(): `Record`<`string`, `any`\>
|
||||
|
||||
Used with built in JSON.stringify
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `any`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[toJSON](TextNode.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
---
|
||||
id: "InMemoryFileSystem"
|
||||
title: "Class: InMemoryFileSystem"
|
||||
sidebar_label: "InMemoryFileSystem"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A filesystem implementation that stores files in memory.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`GenericFileSystem`](../interfaces/GenericFileSystem.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new InMemoryFileSystem**()
|
||||
|
||||
## Properties
|
||||
|
||||
### files
|
||||
|
||||
• `Private` **files**: `Record`<`string`, `any`\> = `{}`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/FileSystem.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/FileSystem.ts#L25)
|
||||
|
||||
## Methods
|
||||
|
||||
### access
|
||||
|
||||
▸ **access**(`path`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :------- |
|
||||
| `path` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[GenericFileSystem](../interfaces/GenericFileSystem.md).[access](../interfaces/GenericFileSystem.md#access)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/FileSystem.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/FileSystem.ts#L38)
|
||||
|
||||
---
|
||||
|
||||
### mkdir
|
||||
|
||||
▸ **mkdir**(`path`, `options?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :------- |
|
||||
| `path` | `string` |
|
||||
| `options?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[GenericFileSystem](../interfaces/GenericFileSystem.md).[mkdir](../interfaces/GenericFileSystem.md#mkdir)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/FileSystem.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/FileSystem.ts#L44)
|
||||
|
||||
---
|
||||
|
||||
### readFile
|
||||
|
||||
▸ **readFile**(`path`, `options?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :------- |
|
||||
| `path` | `string` |
|
||||
| `options?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[GenericFileSystem](../interfaces/GenericFileSystem.md).[readFile](../interfaces/GenericFileSystem.md#readfile)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/FileSystem.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/FileSystem.ts#L31)
|
||||
|
||||
---
|
||||
|
||||
### writeFile
|
||||
|
||||
▸ **writeFile**(`path`, `content`, `options?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :------- |
|
||||
| `path` | `string` |
|
||||
| `content` | `string` |
|
||||
| `options?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[GenericFileSystem](../interfaces/GenericFileSystem.md).[writeFile](../interfaces/GenericFileSystem.md#writefile)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/FileSystem.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/FileSystem.ts#L27)
|
||||
@@ -0,0 +1,161 @@
|
||||
---
|
||||
id: "IndexDict"
|
||||
title: "Class: IndexDict"
|
||||
sidebar_label: "IndexDict"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The underlying structure of each index.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`IndexStruct`](IndexStruct.md)
|
||||
|
||||
↳ **`IndexDict`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new IndexDict**(`indexId?`, `summary?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :-------- | :---------- | :------------ |
|
||||
| `indexId` | `string` | `undefined` |
|
||||
| `summary` | `undefined` | `undefined` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[constructor](IndexStruct.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[indexId](IndexStruct.md#indexid)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L16)
|
||||
|
||||
---
|
||||
|
||||
### nodesDict
|
||||
|
||||
• **nodesDict**: `Record`<`string`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\> = `{}`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L46)
|
||||
|
||||
---
|
||||
|
||||
### summary
|
||||
|
||||
• `Optional` **summary**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[summary](IndexStruct.md#summary)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L17)
|
||||
|
||||
---
|
||||
|
||||
### type
|
||||
|
||||
• **type**: [`IndexStructType`](../enums/IndexStructType.md) = `IndexStructType.SIMPLE_DICT`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L47)
|
||||
|
||||
## Methods
|
||||
|
||||
### addNode
|
||||
|
||||
▸ **addNode**(`node`, `textId?`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :----------------------------------------------------- |
|
||||
| `node` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\> |
|
||||
| `textId?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L56)
|
||||
|
||||
---
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`nodeId`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :------- |
|
||||
| `nodeId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L69)
|
||||
|
||||
---
|
||||
|
||||
### getSummary
|
||||
|
||||
▸ **getSummary**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[IndexStruct](IndexStruct.md).[getSummary](IndexStruct.md#getsummary)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L49)
|
||||
|
||||
---
|
||||
|
||||
### toJson
|
||||
|
||||
▸ **toJson**(): `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `unknown`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[IndexStruct](IndexStruct.md).[toJson](IndexStruct.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L61)
|
||||
@@ -0,0 +1,140 @@
|
||||
---
|
||||
id: "IndexList"
|
||||
title: "Class: IndexList"
|
||||
sidebar_label: "IndexList"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The underlying structure of each index.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`IndexStruct`](IndexStruct.md)
|
||||
|
||||
↳ **`IndexList`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new IndexList**(`indexId?`, `summary?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :-------- | :---------- | :------------ |
|
||||
| `indexId` | `string` | `undefined` |
|
||||
| `summary` | `undefined` | `undefined` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[constructor](IndexStruct.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[indexId](IndexStruct.md#indexid)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L16)
|
||||
|
||||
---
|
||||
|
||||
### nodes
|
||||
|
||||
• **nodes**: `string`[] = `[]`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L94)
|
||||
|
||||
---
|
||||
|
||||
### summary
|
||||
|
||||
• `Optional` **summary**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[summary](IndexStruct.md#summary)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L17)
|
||||
|
||||
---
|
||||
|
||||
### type
|
||||
|
||||
• **type**: [`IndexStructType`](../enums/IndexStructType.md) = `IndexStructType.LIST`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:95](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L95)
|
||||
|
||||
## Methods
|
||||
|
||||
### addNode
|
||||
|
||||
▸ **addNode**(`node`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :----------------------------------------------------- |
|
||||
| `node` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L97)
|
||||
|
||||
---
|
||||
|
||||
### getSummary
|
||||
|
||||
▸ **getSummary**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[getSummary](IndexStruct.md#getsummary)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L31)
|
||||
|
||||
---
|
||||
|
||||
### toJson
|
||||
|
||||
▸ **toJson**(): `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `unknown`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[IndexStruct](IndexStruct.md).[toJson](IndexStruct.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L101)
|
||||
@@ -0,0 +1,514 @@
|
||||
---
|
||||
id: "IndexNode"
|
||||
title: "Class: IndexNode<T>"
|
||||
sidebar_label: "IndexNode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`TextNode`](TextNode.md)<`T`\>
|
||||
|
||||
↳ **`IndexNode`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new IndexNode**<`T`\>(`init?`)
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :-------------------------------------------- |
|
||||
| `init?` | `Partial`<[`IndexNode`](IndexNode.md)<`T`\>\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:236](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L236)
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• `Optional` **embedding**: `number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[embedding](TextNode.md#embedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
|
||||
|
||||
---
|
||||
|
||||
### endCharIdx
|
||||
|
||||
• `Optional` **endCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[endCharIdx](TextNode.md#endcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L157)
|
||||
|
||||
---
|
||||
|
||||
### excludedEmbedMetadataKeys
|
||||
|
||||
• **excludedEmbedMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[excludedEmbedMetadataKeys](TextNode.md#excludedembedmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
|
||||
|
||||
---
|
||||
|
||||
### excludedLlmMetadataKeys
|
||||
|
||||
• **excludedLlmMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[excludedLlmMetadataKeys](TextNode.md#excludedllmmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
|
||||
|
||||
---
|
||||
|
||||
### hash
|
||||
|
||||
• **hash**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[hash](TextNode.md#hash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
|
||||
|
||||
---
|
||||
|
||||
### id\_
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[id\_](TextNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
|
||||
|
||||
---
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string` = `""`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:234](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L234)
|
||||
|
||||
---
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `T`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[metadata](TextNode.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
|
||||
|
||||
---
|
||||
|
||||
### metadataSeparator
|
||||
|
||||
• **metadataSeparator**: `string` = `"\n"`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[metadataSeparator](TextNode.md#metadataseparator)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:160](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L160)
|
||||
|
||||
---
|
||||
|
||||
### relationships
|
||||
|
||||
• **relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[relationships](TextNode.md#relationships)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
|
||||
|
||||
---
|
||||
|
||||
### startCharIdx
|
||||
|
||||
• `Optional` **startCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[startCharIdx](TextNode.md#startcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L156)
|
||||
|
||||
---
|
||||
|
||||
### text
|
||||
|
||||
• **text**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[text](TextNode.md#text)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L155)
|
||||
|
||||
## Accessors
|
||||
|
||||
### childNodes
|
||||
|
||||
• `get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
|
||||
|
||||
---
|
||||
|
||||
### nextNode
|
||||
|
||||
• `get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
|
||||
|
||||
---
|
||||
|
||||
### parentNode
|
||||
|
||||
• `get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
|
||||
|
||||
---
|
||||
|
||||
### prevNode
|
||||
|
||||
• `get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
|
||||
|
||||
---
|
||||
|
||||
### sourceNode
|
||||
|
||||
• `get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRelatedNodeInfo
|
||||
|
||||
▸ **asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[asRelatedNodeInfo](TextNode.md#asrelatednodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
|
||||
|
||||
---
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[generateHash](TextNode.md#generatehash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L178)
|
||||
|
||||
---
|
||||
|
||||
### getContent
|
||||
|
||||
▸ **getContent**(`metadataMode?`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------- | :----------------------------------------- | :------------------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getContent](TextNode.md#getcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L192)
|
||||
|
||||
---
|
||||
|
||||
### getEmbedding
|
||||
|
||||
▸ **getEmbedding**(): `number`[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getEmbedding](TextNode.md#getembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
|
||||
|
||||
---
|
||||
|
||||
### getMetadataStr
|
||||
|
||||
▸ **getMetadataStr**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :----------------------------------------- |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getMetadataStr](TextNode.md#getmetadatastr)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L197)
|
||||
|
||||
---
|
||||
|
||||
### getNodeInfo
|
||||
|
||||
▸ **getNodeInfo**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :---------------------- |
|
||||
| `end` | `undefined` \| `number` |
|
||||
| `start` | `undefined` \| `number` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getNodeInfo](TextNode.md#getnodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L224)
|
||||
|
||||
---
|
||||
|
||||
### getText
|
||||
|
||||
▸ **getText**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getText](TextNode.md#gettext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:228](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L228)
|
||||
|
||||
---
|
||||
|
||||
### getType
|
||||
|
||||
▸ **getType**(): [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[TextNode](TextNode.md).[getType](TextNode.md#gettype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:245](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L245)
|
||||
|
||||
---
|
||||
|
||||
### setContent
|
||||
|
||||
▸ **setContent**(`value`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `value` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[setContent](TextNode.md#setcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:218](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L218)
|
||||
|
||||
---
|
||||
|
||||
### toJSON
|
||||
|
||||
▸ **toJSON**(): `Record`<`string`, `any`\>
|
||||
|
||||
Used with built in JSON.stringify
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `any`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[toJSON](TextNode.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
|
||||
@@ -0,0 +1,84 @@
|
||||
---
|
||||
id: "IndexStruct"
|
||||
title: "Class: IndexStruct"
|
||||
sidebar_label: "IndexStruct"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The underlying structure of each index.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`IndexStruct`**
|
||||
|
||||
↳ [`IndexDict`](IndexDict.md)
|
||||
|
||||
↳ [`IndexList`](IndexList.md)
|
||||
|
||||
↳ [`KeywordTable`](KeywordTable.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new IndexStruct**(`indexId?`, `summary?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :-------- | :---------- | :------------ |
|
||||
| `indexId` | `string` | `undefined` |
|
||||
| `summary` | `undefined` | `undefined` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L16)
|
||||
|
||||
---
|
||||
|
||||
### summary
|
||||
|
||||
• `Optional` **summary**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L17)
|
||||
|
||||
## Methods
|
||||
|
||||
### getSummary
|
||||
|
||||
▸ **getSummary**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L31)
|
||||
|
||||
---
|
||||
|
||||
### toJson
|
||||
|
||||
▸ **toJson**(): `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L24)
|
||||
@@ -0,0 +1,162 @@
|
||||
---
|
||||
id: "KeywordTable"
|
||||
title: "Class: KeywordTable"
|
||||
sidebar_label: "KeywordTable"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The underlying structure of each index.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`IndexStruct`](IndexStruct.md)
|
||||
|
||||
↳ **`KeywordTable`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new KeywordTable**(`indexId?`, `summary?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :-------- | :---------- | :------------ |
|
||||
| `indexId` | `string` | `undefined` |
|
||||
| `summary` | `undefined` | `undefined` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[constructor](IndexStruct.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[indexId](IndexStruct.md#indexid)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L16)
|
||||
|
||||
---
|
||||
|
||||
### summary
|
||||
|
||||
• `Optional` **summary**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[summary](IndexStruct.md#summary)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L17)
|
||||
|
||||
---
|
||||
|
||||
### table
|
||||
|
||||
• **table**: `Map`<`string`, `Set`<`string`\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L112)
|
||||
|
||||
---
|
||||
|
||||
### type
|
||||
|
||||
• **type**: [`IndexStructType`](../enums/IndexStructType.md) = `IndexStructType.KEYWORD_TABLE`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:113](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L113)
|
||||
|
||||
## Methods
|
||||
|
||||
### addNode
|
||||
|
||||
▸ **addNode**(`keywords`, `nodeId`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :--------- |
|
||||
| `keywords` | `string`[] |
|
||||
| `nodeId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:114](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L114)
|
||||
|
||||
---
|
||||
|
||||
### deleteNode
|
||||
|
||||
▸ **deleteNode**(`keywords`, `nodeId`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :--------- |
|
||||
| `keywords` | `string`[] |
|
||||
| `nodeId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L123)
|
||||
|
||||
---
|
||||
|
||||
### getSummary
|
||||
|
||||
▸ **getSummary**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[getSummary](IndexStruct.md#getsummary)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L31)
|
||||
|
||||
---
|
||||
|
||||
### toJson
|
||||
|
||||
▸ **toJson**(): `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `unknown`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[IndexStruct](IndexStruct.md).[toJson](IndexStruct.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L131)
|
||||
+382
@@ -0,0 +1,382 @@
|
||||
---
|
||||
id: "KeywordTableIndex"
|
||||
title: "Class: KeywordTableIndex"
|
||||
sidebar_label: "KeywordTableIndex"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The KeywordTableIndex, an index that extracts keywords from each Node and builds a mapping from each keyword to the corresponding Nodes of that keyword.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseIndex`](BaseIndex.md)<[`KeywordTable`](KeywordTable.md)\>
|
||||
|
||||
↳ **`KeywordTableIndex`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new KeywordTableIndex**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :------------------------------------------------------------------------------------ |
|
||||
| `init` | [`BaseIndexInit`](../interfaces/BaseIndexInit.md)<[`KeywordTable`](KeywordTable.md)\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[constructor](BaseIndex.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L49)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: [`BaseDocumentStore`](BaseDocumentStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[docStore](BaseIndex.md#docstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L156)
|
||||
|
||||
---
|
||||
|
||||
### indexStore
|
||||
|
||||
• `Optional` **indexStore**: [`BaseIndexStore`](BaseIndexStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[indexStore](BaseIndex.md#indexstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:158](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L158)
|
||||
|
||||
---
|
||||
|
||||
### indexStruct
|
||||
|
||||
• **indexStruct**: [`KeywordTable`](KeywordTable.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[indexStruct](BaseIndex.md#indexstruct)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L159)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[serviceContext](BaseIndex.md#servicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:154](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L154)
|
||||
|
||||
---
|
||||
|
||||
### storageContext
|
||||
|
||||
• **storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[storageContext](BaseIndex.md#storagecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L155)
|
||||
|
||||
---
|
||||
|
||||
### vectorStore
|
||||
|
||||
• `Optional` **vectorStore**: [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[vectorStore](BaseIndex.md#vectorstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L157)
|
||||
|
||||
## Methods
|
||||
|
||||
### asQueryEngine
|
||||
|
||||
▸ **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.nodePostprocessors?` | [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[] | - |
|
||||
| `options.preFilters?` | `unknown` | - |
|
||||
| `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
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:130](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L130)
|
||||
|
||||
---
|
||||
|
||||
### asRetriever
|
||||
|
||||
▸ **asRetriever**(`options?`): [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
Create a new retriever from the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---- |
|
||||
| `options?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[asRetriever](BaseIndex.md#asretriever)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L119)
|
||||
|
||||
---
|
||||
|
||||
### deleteNode
|
||||
|
||||
▸ **deleteNode**(`nodeId`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :------- |
|
||||
| `nodeId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L224)
|
||||
|
||||
---
|
||||
|
||||
### deleteNodes
|
||||
|
||||
▸ **deleteNodes**(`nodeIds`, `deleteFromDocStore`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------- | :--------- |
|
||||
| `nodeIds` | `string`[] |
|
||||
| `deleteFromDocStore` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:242](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L242)
|
||||
|
||||
---
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ **deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------------- | :-------- |
|
||||
| `refDocId` | `string` |
|
||||
| `deleteFromDocStore?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[deleteRefDoc](BaseIndex.md#deleterefdoc)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:256](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L256)
|
||||
|
||||
---
|
||||
|
||||
### insert
|
||||
|
||||
▸ **insert**(`document`): `Promise`<`void`\>
|
||||
|
||||
Insert a document into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :----------------------------------------------------- |
|
||||
| `document` | [`Document`](Document.md)<[`Metadata`](../#metadata)\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insert](BaseIndex.md#insert)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:190](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L190)
|
||||
|
||||
---
|
||||
|
||||
### insertNodes
|
||||
|
||||
▸ **insertNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------- |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insertNodes](BaseIndex.md#insertnodes)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:214](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L214)
|
||||
|
||||
---
|
||||
|
||||
### buildIndexFromNodes
|
||||
|
||||
▸ `Static` **buildIndexFromNodes**(`nodes`, `docStore`, `serviceContext`): `Promise`<[`KeywordTable`](KeywordTable.md)\>
|
||||
|
||||
Get keywords for nodes and place them into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------------------------------------------------------- |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
| `docStore` | [`BaseDocumentStore`](BaseDocumentStore.md) |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`KeywordTable`](KeywordTable.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L197)
|
||||
|
||||
---
|
||||
|
||||
### extractKeywords
|
||||
|
||||
▸ `Static` **extractKeywords**(`text`, `serviceContext`): `Promise`<`Set`<`string`\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :-------------------------------------------------- |
|
||||
| `text` | `string` |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Set`<`string`\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:145](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L145)
|
||||
|
||||
---
|
||||
|
||||
### fromDocuments
|
||||
|
||||
▸ `Static` **fromDocuments**(`documents`, `args?`): `Promise`<[`KeywordTableIndex`](KeywordTableIndex.md)\>
|
||||
|
||||
High level API: split documents, get keywords, and build index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------------- | :------------------------------------------------------- |
|
||||
| `documents` | [`Document`](Document.md)<[`Metadata`](../#metadata)\>[] |
|
||||
| `args` | `Object` |
|
||||
| `args.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `args.storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`KeywordTableIndex`](KeywordTableIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:164](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L164)
|
||||
|
||||
---
|
||||
|
||||
### init
|
||||
|
||||
▸ `Static` **init**(`options`): `Promise`<[`KeywordTableIndex`](KeywordTableIndex.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :-------------------- |
|
||||
| `options` | `KeywordIndexOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`KeywordTableIndex`](KeywordTableIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L53)
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
---
|
||||
id: "KeywordTableLLMRetriever"
|
||||
title: "Class: KeywordTableLLMRetriever"
|
||||
sidebar_label: "KeywordTableLLMRetriever"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `BaseKeywordTableRetriever`
|
||||
|
||||
↳ **`KeywordTableLLMRetriever`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new KeywordTableLLMRetriever**(`«destructured»`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------------------- | :------------------------------------------ |
|
||||
| `«destructured»` | `Object` |
|
||||
| › `index` | [`KeywordTableIndex`](KeywordTableIndex.md) |
|
||||
| › `keywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
| › `maxKeywordsPerQuery` | `number` |
|
||||
| › `numChunksPerQuery` | `number` |
|
||||
| › `queryKeywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L31)
|
||||
|
||||
## Properties
|
||||
|
||||
### docstore
|
||||
|
||||
• `Protected` **docstore**: [`BaseDocumentStore`](BaseDocumentStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.docstore
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L23)
|
||||
|
||||
---
|
||||
|
||||
### index
|
||||
|
||||
• `Protected` **index**: [`KeywordTableIndex`](KeywordTableIndex.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.index
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L21)
|
||||
|
||||
---
|
||||
|
||||
### indexStruct
|
||||
|
||||
• `Protected` **indexStruct**: [`KeywordTable`](KeywordTable.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.indexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L22)
|
||||
|
||||
---
|
||||
|
||||
### keywordExtractTemplate
|
||||
|
||||
• `Protected` **keywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.keywordExtractTemplate
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L28)
|
||||
|
||||
---
|
||||
|
||||
### maxKeywordsPerQuery
|
||||
|
||||
• `Protected` **maxKeywordsPerQuery**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.maxKeywordsPerQuery
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L26)
|
||||
|
||||
---
|
||||
|
||||
### numChunksPerQuery
|
||||
|
||||
• `Protected` **numChunksPerQuery**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.numChunksPerQuery
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L27)
|
||||
|
||||
---
|
||||
|
||||
### queryKeywordExtractTemplate
|
||||
|
||||
• `Protected` **queryKeywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.queryKeywordExtractTemplate
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L29)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• `Protected` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.serviceContext
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L24)
|
||||
|
||||
## Methods
|
||||
|
||||
### getKeywords
|
||||
|
||||
▸ **getKeywords**(`query`): `Promise`<`string`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`[]\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseKeywordTableRetriever.getKeywords
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L88)
|
||||
|
||||
---
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.getServiceContext
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:81](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L81)
|
||||
|
||||
---
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`query`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.retrieve
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L59)
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
---
|
||||
id: "KeywordTableRAKERetriever"
|
||||
title: "Class: KeywordTableRAKERetriever"
|
||||
sidebar_label: "KeywordTableRAKERetriever"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `BaseKeywordTableRetriever`
|
||||
|
||||
↳ **`KeywordTableRAKERetriever`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new KeywordTableRAKERetriever**(`«destructured»`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------------------- | :------------------------------------------ |
|
||||
| `«destructured»` | `Object` |
|
||||
| › `index` | [`KeywordTableIndex`](KeywordTableIndex.md) |
|
||||
| › `keywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
| › `maxKeywordsPerQuery` | `number` |
|
||||
| › `numChunksPerQuery` | `number` |
|
||||
| › `queryKeywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L31)
|
||||
|
||||
## Properties
|
||||
|
||||
### docstore
|
||||
|
||||
• `Protected` **docstore**: [`BaseDocumentStore`](BaseDocumentStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.docstore
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L23)
|
||||
|
||||
---
|
||||
|
||||
### index
|
||||
|
||||
• `Protected` **index**: [`KeywordTableIndex`](KeywordTableIndex.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.index
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L21)
|
||||
|
||||
---
|
||||
|
||||
### indexStruct
|
||||
|
||||
• `Protected` **indexStruct**: [`KeywordTable`](KeywordTable.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.indexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L22)
|
||||
|
||||
---
|
||||
|
||||
### keywordExtractTemplate
|
||||
|
||||
• `Protected` **keywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.keywordExtractTemplate
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L28)
|
||||
|
||||
---
|
||||
|
||||
### maxKeywordsPerQuery
|
||||
|
||||
• `Protected` **maxKeywordsPerQuery**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.maxKeywordsPerQuery
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L26)
|
||||
|
||||
---
|
||||
|
||||
### numChunksPerQuery
|
||||
|
||||
• `Protected` **numChunksPerQuery**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.numChunksPerQuery
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L27)
|
||||
|
||||
---
|
||||
|
||||
### queryKeywordExtractTemplate
|
||||
|
||||
• `Protected` **queryKeywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.queryKeywordExtractTemplate
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L29)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• `Protected` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.serviceContext
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L24)
|
||||
|
||||
## Methods
|
||||
|
||||
### getKeywords
|
||||
|
||||
▸ **getKeywords**(`query`): `Promise`<`string`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`[]\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseKeywordTableRetriever.getKeywords
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:114](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L114)
|
||||
|
||||
---
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.getServiceContext
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:81](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L81)
|
||||
|
||||
---
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`query`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.retrieve
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L59)
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
---
|
||||
id: "KeywordTableSimpleRetriever"
|
||||
title: "Class: KeywordTableSimpleRetriever"
|
||||
sidebar_label: "KeywordTableSimpleRetriever"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `BaseKeywordTableRetriever`
|
||||
|
||||
↳ **`KeywordTableSimpleRetriever`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new KeywordTableSimpleRetriever**(`«destructured»`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------------------- | :------------------------------------------ |
|
||||
| `«destructured»` | `Object` |
|
||||
| › `index` | [`KeywordTableIndex`](KeywordTableIndex.md) |
|
||||
| › `keywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
| › `maxKeywordsPerQuery` | `number` |
|
||||
| › `numChunksPerQuery` | `number` |
|
||||
| › `queryKeywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L31)
|
||||
|
||||
## Properties
|
||||
|
||||
### docstore
|
||||
|
||||
• `Protected` **docstore**: [`BaseDocumentStore`](BaseDocumentStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.docstore
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L23)
|
||||
|
||||
---
|
||||
|
||||
### index
|
||||
|
||||
• `Protected` **index**: [`KeywordTableIndex`](KeywordTableIndex.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.index
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L21)
|
||||
|
||||
---
|
||||
|
||||
### indexStruct
|
||||
|
||||
• `Protected` **indexStruct**: [`KeywordTable`](KeywordTable.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.indexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L22)
|
||||
|
||||
---
|
||||
|
||||
### keywordExtractTemplate
|
||||
|
||||
• `Protected` **keywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.keywordExtractTemplate
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L28)
|
||||
|
||||
---
|
||||
|
||||
### maxKeywordsPerQuery
|
||||
|
||||
• `Protected` **maxKeywordsPerQuery**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.maxKeywordsPerQuery
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L26)
|
||||
|
||||
---
|
||||
|
||||
### numChunksPerQuery
|
||||
|
||||
• `Protected` **numChunksPerQuery**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.numChunksPerQuery
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L27)
|
||||
|
||||
---
|
||||
|
||||
### queryKeywordExtractTemplate
|
||||
|
||||
• `Protected` **queryKeywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.queryKeywordExtractTemplate
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L29)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• `Protected` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.serviceContext
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L24)
|
||||
|
||||
## Methods
|
||||
|
||||
### getKeywords
|
||||
|
||||
▸ **getKeywords**(`query`): `Promise`<`string`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`[]\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseKeywordTableRetriever.getKeywords
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:105](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L105)
|
||||
|
||||
---
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.getServiceContext
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:81](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L81)
|
||||
|
||||
---
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`query`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseKeywordTableRetriever.retrieve
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L59)
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
---
|
||||
id: "LLMQuestionGenerator"
|
||||
title: "Class: LLMQuestionGenerator"
|
||||
sidebar_label: "LLMQuestionGenerator"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
LLMQuestionGenerator uses the LLM to generate new questions for the LLM using tools and a user query.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new LLMQuestionGenerator**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------------ |
|
||||
| `init?` | `Partial`<[`LLMQuestionGenerator`](LLMQuestionGenerator.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QuestionGenerator.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QuestionGenerator.ts#L34)
|
||||
|
||||
## Properties
|
||||
|
||||
### llm
|
||||
|
||||
• **llm**: [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QuestionGenerator.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QuestionGenerator.ts#L30)
|
||||
|
||||
---
|
||||
|
||||
### outputParser
|
||||
|
||||
• **outputParser**: [`BaseOutputParser`](../interfaces/BaseOutputParser.md)<[`StructuredOutput`](../interfaces/StructuredOutput.md)<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QuestionGenerator.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QuestionGenerator.ts#L32)
|
||||
|
||||
---
|
||||
|
||||
### prompt
|
||||
|
||||
• **prompt**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QuestionGenerator.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QuestionGenerator.ts#L31)
|
||||
|
||||
## Methods
|
||||
|
||||
### generate
|
||||
|
||||
▸ **generate**(`tools`, `query`): `Promise`<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------ |
|
||||
| `tools` | [`ToolMetadata`](../interfaces/ToolMetadata.md)[] |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseQuestionGenerator](../interfaces/BaseQuestionGenerator.md).[generate](../interfaces/BaseQuestionGenerator.md#generate)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QuestionGenerator.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QuestionGenerator.ts#L40)
|
||||
@@ -0,0 +1,325 @@
|
||||
---
|
||||
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
|
||||
|
||||
[packages/core/src/llm/LLM.ts:434](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L434)
|
||||
|
||||
## Properties
|
||||
|
||||
### chatStrategy
|
||||
|
||||
• **chatStrategy**: [`DeuceChatStrategy`](../enums/DeuceChatStrategy.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:427](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L427)
|
||||
|
||||
---
|
||||
|
||||
### hasStreaming
|
||||
|
||||
• **hasStreaming**: `boolean`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[hasStreaming](../interfaces/LLM.md#hasstreaming)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:432](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L432)
|
||||
|
||||
---
|
||||
|
||||
### maxTokens
|
||||
|
||||
• `Optional` **maxTokens**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:430](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L430)
|
||||
|
||||
---
|
||||
|
||||
### model
|
||||
|
||||
• **model**: `"Llama-2-70b-chat-old"` \| `"Llama-2-70b-chat-4bit"` \| `"Llama-2-13b-chat-old"` \| `"Llama-2-13b-chat-4bit"` \| `"Llama-2-7b-chat-old"` \| `"Llama-2-7b-chat-4bit"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:426](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L426)
|
||||
|
||||
---
|
||||
|
||||
### replicateSession
|
||||
|
||||
• **replicateSession**: `ReplicateSession`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:431](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L431)
|
||||
|
||||
---
|
||||
|
||||
### temperature
|
||||
|
||||
• **temperature**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:428](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L428)
|
||||
|
||||
---
|
||||
|
||||
### topP
|
||||
|
||||
• **topP**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:429](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L429)
|
||||
|
||||
## Accessors
|
||||
|
||||
### metadata
|
||||
|
||||
• `get` **metadata**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :-------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `contextWindow` | `number` |
|
||||
| `maxTokens` | `undefined` \| `number` |
|
||||
| `model` | `"Llama-2-70b-chat-old"` \| `"Llama-2-70b-chat-4bit"` \| `"Llama-2-13b-chat-old"` \| `"Llama-2-13b-chat-4bit"` \| `"Llama-2-7b-chat-old"` \| `"Llama-2-7b-chat-4bit"` |
|
||||
| `temperature` | `number` |
|
||||
| `tokenizer` | `undefined` |
|
||||
| `topP` | `number` |
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[metadata](../interfaces/LLM.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:454](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L454)
|
||||
|
||||
## Methods
|
||||
|
||||
### chat
|
||||
|
||||
▸ **chat**<`T`, `R`\>(`messages`, `_parentEvent?`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
Get a chat response from the LLM
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :-------------- | :---------------------------------------------- | :----------------------------------------------------------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | The return type of chat() and complete() are set by the "streaming" parameter being set to True. |
|
||||
| `_parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
| `streaming?` | `T` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:592](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L592)
|
||||
|
||||
---
|
||||
|
||||
### complete
|
||||
|
||||
▸ **complete**<`T`, `R`\>(`prompt`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
Get a prompt completion from the LLM
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :-------------------------------- | :--------------------- |
|
||||
| `prompt` | `string` | the prompt to complete |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
| `streaming?` | `T` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:632](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L632)
|
||||
|
||||
---
|
||||
|
||||
### mapMessageTypeA16Z
|
||||
|
||||
▸ **mapMessageTypeA16Z**(`messageType`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------------------------------- |
|
||||
| `messageType` | [`MessageType`](../#messagetype) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:501](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L501)
|
||||
|
||||
---
|
||||
|
||||
### mapMessagesToPrompt
|
||||
|
||||
▸ **mapMessagesToPrompt**(`messages`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :------- |
|
||||
| `prompt` | `string` |
|
||||
| `systemPrompt` | `any` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:465](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L465)
|
||||
|
||||
---
|
||||
|
||||
### mapMessagesToPromptA16Z
|
||||
|
||||
▸ **mapMessagesToPromptA16Z**(`messages`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :---------- |
|
||||
| `prompt` | `string` |
|
||||
| `systemPrompt` | `undefined` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:487](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L487)
|
||||
|
||||
---
|
||||
|
||||
### mapMessagesToPromptMeta
|
||||
|
||||
▸ **mapMessagesToPromptMeta**(`messages`, `opts?`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `opts?` | `Object` |
|
||||
| `opts.replicate4Bit?` | `boolean` |
|
||||
| `opts.withBos?` | `boolean` |
|
||||
| `opts.withNewlines?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :------- |
|
||||
| `prompt` | `string` |
|
||||
| `systemPrompt` | `any` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:514](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L514)
|
||||
|
||||
---
|
||||
|
||||
### tokens
|
||||
|
||||
▸ **tokens**(`messages`): `number`
|
||||
|
||||
Calculates the number of tokens needed for the given chat messages
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[tokens](../interfaces/LLM.md#tokens)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:450](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L450)
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
---
|
||||
id: "MarkdownReader"
|
||||
title: "Class: MarkdownReader"
|
||||
sidebar_label: "MarkdownReader"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Extract text from markdown files.
|
||||
Returns dictionary with keys as headers and values as the text between headers.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseReader`](../interfaces/BaseReader.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new MarkdownReader**(`removeHyperlinks?`, `removeImages?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------------------ | :-------- | :------------ | :---------------------------------------------- |
|
||||
| `removeHyperlinks?` | `boolean` | `true` | Indicates whether hyperlinks should be removed. |
|
||||
| `removeImages?` | `boolean` | `true` | Indicates whether images should be removed. |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/MarkdownReader.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
### \_removeHyperlinks
|
||||
|
||||
• `Private` **\_removeHyperlinks**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/MarkdownReader.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L12)
|
||||
|
||||
---
|
||||
|
||||
### \_removeImages
|
||||
|
||||
• `Private` **\_removeImages**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/MarkdownReader.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L13)
|
||||
|
||||
## Methods
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----- | :-------------------------------------------------------- | :------------ |
|
||||
| `file` | `string` | `undefined` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/MarkdownReader.ts:90](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L90)
|
||||
|
||||
---
|
||||
|
||||
### markdownToTups
|
||||
|
||||
▸ **markdownToTups**(`markdownText`): `MarkdownTuple`[]
|
||||
|
||||
Convert a markdown file to a dictionary.
|
||||
The keys are the headers and the values are the text under each header.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :------- | :---------------------------- |
|
||||
| `markdownText` | `string` | The markdown text to convert. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`MarkdownTuple`[]
|
||||
|
||||
- An array of tuples, where each tuple contains a header (or null) and its corresponding text.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/MarkdownReader.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L30)
|
||||
|
||||
---
|
||||
|
||||
### parseTups
|
||||
|
||||
▸ **parseTups**(`content`): `MarkdownTuple`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :------- |
|
||||
| `content` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`MarkdownTuple`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/MarkdownReader.ts:79](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L79)
|
||||
|
||||
---
|
||||
|
||||
### removeHyperlinks
|
||||
|
||||
▸ **removeHyperlinks**(`content`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :------- |
|
||||
| `content` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/MarkdownReader.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L74)
|
||||
|
||||
---
|
||||
|
||||
### removeImages
|
||||
|
||||
▸ **removeImages**(`content`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :------- |
|
||||
| `content` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/MarkdownReader.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L69)
|
||||
+223
@@ -0,0 +1,223 @@
|
||||
---
|
||||
id: "MongoDBAtlasVectorSearch"
|
||||
title: "Class: MongoDBAtlasVectorSearch"
|
||||
sidebar_label: "MongoDBAtlasVectorSearch"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Implements
|
||||
|
||||
- [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new MongoDBAtlasVectorSearch**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :-------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `init` | `Partial`<[`MongoDBAtlasVectorSearch`](MongoDBAtlasVectorSearch.md)\> & { `collectionName`: `string` ; `dbName`: `string` } |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L36)
|
||||
|
||||
## Properties
|
||||
|
||||
### collection
|
||||
|
||||
• `Private` **collection**: `Collection`<`Document`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L34)
|
||||
|
||||
---
|
||||
|
||||
### embeddingKey
|
||||
|
||||
• **embeddingKey**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L29)
|
||||
|
||||
---
|
||||
|
||||
### flatMetadata
|
||||
|
||||
• **flatMetadata**: `boolean` = `true`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L25)
|
||||
|
||||
---
|
||||
|
||||
### idKey
|
||||
|
||||
• **idKey**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L30)
|
||||
|
||||
---
|
||||
|
||||
### indexName
|
||||
|
||||
• **indexName**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L28)
|
||||
|
||||
---
|
||||
|
||||
### insertOptions
|
||||
|
||||
• `Optional` **insertOptions**: `BulkWriteOptions`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L33)
|
||||
|
||||
---
|
||||
|
||||
### metadataKey
|
||||
|
||||
• **metadataKey**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L32)
|
||||
|
||||
---
|
||||
|
||||
### mongodbClient
|
||||
|
||||
• **mongodbClient**: `MongoClient`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L27)
|
||||
|
||||
---
|
||||
|
||||
### storesText
|
||||
|
||||
• **storesText**: `boolean` = `true`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[storesText](../interfaces/VectorStore.md#storestext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L24)
|
||||
|
||||
---
|
||||
|
||||
### textKey
|
||||
|
||||
• **textKey**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L31)
|
||||
|
||||
## Accessors
|
||||
|
||||
### client
|
||||
|
||||
• `get` **client**(): `any`
|
||||
|
||||
#### Returns
|
||||
|
||||
`any`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
VectorStore.client
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:103](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L103)
|
||||
|
||||
## Methods
|
||||
|
||||
### add
|
||||
|
||||
▸ **add**(`nodes`): `Promise`<`string`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------- |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[add](../interfaces/VectorStore.md#add)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L65)
|
||||
|
||||
---
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`refDocId`, `deleteOptions?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `refDocId` | `string` |
|
||||
| `deleteOptions?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[delete](../interfaces/VectorStore.md#delete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L94)
|
||||
|
||||
---
|
||||
|
||||
### query
|
||||
|
||||
▸ **query**(`query`, `options?`): `Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :------------------------------------------------------ |
|
||||
| `query` | [`VectorStoreQuery`](../interfaces/VectorStoreQuery.md) |
|
||||
| `options?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[query](../interfaces/VectorStore.md#query)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L107)
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
---
|
||||
id: "MultiModalEmbedding"
|
||||
title: "Class: MultiModalEmbedding"
|
||||
sidebar_label: "MultiModalEmbedding"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseEmbedding`](BaseEmbedding.md)
|
||||
|
||||
↳ **`MultiModalEmbedding`**
|
||||
|
||||
↳↳ [`ClipEmbedding`](ClipEmbedding.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new MultiModalEmbedding**()
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[constructor](BaseEmbedding.md#constructor)
|
||||
|
||||
## Methods
|
||||
|
||||
### getImageEmbedding
|
||||
|
||||
▸ `Abstract` **getImageEmbedding**(`images`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :--------------------------- |
|
||||
| `images` | [`ImageType`](../#imagetype) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/MultiModalEmbedding.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/MultiModalEmbedding.ts#L9)
|
||||
|
||||
---
|
||||
|
||||
### getImageEmbeddings
|
||||
|
||||
▸ **getImageEmbeddings**(`images`): `Promise`<`number`[][]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :----------------------------- |
|
||||
| `images` | [`ImageType`](../#imagetype)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[][]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/MultiModalEmbedding.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/MultiModalEmbedding.ts#L11)
|
||||
|
||||
---
|
||||
|
||||
### getQueryEmbedding
|
||||
|
||||
▸ `Abstract` **getQueryEmbedding**(`query`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[getQueryEmbedding](BaseEmbedding.md#getqueryembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L23)
|
||||
|
||||
---
|
||||
|
||||
### getTextEmbedding
|
||||
|
||||
▸ `Abstract` **getTextEmbedding**(`text`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :------- |
|
||||
| `text` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[getTextEmbedding](BaseEmbedding.md#gettextembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L22)
|
||||
|
||||
---
|
||||
|
||||
### similarity
|
||||
|
||||
▸ **similarity**(`embedding1`, `embedding2`, `mode?`): `number`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :--------------------------------------------- | :----------------------- |
|
||||
| `embedding1` | `number`[] | `undefined` |
|
||||
| `embedding2` | `number`[] | `undefined` |
|
||||
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[similarity](BaseEmbedding.md#similarity)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L14)
|
||||
@@ -0,0 +1,135 @@
|
||||
---
|
||||
id: "NotionReader"
|
||||
title: "Class: NotionReader"
|
||||
sidebar_label: "NotionReader"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Notion pages are retrieved recursively and converted to Document objects.
|
||||
Notion Database can also be loaded, and [the serialization method can be customized](https://github.com/TomPenguin/notion-md-crawler/tree/main).
|
||||
|
||||
[Note] To use this reader, must be created the Notion integration must be created in advance
|
||||
Please refer to [this document](https://www.notion.so/help/create-integrations-with-the-notion-api) for details.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseReader`](../interfaces/BaseReader.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new NotionReader**(`options`)
|
||||
|
||||
Constructor for the NotionReader class
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :-------- | :-------------------- | :----------------------------------- |
|
||||
| `options` | `NotionReaderOptions` | Configuration options for the reader |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/NotionReader.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/NotionReader.ts#L33)
|
||||
|
||||
## Properties
|
||||
|
||||
### crawl
|
||||
|
||||
• `Private` **crawl**: (`rootPageId`: `string`) => `Promise`<`Pages`\>
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`rootPageId`): `Promise`<`Pages`\>
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :------- |
|
||||
| `rootPageId` | `string` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`Promise`<`Pages`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/NotionReader.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/NotionReader.ts#L27)
|
||||
|
||||
## Methods
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`rootPageId`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
Loads recursively Notion pages and converts them to an array of Document objects
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :----------- | :------- | :---------------------- |
|
||||
| `rootPageId` | `string` | The root Notion page ID |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
A Promise that resolves to an array of Document objects
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/NotionReader.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/NotionReader.ts#L63)
|
||||
|
||||
---
|
||||
|
||||
### loadPages
|
||||
|
||||
▸ **loadPages**(`rootPageId`): `Promise`<`Pages`\>
|
||||
|
||||
Loads recursively the Notion page with the specified root page ID.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :----------- | :------- | :---------------------- |
|
||||
| `rootPageId` | `string` | The root Notion page ID |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Pages`\>
|
||||
|
||||
A Promise that resolves to a Pages object(Convertible with the `toDocuments` method)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/NotionReader.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/NotionReader.ts#L54)
|
||||
|
||||
---
|
||||
|
||||
### toDocuments
|
||||
|
||||
▸ **toDocuments**(`pages`): [`Document`](Document.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
Converts Pages to an array of Document objects
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :-------------------------------------------------------- |
|
||||
| `pages` | `Pages` | The Notion pages to convert (Return value of `loadPages`) |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
An array of Document objects
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/NotionReader.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/NotionReader.ts#L42)
|
||||
@@ -0,0 +1,338 @@
|
||||
---
|
||||
id: "OpenAI"
|
||||
title: "Class: OpenAI"
|
||||
sidebar_label: "OpenAI"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
OpenAI LLM implementation
|
||||
|
||||
## Implements
|
||||
|
||||
- [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new OpenAI**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :-------------------------------------------------------------------- |
|
||||
| `init?` | `Partial`<[`OpenAI`](OpenAI.md)\> & { `azure?`: `AzureOpenAIConfig` } |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:152](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L152)
|
||||
|
||||
## Properties
|
||||
|
||||
### additionalChatOptions
|
||||
|
||||
• `Optional` **additionalChatOptions**: `Omit`<`Partial`<`ChatCompletionCreateParams`\>, `"model"` \| `"temperature"` \| `"max_tokens"` \| `"messages"` \| `"top_p"` \| `"streaming"`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:135](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L135)
|
||||
|
||||
---
|
||||
|
||||
### additionalSessionOptions
|
||||
|
||||
• `Optional` **additionalSessionOptions**: `Omit`<`Partial`<`ClientOptions`\>, `"apiKey"` \| `"timeout"` \| `"maxRetries"`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:145](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L145)
|
||||
|
||||
---
|
||||
|
||||
### apiKey
|
||||
|
||||
• `Optional` **apiKey**: `string` = `undefined`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:141](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L141)
|
||||
|
||||
---
|
||||
|
||||
### callbackManager
|
||||
|
||||
• `Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L150)
|
||||
|
||||
---
|
||||
|
||||
### hasStreaming
|
||||
|
||||
• **hasStreaming**: `boolean` = `true`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[hasStreaming](../interfaces/LLM.md#hasstreaming)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L128)
|
||||
|
||||
---
|
||||
|
||||
### maxRetries
|
||||
|
||||
• **maxRetries**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L142)
|
||||
|
||||
---
|
||||
|
||||
### maxTokens
|
||||
|
||||
• `Optional` **maxTokens**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L134)
|
||||
|
||||
---
|
||||
|
||||
### model
|
||||
|
||||
• **model**: `"gpt-3.5-turbo"` \| `"gpt-3.5-turbo-1106"` \| `"gpt-3.5-turbo-16k"` \| `"gpt-4"` \| `"gpt-4-32k"` \| `"gpt-4-1106-preview"` \| `"gpt-4-vision-preview"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L131)
|
||||
|
||||
---
|
||||
|
||||
### session
|
||||
|
||||
• **session**: `OpenAISession`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:144](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L144)
|
||||
|
||||
---
|
||||
|
||||
### temperature
|
||||
|
||||
• **temperature**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:132](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L132)
|
||||
|
||||
---
|
||||
|
||||
### timeout
|
||||
|
||||
• `Optional` **timeout**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:143](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L143)
|
||||
|
||||
---
|
||||
|
||||
### topP
|
||||
|
||||
• **topP**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:133](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L133)
|
||||
|
||||
## Accessors
|
||||
|
||||
### metadata
|
||||
|
||||
• `get` **metadata**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `contextWindow` | `number` |
|
||||
| `maxTokens` | `undefined` \| `number` |
|
||||
| `model` | `"gpt-3.5-turbo"` \| `"gpt-3.5-turbo-1106"` \| `"gpt-3.5-turbo-16k"` \| `"gpt-4"` \| `"gpt-4-32k"` \| `"gpt-4-1106-preview"` \| `"gpt-4-vision-preview"` |
|
||||
| `temperature` | `number` |
|
||||
| `tokenizer` | [`CL100K_BASE`](../enums/Tokenizers.md#cl100k_base) |
|
||||
| `topP` | `number` |
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[metadata](../interfaces/LLM.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:206](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L206)
|
||||
|
||||
## Methods
|
||||
|
||||
### chat
|
||||
|
||||
▸ **chat**<`T`, `R`\>(`messages`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
Get a chat response from the LLM
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | The return type of chat() and complete() are set by the "streaming" parameter being set to True. |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
| `streaming?` | `T` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:249](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L249)
|
||||
|
||||
---
|
||||
|
||||
### complete
|
||||
|
||||
▸ **complete**<`T`, `R`\>(`prompt`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
Get a prompt completion from the LLM
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :-------------------------------- | :--------------------- |
|
||||
| `prompt` | `string` | the prompt to complete |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
| `streaming?` | `T` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:286](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L286)
|
||||
|
||||
---
|
||||
|
||||
### mapMessageType
|
||||
|
||||
▸ **mapMessageType**(`messageType`): `"function"` \| `"user"` \| `"assistant"` \| `"system"`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------------------------------- |
|
||||
| `messageType` | [`MessageType`](../#messagetype) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`"function"` \| `"user"` \| `"assistant"` \| `"system"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:232](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L232)
|
||||
|
||||
---
|
||||
|
||||
### streamChat
|
||||
|
||||
▸ `Protected` **streamChat**(`messages`, `parentEvent?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:300](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L300)
|
||||
|
||||
---
|
||||
|
||||
### streamComplete
|
||||
|
||||
▸ `Protected` **streamComplete**(`query`, `parentEvent?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:362](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L362)
|
||||
|
||||
---
|
||||
|
||||
### tokens
|
||||
|
||||
▸ **tokens**(`messages`): `number`
|
||||
|
||||
Calculates the number of tokens needed for the given chat messages
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[tokens](../interfaces/LLM.md#tokens)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:217](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L217)
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
---
|
||||
id: "OpenAIEmbedding"
|
||||
title: "Class: OpenAIEmbedding"
|
||||
sidebar_label: "OpenAIEmbedding"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseEmbedding`](BaseEmbedding.md)
|
||||
|
||||
↳ **`OpenAIEmbedding`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new OpenAIEmbedding**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :-------------------------------------------------------------------------------------- |
|
||||
| `init?` | `Partial`<[`OpenAIEmbedding`](OpenAIEmbedding.md)\> & { `azure?`: `AzureOpenAIConfig` } |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[constructor](BaseEmbedding.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L30)
|
||||
|
||||
## Properties
|
||||
|
||||
### additionalSessionOptions
|
||||
|
||||
• `Optional` **additionalSessionOptions**: `Omit`<`Partial`<`ClientOptions`\>, `"apiKey"` \| `"timeout"` \| `"maxRetries"`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L23)
|
||||
|
||||
---
|
||||
|
||||
### apiKey
|
||||
|
||||
• `Optional` **apiKey**: `string` = `undefined`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L20)
|
||||
|
||||
---
|
||||
|
||||
### maxRetries
|
||||
|
||||
• **maxRetries**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L21)
|
||||
|
||||
---
|
||||
|
||||
### model
|
||||
|
||||
• **model**: [`TEXT_EMBED_ADA_002`](../enums/OpenAIEmbeddingModelType.md#text_embed_ada_002)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L17)
|
||||
|
||||
---
|
||||
|
||||
### session
|
||||
|
||||
• **session**: `OpenAISession`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L28)
|
||||
|
||||
---
|
||||
|
||||
### timeout
|
||||
|
||||
• `Optional` **timeout**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L22)
|
||||
|
||||
## Methods
|
||||
|
||||
### getOpenAIEmbedding
|
||||
|
||||
▸ `Private` **getOpenAIEmbedding**(`input`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `input` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L76)
|
||||
|
||||
---
|
||||
|
||||
### getQueryEmbedding
|
||||
|
||||
▸ **getQueryEmbedding**(`query`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[getQueryEmbedding](BaseEmbedding.md#getqueryembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L89)
|
||||
|
||||
---
|
||||
|
||||
### getTextEmbedding
|
||||
|
||||
▸ **getTextEmbedding**(`text`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :------- |
|
||||
| `text` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[getTextEmbedding](BaseEmbedding.md#gettextembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:85](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L85)
|
||||
|
||||
---
|
||||
|
||||
### similarity
|
||||
|
||||
▸ **similarity**(`embedding1`, `embedding2`, `mode?`): `number`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :--------------------------------------------- | :----------------------- |
|
||||
| `embedding1` | `number`[] | `undefined` |
|
||||
| `embedding2` | `number`[] | `undefined` |
|
||||
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[similarity](BaseEmbedding.md#similarity)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L14)
|
||||
@@ -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)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----- | :-------------------------------------------------------- | :------------ |
|
||||
| `file` | `string` | `undefined` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/PDFReader.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/PDFReader.ts#L11)
|
||||
+293
@@ -0,0 +1,293 @@
|
||||
---
|
||||
id: "PGVectorStore"
|
||||
title: "Class: PGVectorStore"
|
||||
sidebar_label: "PGVectorStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Provides support for writing and querying vector data in Postgres.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new PGVectorStore**()
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L40)
|
||||
|
||||
## Properties
|
||||
|
||||
### collection
|
||||
|
||||
• `Private` **collection**: `string` = `""`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L18)
|
||||
|
||||
---
|
||||
|
||||
### db
|
||||
|
||||
• `Optional` **db**: `Client`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L38)
|
||||
|
||||
---
|
||||
|
||||
### storesText
|
||||
|
||||
• **storesText**: `boolean` = `true`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[storesText](../interfaces/VectorStore.md#storestext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L16)
|
||||
|
||||
## Methods
|
||||
|
||||
### add
|
||||
|
||||
▸ **add**(`embeddingResults`): `Promise`<`string`[]\>
|
||||
|
||||
Adds vector record(s) to the table.
|
||||
NOTE: Uses the collection property controlled by setCollection/getCollection.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :----------------- | :------------------------------------------------------- | :-------------------------------------------------------------- |
|
||||
| `embeddingResults` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] | The Nodes to be inserted, optionally including metadata tuples. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`[]\>
|
||||
|
||||
A list of zero or more id values for the created records.
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[add](../interfaces/VectorStore.md#add)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:144](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L144)
|
||||
|
||||
---
|
||||
|
||||
### checkSchema
|
||||
|
||||
▸ `Private` **checkSchema**(`db`): `Promise`<`Client`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :------- |
|
||||
| `db` | `Client` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Client`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:90](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L90)
|
||||
|
||||
---
|
||||
|
||||
### clearCollection
|
||||
|
||||
▸ **clearCollection**(): `Promise`<`QueryResult`<`any`\>\>
|
||||
|
||||
Delete all vector records for the specified collection.
|
||||
NOTE: Uses the collection property controlled by setCollection/getCollection.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`QueryResult`<`any`\>\>
|
||||
|
||||
The result of the delete query.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L128)
|
||||
|
||||
---
|
||||
|
||||
### client
|
||||
|
||||
▸ **client**(): `Promise`<`Client`\>
|
||||
|
||||
Connects to the database specified in environment vars.
|
||||
This method also checks and creates the vector extension,
|
||||
the destination table and indexes if not found.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Client`\>
|
||||
|
||||
A connection to the database, or the error encountered while connecting/setting up.
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[client](../interfaces/VectorStore.md#client)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L119)
|
||||
|
||||
---
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`refDocId`, `deleteKwargs?`): `Promise`<`void`\>
|
||||
|
||||
Deletes a single record from the database by id.
|
||||
NOTE: Uses the collection property controlled by setCollection/getCollection.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :-------------- | :------- | :---------------------------------------------------- |
|
||||
| `refDocId` | `string` | Unique identifier for the record to delete. |
|
||||
| `deleteKwargs?` | `any` | Required by VectorStore interface. Currently ignored. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
Promise that resolves if the delete query did not throw an error.
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[delete](../interfaces/VectorStore.md#delete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:196](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L196)
|
||||
|
||||
---
|
||||
|
||||
### getCollection
|
||||
|
||||
▸ **getCollection**(): `string`
|
||||
|
||||
Getter for the collection property.
|
||||
Using a collection allows for simple segregation of vector data,
|
||||
e.g. by user, source, or access-level.
|
||||
Leave/set blank to ignore the collection value when querying.
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
The currently-set collection value. Default is empty string.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L60)
|
||||
|
||||
---
|
||||
|
||||
### getDb
|
||||
|
||||
▸ `Private` **getDb**(): `Promise`<`Client`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Client`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L64)
|
||||
|
||||
---
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
Required by VectorStore interface. Currently ignored.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------------------- |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
Resolved Promise.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:269](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L269)
|
||||
|
||||
---
|
||||
|
||||
### query
|
||||
|
||||
▸ **query**(`query`, `options?`): `Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
|
||||
|
||||
Query the vector store for the closest matching data to the query embeddings
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :--------- | :------------------------------------------------------ | :---------------------------------------------------- |
|
||||
| `query` | [`VectorStoreQuery`](../interfaces/VectorStoreQuery.md) | The VectorStoreQuery to be used |
|
||||
| `options?` | `any` | Required by VectorStore interface. Currently ignored. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
|
||||
|
||||
Zero or more Document instances with data from the vector store.
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[query](../interfaces/VectorStore.md#query)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:217](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L217)
|
||||
|
||||
---
|
||||
|
||||
### setCollection
|
||||
|
||||
▸ **setCollection**(`coll`): `void`
|
||||
|
||||
Setter for the collection property.
|
||||
Using a collection allows for simple segregation of vector data,
|
||||
e.g. by user, source, or access-level.
|
||||
Leave/set blank to ignore the collection value when querying.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :----- | :------- | :----------------------- |
|
||||
| `coll` | `string` | Name for the collection. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/PGVectorStore.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L49)
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
---
|
||||
id: "PapaCSVReader"
|
||||
title: "Class: PapaCSVReader"
|
||||
sidebar_label: "PapaCSVReader"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
papaparse-based csv parser
|
||||
|
||||
**`Implements`**
|
||||
|
||||
BaseReader
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseReader`](../interfaces/BaseReader.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new PapaCSVReader**(`concatRows?`, `colJoiner?`, `rowJoiner?`, `papaConfig?`)
|
||||
|
||||
Constructs a new instance of the class.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------------ | :--------------------------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `concatRows?` | `boolean` | `true` | whether to concatenate all rows into one document.If set to False, a Document will be created for each row.True by default. |
|
||||
| `colJoiner?` | `string` | `", "` | - |
|
||||
| `rowJoiner?` | `string` | `"\n"` | Separator to use for joining each row.Only used when `concat_rows=True`.Set to "\n" by default. |
|
||||
| `papaConfig?` | `ParseConfig`<`any`, `undefined`\> | `undefined` | - |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/CSVReader.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L23)
|
||||
|
||||
## Properties
|
||||
|
||||
### colJoiner
|
||||
|
||||
• `Private` **colJoiner**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/CSVReader.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L13)
|
||||
|
||||
---
|
||||
|
||||
### concatRows
|
||||
|
||||
• `Private` **concatRows**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/CSVReader.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L12)
|
||||
|
||||
---
|
||||
|
||||
### papaConfig
|
||||
|
||||
• `Private` `Optional` **papaConfig**: `ParseConfig`<`any`, `undefined`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/CSVReader.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L15)
|
||||
|
||||
---
|
||||
|
||||
### rowJoiner
|
||||
|
||||
• `Private` **rowJoiner**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/CSVReader.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L14)
|
||||
|
||||
## Methods
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
Loads data from csv files
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :----- | :-------------------------------------------------------- | :------------ | :------------------------------------------- |
|
||||
| `file` | `string` | `undefined` | The path to the file to load. |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` | The file system to use for reading the file. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/CSVReader.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L41)
|
||||
@@ -0,0 +1,261 @@
|
||||
---
|
||||
id: "Portkey"
|
||||
title: "Class: Portkey"
|
||||
sidebar_label: "Portkey"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Unified language model interface
|
||||
|
||||
## Implements
|
||||
|
||||
- [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new Portkey**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :---------------------------------- |
|
||||
| `init?` | `Partial`<[`Portkey`](Portkey.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:812](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L812)
|
||||
|
||||
## Properties
|
||||
|
||||
### apiKey
|
||||
|
||||
• `Optional` **apiKey**: `string` = `undefined`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:805](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L805)
|
||||
|
||||
---
|
||||
|
||||
### baseURL
|
||||
|
||||
• `Optional` **baseURL**: `string` = `undefined`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:806](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L806)
|
||||
|
||||
---
|
||||
|
||||
### callbackManager
|
||||
|
||||
• `Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:810](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L810)
|
||||
|
||||
---
|
||||
|
||||
### hasStreaming
|
||||
|
||||
• **hasStreaming**: `boolean` = `true`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[hasStreaming](../interfaces/LLM.md#hasstreaming)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:803](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L803)
|
||||
|
||||
---
|
||||
|
||||
### llms
|
||||
|
||||
• `Optional` **llms**: `null` \| [`LLMOptions`] = `undefined`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:808](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L808)
|
||||
|
||||
---
|
||||
|
||||
### mode
|
||||
|
||||
• `Optional` **mode**: `string` = `undefined`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:807](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L807)
|
||||
|
||||
---
|
||||
|
||||
### session
|
||||
|
||||
• **session**: `PortkeySession`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:809](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L809)
|
||||
|
||||
## Accessors
|
||||
|
||||
### metadata
|
||||
|
||||
• `get` **metadata**(): [`LLMMetadata`](../interfaces/LLMMetadata.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`LLMMetadata`](../interfaces/LLMMetadata.md)
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[metadata](../interfaces/LLM.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:830](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L830)
|
||||
|
||||
## Methods
|
||||
|
||||
### chat
|
||||
|
||||
▸ **chat**<`T`, `R`\>(`messages`, `parentEvent?`, `streaming?`, `params?`): `Promise`<`R`\>
|
||||
|
||||
Get a chat response from the LLM
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | The return type of chat() and complete() are set by the "streaming" parameter being set to True. |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
| `streaming?` | `T` | - |
|
||||
| `params?` | `Record`<`string`, `any`\> | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:834](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L834)
|
||||
|
||||
---
|
||||
|
||||
### complete
|
||||
|
||||
▸ **complete**<`T`, `R`\>(`prompt`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
Get a prompt completion from the LLM
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :-------------------------------- | :--------------------- |
|
||||
| `prompt` | `string` | the prompt to complete |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
| `streaming?` | `T` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:858](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L858)
|
||||
|
||||
---
|
||||
|
||||
### streamChat
|
||||
|
||||
▸ **streamChat**(`messages`, `parentEvent?`, `params?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
| `params?` | `Record`<`string`, `any`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:873](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L873)
|
||||
|
||||
---
|
||||
|
||||
### streamComplete
|
||||
|
||||
▸ **streamComplete**(`query`, `parentEvent?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:920](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L920)
|
||||
|
||||
---
|
||||
|
||||
### tokens
|
||||
|
||||
▸ **tokens**(`messages`): `number`
|
||||
|
||||
Calculates the number of tokens needed for the given chat messages
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---------------------------------------------- |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[tokens](../interfaces/LLM.md#tokens)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:826](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L826)
|
||||
@@ -0,0 +1,198 @@
|
||||
---
|
||||
id: "PromptHelper"
|
||||
title: "Class: PromptHelper"
|
||||
sidebar_label: "PromptHelper"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A collection of helper functions for working with prompts.
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new PromptHelper**(`contextWindow?`, `numOutput?`, `chunkOverlapRatio?`, `chunkSizeLimit?`, `tokenizer?`, `separator?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------------ | :---------------------------------- | :---------------------------- |
|
||||
| `contextWindow` | `number` | `DEFAULT_CONTEXT_WINDOW` |
|
||||
| `numOutput` | `number` | `DEFAULT_NUM_OUTPUTS` |
|
||||
| `chunkOverlapRatio` | `number` | `DEFAULT_CHUNK_OVERLAP_RATIO` |
|
||||
| `chunkSizeLimit?` | `number` | `undefined` |
|
||||
| `tokenizer?` | (`text`: `string`) => `Uint32Array` | `undefined` |
|
||||
| `separator` | `string` | `" "` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L40)
|
||||
|
||||
## Properties
|
||||
|
||||
### chunkOverlapRatio
|
||||
|
||||
• **chunkOverlapRatio**: `number` = `DEFAULT_CHUNK_OVERLAP_RATIO`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L35)
|
||||
|
||||
---
|
||||
|
||||
### chunkSizeLimit
|
||||
|
||||
• `Optional` **chunkSizeLimit**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L36)
|
||||
|
||||
---
|
||||
|
||||
### contextWindow
|
||||
|
||||
• **contextWindow**: `number` = `DEFAULT_CONTEXT_WINDOW`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L33)
|
||||
|
||||
---
|
||||
|
||||
### numOutput
|
||||
|
||||
• **numOutput**: `number` = `DEFAULT_NUM_OUTPUTS`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L34)
|
||||
|
||||
---
|
||||
|
||||
### separator
|
||||
|
||||
• **separator**: `string` = `" "`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L38)
|
||||
|
||||
---
|
||||
|
||||
### tokenizer
|
||||
|
||||
• **tokenizer**: (`text`: `string`) => `Uint32Array`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`text`): `Uint32Array`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :------- |
|
||||
| `text` | `string` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`Uint32Array`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L37)
|
||||
|
||||
## Methods
|
||||
|
||||
### getAvailableChunkSize
|
||||
|
||||
▸ `Private` **getAvailableChunkSize**(`prompt`, `numChunks?`, `padding?`): `number`
|
||||
|
||||
Find the maximum size of each chunk given a prompt.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :---------- | :--------------------------------- | :------------ |
|
||||
| `prompt` | [`SimplePrompt`](../#simpleprompt) | `undefined` |
|
||||
| `numChunks` | `number` | `1` |
|
||||
| `padding` | `number` | `5` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L76)
|
||||
|
||||
---
|
||||
|
||||
### getAvailableContextSize
|
||||
|
||||
▸ `Private` **getAvailableContextSize**(`prompt`): `number`
|
||||
|
||||
Given a prompt, return the maximum size of the inputs to the prompt.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :--------------------------------- |
|
||||
| `prompt` | [`SimplePrompt`](../#simpleprompt) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L61)
|
||||
|
||||
---
|
||||
|
||||
### getTextSplitterGivenPrompt
|
||||
|
||||
▸ **getTextSplitterGivenPrompt**(`prompt`, `numChunks?`, `padding?`): [`SentenceSplitter`](SentenceSplitter.md)
|
||||
|
||||
Creates a text splitter with the correct chunk sizes and overlaps given a prompt.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :---------- | :--------------------------------- | :---------------- |
|
||||
| `prompt` | [`SimplePrompt`](../#simpleprompt) | `undefined` |
|
||||
| `numChunks` | `number` | `1` |
|
||||
| `padding` | `number` | `DEFAULT_PADDING` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SentenceSplitter`](SentenceSplitter.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:99](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L99)
|
||||
|
||||
---
|
||||
|
||||
### repack
|
||||
|
||||
▸ **repack**(`prompt`, `textChunks`, `padding?`): `string`[]
|
||||
|
||||
Repack resplits the strings based on the optimal text splitter.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :--------------------------------- | :---------------- |
|
||||
| `prompt` | [`SimplePrompt`](../#simpleprompt) | `undefined` |
|
||||
| `textChunks` | `string`[] | `undefined` |
|
||||
| `padding` | `number` | `DEFAULT_PADDING` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/PromptHelper.ts:120](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L120)
|
||||
@@ -0,0 +1,167 @@
|
||||
---
|
||||
id: "Refine"
|
||||
title: "Class: Refine"
|
||||
sidebar_label: "Refine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A response builder that uses the query to ask the LLM generate a better response using multiple text chunks.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`Refine`**
|
||||
|
||||
↳ [`CompactAndRefine`](CompactAndRefine.md)
|
||||
|
||||
## Implements
|
||||
|
||||
- `BaseResponseBuilder`
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new Refine**(`serviceContext`, `textQATemplate?`, `refineTemplate?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---------------- | :-------------------------------------------------- |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `textQATemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
| `refineTemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:82](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L82)
|
||||
|
||||
## Properties
|
||||
|
||||
### refineTemplate
|
||||
|
||||
• **refineTemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L80)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L78)
|
||||
|
||||
---
|
||||
|
||||
### textQATemplate
|
||||
|
||||
• **textQATemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:79](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L79)
|
||||
|
||||
## Methods
|
||||
|
||||
### getResponse
|
||||
|
||||
▸ **getResponse**(`query`, `textChunks`, `parentEvent?`, `prevResponse?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------- | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
| `prevResponse?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
BaseResponseBuilder.getResponse
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L92)
|
||||
|
||||
---
|
||||
|
||||
### giveResponseSingle
|
||||
|
||||
▸ `Private` **giveResponseSingle**(`queryStr`, `textChunk`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `queryStr` | `string` |
|
||||
| `textChunk` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:117](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L117)
|
||||
|
||||
---
|
||||
|
||||
### refineResponseSingle
|
||||
|
||||
▸ `Private` **refineResponseSingle**(`response`, `queryStr`, `textChunk`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `response` | `string` |
|
||||
| `queryStr` | `string` |
|
||||
| `textChunk` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:153](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L153)
|
||||
@@ -0,0 +1,74 @@
|
||||
---
|
||||
id: "Response"
|
||||
title: "Class: Response"
|
||||
sidebar_label: "Response"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Respone is the output of a LLM
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new Response**(`response`, `sourceNodes?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :------------------------------------------------------- |
|
||||
| `response` | `string` |
|
||||
| `sourceNodes?` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Response.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Response.ts#L10)
|
||||
|
||||
## Properties
|
||||
|
||||
### response
|
||||
|
||||
• **response**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Response.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Response.ts#L7)
|
||||
|
||||
---
|
||||
|
||||
### sourceNodes
|
||||
|
||||
• `Optional` **sourceNodes**: [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Response.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Response.ts#L8)
|
||||
|
||||
## Methods
|
||||
|
||||
### getFormattedSources
|
||||
|
||||
▸ **getFormattedSources**(): `void`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Response.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Response.ts#L15)
|
||||
|
||||
---
|
||||
|
||||
### toString
|
||||
|
||||
▸ **toString**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Response.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Response.ts#L19)
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
---
|
||||
id: "ResponseSynthesizer"
|
||||
title: "Class: ResponseSynthesizer"
|
||||
sidebar_label: "ResponseSynthesizer"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A ResponseSynthesizer is used to generate a response from a query and a list of nodes.
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ResponseSynthesizer**(`«destructured»?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------- | :-------------------------------------------------- |
|
||||
| `«destructured»` | `Object` |
|
||||
| › `metadataMode?` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
| › `responseBuilder?` | `BaseResponseBuilder` |
|
||||
| › `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:295](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L295)
|
||||
|
||||
## Properties
|
||||
|
||||
### metadataMode
|
||||
|
||||
• **metadataMode**: [`MetadataMode`](../enums/MetadataMode.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:293](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L293)
|
||||
|
||||
---
|
||||
|
||||
### responseBuilder
|
||||
|
||||
• **responseBuilder**: `BaseResponseBuilder`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:291](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L291)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:292](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L292)
|
||||
|
||||
## Methods
|
||||
|
||||
### synthesize
|
||||
|
||||
▸ **synthesize**(`query`, `nodesWithScore`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------------------------------------------------------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `nodesWithScore` | [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:310](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L310)
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
---
|
||||
id: "RetrieverQueryEngine"
|
||||
title: "Class: RetrieverQueryEngine"
|
||||
sidebar_label: "RetrieverQueryEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A query engine that uses a retriever to query an index and then synthesizes the response.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new RetrieverQueryEngine**(`retriever`, `responseSynthesizer?`, `preFilters?`, `nodePostprocessors?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------------- | :------------------------------------------------------------------ |
|
||||
| `retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
|
||||
| `responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) |
|
||||
| `preFilters?` | `unknown` |
|
||||
| `nodePostprocessors?` | [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[] |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L37)
|
||||
|
||||
## Properties
|
||||
|
||||
### nodePostprocessors
|
||||
|
||||
• **nodePostprocessors**: [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L34)
|
||||
|
||||
---
|
||||
|
||||
### preFilters
|
||||
|
||||
• `Optional` **preFilters**: `unknown`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L35)
|
||||
|
||||
---
|
||||
|
||||
### responseSynthesizer
|
||||
|
||||
• **responseSynthesizer**: [`ResponseSynthesizer`](ResponseSynthesizer.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L33)
|
||||
|
||||
---
|
||||
|
||||
### retriever
|
||||
|
||||
• **retriever**: [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L32)
|
||||
|
||||
## Methods
|
||||
|
||||
### applyNodePostprocessors
|
||||
|
||||
▸ `Private` **applyNodePostprocessors**(`nodes`): [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------------------------------- |
|
||||
| `nodes` | [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L52)
|
||||
|
||||
---
|
||||
|
||||
### query
|
||||
|
||||
▸ **query**(`query`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
Query the query engine and get a response.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[query](../interfaces/BaseQueryEngine.md#query)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L69)
|
||||
|
||||
---
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ `Private` **retrieve**(`query`, `parentEvent`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `parentEvent` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L59)
|
||||
+271
@@ -0,0 +1,271 @@
|
||||
---
|
||||
id: "SentenceSplitter"
|
||||
title: "Class: SentenceSplitter"
|
||||
sidebar_label: "SentenceSplitter"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
SentenceSplitter is our default text splitter that supports splitting into sentences, paragraphs, or fixed length chunks with overlap.
|
||||
|
||||
One of the advantages of SentenceSplitter is that even in the fixed length chunks it will try to keep sentences together.
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SentenceSplitter**(`options?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------------------------- | :------------------------------------------------- |
|
||||
| `options?` | `Object` |
|
||||
| `options.chunkOverlap?` | `number` |
|
||||
| `options.chunkSize?` | `number` |
|
||||
| `options.chunkingTokenizerFn?` | (`text`: `string`) => `null` \| `RegExpMatchArray` |
|
||||
| `options.paragraphSeparator?` | `string` |
|
||||
| `options.splitLongSentences?` | `boolean` |
|
||||
| `options.tokenizer?` | `any` |
|
||||
| `options.tokenizerDecoder?` | `any` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L67)
|
||||
|
||||
## Properties
|
||||
|
||||
### chunkOverlap
|
||||
|
||||
• `Private` **chunkOverlap**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L60)
|
||||
|
||||
---
|
||||
|
||||
### chunkSize
|
||||
|
||||
• `Private` **chunkSize**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L59)
|
||||
|
||||
---
|
||||
|
||||
### chunkingTokenizerFn
|
||||
|
||||
• `Private` **chunkingTokenizerFn**: (`text`: `string`) => `null` \| `RegExpMatchArray`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`text`): `null` \| `RegExpMatchArray`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :------- |
|
||||
| `text` | `string` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`null` \| `RegExpMatchArray`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L64)
|
||||
|
||||
---
|
||||
|
||||
### paragraphSeparator
|
||||
|
||||
• `Private` **paragraphSeparator**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L63)
|
||||
|
||||
---
|
||||
|
||||
### splitLongSentences
|
||||
|
||||
• `Private` **splitLongSentences**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L65)
|
||||
|
||||
---
|
||||
|
||||
### tokenizer
|
||||
|
||||
• `Private` **tokenizer**: `any`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L61)
|
||||
|
||||
---
|
||||
|
||||
### tokenizerDecoder
|
||||
|
||||
• `Private` **tokenizerDecoder**: `any`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
### combineTextSplits
|
||||
|
||||
▸ **combineTextSplits**(`newSentenceSplits`, `effectiveChunkSize`): `TextSplit`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------- | :----------- |
|
||||
| `newSentenceSplits` | `SplitRep`[] |
|
||||
| `effectiveChunkSize` | `number` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`TextSplit`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:205](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L205)
|
||||
|
||||
---
|
||||
|
||||
### getEffectiveChunkSize
|
||||
|
||||
▸ `Private` **getEffectiveChunkSize**(`extraInfoStr?`): `number`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------- | :------- |
|
||||
| `extraInfoStr?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L104)
|
||||
|
||||
---
|
||||
|
||||
### getParagraphSplits
|
||||
|
||||
▸ **getParagraphSplits**(`text`, `effectiveChunkSize?`): `string`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------------- | :------- |
|
||||
| `text` | `string` |
|
||||
| `effectiveChunkSize?` | `number` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L121)
|
||||
|
||||
---
|
||||
|
||||
### getSentenceSplits
|
||||
|
||||
▸ **getSentenceSplits**(`text`, `effectiveChunkSize?`): `string`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------------- | :------- |
|
||||
| `text` | `string` |
|
||||
| `effectiveChunkSize?` | `number` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:147](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L147)
|
||||
|
||||
---
|
||||
|
||||
### processSentenceSplits
|
||||
|
||||
▸ `Private` **processSentenceSplits**(`sentenceSplits`, `effectiveChunkSize`): `SplitRep`[]
|
||||
|
||||
Splits sentences into chunks if necessary.
|
||||
|
||||
This isn't great behavior because it can split down the middle of a
|
||||
word or in non-English split down the middle of a Unicode codepoint
|
||||
so the splitting is turned off by default. If you need it, please
|
||||
set the splitLongSentences option to true.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------- | :--------- |
|
||||
| `sentenceSplits` | `string`[] |
|
||||
| `effectiveChunkSize` | `number` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`SplitRep`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:176](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L176)
|
||||
|
||||
---
|
||||
|
||||
### splitText
|
||||
|
||||
▸ **splitText**(`text`, `extraInfoStr?`): `string`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------- | :------- |
|
||||
| `text` | `string` |
|
||||
| `extraInfoStr?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:297](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L297)
|
||||
|
||||
---
|
||||
|
||||
### splitTextWithOverlaps
|
||||
|
||||
▸ **splitTextWithOverlaps**(`text`, `extraInfoStr?`): `TextSplit`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------- | :------- |
|
||||
| `text` | `string` |
|
||||
| `extraInfoStr?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`TextSplit`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/TextSplitter.ts:269](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L269)
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
---
|
||||
id: "SimilarityPostprocessor"
|
||||
title: "Class: SimilarityPostprocessor"
|
||||
sidebar_label: "SimilarityPostprocessor"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimilarityPostprocessor**(`options?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------------------- | :------- |
|
||||
| `options?` | `Object` |
|
||||
| `options.similarityCutoff?` | `number` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseNodePostprocessor.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseNodePostprocessor.ts#L10)
|
||||
|
||||
## Properties
|
||||
|
||||
### similarityCutoff
|
||||
|
||||
• `Optional` **similarityCutoff**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseNodePostprocessor.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseNodePostprocessor.ts#L8)
|
||||
|
||||
## Methods
|
||||
|
||||
### postprocessNodes
|
||||
|
||||
▸ **postprocessNodes**(`nodes`): [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------------------------------- |
|
||||
| `nodes` | [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseNodePostprocessor](../interfaces/BaseNodePostprocessor.md).[postprocessNodes](../interfaces/BaseNodePostprocessor.md#postprocessnodes)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseNodePostprocessor.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseNodePostprocessor.ts#L14)
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
---
|
||||
id: "SimpleChatEngine"
|
||||
title: "Class: SimpleChatEngine"
|
||||
sidebar_label: "SimpleChatEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
SimpleChatEngine is the simplest possible chat engine. Useful for using your own custom prompts.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`ChatEngine`](../interfaces/ChatEngine.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleChatEngine**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :---------------------------------------------------- |
|
||||
| `init?` | `Partial`<[`SimpleChatEngine`](SimpleChatEngine.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L51)
|
||||
|
||||
## Properties
|
||||
|
||||
### chatHistory
|
||||
|
||||
• **chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L48)
|
||||
|
||||
---
|
||||
|
||||
### llm
|
||||
|
||||
• **llm**: [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L49)
|
||||
|
||||
## Methods
|
||||
|
||||
### chat
|
||||
|
||||
▸ **chat**<`T`, `R`\>(`message`, `chatHistory?`, `streaming?`): `Promise`<`R`\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :---------------------------------------------------------------------------------------------- |
|
||||
| `T` | extends `undefined` \| `boolean` = `undefined` |
|
||||
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`Response`](Response.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------- |
|
||||
| `message` | [`MessageContent`](../#messagecontent) | |
|
||||
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
|
||||
| `streaming?` | `T` | optional streaming flag, which auto-sets the return value if True. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`R`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[chat](../interfaces/ChatEngine.md#chat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L56)
|
||||
|
||||
---
|
||||
|
||||
### reset
|
||||
|
||||
▸ **reset**(): `void`
|
||||
|
||||
Resets the chat history so that it's empty.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L101)
|
||||
|
||||
---
|
||||
|
||||
### streamChat
|
||||
|
||||
▸ `Protected` **streamChat**(`message`, `chatHistory?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :---------------------------------------------- |
|
||||
| `message` | [`MessageContent`](../#messagecontent) |
|
||||
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncGenerator`<`string`, `void`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatEngine.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L78)
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
---
|
||||
id: "SimpleChatHistory"
|
||||
title: "Class: SimpleChatHistory"
|
||||
sidebar_label: "SimpleChatHistory"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A ChatHistory is used to keep the state of back and forth chat messages
|
||||
|
||||
## Implements
|
||||
|
||||
- [`ChatHistory`](../interfaces/ChatHistory.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleChatHistory**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------ |
|
||||
| `init?` | `Partial`<[`SimpleChatHistory`](SimpleChatHistory.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L39)
|
||||
|
||||
## Properties
|
||||
|
||||
### messages
|
||||
|
||||
• **messages**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatHistory](../interfaces/ChatHistory.md).[messages](../interfaces/ChatHistory.md#messages)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L36)
|
||||
|
||||
---
|
||||
|
||||
### messagesBefore
|
||||
|
||||
• `Private` **messagesBefore**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L37)
|
||||
|
||||
## Methods
|
||||
|
||||
### addMessage
|
||||
|
||||
▸ **addMessage**(`message`): `void`
|
||||
|
||||
Adds a message to the chat history.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :-------------------------------------------- |
|
||||
| `message` | [`ChatMessage`](../interfaces/ChatMessage.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatHistory](../interfaces/ChatHistory.md).[addMessage](../interfaces/ChatHistory.md#addmessage)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L44)
|
||||
|
||||
---
|
||||
|
||||
### newMessages
|
||||
|
||||
▸ **newMessages**(): [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
Returns the new messages since the last call to this function (or since calling the constructor)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatHistory](../interfaces/ChatHistory.md).[newMessages](../interfaces/ChatHistory.md#newmessages)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L56)
|
||||
|
||||
---
|
||||
|
||||
### requestMessages
|
||||
|
||||
▸ **requestMessages**(`transientMessages?`): `Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)[]\>
|
||||
|
||||
Returns the messages that should be used as input to the LLM.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------- | :---------------------------------------------- |
|
||||
| `transientMessages?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatHistory](../interfaces/ChatHistory.md).[requestMessages](../interfaces/ChatHistory.md#requestmessages)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L48)
|
||||
|
||||
---
|
||||
|
||||
### reset
|
||||
|
||||
▸ **reset**(): `void`
|
||||
|
||||
Resets the chat history so that it's empty.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatHistory](../interfaces/ChatHistory.md).[reset](../interfaces/ChatHistory.md#reset)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L52)
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
---
|
||||
id: "SimpleDirectoryReader"
|
||||
title: "Class: SimpleDirectoryReader"
|
||||
sidebar_label: "SimpleDirectoryReader"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Read all of the documents in a directory.
|
||||
By default, supports the list of file types
|
||||
in the FILE_EXT_TO_READER map.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseReader`](../interfaces/BaseReader.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleDirectoryReader**(`observer?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---------- | :--------------- |
|
||||
| `observer?` | `ReaderCallback` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/SimpleDirectoryReader.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleDirectoryReader.ts#L65)
|
||||
|
||||
## Properties
|
||||
|
||||
### observer
|
||||
|
||||
• `Private` `Optional` **observer**: `ReaderCallback`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/SimpleDirectoryReader.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleDirectoryReader.ts#L65)
|
||||
|
||||
## Methods
|
||||
|
||||
### doObserverCheck
|
||||
|
||||
▸ `Private` **doObserverCheck**(`category`, `name`, `status`, `message?`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :------------------------ |
|
||||
| `category` | `"file"` \| `"directory"` |
|
||||
| `name` | `string` |
|
||||
| `status` | `ReaderStatus` |
|
||||
| `message?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/SimpleDirectoryReader.ts:135](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleDirectoryReader.ts#L135)
|
||||
|
||||
---
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`«destructured»`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :----------------------------------------------------------------------------- |
|
||||
| `«destructured»` | [`SimpleDirectoryReaderLoadDataProps`](../#simpledirectoryreaderloaddataprops) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/SimpleDirectoryReader.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleDirectoryReader.ts#L67)
|
||||
+480
@@ -0,0 +1,480 @@
|
||||
---
|
||||
id: "SimpleDocumentStore"
|
||||
title: "Class: SimpleDocumentStore"
|
||||
sidebar_label: "SimpleDocumentStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `KVDocumentStore`
|
||||
|
||||
↳ **`SimpleDocumentStore`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleDocumentStore**(`kvStore?`, `namespace?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :---------------------------------- |
|
||||
| `kvStore?` | [`SimpleKVStore`](SimpleKVStore.md) |
|
||||
| `namespace?` | `string` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVDocumentStore.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
### kvStore
|
||||
|
||||
• `Private` **kvStore**: [`SimpleKVStore`](SimpleKVStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L17)
|
||||
|
||||
## Methods
|
||||
|
||||
### addDocuments
|
||||
|
||||
▸ **addDocuments**(`docs`, `allowUpdate?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------ | :------------------------------------------------------- | :------------ |
|
||||
| `docs` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] | `undefined` |
|
||||
| `allowUpdate` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.addDocuments
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L33)
|
||||
|
||||
---
|
||||
|
||||
### deleteDocument
|
||||
|
||||
▸ **deleteDocument**(`docId`, `raiseError?`, `removeRefDocNode?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------------- | :-------- | :------------ |
|
||||
| `docId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
| `removeRefDocNode` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.deleteDocument
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L131)
|
||||
|
||||
---
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ **deleteRefDoc**(`refDocId`, `raiseError?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :-------- | :------------ |
|
||||
| `refDocId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.deleteRefDoc
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:148](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L148)
|
||||
|
||||
---
|
||||
|
||||
### docs
|
||||
|
||||
▸ **docs**(): `Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.docs
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L24)
|
||||
|
||||
---
|
||||
|
||||
### documentExists
|
||||
|
||||
▸ **documentExists**(`docId`): `Promise`<`boolean`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `docId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.documentExists
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:105](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L105)
|
||||
|
||||
---
|
||||
|
||||
### getAllRefDocInfo
|
||||
|
||||
▸ **getAllRefDocInfo**(): `Promise`<`undefined` \| `Record`<`string`, [`RefDocInfo`](../interfaces/RefDocInfo.md)\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `Record`<`string`, [`RefDocInfo`](../interfaces/RefDocInfo.md)\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getAllRefDocInfo
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:93](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L93)
|
||||
|
||||
---
|
||||
|
||||
### getDocument
|
||||
|
||||
▸ **getDocument**(`docId`, `raiseError?`): `Promise`<`undefined` \| [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :-------- | :------------ |
|
||||
| `docId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getDocument
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L73)
|
||||
|
||||
---
|
||||
|
||||
### getDocumentHash
|
||||
|
||||
▸ **getDocumentHash**(`docId`): `Promise`<`undefined` \| `string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `docId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `string`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getDocumentHash
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:174](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L174)
|
||||
|
||||
---
|
||||
|
||||
### getNode
|
||||
|
||||
▸ **getNode**(`nodeId`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :-------- | :------------ |
|
||||
| `nodeId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L57)
|
||||
|
||||
---
|
||||
|
||||
### getNodeDict
|
||||
|
||||
▸ **getNodeDict**(`nodeIdDict`): `Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :------- |
|
||||
| `nodeIdDict` | `Object` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getNodeDict
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L65)
|
||||
|
||||
---
|
||||
|
||||
### getNodes
|
||||
|
||||
▸ **getNodes**(`nodeIds`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :--------- | :------------ |
|
||||
| `nodeIds` | `string`[] | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/types.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L51)
|
||||
|
||||
---
|
||||
|
||||
### getRefDocInfo
|
||||
|
||||
▸ **getRefDocInfo**(`refDocId`): `Promise`<`undefined` \| [`RefDocInfo`](../interfaces/RefDocInfo.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :------- |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`RefDocInfo`](../interfaces/RefDocInfo.md)\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getRefDocInfo
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L88)
|
||||
|
||||
---
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------------------- |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVDocumentStore.persist
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L52)
|
||||
|
||||
---
|
||||
|
||||
### refDocExists
|
||||
|
||||
▸ **refDocExists**(`refDocId`): `Promise`<`boolean`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :------- |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.refDocExists
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L101)
|
||||
|
||||
---
|
||||
|
||||
### setDocumentHash
|
||||
|
||||
▸ **setDocumentHash**(`docId`, `docHash`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :------- |
|
||||
| `docId` | `string` |
|
||||
| `docHash` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.setDocumentHash
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/KVDocumentStore.ts:169](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L169)
|
||||
|
||||
---
|
||||
|
||||
### toDict
|
||||
|
||||
▸ **toDict**(): `SaveDict`
|
||||
|
||||
#### Returns
|
||||
|
||||
`SaveDict`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L73)
|
||||
|
||||
---
|
||||
|
||||
### fromDict
|
||||
|
||||
▸ `Static` **fromDict**(`saveDict`, `namespace?`): [`SimpleDocumentStore`](SimpleDocumentStore.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :--------- |
|
||||
| `saveDict` | `SaveDict` |
|
||||
| `namespace?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleDocumentStore`](SimpleDocumentStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L68)
|
||||
|
||||
---
|
||||
|
||||
### fromPersistDir
|
||||
|
||||
▸ `Static` **fromPersistDir**(`persistDir?`, `namespace?`, `fsModule?`): `Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :-------------------------------------------------------- | :-------------------- |
|
||||
| `persistDir` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `namespace?` | `string` | `undefined` |
|
||||
| `fsModule?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `undefined` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L26)
|
||||
|
||||
---
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`, `namespace?`, `fs?`): `Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------------------- |
|
||||
| `persistPath` | `string` |
|
||||
| `namespace?` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L42)
|
||||
+234
@@ -0,0 +1,234 @@
|
||||
---
|
||||
id: "SimpleIndexStore"
|
||||
title: "Class: SimpleIndexStore"
|
||||
sidebar_label: "SimpleIndexStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `KVIndexStore`
|
||||
|
||||
↳ **`SimpleIndexStore`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleIndexStore**(`kvStore?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---------------------------------------------- |
|
||||
| `kvStore?` | [`BaseInMemoryKVStore`](BaseInMemoryKVStore.md) |
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVIndexStore.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/SimpleIndexStore.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L15)
|
||||
|
||||
## Properties
|
||||
|
||||
### kvStore
|
||||
|
||||
• `Private` **kvStore**: [`BaseInMemoryKVStore`](BaseInMemoryKVStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/SimpleIndexStore.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L13)
|
||||
|
||||
## Methods
|
||||
|
||||
### addIndexStruct
|
||||
|
||||
▸ **addIndexStruct**(`indexStruct`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------------------------------ |
|
||||
| `indexStruct` | [`IndexStruct`](IndexStruct.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.addIndexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/KVIndexStore.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/KVIndexStore.ts#L17)
|
||||
|
||||
---
|
||||
|
||||
### deleteIndexStruct
|
||||
|
||||
▸ **deleteIndexStruct**(`key`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---- | :------- |
|
||||
| `key` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.deleteIndexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/KVIndexStore.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/KVIndexStore.ts#L23)
|
||||
|
||||
---
|
||||
|
||||
### getIndexStruct
|
||||
|
||||
▸ **getIndexStruct**(`structId?`): `Promise`<`undefined` \| [`IndexStruct`](IndexStruct.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---------- | :------- |
|
||||
| `structId?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`IndexStruct`](IndexStruct.md)\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.getIndexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/KVIndexStore.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/KVIndexStore.ts#L27)
|
||||
|
||||
---
|
||||
|
||||
### getIndexStructs
|
||||
|
||||
▸ **getIndexStructs**(): `Promise`<[`IndexStruct`](IndexStruct.md)[]\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`IndexStruct`](IndexStruct.md)[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.getIndexStructs
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/KVIndexStore.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/KVIndexStore.ts#L43)
|
||||
|
||||
---
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------ | :-------------------------------------------------------- | :-------------------- |
|
||||
| `persistPath` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVIndexStore.persist
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/SimpleIndexStore.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L40)
|
||||
|
||||
---
|
||||
|
||||
### toDict
|
||||
|
||||
▸ **toDict**(): `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/SimpleIndexStore.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L52)
|
||||
|
||||
---
|
||||
|
||||
### fromDict
|
||||
|
||||
▸ `Static` **fromDict**(`saveDict`): [`SimpleIndexStore`](SimpleIndexStore.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :--------- |
|
||||
| `saveDict` | `DataType` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleIndexStore`](SimpleIndexStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/SimpleIndexStore.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L47)
|
||||
|
||||
---
|
||||
|
||||
### fromPersistDir
|
||||
|
||||
▸ `Static` **fromPersistDir**(`persistDir?`, `fs?`): `Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :-------------------------------------------------------- | :-------------------- |
|
||||
| `persistDir` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/SimpleIndexStore.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L21)
|
||||
|
||||
---
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`, `fs?`): `Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------ | :-------------------------------------------------------- | :------------ |
|
||||
| `persistPath` | `string` | `undefined` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/indexStore/SimpleIndexStore.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L32)
|
||||
+239
@@ -0,0 +1,239 @@
|
||||
---
|
||||
id: "SimpleKVStore"
|
||||
title: "Class: SimpleKVStore"
|
||||
sidebar_label: "SimpleKVStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseKVStore`](BaseKVStore.md)
|
||||
|
||||
↳ **`SimpleKVStore`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleKVStore**(`data?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :--------- |
|
||||
| `data?` | `DataType` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseKVStore](BaseKVStore.md).[constructor](BaseKVStore.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L14)
|
||||
|
||||
## Properties
|
||||
|
||||
### data
|
||||
|
||||
• `Private` **data**: `DataType`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L10)
|
||||
|
||||
---
|
||||
|
||||
### fs
|
||||
|
||||
• `Private` **fs**: `undefined` \| [`GenericFileSystem`](../interfaces/GenericFileSystem.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L12)
|
||||
|
||||
---
|
||||
|
||||
### persistPath
|
||||
|
||||
• `Private` **persistPath**: `undefined` \| `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L11)
|
||||
|
||||
## Methods
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`key`, `collection?`): `Promise`<`boolean`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :------- | :------------------- |
|
||||
| `key` | `string` | `undefined` |
|
||||
| `collection` | `string` | `DEFAULT_COLLECTION` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseKVStore](BaseKVStore.md).[delete](BaseKVStore.md#delete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L52)
|
||||
|
||||
---
|
||||
|
||||
### get
|
||||
|
||||
▸ **get**(`key`, `collection?`): `Promise`<`any`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :------- | :------------------- |
|
||||
| `key` | `string` | `undefined` |
|
||||
| `collection` | `string` | `DEFAULT_COLLECTION` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseKVStore](BaseKVStore.md).[get](BaseKVStore.md#get)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L34)
|
||||
|
||||
---
|
||||
|
||||
### getAll
|
||||
|
||||
▸ **getAll**(`collection?`): `Promise`<`DataType`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :------- | :------------------- |
|
||||
| `collection` | `string` | `DEFAULT_COLLECTION` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`DataType`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseKVStore](BaseKVStore.md).[getAll](BaseKVStore.md#getall)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L48)
|
||||
|
||||
---
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------------------- |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L63)
|
||||
|
||||
---
|
||||
|
||||
### put
|
||||
|
||||
▸ **put**(`key`, `val`, `collection?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :------- | :------------------- |
|
||||
| `key` | `string` | `undefined` |
|
||||
| `val` | `any` | `undefined` |
|
||||
| `collection` | `string` | `DEFAULT_COLLECTION` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseKVStore](BaseKVStore.md).[put](BaseKVStore.md#put)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L19)
|
||||
|
||||
---
|
||||
|
||||
### toDict
|
||||
|
||||
▸ **toDict**(): `DataType`
|
||||
|
||||
#### Returns
|
||||
|
||||
`DataType`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:99](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L99)
|
||||
|
||||
---
|
||||
|
||||
### fromDict
|
||||
|
||||
▸ `Static` **fromDict**(`saveDict`): [`SimpleKVStore`](SimpleKVStore.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :--------- |
|
||||
| `saveDict` | `DataType` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleKVStore`](SimpleKVStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:103](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L103)
|
||||
|
||||
---
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`, `fs?`): `Promise`<[`SimpleKVStore`](SimpleKVStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------------------- |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleKVStore`](SimpleKVStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/kvStore/SimpleKVStore.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/SimpleKVStore.ts#L73)
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
---
|
||||
id: "SimpleMongoReader"
|
||||
title: "Class: SimpleMongoReader"
|
||||
sidebar_label: "SimpleMongoReader"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Read in from MongoDB
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseReader`](../interfaces/BaseReader.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleMongoReader**(`client`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :------------ |
|
||||
| `client` | `MongoClient` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/SimpleMongoReader.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleMongoReader.ts#L11)
|
||||
|
||||
## Properties
|
||||
|
||||
### client
|
||||
|
||||
• `Private` **client**: `MongoClient`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/SimpleMongoReader.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleMongoReader.ts#L9)
|
||||
|
||||
## Methods
|
||||
|
||||
### flatten
|
||||
|
||||
▸ `Private` **flatten**(`texts`): `string`[]
|
||||
|
||||
Flattens an array of strings or string arrays into a single-dimensional array of strings.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------------------------- | :------------------------------------------------ |
|
||||
| `texts` | (`string` \| `string`[])[] | The array of strings or string arrays to flatten. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`[]
|
||||
|
||||
The flattened array of strings.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/SimpleMongoReader.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleMongoReader.ts#L20)
|
||||
|
||||
---
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`dbName`, `collectionName`, `fieldNames?`, `separator?`, `filterQuery?`, `maxDocs?`, `metadataNames?`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
Loads data from MongoDB collection
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :--------------- | :------------------------- | :------------ | :--------------------------------------------------------------------------------------------- |
|
||||
| `dbName` | `string` | `undefined` | The name of the database to load. |
|
||||
| `collectionName` | `string` | `undefined` | The name of the collection to load. |
|
||||
| `fieldNames` | `string`[] | `undefined` | An array of field names to retrieve from each document. Defaults to ["text"]. |
|
||||
| `separator` | `string` | `""` | The separator to join multiple field values. Defaults to an empty string. |
|
||||
| `filterQuery` | `Record`<`string`, `any`\> | `{}` | Specific query, as specified by MongoDB NodeJS documentation. |
|
||||
| `maxDocs` | `number` | `0` | The maximum number of documents to retrieve. Defaults to 0 (retrieve all documents). |
|
||||
| `metadataNames?` | `string`[] | `undefined` | An optional array of metadata field names. If specified extracts this information as metadata. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
**`Throws`**
|
||||
|
||||
If a field specified in fieldNames or metadataNames is not found in a MongoDB document.
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/SimpleMongoReader.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleMongoReader.ts#L39)
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
---
|
||||
id: "SimpleNodeParser"
|
||||
title: "Class: SimpleNodeParser"
|
||||
sidebar_label: "SimpleNodeParser"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
SimpleNodeParser is the default NodeParser. It splits documents into TextNodes using a splitter, by default SentenceSplitter
|
||||
|
||||
## Implements
|
||||
|
||||
- [`NodeParser`](../interfaces/NodeParser.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleNodeParser**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------------- | :---------------------------------------- |
|
||||
| `init?` | `Object` |
|
||||
| `init.chunkOverlap?` | `number` |
|
||||
| `init.chunkSize?` | `number` |
|
||||
| `init.includeMetadata?` | `boolean` |
|
||||
| `init.includePrevNextRel?` | `boolean` |
|
||||
| `init.textSplitter?` | [`SentenceSplitter`](SentenceSplitter.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/NodeParser.ts:106](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/NodeParser.ts#L106)
|
||||
|
||||
## Properties
|
||||
|
||||
### includeMetadata
|
||||
|
||||
• **includeMetadata**: `boolean`
|
||||
|
||||
Whether to include metadata in the nodes.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/NodeParser.ts:100](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/NodeParser.ts#L100)
|
||||
|
||||
---
|
||||
|
||||
### includePrevNextRel
|
||||
|
||||
• **includePrevNextRel**: `boolean`
|
||||
|
||||
Whether to include previous and next relationships in the nodes.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/NodeParser.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/NodeParser.ts#L104)
|
||||
|
||||
---
|
||||
|
||||
### textSplitter
|
||||
|
||||
• **textSplitter**: [`SentenceSplitter`](SentenceSplitter.md)
|
||||
|
||||
The text splitter to use.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/NodeParser.ts:96](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/NodeParser.ts#L96)
|
||||
|
||||
## Methods
|
||||
|
||||
### getNodesFromDocuments
|
||||
|
||||
▸ **getNodesFromDocuments**(`documents`): ([`TextNode`](TextNode.md)<[`Metadata`](../#metadata)\> \| [`ImageDocument`](ImageDocument.md)<`any`\>)[]
|
||||
|
||||
Generate Node objects from documents
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---------- | :------------------------------------------------------- |
|
||||
| `documents` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
([`TextNode`](TextNode.md)<[`Metadata`](../#metadata)\> \| [`ImageDocument`](ImageDocument.md)<`any`\>)[]
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[NodeParser](../interfaces/NodeParser.md).[getNodesFromDocuments](../interfaces/NodeParser.md#getnodesfromdocuments)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/NodeParser.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/NodeParser.ts#L137)
|
||||
|
||||
---
|
||||
|
||||
### fromDefaults
|
||||
|
||||
▸ `Static` **fromDefaults**(`init?`): [`SimpleNodeParser`](SimpleNodeParser.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------------- | :-------- |
|
||||
| `init?` | `Object` |
|
||||
| `init.chunkOverlap?` | `number` |
|
||||
| `init.chunkSize?` | `number` |
|
||||
| `init.includeMetadata?` | `boolean` |
|
||||
| `init.includePrevNextRel?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleNodeParser`](SimpleNodeParser.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/NodeParser.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/NodeParser.ts#L124)
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
---
|
||||
id: "SimpleResponseBuilder"
|
||||
title: "Class: SimpleResponseBuilder"
|
||||
sidebar_label: "SimpleResponseBuilder"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A response builder that just concatenates responses.
|
||||
|
||||
## Implements
|
||||
|
||||
- `BaseResponseBuilder`
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleResponseBuilder**(`serviceContext`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :-------------------------------------------------- |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L53)
|
||||
|
||||
## Properties
|
||||
|
||||
### llm
|
||||
|
||||
• **llm**: [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L50)
|
||||
|
||||
---
|
||||
|
||||
### textQATemplate
|
||||
|
||||
• **textQATemplate**: [`SimplePrompt`](../#simpleprompt)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L51)
|
||||
|
||||
## Methods
|
||||
|
||||
### getResponse
|
||||
|
||||
▸ **getResponse**(`query`, `textChunks`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
BaseResponseBuilder.getResponse
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L58)
|
||||
+279
@@ -0,0 +1,279 @@
|
||||
---
|
||||
id: "SimpleVectorStore"
|
||||
title: "Class: SimpleVectorStore"
|
||||
sidebar_label: "SimpleVectorStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Implements
|
||||
|
||||
- [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleVectorStore**(`data?`, `fs?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :-------------------------------------------------------- |
|
||||
| `data?` | `SimpleVectorStoreData` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L37)
|
||||
|
||||
## Properties
|
||||
|
||||
### data
|
||||
|
||||
• `Private` **data**: `SimpleVectorStoreData`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L33)
|
||||
|
||||
---
|
||||
|
||||
### fs
|
||||
|
||||
• `Private` **fs**: [`GenericFileSystem`](../interfaces/GenericFileSystem.md) = `DEFAULT_FS`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L34)
|
||||
|
||||
---
|
||||
|
||||
### persistPath
|
||||
|
||||
• `Private` **persistPath**: `undefined` \| `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L35)
|
||||
|
||||
---
|
||||
|
||||
### storesText
|
||||
|
||||
• **storesText**: `boolean` = `false`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[storesText](../interfaces/VectorStore.md#storestext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L32)
|
||||
|
||||
## Accessors
|
||||
|
||||
### client
|
||||
|
||||
• `get` **client**(): `any`
|
||||
|
||||
#### Returns
|
||||
|
||||
`any`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
VectorStore.client
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L50)
|
||||
|
||||
## Methods
|
||||
|
||||
### add
|
||||
|
||||
▸ **add**(`embeddingResults`): `Promise`<`string`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------------- | :------------------------------------------------------- |
|
||||
| `embeddingResults` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[add](../interfaces/VectorStore.md#add)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L58)
|
||||
|
||||
---
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`refDocId`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :------- |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[delete](../interfaces/VectorStore.md#delete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:77](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L77)
|
||||
|
||||
---
|
||||
|
||||
### get
|
||||
|
||||
▸ **get**(`textId`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :------- |
|
||||
| `textId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L54)
|
||||
|
||||
---
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------------------- |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L146)
|
||||
|
||||
---
|
||||
|
||||
### query
|
||||
|
||||
▸ **query**(`query`): `Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------ |
|
||||
| `query` | [`VectorStoreQuery`](../interfaces/VectorStoreQuery.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[query](../interfaces/VectorStore.md#query)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L88)
|
||||
|
||||
---
|
||||
|
||||
### toDict
|
||||
|
||||
▸ **toDict**(): `SimpleVectorStoreData`
|
||||
|
||||
#### Returns
|
||||
|
||||
`SimpleVectorStoreData`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:196](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L196)
|
||||
|
||||
---
|
||||
|
||||
### fromDict
|
||||
|
||||
▸ `Static` **fromDict**(`saveDict`): [`SimpleVectorStore`](SimpleVectorStore.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---------------------- |
|
||||
| `saveDict` | `SimpleVectorStoreData` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleVectorStore`](SimpleVectorStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:189](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L189)
|
||||
|
||||
---
|
||||
|
||||
### fromPersistDir
|
||||
|
||||
▸ `Static` **fromPersistDir**(`persistDir?`, `fs?`): `Promise`<[`SimpleVectorStore`](SimpleVectorStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :----------- | :-------------------------------------------------------- | :-------------------- |
|
||||
| `persistDir` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleVectorStore`](SimpleVectorStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L42)
|
||||
|
||||
---
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`, `fs?`): `Promise`<[`SimpleVectorStore`](SimpleVectorStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------------------- |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleVectorStore`](SimpleVectorStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/SimpleVectorStore.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L159)
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
---
|
||||
id: "SubQuestionOutputParser"
|
||||
title: "Class: SubQuestionOutputParser"
|
||||
sidebar_label: "SubQuestionOutputParser"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
SubQuestionOutputParser is used to parse the output of the SubQuestionGenerator.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseOutputParser`](../interfaces/BaseOutputParser.md)<[`StructuredOutput`](../interfaces/StructuredOutput.md)<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>\>
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SubQuestionOutputParser**()
|
||||
|
||||
## Methods
|
||||
|
||||
### format
|
||||
|
||||
▸ **format**(`output`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :------- |
|
||||
| `output` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseOutputParser](../interfaces/BaseOutputParser.md).[format](../interfaces/BaseOutputParser.md#format)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/OutputParser.ts:98](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/OutputParser.ts#L98)
|
||||
|
||||
---
|
||||
|
||||
### parse
|
||||
|
||||
▸ **parse**(`output`): [`StructuredOutput`](../interfaces/StructuredOutput.md)<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :------- |
|
||||
| `output` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`StructuredOutput`](../interfaces/StructuredOutput.md)<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseOutputParser](../interfaces/BaseOutputParser.md).[parse](../interfaces/BaseOutputParser.md#parse)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/OutputParser.ts:90](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/OutputParser.ts#L90)
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
---
|
||||
id: "SubQuestionQueryEngine"
|
||||
title: "Class: SubQuestionQueryEngine"
|
||||
sidebar_label: "SubQuestionQueryEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
SubQuestionQueryEngine decomposes a question into subquestions and then
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SubQuestionQueryEngine**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------------- | :---------------------------------------------------------------- |
|
||||
| `init` | `Object` |
|
||||
| `init.queryEngineTools` | [`QueryEngineTool`](../interfaces/QueryEngineTool.md)[] |
|
||||
| `init.questionGen` | [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md) |
|
||||
| `init.responseSynthesizer` | [`ResponseSynthesizer`](ResponseSynthesizer.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L89)
|
||||
|
||||
## Properties
|
||||
|
||||
### metadatas
|
||||
|
||||
• **metadatas**: [`ToolMetadata`](../interfaces/ToolMetadata.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L87)
|
||||
|
||||
---
|
||||
|
||||
### queryEngines
|
||||
|
||||
• **queryEngines**: `Record`<`string`, [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:86](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L86)
|
||||
|
||||
---
|
||||
|
||||
### questionGen
|
||||
|
||||
• **questionGen**: [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:85](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L85)
|
||||
|
||||
---
|
||||
|
||||
### responseSynthesizer
|
||||
|
||||
• **responseSynthesizer**: [`ResponseSynthesizer`](ResponseSynthesizer.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L84)
|
||||
|
||||
## Methods
|
||||
|
||||
### query
|
||||
|
||||
▸ **query**(`query`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
Query the query engine and get a response.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[query](../interfaces/BaseQueryEngine.md#query)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:130](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L130)
|
||||
|
||||
---
|
||||
|
||||
### querySubQ
|
||||
|
||||
▸ `Private` **querySubQ**(`subQ`, `parentEvent?`): `Promise`<`null` \| [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------------------- |
|
||||
| `subQ` | [`SubQuestion`](../interfaces/SubQuestion.md) |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`null` \| [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:158](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L158)
|
||||
|
||||
---
|
||||
|
||||
### fromDefaults
|
||||
|
||||
▸ `Static` **fromDefaults**(`init`): [`SubQuestionQueryEngine`](SubQuestionQueryEngine.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------------------- | :---------------------------------------------------------------- |
|
||||
| `init` | `Object` |
|
||||
| `init.queryEngineTools` | [`QueryEngineTool`](../interfaces/QueryEngineTool.md)[] |
|
||||
| `init.questionGen?` | [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md) |
|
||||
| `init.responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) |
|
||||
| `init.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SubQuestionQueryEngine`](SubQuestionQueryEngine.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/QueryEngine.ts:106](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L106)
|
||||
+289
@@ -0,0 +1,289 @@
|
||||
---
|
||||
id: "SummaryChatHistory"
|
||||
title: "Class: SummaryChatHistory"
|
||||
sidebar_label: "SummaryChatHistory"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A ChatHistory is used to keep the state of back and forth chat messages
|
||||
|
||||
## Implements
|
||||
|
||||
- [`ChatHistory`](../interfaces/ChatHistory.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SummaryChatHistory**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :-------------------------------------------------------- |
|
||||
| `init?` | `Partial`<[`SummaryChatHistory`](SummaryChatHistory.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L70)
|
||||
|
||||
## Properties
|
||||
|
||||
### llm
|
||||
|
||||
• **llm**: [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L67)
|
||||
|
||||
---
|
||||
|
||||
### messages
|
||||
|
||||
• **messages**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatHistory](../interfaces/ChatHistory.md).[messages](../interfaces/ChatHistory.md#messages)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L65)
|
||||
|
||||
---
|
||||
|
||||
### messagesBefore
|
||||
|
||||
• `Private` **messagesBefore**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L68)
|
||||
|
||||
---
|
||||
|
||||
### summaryPrompt
|
||||
|
||||
• **summaryPrompt**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:66](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L66)
|
||||
|
||||
---
|
||||
|
||||
### tokensToSummarize
|
||||
|
||||
• **tokensToSummarize**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L64)
|
||||
|
||||
## Accessors
|
||||
|
||||
### nonSystemMessages
|
||||
|
||||
• `Private` `get` **nonSystemMessages**(): [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L127)
|
||||
|
||||
---
|
||||
|
||||
### systemMessages
|
||||
|
||||
• `Private` `get` **systemMessages**(): [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:122](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L122)
|
||||
|
||||
## Methods
|
||||
|
||||
### addMessage
|
||||
|
||||
▸ **addMessage**(`message`): `void`
|
||||
|
||||
Adds a message to the chat history.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :-------------------------------------------- |
|
||||
| `message` | [`ChatMessage`](../interfaces/ChatMessage.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatHistory](../interfaces/ChatHistory.md).[addMessage](../interfaces/ChatHistory.md#addmessage)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:106](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L106)
|
||||
|
||||
---
|
||||
|
||||
### calcConversationMessages
|
||||
|
||||
▸ `Private` **calcConversationMessages**(`transformSummary?`): [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
Calculates the messages that describe the conversation so far.
|
||||
If there's no memory, all non-system messages are used.
|
||||
If there's a memory, uses all messages after the last summary message.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------ | :-------- |
|
||||
| `transformSummary?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:137](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L137)
|
||||
|
||||
---
|
||||
|
||||
### calcCurrentRequestMessages
|
||||
|
||||
▸ `Private` **calcCurrentRequestMessages**(`transientMessages?`): [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------- | :---------------------------------------------- |
|
||||
| `transientMessages?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L155)
|
||||
|
||||
---
|
||||
|
||||
### getLastSummaryIndex
|
||||
|
||||
▸ `Private` **getLastSummaryIndex**(): `null` \| `number`
|
||||
|
||||
#### Returns
|
||||
|
||||
`null` \| `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:111](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L111)
|
||||
|
||||
---
|
||||
|
||||
### newMessages
|
||||
|
||||
▸ **newMessages**(): [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
Returns the new messages since the last call to this function (or since calling the constructor)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatHistory](../interfaces/ChatHistory.md).[newMessages](../interfaces/ChatHistory.md#newmessages)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:195](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L195)
|
||||
|
||||
---
|
||||
|
||||
### requestMessages
|
||||
|
||||
▸ **requestMessages**(`transientMessages?`): `Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)[]\>
|
||||
|
||||
Returns the messages that should be used as input to the LLM.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------- | :---------------------------------------------- |
|
||||
| `transientMessages?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatHistory](../interfaces/ChatHistory.md).[requestMessages](../interfaces/ChatHistory.md#requestmessages)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:165](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L165)
|
||||
|
||||
---
|
||||
|
||||
### reset
|
||||
|
||||
▸ **reset**(): `void`
|
||||
|
||||
Resets the chat history so that it's empty.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatHistory](../interfaces/ChatHistory.md).[reset](../interfaces/ChatHistory.md#reset)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L191)
|
||||
|
||||
---
|
||||
|
||||
### summarize
|
||||
|
||||
▸ `Private` **summarize**(): `Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ChatHistory.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L84)
|
||||
@@ -0,0 +1,352 @@
|
||||
---
|
||||
id: "SummaryIndex"
|
||||
title: "Class: SummaryIndex"
|
||||
sidebar_label: "SummaryIndex"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A SummaryIndex keeps nodes in a sequential order for use with summarization.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseIndex`](BaseIndex.md)<[`IndexList`](IndexList.md)\>
|
||||
|
||||
↳ **`SummaryIndex`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SummaryIndex**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :------------------------------------------------------------------------------ |
|
||||
| `init` | [`BaseIndexInit`](../interfaces/BaseIndexInit.md)<[`IndexList`](IndexList.md)\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[constructor](BaseIndex.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L48)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: [`BaseDocumentStore`](BaseDocumentStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[docStore](BaseIndex.md#docstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L156)
|
||||
|
||||
---
|
||||
|
||||
### indexStore
|
||||
|
||||
• `Optional` **indexStore**: [`BaseIndexStore`](BaseIndexStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[indexStore](BaseIndex.md#indexstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:158](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L158)
|
||||
|
||||
---
|
||||
|
||||
### indexStruct
|
||||
|
||||
• **indexStruct**: [`IndexList`](IndexList.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[indexStruct](BaseIndex.md#indexstruct)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L159)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[serviceContext](BaseIndex.md#servicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:154](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L154)
|
||||
|
||||
---
|
||||
|
||||
### storageContext
|
||||
|
||||
• **storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[storageContext](BaseIndex.md#storagecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L155)
|
||||
|
||||
---
|
||||
|
||||
### vectorStore
|
||||
|
||||
• `Optional` **vectorStore**: [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[vectorStore](BaseIndex.md#vectorstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L157)
|
||||
|
||||
## Methods
|
||||
|
||||
### asQueryEngine
|
||||
|
||||
▸ **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.nodePostprocessors?` | [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[] | - |
|
||||
| `options.preFilters?` | `unknown` | - |
|
||||
| `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
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L156)
|
||||
|
||||
---
|
||||
|
||||
### asRetriever
|
||||
|
||||
▸ **asRetriever**(`options?`): [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
Create a new retriever from the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :--------------------------------------------------------- |
|
||||
| `options?` | `Object` |
|
||||
| `options.mode` | [`SummaryRetrieverMode`](../enums/SummaryRetrieverMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[asRetriever](BaseIndex.md#asretriever)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:143](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L143)
|
||||
|
||||
---
|
||||
|
||||
### deleteNodes
|
||||
|
||||
▸ **deleteNodes**(`nodeIds`, `deleteFromDocStore`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------- | :--------- |
|
||||
| `nodeIds` | `string`[] |
|
||||
| `deleteFromDocStore` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L224)
|
||||
|
||||
---
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ **deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------------------- | :-------- |
|
||||
| `refDocId` | `string` |
|
||||
| `deleteFromDocStore?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[deleteRefDoc](BaseIndex.md#deleterefdoc)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:205](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L205)
|
||||
|
||||
---
|
||||
|
||||
### getRefDocInfo
|
||||
|
||||
▸ **getRefDocInfo**(): `Promise`<`Record`<`string`, [`RefDocInfo`](../interfaces/RefDocInfo.md)\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, [`RefDocInfo`](../interfaces/RefDocInfo.md)\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:238](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L238)
|
||||
|
||||
---
|
||||
|
||||
### insert
|
||||
|
||||
▸ **insert**(`document`): `Promise`<`void`\>
|
||||
|
||||
Insert a document into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :----------------------------------------------------- |
|
||||
| `document` | [`Document`](Document.md)<[`Metadata`](../#metadata)\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insert](BaseIndex.md#insert)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:190](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L190)
|
||||
|
||||
---
|
||||
|
||||
### insertNodes
|
||||
|
||||
▸ **insertNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------- |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insertNodes](BaseIndex.md#insertnodes)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:199](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L199)
|
||||
|
||||
---
|
||||
|
||||
### buildIndexFromNodes
|
||||
|
||||
▸ `Static` **buildIndexFromNodes**(`nodes`, `docStore`, `indexStruct?`): `Promise`<[`IndexList`](IndexList.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :------------------------------------------------------- |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
| `docStore` | [`BaseDocumentStore`](BaseDocumentStore.md) |
|
||||
| `indexStruct?` | [`IndexList`](IndexList.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`IndexList`](IndexList.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:184](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L184)
|
||||
|
||||
---
|
||||
|
||||
### fromDocuments
|
||||
|
||||
▸ `Static` **fromDocuments**(`documents`, `args?`): `Promise`<[`SummaryIndex`](SummaryIndex.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------------- | :------------------------------------------------------- |
|
||||
| `documents` | [`Document`](Document.md)<[`Metadata`](../#metadata)\>[] |
|
||||
| `args` | `Object` |
|
||||
| `args.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `args.storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SummaryIndex`](SummaryIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:117](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L117)
|
||||
|
||||
---
|
||||
|
||||
### init
|
||||
|
||||
▸ `Static` **init**(`options`): `Promise`<[`SummaryIndex`](SummaryIndex.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :-------------------- |
|
||||
| `options` | `SummaryIndexOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SummaryIndex`](SummaryIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L52)
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
---
|
||||
id: "SummaryIndexLLMRetriever"
|
||||
title: "Class: SummaryIndexLLMRetriever"
|
||||
sidebar_label: "SummaryIndexLLMRetriever"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
LLM retriever for SummaryIndex which lets you select the most relevant chunks.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SummaryIndexLLMRetriever**(`index`, `choiceSelectPrompt?`, `choiceBatchSize?`, `formatNodeBatchFn?`, `parseChoiceSelectAnswerFn?`, `serviceContext?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :--------------------------- | :-------------------------------------------------- | :------------ |
|
||||
| `index` | [`SummaryIndex`](SummaryIndex.md) | `undefined` |
|
||||
| `choiceSelectPrompt?` | (`__namedParameters`: `Object`) => `string` | `undefined` |
|
||||
| `choiceBatchSize` | `number` | `10` |
|
||||
| `formatNodeBatchFn?` | `NodeFormatterFunction` | `undefined` |
|
||||
| `parseChoiceSelectAnswerFn?` | `ChoiceSelectParserFunction` | `undefined` |
|
||||
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) | `undefined` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L64)
|
||||
|
||||
## Properties
|
||||
|
||||
### choiceBatchSize
|
||||
|
||||
• **choiceBatchSize**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L59)
|
||||
|
||||
---
|
||||
|
||||
### choiceSelectPrompt
|
||||
|
||||
• **choiceSelectPrompt**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L58)
|
||||
|
||||
---
|
||||
|
||||
### formatNodeBatchFn
|
||||
|
||||
• **formatNodeBatchFn**: `NodeFormatterFunction`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L60)
|
||||
|
||||
---
|
||||
|
||||
### index
|
||||
|
||||
• **index**: [`SummaryIndex`](SummaryIndex.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L57)
|
||||
|
||||
---
|
||||
|
||||
### parseChoiceSelectAnswerFn
|
||||
|
||||
• **parseChoiceSelectAnswerFn**: `ChoiceSelectParserFunction`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L61)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[getServiceContext](../interfaces/BaseRetriever.md#getservicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L127)
|
||||
|
||||
---
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[retrieve](../interfaces/BaseRetriever.md#retrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:81](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L81)
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
---
|
||||
id: "SummaryIndexRetriever"
|
||||
title: "Class: SummaryIndexRetriever"
|
||||
sidebar_label: "SummaryIndexRetriever"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Simple retriever for SummaryIndex that returns all nodes
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SummaryIndexRetriever**(`index`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :-------------------------------- |
|
||||
| `index` | [`SummaryIndex`](SummaryIndex.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L22)
|
||||
|
||||
## Properties
|
||||
|
||||
### index
|
||||
|
||||
• **index**: [`SummaryIndex`](SummaryIndex.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L20)
|
||||
|
||||
## Methods
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[getServiceContext](../interfaces/BaseRetriever.md#getservicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L48)
|
||||
|
||||
---
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[retrieve](../interfaces/BaseRetriever.md#retrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndexRetriever.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndexRetriever.ts#L26)
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
id: "TextFileReader"
|
||||
title: "Class: TextFileReader"
|
||||
sidebar_label: "TextFileReader"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Read a .txt file
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseReader`](../interfaces/BaseReader.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new TextFileReader**()
|
||||
|
||||
## Methods
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :--------------------------------------------- |
|
||||
| `file` | `string` |
|
||||
| `fs` | [`CompleteFileSystem`](../#completefilesystem) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/readers/SimpleDirectoryReader.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleDirectoryReader.ts#L29)
|
||||
@@ -0,0 +1,486 @@
|
||||
---
|
||||
id: "TextNode"
|
||||
title: "Class: TextNode<T>"
|
||||
sidebar_label: "TextNode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseNode`](BaseNode.md)<`T`\>
|
||||
|
||||
↳ **`TextNode`**
|
||||
|
||||
↳↳ [`IndexNode`](IndexNode.md)
|
||||
|
||||
↳↳ [`Document`](Document.md)
|
||||
|
||||
↳↳ [`ImageNode`](ImageNode.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new TextNode**<`T`\>(`init?`)
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--- | :-------------------------------------------------------------- |
|
||||
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------ |
|
||||
| `init?` | `Partial`<[`TextNode`](TextNode.md)<`T`\>\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[constructor](BaseNode.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L162)
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• `Optional` **embedding**: `number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[embedding](BaseNode.md#embedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
|
||||
|
||||
---
|
||||
|
||||
### endCharIdx
|
||||
|
||||
• `Optional` **endCharIdx**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L157)
|
||||
|
||||
---
|
||||
|
||||
### excludedEmbedMetadataKeys
|
||||
|
||||
• **excludedEmbedMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[excludedEmbedMetadataKeys](BaseNode.md#excludedembedmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
|
||||
|
||||
---
|
||||
|
||||
### excludedLlmMetadataKeys
|
||||
|
||||
• **excludedLlmMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[excludedLlmMetadataKeys](BaseNode.md#excludedllmmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
|
||||
|
||||
---
|
||||
|
||||
### hash
|
||||
|
||||
• **hash**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[hash](BaseNode.md#hash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
|
||||
|
||||
---
|
||||
|
||||
### id\_
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[id\_](BaseNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
|
||||
|
||||
---
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `T`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[metadata](BaseNode.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
|
||||
|
||||
---
|
||||
|
||||
### metadataSeparator
|
||||
|
||||
• **metadataSeparator**: `string` = `"\n"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:160](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L160)
|
||||
|
||||
---
|
||||
|
||||
### relationships
|
||||
|
||||
• **relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[relationships](BaseNode.md#relationships)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
|
||||
|
||||
---
|
||||
|
||||
### startCharIdx
|
||||
|
||||
• `Optional` **startCharIdx**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L156)
|
||||
|
||||
---
|
||||
|
||||
### text
|
||||
|
||||
• **text**: `string` = `""`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L155)
|
||||
|
||||
## Accessors
|
||||
|
||||
### childNodes
|
||||
|
||||
• `get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
|
||||
|
||||
---
|
||||
|
||||
### nextNode
|
||||
|
||||
• `get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
|
||||
|
||||
---
|
||||
|
||||
### parentNode
|
||||
|
||||
• `get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
|
||||
|
||||
---
|
||||
|
||||
### prevNode
|
||||
|
||||
• `get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
|
||||
|
||||
---
|
||||
|
||||
### sourceNode
|
||||
|
||||
• `get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRelatedNodeInfo
|
||||
|
||||
▸ **asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[asRelatedNodeInfo](BaseNode.md#asrelatednodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
|
||||
|
||||
---
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[generateHash](BaseNode.md#generatehash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L178)
|
||||
|
||||
---
|
||||
|
||||
### getContent
|
||||
|
||||
▸ **getContent**(`metadataMode?`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------- | :----------------------------------------- | :------------------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[getContent](BaseNode.md#getcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L192)
|
||||
|
||||
---
|
||||
|
||||
### getEmbedding
|
||||
|
||||
▸ **getEmbedding**(): `number`[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[getEmbedding](BaseNode.md#getembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
|
||||
|
||||
---
|
||||
|
||||
### getMetadataStr
|
||||
|
||||
▸ **getMetadataStr**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :----------------------------------------- |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[getMetadataStr](BaseNode.md#getmetadatastr)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L197)
|
||||
|
||||
---
|
||||
|
||||
### getNodeInfo
|
||||
|
||||
▸ **getNodeInfo**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :---------------------- |
|
||||
| `end` | `undefined` \| `number` |
|
||||
| `start` | `undefined` \| `number` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L224)
|
||||
|
||||
---
|
||||
|
||||
### getText
|
||||
|
||||
▸ **getText**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:228](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L228)
|
||||
|
||||
---
|
||||
|
||||
### getType
|
||||
|
||||
▸ **getType**(): [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[getType](BaseNode.md#gettype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:188](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L188)
|
||||
|
||||
---
|
||||
|
||||
### setContent
|
||||
|
||||
▸ **setContent**(`value`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------- |
|
||||
| `value` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[setContent](BaseNode.md#setcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:218](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L218)
|
||||
|
||||
---
|
||||
|
||||
### toJSON
|
||||
|
||||
▸ **toJSON**(): `Record`<`string`, `any`\>
|
||||
|
||||
Used with built in JSON.stringify
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `any`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[toJSON](BaseNode.md#tojson)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
|
||||
@@ -0,0 +1,90 @@
|
||||
---
|
||||
id: "TreeSummarize"
|
||||
title: "Class: TreeSummarize"
|
||||
sidebar_label: "TreeSummarize"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
TreeSummarize repacks the text chunks into the smallest possible number of chunks and then summarizes them, then recursively does so until there's one chunk left.
|
||||
|
||||
## Implements
|
||||
|
||||
- `BaseResponseBuilder`
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new TreeSummarize**(`serviceContext`, `summaryTemplate?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------------- | :-------------------------------------------------- |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `summaryTemplate?` | (`__namedParameters`: `Object`) => `string` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:217](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L217)
|
||||
|
||||
## Properties
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:214](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L214)
|
||||
|
||||
---
|
||||
|
||||
### summaryTemplate
|
||||
|
||||
• **summaryTemplate**: (`__namedParameters`: `Object`) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`«destructured»`): `string`
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :------- |
|
||||
| `«destructured»` | `Object` |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:215](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L215)
|
||||
|
||||
## Methods
|
||||
|
||||
### getResponse
|
||||
|
||||
▸ **getResponse**(`query`, `textChunks`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
BaseResponseBuilder.getResponse
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/ResponseSynthesizer.ts:225](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L225)
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
---
|
||||
id: "VectorIndexRetriever"
|
||||
title: "Class: VectorIndexRetriever"
|
||||
sidebar_label: "VectorIndexRetriever"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
VectorIndexRetriever retrieves nodes from a VectorIndex.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new VectorIndexRetriever**(`«destructured»`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------------ | :---------------------------------------- |
|
||||
| `«destructured»` | `Object` |
|
||||
| › `index` | [`VectorStoreIndex`](VectorStoreIndex.md) |
|
||||
| › `similarityTopK?` | `number` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L24)
|
||||
|
||||
## Properties
|
||||
|
||||
### index
|
||||
|
||||
• **index**: [`VectorStoreIndex`](VectorStoreIndex.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L20)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• `Private` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L22)
|
||||
|
||||
---
|
||||
|
||||
### similarityTopK
|
||||
|
||||
• **similarityTopK**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L21)
|
||||
|
||||
## Methods
|
||||
|
||||
### buildNodeListFromQueryResult
|
||||
|
||||
▸ `Protected` **buildNodeListFromQueryResult**(`result`): [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------- | :------------------------------------------------------------------ |
|
||||
| `result` | [`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L102)
|
||||
|
||||
---
|
||||
|
||||
### buildVectorStoreQuery
|
||||
|
||||
▸ `Protected` **buildVectorStoreQuery**(`embedModel`, `query`): `Promise`<[`VectorStoreQuery`](../interfaces/VectorStoreQuery.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :---------------------------------- |
|
||||
| `embedModel` | [`BaseEmbedding`](BaseEmbedding.md) |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreQuery`](../interfaces/VectorStoreQuery.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L89)
|
||||
|
||||
---
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[getServiceContext](../interfaces/BaseRetriever.md#getservicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:120](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L120)
|
||||
|
||||
---
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`query`, `parentEvent?`, `preFilters?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------- | :-------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
| `preFilters?` | `unknown` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[retrieve](../interfaces/BaseRetriever.md#retrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L37)
|
||||
|
||||
---
|
||||
|
||||
### sendEvent
|
||||
|
||||
▸ `Protected` **sendEvent**(`query`, `nodesWithScores`, `parentEvent`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :---------------- | :------------------------------------------------------------------------------- |
|
||||
| `query` | `string` |
|
||||
| `nodesWithScores` | [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[] |
|
||||
| `parentEvent` | `undefined` \| [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L72)
|
||||
|
||||
---
|
||||
|
||||
### textRetrieve
|
||||
|
||||
▸ `Protected` **textRetrieve**(`query`, `preFilters?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------- |
|
||||
| `query` | `string` |
|
||||
| `preFilters?` | `unknown` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L50)
|
||||
|
||||
---
|
||||
|
||||
### textToImageRetrieve
|
||||
|
||||
▸ `Private` **textToImageRetrieve**(`query`, `preFilters?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------- |
|
||||
| `query` | `string` |
|
||||
| `preFilters?` | `unknown` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorIndexRetriever.ts#L59)
|
||||
+503
@@ -0,0 +1,503 @@
|
||||
---
|
||||
id: "VectorStoreIndex"
|
||||
title: "Class: VectorStoreIndex"
|
||||
sidebar_label: "VectorStoreIndex"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The VectorStoreIndex, an index that stores the nodes only according to their vector embedings.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseIndex`](BaseIndex.md)<[`IndexDict`](IndexDict.md)\>
|
||||
|
||||
↳ **`VectorStoreIndex`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• `Private` **new VectorStoreIndex**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----- | :---------------------------- |
|
||||
| `init` | `VectorIndexConstructorProps` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[constructor](BaseIndex.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L64)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: [`BaseDocumentStore`](BaseDocumentStore.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[docStore](BaseIndex.md#docstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L156)
|
||||
|
||||
---
|
||||
|
||||
### embedModel
|
||||
|
||||
• **embedModel**: [`BaseEmbedding`](BaseEmbedding.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L60)
|
||||
|
||||
---
|
||||
|
||||
### imageEmbedModel
|
||||
|
||||
• `Optional` **imageEmbedModel**: [`MultiModalEmbedding`](MultiModalEmbedding.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L62)
|
||||
|
||||
---
|
||||
|
||||
### imageVectorStore
|
||||
|
||||
• `Optional` **imageVectorStore**: [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L61)
|
||||
|
||||
---
|
||||
|
||||
### indexStore
|
||||
|
||||
• **indexStore**: [`BaseIndexStore`](BaseIndexStore.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[indexStore](BaseIndex.md#indexstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L59)
|
||||
|
||||
---
|
||||
|
||||
### indexStruct
|
||||
|
||||
• **indexStruct**: [`IndexDict`](IndexDict.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[indexStruct](BaseIndex.md#indexstruct)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L159)
|
||||
|
||||
---
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[serviceContext](BaseIndex.md#servicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:154](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L154)
|
||||
|
||||
---
|
||||
|
||||
### storageContext
|
||||
|
||||
• **storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[storageContext](BaseIndex.md#storagecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L155)
|
||||
|
||||
---
|
||||
|
||||
### vectorStore
|
||||
|
||||
• **vectorStore**: [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[vectorStore](BaseIndex.md#vectorstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L58)
|
||||
|
||||
## Methods
|
||||
|
||||
### asQueryEngine
|
||||
|
||||
▸ **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.nodePostprocessors?` | [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[] | - |
|
||||
| `options.preFilters?` | `unknown` | - |
|
||||
| `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
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:244](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L244)
|
||||
|
||||
---
|
||||
|
||||
### asRetriever
|
||||
|
||||
▸ **asRetriever**(`options?`): [`VectorIndexRetriever`](VectorIndexRetriever.md)
|
||||
|
||||
Create a new retriever from the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :---- |
|
||||
| `options?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`VectorIndexRetriever`](VectorIndexRetriever.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[asRetriever](BaseIndex.md#asretriever)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:240](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L240)
|
||||
|
||||
---
|
||||
|
||||
### buildIndexFromNodes
|
||||
|
||||
▸ **buildIndexFromNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
Get embeddings for nodes and place them into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------- |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L178)
|
||||
|
||||
---
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ **deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------------------- | :-------- | :------------ |
|
||||
| `refDocId` | `string` | `undefined` |
|
||||
| `deleteFromDocStore` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[deleteRefDoc](BaseIndex.md#deleterefdoc)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:305](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L305)
|
||||
|
||||
---
|
||||
|
||||
### deleteRefDocFromStore
|
||||
|
||||
▸ `Protected` **deleteRefDocFromStore**(`vectorStore`, `refDocId`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :-------------------------------------------- |
|
||||
| `vectorStore` | [`VectorStore`](../interfaces/VectorStore.md) |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:319](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L319)
|
||||
|
||||
---
|
||||
|
||||
### getImageNodeEmbeddingResults
|
||||
|
||||
▸ **getImageNodeEmbeddingResults**(`nodes`, `logProgress?`): `Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
Get the embeddings for image nodes.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------------ | :--------------------------------------------------------- | :------------ | :--------------------------------------------- |
|
||||
| `nodes` | [`ImageNode`](ImageNode.md)<[`Metadata`](../#metadata)\>[] | `undefined` | |
|
||||
| `logProgress` | `boolean` | `false` | log progress to console (useful for debugging) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:345](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L345)
|
||||
|
||||
---
|
||||
|
||||
### getNodeEmbeddingResults
|
||||
|
||||
▸ **getNodeEmbeddingResults**(`nodes`, `logProgress?`): `Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
Get the embeddings for nodes.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------------ | :------------------------------------------------------- | :------------ | :--------------------------------------------- |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] | `undefined` | |
|
||||
| `logProgress` | `boolean` | `false` | log progress to console (useful for debugging) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L155)
|
||||
|
||||
---
|
||||
|
||||
### insert
|
||||
|
||||
▸ **insert**(`document`): `Promise`<`void`\>
|
||||
|
||||
Insert a document into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :----------------------------------------------------- |
|
||||
| `document` | [`Document`](Document.md)<[`Metadata`](../#metadata)\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insert](BaseIndex.md#insert)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:190](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L190)
|
||||
|
||||
---
|
||||
|
||||
### insertNodes
|
||||
|
||||
▸ **insertNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------- |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insertNodes](BaseIndex.md#insertnodes)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:284](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L284)
|
||||
|
||||
---
|
||||
|
||||
### insertNodesToStore
|
||||
|
||||
▸ `Protected` **insertNodesToStore**(`vectorStore`, `nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------------ | :------------------------------------------------------- |
|
||||
| `vectorStore` | [`VectorStore`](../interfaces/VectorStore.md) |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:259](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L259)
|
||||
|
||||
---
|
||||
|
||||
### splitNodes
|
||||
|
||||
▸ `Private` **splitNodes**(`nodes`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------------------------------------------------------- |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :--------------------------------------------------------- |
|
||||
| `imageNodes` | [`ImageNode`](ImageNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
| `textNodes` | [`TextNode`](TextNode.md)<[`Metadata`](../#metadata)\>[] |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:367](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L367)
|
||||
|
||||
---
|
||||
|
||||
### 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)<[`Metadata`](../#metadata)\>[] |
|
||||
| `args` | `VectorIndexOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:201](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L201)
|
||||
|
||||
---
|
||||
|
||||
### fromVectorStore
|
||||
|
||||
▸ `Static` **fromVectorStore**(`vectorStore`, `serviceContext`): `Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------------- | :-------------------------------------------------- |
|
||||
| `vectorStore` | [`VectorStore`](../interfaces/VectorStore.md) |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:219](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L219)
|
||||
|
||||
---
|
||||
|
||||
### init
|
||||
|
||||
▸ `Static` **init**(`options`): `Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
The async init function creates a new VectorStoreIndex.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :-------- | :------------------- |
|
||||
| `options` | `VectorIndexOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L80)
|
||||
|
||||
---
|
||||
|
||||
### setupIndexStructFromStorage
|
||||
|
||||
▸ `Static` `Private` **setupIndexStructFromStorage**(`indexStore`, `options`): `Promise`<`undefined` \| [`IndexDict`](IndexDict.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :----------- | :------------------------------------ |
|
||||
| `indexStore` | [`BaseIndexStore`](BaseIndexStore.md) |
|
||||
| `options` | `IndexStructOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`IndexDict`](IndexDict.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/vectorStore/VectorStoreIndex.ts:118](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L118)
|
||||
@@ -0,0 +1,2 @@
|
||||
label: "Classes"
|
||||
position: 3
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
---
|
||||
id: "ClipEmbeddingModelType"
|
||||
title: "Enumeration: ClipEmbeddingModelType"
|
||||
sidebar_label: "ClipEmbeddingModelType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### XENOVA_CLIP_VIT_BASE_PATCH16
|
||||
|
||||
• **XENOVA_CLIP_VIT_BASE_PATCH16** = `"Xenova/clip-vit-base-patch16"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L7)
|
||||
|
||||
---
|
||||
|
||||
### XENOVA_CLIP_VIT_BASE_PATCH32
|
||||
|
||||
• **XENOVA_CLIP_VIT_BASE_PATCH32** = `"Xenova/clip-vit-base-patch32"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/ClipEmbedding.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L6)
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
---
|
||||
id: "DeuceChatStrategy"
|
||||
title: "Enumeration: DeuceChatStrategy"
|
||||
sidebar_label: "DeuceChatStrategy"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### A16Z
|
||||
|
||||
• **A16Z** = `"a16z"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:411](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L411)
|
||||
|
||||
---
|
||||
|
||||
### META
|
||||
|
||||
• **META** = `"meta"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:412](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L412)
|
||||
|
||||
---
|
||||
|
||||
### METAWBOS
|
||||
|
||||
• **METAWBOS** = `"metawbos"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:413](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L413)
|
||||
|
||||
---
|
||||
|
||||
### REPLICATE4BIT
|
||||
|
||||
• **REPLICATE4BIT** = `"replicate4bit"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:416](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L416)
|
||||
|
||||
---
|
||||
|
||||
### REPLICATE4BITWNEWLINES
|
||||
|
||||
• **REPLICATE4BITWNEWLINES** = `"replicate4bitwnewlines"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/llm/LLM.ts:418](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L418)
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
id: "IndexStructType"
|
||||
title: "Enumeration: IndexStructType"
|
||||
sidebar_label: "IndexStructType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### KEYWORD_TABLE
|
||||
|
||||
• **KEYWORD_TABLE** = `"keyword_table"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L42)
|
||||
|
||||
---
|
||||
|
||||
### LIST
|
||||
|
||||
• **LIST** = `"list"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L41)
|
||||
|
||||
---
|
||||
|
||||
### SIMPLE_DICT
|
||||
|
||||
• **SIMPLE_DICT** = `"simple_dict"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/BaseIndex.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L40)
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
---
|
||||
id: "KeywordTableRetrieverMode"
|
||||
title: "Enumeration: KeywordTableRetrieverMode"
|
||||
sidebar_label: "KeywordTableRetrieverMode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### DEFAULT
|
||||
|
||||
• **DEFAULT** = `"DEFAULT"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L34)
|
||||
|
||||
---
|
||||
|
||||
### RAKE
|
||||
|
||||
• **RAKE** = `"RAKE"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L36)
|
||||
|
||||
---
|
||||
|
||||
### SIMPLE
|
||||
|
||||
• **SIMPLE** = `"SIMPLE"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/keyword/KeywordTableIndex.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L35)
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
id: "MetadataMode"
|
||||
title: "Enumeration: MetadataMode"
|
||||
sidebar_label: "MetadataMode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### ALL
|
||||
|
||||
• **ALL** = `"ALL"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L21)
|
||||
|
||||
---
|
||||
|
||||
### EMBED
|
||||
|
||||
• **EMBED** = `"EMBED"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L22)
|
||||
|
||||
---
|
||||
|
||||
### LLM
|
||||
|
||||
• **LLM** = `"LLM"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L23)
|
||||
|
||||
---
|
||||
|
||||
### NONE
|
||||
|
||||
• **NONE** = `"NONE"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L24)
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
---
|
||||
id: "NodeRelationship"
|
||||
title: "Enumeration: NodeRelationship"
|
||||
sidebar_label: "NodeRelationship"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### CHILD
|
||||
|
||||
• **CHILD** = `"CHILD"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L9)
|
||||
|
||||
---
|
||||
|
||||
### NEXT
|
||||
|
||||
• **NEXT** = `"NEXT"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L7)
|
||||
|
||||
---
|
||||
|
||||
### PARENT
|
||||
|
||||
• **PARENT** = `"PARENT"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L8)
|
||||
|
||||
---
|
||||
|
||||
### PREVIOUS
|
||||
|
||||
• **PREVIOUS** = `"PREVIOUS"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L6)
|
||||
|
||||
---
|
||||
|
||||
### SOURCE
|
||||
|
||||
• **SOURCE** = `"SOURCE"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L5)
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
id: "ObjectType"
|
||||
title: "Enumeration: ObjectType"
|
||||
sidebar_label: "ObjectType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### DOCUMENT
|
||||
|
||||
• **DOCUMENT** = `"DOCUMENT"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L16)
|
||||
|
||||
---
|
||||
|
||||
### IMAGE
|
||||
|
||||
• **IMAGE** = `"IMAGE"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L14)
|
||||
|
||||
---
|
||||
|
||||
### IMAGE_DOCUMENT
|
||||
|
||||
• **IMAGE_DOCUMENT** = `"IMAGE_DOCUMENT"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L17)
|
||||
|
||||
---
|
||||
|
||||
### INDEX
|
||||
|
||||
• **INDEX** = `"INDEX"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L15)
|
||||
|
||||
---
|
||||
|
||||
### TEXT
|
||||
|
||||
• **TEXT** = `"TEXT"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/Node.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L13)
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
---
|
||||
id: "OpenAIEmbeddingModelType"
|
||||
title: "Enumeration: OpenAIEmbeddingModelType"
|
||||
sidebar_label: "OpenAIEmbeddingModelType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### TEXT_EMBED_ADA_002
|
||||
|
||||
• **TEXT_EMBED_ADA_002** = `"text-embedding-ada-002"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/OpenAIEmbedding.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L13)
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
id: "SimilarityType"
|
||||
title: "Enumeration: SimilarityType"
|
||||
sidebar_label: "SimilarityType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Similarity type
|
||||
Default is cosine similarity. Dot product and negative Euclidean distance are also supported.
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### DEFAULT
|
||||
|
||||
• **DEFAULT** = `"cosine"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L8)
|
||||
|
||||
---
|
||||
|
||||
### DOT_PRODUCT
|
||||
|
||||
• **DOT_PRODUCT** = `"dot_product"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L9)
|
||||
|
||||
---
|
||||
|
||||
### EUCLIDEAN
|
||||
|
||||
• **EUCLIDEAN** = `"euclidean"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/embeddings/types.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L10)
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
---
|
||||
id: "SummaryRetrieverMode"
|
||||
title: "Enumeration: SummaryRetrieverMode"
|
||||
sidebar_label: "SummaryRetrieverMode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### DEFAULT
|
||||
|
||||
• **DEFAULT** = `"default"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L31)
|
||||
|
||||
---
|
||||
|
||||
### LLM
|
||||
|
||||
• **LLM** = `"llm"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/indices/summary/SummaryIndex.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/summary/SummaryIndex.ts#L33)
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
id: "Tokenizers"
|
||||
title: "Enumeration: Tokenizers"
|
||||
sidebar_label: "Tokenizers"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### CL100K_BASE
|
||||
|
||||
• **CL100K_BASE** = `"cl100k_base"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/GlobalsHelper.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/GlobalsHelper.ts#L7)
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
---
|
||||
id: "VectorStoreQueryMode"
|
||||
title: "Enumeration: VectorStoreQueryMode"
|
||||
sidebar_label: "VectorStoreQueryMode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### DEFAULT
|
||||
|
||||
• **DEFAULT** = `"default"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/types.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/types.ts#L10)
|
||||
|
||||
---
|
||||
|
||||
### HYBRID
|
||||
|
||||
• **HYBRID** = `"hybrid"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/types.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/types.ts#L12)
|
||||
|
||||
---
|
||||
|
||||
### LINEAR_REGRESSION
|
||||
|
||||
• **LINEAR_REGRESSION** = `"linear_regression"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/types.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/types.ts#L16)
|
||||
|
||||
---
|
||||
|
||||
### LOGISTIC_REGRESSION
|
||||
|
||||
• **LOGISTIC_REGRESSION** = `"logistic_regression"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/types.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/types.ts#L15)
|
||||
|
||||
---
|
||||
|
||||
### MMR
|
||||
|
||||
• **MMR** = `"mmr"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/types.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/types.ts#L18)
|
||||
|
||||
---
|
||||
|
||||
### SPARSE
|
||||
|
||||
• **SPARSE** = `"sparse"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/types.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/types.ts#L11)
|
||||
|
||||
---
|
||||
|
||||
### SVM
|
||||
|
||||
• **SVM** = `"svm"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/core/src/storage/vectorStore/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/types.ts#L14)
|
||||
@@ -0,0 +1,2 @@
|
||||
label: "Enumerations"
|
||||
position: 2
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user