Skip to content
Snippets Groups Projects
Commit 07c5aeba authored by Yi Ding's avatar Yi Ding
Browse files

built out the docs

parent d16113ad
No related branches found
No related tags found
No related merge requests found
Showing
with 209 additions and 107 deletions
......@@ -16,7 +16,7 @@ A node with an embedding
#### Defined in
[Node.ts:247](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Node.ts#L247)
[Node.ts:247](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L247)
___
......@@ -26,4 +26,4 @@ ___
#### Defined in
[Node.ts:246](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Node.ts#L246)
[Node.ts:246](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L246)
......@@ -16,7 +16,7 @@ A node with a similarity score
#### Defined in
[Node.ts:238](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Node.ts#L238)
[Node.ts:238](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L238)
___
......@@ -26,4 +26,4 @@ ___
#### Defined in
[Node.ts:239](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Node.ts#L239)
[Node.ts:239](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L239)
......@@ -26,7 +26,7 @@ A Tool that uses a QueryEngine.
#### Defined in
[Tool.ts:12](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Tool.ts#L12)
[Tool.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L12)
___
......@@ -36,4 +36,4 @@ ___
#### Defined in
[Tool.ts:19](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Tool.ts#L19)
[Tool.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L19)
......@@ -14,7 +14,7 @@ custom_edit_url: null
#### Defined in
[Node.ts:29](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Node.ts#L29)
[Node.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L29)
___
......@@ -24,7 +24,7 @@ ___
#### Defined in
[Node.ts:28](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Node.ts#L28)
[Node.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L28)
___
......@@ -34,7 +34,7 @@ ___
#### Defined in
[Node.ts:26](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Node.ts#L26)
[Node.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L26)
___
......@@ -44,4 +44,4 @@ ___
#### Defined in
[Node.ts:27](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Node.ts#L27)
[Node.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L27)
......@@ -24,7 +24,7 @@ BaseCallbackResponse.event
#### Defined in
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L21)
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L21)
___
......@@ -34,7 +34,7 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:47](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L47)
[callbacks/CallbackManager.ts:47](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L47)
___
......@@ -44,4 +44,4 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:46](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L46)
[callbacks/CallbackManager.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L46)
......@@ -16,7 +16,7 @@ The ServiceContext is a collection of components that are used in different part
#### Defined in
[ServiceContext.ts:16](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L16)
[ServiceContext.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L16)
___
......@@ -26,7 +26,7 @@ ___
#### Defined in
[ServiceContext.ts:14](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L14)
[ServiceContext.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L14)
___
......@@ -36,7 +36,7 @@ ___
#### Defined in
[ServiceContext.ts:12](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L12)
[ServiceContext.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L12)
___
......@@ -46,7 +46,7 @@ ___
#### Defined in
[ServiceContext.ts:15](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L15)
[ServiceContext.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L15)
___
......@@ -56,4 +56,4 @@ ___
#### Defined in
[ServiceContext.ts:13](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L13)
[ServiceContext.ts:13](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L13)
......@@ -14,7 +14,7 @@ custom_edit_url: null
#### Defined in
[ServiceContext.ts:26](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L26)
[ServiceContext.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L26)
___
......@@ -24,7 +24,7 @@ ___
#### Defined in
[ServiceContext.ts:29](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L29)
[ServiceContext.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L29)
___
......@@ -34,7 +34,7 @@ ___
#### Defined in
[ServiceContext.ts:28](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L28)
[ServiceContext.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L28)
___
......@@ -44,7 +44,7 @@ ___
#### Defined in
[ServiceContext.ts:24](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L24)
[ServiceContext.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L24)
___
......@@ -54,7 +54,7 @@ ___
#### Defined in
[ServiceContext.ts:22](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L22)
[ServiceContext.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L22)
___
......@@ -64,7 +64,7 @@ ___
#### Defined in
[ServiceContext.ts:21](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L21)
[ServiceContext.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L21)
___
......@@ -74,7 +74,7 @@ ___
#### Defined in
[ServiceContext.ts:25](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L25)
[ServiceContext.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L25)
___
......@@ -84,4 +84,4 @@ ___
#### Defined in
[ServiceContext.ts:23](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L23)
[ServiceContext.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L23)
......@@ -14,7 +14,7 @@ custom_edit_url: null
#### Defined in
[storage/StorageContext.ts:15](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/StorageContext.ts#L15)
[storage/StorageContext.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L15)
___
......@@ -24,7 +24,7 @@ ___
#### Defined in
[storage/StorageContext.ts:16](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/StorageContext.ts#L16)
[storage/StorageContext.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L16)
___
......@@ -34,4 +34,4 @@ ___
#### Defined in
[storage/StorageContext.ts:17](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/StorageContext.ts#L17)
[storage/StorageContext.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L17)
......@@ -24,7 +24,7 @@ BaseCallbackResponse.event
#### Defined in
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L21)
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L21)
___
......@@ -34,7 +34,7 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:40](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L40)
[callbacks/CallbackManager.ts:40](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L40)
___
......@@ -44,7 +44,7 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:41](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L41)
[callbacks/CallbackManager.ts:41](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L41)
___
......@@ -54,4 +54,4 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:42](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L42)
[callbacks/CallbackManager.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L42)
......@@ -14,7 +14,7 @@ custom_edit_url: null
#### Defined in
[callbacks/CallbackManager.ts:29](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L29)
[callbacks/CallbackManager.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L29)
___
......@@ -24,7 +24,7 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:27](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L27)
[callbacks/CallbackManager.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L27)
___
......@@ -34,7 +34,7 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:25](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L25)
[callbacks/CallbackManager.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L25)
___
......@@ -44,7 +44,7 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:28](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L28)
[callbacks/CallbackManager.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L28)
___
......@@ -54,4 +54,4 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:26](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L26)
[callbacks/CallbackManager.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L26)
......@@ -22,7 +22,7 @@ StructuredOutput is just a combo of the raw output and the parsed output.
#### Defined in
[OutputParser.ts:16](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/OutputParser.ts#L16)
[OutputParser.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L16)
___
......@@ -32,4 +32,4 @@ ___
#### Defined in
[OutputParser.ts:15](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/OutputParser.ts#L15)
[OutputParser.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L15)
......@@ -14,7 +14,7 @@ custom_edit_url: null
#### Defined in
[QuestionGenerator.ts:15](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/QuestionGenerator.ts#L15)
[QuestionGenerator.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L15)
___
......@@ -24,4 +24,4 @@ ___
#### Defined in
[QuestionGenerator.ts:16](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/QuestionGenerator.ts#L16)
[QuestionGenerator.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L16)
......@@ -14,7 +14,7 @@ custom_edit_url: null
#### Defined in
[Tool.ts:4](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Tool.ts#L4)
[Tool.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L4)
___
......@@ -24,4 +24,4 @@ ___
#### Defined in
[Tool.ts:5](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Tool.ts#L5)
[Tool.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L5)
......@@ -14,7 +14,7 @@ custom_edit_url: null
#### Defined in
[BaseIndex.ts:89](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/BaseIndex.ts#L89)
[BaseIndex.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L94)
___
......@@ -24,7 +24,7 @@ ___
#### Defined in
[BaseIndex.ts:88](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/BaseIndex.ts#L88)
[BaseIndex.ts:93](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L93)
___
......@@ -34,7 +34,7 @@ ___
#### Defined in
[BaseIndex.ts:90](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/BaseIndex.ts#L90)
[BaseIndex.ts:95](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L95)
___
......@@ -44,4 +44,4 @@ ___
#### Defined in
[BaseIndex.ts:91](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/BaseIndex.ts#L91)
[BaseIndex.ts:96](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L96)
......@@ -24,7 +24,7 @@ custom_edit_url: null
#### Defined in
[storage/FileSystem.ts:17](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/FileSystem.ts#L17)
[storage/FileSystem.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L17)
___
......@@ -44,4 +44,4 @@ ___
#### Defined in
[storage/FileSystem.ts:18](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/FileSystem.ts#L18)
[storage/FileSystem.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L18)
---
id: "modules"
title: "@llamaindex/core"
title: "llamaindex"
sidebar_label: "Exports"
sidebar_position: 0.5
custom_edit_url: null
......@@ -62,6 +62,7 @@ custom_edit_url: null
- [BaseReader](interfaces/BaseReader.md)
- [BaseRetriever](interfaces/BaseRetriever.md)
- [BaseTool](interfaces/BaseTool.md)
- [ChatEngine](interfaces/ChatEngine.md)
- [ChatMessage](interfaces/ChatMessage.md)
- [ChatResponse](interfaces/ChatResponse.md)
- [Event](interfaces/Event.md)
......@@ -92,7 +93,7 @@ custom_edit_url: null
#### Defined in
[storage/FileSystem.ts:49](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/FileSystem.ts#L49)
[storage/FileSystem.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L49)
___
......@@ -102,7 +103,7 @@ ___
#### Defined in
[LLM.ts:25](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/LLM.ts#L25)
[LLM.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L25)
___
......@@ -112,7 +113,7 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:11](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L11)
[callbacks/CallbackManager.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L11)
___
......@@ -122,7 +123,7 @@ ___
#### Defined in
[callbacks/CallbackManager.ts:12](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/callbacks/CallbackManager.ts#L12)
[callbacks/CallbackManager.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L12)
___
......@@ -132,7 +133,7 @@ ___
#### Defined in
[Node.ts:32](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Node.ts#L32)
[Node.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L32)
___
......@@ -151,7 +152,7 @@ ___
#### Defined in
[readers/SimpleDirectoryReader.ts:26](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/readers/SimpleDirectoryReader.ts#L26)
[readers/SimpleDirectoryReader.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/readers/SimpleDirectoryReader.ts#L26)
___
......@@ -179,7 +180,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
## Variables
......@@ -200,7 +201,7 @@ We currently support GPT-3.5 and GPT-4 models
#### Defined in
[LLM.ts:57](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/LLM.ts#L57)
[LLM.ts:57](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L57)
___
......@@ -210,7 +211,7 @@ ___
#### Defined in
[constants.ts:5](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/constants.ts#L5)
[constants.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L5)
___
......@@ -220,7 +221,7 @@ ___
#### Defined in
[constants.ts:6](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/constants.ts#L6)
[constants.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L6)
___
......@@ -230,7 +231,7 @@ ___
#### Defined in
[constants.ts:4](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/constants.ts#L4)
[constants.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L4)
___
......@@ -240,7 +241,7 @@ ___
#### Defined in
[storage/constants.ts:1](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/constants.ts#L1)
[storage/constants.ts:1](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L1)
___
......@@ -250,7 +251,7 @@ ___
#### Defined in
[constants.ts:1](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/constants.ts#L1)
[constants.ts:1](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L1)
___
......@@ -260,7 +261,7 @@ ___
#### Defined in
[storage/constants.ts:4](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/constants.ts#L4)
[storage/constants.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L4)
___
......@@ -270,7 +271,7 @@ ___
#### Defined in
[constants.ts:10](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/constants.ts#L10)
[constants.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L10)
___
......@@ -280,7 +281,7 @@ ___
#### Defined in
[storage/FileSystem.ts:62](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/FileSystem.ts#L62)
[storage/FileSystem.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L62)
___
......@@ -290,7 +291,7 @@ ___
#### Defined in
[storage/constants.ts:6](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/constants.ts#L6)
[storage/constants.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L6)
___
......@@ -300,7 +301,7 @@ ___
#### Defined in
[storage/constants.ts:3](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/constants.ts#L3)
[storage/constants.ts:3](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L3)
___
......@@ -310,7 +311,7 @@ ___
#### Defined in
[storage/constants.ts:7](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/constants.ts#L7)
[storage/constants.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L7)
___
......@@ -320,7 +321,7 @@ ___
#### Defined in
[constants.ts:2](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/constants.ts#L2)
[constants.ts:2](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L2)
___
......@@ -330,7 +331,7 @@ ___
#### Defined in
[constants.ts:11](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/constants.ts#L11)
[constants.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L11)
___
......@@ -340,7 +341,7 @@ ___
#### Defined in
[storage/constants.ts:2](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/constants.ts#L2)
[storage/constants.ts:2](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L2)
___
......@@ -350,7 +351,7 @@ ___
#### Defined in
[constants.ts:7](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/constants.ts#L7)
[constants.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L7)
___
......@@ -360,7 +361,7 @@ ___
#### Defined in
[storage/constants.ts:5](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/constants.ts#L5)
[storage/constants.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L5)
___
......@@ -377,7 +378,7 @@ ___
#### Defined in
[LLM.ts:44](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/LLM.ts#L44)
[LLM.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L44)
___
......@@ -394,7 +395,7 @@ ___
#### Defined in
[LLM.ts:49](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/LLM.ts#L49)
[LLM.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L49)
___
......@@ -404,7 +405,7 @@ ___
#### Defined in
[GlobalsHelper.ts:42](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/GlobalsHelper.ts#L42)
[GlobalsHelper.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/GlobalsHelper.ts#L42)
## Functions
......@@ -424,7 +425,7 @@ ___
#### Defined in
[Prompt.ts:198](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Prompt.ts#L198)
[Prompt.ts:198](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L198)
___
......@@ -448,7 +449,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
......@@ -472,7 +473,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
......@@ -496,7 +497,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
......@@ -520,7 +521,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
......@@ -544,7 +545,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
......@@ -568,7 +569,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
......@@ -592,7 +593,7 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Prompt.ts#L10)
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
......@@ -618,7 +619,7 @@ A promise that resolves to true if the file exists, false otherwise.
#### Defined in
[storage/FileSystem.ts:74](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/FileSystem.ts#L74)
[storage/FileSystem.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L74)
___
......@@ -632,7 +633,7 @@ ___
#### Defined in
[storage/FileSystem.ts:51](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/FileSystem.ts#L51)
[storage/FileSystem.ts:51](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L51)
___
......@@ -655,7 +656,7 @@ ___
#### Defined in
[NodeParser.ts:15](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/NodeParser.ts#L15)
[NodeParser.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L15)
___
......@@ -675,7 +676,7 @@ ___
#### Defined in
[ResponseSynthesizer.ts:212](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ResponseSynthesizer.ts#L212)
[ResponseSynthesizer.ts:212](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L212)
___
......@@ -696,7 +697,7 @@ ___
#### Defined in
[NodeParser.ts:5](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/NodeParser.ts#L5)
[NodeParser.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L5)
___
......@@ -722,7 +723,7 @@ Get the top K embeddings from a list of embeddings ordered by similarity to the
#### Defined in
[Embedding.ts:77](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Embedding.ts#L77)
[Embedding.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L77)
___
......@@ -746,7 +747,7 @@ ___
#### Defined in
[Embedding.ts:119](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Embedding.ts#L119)
[Embedding.ts:119](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L119)
___
......@@ -772,7 +773,7 @@ ___
#### Defined in
[Embedding.ts:131](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Embedding.ts#L131)
[Embedding.ts:131](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L131)
___
......@@ -792,7 +793,7 @@ ___
#### Defined in
[Prompt.ts:300](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Prompt.ts#L300)
[Prompt.ts:300](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L300)
___
......@@ -812,7 +813,7 @@ ___
#### Defined in
[ServiceContext.ts:32](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L32)
[ServiceContext.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L32)
___
......@@ -841,7 +842,7 @@ ___
#### Defined in
[ServiceContext.ts:52](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/ServiceContext.ts#L52)
[ServiceContext.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L52)
___
......@@ -867,7 +868,7 @@ similartiy score with higher numbers meaning the two embeddings are more similar
#### Defined in
[Embedding.ts:22](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/Embedding.ts#L22)
[Embedding.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L22)
___
......@@ -887,7 +888,7 @@ ___
#### Defined in
[storage/StorageContext.ts:28](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/StorageContext.ts#L28)
[storage/StorageContext.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L28)
___
......@@ -910,4 +911,4 @@ Recursively traverses a directory and yields all the paths to the files in it.
#### Defined in
[storage/FileSystem.ts:91](https://github.com/run-llama/llamascript/blob/4649536/packages/core/src/storage/FileSystem.ts#L91)
[storage/FileSystem.ts:91](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L91)
---
sidebar_position: 2
---
# Concepts
## High Level API
- Document: A document represents a text file, PDF file or other contiguous piece of data.
- Node: The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
- Indexes: indexes store the Nodes and the embeddings of those nodes.
- QueryEngine: Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected nodes from your Index to give the LLM the context it needs to answer your query.
- ChatEngine: A ChatEngine helps you build a chatbot that will interact with your Indexes.
## Low Level API
- SimplePrompt: A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
- LLM: The LLM class is a unified interface over a large language model provider such as OpenAI GPT-4, Anthropic Claude, or Meta LLaMA. You can subclass it to write a connector to your own large language model.
- Embedding: An embedding is represented as a vector of floating point numbers. OpenAI's text-embedding-ada-002 is our default embedding model and each embedding it generates consists of 1,536 floating point numbers. Another popular embedding model is BERT which uses 768 floating point numbers to represent each Node. We provide a number of utilities to work with embeddings including 3 similarity calculation options and Maximum Marginal Relevance
- Reader/Loader: A reader or loader is something that takes in a document in the real world and transforms into a Document class that can then be used in your Index and queries. We currently support plain text files and PDFs with many many more to come.
- TextSplitter: Text splitting strategies are incredibly important to the overall efficacy of the embedding search. Currently, while we do have a default, there's no one size fits all solution. Depending on the source documents, you may want to use different splitting sizes and strategies. Currently we support spliltting by fixed size, splitting by fixed size with overlapping sections, splitting by sentence, and splitting by paragraph.
- Retriever: The Retriever is what actually chooses the Nodes to retrieve from the index. Here, you may wish to try retrieving more or fewer Nodes per query, changing your similarity function, or creating your own retriever for each individual use case in your application. For example, you may wish to have a separate retriever for code content vs. text content.
- Storage: At some point you're going to want to store your indexes, data and vectors instead of re-running the embedding models every time. IndexStore, DocStore, VectorStore, and KVStore are abstractions that let you do that. Combined, they form the StorageContext. Currently, we allow you to persist your embeddings in files on the filesystem (or a virtual in memory file system), but we are also actively adding integrations to Vector Databases.
---
sidebar_position: 0
---
# 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.
---
sidebar_position: 1
---
# Quick Start
Welcoem to the LlamaIndex.TS documentation! This page will give you an introduction to the 80% of LlamaIndex.TS concepts that you will use on a daily basis.
---
sidebar_position: 1
---
# Starter Tutorial
Once you have installed LlamaIndex.TS using NPM and set up your OpenAI key, you're ready to start your first app:
In a new folder:
```bash
npx tsc –-init # if needed
```
Create the file example.ts
```ts
// example.ts
import fs from "fs/promises";
import { Document, VectorStoreIndex } from "llamaindex";
async function main() {
// Load essay from abramov.txt in Node
const essay = await fs.readFile(
"node_modules/llamaindex/examples/abramov.txt",
"utf-8"
);
// Create Document object with essay
const document = new Document({ text: essay });
// Split text and create embeddings. Store them in a VectorStoreIndex
const index = await VectorStoreIndex.fromDocuments([document]);
// Query the index
const queryEngine = index.asQueryEngine();
const response = await queryEngine.aquery(
"What did the author do in college?"
);
// Output response
console.log(response.toString());
}
```
Then you can run it using
```bash
npx ts-node example.ts
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment