mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-18 16:44:33 -04:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8bfa53fe66 | |||
| 16ad029335 | |||
| 82bd6228b8 | |||
| a747f28999 | |||
| 142310bd63 | |||
| 67c8b6536a | |||
| efc0e2e0ae | |||
| 0aa0129be9 | |||
| 355910bade | |||
| 74ab63232b | |||
| 90418fa4ec | |||
| 8983e9b0f0 | |||
| cc4bac899e | |||
| 82f30f5637 | |||
| ade9d8fb8e | |||
| 402152f96b | |||
| a43d76d4a7 | |||
| 824c13cb85 | |||
| 0904d3dc5d | |||
| 978ef781e4 |
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Update storage exports (thanks @TomPenguin)
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Add PapaCSVReader (thank you @swk777)
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
OpenAI v4 (final), Anthropic 0.6, Replicate 0.16.1
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
Breaking: Removed NodeWithEmbeddings (just use BaseNode)
|
||||
@@ -26,7 +26,7 @@ Anthropic LLM implementation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:387](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L387)
|
||||
[llm/LLM.ts:449](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L449)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ Anthropic LLM implementation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:380](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L380)
|
||||
[llm/LLM.ts:442](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L442)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:385](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L385)
|
||||
[llm/LLM.ts:447](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L447)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:381](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L381)
|
||||
[llm/LLM.ts:443](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L443)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:377](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L377)
|
||||
[llm/LLM.ts:439](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L439)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,7 +76,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:374](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L374)
|
||||
[llm/LLM.ts:436](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L436)
|
||||
|
||||
___
|
||||
|
||||
@@ -86,7 +86,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:383](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L383)
|
||||
[llm/LLM.ts:445](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L445)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,7 +96,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:375](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L375)
|
||||
[llm/LLM.ts:437](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L437)
|
||||
|
||||
___
|
||||
|
||||
@@ -106,7 +106,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:382](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L382)
|
||||
[llm/LLM.ts:444](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L444)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,7 +116,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:376](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L376)
|
||||
[llm/LLM.ts:438](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L438)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -143,7 +143,7 @@ Get a chat response from the LLM
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:422](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L422)
|
||||
[llm/LLM.ts:484](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L484)
|
||||
|
||||
___
|
||||
|
||||
@@ -170,7 +170,7 @@ Get a prompt completion from the LLM
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:440](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L440)
|
||||
[llm/LLM.ts:502](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L502)
|
||||
|
||||
___
|
||||
|
||||
@@ -190,4 +190,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:407](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L407)
|
||||
[llm/LLM.ts:469](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L469)
|
||||
|
||||
@@ -43,7 +43,7 @@ they can be retrieved for our queries.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L127)
|
||||
[indices/BaseIndex.ts:130](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L130)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -53,7 +53,7 @@ they can be retrieved for our queries.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:122](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L122)
|
||||
[indices/BaseIndex.ts:125](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L125)
|
||||
|
||||
___
|
||||
|
||||
@@ -63,7 +63,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L124)
|
||||
[indices/BaseIndex.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L127)
|
||||
|
||||
___
|
||||
|
||||
@@ -73,7 +73,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:125](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L125)
|
||||
[indices/BaseIndex.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
@@ -83,7 +83,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:120](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L120)
|
||||
[indices/BaseIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L123)
|
||||
|
||||
___
|
||||
|
||||
@@ -93,7 +93,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L121)
|
||||
[indices/BaseIndex.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
@@ -103,7 +103,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L123)
|
||||
[indices/BaseIndex.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L126)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -128,7 +128,7 @@ and response synthezier if they are not provided.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:147](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L147)
|
||||
[indices/BaseIndex.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L150)
|
||||
|
||||
___
|
||||
|
||||
@@ -150,4 +150,67 @@ Create a new retriever from the index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:140](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L140)
|
||||
[indices/BaseIndex.ts:143](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L143)
|
||||
|
||||
___
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ `Abstract` **deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `refDocId` | `string` |
|
||||
| `deleteFromDocStore?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:168](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L168)
|
||||
|
||||
___
|
||||
|
||||
### insert
|
||||
|
||||
▸ **insert**(`document`): `Promise`<`void`\>
|
||||
|
||||
Insert a document into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `document` | [`Document`](Document.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L159)
|
||||
|
||||
___
|
||||
|
||||
### insertNodes
|
||||
|
||||
▸ `Abstract` **insertNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:167](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L167)
|
||||
|
||||
@@ -28,7 +28,7 @@ Generic abstract class for retrievable nodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L48)
|
||||
[Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L55)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -38,7 +38,7 @@ Generic abstract class for retrievable nodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,7 +48,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
@@ -58,7 +58,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -68,7 +68,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,9 +76,14 @@ ___
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +93,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -98,7 +103,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L52)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -112,7 +117,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L104)
|
||||
[Node.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
@@ -126,21 +131,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +145,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -168,7 +159,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
@@ -182,7 +173,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L65)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -196,7 +187,21 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:129](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ `Abstract` **generateHash**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L119)
|
||||
|
||||
___
|
||||
|
||||
@@ -216,7 +221,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L54)
|
||||
[Node.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
@@ -230,7 +235,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -250,7 +255,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L55)
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
@@ -264,7 +269,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L52)
|
||||
[Node.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L59)
|
||||
|
||||
___
|
||||
|
||||
@@ -284,7 +289,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L56)
|
||||
[Node.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
@@ -300,4 +305,4 @@ Used with built in JSON.stringify
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:136](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L136)
|
||||
[Node.ts:141](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L141)
|
||||
|
||||
@@ -32,7 +32,7 @@ A document is just a special text node with a docId.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:229](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L229)
|
||||
[Node.ts:257](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L257)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -46,7 +46,7 @@ A document is just a special text node with a docId.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:147](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L147)
|
||||
[Node.ts:152](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L152)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -110,13 +110,18 @@ ___
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[id_](TextNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -130,7 +135,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -144,7 +149,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L150)
|
||||
[Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
@@ -158,7 +163,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -172,7 +177,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L146)
|
||||
[Node.ts:151](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L151)
|
||||
|
||||
___
|
||||
|
||||
@@ -186,7 +191,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:145](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L145)
|
||||
[Node.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L150)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -204,21 +209,7 @@ TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
### docId
|
||||
|
||||
• `get` **docId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:238](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L238)
|
||||
[Node.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
@@ -236,25 +227,7 @@ TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
@@ -272,7 +245,7 @@ TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -290,7 +263,7 @@ TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
@@ -308,7 +281,7 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L65)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -326,17 +299,20 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:129](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `void`
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -344,7 +320,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L157)
|
||||
[Node.ts:173](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L173)
|
||||
|
||||
___
|
||||
|
||||
@@ -368,7 +344,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:165](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L165)
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
@@ -386,7 +362,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -410,7 +386,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:170](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L170)
|
||||
[Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L192)
|
||||
|
||||
___
|
||||
|
||||
@@ -433,7 +409,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:195](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L195)
|
||||
[Node.ts:219](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L219)
|
||||
|
||||
___
|
||||
|
||||
@@ -451,7 +427,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:199](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L199)
|
||||
[Node.ts:223](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L223)
|
||||
|
||||
___
|
||||
|
||||
@@ -469,7 +445,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:234](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L234)
|
||||
[Node.ts:266](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L266)
|
||||
|
||||
___
|
||||
|
||||
@@ -493,7 +469,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L191)
|
||||
[Node.ts:213](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L213)
|
||||
|
||||
___
|
||||
|
||||
@@ -513,4 +489,4 @@ Used with built in JSON.stringify
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:136](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L136)
|
||||
[Node.ts:141](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L141)
|
||||
|
||||
@@ -37,16 +37,6 @@ The underlying structure of each index.
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: `Record`<`string`, [`Document`](Document.md)\> = `{}`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string`
|
||||
@@ -91,7 +81,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L47)
|
||||
[indices/BaseIndex.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L46)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -112,7 +102,27 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L56)
|
||||
[indices/BaseIndex.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L55)
|
||||
|
||||
___
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`nodeId`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodeId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
@@ -130,7 +140,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L49)
|
||||
[indices/BaseIndex.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
@@ -148,4 +158,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L61)
|
||||
[indices/BaseIndex.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L60)
|
||||
|
||||
@@ -57,7 +57,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:90](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L90)
|
||||
[indices/BaseIndex.ts:93](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L93)
|
||||
|
||||
___
|
||||
|
||||
@@ -81,7 +81,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:91](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L91)
|
||||
[indices/BaseIndex.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L94)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -101,7 +101,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:93](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L93)
|
||||
[indices/BaseIndex.ts:96](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L96)
|
||||
|
||||
___
|
||||
|
||||
@@ -137,4 +137,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L97)
|
||||
[indices/BaseIndex.ts:100](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L100)
|
||||
|
||||
@@ -32,7 +32,7 @@ TextNode is the default node type for text. Most common node type in LlamaIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:215](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L215)
|
||||
[Node.ts:239](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L239)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -46,7 +46,7 @@ TextNode is the default node type for text. Most common node type in LlamaIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:147](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L147)
|
||||
[Node.ts:152](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L152)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -110,13 +110,18 @@ ___
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[id_](TextNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -126,7 +131,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:213](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L213)
|
||||
[Node.ts:237](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L237)
|
||||
|
||||
___
|
||||
|
||||
@@ -140,7 +145,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +159,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L150)
|
||||
[Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
@@ -168,7 +173,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -182,7 +187,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L146)
|
||||
[Node.ts:151](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L151)
|
||||
|
||||
___
|
||||
|
||||
@@ -196,7 +201,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:145](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L145)
|
||||
[Node.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L150)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -214,7 +219,7 @@ TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L104)
|
||||
[Node.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
@@ -232,25 +237,7 @@ TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
@@ -268,7 +255,7 @@ TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -286,7 +273,7 @@ TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
@@ -304,7 +291,7 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L65)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -322,17 +309,20 @@ TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:129](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `void`
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -340,7 +330,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L157)
|
||||
[Node.ts:173](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L173)
|
||||
|
||||
___
|
||||
|
||||
@@ -364,7 +354,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:165](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L165)
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
@@ -382,7 +372,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -406,7 +396,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:170](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L170)
|
||||
[Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L192)
|
||||
|
||||
___
|
||||
|
||||
@@ -429,7 +419,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:195](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L195)
|
||||
[Node.ts:219](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L219)
|
||||
|
||||
___
|
||||
|
||||
@@ -447,7 +437,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:199](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L199)
|
||||
[Node.ts:223](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L223)
|
||||
|
||||
___
|
||||
|
||||
@@ -465,7 +455,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:220](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L220)
|
||||
[Node.ts:248](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L248)
|
||||
|
||||
___
|
||||
|
||||
@@ -489,7 +479,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L191)
|
||||
[Node.ts:213](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L213)
|
||||
|
||||
___
|
||||
|
||||
@@ -509,4 +499,4 @@ Used with built in JSON.stringify
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:136](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L136)
|
||||
[Node.ts:141](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L141)
|
||||
|
||||
@@ -32,7 +32,7 @@ A ListIndex keeps nodes in a sequential list structure
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L43)
|
||||
[indices/list/ListIndex.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L47)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -46,7 +46,7 @@ A ListIndex keeps nodes in a sequential list structure
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:122](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L122)
|
||||
[indices/BaseIndex.ts:125](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L125)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L124)
|
||||
[indices/BaseIndex.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L127)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:125](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L125)
|
||||
[indices/BaseIndex.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:120](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L120)
|
||||
[indices/BaseIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L123)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L121)
|
||||
[indices/BaseIndex.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,50 +116,10 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L123)
|
||||
[indices/BaseIndex.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L126)
|
||||
|
||||
## Methods
|
||||
|
||||
### \_deleteNode
|
||||
|
||||
▸ `Protected` **_deleteNode**(`nodeId`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodeId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:193](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L193)
|
||||
|
||||
___
|
||||
|
||||
### \_insert
|
||||
|
||||
▸ `Protected` **_insert**(`nodes`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
### asQueryEngine
|
||||
|
||||
▸ **asQueryEngine**(`options?`): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
@@ -185,7 +145,7 @@ and response synthezier if they are not provided.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:151](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L151)
|
||||
[indices/list/ListIndex.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
@@ -212,7 +172,53 @@ Create a new retriever from the index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:138](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L138)
|
||||
[indices/list/ListIndex.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L142)
|
||||
|
||||
___
|
||||
|
||||
### deleteNodes
|
||||
|
||||
▸ **deleteNodes**(`nodeIds`, `deleteFromDocStore`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodeIds` | `string`[] |
|
||||
| `deleteFromDocStore` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:216](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L216)
|
||||
|
||||
___
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ **deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `refDocId` | `string` |
|
||||
| `deleteFromDocStore?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[deleteRefDoc](BaseIndex.md#deleterefdoc)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L197)
|
||||
|
||||
___
|
||||
|
||||
@@ -226,13 +232,63 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:199](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L199)
|
||||
[indices/list/ListIndex.ts:230](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L230)
|
||||
|
||||
___
|
||||
|
||||
### \_buildIndexFromNodes
|
||||
### insert
|
||||
|
||||
▸ `Static` **_buildIndexFromNodes**(`nodes`, `docStore`, `indexStruct?`): `Promise`<[`IndexList`](IndexList.md)\>
|
||||
▸ **insert**(`document`): `Promise`<`void`\>
|
||||
|
||||
Insert a document into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `document` | [`Document`](Document.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insert](BaseIndex.md#insert)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L159)
|
||||
|
||||
___
|
||||
|
||||
### insertNodes
|
||||
|
||||
▸ **insertNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insertNodes](BaseIndex.md#insertnodes)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L191)
|
||||
|
||||
___
|
||||
|
||||
### buildIndexFromNodes
|
||||
|
||||
▸ `Static` **buildIndexFromNodes**(`nodes`, `docStore`, `indexStruct?`): `Promise`<[`IndexList`](IndexList.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -248,7 +304,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:172](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L172)
|
||||
[indices/list/ListIndex.ts:176](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L176)
|
||||
|
||||
___
|
||||
|
||||
@@ -271,7 +327,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L112)
|
||||
[indices/list/ListIndex.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
@@ -291,4 +347,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L47)
|
||||
[indices/list/ListIndex.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L51)
|
||||
|
||||
@@ -26,7 +26,7 @@ Llama2 LLM implementation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:242](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L242)
|
||||
[llm/LLM.ts:266](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L266)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ Llama2 LLM implementation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:236](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L236)
|
||||
[llm/LLM.ts:260](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L260)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,17 +46,17 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:239](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L239)
|
||||
[llm/LLM.ts:263](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L263)
|
||||
|
||||
___
|
||||
|
||||
### model
|
||||
|
||||
• **model**: ``"Llama-2-70b-chat"`` \| ``"Llama-2-13b-chat"`` \| ``"Llama-2-7b-chat"``
|
||||
• **model**: ``"Llama-2-70b-chat-old"`` \| ``"Llama-2-70b-chat-4bit"`` \| ``"Llama-2-13b-chat"`` \| ``"Llama-2-13b-chat-4bit"`` \| ``"Llama-2-7b-chat"`` \| ``"Llama-2-7b-chat-4bit"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:235](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L235)
|
||||
[llm/LLM.ts:259](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L259)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:240](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L240)
|
||||
[llm/LLM.ts:264](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L264)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,7 +76,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:237](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L237)
|
||||
[llm/LLM.ts:261](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L261)
|
||||
|
||||
___
|
||||
|
||||
@@ -86,7 +86,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:238](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L238)
|
||||
[llm/LLM.ts:262](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L262)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -113,7 +113,7 @@ Get a chat response from the LLM
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:333](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L333)
|
||||
[llm/LLM.ts:385](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L385)
|
||||
|
||||
___
|
||||
|
||||
@@ -140,7 +140,7 @@ Get a prompt completion from the LLM
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:360](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L360)
|
||||
[llm/LLM.ts:422](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L422)
|
||||
|
||||
___
|
||||
|
||||
@@ -160,13 +160,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:274](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L274)
|
||||
[llm/LLM.ts:309](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L309)
|
||||
|
||||
___
|
||||
|
||||
### mapMessagesToPrompt
|
||||
|
||||
▸ **mapMessagesToPrompt**(`messages`): `string`
|
||||
▸ **mapMessagesToPrompt**(`messages`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -176,17 +176,22 @@ ___
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `prompt` | `string` |
|
||||
| `systemPrompt` | `undefined` \| `string` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:251](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L251)
|
||||
[llm/LLM.ts:281](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L281)
|
||||
|
||||
___
|
||||
|
||||
### mapMessagesToPromptA16Z
|
||||
|
||||
▸ **mapMessagesToPromptA16Z**(`messages`): `string`
|
||||
▸ **mapMessagesToPromptA16Z**(`messages`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -196,29 +201,41 @@ ___
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `prompt` | `string` |
|
||||
| `systemPrompt` | `undefined` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:263](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L263)
|
||||
[llm/LLM.ts:295](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L295)
|
||||
|
||||
___
|
||||
|
||||
### mapMessagesToPromptMeta
|
||||
|
||||
▸ **mapMessagesToPromptMeta**(`messages`, `withBos?`): `string`
|
||||
▸ **mapMessagesToPromptMeta**(`messages`, `opts?`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | `undefined` |
|
||||
| `withBos` | `boolean` | `false` |
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `opts?` | `Object` |
|
||||
| `opts.replicate4Bit?` | `boolean` |
|
||||
| `opts.withBos?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `prompt` | `string` |
|
||||
| `systemPrompt` | `undefined` \| `string` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:287](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L287)
|
||||
[llm/LLM.ts:322](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L322)
|
||||
|
||||
@@ -100,7 +100,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:270](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L270)
|
||||
[Embedding.ts:272](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L272)
|
||||
|
||||
___
|
||||
|
||||
@@ -124,7 +124,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:286](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L286)
|
||||
[Embedding.ts:288](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L288)
|
||||
|
||||
___
|
||||
|
||||
@@ -148,7 +148,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:282](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L282)
|
||||
[Embedding.ts:284](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Embedding.ts#L284)
|
||||
|
||||
___
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
[readers/CSVReader.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/CSVReader.ts#L23)
|
||||
|
||||
## Properties
|
||||
|
||||
### colJoiner
|
||||
|
||||
• `Private` **colJoiner**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/CSVReader.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/CSVReader.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### concatRows
|
||||
|
||||
• `Private` **concatRows**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/CSVReader.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/CSVReader.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### papaConfig
|
||||
|
||||
• `Private` `Optional` **papaConfig**: `ParseConfig`<`any`, `undefined`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/CSVReader.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/CSVReader.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### rowJoiner
|
||||
|
||||
• `Private` **rowJoiner**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/CSVReader.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/CSVReader.ts#L14)
|
||||
|
||||
## Methods
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)[]\>
|
||||
|
||||
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)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/CSVReader.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/CSVReader.ts#L41)
|
||||
@@ -40,4 +40,4 @@ Read all of the documents in a directory. Currently supports PDF and TXT files.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/SimpleDirectoryReader.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/SimpleDirectoryReader.ts#L37)
|
||||
[readers/SimpleDirectoryReader.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/SimpleDirectoryReader.ts#L39)
|
||||
|
||||
@@ -0,0 +1,480 @@
|
||||
---
|
||||
id: "SimpleDocumentStore"
|
||||
title: "Class: SimpleDocumentStore"
|
||||
sidebar_label: "SimpleDocumentStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `KVDocumentStore`
|
||||
|
||||
↳ **`SimpleDocumentStore`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleDocumentStore**(`kvStore?`, `namespace?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `kvStore?` | `SimpleKVStore` |
|
||||
| `namespace?` | `string` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVDocumentStore.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
### kvStore
|
||||
|
||||
• `Private` **kvStore**: `SimpleKVStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L17)
|
||||
|
||||
## Methods
|
||||
|
||||
### addDocuments
|
||||
|
||||
▸ **addDocuments**(`docs`, `allowUpdate?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `docs` | [`BaseNode`](BaseNode.md)[] | `undefined` |
|
||||
| `allowUpdate` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.addDocuments
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### deleteDocument
|
||||
|
||||
▸ **deleteDocument**(`docId`, `raiseError?`, `removeRefDocNode?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `docId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
| `removeRefDocNode` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.deleteDocument
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L131)
|
||||
|
||||
___
|
||||
|
||||
### deleteRefDoc
|
||||
|
||||
▸ **deleteRefDoc**(`refDocId`, `raiseError?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `refDocId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.deleteRefDoc
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:148](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L148)
|
||||
|
||||
___
|
||||
|
||||
### docs
|
||||
|
||||
▸ **docs**(): `Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.docs
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### documentExists
|
||||
|
||||
▸ **documentExists**(`docId`): `Promise`<`boolean`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `docId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.documentExists
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:105](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L105)
|
||||
|
||||
___
|
||||
|
||||
### getAllRefDocInfo
|
||||
|
||||
▸ **getAllRefDocInfo**(): `Promise`<`undefined` \| `Record`<`string`, `RefDocInfo`\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `Record`<`string`, `RefDocInfo`\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getAllRefDocInfo
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:93](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L93)
|
||||
|
||||
___
|
||||
|
||||
### getDocument
|
||||
|
||||
▸ **getDocument**(`docId`, `raiseError?`): `Promise`<`undefined` \| [`BaseNode`](BaseNode.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `docId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`BaseNode`](BaseNode.md)\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getDocument
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### getDocumentHash
|
||||
|
||||
▸ **getDocumentHash**(`docId`): `Promise`<`undefined` \| `string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `docId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `string`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getDocumentHash
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:174](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L174)
|
||||
|
||||
___
|
||||
|
||||
### getNode
|
||||
|
||||
▸ **getNode**(`nodeId`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `nodeId` | `string` | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BaseNode`](BaseNode.md)\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/types.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/types.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
### getNodeDict
|
||||
|
||||
▸ **getNodeDict**(`nodeIdDict`): `Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodeIdDict` | `Object` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getNodeDict
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/types.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/types.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
### getNodes
|
||||
|
||||
▸ **getNodes**(`nodeIds`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `nodeIds` | `string`[] | `undefined` |
|
||||
| `raiseError` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BaseNode`](BaseNode.md)[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/types.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/types.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
### getRefDocInfo
|
||||
|
||||
▸ **getRefDocInfo**(`refDocId`): `Promise`<`undefined` \| `RefDocInfo`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `RefDocInfo`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.getRefDocInfo
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVDocumentStore.persist
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
### refDocExists
|
||||
|
||||
▸ **refDocExists**(`refDocId`): `Promise`<`boolean`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.refDocExists
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L101)
|
||||
|
||||
___
|
||||
|
||||
### setDocumentHash
|
||||
|
||||
▸ **setDocumentHash**(`docId`, `docHash`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `docId` | `string` |
|
||||
| `docHash` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVDocumentStore.setDocumentHash
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/KVDocumentStore.ts:169](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/KVDocumentStore.ts#L169)
|
||||
|
||||
___
|
||||
|
||||
### toDict
|
||||
|
||||
▸ **toDict**(): `SaveDict`
|
||||
|
||||
#### Returns
|
||||
|
||||
`SaveDict`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### fromDict
|
||||
|
||||
▸ `Static` **fromDict**(`saveDict`, `namespace?`): [`SimpleDocumentStore`](SimpleDocumentStore.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `saveDict` | `SaveDict` |
|
||||
| `namespace?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleDocumentStore`](SimpleDocumentStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistDir
|
||||
|
||||
▸ `Static` **fromPersistDir**(`persistDir?`, `namespace?`, `fsModule?`): `Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `persistDir` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `namespace?` | `string` | `undefined` |
|
||||
| `fsModule?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `undefined` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`, `namespace?`, `fs?`): `Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `persistPath` | `string` |
|
||||
| `namespace?` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/docStore/SimpleDocumentStore.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L42)
|
||||
@@ -0,0 +1,234 @@
|
||||
---
|
||||
id: "SimpleIndexStore"
|
||||
title: "Class: SimpleIndexStore"
|
||||
sidebar_label: "SimpleIndexStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `KVIndexStore`
|
||||
|
||||
↳ **`SimpleIndexStore`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleIndexStore**(`kvStore?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `kvStore?` | `BaseInMemoryKVStore` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVIndexStore.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L16)
|
||||
|
||||
## Properties
|
||||
|
||||
### kvStore
|
||||
|
||||
• `Private` **kvStore**: `BaseInMemoryKVStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L14)
|
||||
|
||||
## Methods
|
||||
|
||||
### addIndexStruct
|
||||
|
||||
▸ **addIndexStruct**(`indexStruct`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `indexStruct` | [`IndexStruct`](IndexStruct.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.addIndexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/KVIndexStore.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/KVIndexStore.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
### deleteIndexStruct
|
||||
|
||||
▸ **deleteIndexStruct**(`key`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `key` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.deleteIndexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/KVIndexStore.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/KVIndexStore.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### getIndexStruct
|
||||
|
||||
▸ **getIndexStruct**(`structId?`): `Promise`<`undefined` \| [`IndexStruct`](IndexStruct.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `structId?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`IndexStruct`](IndexStruct.md)\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.getIndexStruct
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/KVIndexStore.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/KVIndexStore.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### getIndexStructs
|
||||
|
||||
▸ **getIndexStructs**(): `Promise`<[`IndexStruct`](IndexStruct.md)[]\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`IndexStruct`](IndexStruct.md)[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
KVIndexStore.getIndexStructs
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/KVIndexStore.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/KVIndexStore.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `persistPath` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
KVIndexStore.persist
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
### toDict
|
||||
|
||||
▸ **toDict**(): `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Record`<`string`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### fromDict
|
||||
|
||||
▸ `Static` **fromDict**(`saveDict`): [`SimpleIndexStore`](SimpleIndexStore.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `saveDict` | `DataType` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleIndexStore`](SimpleIndexStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistDir
|
||||
|
||||
▸ `Static` **fromPersistDir**(`persistDir?`, `fs?`): `Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `persistDir` | `string` | `DEFAULT_PERSIST_DIR` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`, `fs?`): `Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `persistPath` | `string` | `undefined` |
|
||||
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleIndexStore`](SimpleIndexStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/indexStore/SimpleIndexStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/indexStore/SimpleIndexStore.ts#L33)
|
||||
@@ -0,0 +1,283 @@
|
||||
---
|
||||
id: "SimpleVectorStore"
|
||||
title: "Class: SimpleVectorStore"
|
||||
sidebar_label: "SimpleVectorStore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Implements
|
||||
|
||||
- [`VectorStore`](../interfaces/VectorStore.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleVectorStore**(`data?`, `fs?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `data?` | `SimpleVectorStoreData` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L37)
|
||||
|
||||
## Properties
|
||||
|
||||
### data
|
||||
|
||||
• `Private` **data**: `SimpleVectorStoreData`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### fs
|
||||
|
||||
• `Private` **fs**: [`GenericFileSystem`](../interfaces/GenericFileSystem.md) = `DEFAULT_FS`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### persistPath
|
||||
|
||||
• `Private` **persistPath**: `undefined` \| `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### storesText
|
||||
|
||||
• **storesText**: `boolean` = `false`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[storesText](../interfaces/VectorStore.md#storestext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L32)
|
||||
|
||||
## Accessors
|
||||
|
||||
### client
|
||||
|
||||
• `get` **client**(): `any`
|
||||
|
||||
#### Returns
|
||||
|
||||
`any`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
VectorStore.client
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L50)
|
||||
|
||||
## Methods
|
||||
|
||||
### add
|
||||
|
||||
▸ **add**(`embeddingResults`): `Promise`<`string`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `embeddingResults` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[add](../interfaces/VectorStore.md#add)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`refDocId`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `refDocId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[delete](../interfaces/VectorStore.md#delete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:77](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### get
|
||||
|
||||
▸ **get**(`textId`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `textId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L54)
|
||||
|
||||
___
|
||||
|
||||
### persist
|
||||
|
||||
▸ **persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[VectorStore](../interfaces/VectorStore.md).[persist](../interfaces/VectorStore.md#persist)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/main/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
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
### toDict
|
||||
|
||||
▸ **toDict**(): `SimpleVectorStoreData`
|
||||
|
||||
#### Returns
|
||||
|
||||
`SimpleVectorStoreData`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:196](https://github.com/run-llama/LlamaIndexTS/blob/main/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
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:189](https://github.com/run-llama/LlamaIndexTS/blob/main/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
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### fromPersistPath
|
||||
|
||||
▸ `Static` **fromPersistPath**(`persistPath`, `fs?`): `Promise`<[`SimpleVectorStore`](SimpleVectorStore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `persistPath` | `string` |
|
||||
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SimpleVectorStore`](SimpleVectorStore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/SimpleVectorStore.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/SimpleVectorStore.ts#L159)
|
||||
@@ -41,4 +41,4 @@ Read a .txt file
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/SimpleDirectoryReader.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/SimpleDirectoryReader.ts#L12)
|
||||
[readers/SimpleDirectoryReader.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/SimpleDirectoryReader.ts#L13)
|
||||
|
||||
@@ -36,7 +36,7 @@ TextNode is the default node type for text. Most common node type in LlamaIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:152](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L152)
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L157)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -50,7 +50,7 @@ TextNode is the default node type for text. Most common node type in LlamaIndex.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L39)
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:147](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L147)
|
||||
[Node.ts:152](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L152)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L43)
|
||||
[Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L44)
|
||||
[Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L46)
|
||||
[Node.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -110,13 +110,18 @@ ___
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
The unique ID of the Node/Document. The trailing underscore is here
|
||||
to avoid collisions with the id keyword in Python.
|
||||
|
||||
Set to a UUID by default.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[id_](BaseNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L38)
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -130,7 +135,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L42)
|
||||
[Node.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -140,7 +145,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L150)
|
||||
[Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +159,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L45)
|
||||
[Node.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -164,7 +169,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L146)
|
||||
[Node.ts:151](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L151)
|
||||
|
||||
___
|
||||
|
||||
@@ -174,7 +179,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:145](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L145)
|
||||
[Node.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L150)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -192,7 +197,7 @@ BaseNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L104)
|
||||
[Node.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
@@ -210,25 +215,7 @@ BaseNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L58)
|
||||
[Node.ts:87](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
@@ -246,7 +233,7 @@ BaseNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L94)
|
||||
[Node.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -264,7 +251,7 @@ BaseNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L72)
|
||||
[Node.ts:75](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
@@ -282,7 +269,7 @@ BaseNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L62)
|
||||
[Node.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L65)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -300,21 +287,28 @@ BaseNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L124)
|
||||
[Node.ts:129](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `void`
|
||||
▸ **generateHash**(): `string`
|
||||
|
||||
Generate a hash of the text node.
|
||||
The ID is not part of the hash as it can change independent of content.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
`string`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[generateHash](BaseNode.md#generatehash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L157)
|
||||
[Node.ts:173](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L173)
|
||||
|
||||
___
|
||||
|
||||
@@ -338,7 +332,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:165](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L165)
|
||||
[Node.ts:187](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
@@ -356,7 +350,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L116)
|
||||
[Node.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -380,7 +374,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:170](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L170)
|
||||
[Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L192)
|
||||
|
||||
___
|
||||
|
||||
@@ -399,7 +393,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:195](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L195)
|
||||
[Node.ts:219](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L219)
|
||||
|
||||
___
|
||||
|
||||
@@ -413,7 +407,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:199](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L199)
|
||||
[Node.ts:223](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L223)
|
||||
|
||||
___
|
||||
|
||||
@@ -431,7 +425,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:161](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L161)
|
||||
[Node.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L183)
|
||||
|
||||
___
|
||||
|
||||
@@ -455,7 +449,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L191)
|
||||
[Node.ts:213](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L213)
|
||||
|
||||
___
|
||||
|
||||
@@ -475,4 +469,4 @@ Used with built in JSON.stringify
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:136](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L136)
|
||||
[Node.ts:141](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L141)
|
||||
|
||||
@@ -24,7 +24,7 @@ The VectorStoreIndex, an index that stores the nodes only according to their vec
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init` | [`VectorIndexConstructorProps`](../interfaces/VectorIndexConstructorProps.md) |
|
||||
| `init` | `VectorIndexConstructorProps` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
@@ -32,7 +32,7 @@ The VectorStoreIndex, an index that stores the nodes only according to their vec
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L36)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L41)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -46,7 +46,7 @@ The VectorStoreIndex, an index that stores the nodes only according to their vec
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:122](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L122)
|
||||
[indices/BaseIndex.ts:125](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L125)
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L124)
|
||||
[indices/BaseIndex.ts:127](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L127)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:125](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L125)
|
||||
[indices/BaseIndex.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:120](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L120)
|
||||
[indices/BaseIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L123)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L121)
|
||||
[indices/BaseIndex.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,7 +116,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L34)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L39)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -145,7 +145,7 @@ and response synthezier if they are not provided.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:215](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L215)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:226](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L226)
|
||||
|
||||
___
|
||||
|
||||
@@ -171,13 +171,88 @@ Create a new retriever from the index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:211](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L211)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:222](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L222)
|
||||
|
||||
___
|
||||
|
||||
### 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
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:262](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L262)
|
||||
|
||||
___
|
||||
|
||||
### insert
|
||||
|
||||
▸ **insert**(`document`): `Promise`<`void`\>
|
||||
|
||||
Insert a document into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `document` | [`Document`](Document.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insert](BaseIndex.md#insert)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L159)
|
||||
|
||||
___
|
||||
|
||||
### insertNodes
|
||||
|
||||
▸ **insertNodes**(`nodes`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[insertNodes](BaseIndex.md#insertnodes)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:237](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L237)
|
||||
|
||||
___
|
||||
|
||||
### buildIndexFromNodes
|
||||
|
||||
▸ `Static` **buildIndexFromNodes**(`nodes`, `serviceContext`, `vectorStore`, `docStore`): `Promise`<[`IndexDict`](IndexDict.md)\>
|
||||
▸ `Static` **buildIndexFromNodes**(`nodes`, `serviceContext`, `vectorStore`, `docStore`, `indexDict?`): `Promise`<[`IndexDict`](IndexDict.md)\>
|
||||
|
||||
Get embeddings for nodes and place them into the index.
|
||||
|
||||
@@ -189,6 +264,7 @@ Get embeddings for nodes and place them into the index.
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `vectorStore` | [`VectorStore`](../interfaces/VectorStore.md) |
|
||||
| `docStore` | `BaseDocumentStore` |
|
||||
| `indexDict?` | [`IndexDict`](IndexDict.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -196,7 +272,7 @@ Get embeddings for nodes and place them into the index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:151](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L151)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:153](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
@@ -221,13 +297,13 @@ High level API: split documents, get embeddings, and build index.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:186](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L186)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L197)
|
||||
|
||||
___
|
||||
|
||||
### getNodeEmbeddingResults
|
||||
|
||||
▸ `Static` **getNodeEmbeddingResults**(`nodes`, `serviceContext`, `logProgress?`): `Promise`<[`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[]\>
|
||||
▸ `Static` **getNodeEmbeddingResults**(`nodes`, `serviceContext`, `logProgress?`): `Promise`<[`BaseNode`](BaseNode.md)[]\>
|
||||
|
||||
Get the embeddings for nodes.
|
||||
|
||||
@@ -241,11 +317,11 @@ Get the embeddings for nodes.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[]\>
|
||||
`Promise`<[`BaseNode`](BaseNode.md)[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L123)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
@@ -260,7 +336,7 @@ This is needed to handle persistence.
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options` | [`VectorIndexOptions`](../interfaces/VectorIndexOptions.md) |
|
||||
| `options` | `VectorIndexOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -268,4 +344,4 @@ This is needed to handle persistence.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/vectorStore/VectorStoreIndex.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L47)
|
||||
[indices/vectorStore/VectorStoreIndex.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/vectorStore/VectorStoreIndex.ts#L52)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L224)
|
||||
[llm/LLM.ts:246](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L246)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:225](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L225)
|
||||
[llm/LLM.ts:247](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L247)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,4 +34,14 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:226](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L226)
|
||||
[llm/LLM.ts:248](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L248)
|
||||
|
||||
___
|
||||
|
||||
### REPLICATE4BIT
|
||||
|
||||
• **REPLICATE4BIT** = ``"replicate4bit"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[llm/LLM.ts:251](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/llm/LLM.ts#L251)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L26)
|
||||
[indices/list/ListIndex.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,4 +24,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/list/ListIndex.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L28)
|
||||
[indices/list/ListIndex.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/list/ListIndex.ts#L32)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L19)
|
||||
[Node.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L20)
|
||||
[Node.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L21)
|
||||
[Node.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L22)
|
||||
[Node.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L23)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L8)
|
||||
[Node.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L6)
|
||||
[Node.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L7)
|
||||
[Node.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L5)
|
||||
[Node.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L6)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,4 +54,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:4](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L4)
|
||||
[Node.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L5)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L15)
|
||||
[Node.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L13)
|
||||
[Node.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L14)
|
||||
[Node.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L12)
|
||||
[Node.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L13)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L12)
|
||||
[storage/vectorStore/types.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L14)
|
||||
[storage/vectorStore/types.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L18)
|
||||
[storage/vectorStore/types.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L17)
|
||||
[storage/vectorStore/types.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L20)
|
||||
[storage/vectorStore/types.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L19)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,7 +64,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L13)
|
||||
[storage/vectorStore/types.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,4 +74,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L16)
|
||||
[storage/vectorStore/types.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L15)
|
||||
|
||||
@@ -12,12 +12,6 @@ custom_edit_url: null
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`BaseIndexInit`**
|
||||
|
||||
↳ [`VectorIndexConstructorProps`](VectorIndexConstructorProps.md)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
@@ -26,7 +20,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:109](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L109)
|
||||
[indices/BaseIndex.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L112)
|
||||
|
||||
___
|
||||
|
||||
@@ -36,7 +30,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:111](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L111)
|
||||
[indices/BaseIndex.ts:114](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L114)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +40,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L112)
|
||||
[indices/BaseIndex.ts:115](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L115)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +50,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L107)
|
||||
[indices/BaseIndex.ts:110](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L110)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,7 +60,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:108](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L108)
|
||||
[indices/BaseIndex.ts:111](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L111)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,4 +70,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:110](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L110)
|
||||
[indices/BaseIndex.ts:113](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L113)
|
||||
|
||||
@@ -11,6 +11,7 @@ A reader takes imports data into Document objects.
|
||||
## Implemented by
|
||||
|
||||
- [`PDFReader`](../classes/PDFReader.md)
|
||||
- [`PapaCSVReader`](../classes/PapaCSVReader.md)
|
||||
- [`SimpleDirectoryReader`](../classes/SimpleDirectoryReader.md)
|
||||
- [`TextFileReader`](../classes/TextFileReader.md)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L24)
|
||||
[storage/vectorStore/types.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L25)
|
||||
[storage/vectorStore/types.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,4 +34,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L26)
|
||||
[storage/vectorStore/types.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L25)
|
||||
|
||||
@@ -14,4 +14,4 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L30)
|
||||
[storage/vectorStore/types.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L29)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L42)
|
||||
[storage/vectorStore/types.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L40)
|
||||
[storage/vectorStore/types.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,4 +34,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L41)
|
||||
[storage/vectorStore/types.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L40)
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
id: "NodeWithEmbedding"
|
||||
title: "Interface: NodeWithEmbedding"
|
||||
sidebar_label: "NodeWithEmbedding"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A node with an embedding
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• **embedding**: `number`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:277](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L277)
|
||||
|
||||
___
|
||||
|
||||
### node
|
||||
|
||||
• **node**: [`BaseNode`](../classes/BaseNode.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:276](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L276)
|
||||
@@ -16,7 +16,7 @@ A node with a similarity score
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:268](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L268)
|
||||
[Node.ts:296](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L296)
|
||||
|
||||
___
|
||||
|
||||
@@ -26,4 +26,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:269](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L269)
|
||||
[Node.ts:297](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L297)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L29)
|
||||
[Node.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L28)
|
||||
[Node.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L26)
|
||||
[Node.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L27)
|
||||
[Node.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L28)
|
||||
|
||||
@@ -24,7 +24,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:109](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L109)
|
||||
[indices/BaseIndex.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L112)
|
||||
|
||||
___
|
||||
|
||||
@@ -38,7 +38,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:111](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L111)
|
||||
[indices/BaseIndex.ts:114](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L114)
|
||||
|
||||
___
|
||||
|
||||
@@ -52,7 +52,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L112)
|
||||
[indices/BaseIndex.ts:115](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L115)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L107)
|
||||
[indices/BaseIndex.ts:110](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L110)
|
||||
|
||||
___
|
||||
|
||||
@@ -80,7 +80,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:108](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L108)
|
||||
[indices/BaseIndex.ts:111](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L111)
|
||||
|
||||
___
|
||||
|
||||
@@ -94,4 +94,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:162](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L162)
|
||||
[indices/BaseIndex.ts:183](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L183)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L156)
|
||||
[indices/BaseIndex.ts:177](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L177)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L155)
|
||||
[indices/BaseIndex.ts:176](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L176)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:154](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L154)
|
||||
[indices/BaseIndex.ts:175](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L175)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L157)
|
||||
[indices/BaseIndex.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L178)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,4 +54,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:158](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L158)
|
||||
[indices/BaseIndex.ts:179](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L179)
|
||||
|
||||
@@ -6,6 +6,10 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`SimpleVectorStore`](../classes/SimpleVectorStore.md)
|
||||
|
||||
## Properties
|
||||
|
||||
### isEmbeddingQuery
|
||||
@@ -14,7 +18,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L63)
|
||||
[storage/vectorStore/types.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +28,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L62)
|
||||
[storage/vectorStore/types.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L61)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -36,7 +40,7 @@ ___
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `embeddingResults` | [`NodeWithEmbedding`](NodeWithEmbedding.md)[] |
|
||||
| `embeddingResults` | [`BaseNode`](../classes/BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -44,7 +48,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L65)
|
||||
[storage/vectorStore/types.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L64)
|
||||
|
||||
___
|
||||
|
||||
@@ -58,7 +62,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L64)
|
||||
[storage/vectorStore/types.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
@@ -79,7 +83,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:66](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L66)
|
||||
[storage/vectorStore/types.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
@@ -100,7 +104,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L68)
|
||||
[storage/vectorStore/types.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L67)
|
||||
|
||||
___
|
||||
|
||||
@@ -121,4 +125,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L67)
|
||||
[storage/vectorStore/types.ts:66](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L66)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L47)
|
||||
[storage/vectorStore/types.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,4 +24,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L46)
|
||||
[storage/vectorStore/types.ts:45](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L45)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L56)
|
||||
[storage/vectorStore/types.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L55)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L53)
|
||||
[storage/vectorStore/types.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L57)
|
||||
[storage/vectorStore/types.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L56)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L58)
|
||||
[storage/vectorStore/types.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L55)
|
||||
[storage/vectorStore/types.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L54)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,7 +64,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L51)
|
||||
[storage/vectorStore/types.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L54)
|
||||
[storage/vectorStore/types.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -84,4 +84,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L52)
|
||||
[storage/vectorStore/types.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L51)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L8)
|
||||
[storage/vectorStore/types.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L6)
|
||||
[storage/vectorStore/types.ts:5](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L5)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,4 +34,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L7)
|
||||
[storage/vectorStore/types.ts:6](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L6)
|
||||
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L35)
|
||||
[storage/vectorStore/types.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L34)
|
||||
[storage/vectorStore/types.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,4 +34,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/vectorStore/types.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L36)
|
||||
[storage/vectorStore/types.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/storage/vectorStore/types.ts#L35)
|
||||
|
||||
@@ -41,6 +41,7 @@ custom_edit_url: null
|
||||
- [OpenAI](classes/OpenAI.md)
|
||||
- [OpenAIEmbedding](classes/OpenAIEmbedding.md)
|
||||
- [PDFReader](classes/PDFReader.md)
|
||||
- [PapaCSVReader](classes/PapaCSVReader.md)
|
||||
- [Refine](classes/Refine.md)
|
||||
- [Response](classes/Response.md)
|
||||
- [ResponseSynthesizer](classes/ResponseSynthesizer.md)
|
||||
@@ -48,8 +49,11 @@ custom_edit_url: null
|
||||
- [SentenceSplitter](classes/SentenceSplitter.md)
|
||||
- [SimpleChatEngine](classes/SimpleChatEngine.md)
|
||||
- [SimpleDirectoryReader](classes/SimpleDirectoryReader.md)
|
||||
- [SimpleDocumentStore](classes/SimpleDocumentStore.md)
|
||||
- [SimpleIndexStore](classes/SimpleIndexStore.md)
|
||||
- [SimpleNodeParser](classes/SimpleNodeParser.md)
|
||||
- [SimpleResponseBuilder](classes/SimpleResponseBuilder.md)
|
||||
- [SimpleVectorStore](classes/SimpleVectorStore.md)
|
||||
- [SubQuestionOutputParser](classes/SubQuestionOutputParser.md)
|
||||
- [SubQuestionQueryEngine](classes/SubQuestionQueryEngine.md)
|
||||
- [TextFileReader](classes/TextFileReader.md)
|
||||
@@ -77,7 +81,6 @@ custom_edit_url: null
|
||||
- [MetadataFilters](interfaces/MetadataFilters.md)
|
||||
- [MetadataInfo](interfaces/MetadataInfo.md)
|
||||
- [NodeParser](interfaces/NodeParser.md)
|
||||
- [NodeWithEmbedding](interfaces/NodeWithEmbedding.md)
|
||||
- [NodeWithScore](interfaces/NodeWithScore.md)
|
||||
- [QueryEngineTool](interfaces/QueryEngineTool.md)
|
||||
- [RelatedNodeInfo](interfaces/RelatedNodeInfo.md)
|
||||
@@ -90,8 +93,6 @@ custom_edit_url: null
|
||||
- [StructuredOutput](interfaces/StructuredOutput.md)
|
||||
- [SubQuestion](interfaces/SubQuestion.md)
|
||||
- [ToolMetadata](interfaces/ToolMetadata.md)
|
||||
- [VectorIndexConstructorProps](interfaces/VectorIndexConstructorProps.md)
|
||||
- [VectorIndexOptions](interfaces/VectorIndexOptions.md)
|
||||
- [VectorStore](interfaces/VectorStore.md)
|
||||
- [VectorStoreInfo](interfaces/VectorStoreInfo.md)
|
||||
- [VectorStoreQuery](interfaces/VectorStoreQuery.md)
|
||||
@@ -157,7 +158,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L32)
|
||||
[Node.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
@@ -176,7 +177,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/SimpleDirectoryReader.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/SimpleDirectoryReader.ts#L26)
|
||||
[readers/SimpleDirectoryReader.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/readers/SimpleDirectoryReader.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
@@ -219,12 +220,21 @@ NOTE 2: we default to empty string to make it easy to calculate prompt sizes
|
||||
| `Llama-2-13b-chat` | { `contextWindow`: `number` = 4096; `replicateApi`: `string` = "a16z-infra/llama13b-v2-chat:df7690f1994d94e96ad9d568eac121aecf50684a0b0963b25a41cc40061269e5" } |
|
||||
| `Llama-2-13b-chat.contextWindow` | `number` |
|
||||
| `Llama-2-13b-chat.replicateApi` | `string` |
|
||||
| `Llama-2-70b-chat` | { `contextWindow`: `number` = 4096; `replicateApi`: `string` = "replicate/llama70b-v2-chat:e951f18578850b652510200860fc4ea62b3b16fac280f83ff32282f87bbd2e48" } |
|
||||
| `Llama-2-70b-chat.contextWindow` | `number` |
|
||||
| `Llama-2-70b-chat.replicateApi` | `string` |
|
||||
| `Llama-2-13b-chat-4bit` | { `contextWindow`: `number` = 4096; `replicateApi`: `string` = "a16z-infra/llama13b-v2-chat:2a7f981751ec7fdf87b5b91ad4db53683a98082e9ff7bfd12c8cd5ea85980a52" } |
|
||||
| `Llama-2-13b-chat-4bit.contextWindow` | `number` |
|
||||
| `Llama-2-13b-chat-4bit.replicateApi` | `string` |
|
||||
| `Llama-2-70b-chat-4bit` | { `contextWindow`: `number` = 4096; `replicateApi`: `string` = "replicate/llama70b-v2-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1" } |
|
||||
| `Llama-2-70b-chat-4bit.contextWindow` | `number` |
|
||||
| `Llama-2-70b-chat-4bit.replicateApi` | `string` |
|
||||
| `Llama-2-70b-chat-old` | { `contextWindow`: `number` = 4096; `replicateApi`: `string` = "replicate/llama70b-v2-chat:e951f18578850b652510200860fc4ea62b3b16fac280f83ff32282f87bbd2e48" } |
|
||||
| `Llama-2-70b-chat-old.contextWindow` | `number` |
|
||||
| `Llama-2-70b-chat-old.replicateApi` | `string` |
|
||||
| `Llama-2-7b-chat` | { `contextWindow`: `number` = 4096; `replicateApi`: `string` = "a16z-infra/llama7b-v2-chat:4f0a4744c7295c024a1de15e1a63c880d3da035fa1f49bfd344fe076074c8eea" } |
|
||||
| `Llama-2-7b-chat.contextWindow` | `number` |
|
||||
| `Llama-2-7b-chat.replicateApi` | `string` |
|
||||
| `Llama-2-7b-chat-4bit` | { `contextWindow`: `number` = 4096; `replicateApi`: `string` = "a16z-infra/llama7b-v2-chat:4f0b260b6a13eb53a6b1891f089d57c08f41003ae79458be5011303d81a394dc" } |
|
||||
| `Llama-2-7b-chat-4bit.contextWindow` | `number` |
|
||||
| `Llama-2-7b-chat-4bit.replicateApi` | `string` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
@@ -858,7 +868,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[indices/BaseIndex.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L70)
|
||||
[indices/BaseIndex.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/indices/BaseIndex.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
@@ -878,7 +888,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:243](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L243)
|
||||
[Node.ts:271](https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/src/Node.ts#L271)
|
||||
|
||||
___
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# simple
|
||||
|
||||
## 0.0.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [824c13c]
|
||||
- Updated dependencies [18b8915]
|
||||
- Updated dependencies [ade9d8f]
|
||||
- Updated dependencies [824c13c]
|
||||
- llamaindex@0.0.18
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
// @ts-ignore
|
||||
import * as readline from "node:readline/promises";
|
||||
// @ts-ignore
|
||||
import { stdin as input, stdout as output } from "node:process";
|
||||
// readline/promises is still experimental so not in @types/node yet
|
||||
// @ts-ignore
|
||||
import readline from "node:readline/promises";
|
||||
|
||||
import {
|
||||
Document,
|
||||
VectorStoreIndex,
|
||||
ContextChatEngine,
|
||||
Document,
|
||||
serviceContextFromDefaults,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
|
||||
import essay from "./essay";
|
||||
|
||||
async function main() {
|
||||
const document = new Document({ text: essay });
|
||||
const serviceContext = serviceContextFromDefaults({ chunkSize: 512 });
|
||||
const index = await VectorStoreIndex.fromDocuments(
|
||||
[document],
|
||||
{ serviceContext }
|
||||
);
|
||||
const index = await VectorStoreIndex.fromDocuments([document], {
|
||||
serviceContext,
|
||||
});
|
||||
const retriever = index.asRetriever();
|
||||
retriever.similarityTopK = 5;
|
||||
const chatEngine = new ContextChatEngine({ retriever });
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import {
|
||||
CompactAndRefine,
|
||||
OpenAI,
|
||||
PapaCSVReader,
|
||||
ResponseSynthesizer,
|
||||
serviceContextFromDefaults,
|
||||
SimplePrompt,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
// Load CSV
|
||||
const reader = new PapaCSVReader();
|
||||
const path = "data/titanic_train.csv";
|
||||
const documents = await reader.loadData(path);
|
||||
|
||||
const serviceContext = serviceContextFromDefaults({
|
||||
llm: new OpenAI({ model: "gpt-4" }),
|
||||
});
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const index = await VectorStoreIndex.fromDocuments(documents, {
|
||||
serviceContext,
|
||||
});
|
||||
|
||||
const csvPrompt: SimplePrompt = (input) => {
|
||||
const { context = "", query = "" } = input;
|
||||
|
||||
return `The following CSV file is loaded from ${path}
|
||||
\`\`\`csv
|
||||
${context}
|
||||
\`\`\`
|
||||
Given the CSV file, generate me Typescript code to answer the question: ${query}. You can use built in NodeJS functions but avoid using third party libraries.
|
||||
`;
|
||||
};
|
||||
|
||||
const responseSynthesizer = new ResponseSynthesizer({
|
||||
responseBuilder: new CompactAndRefine(serviceContext, csvPrompt),
|
||||
});
|
||||
|
||||
const queryEngine = index.asQueryEngine({ responseSynthesizer });
|
||||
|
||||
// Query the index
|
||||
const response = await queryEngine.query(
|
||||
"What is the correlation between survival and age?",
|
||||
);
|
||||
|
||||
// Output response
|
||||
console.log(response.toString());
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
@@ -0,0 +1,715 @@
|
||||
survived,pclass,name,sex,age,sibsp,parch,ticket,fare,cabin,embarked
|
||||
0,3,Braund,male,22,1,0,A/5 21171,7.25,,S
|
||||
1,1,Cumings,female,38,1,0,PC 17599,71.2833,C85,C
|
||||
1,3,Heikkinen,female,26,0,0,STON/O2. 3101282,7.925,,S
|
||||
1,1,Futrelle,female,35,1,0,113803,53.1,C123,S
|
||||
0,3,Allen,male,35,0,0,373450,8.05,,S
|
||||
0,1,McCarthy,male,54,0,0,17463,51.8625,E46,S
|
||||
0,3,Palsson,male,2,3,1,349909,21.075,,S
|
||||
1,3,Johnson,female,27,0,2,347742,11.1333,,S
|
||||
1,2,Nasser,female,14,1,0,237736,30.0708,,C
|
||||
1,3,Sandstrom,female,4,1,1,PP 9549,16.7,G6,S
|
||||
1,1,Bonnell,female,58,0,0,113783,26.55,C103,S
|
||||
0,3,Saundercock,male,20,0,0,A/5. 2151,8.05,,S
|
||||
0,3,Andersson,male,39,1,5,347082,31.275,,S
|
||||
0,3,Vestrom,female,14,0,0,350406,7.8542,,S
|
||||
1,2,Hewlett,female,55,0,0,248706,16,,S
|
||||
0,3,Rice,male,2,4,1,382652,29.125,,Q
|
||||
0,3,Vander,female,31,1,0,345763,18,,S
|
||||
0,2,Fynney,male,35,0,0,239865,26,,S
|
||||
1,2,Beesley,male,34,0,0,248698,13,D56,S
|
||||
1,3,McGowan,female,15,0,0,330923,8.0292,,Q
|
||||
1,1,Sloper,male,28,0,0,113788,35.5,A6,S
|
||||
0,3,Palsson,female,8,3,1,349909,21.075,,S
|
||||
1,3,Asplund,female,38,1,5,347077,31.3875,,S
|
||||
0,1,Fortune,male,19,3,2,19950,263,C23 C25 C27,S
|
||||
0,1,Uruchurtu,male,40,0,0,PC 17601,27.7208,,C
|
||||
0,2,Wheadon,male,66,0,0,C.A. 24579,10.5,,S
|
||||
0,1,Meyer,male,28,1,0,PC 17604,82.1708,,C
|
||||
0,1,Holverson,male,42,1,0,113789,52,,S
|
||||
0,3,Cann,male,21,0,0,A./5. 2152,8.05,,S
|
||||
0,3,Vander,female,18,2,0,345764,18,,S
|
||||
1,3,Nicola-Yarred,female,14,1,0,2651,11.2417,,C
|
||||
0,3,Ahlin,female,40,1,0,7546,9.475,,S
|
||||
0,2,Turpin,female,27,1,0,11668,21,,S
|
||||
1,2,Laroche,female,3,1,2,SC/Paris 2123,41.5792,,C
|
||||
1,3,Devaney,female,19,0,0,330958,7.8792,,Q
|
||||
0,3,Arnold-Franchi,female,18,1,0,349237,17.8,,S
|
||||
0,3,Panula,male,7,4,1,3101295,39.6875,,S
|
||||
0,3,Nosworthy,male,21,0,0,A/4. 39886,7.8,,S
|
||||
1,1,Harper,female,49,1,0,PC 17572,76.7292,D33,C
|
||||
1,2,Faunthorpe,female,29,1,0,2926,26,,S
|
||||
0,1,Ostby,male,65,0,1,113509,61.9792,B30,C
|
||||
1,2,Rugg,female,21,0,0,C.A. 31026,10.5,,S
|
||||
0,3,Novel,male,28.5,0,0,2697,7.2292,,C
|
||||
1,2,West,female,5,1,2,C.A. 34651,27.75,,S
|
||||
0,3,Goodwin,male,11,5,2,CA 2144,46.9,,S
|
||||
0,3,Sirayanian,male,22,0,0,2669,7.2292,,C
|
||||
1,1,Icard,female,38,0,0,113572,80,B28,
|
||||
0,1,Harris,male,45,1,0,36973,83.475,C83,S
|
||||
0,3,Skoog,male,4,3,2,347088,27.9,,S
|
||||
1,2,Nye,female,29,0,0,C.A. 29395,10.5,F33,S
|
||||
0,3,Crease,male,19,0,0,S.P. 3464,8.1583,,S
|
||||
1,3,Andersson,female,17,4,2,3101281,7.925,,S
|
||||
0,3,Kink,male,26,2,0,315151,8.6625,,S
|
||||
0,2,Jenkin,male,32,0,0,C.A. 33111,10.5,,S
|
||||
0,3,Goodwin,female,16,5,2,CA 2144,46.9,,S
|
||||
0,2,Hood,male,21,0,0,S.O.C. 14879,73.5,,S
|
||||
0,3,Chronopoulos,male,26,1,0,2680,14.4542,,C
|
||||
1,3,Bing,male,32,0,0,1601,56.4958,,S
|
||||
0,3,Moen,male,25,0,0,348123,7.65,F G73,S
|
||||
1,2,Caldwell,male,0.83,0,2,248738,29,,S
|
||||
1,3,Dowdell,female,30,0,0,364516,12.475,,S
|
||||
0,3,Waelens,male,22,0,0,345767,9,,S
|
||||
1,3,Sheerlinck,male,29,0,0,345779,9.5,,S
|
||||
0,1,Carrau,male,28,0,0,113059,47.1,,S
|
||||
1,2,Ilett,female,17,0,0,SO/C 14885,10.5,,S
|
||||
1,3,Backstrom,female,33,3,0,3101278,15.85,,S
|
||||
0,3,Ford,male,16,1,3,W./C. 6608,34.375,,S
|
||||
1,1,Fortune,female,23,3,2,19950,263,C23 C25 C27,S
|
||||
0,3,Celotti,male,24,0,0,343275,8.05,,S
|
||||
0,3,Christmann,male,29,0,0,343276,8.05,,S
|
||||
0,3,Andreasson,male,20,0,0,347466,7.8542,,S
|
||||
0,1,Chaffee,male,46,1,0,W.E.P. 5734,61.175,E31,S
|
||||
0,3,Dean,male,26,1,2,C.A. 2315,20.575,,S
|
||||
0,3,Coxon,male,59,0,0,364500,7.25,,S
|
||||
0,1,Goldschmidt,male,71,0,0,PC 17754,34.6542,A5,C
|
||||
1,1,Greenfield,male,23,0,1,PC 17759,63.3583,D10 D12,C
|
||||
1,2,Doling,female,34,0,1,231919,23,,S
|
||||
0,2,Kantor,male,34,1,0,244367,26,,S
|
||||
0,3,Petranec,female,28,0,0,349245,7.8958,,S
|
||||
0,1,White,male,21,0,1,35281,77.2875,D26,S
|
||||
0,3,Johansson,male,33,0,0,7540,8.6542,,S
|
||||
0,3,Gustafsson,male,37,2,0,3101276,7.925,,S
|
||||
0,3,Mionoff,male,28,0,0,349207,7.8958,,S
|
||||
1,3,Salkjelsvik,female,21,0,0,343120,7.65,,S
|
||||
0,3,Rekic,male,38,0,0,349249,7.8958,,S
|
||||
0,1,Porter,male,47,0,0,110465,52,C110,S
|
||||
0,3,Zabour,female,14.5,1,0,2665,14.4542,,C
|
||||
0,3,Barton,male,22,0,0,324669,8.05,,S
|
||||
0,3,Jussila,female,20,1,0,4136,9.825,,S
|
||||
0,3,Attalah,female,17,0,0,2627,14.4583,,C
|
||||
0,3,Pekoniemi,male,21,0,0,STON/O 2. 3101294,7.925,,S
|
||||
0,3,Connors,male,70.5,0,0,370369,7.75,,Q
|
||||
0,2,Turpin,male,29,1,0,11668,21,,S
|
||||
0,1,Baxter,male,24,0,1,PC 17558,247.5208,B58 B60,C
|
||||
0,3,Andersson,female,2,4,2,347082,31.275,,S
|
||||
0,2,Hickman,male,21,2,0,S.O.C. 14879,73.5,,S
|
||||
0,2,Nasser,male,32.5,1,0,237736,30.0708,,C
|
||||
1,2,Webber,female,32.5,0,0,27267,13,E101,S
|
||||
0,1,White,male,54,0,1,35281,77.2875,D26,S
|
||||
1,3,Nicola-Yarred,male,12,1,0,2651,11.2417,,C
|
||||
1,3,Madsen,male,24,0,0,C 17369,7.1417,,S
|
||||
0,3,Ekstrom,male,45,0,0,347061,6.975,,S
|
||||
0,3,Drazenoic,male,33,0,0,349241,7.8958,,C
|
||||
0,3,Coelho,male,20,0,0,SOTON/O.Q. 3101307,7.05,,S
|
||||
0,3,Robins,female,47,1,0,A/5. 3337,14.5,,S
|
||||
1,2,Weisz,female,29,1,0,228414,26,,S
|
||||
0,2,Sobey,male,25,0,0,C.A. 29178,13,,S
|
||||
0,2,Richard,male,23,0,0,SC/PARIS 2133,15.0458,,C
|
||||
1,1,Newsom,female,19,0,2,11752,26.2833,D47,S
|
||||
0,1,Futrelle,male,37,1,0,113803,53.1,C123,S
|
||||
0,3,Osen,male,16,0,0,7534,9.2167,,S
|
||||
0,1,Giglio,male,24,0,0,PC 17593,79.2,B86,C
|
||||
1,3,Nysten,female,22,0,0,347081,7.75,,S
|
||||
1,3,Hakkarainen,female,24,1,0,STON/O2. 3101279,15.85,,S
|
||||
0,3,Burke,male,19,0,0,365222,6.75,,Q
|
||||
0,2,Andrew,male,18,0,0,231945,11.5,,S
|
||||
0,2,Nicholls,male,19,1,1,C.A. 33112,36.75,,S
|
||||
1,3,Andersson,male,27,0,0,350043,7.7958,,S
|
||||
0,3,Ford,female,9,2,2,W./C. 6608,34.375,,S
|
||||
0,2,Navratil,male,36.5,0,2,230080,26,F2,S
|
||||
0,2,Byles,male,42,0,0,244310,13,,S
|
||||
0,2,Bateman,male,51,0,0,S.O.P. 1166,12.525,,S
|
||||
1,1,Pears,female,22,1,0,113776,66.6,C2,S
|
||||
0,3,Meo,male,55.5,0,0,A.5. 11206,8.05,,S
|
||||
0,3,van,male,40.5,0,2,A/5. 851,14.5,,S
|
||||
0,1,Williams,male,51,0,1,PC 17597,61.3792,,C
|
||||
1,3,Gilnagh,female,16,0,0,35851,7.7333,,Q
|
||||
0,3,Corn,male,30,0,0,SOTON/OQ 392090,8.05,,S
|
||||
0,3,Cribb,male,44,0,1,371362,16.1,,S
|
||||
1,2,Watt,female,40,0,0,C.A. 33595,15.75,,S
|
||||
0,3,Bengtsson,male,26,0,0,347068,7.775,,S
|
||||
0,3,Calic,male,17,0,0,315093,8.6625,,S
|
||||
0,3,Panula,male,1,4,1,3101295,39.6875,,S
|
||||
1,3,Goldsmith,male,9,0,2,363291,20.525,,S
|
||||
0,3,Skoog,female,45,1,4,347088,27.9,,S
|
||||
0,3,Ling,male,28,0,0,1601,56.4958,,S
|
||||
0,1,Van,male,61,0,0,111240,33.5,B19,S
|
||||
0,3,Rice,male,4,4,1,382652,29.125,,Q
|
||||
1,3,Johnson,female,1,1,1,347742,11.1333,,S
|
||||
0,3,Sivola,male,21,0,0,STON/O 2. 3101280,7.925,,S
|
||||
0,1,Smith,male,56,0,0,17764,30.6958,A7,C
|
||||
0,3,Klasen,male,18,1,1,350404,7.8542,,S
|
||||
0,1,Isham,female,50,0,0,PC 17595,28.7125,C49,C
|
||||
0,2,Hale,male,30,0,0,250653,13,,S
|
||||
0,3,Leonard,male,36,0,0,LINE,0,,S
|
||||
0,3,Asplund,male,9,4,2,347077,31.3875,,S
|
||||
1,2,Becker,male,1,2,1,230136,39,F4,S
|
||||
1,3,Kink-Heilmann,female,4,0,2,315153,22.025,,S
|
||||
1,1,Romaine,male,45,0,0,111428,26.55,,S
|
||||
0,3,Bourke,male,40,1,1,364849,15.5,,Q
|
||||
0,3,Turcin,male,36,0,0,349247,7.8958,,S
|
||||
1,2,Pinsky,female,32,0,0,234604,13,,S
|
||||
0,2,Carbines,male,19,0,0,28424,13,,S
|
||||
1,3,Andersen-Jensen,female,19,1,0,350046,7.8542,,S
|
||||
1,2,Navratil,male,3,1,1,230080,26,F2,S
|
||||
1,1,Brown,female,44,0,0,PC 17610,27.7208,B4,C
|
||||
1,1,Lurette,female,58,0,0,PC 17569,146.5208,B80,C
|
||||
0,3,Olsen,male,42,0,1,4579,8.4042,,S
|
||||
0,2,Yrois,female,24,0,0,248747,13,,S
|
||||
0,3,Vande,male,28,0,0,345770,9.5,,S
|
||||
0,3,Johanson,male,34,0,0,3101264,6.4958,,S
|
||||
0,3,Youseff,male,45.5,0,0,2628,7.225,,C
|
||||
1,3,Cohen,male,18,0,0,A/5 3540,8.05,,S
|
||||
0,3,Strom,female,2,0,1,347054,10.4625,G6,S
|
||||
0,3,Backstrom,male,32,1,0,3101278,15.85,,S
|
||||
1,3,Albimona,male,26,0,0,2699,18.7875,,C
|
||||
1,3,Carr,female,16,0,0,367231,7.75,,Q
|
||||
1,1,Blank,male,40,0,0,112277,31,A31,C
|
||||
0,3,Ali,male,24,0,0,SOTON/O.Q. 3101311,7.05,,S
|
||||
1,2,Cameron,female,35,0,0,F.C.C. 13528,21,,S
|
||||
0,3,Perkin,male,22,0,0,A/5 21174,7.25,,S
|
||||
0,2,Givard,male,30,0,0,250646,13,,S
|
||||
1,1,Newell,female,31,1,0,35273,113.275,D36,C
|
||||
1,3,Honkanen,female,27,0,0,STON/O2. 3101283,7.925,,S
|
||||
0,2,Jacobsohn,male,42,1,0,243847,27,,S
|
||||
1,1,Bazzani,female,32,0,0,11813,76.2917,D15,C
|
||||
0,2,Harris,male,30,0,0,W/C 14208,10.5,,S
|
||||
1,3,Sunderland,male,16,0,0,SOTON/OQ 392089,8.05,,S
|
||||
0,2,Bracken,male,27,0,0,220367,13,,S
|
||||
0,3,Green,male,51,0,0,21440,8.05,,S
|
||||
1,1,Hoyt,male,38,1,0,19943,90,C93,S
|
||||
0,3,Berglund,male,22,0,0,PP 4348,9.35,,S
|
||||
1,2,Mellors,male,19,0,0,SW/PP 751,10.5,,S
|
||||
0,3,Lovell,male,20.5,0,0,A/5 21173,7.25,,S
|
||||
0,2,Fahlstrom,male,18,0,0,236171,13,,S
|
||||
1,1,Harris,female,35,1,0,36973,83.475,C83,S
|
||||
0,3,Larsson,male,29,0,0,347067,7.775,,S
|
||||
0,2,Sjostedt,male,59,0,0,237442,13.5,,S
|
||||
1,3,Asplund,female,5,4,2,347077,31.3875,,S
|
||||
0,2,Leyson,male,24,0,0,C.A. 29566,10.5,,S
|
||||
0,2,Hold,male,44,1,0,26707,26,,S
|
||||
1,2,Collyer,female,8,0,2,C.A. 31921,26.25,,S
|
||||
0,2,Pengelly,male,19,0,0,28665,10.5,,S
|
||||
0,2,Hunt,male,33,0,0,SCO/W 1585,12.275,,S
|
||||
0,2,Coleridge,male,29,0,0,W./C. 14263,10.5,,S
|
||||
0,3,Maenpaa,male,22,0,0,STON/O 2. 3101275,7.125,,S
|
||||
0,3,Attalah,male,30,0,0,2694,7.225,,C
|
||||
0,1,Minahan,male,44,2,0,19928,90,C78,Q
|
||||
0,3,Lindahl,female,25,0,0,347071,7.775,,S
|
||||
1,2,Hamalainen,female,24,0,2,250649,14.5,,S
|
||||
1,1,Beckwith,male,37,1,1,11751,52.5542,D35,S
|
||||
0,2,Carter,male,54,1,0,244252,26,,S
|
||||
0,3,Strom,female,29,1,1,347054,10.4625,G6,S
|
||||
0,1,Stead,male,62,0,0,113514,26.55,C87,S
|
||||
0,3,Lobb,male,30,1,0,A/5. 3336,16.1,,S
|
||||
0,3,Rosblom,female,41,0,2,370129,20.2125,,S
|
||||
1,3,Touma,female,29,0,2,2650,15.2458,,C
|
||||
1,1,Cherry,female,30,0,0,110152,86.5,B77,S
|
||||
1,1,Ward,female,35,0,0,PC 17755,512.3292,,C
|
||||
1,2,Parrish,female,50,0,1,230433,26,,S
|
||||
1,3,Asplund,male,3,4,2,347077,31.3875,,S
|
||||
0,1,Taussig,male,52,1,1,110413,79.65,E67,S
|
||||
0,1,Harrison,male,40,0,0,112059,0,B94,S
|
||||
0,2,Reeves,male,36,0,0,C.A. 17248,10.5,,S
|
||||
0,3,Panula,male,16,4,1,3101295,39.6875,,S
|
||||
1,3,Persson,male,25,1,0,347083,7.775,,S
|
||||
1,1,Graham,female,58,0,1,PC 17582,153.4625,C125,S
|
||||
1,1,Bissette,female,35,0,0,PC 17760,135.6333,C99,S
|
||||
1,3,Tornquist,male,25,0,0,LINE,0,,S
|
||||
1,2,Mellinger,female,41,0,1,250644,19.5,,S
|
||||
0,1,Natsch,male,37,0,1,PC 17596,29.7,C118,C
|
||||
1,1,Andrews,female,63,1,0,13502,77.9583,D7,S
|
||||
0,3,Lindblom,female,45,0,0,347073,7.75,,S
|
||||
0,3,Rice,male,7,4,1,382652,29.125,,Q
|
||||
1,3,Abbott,female,35,1,1,C.A. 2673,20.25,,S
|
||||
0,3,Duane,male,65,0,0,336439,7.75,,Q
|
||||
0,3,Olsson,male,28,0,0,347464,7.8542,,S
|
||||
0,3,de,male,16,0,0,345778,9.5,,S
|
||||
1,3,Dorking,male,19,0,0,A/5. 10482,8.05,,S
|
||||
0,3,Stankovic,male,33,0,0,349239,8.6625,,C
|
||||
1,3,de,male,30,0,0,345774,9.5,,S
|
||||
0,3,Naidenoff,male,22,0,0,349206,7.8958,,S
|
||||
1,2,Hosono,male,42,0,0,237798,13,,S
|
||||
1,3,Connolly,female,22,0,0,370373,7.75,,Q
|
||||
1,1,Barber,female,26,0,0,19877,78.85,,S
|
||||
1,1,Bishop,female,19,1,0,11967,91.0792,B49,C
|
||||
0,2,Levy,male,36,0,0,SC/Paris 2163,12.875,D,C
|
||||
0,3,Haas,female,24,0,0,349236,8.85,,S
|
||||
0,3,Mineff,male,24,0,0,349233,7.8958,,S
|
||||
0,3,Hanna,male,23.5,0,0,2693,7.2292,,C
|
||||
0,1,Allison,female,2,1,2,113781,151.55,C22 C26,S
|
||||
1,1,Baxter,female,50,0,1,PC 17558,247.5208,B58 B60,C
|
||||
0,3,Johnson,male,19,0,0,LINE,0,,S
|
||||
1,1,Allison,male,0.92,1,2,113781,151.55,C22 C26,S
|
||||
1,1,Penasco,female,17,1,0,PC 17758,108.9,C65,C
|
||||
0,2,Abelson,male,30,1,0,P/PP 3381,24,,C
|
||||
1,1,Francatelli,female,30,0,0,PC 17485,56.9292,E36,C
|
||||
1,1,Hays,female,24,0,0,11767,83.1583,C54,C
|
||||
1,1,Ryerson,female,18,2,2,PC 17608,262.375,B57 B59 B63 B66,C
|
||||
0,2,Lahtinen,female,26,1,1,250651,26,,S
|
||||
0,3,Hendekovic,male,28,0,0,349243,7.8958,,S
|
||||
0,2,Hart,male,43,1,1,F.C.C. 13529,26.25,,S
|
||||
1,3,Nilsson,female,26,0,0,347470,7.8542,,S
|
||||
1,2,Kantor,female,24,1,0,244367,26,,S
|
||||
0,2,Moraweck,male,54,0,0,29011,14,,S
|
||||
1,1,Wick,female,31,0,2,36928,164.8667,C7,S
|
||||
1,1,Spedden,female,40,1,1,16966,134.5,E34,C
|
||||
0,3,Dennis,male,22,0,0,A/5 21172,7.25,,S
|
||||
0,3,Danoff,male,27,0,0,349219,7.8958,,S
|
||||
1,2,Slayter,female,30,0,0,234818,12.35,,Q
|
||||
1,2,Caldwell,female,22,1,1,248738,29,,S
|
||||
1,1,Young,female,36,0,0,PC 17760,135.6333,C32,C
|
||||
0,3,Nysveen,male,61,0,0,345364,6.2375,,S
|
||||
1,2,Ball,female,36,0,0,28551,13,D,S
|
||||
1,3,Goldsmith,female,31,1,1,363291,20.525,,S
|
||||
1,1,Hippach,female,16,0,1,111361,57.9792,B18,C
|
||||
0,1,Partner,male,45.5,0,0,113043,28.5,C124,S
|
||||
0,1,Graham,male,38,0,1,PC 17582,153.4625,C91,S
|
||||
0,3,Vander,male,16,2,0,345764,18,,S
|
||||
0,1,Pears,male,29,1,0,113776,66.6,C2,S
|
||||
1,1,Burns,female,41,0,0,16966,134.5,E40,C
|
||||
1,3,Dahl,male,45,0,0,7598,8.05,,S
|
||||
0,1,Blackwell,male,45,0,0,113784,35.5,T,S
|
||||
1,2,Navratil,male,2,1,1,230080,26,F2,S
|
||||
1,1,Fortune,female,24,3,2,19950,263,C23 C25 C27,S
|
||||
0,2,Collander,male,28,0,0,248740,13,,S
|
||||
0,2,Sedgwick,male,25,0,0,244361,13,,S
|
||||
0,2,Fox,male,36,0,0,229236,13,,S
|
||||
1,2,Brown,female,24,0,0,248733,13,F33,S
|
||||
1,2,Smith,female,40,0,0,31418,13,,S
|
||||
1,3,Coutts,male,3,1,1,C.A. 37671,15.9,,S
|
||||
0,3,Dimic,male,42,0,0,315088,8.6625,,S
|
||||
0,3,Odahl,male,23,0,0,7267,9.225,,S
|
||||
0,3,Elias,male,15,1,1,2695,7.2292,,C
|
||||
0,3,Arnold-Franchi,male,25,1,0,349237,17.8,,S
|
||||
0,3,Vanden,male,28,0,0,345783,9.5,,S
|
||||
1,1,Bowerman,female,22,0,1,113505,55,E33,S
|
||||
0,2,Funk,female,38,0,0,237671,13,,S
|
||||
0,3,Skoog,male,40,1,4,347088,27.9,,S
|
||||
0,2,del,male,29,1,0,SC/PARIS 2167,27.7208,,C
|
||||
0,3,Barbara,female,45,0,1,2691,14.4542,,C
|
||||
0,3,Asim,male,35,0,0,SOTON/O.Q. 3101310,7.05,,S
|
||||
0,3,Adahl,male,30,0,0,C 7076,7.25,,S
|
||||
1,1,Warren,female,60,1,0,110813,75.25,D37,C
|
||||
1,1,Aubart,female,24,0,0,PC 17477,69.3,B35,C
|
||||
1,1,Harder,male,25,1,0,11765,55.4417,E50,C
|
||||
0,3,Wiklund,male,18,1,0,3101267,6.4958,,S
|
||||
0,3,Beavan,male,19,0,0,323951,8.05,,S
|
||||
0,1,Ringhini,male,22,0,0,PC 17760,135.6333,,C
|
||||
0,3,Palsson,female,3,3,1,349909,21.075,,S
|
||||
1,3,Landergren,female,22,0,0,C 7077,7.25,,S
|
||||
0,1,Widener,male,27,0,2,113503,211.5,C82,C
|
||||
0,3,Betros,male,20,0,0,2648,4.0125,,C
|
||||
0,3,Gustafsson,male,19,0,0,347069,7.775,,S
|
||||
1,1,Bidois,female,42,0,0,PC 17757,227.525,,C
|
||||
1,3,Nakid,female,1,0,2,2653,15.7417,,C
|
||||
0,3,Tikkanen,male,32,0,0,STON/O 2. 3101293,7.925,,S
|
||||
1,1,Holverson,female,35,1,0,113789,52,,S
|
||||
0,2,Davies,male,18,0,0,S.O.C. 14879,73.5,,S
|
||||
0,3,Goodwin,male,1,5,2,CA 2144,46.9,,S
|
||||
1,2,Buss,female,36,0,0,27849,13,,S
|
||||
1,2,Lehmann,female,17,0,0,SC 1748,12,,C
|
||||
1,1,Carter,male,36,1,2,113760,120,B96 B98,S
|
||||
1,3,Jansson,male,21,0,0,350034,7.7958,,S
|
||||
0,3,Gustafsson,male,28,2,0,3101277,7.925,,S
|
||||
1,1,Newell,female,23,1,0,35273,113.275,D36,C
|
||||
1,3,Sandstrom,female,24,0,2,PP 9549,16.7,G6,S
|
||||
0,3,Johansson,male,22,0,0,350052,7.7958,,S
|
||||
0,3,Olsson,female,31,0,0,350407,7.8542,,S
|
||||
0,2,McKane,male,46,0,0,28403,26,,S
|
||||
0,2,Pain,male,23,0,0,244278,10.5,,S
|
||||
1,2,Trout,female,28,0,0,240929,12.65,,S
|
||||
1,3,Niskanen,male,39,0,0,STON/O 2. 3101289,7.925,,S
|
||||
0,3,Adams,male,26,0,0,341826,8.05,,S
|
||||
0,3,Jussila,female,21,1,0,4137,9.825,,S
|
||||
0,3,Hakkarainen,male,28,1,0,STON/O2. 3101279,15.85,,S
|
||||
0,3,Oreskovic,female,20,0,0,315096,8.6625,,S
|
||||
0,2,Gale,male,34,1,0,28664,21,,S
|
||||
0,3,Widegren,male,51,0,0,347064,7.75,,S
|
||||
1,2,Richards,male,3,1,1,29106,18.75,,S
|
||||
0,3,Birkeland,male,21,0,0,312992,7.775,,S
|
||||
1,1,Minahan,female,33,1,0,19928,90,C78,Q
|
||||
1,3,Sundman,male,44,0,0,STON/O 2. 3101269,7.925,,S
|
||||
1,2,Drew,female,34,1,1,28220,32.5,,S
|
||||
1,2,Silven,female,18,0,2,250652,13,,S
|
||||
0,2,Matthews,male,30,0,0,28228,13,,S
|
||||
0,3,Van,female,10,0,2,345773,24.15,,S
|
||||
0,3,Charters,male,21,0,0,A/5. 13032,7.7333,,Q
|
||||
0,3,Zimmerman,male,29,0,0,315082,7.875,,S
|
||||
0,3,Danbom,female,28,1,1,347080,14.4,,S
|
||||
0,3,Rosblom,male,18,1,1,370129,20.2125,,S
|
||||
1,2,Clarke,female,28,1,0,2003,26,,S
|
||||
1,2,Phillips,female,19,0,0,250655,26,,S
|
||||
1,3,Pickard,male,32,0,0,SOTON/O.Q. 392078,8.05,E10,S
|
||||
1,1,Bjornstrom-Steffansson,male,28,0,0,110564,26.55,C52,S
|
||||
1,2,Louch,female,42,1,0,SC/AH 3085,26,,S
|
||||
0,3,Kallio,male,17,0,0,STON/O 2. 3101274,7.125,,S
|
||||
0,1,Silvey,male,50,1,0,13507,55.9,E44,S
|
||||
1,1,Carter,female,14,1,2,113760,120,B96 B98,S
|
||||
0,3,Ford,female,21,2,2,W./C. 6608,34.375,,S
|
||||
1,2,Richards,female,24,2,3,29106,18.75,,S
|
||||
0,1,Fortune,male,64,1,4,19950,263,C23 C25 C27,S
|
||||
0,2,Kvillner,male,31,0,0,C.A. 18723,10.5,,S
|
||||
1,2,Hart,female,45,1,1,F.C.C. 13529,26.25,,S
|
||||
0,3,Hampe,male,20,0,0,345769,9.5,,S
|
||||
0,3,Petterson,male,25,1,0,347076,7.775,,S
|
||||
1,2,Reynaldo,female,28,0,0,230434,13,,S
|
||||
1,1,Dodge,male,4,0,2,33638,81.8583,A34,S
|
||||
1,2,Mellinger,female,13,0,1,250644,19.5,,S
|
||||
1,1,Seward,male,34,0,0,113794,26.55,,S
|
||||
1,3,Baclini,female,5,2,1,2666,19.2583,,C
|
||||
1,1,Peuchen,male,52,0,0,113786,30.5,C104,S
|
||||
0,2,West,male,36,1,2,C.A. 34651,27.75,,S
|
||||
0,1,Foreman,male,30,0,0,113051,27.75,C111,C
|
||||
1,1,Goldenberg,male,49,1,0,17453,89.1042,C92,C
|
||||
1,3,Jalsevac,male,29,0,0,349240,7.8958,,C
|
||||
0,1,Millet,male,65,0,0,13509,26.55,E38,S
|
||||
1,2,Toomey,female,50,0,0,F.C.C. 13531,10.5,,S
|
||||
1,1,Anderson,male,48,0,0,19952,26.55,E12,S
|
||||
0,3,Morley,male,34,0,0,364506,8.05,,S
|
||||
0,1,Gee,male,47,0,0,111320,38.5,E63,S
|
||||
0,2,Milling,male,48,0,0,234360,13,,S
|
||||
0,3,Goncalves,male,38,0,0,SOTON/O.Q. 3101306,7.05,,S
|
||||
0,1,Smart,male,56,0,0,113792,26.55,,S
|
||||
1,3,Baclini,female,0.75,2,1,2666,19.2583,,C
|
||||
0,3,Cacic,male,38,0,0,315089,8.6625,,S
|
||||
1,2,West,female,33,1,2,C.A. 34651,27.75,,S
|
||||
1,2,Jerwan,female,23,0,0,SC/AH Basle 541,13.7917,D,C
|
||||
0,3,Strandberg,female,22,0,0,7553,9.8375,,S
|
||||
0,2,Renouf,male,34,1,0,31027,21,,S
|
||||
0,3,Braund,male,29,1,0,3460,7.0458,,S
|
||||
0,3,Karlsson,male,22,0,0,350060,7.5208,,S
|
||||
1,3,Hirvonen,female,2,0,1,3101298,12.2875,,S
|
||||
0,3,Goodwin,male,9,5,2,CA 2144,46.9,,S
|
||||
0,3,Rouse,male,50,0,0,A/5 3594,8.05,,S
|
||||
1,3,Turkula,female,63,0,0,4134,9.5875,,S
|
||||
1,1,Bishop,male,25,1,0,11967,91.0792,B49,C
|
||||
1,1,Hoyt,female,35,1,0,19943,90,C93,S
|
||||
0,1,Kent,male,58,0,0,11771,29.7,B37,C
|
||||
0,3,Somerton,male,30,0,0,A.5. 18509,8.05,,S
|
||||
1,3,Coutts,male,9,1,1,C.A. 37671,15.9,,S
|
||||
0,3,Windelov,male,21,0,0,SOTON/OQ 3101317,7.25,,S
|
||||
0,1,Molson,male,55,0,0,113787,30.5,C30,S
|
||||
0,1,Artagaveytia,male,71,0,0,PC 17609,49.5042,,C
|
||||
0,3,Stanley,male,21,0,0,A/4 45380,8.05,,S
|
||||
1,1,Eustis,female,54,1,0,36947,78.2667,D20,C
|
||||
0,1,Allison,female,25,1,2,113781,151.55,C22 C26,S
|
||||
0,3,Svensson,male,24,0,0,350035,7.7958,,S
|
||||
0,3,Calic,male,17,0,0,315086,8.6625,,S
|
||||
0,3,Canavan,female,21,0,0,364846,7.75,,Q
|
||||
0,3,Laitinen,female,37,0,0,4135,9.5875,,S
|
||||
1,1,Maioni,female,16,0,0,110152,86.5,B79,S
|
||||
0,1,Penasco,male,18,1,0,PC 17758,108.9,C65,C
|
||||
1,2,Quick,female,33,0,2,26360,26,,S
|
||||
0,3,Olsen,male,28,0,0,C 4001,22.525,,S
|
||||
1,3,Lang,male,26,0,0,1601,56.4958,,S
|
||||
1,3,Daly,male,29,0,0,382651,7.75,,Q
|
||||
1,1,McGough,male,36,0,0,PC 17473,26.2875,E25,S
|
||||
1,1,Rothschild,female,54,1,0,PC 17603,59.4,,C
|
||||
0,3,Coleff,male,24,0,0,349209,7.4958,,S
|
||||
0,1,Walker,male,47,0,0,36967,34.0208,D46,S
|
||||
1,2,Lemore,female,34,0,0,C.A. 34260,10.5,F33,S
|
||||
1,2,Angle,female,36,1,0,226875,26,,S
|
||||
0,3,Pavlovic,male,32,0,0,349242,7.8958,,S
|
||||
1,1,Perreault,female,30,0,0,12749,93.5,B73,S
|
||||
0,3,Vovk,male,22,0,0,349252,7.8958,,S
|
||||
1,1,Hippach,female,44,0,1,111361,57.9792,B18,C
|
||||
0,3,Farrell,male,40.5,0,0,367232,7.75,,Q
|
||||
1,2,Ridsdale,female,50,0,0,W./C. 14258,10.5,,S
|
||||
0,3,Salonen,male,39,0,0,3101296,7.925,,S
|
||||
0,2,Hocking,male,23,2,1,29104,11.5,,S
|
||||
1,2,Quick,female,2,1,1,26360,26,,S
|
||||
0,3,Elias,male,17,1,1,2690,7.2292,,C
|
||||
0,3,Cacic,female,30,0,0,315084,8.6625,,S
|
||||
1,2,Hart,female,7,0,2,F.C.C. 13529,26.25,,S
|
||||
0,1,Butt,male,45,0,0,113050,26.55,B38,S
|
||||
1,1,LeRoy,female,30,0,0,PC 17761,106.425,,C
|
||||
1,1,Frolicher,female,22,0,2,13568,49.5,B39,C
|
||||
1,1,Crosby,female,36,0,2,WE/P 5735,71,B22,S
|
||||
0,3,Andersson,female,9,4,2,347082,31.275,,S
|
||||
0,3,Andersson,female,11,4,2,347082,31.275,,S
|
||||
1,2,Beane,male,32,1,0,2908,26,,S
|
||||
0,1,Douglas,male,50,1,0,PC 17761,106.425,C86,C
|
||||
0,1,Nicholson,male,64,0,0,693,26,,S
|
||||
1,2,Beane,female,19,1,0,2908,26,,S
|
||||
0,3,Goldsmith,male,33,1,1,363291,20.525,,S
|
||||
1,2,Davies,male,8,1,1,C.A. 33112,36.75,,S
|
||||
1,1,Thayer,male,17,0,2,17421,110.8833,C70,C
|
||||
0,2,Sharp,male,27,0,0,244358,26,,S
|
||||
1,3,Leeni,male,22,0,0,2620,7.225,,C
|
||||
1,3,Ohman,female,22,0,0,347085,7.775,,S
|
||||
0,1,Wright,male,62,0,0,113807,26.55,,S
|
||||
1,1,Duff,female,48,1,0,11755,39.6,A16,C
|
||||
1,1,Taussig,female,39,1,1,110413,79.65,E67,S
|
||||
1,3,de,female,36,1,0,345572,17.4,,S
|
||||
0,3,Sivic,male,40,0,0,349251,7.8958,,S
|
||||
0,2,Norman,male,28,0,0,218629,13.5,,S
|
||||
0,3,Davies,male,24,2,0,A/4 48871,24.15,,S
|
||||
0,3,Stoytcheff,male,19,0,0,349205,7.8958,,S
|
||||
0,3,Palsson,female,29,0,4,349909,21.075,,S
|
||||
1,3,Jonsson,male,32,0,0,350417,7.8542,,S
|
||||
1,2,Harris,male,62,0,0,S.W./PP 752,10.5,,S
|
||||
1,1,Appleton,female,53,2,0,11769,51.4792,C101,S
|
||||
1,1,Flynn,male,36,0,0,PC 17474,26.3875,E25,S
|
||||
0,3,Rush,male,16,0,0,A/4. 20589,8.05,,S
|
||||
0,3,Patchett,male,19,0,0,358585,14.5,,S
|
||||
1,2,Garside,female,34,0,0,243880,13,,S
|
||||
1,1,Silvey,female,39,1,0,13507,55.9,E44,S
|
||||
1,3,Jussila,male,32,0,0,STON/O 2. 3101286,7.925,,S
|
||||
1,2,Christy,female,25,1,1,237789,30,,S
|
||||
1,1,Thayer,female,39,1,1,17421,110.8833,C68,C
|
||||
0,2,Downton,male,54,0,0,28403,26,,S
|
||||
0,1,Ross,male,36,0,0,13049,40.125,A10,C
|
||||
1,1,Taussig,female,18,0,2,110413,79.65,E68,S
|
||||
0,2,Jarvis,male,47,0,0,237565,15,,S
|
||||
1,1,Frolicher-Stehli,male,60,1,1,13567,79.2,B41,C
|
||||
0,3,Gilinski,male,22,0,0,14973,8.05,,S
|
||||
0,3,Rintamaki,male,35,0,0,STON/O 2. 3101273,7.125,,S
|
||||
1,1,Stephenson,female,52,1,0,36947,78.2667,D20,C
|
||||
0,3,Elsbury,male,47,0,0,A/5 3902,7.25,,S
|
||||
0,2,Chapman,male,37,1,0,SC/AH 29037,26,,S
|
||||
0,3,Van,male,36,1,1,345773,24.15,,S
|
||||
0,3,Johnson,male,49,0,0,LINE,0,,S
|
||||
1,1,Duff,male,49,1,0,PC 17485,56.9292,A20,C
|
||||
1,2,Jacobsohn,female,24,2,1,243847,27,,S
|
||||
0,3,Torber,male,44,0,0,364511,8.05,,S
|
||||
1,1,Homer,male,35,0,0,111426,26.55,,C
|
||||
0,3,Lindell,male,36,1,0,349910,15.55,,S
|
||||
0,3,Karaic,male,30,0,0,349246,7.8958,,S
|
||||
1,1,Daniel,male,27,0,0,113804,30.5,,S
|
||||
1,2,Laroche,female,22,1,2,SC/Paris 2123,41.5792,,C
|
||||
1,1,Shutes,female,40,0,0,PC 17582,153.4625,C125,S
|
||||
0,3,Andersson,female,39,1,5,347082,31.275,,S
|
||||
0,3,Brocklebank,male,35,0,0,364512,8.05,,S
|
||||
1,2,Herman,female,24,1,2,220845,65,,S
|
||||
0,3,Danbom,male,34,1,1,347080,14.4,,S
|
||||
0,3,Lobb,female,26,1,0,A/5. 3336,16.1,,S
|
||||
1,2,Becker,female,4,2,1,230136,39,F4,S
|
||||
0,2,Gavey,male,26,0,0,31028,10.5,,S
|
||||
0,3,Yasbeck,male,27,1,0,2659,14.4542,,C
|
||||
1,1,Kimball,male,42,1,0,11753,52.5542,D19,S
|
||||
1,3,Nakid,male,20,1,1,2653,15.7417,,C
|
||||
0,3,Hansen,male,21,0,0,350029,7.8542,,S
|
||||
0,3,Bowen,male,21,0,0,54636,16.1,,S
|
||||
0,1,Sutton,male,61,0,0,36963,32.3208,D50,S
|
||||
0,2,Kirkland,male,57,0,0,219533,12.35,,Q
|
||||
1,1,Longley,female,21,0,0,13502,77.9583,D9,S
|
||||
0,3,Bostandyeff,male,26,0,0,349224,7.8958,,S
|
||||
1,1,Barkworth,male,80,0,0,27042,30,A23,S
|
||||
0,3,Lundahl,male,51,0,0,347743,7.0542,,S
|
||||
1,1,Stahelin-Maeglin,male,32,0,0,13214,30.5,B50,C
|
||||
0,3,Skoog,female,9,3,2,347088,27.9,,S
|
||||
1,2,Davis,female,28,0,0,237668,13,,S
|
||||
0,3,Leinonen,male,32,0,0,STON/O 2. 3101292,7.925,,S
|
||||
0,2,Collyer,male,31,1,1,C.A. 31921,26.25,,S
|
||||
0,3,Panula,female,41,0,5,3101295,39.6875,,S
|
||||
0,3,Jensen,male,20,0,0,350050,7.8542,,S
|
||||
1,1,Sagesser,female,24,0,0,PC 17477,69.3,B35,C
|
||||
0,3,Skoog,female,2,3,2,347088,27.9,,S
|
||||
1,3,Baclini,female,0.75,2,1,2666,19.2583,,C
|
||||
1,1,Harper,male,48,1,0,PC 17572,76.7292,D33,C
|
||||
0,3,Cor,male,19,0,0,349231,7.8958,,S
|
||||
1,1,Simonius-Blumer,male,56,0,0,13213,35.5,A26,C
|
||||
1,3,Stanley,female,23,0,0,CA. 2314,7.55,,S
|
||||
1,2,Doling,female,18,0,1,231919,23,,S
|
||||
0,3,Kalvik,male,21,0,0,8475,8.4333,,S
|
||||
0,3,Hegarty,female,18,0,0,365226,6.75,,Q
|
||||
0,2,Hickman,male,24,2,0,S.O.C. 14879,73.5,,S
|
||||
0,3,Bourke,female,32,1,1,364849,15.5,,Q
|
||||
0,2,Eitemiller,male,23,0,0,29751,13,,S
|
||||
0,1,Newell,male,58,0,2,35273,113.275,D48,C
|
||||
1,1,Frauenthal,male,50,2,0,PC 17611,133.65,,S
|
||||
0,3,Badt,male,40,0,0,2623,7.225,,C
|
||||
0,1,Colley,male,47,0,0,5727,25.5875,E58,S
|
||||
0,3,Coleff,male,36,0,0,349210,7.4958,,S
|
||||
1,3,Lindqvist,male,20,1,0,STON/O 2. 3101285,7.925,,S
|
||||
0,2,Hickman,male,32,2,0,S.O.C. 14879,73.5,,S
|
||||
0,2,Butler,male,25,0,0,234686,13,,S
|
||||
0,3,Cook,male,43,0,0,A/5 3536,8.05,,S
|
||||
1,2,Brown,female,40,1,1,29750,39,,S
|
||||
0,1,Davidson,male,31,1,0,F.C. 12750,52,B71,S
|
||||
0,2,Mitchell,male,70,0,0,C.A. 24580,10.5,,S
|
||||
1,2,Wilhelms,male,31,0,0,244270,13,,S
|
||||
0,3,Edvardsson,male,18,0,0,349912,7.775,,S
|
||||
0,3,Sawyer,male,24.5,0,0,342826,8.05,,S
|
||||
1,3,Turja,female,18,0,0,4138,9.8417,,S
|
||||
0,3,Goodwin,female,43,1,6,CA 2144,46.9,,S
|
||||
1,1,Cardeza,male,36,0,1,PC 17755,512.3292,B51 B53 B55,C
|
||||
1,1,Hassab,male,27,0,0,PC 17572,76.7292,D49,C
|
||||
0,3,Olsvigen,male,20,0,0,6563,9.225,,S
|
||||
0,3,Goodwin,male,14,5,2,CA 2144,46.9,,S
|
||||
0,2,Brown,male,60,1,1,29750,39,,S
|
||||
0,2,Laroche,male,25,1,2,SC/Paris 2123,41.5792,,C
|
||||
0,3,Panula,male,14,4,1,3101295,39.6875,,S
|
||||
0,3,Dakic,male,19,0,0,349228,10.1708,,S
|
||||
0,3,Fischer,male,18,0,0,350036,7.7958,,S
|
||||
1,1,Madill,female,15,0,1,24160,211.3375,B5,S
|
||||
1,1,Dick,male,31,1,0,17474,57,B20,S
|
||||
1,3,Karun,female,4,0,1,349256,13.4167,,C
|
||||
0,3,Saad,male,25,0,0,2672,7.225,,C
|
||||
0,1,Weir,male,60,0,0,113800,26.55,,S
|
||||
0,2,Chapman,male,52,0,0,248731,13.5,,S
|
||||
0,3,Kelly,male,44,0,0,363592,8.05,,S
|
||||
0,1,Thayer,male,49,1,1,17421,110.8833,C68,C
|
||||
0,3,Humblen,male,42,0,0,348121,7.65,F G63,S
|
||||
1,1,Astor,female,18,1,0,PC 17757,227.525,C62 C64,C
|
||||
1,1,Silverthorne,male,35,0,0,PC 17475,26.2875,E24,S
|
||||
0,3,Barbara,female,18,0,1,2691,14.4542,,C
|
||||
0,3,Gallagher,male,25,0,0,36864,7.7417,,Q
|
||||
0,3,Hansen,male,26,1,0,350025,7.8542,,S
|
||||
0,2,Morley,male,39,0,0,250655,26,,S
|
||||
1,2,Kelly,female,45,0,0,223596,13.5,,S
|
||||
1,1,Calderhead,male,42,0,0,PC 17476,26.2875,E24,S
|
||||
1,1,Cleaver,female,22,0,0,113781,151.55,,S
|
||||
1,1,Mayne,female,24,0,0,PC 17482,49.5042,C90,C
|
||||
1,1,Taylor,male,48,1,0,19996,52,C126,S
|
||||
0,3,Larsson,male,29,0,0,7545,9.4833,,S
|
||||
0,2,Greenberg,male,52,0,0,250647,13,,S
|
||||
0,3,Soholt,male,19,0,0,348124,7.65,F G73,S
|
||||
1,1,Endres,female,38,0,0,PC 17757,227.525,C45,C
|
||||
1,2,Troutt,female,27,0,0,34218,10.5,E101,S
|
||||
0,3,Johnson,male,33,0,0,347062,7.775,,S
|
||||
1,2,Harper,female,6,0,1,248727,33,,S
|
||||
0,3,Jensen,male,17,1,0,350048,7.0542,,S
|
||||
0,2,Gillespie,male,34,0,0,12233,13,,S
|
||||
0,2,Hodges,male,50,0,0,250643,13,,S
|
||||
1,1,Chambers,male,27,1,0,113806,53.1,E8,S
|
||||
0,3,Oreskovic,male,20,0,0,315094,8.6625,,S
|
||||
1,2,Renouf,female,30,3,0,31027,21,,S
|
||||
0,2,Bryhl,male,25,1,0,236853,26,,S
|
||||
0,3,Ilmakangas,female,25,1,0,STON/O2. 3101271,7.925,,S
|
||||
1,1,Allen,female,29,0,0,24160,211.3375,B5,S
|
||||
0,3,Hassan,male,11,0,0,2699,18.7875,,C
|
||||
0,2,Berriman,male,23,0,0,28425,13,,S
|
||||
0,2,Troupiansky,male,23,0,0,233639,13,,S
|
||||
0,3,Williams,male,28.5,0,0,54636,16.1,,S
|
||||
0,3,Ford,female,48,1,3,W./C. 6608,34.375,,S
|
||||
1,1,Lesurer,male,35,0,0,PC 17755,512.3292,B101,C
|
||||
0,1,Cavendish,male,36,1,0,19877,78.85,C46,S
|
||||
1,1,Ryerson,female,21,2,2,PC 17608,262.375,B57 B59 B63 B66,C
|
||||
0,3,McNamee,male,24,1,0,376566,16.1,,S
|
||||
1,3,Stranden,male,31,0,0,STON/O 2. 3101288,7.925,,S
|
||||
0,1,Crosby,male,70,1,1,WE/P 5735,71,B22,S
|
||||
0,3,Abbott,male,16,1,1,C.A. 2673,20.25,,S
|
||||
1,2,Sinkkonen,female,30,0,0,250648,13,,S
|
||||
0,1,Marvin,male,19,1,0,113773,53.1,D30,S
|
||||
0,3,Connaghton,male,31,0,0,335097,7.75,,Q
|
||||
1,2,Wells,female,4,1,1,29103,23,,S
|
||||
1,3,Moor,male,6,0,1,392096,12.475,E121,S
|
||||
0,3,Vande,male,33,0,0,345780,9.5,,S
|
||||
0,3,Jonkoff,male,23,0,0,349204,7.8958,,S
|
||||
1,2,Herman,female,48,1,2,220845,65,,S
|
||||
1,2,Hamalainen,male,0.67,1,1,250649,14.5,,S
|
||||
0,3,Carlsson,male,28,0,0,350042,7.7958,,S
|
||||
0,2,Bailey,male,18,0,0,29108,11.5,,S
|
||||
0,3,Theobald,male,34,0,0,363294,8.05,,S
|
||||
1,1,Rothes,female,33,0,0,110152,86.5,B77,S
|
||||
0,3,Nirva,male,41,0,0,SOTON/O2 3101272,7.125,,S
|
||||
1,3,Barah,male,20,0,0,2663,7.2292,,C
|
||||
1,1,Carter,female,36,1,2,113760,120,B96 B98,S
|
||||
0,3,Eklund,male,16,0,0,347074,7.775,,S
|
||||
1,1,Hogeboom,female,51,1,0,13502,77.9583,D11,S
|
||||
0,3,Mangan,female,30.5,0,0,364850,7.75,,Q
|
||||
0,3,Gronnestad,male,32,0,0,8471,8.3625,,S
|
||||
0,3,Lievens,male,24,0,0,345781,9.5,,S
|
||||
0,3,Jensen,male,48,0,0,350047,7.8542,,S
|
||||
0,2,Mack,female,57,0,0,S.O./P.P. 3,10.5,E77,S
|
||||
1,2,Hocking,female,54,1,3,29105,23,,S
|
||||
0,3,Myhrman,male,18,0,0,347078,7.75,,S
|
||||
1,3,Emanuel,female,5,0,0,364516,12.475,,S
|
||||
1,1,Robert,female,43,0,1,24160,211.3375,B3,S
|
||||
1,3,Ayoub,female,13,0,0,2687,7.2292,,C
|
||||
1,1,Dick,female,17,1,0,17474,57,B20,S
|
||||
0,1,Long,male,29,0,0,113501,30,D6,S
|
||||
0,3,Ali,male,25,0,0,SOTON/O.Q. 3101312,7.05,,S
|
||||
0,3,Harmer,male,25,0,0,374887,7.25,,S
|
||||
1,3,Sjoblom,female,18,0,0,3101265,7.4958,,S
|
||||
0,3,Rice,male,8,4,1,382652,29.125,,Q
|
||||
1,3,Dean,male,1,1,2,C.A. 2315,20.575,,S
|
||||
0,1,Guggenheim,male,46,0,0,PC 17593,79.2,B82 B84,C
|
||||
0,2,Gaskell,male,16,0,0,239865,26,,S
|
||||
0,3,Dantcheff,male,25,0,0,349203,7.8958,,S
|
||||
0,2,Otter,male,39,0,0,28213,13,,S
|
||||
1,1,Leader,female,49,0,0,17465,25.9292,D17,S
|
||||
1,3,Osman,female,31,0,0,349244,8.6833,,S
|
||||
0,3,Ibrahim,male,30,0,0,2685,7.2292,,C
|
||||
0,3,Van,female,30,1,1,345773,24.15,,S
|
||||
0,2,Ponesell,male,34,0,0,250647,13,,S
|
||||
1,2,Collyer,female,31,1,1,C.A. 31921,26.25,,S
|
||||
1,1,Carter,male,11,1,2,113760,120,B96 B98,S
|
||||
1,3,Thomas,male,0.42,0,1,2625,8.5167,,C
|
||||
1,3,Hedman,male,27,0,0,347089,6.975,,S
|
||||
0,3,Johansson,male,31,0,0,347063,7.775,,S
|
||||
0,1,Andrews,male,39,0,0,112050,0,A36,S
|
||||
0,3,Pettersson,female,18,0,0,347087,7.775,,S
|
||||
0,2,Meyer,male,39,0,0,248723,13,,S
|
||||
1,1,Chambers,female,33,1,0,113806,53.1,E8,S
|
||||
0,3,Alexander,male,26,0,0,3474,7.8875,,S
|
||||
0,3,Lester,male,39,0,0,A/4 48871,24.15,,S
|
||||
0,2,Slemen,male,35,0,0,28206,10.5,,S
|
||||
0,3,Andersson,female,6,4,2,347082,31.275,,S
|
||||
0,3,Tomlin,male,30.5,0,0,364499,8.05,,S
|
||||
0,3,Heininen,female,23,0,0,STON/O2. 3101290,7.925,,S
|
||||
0,2,Mallet,male,31,1,1,S.C./PARIS 2079,37.0042,,C
|
||||
0,3,Holm,male,43,0,0,C 7075,6.45,,S
|
||||
0,3,Skoog,male,10,3,2,347088,27.9,,S
|
||||
1,1,Hays,female,52,1,1,12749,93.5,B69,S
|
||||
1,3,Lulic,male,27,0,0,315098,8.6625,,S
|
||||
0,1,Reuchlin,male,38,0,0,19972,0,,S
|
||||
1,3,Moor,female,27,0,1,392096,12.475,E121,S
|
||||
0,3,Panula,male,2,4,1,3101295,39.6875,,S
|
||||
1,2,Mallet,male,1,0,2,S.C./PARIS 2079,37.0042,,C
|
||||
1,1,Stone,female,62,0,0,113572,80,B28,
|
||||
1,3,Yasbeck,female,15,1,0,2659,14.4542,,C
|
||||
1,2,Richards,male,0.83,1,1,29106,18.75,,S
|
||||
0,3,Augustsson,male,23,0,0,347468,7.8542,,S
|
||||
0,3,Allum,male,18,0,0,2223,8.3,,S
|
||||
1,1,Compton,female,39,1,1,PC 17756,83.1583,E49,C
|
||||
0,3,Pasic,male,21,0,0,315097,8.6625,,S
|
||||
1,3,Chip,male,32,0,0,1601,56.4958,,S
|
||||
0,3,Alhomaki,male,20,0,0,SOTON/O2 3101287,7.925,,S
|
||||
0,2,Mudd,male,16,0,0,S.O./P.P. 3,10.5,,S
|
||||
1,1,Serepeca,female,30,0,0,113798,31,,C
|
||||
0,3,Lemberopolous,male,34.5,0,0,2683,6.4375,,C
|
||||
0,3,Culumovic,male,17,0,0,315090,8.6625,,S
|
||||
0,3,Abbing,male,42,0,0,C.A. 5547,7.55,,S
|
||||
0,3,Markoff,male,35,0,0,349213,7.8958,,C
|
||||
0,2,Harper,male,28,0,1,248727,33,,S
|
||||
0,3,Andersson,male,4,4,2,347082,31.275,,S
|
||||
0,3,Svensson,male,74,0,0,347060,7.775,,S
|
||||
0,3,Boulos,female,9,1,1,2678,15.2458,,C
|
||||
1,1,Lines,female,16,0,1,PC 17592,39.4,D28,S
|
||||
0,2,Carter,female,44,1,0,244252,26,,S
|
||||
1,3,Aks,female,18,0,1,392091,9.35,,S
|
||||
1,1,Wick,female,45,1,1,36928,164.8667,,S
|
||||
1,1,Daly,male,51,0,0,113055,26.55,E17,S
|
||||
1,3,Baclini,female,24,0,3,2666,19.2583,,C
|
||||
0,3,Hansen,male,41,2,0,350026,14.1083,,S
|
||||
0,2,Giles,male,21,1,0,28134,11.5,,S
|
||||
1,1,Swift,female,48,0,0,17466,25.9292,D17,S
|
||||
0,2,Gill,male,24,0,0,233866,13,,S
|
||||
1,2,Bystrom,female,42,0,0,236852,13,,S
|
||||
1,2,Duran,female,27,1,0,SC/PARIS 2149,13.8583,,C
|
||||
0,1,Roebling,male,31,0,0,PC 17590,50.4958,A24,S
|
||||
1,3,Johnson,male,4,1,1,347742,11.1333,,S
|
||||
0,3,Balkic,male,26,0,0,349248,7.8958,,S
|
||||
1,1,Beckwith,female,47,1,1,11751,52.5542,D35,S
|
||||
0,1,Carlsson,male,33,0,0,695,5,B51 B53 B55,S
|
||||
0,3,Vander,male,47,0,0,345765,9,,S
|
||||
1,2,Abelson,female,28,1,0,P/PP 3381,24,,C
|
||||
1,3,Najib,female,15,0,0,2667,7.225,,C
|
||||
0,3,Gustafsson,male,20,0,0,7534,9.8458,,S
|
||||
0,3,Petroff,male,19,0,0,349212,7.8958,,S
|
||||
1,1,Potter,female,56,0,1,11767,83.1583,C50,C
|
||||
1,2,Shelley,female,25,0,1,230433,26,,S
|
||||
0,3,Markun,male,33,0,0,349257,7.8958,,S
|
||||
0,3,Dahlberg,female,22,0,0,7552,10.5167,,S
|
||||
0,2,Banfield,male,28,0,0,C.A./SOTON 34068,10.5,,S
|
||||
0,3,Sutehall,male,25,0,0,SOTON/OQ 392076,7.05,,S
|
||||
0,3,Rice,female,39,0,5,382652,29.125,,Q
|
||||
0,2,Montvila,male,27,0,0,211536,13,,S
|
||||
1,1,Graham,female,19,0,0,112053,30,B42,S
|
||||
1,1,Behr,male,26,0,0,111369,30,C148,C
|
||||
0,3,Dooley,male,32,0,0,370376,7.75,,Q
|
||||
|
@@ -1,7 +1,9 @@
|
||||
import { OpenAI, LlamaDeuce, ChatMessage, DeuceChatStrategy } from "llamaindex";
|
||||
// @ts-ignore
|
||||
import * as readline from "node:readline/promises";
|
||||
import { stdin as input, stdout as output } from "node:process";
|
||||
// readline/promises is still experimental so not in @types/node yet
|
||||
// @ts-ignore
|
||||
import readline from "node:readline/promises";
|
||||
|
||||
import { ChatMessage, LlamaDeuce, OpenAI } from "llamaindex";
|
||||
|
||||
(async () => {
|
||||
const gpt4 = new OpenAI({ model: "gpt-4", temperature: 0.9 });
|
||||
@@ -27,7 +29,7 @@ import { stdin as input, stdout as output } from "node:process";
|
||||
history.map(({ content, role }) => ({
|
||||
content,
|
||||
role: next === l2 ? role : role === "user" ? "assistant" : "user",
|
||||
}))
|
||||
})),
|
||||
);
|
||||
history.push({
|
||||
content: r.message.content,
|
||||
|
||||
@@ -13,16 +13,13 @@ async function main() {
|
||||
chunkSize: 40,
|
||||
}),
|
||||
});
|
||||
const document = new Document({ text: essay });
|
||||
const index = await ListIndex.fromDocuments(
|
||||
[document],
|
||||
{ serviceContext }
|
||||
);
|
||||
const document = new Document({ text: essay, id_: "essay" });
|
||||
const index = await ListIndex.fromDocuments([document], { serviceContext });
|
||||
const queryEngine = index.asQueryEngine({
|
||||
retriever: index.asRetriever({ mode: ListRetrieverMode.LLM }),
|
||||
});
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do growing up?"
|
||||
"What did the author do growing up?",
|
||||
);
|
||||
console.log(response.toString());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "0.0.15",
|
||||
"version": "0.0.16",
|
||||
"private": true,
|
||||
"name": "simple",
|
||||
"dependencies": {
|
||||
|
||||
+1
-2
@@ -1,10 +1,9 @@
|
||||
import fs from "fs/promises";
|
||||
import { PDFReader, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
// Load PDF
|
||||
const reader = new PDFReader();
|
||||
const documents = await reader.loadData("examples/brk-2022.pdf");
|
||||
const documents = await reader.loadData("data/brk-2022.pdf");
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const index = await VectorStoreIndex.fromDocuments(documents);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import fs from "fs/promises";
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
import { SentenceSplitter } from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
const essay = await fs.readFile(
|
||||
"node_modules/llamaindex/examples/abramov.txt",
|
||||
"utf-8"
|
||||
);
|
||||
const path = "node_modules/llamaindex/examples/abramov.txt";
|
||||
const essay = await fs.readFile(path, "utf-8");
|
||||
|
||||
const textSplitter = new SentenceSplitter();
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import {
|
||||
Document,
|
||||
VectorStoreIndex,
|
||||
storageContextFromDefaults,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
import essay from "./essay";
|
||||
|
||||
async function main() {
|
||||
// Create Document object with essay
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: "essay" });
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
// persist the vector store automatically with the storage context
|
||||
@@ -21,7 +21,7 @@ async function main() {
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?"
|
||||
"What did the author do in college?",
|
||||
);
|
||||
|
||||
// Output response
|
||||
@@ -36,7 +36,7 @@ async function main() {
|
||||
});
|
||||
const loadedQueryEngine = loadedIndex.asQueryEngine();
|
||||
const loadedResponse = await loadedQueryEngine.query(
|
||||
"What did the author do growing up?"
|
||||
"What did the author do growing up?",
|
||||
);
|
||||
console.log(loadedResponse.toString());
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Document, VectorStoreIndex, SubQuestionQueryEngine } from "llamaindex";
|
||||
import { Document, SubQuestionQueryEngine, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
import essay from "./essay";
|
||||
|
||||
(async () => {
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: essay });
|
||||
const index = await VectorStoreIndex.fromDocuments([document]);
|
||||
|
||||
const queryEngine = SubQuestionQueryEngine.fromDefaults({
|
||||
@@ -19,7 +19,7 @@ import essay from "./essay";
|
||||
});
|
||||
|
||||
const response = await queryEngine.query(
|
||||
"How was Paul Grahams life different before and after YC?"
|
||||
"How was Paul Grahams life different before and after YC?",
|
||||
);
|
||||
|
||||
console.log(response.toString());
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import fs from "fs/promises";
|
||||
import fs from "node: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"
|
||||
);
|
||||
const path = "node_modules/llamaindex/examples/abramov.txt";
|
||||
|
||||
const essay = await fs.readFile(path, "utf-8");
|
||||
|
||||
// Create Document object with essay
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: path });
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const index = await VectorStoreIndex.fromDocuments([document]);
|
||||
@@ -17,7 +17,7 @@ async function main() {
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?"
|
||||
"What did the author do in college?",
|
||||
);
|
||||
|
||||
// Output response
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import fs from "fs/promises";
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
import {
|
||||
Anthropic,
|
||||
Document,
|
||||
VectorStoreIndex,
|
||||
serviceContextFromDefaults,
|
||||
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"
|
||||
);
|
||||
const path = "node_modules/llamaindex/examples/abramov.txt";
|
||||
|
||||
const essay = await fs.readFile(path, "utf-8");
|
||||
|
||||
// Create Document object with essay
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: path });
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const serviceContext = serviceContextFromDefaults({ llm: new Anthropic() });
|
||||
@@ -25,7 +25,7 @@ async function main() {
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?"
|
||||
"What did the author do in college?",
|
||||
);
|
||||
|
||||
// Output response
|
||||
|
||||
@@ -1,23 +1,31 @@
|
||||
import { Document, VectorStoreIndex, RetrieverQueryEngine, OpenAI, serviceContextFromDefaults } from "llamaindex";
|
||||
import {
|
||||
Document,
|
||||
OpenAI,
|
||||
RetrieverQueryEngine,
|
||||
serviceContextFromDefaults,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
import essay from "./essay";
|
||||
|
||||
// Customize retrieval and query args
|
||||
async function main() {
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: "essay" });
|
||||
|
||||
const serviceContext = serviceContextFromDefaults(
|
||||
{ llm: new OpenAI({ model: "gpt-3.5-turbo", temperature: 0.0 }) }
|
||||
);
|
||||
const serviceContext = serviceContextFromDefaults({
|
||||
llm: new OpenAI({ model: "gpt-3.5-turbo", temperature: 0.0 }),
|
||||
});
|
||||
|
||||
const index = await VectorStoreIndex.fromDocuments([document], {
|
||||
serviceContext,
|
||||
});
|
||||
|
||||
const index = await VectorStoreIndex.fromDocuments([document], { serviceContext });
|
||||
|
||||
const retriever = index.asRetriever();
|
||||
retriever.similarityTopK = 5;
|
||||
// TODO: cannot pass responseSynthesizer into retriever query engine
|
||||
const queryEngine = new RetrieverQueryEngine(retriever);
|
||||
|
||||
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do growing up?"
|
||||
"What did the author do growing up?",
|
||||
);
|
||||
console.log(response.response);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
import fs from "fs/promises";
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
import {
|
||||
OpenAI,
|
||||
Document,
|
||||
VectorStoreIndex,
|
||||
OpenAI,
|
||||
serviceContextFromDefaults,
|
||||
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"
|
||||
);
|
||||
const path = "node_modules/llamaindex/examples/abramov.txt";
|
||||
const essay = await fs.readFile(path, "utf-8");
|
||||
|
||||
// Create Document object with essay
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: path });
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const serviceContext = serviceContextFromDefaults({
|
||||
@@ -27,7 +26,7 @@ async function main() {
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?"
|
||||
"What did the author do in college?",
|
||||
);
|
||||
|
||||
// Output response
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
package-lock.json
|
||||
+10
-9
@@ -1,22 +1,23 @@
|
||||
// @ts-ignore
|
||||
import * as readline from "node:readline/promises";
|
||||
// @ts-ignore
|
||||
import { stdin as input, stdout as output } from "node:process";
|
||||
// readline/promises is still experimental so not in @types/node yet
|
||||
// @ts-ignore
|
||||
import readline from "node:readline/promises";
|
||||
|
||||
import {
|
||||
Document,
|
||||
VectorStoreIndex,
|
||||
ContextChatEngine,
|
||||
Document,
|
||||
serviceContextFromDefaults,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
|
||||
import essay from "./essay";
|
||||
|
||||
async function main() {
|
||||
const document = new Document({ text: essay });
|
||||
const serviceContext = serviceContextFromDefaults({ chunkSize: 512 });
|
||||
const index = await VectorStoreIndex.fromDocuments(
|
||||
[document],
|
||||
{ serviceContext }
|
||||
);
|
||||
const index = await VectorStoreIndex.fromDocuments([document], {
|
||||
serviceContext,
|
||||
});
|
||||
const retriever = index.asRetriever();
|
||||
retriever.similarityTopK = 5;
|
||||
const chatEngine = new ContextChatEngine({ retriever });
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import {
|
||||
CompactAndRefine,
|
||||
OpenAI,
|
||||
PapaCSVReader,
|
||||
ResponseSynthesizer,
|
||||
serviceContextFromDefaults,
|
||||
SimplePrompt,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
// Load CSV
|
||||
const reader = new PapaCSVReader();
|
||||
const path = "data/titanic_train.csv";
|
||||
const documents = await reader.loadData(path);
|
||||
|
||||
const serviceContext = serviceContextFromDefaults({
|
||||
llm: new OpenAI({ model: "gpt-4" }),
|
||||
});
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const index = await VectorStoreIndex.fromDocuments(documents, {
|
||||
serviceContext,
|
||||
});
|
||||
|
||||
const csvPrompt: SimplePrompt = (input) => {
|
||||
const { context = "", query = "" } = input;
|
||||
|
||||
return `The following CSV file is loaded from ${path}
|
||||
\`\`\`csv
|
||||
${context}
|
||||
\`\`\`
|
||||
Given the CSV file, generate me Typescript code to answer the question: ${query}. You can use built in NodeJS functions but avoid using third party libraries.
|
||||
`;
|
||||
};
|
||||
|
||||
const responseSynthesizer = new ResponseSynthesizer({
|
||||
responseBuilder: new CompactAndRefine(serviceContext, csvPrompt),
|
||||
});
|
||||
|
||||
const queryEngine = index.asQueryEngine({ responseSynthesizer });
|
||||
|
||||
// Query the index
|
||||
const response = await queryEngine.query(
|
||||
"What is the correlation between survival and age?",
|
||||
);
|
||||
|
||||
// Output response
|
||||
console.log(response.toString());
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
Binary file not shown.
@@ -0,0 +1,715 @@
|
||||
survived,pclass,name,sex,age,sibsp,parch,ticket,fare,cabin,embarked
|
||||
0,3,Braund,male,22,1,0,A/5 21171,7.25,,S
|
||||
1,1,Cumings,female,38,1,0,PC 17599,71.2833,C85,C
|
||||
1,3,Heikkinen,female,26,0,0,STON/O2. 3101282,7.925,,S
|
||||
1,1,Futrelle,female,35,1,0,113803,53.1,C123,S
|
||||
0,3,Allen,male,35,0,0,373450,8.05,,S
|
||||
0,1,McCarthy,male,54,0,0,17463,51.8625,E46,S
|
||||
0,3,Palsson,male,2,3,1,349909,21.075,,S
|
||||
1,3,Johnson,female,27,0,2,347742,11.1333,,S
|
||||
1,2,Nasser,female,14,1,0,237736,30.0708,,C
|
||||
1,3,Sandstrom,female,4,1,1,PP 9549,16.7,G6,S
|
||||
1,1,Bonnell,female,58,0,0,113783,26.55,C103,S
|
||||
0,3,Saundercock,male,20,0,0,A/5. 2151,8.05,,S
|
||||
0,3,Andersson,male,39,1,5,347082,31.275,,S
|
||||
0,3,Vestrom,female,14,0,0,350406,7.8542,,S
|
||||
1,2,Hewlett,female,55,0,0,248706,16,,S
|
||||
0,3,Rice,male,2,4,1,382652,29.125,,Q
|
||||
0,3,Vander,female,31,1,0,345763,18,,S
|
||||
0,2,Fynney,male,35,0,0,239865,26,,S
|
||||
1,2,Beesley,male,34,0,0,248698,13,D56,S
|
||||
1,3,McGowan,female,15,0,0,330923,8.0292,,Q
|
||||
1,1,Sloper,male,28,0,0,113788,35.5,A6,S
|
||||
0,3,Palsson,female,8,3,1,349909,21.075,,S
|
||||
1,3,Asplund,female,38,1,5,347077,31.3875,,S
|
||||
0,1,Fortune,male,19,3,2,19950,263,C23 C25 C27,S
|
||||
0,1,Uruchurtu,male,40,0,0,PC 17601,27.7208,,C
|
||||
0,2,Wheadon,male,66,0,0,C.A. 24579,10.5,,S
|
||||
0,1,Meyer,male,28,1,0,PC 17604,82.1708,,C
|
||||
0,1,Holverson,male,42,1,0,113789,52,,S
|
||||
0,3,Cann,male,21,0,0,A./5. 2152,8.05,,S
|
||||
0,3,Vander,female,18,2,0,345764,18,,S
|
||||
1,3,Nicola-Yarred,female,14,1,0,2651,11.2417,,C
|
||||
0,3,Ahlin,female,40,1,0,7546,9.475,,S
|
||||
0,2,Turpin,female,27,1,0,11668,21,,S
|
||||
1,2,Laroche,female,3,1,2,SC/Paris 2123,41.5792,,C
|
||||
1,3,Devaney,female,19,0,0,330958,7.8792,,Q
|
||||
0,3,Arnold-Franchi,female,18,1,0,349237,17.8,,S
|
||||
0,3,Panula,male,7,4,1,3101295,39.6875,,S
|
||||
0,3,Nosworthy,male,21,0,0,A/4. 39886,7.8,,S
|
||||
1,1,Harper,female,49,1,0,PC 17572,76.7292,D33,C
|
||||
1,2,Faunthorpe,female,29,1,0,2926,26,,S
|
||||
0,1,Ostby,male,65,0,1,113509,61.9792,B30,C
|
||||
1,2,Rugg,female,21,0,0,C.A. 31026,10.5,,S
|
||||
0,3,Novel,male,28.5,0,0,2697,7.2292,,C
|
||||
1,2,West,female,5,1,2,C.A. 34651,27.75,,S
|
||||
0,3,Goodwin,male,11,5,2,CA 2144,46.9,,S
|
||||
0,3,Sirayanian,male,22,0,0,2669,7.2292,,C
|
||||
1,1,Icard,female,38,0,0,113572,80,B28,
|
||||
0,1,Harris,male,45,1,0,36973,83.475,C83,S
|
||||
0,3,Skoog,male,4,3,2,347088,27.9,,S
|
||||
1,2,Nye,female,29,0,0,C.A. 29395,10.5,F33,S
|
||||
0,3,Crease,male,19,0,0,S.P. 3464,8.1583,,S
|
||||
1,3,Andersson,female,17,4,2,3101281,7.925,,S
|
||||
0,3,Kink,male,26,2,0,315151,8.6625,,S
|
||||
0,2,Jenkin,male,32,0,0,C.A. 33111,10.5,,S
|
||||
0,3,Goodwin,female,16,5,2,CA 2144,46.9,,S
|
||||
0,2,Hood,male,21,0,0,S.O.C. 14879,73.5,,S
|
||||
0,3,Chronopoulos,male,26,1,0,2680,14.4542,,C
|
||||
1,3,Bing,male,32,0,0,1601,56.4958,,S
|
||||
0,3,Moen,male,25,0,0,348123,7.65,F G73,S
|
||||
1,2,Caldwell,male,0.83,0,2,248738,29,,S
|
||||
1,3,Dowdell,female,30,0,0,364516,12.475,,S
|
||||
0,3,Waelens,male,22,0,0,345767,9,,S
|
||||
1,3,Sheerlinck,male,29,0,0,345779,9.5,,S
|
||||
0,1,Carrau,male,28,0,0,113059,47.1,,S
|
||||
1,2,Ilett,female,17,0,0,SO/C 14885,10.5,,S
|
||||
1,3,Backstrom,female,33,3,0,3101278,15.85,,S
|
||||
0,3,Ford,male,16,1,3,W./C. 6608,34.375,,S
|
||||
1,1,Fortune,female,23,3,2,19950,263,C23 C25 C27,S
|
||||
0,3,Celotti,male,24,0,0,343275,8.05,,S
|
||||
0,3,Christmann,male,29,0,0,343276,8.05,,S
|
||||
0,3,Andreasson,male,20,0,0,347466,7.8542,,S
|
||||
0,1,Chaffee,male,46,1,0,W.E.P. 5734,61.175,E31,S
|
||||
0,3,Dean,male,26,1,2,C.A. 2315,20.575,,S
|
||||
0,3,Coxon,male,59,0,0,364500,7.25,,S
|
||||
0,1,Goldschmidt,male,71,0,0,PC 17754,34.6542,A5,C
|
||||
1,1,Greenfield,male,23,0,1,PC 17759,63.3583,D10 D12,C
|
||||
1,2,Doling,female,34,0,1,231919,23,,S
|
||||
0,2,Kantor,male,34,1,0,244367,26,,S
|
||||
0,3,Petranec,female,28,0,0,349245,7.8958,,S
|
||||
0,1,White,male,21,0,1,35281,77.2875,D26,S
|
||||
0,3,Johansson,male,33,0,0,7540,8.6542,,S
|
||||
0,3,Gustafsson,male,37,2,0,3101276,7.925,,S
|
||||
0,3,Mionoff,male,28,0,0,349207,7.8958,,S
|
||||
1,3,Salkjelsvik,female,21,0,0,343120,7.65,,S
|
||||
0,3,Rekic,male,38,0,0,349249,7.8958,,S
|
||||
0,1,Porter,male,47,0,0,110465,52,C110,S
|
||||
0,3,Zabour,female,14.5,1,0,2665,14.4542,,C
|
||||
0,3,Barton,male,22,0,0,324669,8.05,,S
|
||||
0,3,Jussila,female,20,1,0,4136,9.825,,S
|
||||
0,3,Attalah,female,17,0,0,2627,14.4583,,C
|
||||
0,3,Pekoniemi,male,21,0,0,STON/O 2. 3101294,7.925,,S
|
||||
0,3,Connors,male,70.5,0,0,370369,7.75,,Q
|
||||
0,2,Turpin,male,29,1,0,11668,21,,S
|
||||
0,1,Baxter,male,24,0,1,PC 17558,247.5208,B58 B60,C
|
||||
0,3,Andersson,female,2,4,2,347082,31.275,,S
|
||||
0,2,Hickman,male,21,2,0,S.O.C. 14879,73.5,,S
|
||||
0,2,Nasser,male,32.5,1,0,237736,30.0708,,C
|
||||
1,2,Webber,female,32.5,0,0,27267,13,E101,S
|
||||
0,1,White,male,54,0,1,35281,77.2875,D26,S
|
||||
1,3,Nicola-Yarred,male,12,1,0,2651,11.2417,,C
|
||||
1,3,Madsen,male,24,0,0,C 17369,7.1417,,S
|
||||
0,3,Ekstrom,male,45,0,0,347061,6.975,,S
|
||||
0,3,Drazenoic,male,33,0,0,349241,7.8958,,C
|
||||
0,3,Coelho,male,20,0,0,SOTON/O.Q. 3101307,7.05,,S
|
||||
0,3,Robins,female,47,1,0,A/5. 3337,14.5,,S
|
||||
1,2,Weisz,female,29,1,0,228414,26,,S
|
||||
0,2,Sobey,male,25,0,0,C.A. 29178,13,,S
|
||||
0,2,Richard,male,23,0,0,SC/PARIS 2133,15.0458,,C
|
||||
1,1,Newsom,female,19,0,2,11752,26.2833,D47,S
|
||||
0,1,Futrelle,male,37,1,0,113803,53.1,C123,S
|
||||
0,3,Osen,male,16,0,0,7534,9.2167,,S
|
||||
0,1,Giglio,male,24,0,0,PC 17593,79.2,B86,C
|
||||
1,3,Nysten,female,22,0,0,347081,7.75,,S
|
||||
1,3,Hakkarainen,female,24,1,0,STON/O2. 3101279,15.85,,S
|
||||
0,3,Burke,male,19,0,0,365222,6.75,,Q
|
||||
0,2,Andrew,male,18,0,0,231945,11.5,,S
|
||||
0,2,Nicholls,male,19,1,1,C.A. 33112,36.75,,S
|
||||
1,3,Andersson,male,27,0,0,350043,7.7958,,S
|
||||
0,3,Ford,female,9,2,2,W./C. 6608,34.375,,S
|
||||
0,2,Navratil,male,36.5,0,2,230080,26,F2,S
|
||||
0,2,Byles,male,42,0,0,244310,13,,S
|
||||
0,2,Bateman,male,51,0,0,S.O.P. 1166,12.525,,S
|
||||
1,1,Pears,female,22,1,0,113776,66.6,C2,S
|
||||
0,3,Meo,male,55.5,0,0,A.5. 11206,8.05,,S
|
||||
0,3,van,male,40.5,0,2,A/5. 851,14.5,,S
|
||||
0,1,Williams,male,51,0,1,PC 17597,61.3792,,C
|
||||
1,3,Gilnagh,female,16,0,0,35851,7.7333,,Q
|
||||
0,3,Corn,male,30,0,0,SOTON/OQ 392090,8.05,,S
|
||||
0,3,Cribb,male,44,0,1,371362,16.1,,S
|
||||
1,2,Watt,female,40,0,0,C.A. 33595,15.75,,S
|
||||
0,3,Bengtsson,male,26,0,0,347068,7.775,,S
|
||||
0,3,Calic,male,17,0,0,315093,8.6625,,S
|
||||
0,3,Panula,male,1,4,1,3101295,39.6875,,S
|
||||
1,3,Goldsmith,male,9,0,2,363291,20.525,,S
|
||||
0,3,Skoog,female,45,1,4,347088,27.9,,S
|
||||
0,3,Ling,male,28,0,0,1601,56.4958,,S
|
||||
0,1,Van,male,61,0,0,111240,33.5,B19,S
|
||||
0,3,Rice,male,4,4,1,382652,29.125,,Q
|
||||
1,3,Johnson,female,1,1,1,347742,11.1333,,S
|
||||
0,3,Sivola,male,21,0,0,STON/O 2. 3101280,7.925,,S
|
||||
0,1,Smith,male,56,0,0,17764,30.6958,A7,C
|
||||
0,3,Klasen,male,18,1,1,350404,7.8542,,S
|
||||
0,1,Isham,female,50,0,0,PC 17595,28.7125,C49,C
|
||||
0,2,Hale,male,30,0,0,250653,13,,S
|
||||
0,3,Leonard,male,36,0,0,LINE,0,,S
|
||||
0,3,Asplund,male,9,4,2,347077,31.3875,,S
|
||||
1,2,Becker,male,1,2,1,230136,39,F4,S
|
||||
1,3,Kink-Heilmann,female,4,0,2,315153,22.025,,S
|
||||
1,1,Romaine,male,45,0,0,111428,26.55,,S
|
||||
0,3,Bourke,male,40,1,1,364849,15.5,,Q
|
||||
0,3,Turcin,male,36,0,0,349247,7.8958,,S
|
||||
1,2,Pinsky,female,32,0,0,234604,13,,S
|
||||
0,2,Carbines,male,19,0,0,28424,13,,S
|
||||
1,3,Andersen-Jensen,female,19,1,0,350046,7.8542,,S
|
||||
1,2,Navratil,male,3,1,1,230080,26,F2,S
|
||||
1,1,Brown,female,44,0,0,PC 17610,27.7208,B4,C
|
||||
1,1,Lurette,female,58,0,0,PC 17569,146.5208,B80,C
|
||||
0,3,Olsen,male,42,0,1,4579,8.4042,,S
|
||||
0,2,Yrois,female,24,0,0,248747,13,,S
|
||||
0,3,Vande,male,28,0,0,345770,9.5,,S
|
||||
0,3,Johanson,male,34,0,0,3101264,6.4958,,S
|
||||
0,3,Youseff,male,45.5,0,0,2628,7.225,,C
|
||||
1,3,Cohen,male,18,0,0,A/5 3540,8.05,,S
|
||||
0,3,Strom,female,2,0,1,347054,10.4625,G6,S
|
||||
0,3,Backstrom,male,32,1,0,3101278,15.85,,S
|
||||
1,3,Albimona,male,26,0,0,2699,18.7875,,C
|
||||
1,3,Carr,female,16,0,0,367231,7.75,,Q
|
||||
1,1,Blank,male,40,0,0,112277,31,A31,C
|
||||
0,3,Ali,male,24,0,0,SOTON/O.Q. 3101311,7.05,,S
|
||||
1,2,Cameron,female,35,0,0,F.C.C. 13528,21,,S
|
||||
0,3,Perkin,male,22,0,0,A/5 21174,7.25,,S
|
||||
0,2,Givard,male,30,0,0,250646,13,,S
|
||||
1,1,Newell,female,31,1,0,35273,113.275,D36,C
|
||||
1,3,Honkanen,female,27,0,0,STON/O2. 3101283,7.925,,S
|
||||
0,2,Jacobsohn,male,42,1,0,243847,27,,S
|
||||
1,1,Bazzani,female,32,0,0,11813,76.2917,D15,C
|
||||
0,2,Harris,male,30,0,0,W/C 14208,10.5,,S
|
||||
1,3,Sunderland,male,16,0,0,SOTON/OQ 392089,8.05,,S
|
||||
0,2,Bracken,male,27,0,0,220367,13,,S
|
||||
0,3,Green,male,51,0,0,21440,8.05,,S
|
||||
1,1,Hoyt,male,38,1,0,19943,90,C93,S
|
||||
0,3,Berglund,male,22,0,0,PP 4348,9.35,,S
|
||||
1,2,Mellors,male,19,0,0,SW/PP 751,10.5,,S
|
||||
0,3,Lovell,male,20.5,0,0,A/5 21173,7.25,,S
|
||||
0,2,Fahlstrom,male,18,0,0,236171,13,,S
|
||||
1,1,Harris,female,35,1,0,36973,83.475,C83,S
|
||||
0,3,Larsson,male,29,0,0,347067,7.775,,S
|
||||
0,2,Sjostedt,male,59,0,0,237442,13.5,,S
|
||||
1,3,Asplund,female,5,4,2,347077,31.3875,,S
|
||||
0,2,Leyson,male,24,0,0,C.A. 29566,10.5,,S
|
||||
0,2,Hold,male,44,1,0,26707,26,,S
|
||||
1,2,Collyer,female,8,0,2,C.A. 31921,26.25,,S
|
||||
0,2,Pengelly,male,19,0,0,28665,10.5,,S
|
||||
0,2,Hunt,male,33,0,0,SCO/W 1585,12.275,,S
|
||||
0,2,Coleridge,male,29,0,0,W./C. 14263,10.5,,S
|
||||
0,3,Maenpaa,male,22,0,0,STON/O 2. 3101275,7.125,,S
|
||||
0,3,Attalah,male,30,0,0,2694,7.225,,C
|
||||
0,1,Minahan,male,44,2,0,19928,90,C78,Q
|
||||
0,3,Lindahl,female,25,0,0,347071,7.775,,S
|
||||
1,2,Hamalainen,female,24,0,2,250649,14.5,,S
|
||||
1,1,Beckwith,male,37,1,1,11751,52.5542,D35,S
|
||||
0,2,Carter,male,54,1,0,244252,26,,S
|
||||
0,3,Strom,female,29,1,1,347054,10.4625,G6,S
|
||||
0,1,Stead,male,62,0,0,113514,26.55,C87,S
|
||||
0,3,Lobb,male,30,1,0,A/5. 3336,16.1,,S
|
||||
0,3,Rosblom,female,41,0,2,370129,20.2125,,S
|
||||
1,3,Touma,female,29,0,2,2650,15.2458,,C
|
||||
1,1,Cherry,female,30,0,0,110152,86.5,B77,S
|
||||
1,1,Ward,female,35,0,0,PC 17755,512.3292,,C
|
||||
1,2,Parrish,female,50,0,1,230433,26,,S
|
||||
1,3,Asplund,male,3,4,2,347077,31.3875,,S
|
||||
0,1,Taussig,male,52,1,1,110413,79.65,E67,S
|
||||
0,1,Harrison,male,40,0,0,112059,0,B94,S
|
||||
0,2,Reeves,male,36,0,0,C.A. 17248,10.5,,S
|
||||
0,3,Panula,male,16,4,1,3101295,39.6875,,S
|
||||
1,3,Persson,male,25,1,0,347083,7.775,,S
|
||||
1,1,Graham,female,58,0,1,PC 17582,153.4625,C125,S
|
||||
1,1,Bissette,female,35,0,0,PC 17760,135.6333,C99,S
|
||||
1,3,Tornquist,male,25,0,0,LINE,0,,S
|
||||
1,2,Mellinger,female,41,0,1,250644,19.5,,S
|
||||
0,1,Natsch,male,37,0,1,PC 17596,29.7,C118,C
|
||||
1,1,Andrews,female,63,1,0,13502,77.9583,D7,S
|
||||
0,3,Lindblom,female,45,0,0,347073,7.75,,S
|
||||
0,3,Rice,male,7,4,1,382652,29.125,,Q
|
||||
1,3,Abbott,female,35,1,1,C.A. 2673,20.25,,S
|
||||
0,3,Duane,male,65,0,0,336439,7.75,,Q
|
||||
0,3,Olsson,male,28,0,0,347464,7.8542,,S
|
||||
0,3,de,male,16,0,0,345778,9.5,,S
|
||||
1,3,Dorking,male,19,0,0,A/5. 10482,8.05,,S
|
||||
0,3,Stankovic,male,33,0,0,349239,8.6625,,C
|
||||
1,3,de,male,30,0,0,345774,9.5,,S
|
||||
0,3,Naidenoff,male,22,0,0,349206,7.8958,,S
|
||||
1,2,Hosono,male,42,0,0,237798,13,,S
|
||||
1,3,Connolly,female,22,0,0,370373,7.75,,Q
|
||||
1,1,Barber,female,26,0,0,19877,78.85,,S
|
||||
1,1,Bishop,female,19,1,0,11967,91.0792,B49,C
|
||||
0,2,Levy,male,36,0,0,SC/Paris 2163,12.875,D,C
|
||||
0,3,Haas,female,24,0,0,349236,8.85,,S
|
||||
0,3,Mineff,male,24,0,0,349233,7.8958,,S
|
||||
0,3,Hanna,male,23.5,0,0,2693,7.2292,,C
|
||||
0,1,Allison,female,2,1,2,113781,151.55,C22 C26,S
|
||||
1,1,Baxter,female,50,0,1,PC 17558,247.5208,B58 B60,C
|
||||
0,3,Johnson,male,19,0,0,LINE,0,,S
|
||||
1,1,Allison,male,0.92,1,2,113781,151.55,C22 C26,S
|
||||
1,1,Penasco,female,17,1,0,PC 17758,108.9,C65,C
|
||||
0,2,Abelson,male,30,1,0,P/PP 3381,24,,C
|
||||
1,1,Francatelli,female,30,0,0,PC 17485,56.9292,E36,C
|
||||
1,1,Hays,female,24,0,0,11767,83.1583,C54,C
|
||||
1,1,Ryerson,female,18,2,2,PC 17608,262.375,B57 B59 B63 B66,C
|
||||
0,2,Lahtinen,female,26,1,1,250651,26,,S
|
||||
0,3,Hendekovic,male,28,0,0,349243,7.8958,,S
|
||||
0,2,Hart,male,43,1,1,F.C.C. 13529,26.25,,S
|
||||
1,3,Nilsson,female,26,0,0,347470,7.8542,,S
|
||||
1,2,Kantor,female,24,1,0,244367,26,,S
|
||||
0,2,Moraweck,male,54,0,0,29011,14,,S
|
||||
1,1,Wick,female,31,0,2,36928,164.8667,C7,S
|
||||
1,1,Spedden,female,40,1,1,16966,134.5,E34,C
|
||||
0,3,Dennis,male,22,0,0,A/5 21172,7.25,,S
|
||||
0,3,Danoff,male,27,0,0,349219,7.8958,,S
|
||||
1,2,Slayter,female,30,0,0,234818,12.35,,Q
|
||||
1,2,Caldwell,female,22,1,1,248738,29,,S
|
||||
1,1,Young,female,36,0,0,PC 17760,135.6333,C32,C
|
||||
0,3,Nysveen,male,61,0,0,345364,6.2375,,S
|
||||
1,2,Ball,female,36,0,0,28551,13,D,S
|
||||
1,3,Goldsmith,female,31,1,1,363291,20.525,,S
|
||||
1,1,Hippach,female,16,0,1,111361,57.9792,B18,C
|
||||
0,1,Partner,male,45.5,0,0,113043,28.5,C124,S
|
||||
0,1,Graham,male,38,0,1,PC 17582,153.4625,C91,S
|
||||
0,3,Vander,male,16,2,0,345764,18,,S
|
||||
0,1,Pears,male,29,1,0,113776,66.6,C2,S
|
||||
1,1,Burns,female,41,0,0,16966,134.5,E40,C
|
||||
1,3,Dahl,male,45,0,0,7598,8.05,,S
|
||||
0,1,Blackwell,male,45,0,0,113784,35.5,T,S
|
||||
1,2,Navratil,male,2,1,1,230080,26,F2,S
|
||||
1,1,Fortune,female,24,3,2,19950,263,C23 C25 C27,S
|
||||
0,2,Collander,male,28,0,0,248740,13,,S
|
||||
0,2,Sedgwick,male,25,0,0,244361,13,,S
|
||||
0,2,Fox,male,36,0,0,229236,13,,S
|
||||
1,2,Brown,female,24,0,0,248733,13,F33,S
|
||||
1,2,Smith,female,40,0,0,31418,13,,S
|
||||
1,3,Coutts,male,3,1,1,C.A. 37671,15.9,,S
|
||||
0,3,Dimic,male,42,0,0,315088,8.6625,,S
|
||||
0,3,Odahl,male,23,0,0,7267,9.225,,S
|
||||
0,3,Elias,male,15,1,1,2695,7.2292,,C
|
||||
0,3,Arnold-Franchi,male,25,1,0,349237,17.8,,S
|
||||
0,3,Vanden,male,28,0,0,345783,9.5,,S
|
||||
1,1,Bowerman,female,22,0,1,113505,55,E33,S
|
||||
0,2,Funk,female,38,0,0,237671,13,,S
|
||||
0,3,Skoog,male,40,1,4,347088,27.9,,S
|
||||
0,2,del,male,29,1,0,SC/PARIS 2167,27.7208,,C
|
||||
0,3,Barbara,female,45,0,1,2691,14.4542,,C
|
||||
0,3,Asim,male,35,0,0,SOTON/O.Q. 3101310,7.05,,S
|
||||
0,3,Adahl,male,30,0,0,C 7076,7.25,,S
|
||||
1,1,Warren,female,60,1,0,110813,75.25,D37,C
|
||||
1,1,Aubart,female,24,0,0,PC 17477,69.3,B35,C
|
||||
1,1,Harder,male,25,1,0,11765,55.4417,E50,C
|
||||
0,3,Wiklund,male,18,1,0,3101267,6.4958,,S
|
||||
0,3,Beavan,male,19,0,0,323951,8.05,,S
|
||||
0,1,Ringhini,male,22,0,0,PC 17760,135.6333,,C
|
||||
0,3,Palsson,female,3,3,1,349909,21.075,,S
|
||||
1,3,Landergren,female,22,0,0,C 7077,7.25,,S
|
||||
0,1,Widener,male,27,0,2,113503,211.5,C82,C
|
||||
0,3,Betros,male,20,0,0,2648,4.0125,,C
|
||||
0,3,Gustafsson,male,19,0,0,347069,7.775,,S
|
||||
1,1,Bidois,female,42,0,0,PC 17757,227.525,,C
|
||||
1,3,Nakid,female,1,0,2,2653,15.7417,,C
|
||||
0,3,Tikkanen,male,32,0,0,STON/O 2. 3101293,7.925,,S
|
||||
1,1,Holverson,female,35,1,0,113789,52,,S
|
||||
0,2,Davies,male,18,0,0,S.O.C. 14879,73.5,,S
|
||||
0,3,Goodwin,male,1,5,2,CA 2144,46.9,,S
|
||||
1,2,Buss,female,36,0,0,27849,13,,S
|
||||
1,2,Lehmann,female,17,0,0,SC 1748,12,,C
|
||||
1,1,Carter,male,36,1,2,113760,120,B96 B98,S
|
||||
1,3,Jansson,male,21,0,0,350034,7.7958,,S
|
||||
0,3,Gustafsson,male,28,2,0,3101277,7.925,,S
|
||||
1,1,Newell,female,23,1,0,35273,113.275,D36,C
|
||||
1,3,Sandstrom,female,24,0,2,PP 9549,16.7,G6,S
|
||||
0,3,Johansson,male,22,0,0,350052,7.7958,,S
|
||||
0,3,Olsson,female,31,0,0,350407,7.8542,,S
|
||||
0,2,McKane,male,46,0,0,28403,26,,S
|
||||
0,2,Pain,male,23,0,0,244278,10.5,,S
|
||||
1,2,Trout,female,28,0,0,240929,12.65,,S
|
||||
1,3,Niskanen,male,39,0,0,STON/O 2. 3101289,7.925,,S
|
||||
0,3,Adams,male,26,0,0,341826,8.05,,S
|
||||
0,3,Jussila,female,21,1,0,4137,9.825,,S
|
||||
0,3,Hakkarainen,male,28,1,0,STON/O2. 3101279,15.85,,S
|
||||
0,3,Oreskovic,female,20,0,0,315096,8.6625,,S
|
||||
0,2,Gale,male,34,1,0,28664,21,,S
|
||||
0,3,Widegren,male,51,0,0,347064,7.75,,S
|
||||
1,2,Richards,male,3,1,1,29106,18.75,,S
|
||||
0,3,Birkeland,male,21,0,0,312992,7.775,,S
|
||||
1,1,Minahan,female,33,1,0,19928,90,C78,Q
|
||||
1,3,Sundman,male,44,0,0,STON/O 2. 3101269,7.925,,S
|
||||
1,2,Drew,female,34,1,1,28220,32.5,,S
|
||||
1,2,Silven,female,18,0,2,250652,13,,S
|
||||
0,2,Matthews,male,30,0,0,28228,13,,S
|
||||
0,3,Van,female,10,0,2,345773,24.15,,S
|
||||
0,3,Charters,male,21,0,0,A/5. 13032,7.7333,,Q
|
||||
0,3,Zimmerman,male,29,0,0,315082,7.875,,S
|
||||
0,3,Danbom,female,28,1,1,347080,14.4,,S
|
||||
0,3,Rosblom,male,18,1,1,370129,20.2125,,S
|
||||
1,2,Clarke,female,28,1,0,2003,26,,S
|
||||
1,2,Phillips,female,19,0,0,250655,26,,S
|
||||
1,3,Pickard,male,32,0,0,SOTON/O.Q. 392078,8.05,E10,S
|
||||
1,1,Bjornstrom-Steffansson,male,28,0,0,110564,26.55,C52,S
|
||||
1,2,Louch,female,42,1,0,SC/AH 3085,26,,S
|
||||
0,3,Kallio,male,17,0,0,STON/O 2. 3101274,7.125,,S
|
||||
0,1,Silvey,male,50,1,0,13507,55.9,E44,S
|
||||
1,1,Carter,female,14,1,2,113760,120,B96 B98,S
|
||||
0,3,Ford,female,21,2,2,W./C. 6608,34.375,,S
|
||||
1,2,Richards,female,24,2,3,29106,18.75,,S
|
||||
0,1,Fortune,male,64,1,4,19950,263,C23 C25 C27,S
|
||||
0,2,Kvillner,male,31,0,0,C.A. 18723,10.5,,S
|
||||
1,2,Hart,female,45,1,1,F.C.C. 13529,26.25,,S
|
||||
0,3,Hampe,male,20,0,0,345769,9.5,,S
|
||||
0,3,Petterson,male,25,1,0,347076,7.775,,S
|
||||
1,2,Reynaldo,female,28,0,0,230434,13,,S
|
||||
1,1,Dodge,male,4,0,2,33638,81.8583,A34,S
|
||||
1,2,Mellinger,female,13,0,1,250644,19.5,,S
|
||||
1,1,Seward,male,34,0,0,113794,26.55,,S
|
||||
1,3,Baclini,female,5,2,1,2666,19.2583,,C
|
||||
1,1,Peuchen,male,52,0,0,113786,30.5,C104,S
|
||||
0,2,West,male,36,1,2,C.A. 34651,27.75,,S
|
||||
0,1,Foreman,male,30,0,0,113051,27.75,C111,C
|
||||
1,1,Goldenberg,male,49,1,0,17453,89.1042,C92,C
|
||||
1,3,Jalsevac,male,29,0,0,349240,7.8958,,C
|
||||
0,1,Millet,male,65,0,0,13509,26.55,E38,S
|
||||
1,2,Toomey,female,50,0,0,F.C.C. 13531,10.5,,S
|
||||
1,1,Anderson,male,48,0,0,19952,26.55,E12,S
|
||||
0,3,Morley,male,34,0,0,364506,8.05,,S
|
||||
0,1,Gee,male,47,0,0,111320,38.5,E63,S
|
||||
0,2,Milling,male,48,0,0,234360,13,,S
|
||||
0,3,Goncalves,male,38,0,0,SOTON/O.Q. 3101306,7.05,,S
|
||||
0,1,Smart,male,56,0,0,113792,26.55,,S
|
||||
1,3,Baclini,female,0.75,2,1,2666,19.2583,,C
|
||||
0,3,Cacic,male,38,0,0,315089,8.6625,,S
|
||||
1,2,West,female,33,1,2,C.A. 34651,27.75,,S
|
||||
1,2,Jerwan,female,23,0,0,SC/AH Basle 541,13.7917,D,C
|
||||
0,3,Strandberg,female,22,0,0,7553,9.8375,,S
|
||||
0,2,Renouf,male,34,1,0,31027,21,,S
|
||||
0,3,Braund,male,29,1,0,3460,7.0458,,S
|
||||
0,3,Karlsson,male,22,0,0,350060,7.5208,,S
|
||||
1,3,Hirvonen,female,2,0,1,3101298,12.2875,,S
|
||||
0,3,Goodwin,male,9,5,2,CA 2144,46.9,,S
|
||||
0,3,Rouse,male,50,0,0,A/5 3594,8.05,,S
|
||||
1,3,Turkula,female,63,0,0,4134,9.5875,,S
|
||||
1,1,Bishop,male,25,1,0,11967,91.0792,B49,C
|
||||
1,1,Hoyt,female,35,1,0,19943,90,C93,S
|
||||
0,1,Kent,male,58,0,0,11771,29.7,B37,C
|
||||
0,3,Somerton,male,30,0,0,A.5. 18509,8.05,,S
|
||||
1,3,Coutts,male,9,1,1,C.A. 37671,15.9,,S
|
||||
0,3,Windelov,male,21,0,0,SOTON/OQ 3101317,7.25,,S
|
||||
0,1,Molson,male,55,0,0,113787,30.5,C30,S
|
||||
0,1,Artagaveytia,male,71,0,0,PC 17609,49.5042,,C
|
||||
0,3,Stanley,male,21,0,0,A/4 45380,8.05,,S
|
||||
1,1,Eustis,female,54,1,0,36947,78.2667,D20,C
|
||||
0,1,Allison,female,25,1,2,113781,151.55,C22 C26,S
|
||||
0,3,Svensson,male,24,0,0,350035,7.7958,,S
|
||||
0,3,Calic,male,17,0,0,315086,8.6625,,S
|
||||
0,3,Canavan,female,21,0,0,364846,7.75,,Q
|
||||
0,3,Laitinen,female,37,0,0,4135,9.5875,,S
|
||||
1,1,Maioni,female,16,0,0,110152,86.5,B79,S
|
||||
0,1,Penasco,male,18,1,0,PC 17758,108.9,C65,C
|
||||
1,2,Quick,female,33,0,2,26360,26,,S
|
||||
0,3,Olsen,male,28,0,0,C 4001,22.525,,S
|
||||
1,3,Lang,male,26,0,0,1601,56.4958,,S
|
||||
1,3,Daly,male,29,0,0,382651,7.75,,Q
|
||||
1,1,McGough,male,36,0,0,PC 17473,26.2875,E25,S
|
||||
1,1,Rothschild,female,54,1,0,PC 17603,59.4,,C
|
||||
0,3,Coleff,male,24,0,0,349209,7.4958,,S
|
||||
0,1,Walker,male,47,0,0,36967,34.0208,D46,S
|
||||
1,2,Lemore,female,34,0,0,C.A. 34260,10.5,F33,S
|
||||
1,2,Angle,female,36,1,0,226875,26,,S
|
||||
0,3,Pavlovic,male,32,0,0,349242,7.8958,,S
|
||||
1,1,Perreault,female,30,0,0,12749,93.5,B73,S
|
||||
0,3,Vovk,male,22,0,0,349252,7.8958,,S
|
||||
1,1,Hippach,female,44,0,1,111361,57.9792,B18,C
|
||||
0,3,Farrell,male,40.5,0,0,367232,7.75,,Q
|
||||
1,2,Ridsdale,female,50,0,0,W./C. 14258,10.5,,S
|
||||
0,3,Salonen,male,39,0,0,3101296,7.925,,S
|
||||
0,2,Hocking,male,23,2,1,29104,11.5,,S
|
||||
1,2,Quick,female,2,1,1,26360,26,,S
|
||||
0,3,Elias,male,17,1,1,2690,7.2292,,C
|
||||
0,3,Cacic,female,30,0,0,315084,8.6625,,S
|
||||
1,2,Hart,female,7,0,2,F.C.C. 13529,26.25,,S
|
||||
0,1,Butt,male,45,0,0,113050,26.55,B38,S
|
||||
1,1,LeRoy,female,30,0,0,PC 17761,106.425,,C
|
||||
1,1,Frolicher,female,22,0,2,13568,49.5,B39,C
|
||||
1,1,Crosby,female,36,0,2,WE/P 5735,71,B22,S
|
||||
0,3,Andersson,female,9,4,2,347082,31.275,,S
|
||||
0,3,Andersson,female,11,4,2,347082,31.275,,S
|
||||
1,2,Beane,male,32,1,0,2908,26,,S
|
||||
0,1,Douglas,male,50,1,0,PC 17761,106.425,C86,C
|
||||
0,1,Nicholson,male,64,0,0,693,26,,S
|
||||
1,2,Beane,female,19,1,0,2908,26,,S
|
||||
0,3,Goldsmith,male,33,1,1,363291,20.525,,S
|
||||
1,2,Davies,male,8,1,1,C.A. 33112,36.75,,S
|
||||
1,1,Thayer,male,17,0,2,17421,110.8833,C70,C
|
||||
0,2,Sharp,male,27,0,0,244358,26,,S
|
||||
1,3,Leeni,male,22,0,0,2620,7.225,,C
|
||||
1,3,Ohman,female,22,0,0,347085,7.775,,S
|
||||
0,1,Wright,male,62,0,0,113807,26.55,,S
|
||||
1,1,Duff,female,48,1,0,11755,39.6,A16,C
|
||||
1,1,Taussig,female,39,1,1,110413,79.65,E67,S
|
||||
1,3,de,female,36,1,0,345572,17.4,,S
|
||||
0,3,Sivic,male,40,0,0,349251,7.8958,,S
|
||||
0,2,Norman,male,28,0,0,218629,13.5,,S
|
||||
0,3,Davies,male,24,2,0,A/4 48871,24.15,,S
|
||||
0,3,Stoytcheff,male,19,0,0,349205,7.8958,,S
|
||||
0,3,Palsson,female,29,0,4,349909,21.075,,S
|
||||
1,3,Jonsson,male,32,0,0,350417,7.8542,,S
|
||||
1,2,Harris,male,62,0,0,S.W./PP 752,10.5,,S
|
||||
1,1,Appleton,female,53,2,0,11769,51.4792,C101,S
|
||||
1,1,Flynn,male,36,0,0,PC 17474,26.3875,E25,S
|
||||
0,3,Rush,male,16,0,0,A/4. 20589,8.05,,S
|
||||
0,3,Patchett,male,19,0,0,358585,14.5,,S
|
||||
1,2,Garside,female,34,0,0,243880,13,,S
|
||||
1,1,Silvey,female,39,1,0,13507,55.9,E44,S
|
||||
1,3,Jussila,male,32,0,0,STON/O 2. 3101286,7.925,,S
|
||||
1,2,Christy,female,25,1,1,237789,30,,S
|
||||
1,1,Thayer,female,39,1,1,17421,110.8833,C68,C
|
||||
0,2,Downton,male,54,0,0,28403,26,,S
|
||||
0,1,Ross,male,36,0,0,13049,40.125,A10,C
|
||||
1,1,Taussig,female,18,0,2,110413,79.65,E68,S
|
||||
0,2,Jarvis,male,47,0,0,237565,15,,S
|
||||
1,1,Frolicher-Stehli,male,60,1,1,13567,79.2,B41,C
|
||||
0,3,Gilinski,male,22,0,0,14973,8.05,,S
|
||||
0,3,Rintamaki,male,35,0,0,STON/O 2. 3101273,7.125,,S
|
||||
1,1,Stephenson,female,52,1,0,36947,78.2667,D20,C
|
||||
0,3,Elsbury,male,47,0,0,A/5 3902,7.25,,S
|
||||
0,2,Chapman,male,37,1,0,SC/AH 29037,26,,S
|
||||
0,3,Van,male,36,1,1,345773,24.15,,S
|
||||
0,3,Johnson,male,49,0,0,LINE,0,,S
|
||||
1,1,Duff,male,49,1,0,PC 17485,56.9292,A20,C
|
||||
1,2,Jacobsohn,female,24,2,1,243847,27,,S
|
||||
0,3,Torber,male,44,0,0,364511,8.05,,S
|
||||
1,1,Homer,male,35,0,0,111426,26.55,,C
|
||||
0,3,Lindell,male,36,1,0,349910,15.55,,S
|
||||
0,3,Karaic,male,30,0,0,349246,7.8958,,S
|
||||
1,1,Daniel,male,27,0,0,113804,30.5,,S
|
||||
1,2,Laroche,female,22,1,2,SC/Paris 2123,41.5792,,C
|
||||
1,1,Shutes,female,40,0,0,PC 17582,153.4625,C125,S
|
||||
0,3,Andersson,female,39,1,5,347082,31.275,,S
|
||||
0,3,Brocklebank,male,35,0,0,364512,8.05,,S
|
||||
1,2,Herman,female,24,1,2,220845,65,,S
|
||||
0,3,Danbom,male,34,1,1,347080,14.4,,S
|
||||
0,3,Lobb,female,26,1,0,A/5. 3336,16.1,,S
|
||||
1,2,Becker,female,4,2,1,230136,39,F4,S
|
||||
0,2,Gavey,male,26,0,0,31028,10.5,,S
|
||||
0,3,Yasbeck,male,27,1,0,2659,14.4542,,C
|
||||
1,1,Kimball,male,42,1,0,11753,52.5542,D19,S
|
||||
1,3,Nakid,male,20,1,1,2653,15.7417,,C
|
||||
0,3,Hansen,male,21,0,0,350029,7.8542,,S
|
||||
0,3,Bowen,male,21,0,0,54636,16.1,,S
|
||||
0,1,Sutton,male,61,0,0,36963,32.3208,D50,S
|
||||
0,2,Kirkland,male,57,0,0,219533,12.35,,Q
|
||||
1,1,Longley,female,21,0,0,13502,77.9583,D9,S
|
||||
0,3,Bostandyeff,male,26,0,0,349224,7.8958,,S
|
||||
1,1,Barkworth,male,80,0,0,27042,30,A23,S
|
||||
0,3,Lundahl,male,51,0,0,347743,7.0542,,S
|
||||
1,1,Stahelin-Maeglin,male,32,0,0,13214,30.5,B50,C
|
||||
0,3,Skoog,female,9,3,2,347088,27.9,,S
|
||||
1,2,Davis,female,28,0,0,237668,13,,S
|
||||
0,3,Leinonen,male,32,0,0,STON/O 2. 3101292,7.925,,S
|
||||
0,2,Collyer,male,31,1,1,C.A. 31921,26.25,,S
|
||||
0,3,Panula,female,41,0,5,3101295,39.6875,,S
|
||||
0,3,Jensen,male,20,0,0,350050,7.8542,,S
|
||||
1,1,Sagesser,female,24,0,0,PC 17477,69.3,B35,C
|
||||
0,3,Skoog,female,2,3,2,347088,27.9,,S
|
||||
1,3,Baclini,female,0.75,2,1,2666,19.2583,,C
|
||||
1,1,Harper,male,48,1,0,PC 17572,76.7292,D33,C
|
||||
0,3,Cor,male,19,0,0,349231,7.8958,,S
|
||||
1,1,Simonius-Blumer,male,56,0,0,13213,35.5,A26,C
|
||||
1,3,Stanley,female,23,0,0,CA. 2314,7.55,,S
|
||||
1,2,Doling,female,18,0,1,231919,23,,S
|
||||
0,3,Kalvik,male,21,0,0,8475,8.4333,,S
|
||||
0,3,Hegarty,female,18,0,0,365226,6.75,,Q
|
||||
0,2,Hickman,male,24,2,0,S.O.C. 14879,73.5,,S
|
||||
0,3,Bourke,female,32,1,1,364849,15.5,,Q
|
||||
0,2,Eitemiller,male,23,0,0,29751,13,,S
|
||||
0,1,Newell,male,58,0,2,35273,113.275,D48,C
|
||||
1,1,Frauenthal,male,50,2,0,PC 17611,133.65,,S
|
||||
0,3,Badt,male,40,0,0,2623,7.225,,C
|
||||
0,1,Colley,male,47,0,0,5727,25.5875,E58,S
|
||||
0,3,Coleff,male,36,0,0,349210,7.4958,,S
|
||||
1,3,Lindqvist,male,20,1,0,STON/O 2. 3101285,7.925,,S
|
||||
0,2,Hickman,male,32,2,0,S.O.C. 14879,73.5,,S
|
||||
0,2,Butler,male,25,0,0,234686,13,,S
|
||||
0,3,Cook,male,43,0,0,A/5 3536,8.05,,S
|
||||
1,2,Brown,female,40,1,1,29750,39,,S
|
||||
0,1,Davidson,male,31,1,0,F.C. 12750,52,B71,S
|
||||
0,2,Mitchell,male,70,0,0,C.A. 24580,10.5,,S
|
||||
1,2,Wilhelms,male,31,0,0,244270,13,,S
|
||||
0,3,Edvardsson,male,18,0,0,349912,7.775,,S
|
||||
0,3,Sawyer,male,24.5,0,0,342826,8.05,,S
|
||||
1,3,Turja,female,18,0,0,4138,9.8417,,S
|
||||
0,3,Goodwin,female,43,1,6,CA 2144,46.9,,S
|
||||
1,1,Cardeza,male,36,0,1,PC 17755,512.3292,B51 B53 B55,C
|
||||
1,1,Hassab,male,27,0,0,PC 17572,76.7292,D49,C
|
||||
0,3,Olsvigen,male,20,0,0,6563,9.225,,S
|
||||
0,3,Goodwin,male,14,5,2,CA 2144,46.9,,S
|
||||
0,2,Brown,male,60,1,1,29750,39,,S
|
||||
0,2,Laroche,male,25,1,2,SC/Paris 2123,41.5792,,C
|
||||
0,3,Panula,male,14,4,1,3101295,39.6875,,S
|
||||
0,3,Dakic,male,19,0,0,349228,10.1708,,S
|
||||
0,3,Fischer,male,18,0,0,350036,7.7958,,S
|
||||
1,1,Madill,female,15,0,1,24160,211.3375,B5,S
|
||||
1,1,Dick,male,31,1,0,17474,57,B20,S
|
||||
1,3,Karun,female,4,0,1,349256,13.4167,,C
|
||||
0,3,Saad,male,25,0,0,2672,7.225,,C
|
||||
0,1,Weir,male,60,0,0,113800,26.55,,S
|
||||
0,2,Chapman,male,52,0,0,248731,13.5,,S
|
||||
0,3,Kelly,male,44,0,0,363592,8.05,,S
|
||||
0,1,Thayer,male,49,1,1,17421,110.8833,C68,C
|
||||
0,3,Humblen,male,42,0,0,348121,7.65,F G63,S
|
||||
1,1,Astor,female,18,1,0,PC 17757,227.525,C62 C64,C
|
||||
1,1,Silverthorne,male,35,0,0,PC 17475,26.2875,E24,S
|
||||
0,3,Barbara,female,18,0,1,2691,14.4542,,C
|
||||
0,3,Gallagher,male,25,0,0,36864,7.7417,,Q
|
||||
0,3,Hansen,male,26,1,0,350025,7.8542,,S
|
||||
0,2,Morley,male,39,0,0,250655,26,,S
|
||||
1,2,Kelly,female,45,0,0,223596,13.5,,S
|
||||
1,1,Calderhead,male,42,0,0,PC 17476,26.2875,E24,S
|
||||
1,1,Cleaver,female,22,0,0,113781,151.55,,S
|
||||
1,1,Mayne,female,24,0,0,PC 17482,49.5042,C90,C
|
||||
1,1,Taylor,male,48,1,0,19996,52,C126,S
|
||||
0,3,Larsson,male,29,0,0,7545,9.4833,,S
|
||||
0,2,Greenberg,male,52,0,0,250647,13,,S
|
||||
0,3,Soholt,male,19,0,0,348124,7.65,F G73,S
|
||||
1,1,Endres,female,38,0,0,PC 17757,227.525,C45,C
|
||||
1,2,Troutt,female,27,0,0,34218,10.5,E101,S
|
||||
0,3,Johnson,male,33,0,0,347062,7.775,,S
|
||||
1,2,Harper,female,6,0,1,248727,33,,S
|
||||
0,3,Jensen,male,17,1,0,350048,7.0542,,S
|
||||
0,2,Gillespie,male,34,0,0,12233,13,,S
|
||||
0,2,Hodges,male,50,0,0,250643,13,,S
|
||||
1,1,Chambers,male,27,1,0,113806,53.1,E8,S
|
||||
0,3,Oreskovic,male,20,0,0,315094,8.6625,,S
|
||||
1,2,Renouf,female,30,3,0,31027,21,,S
|
||||
0,2,Bryhl,male,25,1,0,236853,26,,S
|
||||
0,3,Ilmakangas,female,25,1,0,STON/O2. 3101271,7.925,,S
|
||||
1,1,Allen,female,29,0,0,24160,211.3375,B5,S
|
||||
0,3,Hassan,male,11,0,0,2699,18.7875,,C
|
||||
0,2,Berriman,male,23,0,0,28425,13,,S
|
||||
0,2,Troupiansky,male,23,0,0,233639,13,,S
|
||||
0,3,Williams,male,28.5,0,0,54636,16.1,,S
|
||||
0,3,Ford,female,48,1,3,W./C. 6608,34.375,,S
|
||||
1,1,Lesurer,male,35,0,0,PC 17755,512.3292,B101,C
|
||||
0,1,Cavendish,male,36,1,0,19877,78.85,C46,S
|
||||
1,1,Ryerson,female,21,2,2,PC 17608,262.375,B57 B59 B63 B66,C
|
||||
0,3,McNamee,male,24,1,0,376566,16.1,,S
|
||||
1,3,Stranden,male,31,0,0,STON/O 2. 3101288,7.925,,S
|
||||
0,1,Crosby,male,70,1,1,WE/P 5735,71,B22,S
|
||||
0,3,Abbott,male,16,1,1,C.A. 2673,20.25,,S
|
||||
1,2,Sinkkonen,female,30,0,0,250648,13,,S
|
||||
0,1,Marvin,male,19,1,0,113773,53.1,D30,S
|
||||
0,3,Connaghton,male,31,0,0,335097,7.75,,Q
|
||||
1,2,Wells,female,4,1,1,29103,23,,S
|
||||
1,3,Moor,male,6,0,1,392096,12.475,E121,S
|
||||
0,3,Vande,male,33,0,0,345780,9.5,,S
|
||||
0,3,Jonkoff,male,23,0,0,349204,7.8958,,S
|
||||
1,2,Herman,female,48,1,2,220845,65,,S
|
||||
1,2,Hamalainen,male,0.67,1,1,250649,14.5,,S
|
||||
0,3,Carlsson,male,28,0,0,350042,7.7958,,S
|
||||
0,2,Bailey,male,18,0,0,29108,11.5,,S
|
||||
0,3,Theobald,male,34,0,0,363294,8.05,,S
|
||||
1,1,Rothes,female,33,0,0,110152,86.5,B77,S
|
||||
0,3,Nirva,male,41,0,0,SOTON/O2 3101272,7.125,,S
|
||||
1,3,Barah,male,20,0,0,2663,7.2292,,C
|
||||
1,1,Carter,female,36,1,2,113760,120,B96 B98,S
|
||||
0,3,Eklund,male,16,0,0,347074,7.775,,S
|
||||
1,1,Hogeboom,female,51,1,0,13502,77.9583,D11,S
|
||||
0,3,Mangan,female,30.5,0,0,364850,7.75,,Q
|
||||
0,3,Gronnestad,male,32,0,0,8471,8.3625,,S
|
||||
0,3,Lievens,male,24,0,0,345781,9.5,,S
|
||||
0,3,Jensen,male,48,0,0,350047,7.8542,,S
|
||||
0,2,Mack,female,57,0,0,S.O./P.P. 3,10.5,E77,S
|
||||
1,2,Hocking,female,54,1,3,29105,23,,S
|
||||
0,3,Myhrman,male,18,0,0,347078,7.75,,S
|
||||
1,3,Emanuel,female,5,0,0,364516,12.475,,S
|
||||
1,1,Robert,female,43,0,1,24160,211.3375,B3,S
|
||||
1,3,Ayoub,female,13,0,0,2687,7.2292,,C
|
||||
1,1,Dick,female,17,1,0,17474,57,B20,S
|
||||
0,1,Long,male,29,0,0,113501,30,D6,S
|
||||
0,3,Ali,male,25,0,0,SOTON/O.Q. 3101312,7.05,,S
|
||||
0,3,Harmer,male,25,0,0,374887,7.25,,S
|
||||
1,3,Sjoblom,female,18,0,0,3101265,7.4958,,S
|
||||
0,3,Rice,male,8,4,1,382652,29.125,,Q
|
||||
1,3,Dean,male,1,1,2,C.A. 2315,20.575,,S
|
||||
0,1,Guggenheim,male,46,0,0,PC 17593,79.2,B82 B84,C
|
||||
0,2,Gaskell,male,16,0,0,239865,26,,S
|
||||
0,3,Dantcheff,male,25,0,0,349203,7.8958,,S
|
||||
0,2,Otter,male,39,0,0,28213,13,,S
|
||||
1,1,Leader,female,49,0,0,17465,25.9292,D17,S
|
||||
1,3,Osman,female,31,0,0,349244,8.6833,,S
|
||||
0,3,Ibrahim,male,30,0,0,2685,7.2292,,C
|
||||
0,3,Van,female,30,1,1,345773,24.15,,S
|
||||
0,2,Ponesell,male,34,0,0,250647,13,,S
|
||||
1,2,Collyer,female,31,1,1,C.A. 31921,26.25,,S
|
||||
1,1,Carter,male,11,1,2,113760,120,B96 B98,S
|
||||
1,3,Thomas,male,0.42,0,1,2625,8.5167,,C
|
||||
1,3,Hedman,male,27,0,0,347089,6.975,,S
|
||||
0,3,Johansson,male,31,0,0,347063,7.775,,S
|
||||
0,1,Andrews,male,39,0,0,112050,0,A36,S
|
||||
0,3,Pettersson,female,18,0,0,347087,7.775,,S
|
||||
0,2,Meyer,male,39,0,0,248723,13,,S
|
||||
1,1,Chambers,female,33,1,0,113806,53.1,E8,S
|
||||
0,3,Alexander,male,26,0,0,3474,7.8875,,S
|
||||
0,3,Lester,male,39,0,0,A/4 48871,24.15,,S
|
||||
0,2,Slemen,male,35,0,0,28206,10.5,,S
|
||||
0,3,Andersson,female,6,4,2,347082,31.275,,S
|
||||
0,3,Tomlin,male,30.5,0,0,364499,8.05,,S
|
||||
0,3,Heininen,female,23,0,0,STON/O2. 3101290,7.925,,S
|
||||
0,2,Mallet,male,31,1,1,S.C./PARIS 2079,37.0042,,C
|
||||
0,3,Holm,male,43,0,0,C 7075,6.45,,S
|
||||
0,3,Skoog,male,10,3,2,347088,27.9,,S
|
||||
1,1,Hays,female,52,1,1,12749,93.5,B69,S
|
||||
1,3,Lulic,male,27,0,0,315098,8.6625,,S
|
||||
0,1,Reuchlin,male,38,0,0,19972,0,,S
|
||||
1,3,Moor,female,27,0,1,392096,12.475,E121,S
|
||||
0,3,Panula,male,2,4,1,3101295,39.6875,,S
|
||||
1,2,Mallet,male,1,0,2,S.C./PARIS 2079,37.0042,,C
|
||||
1,1,Stone,female,62,0,0,113572,80,B28,
|
||||
1,3,Yasbeck,female,15,1,0,2659,14.4542,,C
|
||||
1,2,Richards,male,0.83,1,1,29106,18.75,,S
|
||||
0,3,Augustsson,male,23,0,0,347468,7.8542,,S
|
||||
0,3,Allum,male,18,0,0,2223,8.3,,S
|
||||
1,1,Compton,female,39,1,1,PC 17756,83.1583,E49,C
|
||||
0,3,Pasic,male,21,0,0,315097,8.6625,,S
|
||||
1,3,Chip,male,32,0,0,1601,56.4958,,S
|
||||
0,3,Alhomaki,male,20,0,0,SOTON/O2 3101287,7.925,,S
|
||||
0,2,Mudd,male,16,0,0,S.O./P.P. 3,10.5,,S
|
||||
1,1,Serepeca,female,30,0,0,113798,31,,C
|
||||
0,3,Lemberopolous,male,34.5,0,0,2683,6.4375,,C
|
||||
0,3,Culumovic,male,17,0,0,315090,8.6625,,S
|
||||
0,3,Abbing,male,42,0,0,C.A. 5547,7.55,,S
|
||||
0,3,Markoff,male,35,0,0,349213,7.8958,,C
|
||||
0,2,Harper,male,28,0,1,248727,33,,S
|
||||
0,3,Andersson,male,4,4,2,347082,31.275,,S
|
||||
0,3,Svensson,male,74,0,0,347060,7.775,,S
|
||||
0,3,Boulos,female,9,1,1,2678,15.2458,,C
|
||||
1,1,Lines,female,16,0,1,PC 17592,39.4,D28,S
|
||||
0,2,Carter,female,44,1,0,244252,26,,S
|
||||
1,3,Aks,female,18,0,1,392091,9.35,,S
|
||||
1,1,Wick,female,45,1,1,36928,164.8667,,S
|
||||
1,1,Daly,male,51,0,0,113055,26.55,E17,S
|
||||
1,3,Baclini,female,24,0,3,2666,19.2583,,C
|
||||
0,3,Hansen,male,41,2,0,350026,14.1083,,S
|
||||
0,2,Giles,male,21,1,0,28134,11.5,,S
|
||||
1,1,Swift,female,48,0,0,17466,25.9292,D17,S
|
||||
0,2,Gill,male,24,0,0,233866,13,,S
|
||||
1,2,Bystrom,female,42,0,0,236852,13,,S
|
||||
1,2,Duran,female,27,1,0,SC/PARIS 2149,13.8583,,C
|
||||
0,1,Roebling,male,31,0,0,PC 17590,50.4958,A24,S
|
||||
1,3,Johnson,male,4,1,1,347742,11.1333,,S
|
||||
0,3,Balkic,male,26,0,0,349248,7.8958,,S
|
||||
1,1,Beckwith,female,47,1,1,11751,52.5542,D35,S
|
||||
0,1,Carlsson,male,33,0,0,695,5,B51 B53 B55,S
|
||||
0,3,Vander,male,47,0,0,345765,9,,S
|
||||
1,2,Abelson,female,28,1,0,P/PP 3381,24,,C
|
||||
1,3,Najib,female,15,0,0,2667,7.225,,C
|
||||
0,3,Gustafsson,male,20,0,0,7534,9.8458,,S
|
||||
0,3,Petroff,male,19,0,0,349212,7.8958,,S
|
||||
1,1,Potter,female,56,0,1,11767,83.1583,C50,C
|
||||
1,2,Shelley,female,25,0,1,230433,26,,S
|
||||
0,3,Markun,male,33,0,0,349257,7.8958,,S
|
||||
0,3,Dahlberg,female,22,0,0,7552,10.5167,,S
|
||||
0,2,Banfield,male,28,0,0,C.A./SOTON 34068,10.5,,S
|
||||
0,3,Sutehall,male,25,0,0,SOTON/OQ 392076,7.05,,S
|
||||
0,3,Rice,female,39,0,5,382652,29.125,,Q
|
||||
0,2,Montvila,male,27,0,0,211536,13,,S
|
||||
1,1,Graham,female,19,0,0,112053,30,B42,S
|
||||
1,1,Behr,male,26,0,0,111369,30,C148,C
|
||||
0,3,Dooley,male,32,0,0,370376,7.75,,Q
|
||||
|
@@ -1,6 +1,9 @@
|
||||
import { OpenAI, LlamaDeuce, ChatMessage, DeuceChatStrategy } from "llamaindex";
|
||||
import * as readline from "node:readline/promises";
|
||||
import { stdin as input, stdout as output } from "node:process";
|
||||
// readline/promises is still experimental so not in @types/node yet
|
||||
// @ts-ignore
|
||||
import readline from "node:readline/promises";
|
||||
|
||||
import { ChatMessage, LlamaDeuce, OpenAI } from "llamaindex";
|
||||
|
||||
(async () => {
|
||||
const gpt4 = new OpenAI({ model: "gpt-4", temperature: 0.9 });
|
||||
@@ -26,7 +29,7 @@ import { stdin as input, stdout as output } from "node:process";
|
||||
history.map(({ content, role }) => ({
|
||||
content,
|
||||
role: next === l2 ? role : role === "user" ? "assistant" : "user",
|
||||
}))
|
||||
})),
|
||||
);
|
||||
history.push({
|
||||
content: r.message.content,
|
||||
|
||||
@@ -13,16 +13,13 @@ async function main() {
|
||||
chunkSize: 40,
|
||||
}),
|
||||
});
|
||||
const document = new Document({ text: essay });
|
||||
const index = await ListIndex.fromDocuments(
|
||||
[document],
|
||||
{ serviceContext }
|
||||
);
|
||||
const document = new Document({ text: essay, id_: "essay" });
|
||||
const index = await ListIndex.fromDocuments([document], { serviceContext });
|
||||
const queryEngine = index.asQueryEngine({
|
||||
retriever: index.asRetriever({ mode: ListRetrieverMode.LLM }),
|
||||
});
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do growing up?"
|
||||
"What did the author do growing up?",
|
||||
);
|
||||
console.log(response.toString());
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { LlamaDeuce } from "llamaindex";
|
||||
import { DeuceChatStrategy, LlamaDeuce } from "llamaindex";
|
||||
|
||||
(async () => {
|
||||
const deuce = new LlamaDeuce();
|
||||
const deuce = new LlamaDeuce({ chatStrategy: DeuceChatStrategy.META });
|
||||
const result = await deuce.chat([{ content: "Hello, world!", role: "user" }]);
|
||||
console.log(result);
|
||||
})();
|
||||
|
||||
Generated
-367
@@ -1,367 +0,0 @@
|
||||
{
|
||||
"name": "simple",
|
||||
"version": "0.0.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "simple",
|
||||
"version": "0.0.3",
|
||||
"dependencies": {
|
||||
"llamaindex": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18"
|
||||
}
|
||||
},
|
||||
"node_modules/@anthropic-ai/sdk": {
|
||||
"version": "0.5.10",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.5.10.tgz",
|
||||
"integrity": "sha512-P8xrIuTUO/6wDzcjQRUROXp4WSqtngbXaE4GpEu0PhEmnq/1Q8vbF1s0o7W07EV3j8zzRoyJxAKovUJtNXH7ew==",
|
||||
"dependencies": {
|
||||
"@types/node": "^18.11.18",
|
||||
"@types/node-fetch": "^2.6.4",
|
||||
"abort-controller": "^3.0.0",
|
||||
"agentkeepalive": "^4.2.1",
|
||||
"digest-fetch": "^1.3.0",
|
||||
"form-data-encoder": "1.7.2",
|
||||
"formdata-node": "^4.3.2",
|
||||
"node-fetch": "^2.6.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "18.17.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.3.tgz",
|
||||
"integrity": "sha512-2x8HWtFk0S99zqVQABU9wTpr8wPoaDHZUcAkoTKH+nL7kPv3WUI9cRi/Kk5Mz4xdqXSqTkKP7IWNoQQYCnDsTA=="
|
||||
},
|
||||
"node_modules/@types/node-fetch": {
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz",
|
||||
"integrity": "sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==",
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"form-data": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/abort-controller": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
||||
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
||||
"dependencies": {
|
||||
"event-target-shim": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.5"
|
||||
}
|
||||
},
|
||||
"node_modules/agentkeepalive": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz",
|
||||
"integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==",
|
||||
"dependencies": {
|
||||
"humanize-ms": "^1.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
},
|
||||
"node_modules/base-64": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz",
|
||||
"integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA=="
|
||||
},
|
||||
"node_modules/charenc": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
|
||||
"integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"dependencies": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/crypt": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
|
||||
"integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/digest-fetch": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-1.3.0.tgz",
|
||||
"integrity": "sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA==",
|
||||
"dependencies": {
|
||||
"base-64": "^0.1.0",
|
||||
"md5": "^2.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/event-target-shim": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
||||
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
|
||||
"integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/form-data-encoder": {
|
||||
"version": "1.7.2",
|
||||
"resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz",
|
||||
"integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A=="
|
||||
},
|
||||
"node_modules/formdata-node": {
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz",
|
||||
"integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==",
|
||||
"dependencies": {
|
||||
"node-domexception": "1.0.0",
|
||||
"web-streams-polyfill": "4.0.0-beta.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12.20"
|
||||
}
|
||||
},
|
||||
"node_modules/humanize-ms": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
|
||||
"integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==",
|
||||
"dependencies": {
|
||||
"ms": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-buffer": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
|
||||
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
|
||||
},
|
||||
"node_modules/llamaindex": {
|
||||
"version": "0.0.17",
|
||||
"resolved": "https://registry.npmjs.org/llamaindex/-/llamaindex-0.0.17.tgz",
|
||||
"integrity": "sha512-2XrKEBUaEfATYmMcW4AkX0B4EiVpp6Gcg3aeWZ+gJZVYc5iMsApReH1gy5T/+XstJWz6lNYOP/DJnVRfkVj0Lg==",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.5.9",
|
||||
"lodash": "^4.17.21",
|
||||
"openai": "4.0.0-beta.8",
|
||||
"pdf-parse": "^1.1.1",
|
||||
"replicate": "^0.14.1",
|
||||
"tiktoken-node": "^0.0.6",
|
||||
"uuid": "^9.0.0",
|
||||
"wink-nlp": "^1.14.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
},
|
||||
"node_modules/md5": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz",
|
||||
"integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
|
||||
"dependencies": {
|
||||
"charenc": "0.0.2",
|
||||
"crypt": "0.0.2",
|
||||
"is-buffer": "~1.1.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"dependencies": {
|
||||
"mime-db": "1.52.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||
},
|
||||
"node_modules/node-domexception": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
|
||||
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jimmywarting"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://paypal.me/jimmywarting"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-ensure": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-ensure/-/node-ensure-0.0.0.tgz",
|
||||
"integrity": "sha512-DRI60hzo2oKN1ma0ckc6nQWlHU69RH6xN0sjQTjMpChPfTYvKZdcQFfdYK2RWbJcKyUizSIy/l8OTGxMAM1QDw=="
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.12",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz",
|
||||
"integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/openai": {
|
||||
"version": "4.0.0-beta.8",
|
||||
"resolved": "https://registry.npmjs.org/openai/-/openai-4.0.0-beta.8.tgz",
|
||||
"integrity": "sha512-bXBxUK2B288GlLckjnpT+UgyyddP+f4JIT5/df95C6eeqQhf5UkuN41Z3uf/6unPvR8Tthm4jJje1fA0OgsDEw==",
|
||||
"dependencies": {
|
||||
"@types/node": "^18.11.18",
|
||||
"@types/node-fetch": "^2.6.4",
|
||||
"abort-controller": "^3.0.0",
|
||||
"agentkeepalive": "^4.2.1",
|
||||
"digest-fetch": "^1.3.0",
|
||||
"form-data-encoder": "1.7.2",
|
||||
"formdata-node": "^4.3.2",
|
||||
"node-fetch": "^2.6.7"
|
||||
}
|
||||
},
|
||||
"node_modules/pdf-parse": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/pdf-parse/-/pdf-parse-1.1.1.tgz",
|
||||
"integrity": "sha512-v6ZJ/efsBpGrGGknjtq9J/oC8tZWq0KWL5vQrk2GlzLEQPUDB1ex+13Rmidl1neNN358Jn9EHZw5y07FFtaC7A==",
|
||||
"dependencies": {
|
||||
"debug": "^3.1.0",
|
||||
"node-ensure": "^0.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.8.1"
|
||||
}
|
||||
},
|
||||
"node_modules/replicate": {
|
||||
"version": "0.14.1",
|
||||
"resolved": "https://registry.npmjs.org/replicate/-/replicate-0.14.1.tgz",
|
||||
"integrity": "sha512-3NpuNRbvXoEjY+n/ra24VfQyIRCdLub9GCrU51fFTrMaa6OjRvMC9jGDJSpGRXOLvID75mFgN577HEhA3XEFtg==",
|
||||
"engines": {
|
||||
"git": ">=2.11.0",
|
||||
"node": ">=16.6.0",
|
||||
"npm": ">=7.19.0",
|
||||
"yarn": ">=1.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tiktoken-node": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/tiktoken-node/-/tiktoken-node-0.0.6.tgz",
|
||||
"integrity": "sha512-MiprfzPhoKhCflzl0Jyds0VKibAgUGHfJLvBCAXPpum6Lru6ZoKQGsl8lJP0B94LPpby2B2WveOB2tZVfEZQOQ==",
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
|
||||
"integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/web-streams-polyfill": {
|
||||
"version": "4.0.0-beta.3",
|
||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz",
|
||||
"integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==",
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wink-nlp": {
|
||||
"version": "1.14.3",
|
||||
"resolved": "https://registry.npmjs.org/wink-nlp/-/wink-nlp-1.14.3.tgz",
|
||||
"integrity": "sha512-lvY5iCs3T8I34F8WKS70+2P0U9dWLn3vdPf/Z+m2VK14N7OmqnPzmHfh3moHdusajoQ37Em39z0IZB9K4x/96A=="
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -1,10 +1,9 @@
|
||||
import fs from "fs/promises";
|
||||
import { PDFReader, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
// Load PDF
|
||||
const reader = new PDFReader();
|
||||
const documents = await reader.loadData("examples/brk-2022.pdf");
|
||||
const documents = await reader.loadData("data/brk-2022.pdf");
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const index = await VectorStoreIndex.fromDocuments(documents);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
import { SentenceSplitter } from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
const path = "node_modules/llamaindex/examples/abramov.txt";
|
||||
const essay = await fs.readFile(path, "utf-8");
|
||||
|
||||
const textSplitter = new SentenceSplitter();
|
||||
|
||||
const chunks = textSplitter.splitTextWithOverlaps(essay);
|
||||
|
||||
console.log(chunks);
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -1,13 +1,13 @@
|
||||
import {
|
||||
Document,
|
||||
VectorStoreIndex,
|
||||
storageContextFromDefaults,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
import essay from "./essay";
|
||||
|
||||
async function main() {
|
||||
// Create Document object with essay
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: "essay" });
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
// persist the vector store automatically with the storage context
|
||||
@@ -21,7 +21,7 @@ async function main() {
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?"
|
||||
"What did the author do in college?",
|
||||
);
|
||||
|
||||
// Output response
|
||||
@@ -36,7 +36,7 @@ async function main() {
|
||||
});
|
||||
const loadedQueryEngine = loadedIndex.asQueryEngine();
|
||||
const loadedResponse = await loadedQueryEngine.query(
|
||||
"What did the author do growing up?"
|
||||
"What did the author do growing up?",
|
||||
);
|
||||
console.log(loadedResponse.toString());
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Document, VectorStoreIndex, SubQuestionQueryEngine } from "llamaindex";
|
||||
import { Document, SubQuestionQueryEngine, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
import essay from "./essay";
|
||||
|
||||
(async () => {
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: essay });
|
||||
const index = await VectorStoreIndex.fromDocuments([document]);
|
||||
|
||||
const queryEngine = SubQuestionQueryEngine.fromDefaults({
|
||||
@@ -19,7 +19,7 @@ import essay from "./essay";
|
||||
});
|
||||
|
||||
const response = await queryEngine.query(
|
||||
"How was Paul Grahams life different before and after YC?"
|
||||
"How was Paul Grahams life different before and after YC?",
|
||||
);
|
||||
|
||||
console.log(response.toString());
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import fs from "fs/promises";
|
||||
import fs from "node: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"
|
||||
);
|
||||
const path = "node_modules/llamaindex/examples/abramov.txt";
|
||||
|
||||
const essay = await fs.readFile(path, "utf-8");
|
||||
|
||||
// Create Document object with essay
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: path });
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const index = await VectorStoreIndex.fromDocuments([document]);
|
||||
@@ -17,7 +17,7 @@ async function main() {
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?"
|
||||
"What did the author do in college?",
|
||||
);
|
||||
|
||||
// Output response
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import fs from "fs/promises";
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
import {
|
||||
Anthropic,
|
||||
Document,
|
||||
VectorStoreIndex,
|
||||
serviceContextFromDefaults,
|
||||
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"
|
||||
);
|
||||
const path = "node_modules/llamaindex/examples/abramov.txt";
|
||||
|
||||
const essay = await fs.readFile(path, "utf-8");
|
||||
|
||||
// Create Document object with essay
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: path });
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const serviceContext = serviceContextFromDefaults({ llm: new Anthropic() });
|
||||
@@ -25,7 +25,7 @@ async function main() {
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?"
|
||||
"What did the author do in college?",
|
||||
);
|
||||
|
||||
// Output response
|
||||
|
||||
@@ -1,23 +1,31 @@
|
||||
import { Document, VectorStoreIndex, RetrieverQueryEngine, OpenAI, serviceContextFromDefaults } from "llamaindex";
|
||||
import {
|
||||
Document,
|
||||
OpenAI,
|
||||
RetrieverQueryEngine,
|
||||
serviceContextFromDefaults,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
import essay from "./essay";
|
||||
|
||||
// Customize retrieval and query args
|
||||
async function main() {
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: "essay" });
|
||||
|
||||
const serviceContext = serviceContextFromDefaults(
|
||||
{ llm: new OpenAI({ model: "gpt-3.5-turbo", temperature: 0.0 }) }
|
||||
);
|
||||
const serviceContext = serviceContextFromDefaults({
|
||||
llm: new OpenAI({ model: "gpt-3.5-turbo", temperature: 0.0 }),
|
||||
});
|
||||
|
||||
const index = await VectorStoreIndex.fromDocuments([document], {
|
||||
serviceContext,
|
||||
});
|
||||
|
||||
const index = await VectorStoreIndex.fromDocuments([document], { serviceContext });
|
||||
|
||||
const retriever = index.asRetriever();
|
||||
retriever.similarityTopK = 5;
|
||||
// TODO: cannot pass responseSynthesizer into retriever query engine
|
||||
const queryEngine = new RetrieverQueryEngine(retriever);
|
||||
|
||||
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do growing up?"
|
||||
"What did the author do growing up?",
|
||||
);
|
||||
console.log(response.response);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
import fs from "fs/promises";
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
import {
|
||||
OpenAI,
|
||||
Document,
|
||||
VectorStoreIndex,
|
||||
OpenAI,
|
||||
serviceContextFromDefaults,
|
||||
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"
|
||||
);
|
||||
const path = "node_modules/llamaindex/examples/abramov.txt";
|
||||
const essay = await fs.readFile(path, "utf-8");
|
||||
|
||||
// Create Document object with essay
|
||||
const document = new Document({ text: essay });
|
||||
const document = new Document({ text: essay, id_: path });
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const serviceContext = serviceContextFromDefaults({
|
||||
@@ -27,7 +26,7 @@ async function main() {
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query(
|
||||
"What did the author do in college?"
|
||||
"What did the author do in college?",
|
||||
);
|
||||
|
||||
// Output response
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"husky": "^8.0.3",
|
||||
"jest": "^29.6.2",
|
||||
"prettier": "^2.8.8",
|
||||
"prettier-plugin-tailwindcss": "^0.3.0",
|
||||
"prettier": "^3.0.2",
|
||||
"prettier-plugin-organize-imports": "^3.2.3",
|
||||
"ts-jest": "^29.1.1",
|
||||
"turbo": "^1.10.12"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# llamaindex
|
||||
|
||||
## 0.0.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 824c13c: Breaking: allow documents to be reimported with hash checking.
|
||||
- 18b8915: Update storage exports (thanks @TomPenguin)
|
||||
- ade9d8f: Bug fix: use session in OpenAI Embeddings (thanks @swk777)
|
||||
- 824c13c: Breaking: removed nodeId and docId. Just use id\_
|
||||
|
||||
## 0.0.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
{
|
||||
"name": "llamaindex",
|
||||
"version": "0.0.17",
|
||||
"version": "0.0.18",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.5.9",
|
||||
"@anthropic-ai/sdk": "^0.6.0",
|
||||
"lodash": "^4.17.21",
|
||||
"openai": "4.0.0-beta.8",
|
||||
"openai": "^4.0.0",
|
||||
"papaparse": "^5.4.1",
|
||||
"pdf-parse": "^1.1.1",
|
||||
"replicate": "^0.14.1",
|
||||
"replicate": "^0.16.1",
|
||||
"tiktoken-node": "^0.0.6",
|
||||
"uuid": "^9.0.0",
|
||||
"wink-nlp": "^1.14.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.14.196",
|
||||
"@types/node": "^18.17.1",
|
||||
"@types/lodash": "^4.14.197",
|
||||
"@types/node": "^18.17.5",
|
||||
"@types/papaparse": "^5.3.7",
|
||||
"@types/pdf-parse": "^1.1.1",
|
||||
"@types/uuid": "^9.0.2",
|
||||
"node-stdlib-browser": "^1.2.0",
|
||||
"tsup": "^7.1.0"
|
||||
"tsup": "^7.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
|
||||
@@ -259,11 +259,13 @@ export class OpenAIEmbedding extends BaseEmbedding {
|
||||
});
|
||||
} else {
|
||||
this.apiKey = init?.apiKey ?? undefined;
|
||||
this.session = getOpenAISession({
|
||||
apiKey: this.apiKey,
|
||||
maxRetries: this.maxRetries,
|
||||
timeout: this.timeout,
|
||||
});
|
||||
this.session =
|
||||
init?.session ??
|
||||
getOpenAISession({
|
||||
apiKey: this.apiKey,
|
||||
maxRetries: this.maxRetries,
|
||||
timeout: this.timeout,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+40
-20
@@ -1,3 +1,4 @@
|
||||
import crypto from "crypto"; // TODO Node dependency
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
export enum NodeRelationship {
|
||||
@@ -35,6 +36,12 @@ export type RelatedNodeType = RelatedNodeInfo | RelatedNodeInfo[];
|
||||
* Generic abstract class for retrievable nodes
|
||||
*/
|
||||
export abstract class BaseNode {
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
id_: string = uuidv4();
|
||||
embedding?: number[];
|
||||
|
||||
@@ -55,10 +62,6 @@ export abstract class BaseNode {
|
||||
abstract getMetadataStr(metadataMode: MetadataMode): string;
|
||||
abstract setContent(value: any): void;
|
||||
|
||||
get nodeId(): string {
|
||||
return this.id_;
|
||||
}
|
||||
|
||||
get sourceNode(): RelatedNodeInfo | undefined {
|
||||
const relationship = this.relationships[NodeRelationship.SOURCE];
|
||||
|
||||
@@ -74,7 +77,7 @@ export abstract class BaseNode {
|
||||
|
||||
if (Array.isArray(relationship)) {
|
||||
throw new Error(
|
||||
"Previous object must be a single RelatedNodeInfo object"
|
||||
"Previous object must be a single RelatedNodeInfo object",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -106,13 +109,15 @@ export abstract class BaseNode {
|
||||
|
||||
if (!Array.isArray(relationship)) {
|
||||
throw new Error(
|
||||
"Child object must be a an array of RelatedNodeInfo objects"
|
||||
"Child object must be a an array of RelatedNodeInfo objects",
|
||||
);
|
||||
}
|
||||
|
||||
return relationship;
|
||||
}
|
||||
|
||||
abstract generateHash(): string;
|
||||
|
||||
getEmbedding(): number[] {
|
||||
if (this.embedding === undefined) {
|
||||
throw new Error("Embedding not set");
|
||||
@@ -123,7 +128,7 @@ export abstract class BaseNode {
|
||||
|
||||
asRelatedNodeInfo(): RelatedNodeInfo {
|
||||
return {
|
||||
nodeId: this.nodeId,
|
||||
nodeId: this.id_,
|
||||
metadata: this.metadata,
|
||||
hash: this.hash,
|
||||
};
|
||||
@@ -152,10 +157,27 @@ export class TextNode extends BaseNode {
|
||||
constructor(init?: Partial<TextNode>) {
|
||||
super(init);
|
||||
Object.assign(this, init);
|
||||
|
||||
if (new.target === TextNode) {
|
||||
// Don't generate the hash repeatedly so only do it if this is
|
||||
// constructing the derived class
|
||||
this.hash = this.generateHash();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a hash of the text node.
|
||||
* The ID is not part of the hash as it can change independent of content.
|
||||
* @returns
|
||||
*/
|
||||
generateHash() {
|
||||
throw new Error("Not implemented");
|
||||
const hashFunction = crypto.createHash("sha256");
|
||||
hashFunction.update(`type=${this.getType()}`);
|
||||
hashFunction.update(
|
||||
`startCharIdx=${this.startCharIdx} endCharIdx=${this.endCharIdx}`,
|
||||
);
|
||||
hashFunction.update(this.getContent(MetadataMode.ALL));
|
||||
return hashFunction.digest("base64");
|
||||
}
|
||||
|
||||
getType(): ObjectType {
|
||||
@@ -190,6 +212,8 @@ export class TextNode extends BaseNode {
|
||||
|
||||
setContent(value: string) {
|
||||
this.text = value;
|
||||
|
||||
this.hash = this.generateHash();
|
||||
}
|
||||
|
||||
getNodeInfo() {
|
||||
@@ -215,6 +239,10 @@ export class IndexNode extends TextNode {
|
||||
constructor(init?: Partial<IndexNode>) {
|
||||
super(init);
|
||||
Object.assign(this, init);
|
||||
|
||||
if (new.target === IndexNode) {
|
||||
this.hash = this.generateHash();
|
||||
}
|
||||
}
|
||||
|
||||
getType(): ObjectType {
|
||||
@@ -229,15 +257,15 @@ export class Document extends TextNode {
|
||||
constructor(init?: Partial<Document>) {
|
||||
super(init);
|
||||
Object.assign(this, init);
|
||||
|
||||
if (new.target === Document) {
|
||||
this.hash = this.generateHash();
|
||||
}
|
||||
}
|
||||
|
||||
getType() {
|
||||
return ObjectType.DOCUMENT;
|
||||
}
|
||||
|
||||
get docId() {
|
||||
return this.id_;
|
||||
}
|
||||
}
|
||||
|
||||
export function jsonToNode(json: any) {
|
||||
@@ -268,11 +296,3 @@ export interface NodeWithScore {
|
||||
node: BaseNode;
|
||||
score: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A node with an embedding
|
||||
*/
|
||||
export interface NodeWithEmbedding {
|
||||
node: BaseNode;
|
||||
embedding: number[];
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { ChatCompletionChunk } from "openai/resources/chat";
|
||||
import { globalsHelper } from "../../GlobalsHelper";
|
||||
import { StreamCallbackResponse, Event } from "../CallbackManager";
|
||||
import { APIResponse } from "openai/core";
|
||||
import { Stream } from "openai/streaming";
|
||||
import { globalsHelper } from "../../GlobalsHelper";
|
||||
import { MessageType } from "../../llm/LLM";
|
||||
import { Event, StreamCallbackResponse } from "../CallbackManager";
|
||||
|
||||
/**
|
||||
* Handles the OpenAI streaming interface and pipes it to the callback function
|
||||
@@ -17,7 +16,7 @@ export async function handleOpenAIStream({
|
||||
onLLMStream,
|
||||
parentEvent,
|
||||
}: {
|
||||
response: APIResponse<Stream<ChatCompletionChunk>>;
|
||||
response: Stream<ChatCompletionChunk>;
|
||||
onLLMStream: (data: StreamCallbackResponse) => void;
|
||||
parentEvent?: Event;
|
||||
}): Promise<{ message: string; role: MessageType }> {
|
||||
|
||||
@@ -22,6 +22,7 @@ export * from "./callbacks/CallbackManager";
|
||||
|
||||
export * from "./readers/base";
|
||||
export * from "./readers/PDFReader";
|
||||
export * from "./readers/CSVReader";
|
||||
export * from "./readers/SimpleDirectoryReader";
|
||||
|
||||
export * from "./storage";
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Document, BaseNode, jsonToNode } from "../Node";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { BaseRetriever } from "../Retriever";
|
||||
import { ServiceContext } from "../ServiceContext";
|
||||
import { StorageContext } from "../storage/StorageContext";
|
||||
import { BaseDocumentStore } from "../storage/docStore/types";
|
||||
import { VectorStore } from "../storage/vectorStore/types";
|
||||
import { BaseIndexStore } from "../storage/indexStore/types";
|
||||
import { BaseNode, Document, jsonToNode } from "../Node";
|
||||
import { BaseQueryEngine } from "../QueryEngine";
|
||||
import { ResponseSynthesizer } from "../ResponseSynthesizer";
|
||||
import { BaseRetriever } from "../Retriever";
|
||||
import { ServiceContext } from "../ServiceContext";
|
||||
import { BaseDocumentStore } from "../storage/docStore/types";
|
||||
import { BaseIndexStore } from "../storage/indexStore/types";
|
||||
import { StorageContext } from "../storage/StorageContext";
|
||||
import { VectorStore } from "../storage/vectorStore/types";
|
||||
|
||||
/**
|
||||
* The underlying structure of each index.
|
||||
@@ -43,7 +43,6 @@ export enum IndexStructType {
|
||||
|
||||
export class IndexDict extends IndexStruct {
|
||||
nodesDict: Record<string, BaseNode> = {};
|
||||
docStore: Record<string, Document> = {}; // FIXME: this should be implemented in storageContext
|
||||
type: IndexStructType = IndexStructType.SIMPLE_DICT;
|
||||
|
||||
getSummary(): string {
|
||||
@@ -65,6 +64,10 @@ export class IndexDict extends IndexStruct {
|
||||
type: this.type,
|
||||
};
|
||||
}
|
||||
|
||||
delete(nodeId: string) {
|
||||
delete this.nodesDict[nodeId];
|
||||
}
|
||||
}
|
||||
|
||||
export function jsonToIndexStruct(json: any): IndexStruct {
|
||||
@@ -148,16 +151,22 @@ export abstract class BaseIndex<T> {
|
||||
retriever?: BaseRetriever;
|
||||
responseSynthesizer?: ResponseSynthesizer;
|
||||
}): BaseQueryEngine;
|
||||
}
|
||||
|
||||
export interface VectorIndexOptions {
|
||||
nodes?: BaseNode[];
|
||||
indexStruct?: IndexDict;
|
||||
indexId?: string;
|
||||
serviceContext?: ServiceContext;
|
||||
storageContext?: StorageContext;
|
||||
}
|
||||
/**
|
||||
* Insert a document into the index.
|
||||
* @param document
|
||||
*/
|
||||
async insert(document: Document) {
|
||||
const nodes = this.serviceContext.nodeParser.getNodesFromDocuments([
|
||||
document,
|
||||
]);
|
||||
await this.insertNodes(nodes);
|
||||
this.docStore.setDocumentHash(document.id_, document.hash);
|
||||
}
|
||||
|
||||
export interface VectorIndexConstructorProps extends BaseIndexInit<IndexDict> {
|
||||
vectorStore: VectorStore;
|
||||
abstract insertNodes(nodes: BaseNode[]): Promise<void>;
|
||||
abstract deleteRefDoc(
|
||||
refDocId: string,
|
||||
deleteFromDocStore?: boolean,
|
||||
): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -1,26 +1,30 @@
|
||||
import _ from "lodash";
|
||||
import { BaseNode, Document } from "../../Node";
|
||||
import { BaseIndex, BaseIndexInit, IndexList } from "../BaseIndex";
|
||||
import { BaseQueryEngine, RetrieverQueryEngine } from "../../QueryEngine";
|
||||
import {
|
||||
StorageContext,
|
||||
storageContextFromDefaults,
|
||||
} from "../../storage/StorageContext";
|
||||
CompactAndRefine,
|
||||
ResponseSynthesizer,
|
||||
} from "../../ResponseSynthesizer";
|
||||
import { BaseRetriever } from "../../Retriever";
|
||||
import {
|
||||
ListIndexRetriever,
|
||||
ListIndexLLMRetriever,
|
||||
} from "./ListIndexRetriever";
|
||||
import {
|
||||
ServiceContext,
|
||||
serviceContextFromDefaults,
|
||||
} from "../../ServiceContext";
|
||||
import { BaseDocumentStore, RefDocInfo } from "../../storage/docStore/types";
|
||||
import _ from "lodash";
|
||||
import {
|
||||
ResponseSynthesizer,
|
||||
CompactAndRefine,
|
||||
} from "../../ResponseSynthesizer";
|
||||
import { IndexStructType } from "../BaseIndex";
|
||||
StorageContext,
|
||||
storageContextFromDefaults,
|
||||
} from "../../storage/StorageContext";
|
||||
import {
|
||||
BaseIndex,
|
||||
BaseIndexInit,
|
||||
IndexList,
|
||||
IndexStructType,
|
||||
} from "../BaseIndex";
|
||||
import {
|
||||
ListIndexLLMRetriever,
|
||||
ListIndexRetriever,
|
||||
} from "./ListIndexRetriever";
|
||||
|
||||
export enum ListRetrieverMode {
|
||||
DEFAULT = "default",
|
||||
@@ -57,7 +61,7 @@ export class ListIndex extends BaseIndex<IndexList> {
|
||||
|
||||
if (options.indexStruct && indexStructs.length > 0) {
|
||||
throw new Error(
|
||||
"Cannot initialize index with both indexStruct and indexStore"
|
||||
"Cannot initialize index with both indexStruct and indexStore",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,7 +71,7 @@ export class ListIndex extends BaseIndex<IndexList> {
|
||||
indexStruct = indexStructs[0];
|
||||
} else if (indexStructs.length > 1 && options.indexId) {
|
||||
indexStruct = (await indexStore.getIndexStruct(
|
||||
options.indexId
|
||||
options.indexId,
|
||||
)) as IndexList;
|
||||
} else {
|
||||
indexStruct = null;
|
||||
@@ -76,25 +80,25 @@ export class ListIndex extends BaseIndex<IndexList> {
|
||||
// check indexStruct type
|
||||
if (indexStruct && indexStruct.type !== IndexStructType.LIST) {
|
||||
throw new Error(
|
||||
"Attempting to initialize ListIndex with non-list indexStruct"
|
||||
"Attempting to initialize ListIndex with non-list indexStruct",
|
||||
);
|
||||
}
|
||||
|
||||
if (indexStruct) {
|
||||
if (options.nodes) {
|
||||
throw new Error(
|
||||
"Cannot initialize VectorStoreIndex with both nodes and indexStruct"
|
||||
"Cannot initialize VectorStoreIndex with both nodes and indexStruct",
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (!options.nodes) {
|
||||
throw new Error(
|
||||
"Cannot initialize VectorStoreIndex without nodes or indexStruct"
|
||||
"Cannot initialize VectorStoreIndex without nodes or indexStruct",
|
||||
);
|
||||
}
|
||||
indexStruct = await ListIndex._buildIndexFromNodes(
|
||||
indexStruct = await ListIndex.buildIndexFromNodes(
|
||||
options.nodes,
|
||||
storageContext.docStore
|
||||
storageContext.docStore,
|
||||
);
|
||||
|
||||
await indexStore.addIndexStruct(indexStruct);
|
||||
@@ -114,7 +118,7 @@ export class ListIndex extends BaseIndex<IndexList> {
|
||||
args: {
|
||||
storageContext?: StorageContext;
|
||||
serviceContext?: ServiceContext;
|
||||
} = {}
|
||||
} = {},
|
||||
): Promise<ListIndex> {
|
||||
let { storageContext, serviceContext } = args;
|
||||
storageContext = storageContext ?? (await storageContextFromDefaults({}));
|
||||
@@ -169,10 +173,10 @@ export class ListIndex extends BaseIndex<IndexList> {
|
||||
return new RetrieverQueryEngine(retriever, responseSynthesizer);
|
||||
}
|
||||
|
||||
static async _buildIndexFromNodes(
|
||||
static async buildIndexFromNodes(
|
||||
nodes: BaseNode[],
|
||||
docStore: BaseDocumentStore,
|
||||
indexStruct?: IndexList
|
||||
indexStruct?: IndexList,
|
||||
): Promise<IndexList> {
|
||||
indexStruct = indexStruct || new IndexList();
|
||||
|
||||
@@ -184,16 +188,43 @@ export class ListIndex extends BaseIndex<IndexList> {
|
||||
return indexStruct;
|
||||
}
|
||||
|
||||
protected _insert(nodes: BaseNode[]): void {
|
||||
async insertNodes(nodes: BaseNode[]): Promise<void> {
|
||||
for (const node of nodes) {
|
||||
this.indexStruct.addNode(node);
|
||||
}
|
||||
}
|
||||
|
||||
protected _deleteNode(nodeId: string): void {
|
||||
async deleteRefDoc(
|
||||
refDocId: string,
|
||||
deleteFromDocStore?: boolean,
|
||||
): Promise<void> {
|
||||
const refDocInfo = await this.docStore.getRefDocInfo(refDocId);
|
||||
|
||||
if (!refDocInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.deleteNodes(refDocInfo.nodeIds, false);
|
||||
|
||||
if (deleteFromDocStore) {
|
||||
await this.docStore.deleteRefDoc(refDocId, false);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
async deleteNodes(nodeIds: string[], deleteFromDocStore: boolean) {
|
||||
this.indexStruct.nodes = this.indexStruct.nodes.filter(
|
||||
(existingNodeId: string) => existingNodeId !== nodeId
|
||||
(existingNodeId: string) => !nodeIds.includes(existingNodeId),
|
||||
);
|
||||
|
||||
if (deleteFromDocStore) {
|
||||
for (const nodeId of nodeIds) {
|
||||
await this.docStore.deleteDocument(nodeId, false);
|
||||
}
|
||||
}
|
||||
|
||||
await this.storageContext.indexStore.addIndexStruct(this.indexStruct);
|
||||
}
|
||||
|
||||
async getRefDocInfo(): Promise<Record<string, RefDocInfo>> {
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import {
|
||||
Document,
|
||||
BaseNode,
|
||||
MetadataMode,
|
||||
NodeWithEmbedding,
|
||||
} from "../../Node";
|
||||
import { BaseNode, Document, MetadataMode } from "../../Node";
|
||||
import { BaseQueryEngine, RetrieverQueryEngine } from "../../QueryEngine";
|
||||
import { VectorIndexRetriever } from "./VectorIndexRetriever";
|
||||
import { ResponseSynthesizer } from "../../ResponseSynthesizer";
|
||||
import { BaseRetriever } from "../../Retriever";
|
||||
import {
|
||||
ServiceContext,
|
||||
serviceContextFromDefaults,
|
||||
} from "../../ServiceContext";
|
||||
import { BaseDocumentStore } from "../../storage/docStore/types";
|
||||
import {
|
||||
StorageContext,
|
||||
storageContextFromDefaults,
|
||||
@@ -17,19 +14,27 @@ import {
|
||||
import { VectorStore } from "../../storage/vectorStore/types";
|
||||
import {
|
||||
BaseIndex,
|
||||
BaseIndexInit,
|
||||
IndexDict,
|
||||
VectorIndexConstructorProps,
|
||||
VectorIndexOptions,
|
||||
IndexStructType
|
||||
IndexStructType,
|
||||
} from "../BaseIndex";
|
||||
import { BaseRetriever } from "../../Retriever";
|
||||
import { ResponseSynthesizer } from "../../ResponseSynthesizer";
|
||||
import { BaseDocumentStore } from "../../storage/docStore/types";
|
||||
import { VectorIndexRetriever } from "./VectorIndexRetriever";
|
||||
|
||||
export interface VectorIndexOptions {
|
||||
nodes?: BaseNode[];
|
||||
indexStruct?: IndexDict;
|
||||
indexId?: string;
|
||||
serviceContext?: ServiceContext;
|
||||
storageContext?: StorageContext;
|
||||
}
|
||||
|
||||
export interface VectorIndexConstructorProps extends BaseIndexInit<IndexDict> {
|
||||
vectorStore: VectorStore;
|
||||
}
|
||||
|
||||
/**
|
||||
* The VectorStoreIndex, an index that stores the nodes only according to their vector embedings.
|
||||
*/
|
||||
|
||||
export class VectorStoreIndex extends BaseIndex<IndexDict> {
|
||||
vectorStore: VectorStore;
|
||||
|
||||
@@ -55,11 +60,11 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
|
||||
|
||||
// Setup IndexStruct from storage
|
||||
let indexStructs = (await indexStore.getIndexStructs()) as IndexDict[];
|
||||
let indexStruct: IndexDict | null;
|
||||
let indexStruct: IndexDict | undefined;
|
||||
|
||||
if (options.indexStruct && indexStructs.length > 0) {
|
||||
throw new Error(
|
||||
"Cannot initialize index with both indexStruct and indexStore"
|
||||
"Cannot initialize index with both indexStruct and indexStore",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -69,53 +74,44 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
|
||||
indexStruct = indexStructs[0];
|
||||
} else if (indexStructs.length > 1 && options.indexId) {
|
||||
indexStruct = (await indexStore.getIndexStruct(
|
||||
options.indexId
|
||||
options.indexId,
|
||||
)) as IndexDict;
|
||||
} else {
|
||||
indexStruct = null;
|
||||
indexStruct = undefined;
|
||||
}
|
||||
|
||||
// check indexStruct type
|
||||
if (indexStruct && indexStruct.type !== IndexStructType.SIMPLE_DICT) {
|
||||
throw new Error(
|
||||
"Attempting to initialize VectorStoreIndex with non-vector indexStruct"
|
||||
"Attempting to initialize VectorStoreIndex with non-vector indexStruct",
|
||||
);
|
||||
}
|
||||
|
||||
if (indexStruct) {
|
||||
if (options.nodes) {
|
||||
throw new Error(
|
||||
"Cannot initialize VectorStoreIndex with both nodes and indexStruct"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (!options.nodes) {
|
||||
throw new Error(
|
||||
"Cannot initialize VectorStoreIndex without nodes or indexStruct"
|
||||
);
|
||||
}
|
||||
indexStruct = await VectorStoreIndex.buildIndexFromNodes(
|
||||
options.nodes,
|
||||
serviceContext,
|
||||
vectorStore,
|
||||
docStore
|
||||
if (!indexStruct && !options.nodes) {
|
||||
throw new Error(
|
||||
"Cannot initialize VectorStoreIndex without nodes or indexStruct",
|
||||
);
|
||||
|
||||
await indexStore.addIndexStruct(indexStruct);
|
||||
}
|
||||
|
||||
// Using the singleton pattern to ensure that only one instance of VectorStoreIndex is created.
|
||||
if (VectorStoreIndex.instance) {
|
||||
throw new Error('VectorStoreIndex has already been initialized');
|
||||
}
|
||||
VectorStoreIndex.instance = new VectorStoreIndex({
|
||||
const nodes = options.nodes ?? [];
|
||||
|
||||
indexStruct = await VectorStoreIndex.buildIndexFromNodes(
|
||||
nodes,
|
||||
serviceContext,
|
||||
vectorStore,
|
||||
docStore,
|
||||
indexStruct,
|
||||
);
|
||||
|
||||
await indexStore.addIndexStruct(indexStruct);
|
||||
|
||||
return new VectorStoreIndex({
|
||||
storageContext,
|
||||
serviceContext,
|
||||
docStore,
|
||||
vectorStore,
|
||||
indexStruct,
|
||||
});
|
||||
return VectorStoreIndex.instance;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,22 +124,20 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
|
||||
static async getNodeEmbeddingResults(
|
||||
nodes: BaseNode[],
|
||||
serviceContext: ServiceContext,
|
||||
logProgress = false
|
||||
logProgress = false,
|
||||
) {
|
||||
const nodesWithEmbeddings: NodeWithEmbedding[] = [];
|
||||
const nodesWithEmbeddings: BaseNode[] = [];
|
||||
|
||||
for (let i = 0; i < nodes.length; ++i) {
|
||||
const node = nodes[i];
|
||||
if (typeof node.getContent !== 'function') {
|
||||
throw new Error('Expected node object of type BaseNode with getContent function');
|
||||
}
|
||||
if (logProgress) {
|
||||
const node = nodes[i];
|
||||
if (logProgress) {
|
||||
console.log(`getting embedding for node ${i}/${nodes.length}`);
|
||||
}
|
||||
const embedding = await serviceContext.embedModel.getTextEmbedding(
|
||||
node.getContent(MetadataMode.EMBED)
|
||||
);
|
||||
nodesWithEmbeddings.push({ node, embedding });
|
||||
}
|
||||
const embedding = await serviceContext.embedModel.getTextEmbedding(
|
||||
node.getContent(MetadataMode.EMBED),
|
||||
);
|
||||
node.embedding = embedding;
|
||||
nodesWithEmbeddings.push(node);
|
||||
}
|
||||
|
||||
return nodesWithEmbeddings;
|
||||
@@ -160,24 +154,33 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
|
||||
nodes: BaseNode[],
|
||||
serviceContext: ServiceContext,
|
||||
vectorStore: VectorStore,
|
||||
docStore: BaseDocumentStore
|
||||
docStore: BaseDocumentStore,
|
||||
indexDict?: IndexDict,
|
||||
): Promise<IndexDict> {
|
||||
const embeddingResults = await this.getNodeEmbeddingResults(
|
||||
nodes,
|
||||
serviceContext
|
||||
indexDict = indexDict ?? new IndexDict();
|
||||
|
||||
// Check if the index already has nodes with the same hash
|
||||
const newNodes = nodes.filter((node) =>
|
||||
Object.entries(indexDict!.nodesDict).reduce((acc, [key, value]) => {
|
||||
if (value.hash === node.hash) {
|
||||
acc = false;
|
||||
}
|
||||
return acc;
|
||||
}, true),
|
||||
);
|
||||
|
||||
vectorStore.add(embeddingResults);
|
||||
const embeddingResults = await this.getNodeEmbeddingResults(
|
||||
newNodes,
|
||||
serviceContext,
|
||||
);
|
||||
|
||||
await vectorStore.add(embeddingResults);
|
||||
|
||||
if (!vectorStore.storesText) {
|
||||
await docStore.addDocuments(
|
||||
embeddingResults.map((result) => result.node),
|
||||
true
|
||||
);
|
||||
await docStore.addDocuments(embeddingResults, true);
|
||||
}
|
||||
|
||||
const indexDict = new IndexDict();
|
||||
for (const { node } of embeddingResults) {
|
||||
for (const node of embeddingResults) {
|
||||
indexDict.addNode(node);
|
||||
}
|
||||
|
||||
@@ -196,7 +199,7 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
|
||||
args: {
|
||||
storageContext?: StorageContext;
|
||||
serviceContext?: ServiceContext;
|
||||
} = {}
|
||||
} = {},
|
||||
): Promise<VectorStoreIndex> {
|
||||
let { storageContext, serviceContext } = args;
|
||||
storageContext = storageContext ?? (await storageContextFromDefaults({}));
|
||||
@@ -225,6 +228,57 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
|
||||
responseSynthesizer?: ResponseSynthesizer;
|
||||
}): BaseQueryEngine {
|
||||
const { retriever, responseSynthesizer } = options ?? {};
|
||||
return new RetrieverQueryEngine(retriever ?? this.asRetriever(), responseSynthesizer);
|
||||
return new RetrieverQueryEngine(
|
||||
retriever ?? this.asRetriever(),
|
||||
responseSynthesizer,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async insertNodes(nodes: BaseNode[]): Promise<void> {
|
||||
const embeddingResults = await VectorStoreIndex.getNodeEmbeddingResults(
|
||||
nodes,
|
||||
this.serviceContext,
|
||||
);
|
||||
|
||||
const newIds = await this.vectorStore.add(embeddingResults);
|
||||
|
||||
if (!this.vectorStore.storesText) {
|
||||
for (let i = 0; i < nodes.length; ++i) {
|
||||
this.indexStruct.addNode(nodes[i], newIds[i]);
|
||||
this.docStore.addDocuments([nodes[i]], true);
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < nodes.length; ++i) {
|
||||
if (nodes[i].getType() === "INDEX") {
|
||||
this.indexStruct.addNode(nodes[i], newIds[i]);
|
||||
this.docStore.addDocuments([nodes[i]], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await this.storageContext.indexStore.addIndexStruct(this.indexStruct);
|
||||
}
|
||||
|
||||
async deleteRefDoc(
|
||||
refDocId: string,
|
||||
deleteFromDocStore: boolean = true,
|
||||
): Promise<void> {
|
||||
this.vectorStore.delete(refDocId);
|
||||
|
||||
if (!this.vectorStore.storesText) {
|
||||
const refDocInfo = await this.docStore.getRefDocInfo(refDocId);
|
||||
|
||||
if (refDocInfo) {
|
||||
for (const nodeId of refDocInfo.nodeIds) {
|
||||
this.indexStruct.delete(nodeId);
|
||||
}
|
||||
}
|
||||
|
||||
await this.storageContext.indexStore.addIndexStruct(this.indexStruct);
|
||||
}
|
||||
|
||||
if (deleteFromDocStore) {
|
||||
await this.docStore.deleteDocument(refDocId, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import OpenAILLM from "openai";
|
||||
import { CallbackManager, Event } from "../callbacks/CallbackManager";
|
||||
import { handleOpenAIStream } from "../callbacks/utility/handleOpenAIStream";
|
||||
import { OpenAISession, getOpenAISession } from "./openai";
|
||||
import OpenAILLM from "openai";
|
||||
import { ReplicateSession } from "./replicate";
|
||||
import {
|
||||
AnthropicSession,
|
||||
ANTHROPIC_AI_PROMPT,
|
||||
ANTHROPIC_HUMAN_PROMPT,
|
||||
AnthropicSession,
|
||||
getAnthropicSession,
|
||||
} from "./anthropic";
|
||||
import {
|
||||
AzureOpenAIConfig,
|
||||
getAzureBaseUrl,
|
||||
getAzureConfigFromEnv,
|
||||
getAzureModel,
|
||||
getAzureBaseUrl,
|
||||
shouldUseAzure,
|
||||
} from "./azure";
|
||||
import { getOpenAISession, OpenAISession } from "./openai";
|
||||
import { ReplicateSession } from "./replicate";
|
||||
|
||||
export type MessageType =
|
||||
| "user"
|
||||
@@ -108,7 +108,7 @@ export class OpenAI implements LLM {
|
||||
|
||||
if (!azureConfig.apiKey) {
|
||||
throw new Error(
|
||||
"Azure API key is required for OpenAI Azure models. Please set the AZURE_OPENAI_KEY environment variable."
|
||||
"Azure API key is required for OpenAI Azure models. Please set the AZURE_OPENAI_KEY environment variable.",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ export class OpenAI implements LLM {
|
||||
}
|
||||
|
||||
mapMessageType(
|
||||
messageType: MessageType
|
||||
messageType: MessageType,
|
||||
): "user" | "assistant" | "system" | "function" {
|
||||
switch (messageType) {
|
||||
case "user":
|
||||
@@ -156,7 +156,7 @@ export class OpenAI implements LLM {
|
||||
|
||||
async chat(
|
||||
messages: ChatMessage[],
|
||||
parentEvent?: Event
|
||||
parentEvent?: Event,
|
||||
): Promise<ChatResponse> {
|
||||
const baseRequestParams: OpenAILLM.Chat.CompletionCreateParams = {
|
||||
model: this.model,
|
||||
@@ -196,7 +196,7 @@ export class OpenAI implements LLM {
|
||||
|
||||
async complete(
|
||||
prompt: string,
|
||||
parentEvent?: Event
|
||||
parentEvent?: Event,
|
||||
): Promise<CompletionResponse> {
|
||||
return this.chat([{ content: prompt, role: "user" }], parentEvent);
|
||||
}
|
||||
@@ -321,7 +321,7 @@ export class LlamaDeuce implements LLM {
|
||||
|
||||
mapMessagesToPromptMeta(
|
||||
messages: ChatMessage[],
|
||||
opts?: { withBos?: boolean; replicate4Bit?: boolean }
|
||||
opts?: { withBos?: boolean; replicate4Bit?: boolean },
|
||||
) {
|
||||
const { withBos = false, replicate4Bit = false } = opts ?? {};
|
||||
const DEFAULT_SYSTEM_PROMPT = `You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
|
||||
@@ -354,7 +354,7 @@ If a question does not make any sense, or is not factually coherent, explain why
|
||||
// @ts-ignore
|
||||
if (messages[0].role !== "user") {
|
||||
throw new Error(
|
||||
"LlamaDeuce: if there is a system message, the second message must be a user message."
|
||||
"LlamaDeuce: if there is a system message, the second message must be a user message.",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ If a question does not make any sense, or is not factually coherent, explain why
|
||||
|
||||
async chat(
|
||||
messages: ChatMessage[],
|
||||
_parentEvent?: Event
|
||||
_parentEvent?: Event,
|
||||
): Promise<ChatResponse> {
|
||||
const api = ALL_AVAILABLE_LLAMADEUCE_MODELS[this.model]
|
||||
.replicateApi as `${string}/${string}:${string}`;
|
||||
@@ -408,7 +408,7 @@ If a question does not make any sense, or is not factually coherent, explain why
|
||||
|
||||
const response = await this.replicateSession.replicate.run(
|
||||
api,
|
||||
replicateOptions
|
||||
replicateOptions,
|
||||
);
|
||||
return {
|
||||
message: {
|
||||
@@ -421,7 +421,7 @@ If a question does not make any sense, or is not factually coherent, explain why
|
||||
|
||||
async complete(
|
||||
prompt: string,
|
||||
parentEvent?: Event
|
||||
parentEvent?: Event,
|
||||
): Promise<CompletionResponse> {
|
||||
return this.chat([{ content: prompt, role: "user" }], parentEvent);
|
||||
}
|
||||
@@ -483,7 +483,7 @@ export class Anthropic implements LLM {
|
||||
|
||||
async chat(
|
||||
messages: ChatMessage[],
|
||||
parentEvent?: Event | undefined
|
||||
parentEvent?: Event | undefined,
|
||||
): Promise<ChatResponse> {
|
||||
const response = await this.session.anthropic.completions.create({
|
||||
model: this.model,
|
||||
@@ -501,7 +501,7 @@ export class Anthropic implements LLM {
|
||||
}
|
||||
async complete(
|
||||
prompt: string,
|
||||
parentEvent?: Event | undefined
|
||||
parentEvent?: Event | undefined,
|
||||
): Promise<CompletionResponse> {
|
||||
return this.chat([{ content: prompt, role: "user" }], parentEvent);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
import { DEFAULT_FS, GenericFileSystem } from "../storage/FileSystem";
|
||||
import Papa, { ParseConfig } from "papaparse";
|
||||
import { BaseReader } from "./base";
|
||||
import { Document } from "../Node";
|
||||
|
||||
/**
|
||||
* papaparse-based csv parser
|
||||
* @class CSVReader
|
||||
* @implements BaseReader
|
||||
*/
|
||||
export class PapaCSVReader implements BaseReader {
|
||||
private concatRows: boolean;
|
||||
private colJoiner: string;
|
||||
private rowJoiner: string;
|
||||
private papaConfig?: ParseConfig;
|
||||
|
||||
/**
|
||||
* Constructs a new instance of the class.
|
||||
* @param {boolean} [concatRows=true] - whether to concatenate all rows into one document.If set to False, a Document will be created for each row.True by default.
|
||||
* @param {string} [colJoiner=', '] - Separator to use for joining cols per row. Set to ", " by default.
|
||||
* @param {string} [rowJoiner='\n'] - Separator to use for joining each row.Only used when `concat_rows=True`.Set to "\n" by default.
|
||||
*/
|
||||
constructor(
|
||||
concatRows: boolean = true,
|
||||
colJoiner: string = ", ",
|
||||
rowJoiner: string = "\n",
|
||||
papaConfig?: ParseConfig
|
||||
) {
|
||||
this.concatRows = concatRows;
|
||||
this.colJoiner = colJoiner;
|
||||
this.rowJoiner = rowJoiner;
|
||||
this.papaConfig = papaConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads data from csv files
|
||||
* @param {string} file - The path to the file to load.
|
||||
* @param {GenericFileSystem} [fs=DEFAULT_FS] - The file system to use for reading the file.
|
||||
* @returns {Promise<Document[]>}
|
||||
*/
|
||||
async loadData(
|
||||
file: string,
|
||||
fs: GenericFileSystem = DEFAULT_FS
|
||||
): Promise<Document[]> {
|
||||
const fileContent: string = await fs.readFile(file, "utf-8");
|
||||
const result = Papa.parse(fileContent, this.papaConfig);
|
||||
const textList = result.data.map((row: any) => {
|
||||
// Compatible with header row mode
|
||||
const rowValues = Object.values(row).map((value) => String(value));
|
||||
return rowValues.join(this.colJoiner);
|
||||
});
|
||||
|
||||
if (this.concatRows) {
|
||||
return [new Document({ text: textList.join(this.rowJoiner) })];
|
||||
} else {
|
||||
return textList.map((text) => new Document({ text }));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { BaseReader } from "./base";
|
||||
import { CompleteFileSystem, walk } from "../storage/FileSystem";
|
||||
import { DEFAULT_FS } from "../storage/constants";
|
||||
import { PDFReader } from "./PDFReader";
|
||||
import { PapaCSVReader } from "./CSVReader";
|
||||
|
||||
/**
|
||||
* Read a .txt file
|
||||
@@ -21,6 +22,7 @@ export class TextFileReader implements BaseReader {
|
||||
const FILE_EXT_TO_READER: Record<string, BaseReader> = {
|
||||
txt: new TextFileReader(),
|
||||
pdf: new PDFReader(),
|
||||
csv: new PapaCSVReader(),
|
||||
};
|
||||
|
||||
export type SimpleDirectoryReaderLoadDataProps = {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { BaseNode, Document, ObjectType, TextNode } from "../../Node";
|
||||
import { BaseDocumentStore, RefDocInfo } from "./types";
|
||||
import { BaseKVStore } from "../kvStore/types";
|
||||
import _, * as lodash from "lodash";
|
||||
import { docToJson, jsonToDoc } from "./utils";
|
||||
import { BaseNode, ObjectType } from "../../Node";
|
||||
import { DEFAULT_NAMESPACE } from "../constants";
|
||||
import { BaseKVStore } from "../kvStore/types";
|
||||
import { BaseDocumentStore, RefDocInfo } from "./types";
|
||||
import { docToJson, jsonToDoc } from "./utils";
|
||||
|
||||
type DocMetaData = { docHash: string; refDocId?: string };
|
||||
|
||||
@@ -32,7 +32,7 @@ export class KVDocumentStore extends BaseDocumentStore {
|
||||
|
||||
async addDocuments(
|
||||
docs: BaseNode[],
|
||||
allowUpdate: boolean = true
|
||||
allowUpdate: boolean = true,
|
||||
): Promise<void> {
|
||||
for (var idx = 0; idx < docs.length; idx++) {
|
||||
const doc = docs[idx];
|
||||
@@ -41,7 +41,7 @@ export class KVDocumentStore extends BaseDocumentStore {
|
||||
}
|
||||
if (!allowUpdate && (await this.documentExists(doc.id_))) {
|
||||
throw new Error(
|
||||
`doc_id ${doc.id_} already exists. Set allow_update to True to overwrite.`
|
||||
`doc_id ${doc.id_} already exists. Set allow_update to True to overwrite.`,
|
||||
);
|
||||
}
|
||||
let nodeKey = doc.id_;
|
||||
@@ -51,17 +51,17 @@ export class KVDocumentStore extends BaseDocumentStore {
|
||||
|
||||
if (doc.getType() === ObjectType.TEXT && doc.sourceNode !== undefined) {
|
||||
let refDocInfo = (await this.getRefDocInfo(doc.sourceNode.nodeId)) || {
|
||||
docIds: [],
|
||||
nodeIds: [],
|
||||
extraInfo: {},
|
||||
};
|
||||
refDocInfo.docIds.push(doc.id_);
|
||||
refDocInfo.nodeIds.push(doc.id_);
|
||||
if (_.isEmpty(refDocInfo.extraInfo)) {
|
||||
refDocInfo.extraInfo = {};
|
||||
}
|
||||
await this.kvstore.put(
|
||||
doc.sourceNode.nodeId,
|
||||
refDocInfo,
|
||||
this.refDocCollection
|
||||
this.refDocCollection,
|
||||
);
|
||||
metadata.refDocId = doc.sourceNode.nodeId!;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ export class KVDocumentStore extends BaseDocumentStore {
|
||||
|
||||
async getDocument(
|
||||
docId: string,
|
||||
raiseError: boolean = true
|
||||
raiseError: boolean = true,
|
||||
): Promise<BaseNode | undefined> {
|
||||
let json = await this.kvstore.get(docId, this.nodeCollection);
|
||||
if (_.isNil(json)) {
|
||||
@@ -131,7 +131,7 @@ export class KVDocumentStore extends BaseDocumentStore {
|
||||
async deleteDocument(
|
||||
docId: string,
|
||||
raiseError: boolean = true,
|
||||
removeRefDocNode: boolean = true
|
||||
removeRefDocNode: boolean = true,
|
||||
): Promise<void> {
|
||||
if (removeRefDocNode) {
|
||||
await this.removeRefDocNode(docId);
|
||||
@@ -147,7 +147,7 @@ export class KVDocumentStore extends BaseDocumentStore {
|
||||
|
||||
async deleteRefDoc(
|
||||
refDocId: string,
|
||||
raiseError: boolean = true
|
||||
raiseError: boolean = true,
|
||||
): Promise<void> {
|
||||
let refDocInfo = await this.getRefDocInfo(refDocId);
|
||||
if (_.isNil(refDocInfo)) {
|
||||
@@ -158,7 +158,7 @@ export class KVDocumentStore extends BaseDocumentStore {
|
||||
}
|
||||
}
|
||||
|
||||
for (let docId of refDocInfo.docIds) {
|
||||
for (let docId of refDocInfo.nodeIds) {
|
||||
await this.deleteDocument(docId, false, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { BaseNode } from "../../Node";
|
||||
import { GenericFileSystem } from "../FileSystem";
|
||||
import {
|
||||
DEFAULT_PERSIST_DIR,
|
||||
DEFAULT_DOC_STORE_PERSIST_FILENAME,
|
||||
DEFAULT_PERSIST_DIR,
|
||||
} from "../constants";
|
||||
import { GenericFileSystem } from "../FileSystem";
|
||||
|
||||
const defaultPersistPath = `${DEFAULT_PERSIST_DIR}/${DEFAULT_DOC_STORE_PERSIST_FILENAME}`;
|
||||
|
||||
export interface RefDocInfo {
|
||||
docIds: string[];
|
||||
nodeIds: string[];
|
||||
extraInfo: Record<string, any>;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export abstract class BaseDocumentStore {
|
||||
// Save/load
|
||||
persist(
|
||||
persistPath: string = defaultPersistPath,
|
||||
fs?: GenericFileSystem
|
||||
fs?: GenericFileSystem,
|
||||
): void {
|
||||
// Persist the docstore to a file.
|
||||
}
|
||||
@@ -24,14 +24,14 @@ export abstract class BaseDocumentStore {
|
||||
// Main interface
|
||||
abstract docs(): Promise<Record<string, BaseNode>>;
|
||||
|
||||
abstract addDocuments(docs: BaseNode[], allowUpdate: boolean): void;
|
||||
abstract addDocuments(docs: BaseNode[], allowUpdate: boolean): Promise<void>;
|
||||
|
||||
abstract getDocument(
|
||||
docId: string,
|
||||
raiseError: boolean
|
||||
raiseError: boolean,
|
||||
): Promise<BaseNode | undefined>;
|
||||
|
||||
abstract deleteDocument(docId: string, raiseError: boolean): void;
|
||||
abstract deleteDocument(docId: string, raiseError: boolean): Promise<void>;
|
||||
|
||||
abstract documentExists(docId: string): Promise<boolean>;
|
||||
|
||||
@@ -50,7 +50,7 @@ export abstract class BaseDocumentStore {
|
||||
// Nodes
|
||||
getNodes(nodeIds: string[], raiseError: boolean = true): Promise<BaseNode[]> {
|
||||
return Promise.all(
|
||||
nodeIds.map((nodeId) => this.getNode(nodeId, raiseError))
|
||||
nodeIds.map((nodeId) => this.getNode(nodeId, raiseError)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import * as path from "path";
|
||||
import _ from "lodash";
|
||||
import { GenericFileSystem, exists } from "../FileSystem";
|
||||
import * as path from "path";
|
||||
import {
|
||||
getTopKEmbeddings,
|
||||
getTopKEmbeddingsLearner,
|
||||
getTopKMMREmbeddings,
|
||||
} from "../../Embedding";
|
||||
import { BaseNode } from "../../Node";
|
||||
import { DEFAULT_FS, DEFAULT_PERSIST_DIR } from "../constants";
|
||||
import { exists, GenericFileSystem } from "../FileSystem";
|
||||
import {
|
||||
VectorStore,
|
||||
VectorStoreQuery,
|
||||
VectorStoreQueryMode,
|
||||
VectorStoreQueryResult,
|
||||
} from "./types";
|
||||
import {
|
||||
getTopKEmbeddings,
|
||||
getTopKEmbeddingsLearner,
|
||||
getTopKMMREmbeddings,
|
||||
} from "../../Embedding";
|
||||
import { DEFAULT_PERSIST_DIR, DEFAULT_FS } from "../constants";
|
||||
import { NodeWithEmbedding } from "../../Node";
|
||||
|
||||
const LEARNER_MODES = new Set<VectorStoreQueryMode>([
|
||||
VectorStoreQueryMode.SVM,
|
||||
@@ -41,7 +41,7 @@ export class SimpleVectorStore implements VectorStore {
|
||||
|
||||
static async fromPersistDir(
|
||||
persistDir: string = DEFAULT_PERSIST_DIR,
|
||||
fs: GenericFileSystem = DEFAULT_FS
|
||||
fs: GenericFileSystem = DEFAULT_FS,
|
||||
): Promise<SimpleVectorStore> {
|
||||
let persistPath = `${persistDir}/vector_store.json`;
|
||||
return await SimpleVectorStore.fromPersistPath(persistPath, fs);
|
||||
@@ -55,29 +55,28 @@ export class SimpleVectorStore implements VectorStore {
|
||||
return this.data.embeddingDict[textId];
|
||||
}
|
||||
|
||||
async add(embeddingResults: NodeWithEmbedding[]): Promise<string[]> {
|
||||
for (let result of embeddingResults) {
|
||||
this.data.embeddingDict[result.node.id_] = result.embedding;
|
||||
async add(embeddingResults: BaseNode[]): Promise<string[]> {
|
||||
for (let node of embeddingResults) {
|
||||
this.data.embeddingDict[node.id_] = node.getEmbedding();
|
||||
|
||||
if (!result.node.sourceNode) {
|
||||
if (!node.sourceNode) {
|
||||
console.error("Missing source node from TextNode.");
|
||||
continue;
|
||||
}
|
||||
|
||||
this.data.textIdToRefDocId[result.node.id_] =
|
||||
result.node.sourceNode?.nodeId;
|
||||
this.data.textIdToRefDocId[node.id_] = node.sourceNode?.nodeId;
|
||||
}
|
||||
|
||||
if (this.persistPath) {
|
||||
await this.persist(this.persistPath, this.fs);
|
||||
}
|
||||
|
||||
return embeddingResults.map((result) => result.node.id_);
|
||||
return embeddingResults.map((result) => result.id_);
|
||||
}
|
||||
|
||||
async delete(refDocId: string): Promise<void> {
|
||||
let textIdsToDelete = Object.keys(this.data.textIdToRefDocId).filter(
|
||||
(textId) => this.data.textIdToRefDocId[textId] === refDocId
|
||||
(textId) => this.data.textIdToRefDocId[textId] === refDocId,
|
||||
);
|
||||
for (let textId of textIdsToDelete) {
|
||||
delete this.data.embeddingDict[textId];
|
||||
@@ -89,7 +88,7 @@ export class SimpleVectorStore implements VectorStore {
|
||||
async query(query: VectorStoreQuery): Promise<VectorStoreQueryResult> {
|
||||
if (!_.isNil(query.filters)) {
|
||||
throw new Error(
|
||||
"Metadata filters not implemented for SimpleVectorStore yet."
|
||||
"Metadata filters not implemented for SimpleVectorStore yet.",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -115,7 +114,7 @@ export class SimpleVectorStore implements VectorStore {
|
||||
queryEmbedding,
|
||||
embeddings,
|
||||
query.similarityTopK,
|
||||
nodeIds
|
||||
nodeIds,
|
||||
);
|
||||
} else if (query.mode === MMR_MODE) {
|
||||
let mmrThreshold = query.mmrThreshold;
|
||||
@@ -125,14 +124,14 @@ export class SimpleVectorStore implements VectorStore {
|
||||
null,
|
||||
query.similarityTopK,
|
||||
nodeIds,
|
||||
mmrThreshold
|
||||
mmrThreshold,
|
||||
);
|
||||
} else if (query.mode === VectorStoreQueryMode.DEFAULT) {
|
||||
[topSimilarities, topIds] = getTopKEmbeddings(
|
||||
queryEmbedding,
|
||||
embeddings,
|
||||
query.similarityTopK,
|
||||
nodeIds
|
||||
nodeIds,
|
||||
);
|
||||
} else {
|
||||
throw new Error(`Invalid query mode: ${query.mode}`);
|
||||
@@ -146,7 +145,7 @@ export class SimpleVectorStore implements VectorStore {
|
||||
|
||||
async persist(
|
||||
persistPath: string = `${DEFAULT_PERSIST_DIR}/vector_store.json`,
|
||||
fs?: GenericFileSystem
|
||||
fs?: GenericFileSystem,
|
||||
): Promise<void> {
|
||||
fs = fs || this.fs;
|
||||
let dirPath = path.dirname(persistPath);
|
||||
@@ -159,7 +158,7 @@ export class SimpleVectorStore implements VectorStore {
|
||||
|
||||
static async fromPersistPath(
|
||||
persistPath: string,
|
||||
fs?: GenericFileSystem
|
||||
fs?: GenericFileSystem,
|
||||
): Promise<SimpleVectorStore> {
|
||||
fs = fs || DEFAULT_FS;
|
||||
|
||||
@@ -174,7 +173,7 @@ export class SimpleVectorStore implements VectorStore {
|
||||
dataDict = JSON.parse(fileData.toString());
|
||||
} catch (e) {
|
||||
console.error(
|
||||
`No valid data found at path: ${persistPath} starting new store.`
|
||||
`No valid data found at path: ${persistPath} starting new store.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { BaseNode } from "../../Node";
|
||||
import { GenericFileSystem } from "../FileSystem";
|
||||
import { NodeWithEmbedding } from "../../Node";
|
||||
|
||||
export interface VectorStoreQueryResult {
|
||||
nodes?: BaseNode[];
|
||||
@@ -62,7 +61,7 @@ export interface VectorStore {
|
||||
storesText: boolean;
|
||||
isEmbeddingQuery?: boolean;
|
||||
client(): any;
|
||||
add(embeddingResults: NodeWithEmbedding[]): Promise<string[]>;
|
||||
add(embeddingResults: BaseNode[]): Promise<string[]>;
|
||||
delete(refDocId: string, deleteKwargs?: any): Promise<void>;
|
||||
query(query: VectorStoreQuery, kwargs?: any): Promise<VectorStoreQueryResult>;
|
||||
persist(persistPath: string, fs?: GenericFileSystem): Promise<void>;
|
||||
|
||||
Generated
+570
-374
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,3 +1,3 @@
|
||||
module.exports = {
|
||||
plugins: [require("prettier-plugin-tailwindcss")],
|
||||
plugins: ["prettier-plugin-organize-imports"],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user