Compare commits

..

385 Commits

Author SHA1 Message Date
Yi Ding eb0e9947f2 changesets 2023-10-07 15:56:42 -07:00
Yi Ding 23a09cff1b export PromptHelper 2023-10-07 15:54:35 -07:00
Yi Ding ebe9041fdc esm module 2023-10-07 14:07:16 -07:00
Yi Ding f93ef09b58 upgrade packages 2023-10-07 13:48:44 -07:00
Yi Ding e74cfb93b5 package upgrades 2023-10-07 13:32:09 -07:00
yisding 4a44621f87 Merge pull request #138 from run-llama/feat/improve-chat-history-summarizer
feat: improved chat history summarizer
2023-10-05 18:37:35 -07:00
Yi Ding c7acaa2f5e fix test 2023-10-05 15:50:11 -07:00
Yi Ding 139abad1f4 changeset 2023-10-05 15:02:35 -07:00
Marcus Schiesser a3a5306f11 feat: improved chat history summarizer 2023-10-05 17:14:19 +07:00
yisding fb1c3bc446 Merge pull request #130 from Einsenhorn/einsenhorn/from_vector_store
VectorStore - Add Method "VectorStoreIndex.fromVectorStore" + Prefilters + Pinecone Demo
2023-10-03 14:48:39 -07:00
yisding aaf344a4dd Merge pull request #133 from noble-varghese/noble-varghese/portkey-integration
feat: Portkey integration with LLamaIndexTS
2023-10-03 14:48:16 -07:00
Yi Ding 62ca9c0ed2 fix lint errors and change spelling of organization 2023-10-03 11:57:07 -07:00
Louis de Courcel dc8be8740d impr: add a simple example to show pinecone query with prefilters 2023-10-03 11:23:44 -07:00
Louis de Courcel d9bcf4df92 impr: add fromVectorStore method 2023-10-03 11:22:17 -07:00
yisding 7ceb94f9c2 Merge pull request #131 from kkang2097/chat-queryengine-streaming
ChatEngine streaming [needs merge]
2023-10-03 11:12:12 -07:00
Elliot Kang 2e5becb4fb Update LLM.ts - anthropic comment 2023-09-30 15:17:03 -07:00
Elliot Kang 5e12f568bd formatting 2023-09-30 14:10:55 -07:00
Elliot Kang 80382c0bf9 fix example + bugfixes 2023-09-30 13:50:11 -07:00
Elliot Kang 91150d4150 Updated Anthropic Stream Token 2023-09-30 13:49:54 -07:00
Elliot Kang 6bfc38db53 pnpm run format 2023-09-30 12:20:11 -07:00
Elliot Kang 95b99db199 example fix 2023-09-30 12:18:31 -07:00
Elliot Kang 1b13395e65 Anthropic steaming support 2023-09-30 12:18:17 -07:00
Elliot Kang fe21904b53 added AnthropicStreamToken type 2023-09-30 12:18:02 -07:00
Elliot Kang ab0d666f03 fixed imports, moved llmStrem example 2023-09-30 11:46:54 -07:00
Elliot Kang 30add7a765 add chatEngine example 2023-09-29 12:00:39 -07:00
Elliot Kang 83971a1913 revert interface change 2023-09-28 16:27:28 -07:00
Elliot Kang 2f62081683 pnpm run format 2023-09-28 16:26:07 -07:00
Elliot Kang c7eb81dfa4 camelcase 2023-09-28 16:23:20 -07:00
Elliot Kang 9f35f526e0 Updated ChatEngine interface
- makes chatEngine auto-set return type like LLM.ts
- added streaming support for some chatEngines
2023-09-28 16:21:06 -07:00
Elliot Kang e755a63250 fixed example based on new interface 2023-09-28 16:11:30 -07:00
Elliot Kang 29c6b62ba1 Updated LLM interface
- auto-sets return types based on streaming flag
2023-09-28 16:11:13 -07:00
noble-varghese 9d69903c36 fix: fixing the baseURL param 2023-09-28 18:44:55 +05:30
noble-varghese 51475a9290 docs: Added more examples 2023-09-28 17:45:10 +05:30
noble-varghese a9e794bde9 feat: Portkey integration with LLamaIndexTs 2023-09-28 17:27:39 +05:30
Elliot Kang 5114a7aa27 type fix + stream_chat for ChatEngines
- fixed chatModel type for ContextChatEngine
- added stream_chat for severl ChatEngines
2023-09-26 17:10:28 -07:00
Elliot Kang d14042e536 added optional streaming for QueryEngine 2023-09-26 17:09:02 -07:00
Elliot Kang 7819fca349 make stream_chat optional, +streaming to basicChatEngine 2023-09-26 16:43:53 -07:00
Yi Ding 68d9cfb550 0.0.29 2023-09-26 15:34:36 -07:00
Yi Ding 1b7fd95214 changeset and fixed test case bug 2023-09-26 15:30:38 -07:00
yisding 0a1e6ccf9a Merge pull request #129 from kkang2097/streaming-support
Fixed Streaming Support for OpenAI LLM [Needs Review]
2023-09-26 15:25:33 -07:00
Yi Ding 0db3f415a8 changeset 2023-09-26 13:41:40 -07:00
Yi Ding 8a1385b9d0 migrated to tiktoken lite
Hopefully fixes the Windows issue
2023-09-26 13:40:37 -07:00
Yi Ding a52143b0ef changeset and package update 2023-09-26 12:42:13 -07:00
yisding 75ec41c85a Merge pull request #128 from jayantasamaddar/jayanta/docx-reader
Added DocxReader, adding support for reading .docx files.
2023-09-26 12:38:44 -07:00
Elliot Kang 827c8b3c48 remove spaghetti 2023-09-25 01:21:23 -07:00
Elliot Kang 194b35d889 move event creation out of loop 2023-09-24 22:24:26 -07:00
Elliot Kang 1b33523537 made events optional in stream_chat 2023-09-24 22:16:20 -07:00
Elliot Kang 807b95597a pnpm run format (prettier) 2023-09-24 21:02:49 -07:00
Elliot Kang 14b1ffa413 OpenAI LLM streaming + callbacks demo
- this makes it easy for people to add logging/token tracking
- "for await" logic becomes even more elegant
2023-09-24 21:00:11 -07:00
Elliot Kang d1db4d5534 Final fixes, sanity checks on types
- expanded LLM interface
- cleaned up OpenAI LLM stream
- simplified types in CallbackManager
-> CallbackResponse should require Token I think, we already have the StreamToken inside of the LLM's stream_chat anyways
2023-09-24 20:57:30 -07:00
Elliot Kang a45c0e537f Update LLM interface
standardizing streaming behavior for LLMs
2023-09-23 22:07:49 -07:00
Elliot Kang 4dab9b8fa3 Update LLM.ts 2023-09-23 21:56:32 -07:00
Elliot Kang a84f8ba5d6 Remove in re-factor 2023-09-23 21:56:24 -07:00
Elliot Kang f6f5cab661 Update llm_stream.ts 2023-09-23 21:56:06 -07:00
Elliot Kang 618f563ce9 LLM Stream example, need to flesh out more 2023-09-23 21:51:06 -07:00
Elliot Kang 5b49c90538 Fixed streaming for OpenAI
- stream support was actually broken
2023-09-23 21:49:26 -07:00
Elliot Kang 41be0003f1 Not every StreamResponse fits into StreamToken
- adds flexibility to our CallbackResponse interface
2023-09-23 21:47:58 -07:00
Jayanta Samaddar 8f8ee28ba0 Added DocxReader, adding support for reading .docx files. Made changes to relevant docs as well. 2023-09-23 06:23:17 +05:30
Yi Ding b3ae7fbb49 0.0.28 2023-09-14 10:47:13 -07:00
Yi Ding 837854de1e rolled back notion package and changeset 2023-09-14 10:41:00 -07:00
yisding 8cc1f0726f Merge pull request #112 from kkang2097/fix-output-parser
Create OutputParser.test.ts [Needs Merge]
2023-09-14 09:32:35 -07:00
yisding e1d617ef70 Merge pull request #122 from kevinlu1248/patch-1
Update sweep.yaml with newest sandbox format
2023-09-13 20:49:22 -07:00
Kevin Lu 5f199d68f9 Update sweep.yaml 2023-09-13 18:49:11 -07:00
Elliot Kang b8cca2db97 make parseJsonMarkdown exportable 2023-09-13 15:30:55 -07:00
Elliot Kang 35e959219d prettify OutputParser 2023-09-12 17:14:39 -07:00
Elliot Kang 08d466faee Ported Python _marshall_llm_to_json
From the Python side:
- output_parsers/utils

We'll still call this parseJsonMarkdown on the TS side
2023-09-12 17:13:02 -07:00
Yi Ding 0b5823f451 updated packages 2023-09-11 21:53:15 -07:00
Elliot Kang c77b150c28 hardcoding single JSON object case 2023-09-11 15:24:07 -07:00
Elliot Kang 3cf27bb838 Okay, should be final version. 2023-09-11 14:55:50 -07:00
Elliot Kang 26a90435c7 Revert "Simplified OutputParser"
This reverts commit ff0e831da9.
2023-09-11 14:55:07 -07:00
Elliot Kang f6efaba906 Update OutputParser.test.ts
- test cases are much simpler now.
2023-09-11 14:46:21 -07:00
Elliot Kang ff0e831da9 Simplified OutputParser 2023-09-11 14:46:01 -07:00
Yi Ding 96bb65723a changesets 2023-09-11 11:14:17 -07:00
Yi Ding 33ac4bc424 changelog typo 2023-09-11 10:45:27 -07:00
yisding 698503b467 Merge pull request #108 from run-llama/sweep/fix-broken-link-summary-index
Fix broken link to Summary Index in end_to_end.md: Typo correction
2023-09-11 10:33:52 -07:00
yisding 0657525d40 Merge pull request #99 from kkang2097/main
Add MongoReader [Needs merge]
2023-09-11 10:33:01 -07:00
Yi Ding 064d0de531 fix lint 2023-09-11 10:31:37 -07:00
Elliot Kang 471bf36a7b Delete MongoReader.ts 2023-09-11 10:19:40 -07:00
Elliot Kang cb7d2b4040 Revert "commit cleanup"
This reverts commit 3dd334c6db5b211080e7a0b269e58e160914acc2.
2023-09-11 10:19:38 -07:00
Elliot Kang 6032cbcf45 Fixed typing to be more restrictive
- Should have done this in the beginning, {Key:Value} objects should always be defined by Record<string, any>
2023-09-11 10:18:13 -07:00
Elliot Kang 73785d7552 Run Prettier, minor fixes
-changed .limit(Infinity) to .limit(0) in readers/SimpleMongoReader.ts
2023-09-11 10:18:13 -07:00
Elliot Kang 431b5ffa59 rename to simpleMongoReader 2023-09-11 10:18:13 -07:00
Elliot Kang c0500a0d4d SimpleMongoReader demo 2023-09-11 10:18:13 -07:00
Yi Ding 5300534188 commit cleanup 2023-09-11 10:17:49 -07:00
Elliot Kang 02192a5f53 Create MongoReader.ts 2023-09-11 10:15:55 -07:00
Elliot Kang 2a98d5b8ee Add MongoReader 2023-09-11 10:15:55 -07:00
yisding 4f495b5fc6 Merge pull request #110 from TomPenguin/extend-document-type
Enhancing Type Safety for metadata
2023-09-11 10:12:39 -07:00
Elliot Kang b75e2d23a2 re-ordering logic for parser
- previous iteration ran the computation twice if we had an unexpected output format
- added comment for future use
2023-09-11 01:16:31 -07:00
Elliot Kang 5261cdc794 Update OutputParser.test.ts
removing comment
2023-09-10 21:52:57 -07:00
Elliot Kang b179f61c6f Update OutputParser.ts
Essentially, we're giving OutputParser an option to parse List[JSON object] in case our LLM doesn't give us the exact output we want.
2023-09-10 21:39:41 -07:00
Elliot Kang 71b245ad6f Update OutputParser.test.ts
added new test cases, our LLM is not guaranteed to give us the exact formatted output.
2023-09-10 21:36:16 -07:00
Elliot Kang 5b070cf87a Add new test, this one fails
- fix this after adding all tests
2023-09-10 20:19:38 -07:00
Elliot Kang b8afe0b364 Update OutputParser.test.ts
- initial version of test script
2023-09-10 19:57:07 -07:00
Elliot Kang 92b4ec48f7 Create OutputParser.test.ts
- SubQuestionOutputParser is not working as expected, writing some tests to check it out.

QuestionGenerator outputs a list of objects in string format, which is unexpected.

In particular:
"[{prompt: "smth", response: "nothing"}]"
2023-09-10 05:00:09 -07:00
TomPenguin 6a69ac997d Type-safe Metadata 2023-09-09 12:02:33 +09:00
Yi Ding 8c542c30a9 0.0.27 2023-09-08 08:49:27 -07:00
Yi Ding 5c59f93138 copy over example 2023-09-08 08:46:31 -07:00
Yi Ding 4a5591be75 changeset 2023-09-08 08:45:58 -07:00
yisding e756764398 Merge pull request #100 from marcusschiesser/feat/summarize-chat-history
feat: added draft for a summarizer of the chat history
2023-09-08 08:43:39 -07:00
yisding 568b9c3a4c Merge pull request #98 from TomPenguin/add-support-notion-db
Add Notion database support to NotionReader
2023-09-08 06:50:38 -07:00
yisding 13a4aa5212 Merge pull request #92 from swk777/larry/keyword
support keyword index
2023-09-08 06:50:02 -07:00
sweep-ai[bot] a8388c841f Updated apps/docs/docs/end_to_end.md 2023-09-06 21:22:28 +00:00
Marcus Schiesser 87f1f59855 feat: added draft for a summarizer of the chat history 2023-09-05 14:00:47 +07:00
TomPenguin c8c67d2a3d add doc comments 2023-09-04 10:37:50 +09:00
TomPenguin a042fa0b9a add options 2023-09-04 10:14:50 +09:00
TomPenguin b68d870599 support notion db by using notion-md-crawler 2023-09-04 09:03:42 +09:00
Yi Ding 2c63f10dca 0.0.26 2023-09-02 12:17:31 -07:00
yisding 7b8e2d0dc7 Merge pull request #94 from TomPenguin/add-notion-reader
Add NotionReader
2023-09-02 12:16:16 -07:00
Yi Ding 5bb55bcc7d changeset and bug fix 2023-09-02 12:14:30 -07:00
Yi Ding 08c49b0d5f more demo work 2023-09-02 12:11:52 -07:00
Yi Ding 5b07c8adc6 beefed up notion example 2023-09-02 11:52:20 -07:00
TomPenguin ca7e61c701 Mod import bug 2023-09-01 16:21:39 +09:00
TomPenguin 6795df10bd Update md-utils-ts 2023-09-01 16:21:12 +09:00
swk777 1e98a35953 replace rake-pos 2023-09-01 15:08:19 +08:00
Yi Ding 2ab3fedf8f adding test script 2023-08-31 22:50:27 -07:00
TomPenguin 915fc33dd7 Add NotionReader 2023-08-31 17:06:49 -07:00
Yi Ding c79a5359b1 minor changes 2023-08-31 16:45:48 -07:00
swk777 632f176cdd fix error 2023-08-31 16:24:13 -07:00
swk777 99e7857ac8 remove comment 2023-08-31 16:24:13 -07:00
swk777 9ff3837e49 add test case 2023-08-31 16:24:13 -07:00
swk777 6c91d0da5a add example 2023-08-31 16:24:13 -07:00
swk777 12dd3c5eea add keyword index and retriever 2023-08-31 16:24:11 -07:00
Yi Ding 04da822826 0.0.25 2023-08-30 13:09:54 -07:00
Yi Ding 40a8f0775e updated exports for storage/index.ts 2023-08-30 12:06:58 -07:00
yisding 65aaebe2b5 Merge pull request #93 from andfk/patch-1
Update README.md for apps example
2023-08-30 06:20:40 -07:00
Andrés F 769559279f Update README.md
The commands should be inverted
2023-08-30 18:13:00 +08:00
Yi Ding bb7fd38c46 removing the newline to space embedding conversion
https://github.com/openai/openai-python/issues/418
2023-08-29 22:35:41 -07:00
Yi Ding a734927a42 upgrade prettier and prettiered 2023-08-29 20:30:02 -07:00
Yi Ding e21eca2a16 updated packages and README 2023-08-29 20:24:29 -07:00
Yi Ding 33c8c2fe47 documentation update for SummaryIndex 2023-08-29 14:06:12 -07:00
Yi Ding c3048858e9 0.0.24 2023-08-29 12:34:21 -07:00
Yi Ding 259fe63ceb strong types for prompts 2023-08-29 12:33:46 -07:00
Yi Ding d1aa3b7982 more changes for the summary index 2023-08-29 09:41:23 -07:00
Yi Ding e4af7b3a53 renamed listindex to summaryindex
Better aligns with what the index is used for
2023-08-29 09:32:04 -07:00
Yi Ding 51bd392fed 0.0.23 2023-08-25 12:28:06 -07:00
yisding 9bc4a2c564 Merge pull request #91 from TomPenguin/customizable-metadatamode
Added property to set MetadataMode to ResponseSynthesizer
2023-08-25 12:10:05 -07:00
yisding 550d28388a Merge branch 'main' into customizable-metadatamode 2023-08-25 09:49:44 -07:00
TomPenguin e073b4f81b fix 2023-08-25 15:29:36 +09:00
yisding fc0fdb5e37 Merge pull request #82 from swk777/larry/md
add markdown reader
2023-08-24 16:47:06 -07:00
Yi Ding 9d6b2ed937 changeset 2023-08-24 16:45:21 -07:00
Yi Ding 86468b9552 minor comment change 2023-08-24 16:31:58 -07:00
swk777 8c1b76f3c3 add example to simple 2023-08-24 16:22:53 -07:00
swk777 6fc6a499ec add markdown reader 2023-08-24 16:22:27 -07:00
Yi Ding 293b83c3df 0.0.22 2023-08-23 23:19:41 -07:00
Yi Ding 99df58f6d2 openai and anthropic upgrade 2023-08-23 23:19:10 -07:00
Yi Ding 454f3f84b2 changesets 2023-08-23 23:10:58 -07:00
Yi Ding 2d558c3963 stop splitting sentences by default 2023-08-23 23:06:25 -07:00
Yi Ding 055b49936a cjk support for text splitter (thanks @TomPenguin) 2023-08-23 23:06:25 -07:00
Yi Ding 48289c3c5a 0.0.21 2023-08-22 23:42:21 -07:00
Yi Ding 0a09de2ed7 OpenAI 4.1.0 2023-08-22 23:41:22 -07:00
Yi Ding f7a57ca3e2 fixed metadata deserialization
add changesets
2023-08-22 23:34:13 -07:00
Yi Ding cfa93a78a3 add chatgpt optimized prompts 2023-08-22 23:28:49 -07:00
Yi Ding e4e616ee56 add line number link 2023-08-22 22:44:00 -07:00
yisding 5cf2d243f0 Merge pull request #88 from run-llama/docs-work
Docs work
2023-08-22 22:30:41 -07:00
Yi Ding 0a35c4f1c7 removing the import of the README into API docs 2023-08-22 22:28:29 -07:00
Yi Ding 4b94ff7492 remove api docs from repo
It gets regenerated on build so removing them prevents thrashing
2023-08-22 21:58:31 -07:00
Yi Ding aacc0b47c0 0.20.0 2023-08-19 18:24:48 -07:00
Yi Ding b526a2d9cf openai updates (should allow proxy servers) 2023-08-19 18:22:37 -07:00
Yi Ding af32450eca 0.0.19 2023-08-16 18:15:25 -07:00
yisding 8664f73855 Merge pull request #80 from swk777/larry/reader
feat: add CSV loader
2023-08-16 18:03:55 -07:00
Yi Ding 8bfa53fe66 docs change 2023-08-16 18:01:44 -07:00
Yi Ding 16ad029335 updated example 2023-08-16 17:59:57 -07:00
Yi Ding 82bd6228b8 update docs 2023-08-16 17:10:27 -07:00
Yi Ding a747f28999 changeset 2023-08-16 17:08:11 -07:00
swk777 142310bd63 modify demo 2023-08-16 17:06:08 -07:00
swk777 67c8b6536a add papa config 2023-08-16 17:06:08 -07:00
swk777 efc0e2e0ae add csv loader 2023-08-16 17:06:06 -07:00
yisding 0aa0129be9 Merge pull request #81 from run-llama/remove-node-with-embedding
remove NodeWithEmbedding and upgrade to OpenAI v4
2023-08-16 17:01:54 -07:00
Yi Ding 355910bade changeset 2023-08-16 16:57:05 -07:00
Yi Ding 74ab63232b update docs 2023-08-16 16:57:05 -07:00
Yi Ding 90418fa4ec upgrade packages 2023-08-16 16:57:05 -07:00
Yi Ding 8983e9b0f0 remove package-lock.json from examples
So they always run on the latest lits release
2023-08-16 16:57:05 -07:00
Yi Ding cc4bac899e remove node with embedding 2023-08-16 16:57:05 -07:00
Yi Ding 82f30f5637 0.0.18 2023-08-15 09:23:44 -07:00
Yi Ding ade9d8fb8e changeset 2023-08-15 09:16:37 -07:00
yisding 402152f96b Merge pull request #70 from swk777/larry/session
Fix OpenAIEmbedding Fails to Retrieve Session from Parameters When No…
2023-08-15 09:13:34 -07:00
yisding a43d76d4a7 Merge pull request #79 from run-llama/vectorstore-doccompare
allow adding of nodes with hash comparisons
2023-08-15 09:04:01 -07:00
Yi Ding 824c13cb85 changesets 2023-08-15 08:51:26 -07:00
Yi Ding 0904d3dc5d allow adding of nodes with hash comparisons
Allows our scripts to be run repeatedly with vector store backing and
persistence without throwing an error.

This is rudimentary support which doesn't work if the document has
changed over time.

Also added the insert and delete functions so that documents can be
added manually.
2023-08-15 08:49:06 -07:00
swk777 978ef781e4 Fix OpenAIEmbedding Fails to Retrieve Session from Parameters When Not Using Azure 2023-08-14 15:13:29 +08:00
Yi Ding 18b8915f22 changeset 2023-08-09 15:20:09 -07:00
Yi Ding 9bbfc2414e example npm update 2023-08-09 14:50:38 -07:00
yisding 9487aa1ed5 Merge pull request #65 from TomPenguin/export-store
Export storage
2023-08-09 06:30:27 -07:00
TomPenguin fd74c52fe8 export storage 2023-08-09 18:13:27 +09:00
Yi Ding 0d2bf51a2e 0.0.17 2023-08-08 18:13:08 -07:00
yisding 551c0edadf Merge pull request #64 from run-llama/llama2-fixes
Llama2 4bit support
2023-08-08 18:10:26 -07:00
Yi Ding f80b06293b changed default temp to 0.1 2023-08-08 17:28:56 -07:00
Yi Ding b3fec86413 Llama2 fixes with 4 bit model support 2023-08-08 17:22:42 -07:00
Yi Ding ab886a34d7 add other @tyre PR to the CHANGELOG 2023-08-07 06:46:11 -07:00
Yi Ding 1ec9da120e 0.0.16 2023-08-07 06:30:23 -07:00
yisding 817178272d Merge pull request #59 from run-llama/azure
add azure OpenAI
2023-08-07 06:28:40 -07:00
Yi Ding 3316c6b41c add azure OpenAI
Update OpenAI v4 to latest beta and fixed a few bugs
2023-08-07 06:23:47 -07:00
Yi Ding 9214b0669d fix persistence bug 2023-08-04 23:33:16 -07:00
yisding b3d659b9af Merge pull request #58 from tyre/index-constructor
add constructor to index node so it keeps passed-in indexId
2023-08-02 14:37:25 -07:00
Chris Maddox 05b0fca610 add constructor to index node so it keeps passed-in indexId 2023-08-02 22:33:20 +02:00
yisding 64b909f436 Merge pull request #57 from tyre/typed-filters
add a filter type to exact match filters
2023-08-01 16:09:11 -07:00
Chris Maddox a2e6299aaa add a filter type to exact match filters 2023-08-02 01:04:28 +02:00
yisding 1fbfcab55e Merge pull request #55 from run-llama/repo-maintenance
Repo maintenance
2023-08-01 08:15:39 -07:00
Yi Ding 7db567ea74 remove unnecessary package-lock.json from docs
Also ran some upgrades on npm/pnpm
pnpm install should install the right packages without the
package-lock.json in the docs folder
2023-08-01 08:11:12 -07:00
Yi Ding 6354c16776 add the docs/api folder back in 2023-08-01 08:01:59 -07:00
Yi Ding eb4c3dd3c7 Revert "try replacing CONTRIBUTING and README with symlinks"
This reverts commit 8a4330132c.

Symlinks didn't quite work
2023-07-31 22:54:31 -07:00
Yi Ding 8a4330132c try replacing CONTRIBUTING and README with symlinks
Avoid duplication
2023-07-31 22:49:48 -07:00
Yi Ding f2d4f828d4 repo maintenance
upgrade packages
update docs
update README and CONTRIBUTING
2023-07-31 22:47:13 -07:00
Yi Ding fe8030a9ad updated docs and removed trim vuln
dependabot was complaining about the trim version in the docusaurus so
pinned it to a non-vuln version
2023-07-31 10:50:43 -07:00
Yi Ding ec12633ae0 changeset for #54 2023-07-31 10:30:16 -07:00
yisding 5e24733e41 Merge pull request #54 from tyre/async-vector-stores
make VectorStore function signatures unique, export VectorStore types
2023-07-31 10:23:12 -07:00
Chris Maddox a13911435f make VectorStore function signatures unique, export VectorStore types to allow for extensions 2023-07-31 19:15:50 +02:00
Yi Ding 857bb4596a 0.0.15 2023-07-31 00:29:57 -07:00
yisding 1359de75b5 Merge pull request #52 from run-llama/anthropic
Anthropic support
2023-07-31 00:28:51 -07:00
Yi Ding f9d1a6e013 add top P 2023-07-31 00:27:09 -07:00
Yi Ding b18e1228a8 have examples use snapshot build 2023-07-29 19:37:59 -07:00
Yi Ding b501eb5a19 anthropic support 2023-07-29 19:35:14 -07:00
Yi Ding bfab1d407b 0.0.14 2023-07-27 21:02:20 -07:00
Yi Ding 4ef334a70f changesets 2023-07-27 21:01:13 -07:00
yisding af60503115 Merge pull request #45 from run-llama/sweep/add-docstrings
Add missing docstrings to NodeParser.ts and handleOpenAIStream.ts
2023-07-27 20:59:07 -07:00
Yi Ding b3a7a9df2c slight update 2023-07-27 20:57:52 -07:00
Yi Ding 6b90e4c1b3 updated docs 2023-07-27 20:56:59 -07:00
sweep-ai[bot] 108634b94f Merge main into sweep/add-docstrings 2023-07-28 03:53:24 +00:00
yisding 4bb92be1e4 Merge pull request #47 from run-llama/better-deuce
add meta delimitation strategy for llama2
2023-07-27 20:53:21 -07:00
sweep-ai[bot] 7678d319f2 Merge main into sweep/add-docstrings 2023-07-28 03:45:48 +00:00
yisding aaff02bc4b Merge pull request #48 from ysak-y/modify_bug_of_vector_store_index
[BUG FIX] Use retriever from argument if exist in asQueryEngine of VectorStoreIndex
2023-07-27 20:45:45 -07:00
yoshiaki-yamada 34f5398f41 refactor: Integrate some module imports from BaseIndex 2023-07-28 11:43:17 +09:00
yoshiaki-yamada c06d1e5b09 fix: Use retriever from argument if exist in asQueryEngine 2023-07-28 11:42:01 +09:00
Yi Ding 0af7773c40 add meta delimitation strategy for llama2 2023-07-27 18:00:09 -07:00
sweep-ai[bot] a44ee19114 Merge main into sweep/add-docstrings 2023-07-27 23:46:24 +00:00
Yi Ding 2726e375ea remove storage from gitignore 2023-07-27 16:46:07 -07:00
sweep-ai[bot] b599813600 Merge main into sweep/add-docstrings 2023-07-27 15:25:52 +00:00
Yi Ding bea4af984f fix sentence splitter overlap logic 2023-07-27 08:24:38 -07:00
sweep-ai[bot] 5dbbb7d4c1 Update packages/core/src/NodeParser.ts 2023-07-27 08:23:43 +00:00
sweep-ai[bot] c8ea424c7a Update packages/core/src/callbacks/utility/handleOpenAIStream.ts 2023-07-27 07:52:49 +00:00
sweep-ai[bot] 8de110e577 Update packages/core/src/NodeParser.ts 2023-07-27 07:52:11 +00:00
yisding 7e82b89f36 Merge pull request #42 from run-llama/sweep/add-gha-workflow_1
[DRAFT] Add GitHub Actions workflow to run tests
2023-07-27 00:50:13 -07:00
sweep-ai[bot] 669483699f Merge main into sweep/add-gha-workflow_1 2023-07-27 07:42:26 +00:00
yisding 672dde6e58 Merge pull request #34 from run-llama/stop-thrashing-docs
set typedoc revision to main
2023-07-27 00:42:21 -07:00
sweep-ai[bot] 31a1a4b4d0 Merge main into sweep/add-gha-workflow_1 2023-07-27 07:39:27 +00:00
yisding f12a8d8006 Merge pull request #36 from run-llama/sweep/add-sweep-config
Configure Sweep
2023-07-27 00:39:23 -07:00
sweep-ai[bot] 03ea3af58c Merge main into sweep/add-gha-workflow_1 2023-07-27 07:38:44 +00:00
sweep-ai[bot] cc2585360b Merge main into sweep/add-sweep-config 2023-07-27 07:38:44 +00:00
yisding ff59660585 Merge pull request #40 from run-llama/sweep/add-gha-workflow
Add GitHub Actions workflow for linting on push/pull
2023-07-27 00:38:39 -07:00
sweep-ai[bot] 6063ce22fd sweep: Create .github/workflows/test.yml 2023-07-27 00:36:26 +00:00
sweep-ai[bot] bc7cf343cc Update .github/workflows/lint_on_push_or_pull.yml 2023-07-27 00:32:16 +00:00
sweep-ai[bot] 938eaf5d2d sweep: Create .github/workflows/lint_on_push_or_pull.yml 2023-07-27 00:30:59 +00:00
sweep-ai[bot] a0bf44addb Create refactor template 2023-07-26 23:25:54 +00:00
sweep-ai[bot] 8d7e1624c7 Create feature template 2023-07-26 23:25:54 +00:00
sweep-ai[bot] d1c9f30dfc Create bugfix template 2023-07-26 23:25:53 +00:00
sweep-ai[bot] e57eb0caa3 Create sweep.yaml config file 2023-07-26 23:25:53 +00:00
Yi Ding 7699f5432d set typedoc revision to main
In theory this will stop the API docs thrashing on every build.

Of course, there is a drawback in that if main changes but we haven't
released a new version of the docs yet the links will go out of date.

So longer term we might want to investigate some kind of variable where
we can continue to have up to date revs but keep the rev in a single
variable somewhere:

https://github.com/facebook/docusaurus/issues/395

In the meantime much smaller commits will be a relief
2023-07-25 23:06:44 -07:00
Yi Ding fe3b1f4f50 0.0.13 2023-07-25 22:57:08 -07:00
yisding 35f3030db6 Merge pull request #33 from run-llama/openaiv4
openai v4
2023-07-25 22:55:32 -07:00
Yi Ding c0f31bbef2 build docs 2023-07-25 22:53:16 -07:00
Yi Ding 0f654ae04b get response message role from OpenAI 2023-07-25 22:52:10 -07:00
Yi Ding be2dc5df28 upgraded packages in docs
docusaurus is causing a dependabot issue with trim 0.0.1. It's probably
not a real vuln but it's a bit annoying.

Unfortunately this didn't solve it.
2023-07-25 22:35:16 -07:00
Yi Ding d6aeedd0e3 fixed broken link in api docs
Also deleting LLM Predictor
2023-07-25 22:23:12 -07:00
Yi Ding dc91f5fdf7 correctly handle retries and timeout settings 2023-07-25 22:19:00 -07:00
Yi Ding 4f6f245006 changeset, packages, and cleanup 2023-07-25 21:25:41 -07:00
Yi Ding ac69adba7a openai v4 2023-07-25 21:04:54 -07:00
Yi Ding b0bb4108a8 bug fix: merge the indexStructs 2023-07-25 18:00:11 -07:00
yisding 6ff932a055 Merge pull request #29 from run-llama/jerry/add_link_fix
add link to starter guide to installation
2023-07-24 18:56:28 -07:00
Jerry Liu c850e7578b cr 2023-07-24 18:53:13 -07:00
yisding 577534813d Merge pull request #28 from run-llama/small-fixes
Small fixes
2023-07-24 18:18:31 -07:00
Yi Ding 7d2fe9c69f 0.0.12 2023-07-24 18:09:36 -07:00
Yi Ding 68bdaaa657 updated dependencies 2023-07-24 18:07:49 -07:00
Yi Ding 7db9bc0c63 updated npm lock in example/ 2023-07-24 18:05:58 -07:00
Yi Ding cd8d22b33f typo in README 2023-07-24 18:04:26 -07:00
Yi Ding 802860050f Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-07-24 14:50:01 -07:00
Yi Ding 3fda1deece 0.0.11 2023-07-24 14:48:15 -07:00
Yi Ding fb7fb760a0 add back PDF loader 2023-07-24 14:47:49 -07:00
Logan a4d6d7bc7d Merge pull request #27 from run-llama/immediate-docs 2023-07-24 13:29:54 -06:00
Yi Ding f7cc69b5ec have docs show up on the domain root 2023-07-24 10:55:57 -07:00
yisding 74b34a3730 Merge pull request #26 from run-llama/playground-docs
playground docs
2023-07-24 10:28:27 -07:00
Yi Ding fc2a1b527e playground docs 2023-07-24 09:40:25 -07:00
Logan 3e85a90b92 Merge pull request #25 from run-llama/logan/agolia_search 2023-07-24 09:41:49 -06:00
Logan Markewich 74ab98ddec add agolia search 2023-07-24 09:38:38 -06:00
Logan bff788b484 Merge pull request #24 from run-llama/logan/patch_storage_docs
fix storage example
2023-07-24 08:12:07 -06:00
Logan Markewich 3e1abd2c6c fix storage example 2023-07-24 08:11:27 -06:00
Yi Ding 79c76ea9d7 0.0.10 2023-07-24 06:03:35 -07:00
Yi Ding 6f2cb31d41 fixed tokenizer decoder 2023-07-24 06:02:16 -07:00
Yi Ding cc88141772 version 0.0.9 2023-07-24 05:29:42 -07:00
Yi Ding 02d9bb0518 the ESM export is causing issues with edge functions
Looks like there's another issue with axios. Will turn ESM bundles back
on once we fix it and the PDF issue
2023-07-24 05:22:14 -07:00
Yi Ding 5321fb3135 0.0.8 2023-07-24 05:19:46 -07:00
Yi Ding ea5038e4b7 disable PDF reader for now
Looks like it causes an issue with the esm package
2023-07-24 05:10:39 -07:00
Yi Ding b012207764 version 0.0.7
Also updated examples package.json to latest
2023-07-24 04:10:02 -07:00
Yi Ding 9fa6d4a8a7 make second arg in fromDocuments optional 2023-07-24 04:06:46 -07:00
yisding c77dd18f2d Merge pull request #22 from run-llama/logan/fix_persistance
fix persistance, align fromDocuments
2023-07-23 21:01:22 -07:00
Yi Ding bb7c0d7deb v0.0.6 2023-07-23 21:00:49 -07:00
Yi Ding 80d3fc9482 copy examples back to app/simple and tested them 2023-07-23 20:58:27 -07:00
Logan Markewich 79a721226d use proper camelCase for indexId 2023-07-23 21:22:10 -06:00
Logan Markewich ed36d41024 better type checking 2023-07-23 21:20:48 -06:00
Logan Markewich 9a15c8ece0 update storage example 2023-07-23 20:14:35 -06:00
Logan Markewich 9c5220ce75 fix tests 2023-07-23 19:28:14 -06:00
Logan Markewich 8c67635041 fix persistance, update fromDocuments 2023-07-23 19:26:17 -06:00
yisding fc7f35141a Merge pull request #21 from run-llama/logan/storage_demo
initial storage examples attempt
2023-07-21 15:54:26 -07:00
Logan Markewich fc65e6b97d initial storage examples attempt 2023-07-21 16:04:43 -06:00
Yi Ding 629bd3239a logan's fix 2023-07-21 11:48:49 -07:00
Yi Ding 31c99baf1c Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-07-21 11:47:56 -07:00
Yi Ding b2810777ef copied simple examples outside of the apps folder
Makes it easier to get started although now they have to use npm instead
of pnpm
2023-07-21 11:47:00 -07:00
Logan 805d6fb81d Merge pull request #20 from run-llama/logan/patch_llama2
patch import for llamaduece
2023-07-21 12:06:54 -06:00
Logan Markewich 9c566b0530 patch import 2023-07-21 12:06:22 -06:00
Yi Ding daa14b8a5f Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-07-21 11:03:29 -07:00
Yi Ding ed4fe4ac22 add pnpm install to the examples README 2023-07-21 11:02:48 -07:00
Simon Suo b76562061e Merge pull request #19 from run-llama/suo/update_docs_title_and_desc
Update docs title and meta description
2023-07-21 10:58:00 -07:00
Simon Suo baa91540cf wip 2023-07-21 10:57:08 -07:00
Simon Suo a594e22d2d Merge pull request #18 from run-llama/suo/update_github_link
Update Github link on docs
2023-07-21 10:50:28 -07:00
Simon Suo 91615a6602 update 2023-07-21 10:49:30 -07:00
Simon Suo 43144ae782 wip 2023-07-21 10:47:49 -07:00
Logan e927fc1800 Merge pull request #17 from run-llama/logan/starter_patch
replace -- chars
2023-07-21 11:31:14 -06:00
Logan Markewich a08e904834 replace -- chars 2023-07-21 11:30:30 -06:00
Logan 90429ab63d Merge pull request #16 from run-llama/logan/add_links_to_docs
patch various links
2023-07-21 11:24:55 -06:00
Logan Markewich abaab0caca patch links 2023-07-21 11:23:45 -06:00
Simon Suo bc5c2e5c7b Merge pull request #15 from run-llama/Disiok-patch-2
Update README.md
2023-07-21 10:17:09 -07:00
Simon Suo c3e4b37414 Update README.md 2023-07-21 10:16:59 -07:00
Simon Suo 63906798e8 Merge pull request #14 from run-llama/Disiok-patch-1
Update README.md
2023-07-21 10:12:17 -07:00
Simon Suo d7c2453c7d Update README.md 2023-07-21 10:11:40 -07:00
Yi Ding 6a61ea46bf publish 0.0.5 2023-07-21 09:33:00 -07:00
Yi Ding 5a765aa1d6 updated README 2023-07-21 09:32:23 -07:00
Yi Ding 3cab956f94 publish 0.0.4 2023-07-21 09:16:27 -07:00
Yi Ding c65d671ddb changeset 2023-07-21 09:15:39 -07:00
Yi Ding 985f3b52bb add README and CONTRIBUTING to dir and remove .turbo 2023-07-21 09:14:38 -07:00
Yi Ding 4636a763b0 removed gitignore from packages/core 2023-07-21 09:11:32 -07:00
Yi Ding f4ddf89b51 published 0.0.3 2023-07-21 09:08:30 -07:00
Yi Ding ca9410f702 try changeset 2023-07-21 09:07:38 -07:00
Yi Ding 50c0b04017 v0.0.2 2023-07-21 08:16:12 -07:00
Yi Ding 41464386d6 getting ready to publish 2023-07-21 08:13:09 -07:00
Yi Ding a07a94108d more persistence 2023-07-21 07:49:00 -07:00
Yi Ding a7cc8020db persistence and packaging 2023-07-21 07:32:36 -07:00
Yi Ding 761fa4d836 switch back to cjs default 2023-07-20 22:29:43 -07:00
Yi Ding ade5587a15 build stuff 2023-07-20 22:15:51 -07:00
Yi Ding 2db8a8c2e3 updated packages 2023-07-20 21:22:37 -07:00
Yi Ding 3ad826e358 doc build works thanks Logan! 2023-07-20 21:07:38 -07:00
Logan Markewich 87925a36e6 fix searchbar dependencies 2023-07-20 21:48:43 -06:00
Yi Ding fc6ff47fd2 replace all instances of yarn in docusaurus with pnpm 2023-07-20 20:37:49 -07:00
Yi Ding 17b22f4673 a few updates for the README 2023-07-20 19:48:55 -07:00
Yi Ding b033d0fbe9 Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-07-20 18:19:34 -07:00
Yi Ding 122ab88fa5 missed a chatRepl 2023-07-20 18:17:35 -07:00
Logan Markewich 73c188761f fix some docs usage 2023-07-20 19:08:59 -06:00
Logan Markewich 0fbf7b4ace update examples and docs 2023-07-20 19:08:59 -06:00
Yi Ding f9394ebb22 missing package in pnpm-lock 2023-07-20 17:29:24 -07:00
Yi Ding 05f2f388d9 Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-07-20 17:28:54 -07:00
Yi Ding d489a2120f allow asQueryEngine and asRetriever to take options 2023-07-20 17:15:11 -07:00
Logan Markewich 8954a80e04 add search bar 2023-07-20 17:06:39 -06:00
Logan Markewich f264211550 link to llama2 demo 2023-07-20 16:38:12 -06:00
Logan Markewich 4d990d012c remove some 'a' methods 2023-07-20 16:35:47 -06:00
Logan Markewich 2683121ee1 Update sidebar ordering, add storagecontext docs 2023-07-20 16:34:27 -06:00
Yi Ding 08c2d4620f removed ChatGPTLLMPredictor class 2023-07-19 21:25:51 -07:00
Yi Ding 643ad626cd deuce LLM class 2023-07-19 09:17:01 -07:00
Yi Ding 2619d4175d Fixed the context window issue.
Putting in a max tokens into the request was a mistake.
2023-07-18 23:17:44 -07:00
Yi Ding b00821dbe9 missing package in lockfile 2023-07-18 21:20:13 -07:00
Yi Ding b0a742c3e6 api docs updated with latest 2023-07-18 21:06:24 -07:00
yisding 9d0cadfc5f Merge pull request #13 from run-llama/logan/docs_finish
Finish Docs
2023-07-18 20:58:33 -07:00
Yi Ding 4ea034082b changed default response synthesizer to compact 2023-07-18 20:58:01 -07:00
Logan Markewich 2298f42c18 remove advanced concepts section 2023-07-18 20:35:37 -06:00
Logan Markewich a67bfe26ed fix link to node_parser 2023-07-18 19:58:34 -06:00
Logan Markewich d73ac8e718 Update high-level concetps 2023-07-18 19:54:06 -06:00
Logan Markewich 213a68bb0f round out low level modules 2023-07-18 19:13:05 -06:00
Logan Markewich 5bba0de1f3 reorder 2023-07-18 16:44:28 -06:00
Logan Markewich f1d609df5f docs re-generate 2023-07-18 13:57:05 -06:00
Logan Markewich f9f6dc6985 link in modules index 2023-07-18 13:13:42 -06:00
Logan Markewich 4ae690612a flesh out more 2023-07-18 13:09:07 -06:00
Logan Markewich dc74b40c7a add end-to-end examples 2023-07-18 11:48:53 -06:00
Logan Markewich b6b2598119 better org 2023-07-18 09:31:51 -06:00
Yi Ding 5cd54e2f98 few more fixes 2023-07-17 21:55:59 -07:00
Yi Ding 8b7a94f8c5 fix 2023-07-17 21:51:14 -07:00
Yi Ding 44ab4d838f no more a-prefix 2023-07-17 21:49:45 -07:00
Yi Ding 372ac1a24b move all indexes into indices folder 2023-07-17 21:32:29 -07:00
Yi Ding 09f02ff9b3 pnpm upgrade 2023-07-17 21:31:28 -07:00
yisding 9dc30f5385 Merge pull request #12 from run-llama/li_fix
ListIndex fix
2023-07-17 20:43:01 -07:00
Sourabh Desai 5871959c15 remove console log 2023-07-18 02:49:20 +00:00
Logan Markewich e108757255 add more structure 2023-07-17 20:48:48 -06:00
Logan Markewich 3cdc7e3feb re-org top level 2023-07-17 20:48:36 -06:00
Logan Markewich bc1a0fe651 undo organization 2023-07-17 20:48:27 -06:00
Logan Markewich 5752fb6921 organize modules 2023-07-17 20:48:19 -06:00
Logan Markewich f36f4b2dae Revert "organize modules"
This reverts commit 1a3940376a.
2023-07-17 20:46:37 -06:00
Logan Markewich 8ee5503505 Revert "undo organization"
This reverts commit abafa6014c.
2023-07-17 20:46:37 -06:00
Logan Markewich da7199b3e9 Revert "re-org top level"
This reverts commit 452b678450.
2023-07-17 20:46:37 -06:00
Logan Markewich 67be6f373a Revert "add more structure"
This reverts commit d5cbaa9ec7.
2023-07-17 20:46:37 -06:00
Logan Markewich d5cbaa9ec7 add more structure 2023-07-17 20:42:26 -06:00
Sourabh Desai e7206a7dea simplify test 2023-07-18 02:20:49 +00:00
Sourabh Desai 5cdab4e311 make ListIndex query engine use CompactAndRefine response builder by default 2023-07-18 02:08:22 +00:00
Sourabh Desai ee293da4f6 update test 2023-07-18 01:41:27 +00:00
Sourabh Desai 5a50ed2dfe udpate ListIndex.fromDocuments method signature 2023-07-18 01:39:20 +00:00
Logan Markewich 452b678450 re-org top level 2023-07-17 16:53:57 -06:00
Logan Markewich abafa6014c undo organization 2023-07-17 16:53:22 -06:00
Logan Markewich 1a3940376a organize modules 2023-07-17 16:30:32 -06:00
Yi Ding 775be4da64 add next as a dev dep on lint rules 2023-07-17 15:02:40 -07:00
yisding fcd70abc1f Merge pull request #11 from run-llama/docs
doc site
2023-07-17 10:43:26 -07:00
270 changed files with 13531 additions and 25414 deletions
+8
View File
@@ -0,0 +1,8 @@
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
+5
View File
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---
Streaming improvements including Anthropic (thanks @kkang2097)
+5
View File
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---
Portkey integration (Thank you @noble-varghese)
+11
View File
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
+5
View File
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---
Add export for PromptHelper (thanks @zigamall)
+5
View File
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---
Publish ESM module again
+5
View File
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---
Pinecone demo (thanks @Einsenhorn)
+11
View File
@@ -0,0 +1,11 @@
name: Bugfix
title: "Sweep: "
description: Write something like "We notice ... behavior when ... happens instead of ...""
labels: sweep
body:
- type: textarea
id: description
attributes:
label: Details
description: More details about the bug
placeholder: The bug might be in ... file
+11
View File
@@ -0,0 +1,11 @@
name: Feature Request
title: "Sweep: "
description: Write something like "Write an api endpoint that does "..." in the "..." file"
labels: sweep
body:
- type: textarea
id: description
attributes:
label: Details
description: More details for Sweep
placeholder: The new endpoint should use the ... class from ... file because it contains ... logic
+11
View File
@@ -0,0 +1,11 @@
name: Refactor
title: "Sweep: "
description: Write something like "Modify the ... api endpoint to use ... version and ... framework"
labels: sweep
body:
- type: textarea
id: description
attributes:
label: Details
description: More details for Sweep
placeholder: We are migrating this function to ... version because ...
@@ -0,0 +1,25 @@
name: Lint on push or pull request
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Run lint
run: pnpm run lint
+24
View File
@@ -0,0 +1,24 @@
name: Run Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install dependencies
run: |
npm i -g pnpm
pnpm install
- name: Run tests
run: pnpm run test
+1 -1
View File
@@ -35,4 +35,4 @@ yarn-error.log*
# vercel
.vercel
storage/
dist/
+5 -3
View File
@@ -12,13 +12,13 @@ apps/simple is where the demo code lives
### Turborepo docs
You can checkout how Turborepo works using the built in [README-turborepo.md](README-turborepo.md)
You can checkout how Turborepo works using the default [README-turborepo.md](/README-turborepo.md)
## Getting Started
Install NodeJS. Preferably v18 using nvm or n.
Inside the llamascript directory:
Inside the LlamaIndexTS directory:
```
npm i -g pnpm ts-node
@@ -41,12 +41,14 @@ To run them, run
pnpm run test
```
To write new test cases write them in packages/core/src/tests
To write new test cases write them in [packages/core/src/tests](/packages/core/src/tests)
We use Jest https://jestjs.io/ to write our test cases. Jest comes with a bunch of built in assertions using the expect function: https://jestjs.io/docs/expect
### Demo applications
There is an existing ["simple"](/apps/simple/README.md) demos folder with mainly NodeJS scripts. Feel free to add additional demos to that folder. If you would like to try out your changes in the core package with a new demo, you need to run the build command in the README.
You can create new demo applications in the apps folder. Just run pnpm init in the folder after you create it to create its own package.json
### Installing packages
+35 -14
View File
@@ -1,7 +1,11 @@
# LlamaIndex.TS
LlamaIndex is a data framework for your LLM application.
Use your own data with large language models (LLMs, OpenAI ChatGPT and others) in Typescript and Javascript.
Documentation: https://ts.llamaindex.ai/
## What is LlamaIndex.TS?
LlamaIndex.TS aims to be a lightweight, easy to use set of libraries to help you integrate large language models into your applications with your own data.
@@ -13,9 +17,12 @@ LlamaIndex.TS requries Node v18 or higher. You can download it from https://node
In a new folder:
```bash
export OPEN_AI_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
npx tsc -init # if needed
export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
pnpm init
pnpm install typescript
pnpm exec tsc --init # if needed
pnpm install llamaindex
pnpm install @types/node
```
Create the file example.ts
@@ -29,7 +36,7 @@ async function main() {
// Load essay from abramov.txt in Node
const essay = await fs.readFile(
"node_modules/llamaindex/examples/abramov.txt",
"utf-8"
"utf-8",
);
// Create Document object with essay
@@ -40,38 +47,52 @@ async function main() {
// Query the index
const queryEngine = index.asQueryEngine();
const response = await queryEngine.aquery(
"What did the author do in college?"
const response = await queryEngine.query(
"What did the author do in college?",
);
// Output response
console.log(response.toString());
}
main();
```
Then you can run it using
```bash
npx ts-node example.ts
pnpx ts-node example.ts
```
## Core concepts:
## Playground
- [Document](packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
Check out our NextJS playground at https://llama-playground.vercel.app/. The source is available at https://github.com/run-llama/ts-playground
- [Node](packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
## Core concepts for getting started:
- Indexes: indexes store the Nodes and the embeddings of those nodes.
- [Document](/packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
- [QueryEngine](packages/core/src/QueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected nodes from your Index to give the LLM the context it needs to answer your query.
- [Node](/packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
- [ChatEngine](packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indexes.
- [Embedding](/packages/core/src/Embedding.ts): Embeddings are sets of floating point numbers which represent the data in a Node. By comparing the similarity of embeddings, we can derive an understanding of the similarity of two pieces of data. One use case is to compare the embedding of a question with the embeddings of our Nodes to see which Nodes may contain the data needed to answer that quesiton.
- [SimplePrompt](packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
- [Indices](/packages/core/src/indices/): Indices store the Nodes and the embeddings of those nodes. QueryEngines retrieve Nodes from these Indices using embedding similarity.
- [QueryEngine](/packages/core/src/QueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected Nodes from your Index to give the LLM the context it needs to answer your query.
- [ChatEngine](/packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indices.
- [SimplePrompt](/packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and formats them in a template literal. SimplePrompts can be specialized using currying and combined using other SimplePrompt functions.
## Supported LLMs:
- OpenAI GPT-3.5-turbo and GPT-4
- Anthropic Claude Instant and Claude 2
- Llama2 Chat LLMs (70B, 13B, and 7B parameters)
## Contributing:
We are in the very early days of LlamaIndex.TS. If youre interested in hacking on it with us check out our [contributing guide](CONTRIBUTING.md)
We are in the very early days of LlamaIndex.TS. If youre interested in hacking on it with us check out our [contributing guide](/CONTRIBUTING.md)
## Bugs? Questions?
+11 -5
View File
@@ -5,21 +5,27 @@ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern sta
### Installation
```
$ yarn
$ pnpm
```
### Local Development
```
$ yarn start
$ pnpm start
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
However, the searchbar may not function with `yarn start`. Instead, run `yarn build` and launch a server:
```
$ npx http-server ./build
```
### Build
```
$ yarn build
$ pnpm build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
@@ -29,13 +35,13 @@ This command generates static content into the `build` directory and can be serv
Using SSH:
```
$ USE_SSH=true yarn deploy
$ USE_SSH=true pnpm deploy
```
Not using SSH:
```
$ GIT_USER=<Your GitHub username> yarn deploy
$ GIT_USER=<Your GitHub username> pnpm deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
+1 -1
View File
@@ -1,3 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
};
+1
View File
@@ -0,0 +1 @@
api/
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

-2
View File
@@ -1,2 +0,0 @@
label: "API"
position: 4
@@ -1,81 +0,0 @@
---
id: "BaseEmbedding"
title: "Class: BaseEmbedding"
sidebar_label: "BaseEmbedding"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- **`BaseEmbedding`**
↳ [`OpenAIEmbedding`](OpenAIEmbedding.md)
## Constructors
### constructor
**new BaseEmbedding**()
## Methods
### aGetQueryEmbedding
`Abstract` **aGetQueryEmbedding**(`query`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Defined in
[Embedding.ts:206](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L206)
___
### aGetTextEmbedding
`Abstract` **aGetTextEmbedding**(`text`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `text` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Defined in
[Embedding.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L205)
___
### similarity
**similarity**(`embedding1`, `embedding2`, `mode?`): `number`
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `embedding1` | `number`[] | `undefined` |
| `embedding2` | `number`[] | `undefined` |
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
#### Returns
`number`
#### Defined in
[Embedding.ts:197](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L197)
-120
View File
@@ -1,120 +0,0 @@
---
id: "BaseIndex"
title: "Class: BaseIndex<T>"
sidebar_label: "BaseIndex"
sidebar_position: 0
custom_edit_url: null
---
Indexes are the data structure that we store our nodes and embeddings in so
they can be retrieved for our queries.
## Type parameters
| Name |
| :------ |
| `T` |
## Hierarchy
- **`BaseIndex`**
↳ [`VectorStoreIndex`](VectorStoreIndex.md)
↳ [`ListIndex`](ListIndex.md)
## Constructors
### constructor
**new BaseIndex**<`T`\>(`init`)
#### Type parameters
| Name |
| :------ |
| `T` |
#### Parameters
| Name | Type |
| :------ | :------ |
| `init` | [`BaseIndexInit`](../interfaces/BaseIndexInit.md)<`T`\> |
#### Defined in
[BaseIndex.ts:80](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L80)
## Properties
### docStore
**docStore**: `BaseDocumentStore`
#### Defined in
[BaseIndex.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L75)
___
### indexStore
`Optional` **indexStore**: `BaseIndexStore`
#### Defined in
[BaseIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L77)
___
### indexStruct
**indexStruct**: `T`
#### Defined in
[BaseIndex.ts:78](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L78)
___
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[BaseIndex.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L73)
___
### storageContext
**storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
#### Defined in
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
___
### vectorStore
`Optional` **vectorStore**: `VectorStore`
#### Defined in
[BaseIndex.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L76)
## Methods
### asRetriever
`Abstract` **asRetriever**(): [`BaseRetriever`](../interfaces/BaseRetriever.md)
#### Returns
[`BaseRetriever`](../interfaces/BaseRetriever.md)
#### Defined in
[BaseIndex.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L89)
-287
View File
@@ -1,287 +0,0 @@
---
id: "BaseNode"
title: "Class: BaseNode"
sidebar_label: "BaseNode"
sidebar_position: 0
custom_edit_url: null
---
Generic abstract class for retrievable nodes
## Hierarchy
- **`BaseNode`**
↳ [`TextNode`](TextNode.md)
## Constructors
### constructor
**new BaseNode**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init?` | `Partial`<[`BaseNode`](BaseNode.md)\> |
#### Defined in
[Node.ts:48](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L48)
## Properties
### embedding
`Optional` **embedding**: `number`[]
#### Defined in
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
___
### excludedEmbedMetadataKeys
**excludedEmbedMetadataKeys**: `string`[] = `[]`
#### Defined in
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
___
### excludedLlmMetadataKeys
**excludedLlmMetadataKeys**: `string`[] = `[]`
#### Defined in
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
___
### hash
**hash**: `string` = `""`
#### Defined in
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
___
### id\_
**id\_**: `string`
#### Defined in
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
___
### metadata
**metadata**: `Record`<`string`, `any`\> = `{}`
#### Defined in
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
___
### relationships
**relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../modules.md#relatednodetype)\>\> = `{}`
#### Defined in
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
## Accessors
### childNodes
`get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
#### Defined in
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
___
### nextNode
`get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Defined in
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
___
### nodeId
`get` **nodeId**(): `string`
#### Returns
`string`
#### Defined in
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
___
### parentNode
`get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Defined in
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
___
### prevNode
`get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Defined in
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
___
### sourceNode
`get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Defined in
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
## Methods
### asRelatedNodeInfo
**asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Defined in
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
___
### getContent
`Abstract` **getContent**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Defined in
[Node.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L54)
___
### getEmbedding
**getEmbedding**(): `number`[]
#### Returns
`number`[]
#### Defined in
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
___
### getMetadataStr
`Abstract` **getMetadataStr**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Defined in
[Node.ts:55](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L55)
___
### getType
`Abstract` **getType**(): [`ObjectType`](../enums/ObjectType.md)
#### Returns
[`ObjectType`](../enums/ObjectType.md)
#### Defined in
[Node.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L52)
___
### setContent
`Abstract` **setContent**(`value`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `value` | `any` |
#### Returns
`void`
#### Defined in
[Node.ts:56](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L56)
@@ -1,83 +0,0 @@
---
id: "CallbackManager"
title: "Class: CallbackManager"
sidebar_label: "CallbackManager"
sidebar_position: 0
custom_edit_url: null
---
## Implements
- `CallbackManagerMethods`
## Constructors
### constructor
**new CallbackManager**(`handlers?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `handlers?` | `CallbackManagerMethods` |
#### Defined in
[callbacks/CallbackManager.ts:68](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L68)
## Properties
### onLLMStream
`Optional` **onLLMStream**: (`params`: [`StreamCallbackResponse`](../interfaces/StreamCallbackResponse.md)) => `void` \| `Promise`<`void`\>
#### Type declaration
▸ (`params`): `void` \| `Promise`<`void`\>
##### Parameters
| Name | Type |
| :------ | :------ |
| `params` | [`StreamCallbackResponse`](../interfaces/StreamCallbackResponse.md) |
##### Returns
`void` \| `Promise`<`void`\>
#### Implementation of
CallbackManagerMethods.onLLMStream
#### Defined in
[callbacks/CallbackManager.ts:65](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L65)
___
### onRetrieve
`Optional` **onRetrieve**: (`params`: [`RetrievalCallbackResponse`](../interfaces/RetrievalCallbackResponse.md)) => `void` \| `Promise`<`void`\>
#### Type declaration
▸ (`params`): `void` \| `Promise`<`void`\>
##### Parameters
| Name | Type |
| :------ | :------ |
| `params` | [`RetrievalCallbackResponse`](../interfaces/RetrievalCallbackResponse.md) |
##### Returns
`void` \| `Promise`<`void`\>
#### Implementation of
CallbackManagerMethods.onRetrieve
#### Defined in
[callbacks/CallbackManager.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L66)
@@ -1,113 +0,0 @@
---
id: "ChatGPTLLMPredictor"
title: "Class: ChatGPTLLMPredictor"
sidebar_label: "ChatGPTLLMPredictor"
sidebar_position: 0
custom_edit_url: null
---
ChatGPTLLMPredictor is a predictor that uses GPT.
## Implements
- [`BaseLLMPredictor`](../interfaces/BaseLLMPredictor.md)
## Constructors
### constructor
**new ChatGPTLLMPredictor**(`props?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `props?` | `Partial`<[`ChatGPTLLMPredictor`](ChatGPTLLMPredictor.md)\> |
#### Defined in
[LLMPredictor.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L26)
## Properties
### callbackManager
`Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
#### Defined in
[LLMPredictor.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L24)
___
### languageModel
**languageModel**: [`OpenAI`](OpenAI.md)
#### Defined in
[LLMPredictor.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L23)
___
### model
**model**: ``"gpt-3.5-turbo"`` \| ``"gpt-3.5-turbo-16k"`` \| ``"gpt-4"`` \| ``"gpt-4-32k"``
#### Defined in
[LLMPredictor.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L21)
___
### retryOnThrottling
• **retryOnThrottling**: `boolean`
#### Defined in
[LLMPredictor.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L22)
## Methods
### apredict
▸ **apredict**(`prompt`, `input?`, `parentEvent?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `prompt` | `string` \| [`SimplePrompt`](../modules.md#simpleprompt) |
| `input?` | `Record`<`string`, `string`\> |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<`string`\>
#### Implementation of
[BaseLLMPredictor](../interfaces/BaseLLMPredictor.md).[apredict](../interfaces/BaseLLMPredictor.md#apredict)
#### Defined in
[LLMPredictor.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L49)
___
### getLlmMetadata
▸ **getLlmMetadata**(): `Promise`<`void`\>
#### Returns
`Promise`<`void`\>
#### Implementation of
[BaseLLMPredictor](../interfaces/BaseLLMPredictor.md).[getLlmMetadata](../interfaces/BaseLLMPredictor.md#getllmmetadata)
#### Defined in
[LLMPredictor.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L45)
@@ -1,105 +0,0 @@
---
id: "CompactAndRefine"
title: "Class: CompactAndRefine"
sidebar_label: "CompactAndRefine"
sidebar_position: 0
custom_edit_url: null
---
CompactAndRefine is a slight variation of Refine that first compacts the text chunks into the smallest possible number of chunks.
## Hierarchy
- [`Refine`](Refine.md)
**`CompactAndRefine`**
## Constructors
### constructor
**new CompactAndRefine**(`serviceContext`, `textQATemplate?`, `refineTemplate?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
| `textQATemplate?` | [`SimplePrompt`](../modules.md#simpleprompt) |
| `refineTemplate?` | [`SimplePrompt`](../modules.md#simpleprompt) |
#### Inherited from
[Refine](Refine.md).[constructor](Refine.md#constructor)
#### Defined in
[ResponseSynthesizer.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L66)
## Properties
### refineTemplate
**refineTemplate**: [`SimplePrompt`](../modules.md#simpleprompt)
#### Inherited from
[Refine](Refine.md).[refineTemplate](Refine.md#refinetemplate)
#### Defined in
[ResponseSynthesizer.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L64)
___
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
[Refine](Refine.md).[serviceContext](Refine.md#servicecontext)
#### Defined in
[ResponseSynthesizer.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L62)
___
### textQATemplate
**textQATemplate**: [`SimplePrompt`](../modules.md#simpleprompt)
#### Inherited from
[Refine](Refine.md).[textQATemplate](Refine.md#textqatemplate)
#### Defined in
[ResponseSynthesizer.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L63)
## Methods
### agetResponse
**agetResponse**(`query`, `textChunks`, `prevResponse?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `textChunks` | `string`[] |
| `prevResponse?` | `any` |
#### Returns
`Promise`<`string`\>
#### Overrides
[Refine](Refine.md).[agetResponse](Refine.md#agetresponse)
#### Defined in
[ResponseSynthesizer.ts:152](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L152)
@@ -1,148 +0,0 @@
---
id: "CondenseQuestionChatEngine"
title: "Class: CondenseQuestionChatEngine"
sidebar_label: "CondenseQuestionChatEngine"
sidebar_position: 0
custom_edit_url: null
---
CondenseQuestionChatEngine is used in conjunction with a Index (for example VectorIndex).
It does two steps on taking a user's chat message: first, it condenses the chat message
with the previous chat history into a question with more context.
Then, it queries the underlying Index using the new question with context and returns
the response.
CondenseQuestionChatEngine performs well when the input is primarily questions about the
underlying data. It performs less well when the chat messages are not questions about the
data, or are very referential to previous context.
## Implements
- [`ChatEngine`](../interfaces/ChatEngine.md)
## Constructors
### constructor
**new CondenseQuestionChatEngine**(`init`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init` | `Object` |
| `init.chatHistory` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `init.condenseMessagePrompt?` | [`SimplePrompt`](../modules.md#simpleprompt) |
| `init.queryEngine` | [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md) |
| `init.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Defined in
[ChatEngine.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L75)
## Properties
### chatHistory
**chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
#### Defined in
[ChatEngine.ts:71](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L71)
___
### condenseMessagePrompt
**condenseMessagePrompt**: [`SimplePrompt`](../modules.md#simpleprompt)
#### Defined in
[ChatEngine.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L73)
___
### queryEngine
**queryEngine**: [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
#### Defined in
[ChatEngine.ts:70](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L70)
___
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[ChatEngine.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L72)
## Methods
### achat
**achat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
Send message along with the class's current chat history to the LLM.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `message` | `string` | |
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
#### Returns
`Promise`<[`Response`](Response.md)\>
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[achat](../interfaces/ChatEngine.md#achat)
#### Defined in
[ChatEngine.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L104)
___
### acondenseQuestion
`Private` **acondenseQuestion**(`chatHistory`, `question`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `chatHistory` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `question` | `string` |
#### Returns
`Promise`<`string`\>
#### Defined in
[ChatEngine.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L89)
___
### reset
**reset**(): `void`
Resets the chat history so that it's empty.
#### Returns
`void`
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
#### Defined in
[ChatEngine.ts:123](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L123)
@@ -1,125 +0,0 @@
---
id: "ContextChatEngine"
title: "Class: ContextChatEngine"
sidebar_label: "ContextChatEngine"
sidebar_position: 0
custom_edit_url: null
---
ContextChatEngine uses the Index to get the appropriate context for each query.
The context is stored in the system prompt, and the chat history is preserved,
ideally allowing the appropriate context to be surfaced for each query.
## Implements
- [`ChatEngine`](../interfaces/ChatEngine.md)
## Constructors
### constructor
**new ContextChatEngine**(`init`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init` | `Object` |
| `init.chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `init.chatModel?` | [`OpenAI`](OpenAI.md) |
| `init.retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
#### Defined in
[ChatEngine.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L138)
## Properties
### chatHistory
**chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
#### Defined in
[ChatEngine.ts:136](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L136)
___
### chatModel
**chatModel**: [`OpenAI`](OpenAI.md)
#### Defined in
[ChatEngine.ts:135](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L135)
___
### retriever
**retriever**: [`BaseRetriever`](../interfaces/BaseRetriever.md)
#### Defined in
[ChatEngine.ts:134](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L134)
## Methods
### achat
**achat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
Send message along with the class's current chat history to the LLM.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `message` | `string` | |
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
#### Returns
`Promise`<[`Response`](Response.md)\>
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[achat](../interfaces/ChatEngine.md#achat)
#### Defined in
[ChatEngine.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L153)
___
### chatRepl
**chatRepl**(): `void`
#### Returns
`void`
#### Defined in
[ChatEngine.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L149)
___
### reset
**reset**(): `void`
Resets the chat history so that it's empty.
#### Returns
`void`
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
#### Defined in
[ChatEngine.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L191)
-496
View File
@@ -1,496 +0,0 @@
---
id: "Document"
title: "Class: Document"
sidebar_label: "Document"
sidebar_position: 0
custom_edit_url: null
---
A document is just a special text node with a docId.
## Hierarchy
- [`TextNode`](TextNode.md)
**`Document`**
## Constructors
### constructor
**new Document**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init?` | `Partial`<[`Document`](Document.md)\> |
#### Overrides
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
#### Defined in
[Node.ts:216](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L216)
## Properties
### embedding
`Optional` **embedding**: `number`[]
#### Inherited from
[TextNode](TextNode.md).[embedding](TextNode.md#embedding)
#### Defined in
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
___
### endCharIdx
`Optional` **endCharIdx**: `number`
#### Inherited from
[TextNode](TextNode.md).[endCharIdx](TextNode.md#endcharidx)
#### Defined in
[Node.ts:139](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L139)
___
### excludedEmbedMetadataKeys
**excludedEmbedMetadataKeys**: `string`[] = `[]`
#### Inherited from
[TextNode](TextNode.md).[excludedEmbedMetadataKeys](TextNode.md#excludedembedmetadatakeys)
#### Defined in
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
___
### excludedLlmMetadataKeys
**excludedLlmMetadataKeys**: `string`[] = `[]`
#### Inherited from
[TextNode](TextNode.md).[excludedLlmMetadataKeys](TextNode.md#excludedllmmetadatakeys)
#### Defined in
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
___
### hash
**hash**: `string` = `""`
#### Inherited from
[TextNode](TextNode.md).[hash](TextNode.md#hash)
#### Defined in
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
___
### id\_
**id\_**: `string`
#### Inherited from
[TextNode](TextNode.md).[id_](TextNode.md#id_)
#### Defined in
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
___
### metadata
**metadata**: `Record`<`string`, `any`\> = `{}`
#### Inherited from
[TextNode](TextNode.md).[metadata](TextNode.md#metadata)
#### Defined in
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
___
### metadataSeparator
**metadataSeparator**: `string` = `"\n"`
#### Inherited from
[TextNode](TextNode.md).[metadataSeparator](TextNode.md#metadataseparator)
#### Defined in
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
___
### relationships
**relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../modules.md#relatednodetype)\>\> = `{}`
#### Inherited from
[TextNode](TextNode.md).[relationships](TextNode.md#relationships)
#### Defined in
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
___
### startCharIdx
`Optional` **startCharIdx**: `number`
#### Inherited from
[TextNode](TextNode.md).[startCharIdx](TextNode.md#startcharidx)
#### Defined in
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
___
### text
**text**: `string` = `""`
#### Inherited from
[TextNode](TextNode.md).[text](TextNode.md#text)
#### Defined in
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
## Accessors
### childNodes
`get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
#### Inherited from
TextNode.childNodes
#### Defined in
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
___
### docId
`get` **docId**(): `string`
#### Returns
`string`
#### Defined in
[Node.ts:225](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L225)
___
### nextNode
`get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
TextNode.nextNode
#### Defined in
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/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/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
___
### parentNode
`get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
TextNode.parentNode
#### Defined in
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
___
### prevNode
`get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
TextNode.prevNode
#### Defined in
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
___
### sourceNode
`get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
TextNode.sourceNode
#### Defined in
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
## Methods
### asRelatedNodeInfo
**asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
[TextNode](TextNode.md).[asRelatedNodeInfo](TextNode.md#asrelatednodeinfo)
#### Defined in
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
___
### generateHash
**generateHash**(): `void`
#### Returns
`void`
#### Inherited from
[TextNode](TextNode.md).[generateHash](TextNode.md#generatehash)
#### Defined in
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
___
### getContent
**getContent**(`metadataMode?`): `string`
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getContent](TextNode.md#getcontent)
#### Defined in
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
___
### getEmbedding
**getEmbedding**(): `number`[]
#### Returns
`number`[]
#### Inherited from
[TextNode](TextNode.md).[getEmbedding](TextNode.md#getembedding)
#### Defined in
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
___
### getMetadataStr
**getMetadataStr**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getMetadataStr](TextNode.md#getmetadatastr)
#### Defined in
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
___
### getNodeInfo
**getNodeInfo**(): `Object`
#### Returns
`Object`
| Name | Type |
| :------ | :------ |
| `end` | `undefined` \| `number` |
| `start` | `undefined` \| `number` |
#### Inherited from
[TextNode](TextNode.md).[getNodeInfo](TextNode.md#getnodeinfo)
#### Defined in
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
___
### getText
**getText**(): `string`
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getText](TextNode.md#gettext)
#### Defined in
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
___
### getType
**getType**(): [`ObjectType`](../enums/ObjectType.md)
#### Returns
[`ObjectType`](../enums/ObjectType.md)
#### Overrides
[TextNode](TextNode.md).[getType](TextNode.md#gettype)
#### Defined in
[Node.ts:221](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L221)
___
### setContent
**setContent**(`value`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `value` | `string` |
#### Returns
`void`
#### Inherited from
[TextNode](TextNode.md).[setContent](TextNode.md#setcontent)
#### Defined in
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
@@ -1,129 +0,0 @@
---
id: "InMemoryFileSystem"
title: "Class: InMemoryFileSystem"
sidebar_label: "InMemoryFileSystem"
sidebar_position: 0
custom_edit_url: null
---
A filesystem implementation that stores files in memory.
## Implements
- [`GenericFileSystem`](../interfaces/GenericFileSystem.md)
## Constructors
### constructor
**new InMemoryFileSystem**()
## Properties
### files
`Private` **files**: `Record`<`string`, `any`\> = `{}`
#### Defined in
[storage/FileSystem.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L25)
## Methods
### access
**access**(`path`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `path` | `string` |
#### Returns
`Promise`<`void`\>
#### Implementation of
[GenericFileSystem](../interfaces/GenericFileSystem.md).[access](../interfaces/GenericFileSystem.md#access)
#### Defined in
[storage/FileSystem.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L38)
___
### mkdir
**mkdir**(`path`, `options?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `path` | `string` |
| `options?` | `any` |
#### Returns
`Promise`<`void`\>
#### Implementation of
[GenericFileSystem](../interfaces/GenericFileSystem.md).[mkdir](../interfaces/GenericFileSystem.md#mkdir)
#### Defined in
[storage/FileSystem.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L44)
___
### readFile
**readFile**(`path`, `options?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `path` | `string` |
| `options?` | `any` |
#### Returns
`Promise`<`string`\>
#### Implementation of
[GenericFileSystem](../interfaces/GenericFileSystem.md).[readFile](../interfaces/GenericFileSystem.md#readfile)
#### Defined in
[storage/FileSystem.ts:31](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L31)
___
### writeFile
**writeFile**(`path`, `content`, `options?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `path` | `string` |
| `content` | `string` |
| `options?` | `any` |
#### Returns
`Promise`<`void`\>
#### Implementation of
[GenericFileSystem](../interfaces/GenericFileSystem.md).[writeFile](../interfaces/GenericFileSystem.md#writefile)
#### Defined in
[storage/FileSystem.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L27)
-123
View File
@@ -1,123 +0,0 @@
---
id: "IndexDict"
title: "Class: IndexDict"
sidebar_label: "IndexDict"
sidebar_position: 0
custom_edit_url: null
---
The underlying structure of each index.
## Hierarchy
- [`IndexStruct`](IndexStruct.md)
**`IndexDict`**
## Constructors
### constructor
**new IndexDict**(`indexId?`, `summary?`)
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `indexId` | `string` | `undefined` |
| `summary` | `undefined` | `undefined` |
#### Inherited from
[IndexStruct](IndexStruct.md).[constructor](IndexStruct.md#constructor)
#### Defined in
[BaseIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L21)
## Properties
### docStore
**docStore**: `Record`<`string`, [`Document`](Document.md)\> = `{}`
#### Defined in
[BaseIndex.ts:36](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L36)
___
### indexId
**indexId**: `string`
#### Inherited from
[IndexStruct](IndexStruct.md).[indexId](IndexStruct.md#indexid)
#### Defined in
[BaseIndex.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L18)
___
### nodesDict
**nodesDict**: `Record`<`string`, [`BaseNode`](BaseNode.md)\> = `{}`
#### Defined in
[BaseIndex.ts:35](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L35)
___
### summary
`Optional` **summary**: `string`
#### Inherited from
[IndexStruct](IndexStruct.md).[summary](IndexStruct.md#summary)
#### Defined in
[BaseIndex.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L19)
## Methods
### addNode
**addNode**(`node`, `textId?`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `node` | [`BaseNode`](BaseNode.md) |
| `textId?` | `string` |
#### Returns
`void`
#### Defined in
[BaseIndex.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L45)
___
### getSummary
**getSummary**(): `string`
#### Returns
`string`
#### Overrides
[IndexStruct](IndexStruct.md).[getSummary](IndexStruct.md#getsummary)
#### Defined in
[BaseIndex.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L38)
-112
View File
@@ -1,112 +0,0 @@
---
id: "IndexList"
title: "Class: IndexList"
sidebar_label: "IndexList"
sidebar_position: 0
custom_edit_url: null
---
The underlying structure of each index.
## Hierarchy
- [`IndexStruct`](IndexStruct.md)
**`IndexList`**
## Constructors
### constructor
**new IndexList**(`indexId?`, `summary?`)
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `indexId` | `string` | `undefined` |
| `summary` | `undefined` | `undefined` |
#### Inherited from
[IndexStruct](IndexStruct.md).[constructor](IndexStruct.md#constructor)
#### Defined in
[BaseIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L21)
## Properties
### indexId
**indexId**: `string`
#### Inherited from
[IndexStruct](IndexStruct.md).[indexId](IndexStruct.md#indexid)
#### Defined in
[BaseIndex.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L18)
___
### nodes
**nodes**: `string`[] = `[]`
#### Defined in
[BaseIndex.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L52)
___
### summary
`Optional` **summary**: `string`
#### Inherited from
[IndexStruct](IndexStruct.md).[summary](IndexStruct.md#summary)
#### Defined in
[BaseIndex.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L19)
## Methods
### addNode
**addNode**(`node`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `node` | [`BaseNode`](BaseNode.md) |
#### Returns
`void`
#### Defined in
[BaseIndex.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L54)
___
### getSummary
**getSummary**(): `string`
#### Returns
`string`
#### Inherited from
[IndexStruct](IndexStruct.md).[getSummary](IndexStruct.md#getsummary)
#### Defined in
[BaseIndex.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L26)
-492
View File
@@ -1,492 +0,0 @@
---
id: "IndexNode"
title: "Class: IndexNode"
sidebar_label: "IndexNode"
sidebar_position: 0
custom_edit_url: null
---
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
## Hierarchy
- [`TextNode`](TextNode.md)
**`IndexNode`**
## Constructors
### constructor
**new IndexNode**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init?` | `Partial`<[`TextNode`](TextNode.md)\> |
#### Inherited from
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
#### Defined in
[Node.ts:144](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L144)
## Properties
### embedding
`Optional` **embedding**: `number`[]
#### Inherited from
[TextNode](TextNode.md).[embedding](TextNode.md#embedding)
#### Defined in
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
___
### endCharIdx
`Optional` **endCharIdx**: `number`
#### Inherited from
[TextNode](TextNode.md).[endCharIdx](TextNode.md#endcharidx)
#### Defined in
[Node.ts:139](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L139)
___
### excludedEmbedMetadataKeys
**excludedEmbedMetadataKeys**: `string`[] = `[]`
#### Inherited from
[TextNode](TextNode.md).[excludedEmbedMetadataKeys](TextNode.md#excludedembedmetadatakeys)
#### Defined in
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
___
### excludedLlmMetadataKeys
**excludedLlmMetadataKeys**: `string`[] = `[]`
#### Inherited from
[TextNode](TextNode.md).[excludedLlmMetadataKeys](TextNode.md#excludedllmmetadatakeys)
#### Defined in
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
___
### hash
**hash**: `string` = `""`
#### Inherited from
[TextNode](TextNode.md).[hash](TextNode.md#hash)
#### Defined in
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
___
### id\_
**id\_**: `string`
#### Inherited from
[TextNode](TextNode.md).[id_](TextNode.md#id_)
#### Defined in
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
___
### indexId
**indexId**: `string` = `""`
#### Defined in
[Node.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L205)
___
### metadata
**metadata**: `Record`<`string`, `any`\> = `{}`
#### Inherited from
[TextNode](TextNode.md).[metadata](TextNode.md#metadata)
#### Defined in
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
___
### metadataSeparator
**metadataSeparator**: `string` = `"\n"`
#### Inherited from
[TextNode](TextNode.md).[metadataSeparator](TextNode.md#metadataseparator)
#### Defined in
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
___
### relationships
**relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../modules.md#relatednodetype)\>\> = `{}`
#### Inherited from
[TextNode](TextNode.md).[relationships](TextNode.md#relationships)
#### Defined in
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
___
### startCharIdx
`Optional` **startCharIdx**: `number`
#### Inherited from
[TextNode](TextNode.md).[startCharIdx](TextNode.md#startcharidx)
#### Defined in
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
___
### text
**text**: `string` = `""`
#### Inherited from
[TextNode](TextNode.md).[text](TextNode.md#text)
#### Defined in
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
## Accessors
### childNodes
`get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
#### Inherited from
TextNode.childNodes
#### Defined in
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
___
### nextNode
`get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
TextNode.nextNode
#### Defined in
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/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/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
___
### parentNode
`get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
TextNode.parentNode
#### Defined in
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
___
### prevNode
`get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
TextNode.prevNode
#### Defined in
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
___
### sourceNode
`get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
TextNode.sourceNode
#### Defined in
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
## Methods
### asRelatedNodeInfo
**asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
[TextNode](TextNode.md).[asRelatedNodeInfo](TextNode.md#asrelatednodeinfo)
#### Defined in
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
___
### generateHash
**generateHash**(): `void`
#### Returns
`void`
#### Inherited from
[TextNode](TextNode.md).[generateHash](TextNode.md#generatehash)
#### Defined in
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
___
### getContent
**getContent**(`metadataMode?`): `string`
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getContent](TextNode.md#getcontent)
#### Defined in
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
___
### getEmbedding
**getEmbedding**(): `number`[]
#### Returns
`number`[]
#### Inherited from
[TextNode](TextNode.md).[getEmbedding](TextNode.md#getembedding)
#### Defined in
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
___
### getMetadataStr
**getMetadataStr**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getMetadataStr](TextNode.md#getmetadatastr)
#### Defined in
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
___
### getNodeInfo
**getNodeInfo**(): `Object`
#### Returns
`Object`
| Name | Type |
| :------ | :------ |
| `end` | `undefined` \| `number` |
| `start` | `undefined` \| `number` |
#### Inherited from
[TextNode](TextNode.md).[getNodeInfo](TextNode.md#getnodeinfo)
#### Defined in
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
___
### getText
**getText**(): `string`
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getText](TextNode.md#gettext)
#### Defined in
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
___
### getType
**getType**(): [`ObjectType`](../enums/ObjectType.md)
#### Returns
[`ObjectType`](../enums/ObjectType.md)
#### Overrides
[TextNode](TextNode.md).[getType](TextNode.md#gettype)
#### Defined in
[Node.ts:207](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L207)
___
### setContent
**setContent**(`value`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `value` | `string` |
#### Returns
`void`
#### Inherited from
[TextNode](TextNode.md).[setContent](TextNode.md#setcontent)
#### Defined in
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
-68
View File
@@ -1,68 +0,0 @@
---
id: "IndexStruct"
title: "Class: IndexStruct"
sidebar_label: "IndexStruct"
sidebar_position: 0
custom_edit_url: null
---
The underlying structure of each index.
## Hierarchy
- **`IndexStruct`**
↳ [`IndexDict`](IndexDict.md)
↳ [`IndexList`](IndexList.md)
## Constructors
### constructor
**new IndexStruct**(`indexId?`, `summary?`)
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `indexId` | `string` | `undefined` |
| `summary` | `undefined` | `undefined` |
#### Defined in
[BaseIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L21)
## Properties
### indexId
**indexId**: `string`
#### Defined in
[BaseIndex.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L18)
___
### summary
`Optional` **summary**: `string`
#### Defined in
[BaseIndex.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L19)
## Methods
### getSummary
**getSummary**(): `string`
#### Returns
`string`
#### Defined in
[BaseIndex.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L26)
@@ -1,84 +0,0 @@
---
id: "LLMQuestionGenerator"
title: "Class: LLMQuestionGenerator"
sidebar_label: "LLMQuestionGenerator"
sidebar_position: 0
custom_edit_url: null
---
LLMQuestionGenerator uses the LLM to generate new questions for the LLM using tools and a user query.
## Implements
- [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md)
## Constructors
### constructor
**new LLMQuestionGenerator**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init?` | `Partial`<[`LLMQuestionGenerator`](LLMQuestionGenerator.md)\> |
#### Defined in
[QuestionGenerator.ts:34](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L34)
## Properties
### llmPredictor
**llmPredictor**: [`BaseLLMPredictor`](../interfaces/BaseLLMPredictor.md)
#### Defined in
[QuestionGenerator.ts:30](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L30)
___
### outputParser
**outputParser**: [`BaseOutputParser`](../interfaces/BaseOutputParser.md)<[`StructuredOutput`](../interfaces/StructuredOutput.md)<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>\>
#### Defined in
[QuestionGenerator.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L32)
___
### prompt
**prompt**: [`SimplePrompt`](../modules.md#simpleprompt)
#### Defined in
[QuestionGenerator.ts:31](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L31)
## Methods
### agenerate
**agenerate**(`tools`, `query`): `Promise`<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `tools` | [`ToolMetadata`](../interfaces/ToolMetadata.md)[] |
| `query` | `string` |
#### Returns
`Promise`<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
#### Implementation of
[BaseQuestionGenerator](../interfaces/BaseQuestionGenerator.md).[agenerate](../interfaces/BaseQuestionGenerator.md#agenerate)
#### Defined in
[QuestionGenerator.ts:40](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L40)
-281
View File
@@ -1,281 +0,0 @@
---
id: "ListIndex"
title: "Class: ListIndex"
sidebar_label: "ListIndex"
sidebar_position: 0
custom_edit_url: null
---
A ListIndex keeps nodes in a sequential list structure
## Hierarchy
- [`BaseIndex`](BaseIndex.md)<[`IndexList`](IndexList.md)\>
**`ListIndex`**
## Constructors
### constructor
**new ListIndex**(`init`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init` | [`BaseIndexInit`](../interfaces/BaseIndexInit.md)<[`IndexList`](IndexList.md)\> |
#### Overrides
[BaseIndex](BaseIndex.md).[constructor](BaseIndex.md#constructor)
#### Defined in
[index/list/ListIndex.ts:37](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L37)
## Properties
### docStore
**docStore**: `BaseDocumentStore`
#### Inherited from
[BaseIndex](BaseIndex.md).[docStore](BaseIndex.md#docstore)
#### Defined in
[BaseIndex.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L75)
___
### indexStore
`Optional` **indexStore**: `BaseIndexStore`
#### Inherited from
[BaseIndex](BaseIndex.md).[indexStore](BaseIndex.md#indexstore)
#### Defined in
[BaseIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L77)
___
### indexStruct
**indexStruct**: [`IndexList`](IndexList.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[indexStruct](BaseIndex.md#indexstruct)
#### Defined in
[BaseIndex.ts:78](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L78)
___
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[serviceContext](BaseIndex.md#servicecontext)
#### Defined in
[BaseIndex.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L73)
___
### storageContext
**storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[storageContext](BaseIndex.md#storagecontext)
#### Defined in
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
___
### vectorStore
`Optional` **vectorStore**: `VectorStore`
#### Inherited from
[BaseIndex](BaseIndex.md).[vectorStore](BaseIndex.md#vectorstore)
#### Defined in
[BaseIndex.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L76)
## Methods
### \_deleteNode
`Protected` **_deleteNode**(`nodeId`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `nodeId` | `string` |
#### Returns
`void`
#### Defined in
[index/list/ListIndex.ts:140](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L140)
___
### \_insert
`Protected` **_insert**(`nodes`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `nodes` | [`BaseNode`](BaseNode.md)[] |
#### Returns
`void`
#### Defined in
[index/list/ListIndex.ts:134](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L134)
___
### asQueryEngine
**asQueryEngine**(`mode?`): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `mode` | [`ListRetrieverMode`](../enums/ListRetrieverMode.md) | `ListRetrieverMode.DEFAULT` |
#### Returns
[`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
#### Defined in
[index/list/ListIndex.ts:113](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L113)
___
### asRetriever
**asRetriever**(`mode?`): [`BaseRetriever`](../interfaces/BaseRetriever.md)
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `mode` | [`ListRetrieverMode`](../enums/ListRetrieverMode.md) | `ListRetrieverMode.DEFAULT` |
#### Returns
[`BaseRetriever`](../interfaces/BaseRetriever.md)
#### Overrides
[BaseIndex](BaseIndex.md).[asRetriever](BaseIndex.md#asretriever)
#### Defined in
[index/list/ListIndex.ts:100](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L100)
___
### getRefDocInfo
**getRefDocInfo**(): `Promise`<`Record`<`string`, `RefDocInfo`\>\>
#### Returns
`Promise`<`Record`<`string`, `RefDocInfo`\>\>
#### Defined in
[index/list/ListIndex.ts:146](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L146)
___
### \_buildIndexFromNodes
`Static` **_buildIndexFromNodes**(`nodes`, `docStore`, `indexStruct?`): `Promise`<[`IndexList`](IndexList.md)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `nodes` | [`BaseNode`](BaseNode.md)[] |
| `docStore` | `BaseDocumentStore` |
| `indexStruct?` | [`IndexList`](IndexList.md) |
#### Returns
`Promise`<[`IndexList`](IndexList.md)\>
#### Defined in
[index/list/ListIndex.ts:119](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L119)
___
### fromDocuments
`Static` **fromDocuments**(`documents`, `storageContext?`, `serviceContext?`): `Promise`<[`ListIndex`](ListIndex.md)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `documents` | [`Document`](Document.md)[] |
| `storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Returns
`Promise`<[`ListIndex`](ListIndex.md)\>
#### Defined in
[index/list/ListIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L77)
___
### init
`Static` **init**(`options`): `Promise`<[`ListIndex`](ListIndex.md)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `options` | `ListIndexOptions` |
#### Returns
`Promise`<[`ListIndex`](ListIndex.md)\>
#### Defined in
[index/list/ListIndex.ts:41](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L41)
@@ -1,137 +0,0 @@
---
id: "ListIndexLLMRetriever"
title: "Class: ListIndexLLMRetriever"
sidebar_label: "ListIndexLLMRetriever"
sidebar_position: 0
custom_edit_url: null
---
LLM retriever for ListIndex.
## Implements
- [`BaseRetriever`](../interfaces/BaseRetriever.md)
## Constructors
### constructor
**new ListIndexLLMRetriever**(`index`, `choiceSelectPrompt?`, `choiceBatchSize?`, `formatNodeBatchFn?`, `parseChoiceSelectAnswerFn?`, `serviceContext?`)
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `index` | [`ListIndex`](ListIndex.md) | `undefined` |
| `choiceSelectPrompt?` | [`SimplePrompt`](../modules.md#simpleprompt) | `undefined` |
| `choiceBatchSize` | `number` | `10` |
| `formatNodeBatchFn?` | `NodeFormatterFunction` | `undefined` |
| `parseChoiceSelectAnswerFn?` | `ChoiceSelectParserFunction` | `undefined` |
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) | `undefined` |
#### Defined in
[index/list/ListIndexRetriever.ts:67](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L67)
## Properties
### choiceBatchSize
**choiceBatchSize**: `number`
#### Defined in
[index/list/ListIndexRetriever.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L62)
___
### choiceSelectPrompt
**choiceSelectPrompt**: [`SimplePrompt`](../modules.md#simpleprompt)
#### Defined in
[index/list/ListIndexRetriever.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L61)
___
### formatNodeBatchFn
**formatNodeBatchFn**: `NodeFormatterFunction`
#### Defined in
[index/list/ListIndexRetriever.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L63)
___
### index
**index**: [`ListIndex`](ListIndex.md)
#### Defined in
[index/list/ListIndexRetriever.ts:60](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L60)
___
### parseChoiceSelectAnswerFn
**parseChoiceSelectAnswerFn**: `ChoiceSelectParserFunction`
#### Defined in
[index/list/ListIndexRetriever.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L64)
___
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[index/list/ListIndexRetriever.ts:65](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L65)
## Methods
### aretrieve
**aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
#### Implementation of
[BaseRetriever](../interfaces/BaseRetriever.md).[aretrieve](../interfaces/BaseRetriever.md#aretrieve)
#### Defined in
[index/list/ListIndexRetriever.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L84)
___
### getServiceContext
**getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
#### Returns
[`ServiceContext`](../interfaces/ServiceContext.md)
#### Implementation of
[BaseRetriever](../interfaces/BaseRetriever.md).[getServiceContext](../interfaces/BaseRetriever.md#getservicecontext)
#### Defined in
[index/list/ListIndexRetriever.ts:134](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L134)
@@ -1,82 +0,0 @@
---
id: "ListIndexRetriever"
title: "Class: ListIndexRetriever"
sidebar_label: "ListIndexRetriever"
sidebar_position: 0
custom_edit_url: null
---
Simple retriever for ListIndex that returns all nodes
## Implements
- [`BaseRetriever`](../interfaces/BaseRetriever.md)
## Constructors
### constructor
**new ListIndexRetriever**(`index`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `index` | [`ListIndex`](ListIndex.md) |
#### Defined in
[index/list/ListIndexRetriever.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L22)
## Properties
### index
**index**: [`ListIndex`](ListIndex.md)
#### Defined in
[index/list/ListIndexRetriever.ts:20](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L20)
## Methods
### aretrieve
**aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
#### Implementation of
[BaseRetriever](../interfaces/BaseRetriever.md).[aretrieve](../interfaces/BaseRetriever.md#aretrieve)
#### Defined in
[index/list/ListIndexRetriever.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L26)
___
### getServiceContext
**getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
#### Returns
[`ServiceContext`](../interfaces/ServiceContext.md)
#### Implementation of
[BaseRetriever](../interfaces/BaseRetriever.md).[getServiceContext](../interfaces/BaseRetriever.md#getservicecontext)
#### Defined in
[index/list/ListIndexRetriever.ts:51](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L51)
-193
View File
@@ -1,193 +0,0 @@
---
id: "OpenAI"
title: "Class: OpenAI"
sidebar_label: "OpenAI"
sidebar_position: 0
custom_edit_url: null
---
OpenAI LLM implementation
## Implements
- [`LLM`](../interfaces/LLM.md)
## Constructors
### constructor
**new OpenAI**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init?` | `Partial`<[`OpenAI`](OpenAI.md)\> |
#### Defined in
[LLM.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L76)
## Properties
### callbackManager
`Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
#### Defined in
[LLM.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L74)
___
### maxRetries
**maxRetries**: `number`
#### Defined in
[LLM.ts:69](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L69)
___
### maxTokens
`Optional` **maxTokens**: `number`
#### Defined in
[LLM.ts:71](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L71)
___
### model
**model**: ``"gpt-3.5-turbo"`` \| ``"gpt-3.5-turbo-16k"`` \| ``"gpt-4"`` \| ``"gpt-4-32k"``
#### Defined in
[LLM.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L66)
___
### n
• **n**: `number` = `1`
#### Defined in
[LLM.ts:70](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L70)
___
### openAIKey
• **openAIKey**: ``null`` \| `string` = `null`
#### Defined in
[LLM.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L72)
___
### requestTimeout
• **requestTimeout**: ``null`` \| `number`
#### Defined in
[LLM.ts:68](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L68)
___
### session
• **session**: `OpenAISession`
#### Defined in
[LLM.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L73)
___
### temperature
• **temperature**: `number`
#### Defined in
[LLM.ts:67](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L67)
## Methods
### achat
▸ **achat**(`messages`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
Get a chat response from the LLM
#### Parameters
| Name | Type |
| :------ | :------ |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
#### Implementation of
[LLM](../interfaces/LLM.md).[achat](../interfaces/LLM.md#achat)
#### Defined in
[LLM.ts:103](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L103)
___
### acomplete
▸ **acomplete**(`prompt`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
Get a prompt completion from the LLM
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `prompt` | `string` | the prompt to complete |
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
#### Returns
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
#### Implementation of
[LLM](../interfaces/LLM.md).[acomplete](../interfaces/LLM.md#acomplete)
#### Defined in
[LLM.ts:145](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L145)
___
### mapMessageType
▸ **mapMessageType**(`type`): `ChatCompletionRequestMessageRoleEnum`
#### Parameters
| Name | Type |
| :------ | :------ |
| `type` | `MessageType` |
#### Returns
`ChatCompletionRequestMessageRoleEnum`
#### Defined in
[LLM.ts:88](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L88)
@@ -1,141 +0,0 @@
---
id: "OpenAIEmbedding"
title: "Class: OpenAIEmbedding"
sidebar_label: "OpenAIEmbedding"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`BaseEmbedding`](BaseEmbedding.md)
**`OpenAIEmbedding`**
## Constructors
### constructor
**new OpenAIEmbedding**()
#### Overrides
[BaseEmbedding](BaseEmbedding.md).[constructor](BaseEmbedding.md#constructor)
#### Defined in
[Embedding.ts:217](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L217)
## Properties
### model
**model**: `TEXT_EMBED_ADA_002`
#### Defined in
[Embedding.ts:215](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L215)
___
### session
**session**: `OpenAISession`
#### Defined in
[Embedding.ts:214](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L214)
## Methods
### \_aGetOpenAIEmbedding
`Private` **_aGetOpenAIEmbedding**(`input`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `input` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Defined in
[Embedding.ts:224](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L224)
___
### aGetQueryEmbedding
**aGetQueryEmbedding**(`query`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Overrides
[BaseEmbedding](BaseEmbedding.md).[aGetQueryEmbedding](BaseEmbedding.md#agetqueryembedding)
#### Defined in
[Embedding.ts:240](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L240)
___
### aGetTextEmbedding
**aGetTextEmbedding**(`text`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `text` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Overrides
[BaseEmbedding](BaseEmbedding.md).[aGetTextEmbedding](BaseEmbedding.md#agettextembedding)
#### Defined in
[Embedding.ts:236](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L236)
___
### similarity
**similarity**(`embedding1`, `embedding2`, `mode?`): `number`
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `embedding1` | `number`[] | `undefined` |
| `embedding2` | `number`[] | `undefined` |
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
#### Returns
`number`
#### Inherited from
[BaseEmbedding](BaseEmbedding.md).[similarity](BaseEmbedding.md#similarity)
#### Defined in
[Embedding.ts:197](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L197)
-136
View File
@@ -1,136 +0,0 @@
---
id: "Refine"
title: "Class: Refine"
sidebar_label: "Refine"
sidebar_position: 0
custom_edit_url: null
---
A response builder that uses the query to ask the LLM generate a better response using multiple text chunks.
## Hierarchy
- **`Refine`**
↳ [`CompactAndRefine`](CompactAndRefine.md)
## Implements
- `BaseResponseBuilder`
## Constructors
### constructor
**new Refine**(`serviceContext`, `textQATemplate?`, `refineTemplate?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
| `textQATemplate?` | [`SimplePrompt`](../modules.md#simpleprompt) |
| `refineTemplate?` | [`SimplePrompt`](../modules.md#simpleprompt) |
#### Defined in
[ResponseSynthesizer.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L66)
## Properties
### refineTemplate
**refineTemplate**: [`SimplePrompt`](../modules.md#simpleprompt)
#### Defined in
[ResponseSynthesizer.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L64)
___
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[ResponseSynthesizer.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L62)
___
### textQATemplate
**textQATemplate**: [`SimplePrompt`](../modules.md#simpleprompt)
#### Defined in
[ResponseSynthesizer.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L63)
## Methods
### agetResponse
**agetResponse**(`query`, `textChunks`, `prevResponse?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `textChunks` | `string`[] |
| `prevResponse?` | `any` |
#### Returns
`Promise`<`string`\>
#### Implementation of
BaseResponseBuilder.agetResponse
#### Defined in
[ResponseSynthesizer.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L76)
___
### giveResponseSingle
`Private` **giveResponseSingle**(`queryStr`, `textChunk`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `queryStr` | `string` |
| `textChunk` | `string` |
#### Returns
`Promise`<`string`\>
#### Defined in
[ResponseSynthesizer.ts:95](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L95)
___
### refineResponseSingle
`Private` **refineResponseSingle**(`response`, `queryStr`, `textChunk`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `response` | `string` |
| `queryStr` | `string` |
| `textChunk` | `string` |
#### Returns
`Promise`<`string`\>
#### Defined in
[ResponseSynthesizer.ts:123](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L123)
-74
View File
@@ -1,74 +0,0 @@
---
id: "Response"
title: "Class: Response"
sidebar_label: "Response"
sidebar_position: 0
custom_edit_url: null
---
Respone is the output of a LLM
## Constructors
### constructor
**new Response**(`response`, `sourceNodes?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `response` | `string` |
| `sourceNodes?` | [`BaseNode`](BaseNode.md)[] |
#### Defined in
[Response.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L10)
## Properties
### response
**response**: `string`
#### Defined in
[Response.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L7)
___
### sourceNodes
`Optional` **sourceNodes**: [`BaseNode`](BaseNode.md)[]
#### Defined in
[Response.ts:8](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L8)
## Methods
### getFormattedSources
**getFormattedSources**(): `void`
#### Returns
`void`
#### Defined in
[Response.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L15)
___
### toString
**toString**(): `string`
#### Returns
`string`
#### Defined in
[Response.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L19)
@@ -1,69 +0,0 @@
---
id: "ResponseSynthesizer"
title: "Class: ResponseSynthesizer"
sidebar_label: "ResponseSynthesizer"
sidebar_position: 0
custom_edit_url: null
---
A ResponseSynthesizer is used to generate a response from a query and a list of nodes.
## Constructors
### constructor
**new ResponseSynthesizer**(`«destructured»?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `«destructured»` | `Object` |
|  `responseBuilder?` | `BaseResponseBuilder` |
|  `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Defined in
[ResponseSynthesizer.ts:225](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L225)
## Properties
### responseBuilder
**responseBuilder**: `BaseResponseBuilder`
#### Defined in
[ResponseSynthesizer.ts:222](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L222)
___
### serviceContext
`Optional` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[ResponseSynthesizer.ts:223](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L223)
## Methods
### asynthesize
**asynthesize**(`query`, `nodes`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `nodes` | [`NodeWithScore`](../interfaces/NodeWithScore.md)[] |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<[`Response`](Response.md)\>
#### Defined in
[ResponseSynthesizer.ts:237](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L237)
@@ -1,74 +0,0 @@
---
id: "RetrieverQueryEngine"
title: "Class: RetrieverQueryEngine"
sidebar_label: "RetrieverQueryEngine"
sidebar_position: 0
custom_edit_url: null
---
A query engine that uses a retriever to query an index and then synthesizes the response.
## Implements
- [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
## Constructors
### constructor
**new RetrieverQueryEngine**(`retriever`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
#### Defined in
[QueryEngine.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L29)
## Properties
### responseSynthesizer
**responseSynthesizer**: [`ResponseSynthesizer`](ResponseSynthesizer.md)
#### Defined in
[QueryEngine.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L27)
___
### retriever
**retriever**: [`BaseRetriever`](../interfaces/BaseRetriever.md)
#### Defined in
[QueryEngine.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L26)
## Methods
### aquery
**aquery**(`query`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<[`Response`](Response.md)\>
#### Implementation of
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[aquery](../interfaces/BaseQueryEngine.md#aquery)
#### Defined in
[QueryEngine.ts:36](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L36)
@@ -1,236 +0,0 @@
---
id: "SentenceSplitter"
title: "Class: SentenceSplitter"
sidebar_label: "SentenceSplitter"
sidebar_position: 0
custom_edit_url: null
---
SentenceSplitter is our default text splitter that supports splitting into sentences, paragraphs, or fixed length chunks with overlap.
## Constructors
### constructor
**new SentenceSplitter**(`chunkSize?`, `chunkOverlap?`, `tokenizer?`, `tokenizerDecoder?`, `paragraphSeparator?`, `chunkingTokenizerFn?`)
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `chunkSize` | `number` | `DEFAULT_CHUNK_SIZE` |
| `chunkOverlap` | `number` | `DEFAULT_CHUNK_OVERLAP` |
| `tokenizer` | `any` | `null` |
| `tokenizerDecoder` | `any` | `null` |
| `paragraphSeparator` | `string` | `"\n\n\n"` |
| `chunkingTokenizerFn` | `any` | `undefined` |
#### Defined in
[TextSplitter.ts:33](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L33)
## Properties
### chunkOverlap
`Private` **chunkOverlap**: `number`
#### Defined in
[TextSplitter.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L26)
___
### chunkSize
`Private` **chunkSize**: `number`
#### Defined in
[TextSplitter.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L25)
___
### chunkingTokenizerFn
`Private` **chunkingTokenizerFn**: `any`
#### Defined in
[TextSplitter.ts:30](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L30)
___
### paragraphSeparator
`Private` **paragraphSeparator**: `string`
#### Defined in
[TextSplitter.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L29)
___
### tokenizer
`Private` **tokenizer**: `any`
#### Defined in
[TextSplitter.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L27)
___
### tokenizerDecoder
`Private` **tokenizerDecoder**: `any`
#### Defined in
[TextSplitter.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L28)
## Methods
### combineTextSplits
**combineTextSplits**(`newSentenceSplits`, `effectiveChunkSize`): `TextSplit`[]
#### Parameters
| Name | Type |
| :------ | :------ |
| `newSentenceSplits` | `SplitRep`[] |
| `effectiveChunkSize` | `number` |
#### Returns
`TextSplit`[]
#### Defined in
[TextSplitter.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L153)
___
### getEffectiveChunkSize
`Private` **getEffectiveChunkSize**(`extraInfoStr?`): `number`
#### Parameters
| Name | Type |
| :------ | :------ |
| `extraInfoStr?` | `string` |
#### Returns
`number`
#### Defined in
[TextSplitter.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L72)
___
### getParagraphSplits
**getParagraphSplits**(`text`, `effectiveChunkSize?`): `string`[]
#### Parameters
| Name | Type |
| :------ | :------ |
| `text` | `string` |
| `effectiveChunkSize?` | `number` |
#### Returns
`string`[]
#### Defined in
[TextSplitter.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L89)
___
### getSentenceSplits
**getSentenceSplits**(`text`, `effectiveChunkSize?`): `string`[]
#### Parameters
| Name | Type |
| :------ | :------ |
| `text` | `string` |
| `effectiveChunkSize?` | `number` |
#### Returns
`string`[]
#### Defined in
[TextSplitter.ts:115](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L115)
___
### processSentenceSplits
`Private` **processSentenceSplits**(`sentenceSplits`, `effectiveChunkSize`): `SplitRep`[]
#### Parameters
| Name | Type |
| :------ | :------ |
| `sentenceSplits` | `string`[] |
| `effectiveChunkSize` | `number` |
#### Returns
`SplitRep`[]
#### Defined in
[TextSplitter.ts:128](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L128)
___
### splitText
**splitText**(`text`, `extraInfoStr?`): `string`[]
#### Parameters
| Name | Type |
| :------ | :------ |
| `text` | `string` |
| `extraInfoStr?` | `string` |
#### Returns
`string`[]
#### Defined in
[TextSplitter.ts:233](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L233)
___
### splitTextWithOverlaps
**splitTextWithOverlaps**(`text`, `extraInfoStr?`): `TextSplit`[]
#### Parameters
| Name | Type |
| :------ | :------ |
| `text` | `string` |
| `extraInfoStr?` | `string` |
#### Returns
`TextSplit`[]
#### Defined in
[TextSplitter.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L205)
@@ -1,96 +0,0 @@
---
id: "SimpleChatEngine"
title: "Class: SimpleChatEngine"
sidebar_label: "SimpleChatEngine"
sidebar_position: 0
custom_edit_url: null
---
SimpleChatEngine is the simplest possible chat engine. Useful for using your own custom prompts.
## Implements
- [`ChatEngine`](../interfaces/ChatEngine.md)
## Constructors
### constructor
**new SimpleChatEngine**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init?` | `Partial`<[`SimpleChatEngine`](SimpleChatEngine.md)\> |
#### Defined in
[ChatEngine.ts:40](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L40)
## Properties
### chatHistory
**chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
#### Defined in
[ChatEngine.ts:37](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L37)
___
### llm
**llm**: [`LLM`](../interfaces/LLM.md)
#### Defined in
[ChatEngine.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L38)
## Methods
### achat
**achat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
Send message along with the class's current chat history to the LLM.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `message` | `string` | |
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
#### Returns
`Promise`<[`Response`](Response.md)\>
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[achat](../interfaces/ChatEngine.md#achat)
#### Defined in
[ChatEngine.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L45)
___
### reset
**reset**(): `void`
Resets the chat history so that it's empty.
#### Returns
`void`
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
#### Defined in
[ChatEngine.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L54)
@@ -1,114 +0,0 @@
---
id: "SimpleNodeParser"
title: "Class: SimpleNodeParser"
sidebar_label: "SimpleNodeParser"
sidebar_position: 0
custom_edit_url: null
---
SimpleNodeParser is the default NodeParser. It splits documents into TextNodes using a splitter, by default SentenceSplitter
## Implements
- [`NodeParser`](../interfaces/NodeParser.md)
## Constructors
### constructor
**new SimpleNodeParser**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init?` | `Object` |
| `init.chunkOverlap?` | `number` |
| `init.chunkSize?` | `number` |
| `init.includeMetadata?` | `boolean` |
| `init.includePrevNextRel?` | `boolean` |
| `init.textSplitter?` | [`SentenceSplitter`](SentenceSplitter.md) |
#### Defined in
[NodeParser.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L64)
## Properties
### includeMetadata
**includeMetadata**: `boolean`
#### Defined in
[NodeParser.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L61)
___
### includePrevNextRel
**includePrevNextRel**: `boolean`
#### Defined in
[NodeParser.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L62)
___
### textSplitter
**textSplitter**: [`SentenceSplitter`](SentenceSplitter.md)
#### Defined in
[NodeParser.ts:60](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L60)
## Methods
### getNodesFromDocuments
**getNodesFromDocuments**(`documents`): [`TextNode`](TextNode.md)[]
Generate Node objects from documents
#### Parameters
| Name | Type |
| :------ | :------ |
| `documents` | [`Document`](Document.md)[] |
#### Returns
[`TextNode`](TextNode.md)[]
#### Implementation of
[NodeParser](../interfaces/NodeParser.md).[getNodesFromDocuments](../interfaces/NodeParser.md#getnodesfromdocuments)
#### Defined in
[NodeParser.ts:95](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L95)
___
### fromDefaults
`Static` **fromDefaults**(`init?`): [`SimpleNodeParser`](SimpleNodeParser.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init?` | `Object` |
| `init.chunkOverlap?` | `number` |
| `init.chunkSize?` | `number` |
| `init.includeMetadata?` | `boolean` |
| `init.includePrevNextRel?` | `boolean` |
#### Returns
[`SimpleNodeParser`](SimpleNodeParser.md)
#### Defined in
[NodeParser.ts:82](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L82)
@@ -1,75 +0,0 @@
---
id: "SimpleResponseBuilder"
title: "Class: SimpleResponseBuilder"
sidebar_label: "SimpleResponseBuilder"
sidebar_position: 0
custom_edit_url: null
---
A response builder that just concatenates responses.
## Implements
- `BaseResponseBuilder`
## Constructors
### constructor
**new SimpleResponseBuilder**(`serviceContext?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Defined in
[ResponseSynthesizer.ts:37](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L37)
## Properties
### llmPredictor
**llmPredictor**: [`BaseLLMPredictor`](../interfaces/BaseLLMPredictor.md)
#### Defined in
[ResponseSynthesizer.ts:34](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L34)
___
### textQATemplate
**textQATemplate**: [`SimplePrompt`](../modules.md#simpleprompt)
#### Defined in
[ResponseSynthesizer.ts:35](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L35)
## Methods
### agetResponse
**agetResponse**(`query`, `textChunks`, `parentEvent?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `textChunks` | `string`[] |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<`string`\>
#### Implementation of
BaseResponseBuilder.agetResponse
#### Defined in
[ResponseSynthesizer.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L43)
@@ -1,67 +0,0 @@
---
id: "SubQuestionOutputParser"
title: "Class: SubQuestionOutputParser"
sidebar_label: "SubQuestionOutputParser"
sidebar_position: 0
custom_edit_url: null
---
SubQuestionOutputParser is used to parse the output of the SubQuestionGenerator.
## Implements
- [`BaseOutputParser`](../interfaces/BaseOutputParser.md)<[`StructuredOutput`](../interfaces/StructuredOutput.md)<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>\>
## Constructors
### constructor
**new SubQuestionOutputParser**()
## Methods
### format
**format**(`output`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| `output` | `string` |
#### Returns
`string`
#### Implementation of
[BaseOutputParser](../interfaces/BaseOutputParser.md).[format](../interfaces/BaseOutputParser.md#format)
#### Defined in
[OutputParser.ts:97](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L97)
___
### parse
**parse**(`output`): [`StructuredOutput`](../interfaces/StructuredOutput.md)<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `output` | `string` |
#### Returns
[`StructuredOutput`](../interfaces/StructuredOutput.md)<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
#### Implementation of
[BaseOutputParser](../interfaces/BaseOutputParser.md).[parse](../interfaces/BaseOutputParser.md#parse)
#### Defined in
[OutputParser.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L89)
@@ -1,141 +0,0 @@
---
id: "SubQuestionQueryEngine"
title: "Class: SubQuestionQueryEngine"
sidebar_label: "SubQuestionQueryEngine"
sidebar_position: 0
custom_edit_url: null
---
SubQuestionQueryEngine decomposes a question into subquestions and then
## Implements
- [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
## Constructors
### constructor
**new SubQuestionQueryEngine**(`init`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init` | `Object` |
| `init.queryEngineTools` | [`QueryEngineTool`](../interfaces/QueryEngineTool.md)[] |
| `init.questionGen` | [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md) |
| `init.responseSynthesizer` | [`ResponseSynthesizer`](ResponseSynthesizer.md) |
#### Defined in
[QueryEngine.ts:56](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L56)
## Properties
### metadatas
**metadatas**: [`ToolMetadata`](../interfaces/ToolMetadata.md)[]
#### Defined in
[QueryEngine.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L54)
___
### queryEngines
**queryEngines**: `Record`<`string`, [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)\>
#### Defined in
[QueryEngine.ts:53](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L53)
___
### questionGen
**questionGen**: [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md)
#### Defined in
[QueryEngine.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L52)
___
### responseSynthesizer
**responseSynthesizer**: [`ResponseSynthesizer`](ResponseSynthesizer.md)
#### Defined in
[QueryEngine.ts:51](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L51)
## Methods
### aquery
**aquery**(`query`): `Promise`<[`Response`](Response.md)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
#### Returns
`Promise`<[`Response`](Response.md)\>
#### Implementation of
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[aquery](../interfaces/BaseQueryEngine.md#aquery)
#### Defined in
[QueryEngine.ts:97](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L97)
___
### aquerySubQ
`Private` **aquerySubQ**(`subQ`, `parentEvent?`): `Promise`<``null`` \| [`NodeWithScore`](../interfaces/NodeWithScore.md)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `subQ` | [`SubQuestion`](../interfaces/SubQuestion.md) |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<``null`` \| [`NodeWithScore`](../interfaces/NodeWithScore.md)\>
#### Defined in
[QueryEngine.ts:128](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L128)
___
### fromDefaults
▸ `Static` **fromDefaults**(`init`): [`SubQuestionQueryEngine`](SubQuestionQueryEngine.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init` | `Object` |
| `init.queryEngineTools` | [`QueryEngineTool`](../interfaces/QueryEngineTool.md)[] |
| `init.questionGen?` | [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md) |
| `init.responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) |
| `init.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Returns
[`SubQuestionQueryEngine`](SubQuestionQueryEngine.md)
#### Defined in
[QueryEngine.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L73)
@@ -1,44 +0,0 @@
---
id: "TextFileReader"
title: "Class: TextFileReader"
sidebar_label: "TextFileReader"
sidebar_position: 0
custom_edit_url: null
---
Read a .txt file
## Implements
- [`BaseReader`](../interfaces/BaseReader.md)
## Constructors
### constructor
**new TextFileReader**()
## Methods
### loadData
**loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `file` | `string` |
| `fs` | [`CompleteFileSystem`](../modules.md#completefilesystem) |
#### Returns
`Promise`<[`Document`](Document.md)[]\>
#### Implementation of
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
#### Defined in
[readers/SimpleDirectoryReader.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/readers/SimpleDirectoryReader.ts#L12)
-458
View File
@@ -1,458 +0,0 @@
---
id: "TextNode"
title: "Class: TextNode"
sidebar_label: "TextNode"
sidebar_position: 0
custom_edit_url: null
---
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
## Hierarchy
- [`BaseNode`](BaseNode.md)
**`TextNode`**
↳↳ [`IndexNode`](IndexNode.md)
↳↳ [`Document`](Document.md)
## Constructors
### constructor
**new TextNode**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init?` | `Partial`<[`TextNode`](TextNode.md)\> |
#### Overrides
[BaseNode](BaseNode.md).[constructor](BaseNode.md#constructor)
#### Defined in
[Node.ts:144](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L144)
## Properties
### embedding
`Optional` **embedding**: `number`[]
#### Inherited from
[BaseNode](BaseNode.md).[embedding](BaseNode.md#embedding)
#### Defined in
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
___
### endCharIdx
`Optional` **endCharIdx**: `number`
#### Defined in
[Node.ts:139](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L139)
___
### excludedEmbedMetadataKeys
**excludedEmbedMetadataKeys**: `string`[] = `[]`
#### Inherited from
[BaseNode](BaseNode.md).[excludedEmbedMetadataKeys](BaseNode.md#excludedembedmetadatakeys)
#### Defined in
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
___
### excludedLlmMetadataKeys
**excludedLlmMetadataKeys**: `string`[] = `[]`
#### Inherited from
[BaseNode](BaseNode.md).[excludedLlmMetadataKeys](BaseNode.md#excludedllmmetadatakeys)
#### Defined in
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
___
### hash
**hash**: `string` = `""`
#### Inherited from
[BaseNode](BaseNode.md).[hash](BaseNode.md#hash)
#### Defined in
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
___
### id\_
**id\_**: `string`
#### Inherited from
[BaseNode](BaseNode.md).[id_](BaseNode.md#id_)
#### Defined in
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
___
### metadata
**metadata**: `Record`<`string`, `any`\> = `{}`
#### Inherited from
[BaseNode](BaseNode.md).[metadata](BaseNode.md#metadata)
#### Defined in
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
___
### metadataSeparator
**metadataSeparator**: `string` = `"\n"`
#### Defined in
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
___
### relationships
**relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../modules.md#relatednodetype)\>\> = `{}`
#### Inherited from
[BaseNode](BaseNode.md).[relationships](BaseNode.md#relationships)
#### Defined in
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
___
### startCharIdx
`Optional` **startCharIdx**: `number`
#### Defined in
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
___
### text
**text**: `string` = `""`
#### Defined in
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
## Accessors
### childNodes
`get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
#### Inherited from
BaseNode.childNodes
#### Defined in
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
___
### nextNode
`get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
BaseNode.nextNode
#### Defined in
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/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/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
___
### parentNode
`get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
BaseNode.parentNode
#### Defined in
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
___
### prevNode
`get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
BaseNode.prevNode
#### Defined in
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
___
### sourceNode
`get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
BaseNode.sourceNode
#### Defined in
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
## Methods
### asRelatedNodeInfo
**asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Returns
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
#### Inherited from
[BaseNode](BaseNode.md).[asRelatedNodeInfo](BaseNode.md#asrelatednodeinfo)
#### Defined in
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
___
### generateHash
**generateHash**(): `void`
#### Returns
`void`
#### Defined in
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
___
### getContent
**getContent**(`metadataMode?`): `string`
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
#### Returns
`string`
#### Overrides
[BaseNode](BaseNode.md).[getContent](BaseNode.md#getcontent)
#### Defined in
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
___
### getEmbedding
**getEmbedding**(): `number`[]
#### Returns
`number`[]
#### Inherited from
[BaseNode](BaseNode.md).[getEmbedding](BaseNode.md#getembedding)
#### Defined in
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
___
### getMetadataStr
**getMetadataStr**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Overrides
[BaseNode](BaseNode.md).[getMetadataStr](BaseNode.md#getmetadatastr)
#### Defined in
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
___
### getNodeInfo
**getNodeInfo**(): `Object`
#### Returns
`Object`
| Name | Type |
| :------ | :------ |
| `end` | `undefined` \| `number` |
| `start` | `undefined` \| `number` |
#### Defined in
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
___
### getText
**getText**(): `string`
#### Returns
`string`
#### Defined in
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
___
### getType
**getType**(): [`ObjectType`](../enums/ObjectType.md)
#### Returns
[`ObjectType`](../enums/ObjectType.md)
#### Overrides
[BaseNode](BaseNode.md).[getType](BaseNode.md#gettype)
#### Defined in
[Node.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L153)
___
### setContent
**setContent**(`value`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `value` | `string` |
#### Returns
`void`
#### Overrides
[BaseNode](BaseNode.md).[setContent](BaseNode.md#setcontent)
#### Defined in
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
@@ -1,64 +0,0 @@
---
id: "TreeSummarize"
title: "Class: TreeSummarize"
sidebar_label: "TreeSummarize"
sidebar_position: 0
custom_edit_url: null
---
TreeSummarize repacks the text chunks into the smallest possible number of chunks and then summarizes them, then recursively does so until there's one chunk left.
## Implements
- `BaseResponseBuilder`
## Constructors
### constructor
**new TreeSummarize**(`serviceContext`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Defined in
[ResponseSynthesizer.ts:177](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L177)
## Properties
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[ResponseSynthesizer.ts:175](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L175)
## Methods
### agetResponse
**agetResponse**(`query`, `textChunks`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `textChunks` | `string`[] |
#### Returns
`Promise`<`string`\>
#### Implementation of
BaseResponseBuilder.agetResponse
#### Defined in
[ResponseSynthesizer.ts:181](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L181)
@@ -1,102 +0,0 @@
---
id: "VectorIndexRetriever"
title: "Class: VectorIndexRetriever"
sidebar_label: "VectorIndexRetriever"
sidebar_position: 0
custom_edit_url: null
---
VectorIndexRetriever retrieves nodes from a VectorIndex.
## Implements
- [`BaseRetriever`](../interfaces/BaseRetriever.md)
## Constructors
### constructor
**new VectorIndexRetriever**(`index`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `index` | [`VectorStoreIndex`](VectorStoreIndex.md) |
#### Defined in
[Retriever.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L28)
## Properties
### index
**index**: [`VectorStoreIndex`](VectorStoreIndex.md)
#### Defined in
[Retriever.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L24)
___
### serviceContext
`Private` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[Retriever.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L26)
___
### similarityTopK
**similarityTopK**: `number` = `DEFAULT_SIMILARITY_TOP_K`
#### Defined in
[Retriever.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L25)
## Methods
### aretrieve
**aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
#### Implementation of
[BaseRetriever](../interfaces/BaseRetriever.md).[aretrieve](../interfaces/BaseRetriever.md#aretrieve)
#### Defined in
[Retriever.ts:33](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L33)
___
### getServiceContext
**getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
#### Returns
[`ServiceContext`](../interfaces/ServiceContext.md)
#### Implementation of
[BaseRetriever](../interfaces/BaseRetriever.md).[getServiceContext](../interfaces/BaseRetriever.md#getservicecontext)
#### Defined in
[Retriever.ts:70](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L70)
@@ -1,253 +0,0 @@
---
id: "VectorStoreIndex"
title: "Class: VectorStoreIndex"
sidebar_label: "VectorStoreIndex"
sidebar_position: 0
custom_edit_url: null
---
The VectorStoreIndex, an index that stores the nodes only according to their vector embedings.
## Hierarchy
- [`BaseIndex`](BaseIndex.md)<[`IndexDict`](IndexDict.md)\>
**`VectorStoreIndex`**
## Constructors
### constructor
`Private` **new VectorStoreIndex**(`init`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `init` | `VectorIndexConstructorProps` |
#### Overrides
[BaseIndex](BaseIndex.md).[constructor](BaseIndex.md#constructor)
#### Defined in
[BaseIndex.ts:109](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L109)
## Properties
### docStore
**docStore**: `BaseDocumentStore`
#### Inherited from
[BaseIndex](BaseIndex.md).[docStore](BaseIndex.md#docstore)
#### Defined in
[BaseIndex.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L75)
___
### indexStore
`Optional` **indexStore**: `BaseIndexStore`
#### Inherited from
[BaseIndex](BaseIndex.md).[indexStore](BaseIndex.md#indexstore)
#### Defined in
[BaseIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L77)
___
### indexStruct
**indexStruct**: [`IndexDict`](IndexDict.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[indexStruct](BaseIndex.md#indexstruct)
#### Defined in
[BaseIndex.ts:78](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L78)
___
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[serviceContext](BaseIndex.md#servicecontext)
#### Defined in
[BaseIndex.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L73)
___
### storageContext
**storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[storageContext](BaseIndex.md#storagecontext)
#### Defined in
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
___
### vectorStore
**vectorStore**: `VectorStore`
#### Overrides
[BaseIndex](BaseIndex.md).[vectorStore](BaseIndex.md#vectorstore)
#### Defined in
[BaseIndex.ts:107](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L107)
## Methods
### asQueryEngine
**asQueryEngine**(): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
Get a retriever query engine for this index.
NOTE: if you are using a custom query engine you don't have to use this method.
#### Returns
[`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
#### Defined in
[BaseIndex.ts:252](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L252)
___
### asRetriever
**asRetriever**(): [`VectorIndexRetriever`](VectorIndexRetriever.md)
Get a VectorIndexRetriever for this index.
NOTE: if you want to use a custom retriever you don't have to use this method.
#### Returns
[`VectorIndexRetriever`](VectorIndexRetriever.md)
retriever for the index
#### Overrides
[BaseIndex](BaseIndex.md).[asRetriever](BaseIndex.md#asretriever)
#### Defined in
[BaseIndex.ts:242](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L242)
___
### agetNodeEmbeddingResults
`Static` **agetNodeEmbeddingResults**(`nodes`, `serviceContext`, `logProgress?`): `Promise`<[`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[]\>
Get the embeddings for nodes.
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `nodes` | [`BaseNode`](BaseNode.md)[] | `undefined` | |
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) | `undefined` | |
| `logProgress` | `boolean` | `false` | log progress to console (useful for debugging) |
#### Returns
`Promise`<[`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[]\>
#### Defined in
[BaseIndex.ts:159](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L159)
___
### buildIndexFromNodes
`Static` **buildIndexFromNodes**(`nodes`, `serviceContext`, `vectorStore`): `Promise`<[`IndexDict`](IndexDict.md)\>
Get embeddings for nodes and place them into the index.
#### Parameters
| Name | Type |
| :------ | :------ |
| `nodes` | [`BaseNode`](BaseNode.md)[] |
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
| `vectorStore` | `VectorStore` |
#### Returns
`Promise`<[`IndexDict`](IndexDict.md)\>
#### Defined in
[BaseIndex.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L187)
___
### fromDocuments
`Static` **fromDocuments**(`documents`, `storageContext?`, `serviceContext?`): `Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
High level API: split documents, get embeddings, and build index.
#### Parameters
| Name | Type |
| :------ | :------ |
| `documents` | [`Document`](Document.md)[] |
| `storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Returns
`Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
#### Defined in
[BaseIndex.ts:214](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L214)
___
### init
`Static` **init**(`options`): `Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `options` | [`VectorIndexOptions`](../interfaces/VectorIndexOptions.md) |
#### Returns
`Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
#### Defined in
[BaseIndex.ts:114](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L114)
@@ -1,2 +0,0 @@
label: "Classes"
position: 3
@@ -1,27 +0,0 @@
---
id: "ListRetrieverMode"
title: "Enumeration: ListRetrieverMode"
sidebar_label: "ListRetrieverMode"
sidebar_position: 0
custom_edit_url: null
---
## Enumeration Members
### DEFAULT
**DEFAULT** = ``"default"``
#### Defined in
[index/list/ListIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L21)
___
### LLM
• **LLM** = ``"llm"``
#### Defined in
[index/list/ListIndex.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L23)
-47
View File
@@ -1,47 +0,0 @@
---
id: "MetadataMode"
title: "Enumeration: MetadataMode"
sidebar_label: "MetadataMode"
sidebar_position: 0
custom_edit_url: null
---
## Enumeration Members
### ALL
**ALL** = ``"ALL"``
#### Defined in
[Node.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L19)
___
### EMBED
• **EMBED** = ``"EMBED"``
#### Defined in
[Node.ts:20](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L20)
___
### LLM
• **LLM** = ``"LLM"``
#### Defined in
[Node.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L21)
___
### NONE
• **NONE** = ``"NONE"``
#### Defined in
[Node.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L22)
@@ -1,57 +0,0 @@
---
id: "NodeRelationship"
title: "Enumeration: NodeRelationship"
sidebar_label: "NodeRelationship"
sidebar_position: 0
custom_edit_url: null
---
## Enumeration Members
### CHILD
**CHILD** = ``"CHILD"``
#### Defined in
[Node.ts:8](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L8)
___
### NEXT
• **NEXT** = ``"NEXT"``
#### Defined in
[Node.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L6)
___
### PARENT
• **PARENT** = ``"PARENT"``
#### Defined in
[Node.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L7)
___
### PREVIOUS
• **PREVIOUS** = ``"PREVIOUS"``
#### Defined in
[Node.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L5)
___
### SOURCE
• **SOURCE** = ``"SOURCE"``
#### Defined in
[Node.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L4)
-47
View File
@@ -1,47 +0,0 @@
---
id: "ObjectType"
title: "Enumeration: ObjectType"
sidebar_label: "ObjectType"
sidebar_position: 0
custom_edit_url: null
---
## Enumeration Members
### DOCUMENT
**DOCUMENT** = ``"DOCUMENT"``
#### Defined in
[Node.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L15)
___
### IMAGE
• **IMAGE** = ``"IMAGE"``
#### Defined in
[Node.ts:13](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L13)
___
### INDEX
• **INDEX** = ``"INDEX"``
#### Defined in
[Node.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L14)
___
### TEXT
• **TEXT** = ``"TEXT"``
#### Defined in
[Node.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L12)
@@ -1,40 +0,0 @@
---
id: "SimilarityType"
title: "Enumeration: SimilarityType"
sidebar_label: "SimilarityType"
sidebar_position: 0
custom_edit_url: null
---
Similarity type
Default is cosine similarity. Dot product and negative Euclidean distance are also supported.
## Enumeration Members
### DEFAULT
**DEFAULT** = ``"cosine"``
#### Defined in
[Embedding.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L10)
___
### DOT\_PRODUCT
• **DOT\_PRODUCT** = ``"dot_product"``
#### Defined in
[Embedding.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L11)
___
### EUCLIDEAN
• **EUCLIDEAN** = ``"euclidean"``
#### Defined in
[Embedding.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L12)
-2
View File
@@ -1,2 +0,0 @@
label: "Enumerations"
position: 2
-86
View File
@@ -1,86 +0,0 @@
---
id: "index"
title: "llamaindex"
sidebar_label: "Readme"
sidebar_position: 0
custom_edit_url: null
---
# LlamaIndex.TS
Use your own data with large language models (LLMs, OpenAI ChatGPT and others) in Typescript and Javascript.
## What is LlamaIndex.TS?
LlamaIndex.TS aims to be a lightweight, easy to use set of libraries to help you integrate large language models into your applications with your own data.
## Getting started with an example:
LlamaIndex.TS requries Node v18 or higher. You can download it from https://nodejs.org or use https://nvm.sh (our preferred option).
In a new folder:
```bash
export OPEN_AI_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
npx tsc -init # if needed
pnpm install llamaindex
```
Create the file example.ts
```ts
// example.ts
import fs from "fs/promises";
import { Document, VectorStoreIndex } from "llamaindex";
async function main() {
// Load essay from abramov.txt in Node
const essay = await fs.readFile(
"node_modules/llamaindex/examples/abramov.txt",
"utf-8"
);
// Create Document object with essay
const document = new Document({ text: essay });
// Split text and create embeddings. Store them in a VectorStoreIndex
const index = await VectorStoreIndex.fromDocuments([document]);
// Query the index
const queryEngine = index.asQueryEngine();
const response = await queryEngine.aquery(
"What did the author do in college?"
);
// Output response
console.log(response.toString());
}
```
Then you can run it using
```bash
npx ts-node example.ts
```
## Core concepts:
- [Document](packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
- [Node](packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
- Indexes: indexes store the Nodes and the embeddings of those nodes.
- [QueryEngine](packages/core/src/QueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected nodes from your Index to give the LLM the context it needs to answer your query.
- [ChatEngine](packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indexes.
- [SimplePrompt](packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
## Contributing:
We are in the very early days of LlamaIndex.TS. If youre interested in hacking on it with us check out our [contributing guide](CONTRIBUTING.md)
## Bugs? Questions?
Please join our Discord! https://discord.com/invite/eN6D2HQ4aX
@@ -1,73 +0,0 @@
---
id: "BaseIndexInit"
title: "Interface: BaseIndexInit<T>"
sidebar_label: "BaseIndexInit"
sidebar_position: 0
custom_edit_url: null
---
## Type parameters
| Name |
| :------ |
| `T` |
## Properties
### docStore
**docStore**: `BaseDocumentStore`
#### Defined in
[BaseIndex.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L62)
___
### indexStore
`Optional` **indexStore**: `BaseIndexStore`
#### Defined in
[BaseIndex.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L64)
___
### indexStruct
**indexStruct**: `T`
#### Defined in
[BaseIndex.ts:65](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L65)
___
### serviceContext
**serviceContext**: [`ServiceContext`](ServiceContext.md)
#### Defined in
[BaseIndex.ts:60](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L60)
___
### storageContext
**storageContext**: [`StorageContext`](StorageContext.md)
#### Defined in
[BaseIndex.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L61)
___
### vectorStore
`Optional` **vectorStore**: `VectorStore`
#### Defined in
[BaseIndex.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L63)
@@ -1,49 +0,0 @@
---
id: "BaseLLMPredictor"
title: "Interface: BaseLLMPredictor"
sidebar_label: "BaseLLMPredictor"
sidebar_position: 0
custom_edit_url: null
---
LLM Predictors are an abstraction to predict the response to a prompt.
## Implemented by
- [`ChatGPTLLMPredictor`](../classes/ChatGPTLLMPredictor.md)
## Methods
### apredict
**apredict**(`prompt`, `input?`, `parentEvent?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `prompt` | `string` \| [`SimplePrompt`](../modules.md#simpleprompt) |
| `input?` | `Record`<`string`, `string`\> |
| `parentEvent?` | [`Event`](Event.md) |
#### Returns
`Promise`<`string`\>
#### Defined in
[LLMPredictor.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L10)
___
### getLlmMetadata
**getLlmMetadata**(): `Promise`<`any`\>
#### Returns
`Promise`<`any`\>
#### Defined in
[LLMPredictor.ts:9](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L9)
@@ -1,59 +0,0 @@
---
id: "BaseOutputParser"
title: "Interface: BaseOutputParser<T>"
sidebar_label: "BaseOutputParser"
sidebar_position: 0
custom_edit_url: null
---
An OutputParser is used to extract structured data from the raw output of the LLM.
## Type parameters
| Name |
| :------ |
| `T` |
## Implemented by
- [`SubQuestionOutputParser`](../classes/SubQuestionOutputParser.md)
## Methods
### format
**format**(`output`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| `output` | `string` |
#### Returns
`string`
#### Defined in
[OutputParser.ts:8](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L8)
___
### parse
**parse**(`output`): `T`
#### Parameters
| Name | Type |
| :------ | :------ |
| `output` | `string` |
#### Returns
`T`
#### Defined in
[OutputParser.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L7)
@@ -1,35 +0,0 @@
---
id: "BaseQueryEngine"
title: "Interface: BaseQueryEngine"
sidebar_label: "BaseQueryEngine"
sidebar_position: 0
custom_edit_url: null
---
A query engine is a question answerer that can use one or more steps.
## Implemented by
- [`RetrieverQueryEngine`](../classes/RetrieverQueryEngine.md)
- [`SubQuestionQueryEngine`](../classes/SubQuestionQueryEngine.md)
## Methods
### aquery
**aquery**(`query`, `parentEvent?`): `Promise`<[`Response`](../classes/Response.md)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `parentEvent?` | [`Event`](Event.md) |
#### Returns
`Promise`<[`Response`](../classes/Response.md)\>
#### Defined in
[QueryEngine.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L19)
@@ -1,34 +0,0 @@
---
id: "BaseQuestionGenerator"
title: "Interface: BaseQuestionGenerator"
sidebar_label: "BaseQuestionGenerator"
sidebar_position: 0
custom_edit_url: null
---
QuestionGenerators generate new questions for the LLM using tools and a user query.
## Implemented by
- [`LLMQuestionGenerator`](../classes/LLMQuestionGenerator.md)
## Methods
### agenerate
**agenerate**(`tools`, `query`): `Promise`<[`SubQuestion`](SubQuestion.md)[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `tools` | [`ToolMetadata`](ToolMetadata.md)[] |
| `query` | `string` |
#### Returns
`Promise`<[`SubQuestion`](SubQuestion.md)[]\>
#### Defined in
[QuestionGenerator.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L23)
@@ -1,33 +0,0 @@
---
id: "BaseReader"
title: "Interface: BaseReader"
sidebar_label: "BaseReader"
sidebar_position: 0
custom_edit_url: null
---
A reader takes imports data into Document objects.
## Implemented by
- [`TextFileReader`](../classes/TextFileReader.md)
## Methods
### loadData
**loadData**(`...args`): `Promise`<[`Document`](../classes/Document.md)[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `...args` | `any`[] |
#### Returns
`Promise`<[`Document`](../classes/Document.md)[]\>
#### Defined in
[readers/base.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/readers/base.ts#L7)
@@ -1,50 +0,0 @@
---
id: "BaseRetriever"
title: "Interface: BaseRetriever"
sidebar_label: "BaseRetriever"
sidebar_position: 0
custom_edit_url: null
---
Retrievers retrieve the nodes that most closely match our query in similarity.
## Implemented by
- [`ListIndexLLMRetriever`](../classes/ListIndexLLMRetriever.md)
- [`ListIndexRetriever`](../classes/ListIndexRetriever.md)
- [`VectorIndexRetriever`](../classes/VectorIndexRetriever.md)
## Methods
### aretrieve
**aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](NodeWithScore.md)[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `query` | `string` |
| `parentEvent?` | [`Event`](Event.md) |
#### Returns
`Promise`<[`NodeWithScore`](NodeWithScore.md)[]\>
#### Defined in
[Retriever.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L16)
___
### getServiceContext
**getServiceContext**(): [`ServiceContext`](ServiceContext.md)
#### Returns
[`ServiceContext`](ServiceContext.md)
#### Defined in
[Retriever.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L17)
-25
View File
@@ -1,25 +0,0 @@
---
id: "BaseTool"
title: "Interface: BaseTool"
sidebar_label: "BaseTool"
sidebar_position: 0
custom_edit_url: null
---
Simple Tool interface. Likely to change.
## Hierarchy
- **`BaseTool`**
↳ [`QueryEngineTool`](QueryEngineTool.md)
## Properties
### metadata
**metadata**: [`ToolMetadata`](ToolMetadata.md)
#### Defined in
[Tool.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L12)
@@ -1,54 +0,0 @@
---
id: "ChatEngine"
title: "Interface: ChatEngine"
sidebar_label: "ChatEngine"
sidebar_position: 0
custom_edit_url: null
---
A ChatEngine is used to handle back and forth chats between the application and the LLM.
## Implemented by
- [`CondenseQuestionChatEngine`](../classes/CondenseQuestionChatEngine.md)
- [`ContextChatEngine`](../classes/ContextChatEngine.md)
- [`SimpleChatEngine`](../classes/SimpleChatEngine.md)
## Methods
### achat
**achat**(`message`, `chatHistory?`): `Promise`<[`Response`](../classes/Response.md)\>
Send message along with the class's current chat history to the LLM.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `message` | `string` | |
| `chatHistory?` | [`ChatMessage`](ChatMessage.md)[] | optional chat history if you want to customize the chat history |
#### Returns
`Promise`<[`Response`](../classes/Response.md)\>
#### Defined in
[ChatEngine.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L25)
___
### reset
**reset**(): `void`
Resets the chat history so that it's empty.
#### Returns
`void`
#### Defined in
[ChatEngine.ts:30](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L30)
@@ -1,27 +0,0 @@
---
id: "ChatMessage"
title: "Interface: ChatMessage"
sidebar_label: "ChatMessage"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### content
**content**: `string`
#### Defined in
[LLM.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L14)
___
### role
**role**: `MessageType`
#### Defined in
[LLM.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L15)
@@ -1,37 +0,0 @@
---
id: "ChatResponse"
title: "Interface: ChatResponse"
sidebar_label: "ChatResponse"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### delta
`Optional` **delta**: `string`
#### Defined in
[LLM.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L21)
___
### message
**message**: [`ChatMessage`](ChatMessage.md)
#### Defined in
[LLM.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L19)
___
### raw
`Optional` **raw**: `Record`<`string`, `any`\>
#### Defined in
[LLM.ts:20](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L20)
-47
View File
@@ -1,47 +0,0 @@
---
id: "Event"
title: "Interface: Event"
sidebar_label: "Event"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### id
**id**: `string`
#### Defined in
[callbacks/CallbackManager.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L14)
___
### parentId
`Optional` **parentId**: `string`
#### Defined in
[callbacks/CallbackManager.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L17)
___
### tags
`Optional` **tags**: [`EventTag`](../modules.md#eventtag)[]
#### Defined in
[callbacks/CallbackManager.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L16)
___
### type
**type**: [`EventType`](../modules.md#eventtype)
#### Defined in
[callbacks/CallbackManager.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L15)
@@ -1,100 +0,0 @@
---
id: "GenericFileSystem"
title: "Interface: GenericFileSystem"
sidebar_label: "GenericFileSystem"
sidebar_position: 0
custom_edit_url: null
---
A filesystem interface that is meant to be compatible with
the 'fs' module from Node.js.
Allows for the use of similar inteface implementation on
browsers.
## Implemented by
- [`InMemoryFileSystem`](../classes/InMemoryFileSystem.md)
## Methods
### access
**access**(`path`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `path` | `string` |
#### Returns
`Promise`<`void`\>
#### Defined in
[storage/FileSystem.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L12)
___
### mkdir
**mkdir**(`path`, `options?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `path` | `string` |
| `options?` | `any` |
#### Returns
`Promise`<`void`\>
#### Defined in
[storage/FileSystem.ts:13](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L13)
___
### readFile
**readFile**(`path`, `options?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `path` | `string` |
| `options?` | `any` |
#### Returns
`Promise`<`string`\>
#### Defined in
[storage/FileSystem.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L11)
___
### writeFile
**writeFile**(`path`, `content`, `options?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `path` | `string` |
| `content` | `string` |
| `options?` | `any` |
#### Returns
`Promise`<`void`\>
#### Defined in
[storage/FileSystem.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L10)
-57
View File
@@ -1,57 +0,0 @@
---
id: "LLM"
title: "Interface: LLM"
sidebar_label: "LLM"
sidebar_position: 0
custom_edit_url: null
---
Unified language model interface
## Implemented by
- [`OpenAI`](../classes/OpenAI.md)
## Methods
### achat
**achat**(`messages`): `Promise`<[`ChatResponse`](ChatResponse.md)\>
Get a chat response from the LLM
#### Parameters
| Name | Type |
| :------ | :------ |
| `messages` | [`ChatMessage`](ChatMessage.md)[] |
#### Returns
`Promise`<[`ChatResponse`](ChatResponse.md)\>
#### Defined in
[LLM.ts:35](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L35)
___
### acomplete
**acomplete**(`prompt`): `Promise`<[`ChatResponse`](ChatResponse.md)\>
Get a prompt completion from the LLM
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `prompt` | `string` | the prompt to complete |
#### Returns
`Promise`<[`ChatResponse`](ChatResponse.md)\>
#### Defined in
[LLM.ts:41](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L41)
@@ -1,33 +0,0 @@
---
id: "NodeParser"
title: "Interface: NodeParser"
sidebar_label: "NodeParser"
sidebar_position: 0
custom_edit_url: null
---
A node parser generates TextNodes from Documents
## Implemented by
- [`SimpleNodeParser`](../classes/SimpleNodeParser.md)
## Methods
### getNodesFromDocuments
**getNodesFromDocuments**(`documents`): [`TextNode`](../classes/TextNode.md)[]
#### Parameters
| Name | Type |
| :------ | :------ |
| `documents` | [`Document`](../classes/Document.md)[] |
#### Returns
[`TextNode`](../classes/TextNode.md)[]
#### Defined in
[NodeParser.ts:53](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L53)
@@ -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:247](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L247)
___
### node
**node**: [`BaseNode`](../classes/BaseNode.md)
#### Defined in
[Node.ts:246](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L246)
@@ -1,29 +0,0 @@
---
id: "NodeWithScore"
title: "Interface: NodeWithScore"
sidebar_label: "NodeWithScore"
sidebar_position: 0
custom_edit_url: null
---
A node with a similarity score
## Properties
### node
**node**: [`BaseNode`](../classes/BaseNode.md)
#### Defined in
[Node.ts:238](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L238)
___
### score
**score**: `number`
#### Defined in
[Node.ts:239](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L239)
@@ -1,39 +0,0 @@
---
id: "QueryEngineTool"
title: "Interface: QueryEngineTool"
sidebar_label: "QueryEngineTool"
sidebar_position: 0
custom_edit_url: null
---
A Tool that uses a QueryEngine.
## Hierarchy
- [`BaseTool`](BaseTool.md)
**`QueryEngineTool`**
## Properties
### metadata
**metadata**: [`ToolMetadata`](ToolMetadata.md)
#### Inherited from
[BaseTool](BaseTool.md).[metadata](BaseTool.md#metadata)
#### Defined in
[Tool.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L12)
___
### queryEngine
**queryEngine**: [`BaseQueryEngine`](BaseQueryEngine.md)
#### Defined in
[Tool.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L19)
@@ -1,47 +0,0 @@
---
id: "RelatedNodeInfo"
title: "Interface: RelatedNodeInfo"
sidebar_label: "RelatedNodeInfo"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### hash
`Optional` **hash**: `string`
#### Defined in
[Node.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L29)
___
### metadata
**metadata**: `Record`<`string`, `any`\>
#### Defined in
[Node.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L28)
___
### nodeId
**nodeId**: `string`
#### Defined in
[Node.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L26)
___
### nodeType
`Optional` **nodeType**: [`ObjectType`](../enums/ObjectType.md)
#### Defined in
[Node.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L27)
@@ -1,47 +0,0 @@
---
id: "RetrievalCallbackResponse"
title: "Interface: RetrievalCallbackResponse"
sidebar_label: "RetrievalCallbackResponse"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- `BaseCallbackResponse`
**`RetrievalCallbackResponse`**
## Properties
### event
**event**: [`Event`](Event.md)
#### Inherited from
BaseCallbackResponse.event
#### Defined in
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L21)
___
### nodes
**nodes**: [`NodeWithScore`](NodeWithScore.md)[]
#### Defined in
[callbacks/CallbackManager.ts:47](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L47)
___
### query
**query**: `string`
#### Defined in
[callbacks/CallbackManager.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L46)
@@ -1,59 +0,0 @@
---
id: "ServiceContext"
title: "Interface: ServiceContext"
sidebar_label: "ServiceContext"
sidebar_position: 0
custom_edit_url: null
---
The ServiceContext is a collection of components that are used in different parts of the application.
## Properties
### callbackManager
**callbackManager**: [`CallbackManager`](../classes/CallbackManager.md)
#### Defined in
[ServiceContext.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L16)
___
### embedModel
**embedModel**: [`BaseEmbedding`](../classes/BaseEmbedding.md)
#### Defined in
[ServiceContext.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L14)
___
### llmPredictor
**llmPredictor**: [`BaseLLMPredictor`](BaseLLMPredictor.md)
#### Defined in
[ServiceContext.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L12)
___
### nodeParser
**nodeParser**: [`NodeParser`](NodeParser.md)
#### Defined in
[ServiceContext.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L15)
___
### promptHelper
**promptHelper**: `PromptHelper`
#### Defined in
[ServiceContext.ts:13](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L13)
@@ -1,87 +0,0 @@
---
id: "ServiceContextOptions"
title: "Interface: ServiceContextOptions"
sidebar_label: "ServiceContextOptions"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### callbackManager
`Optional` **callbackManager**: [`CallbackManager`](../classes/CallbackManager.md)
#### Defined in
[ServiceContext.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L26)
___
### chunkOverlap
`Optional` **chunkOverlap**: `number`
#### Defined in
[ServiceContext.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L29)
___
### chunkSize
`Optional` **chunkSize**: `number`
#### Defined in
[ServiceContext.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L28)
___
### embedModel
`Optional` **embedModel**: [`BaseEmbedding`](../classes/BaseEmbedding.md)
#### Defined in
[ServiceContext.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L24)
___
### llm
`Optional` **llm**: [`OpenAI`](../classes/OpenAI.md)
#### Defined in
[ServiceContext.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L22)
___
### llmPredictor
`Optional` **llmPredictor**: [`BaseLLMPredictor`](BaseLLMPredictor.md)
#### Defined in
[ServiceContext.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L21)
___
### nodeParser
`Optional` **nodeParser**: [`NodeParser`](NodeParser.md)
#### Defined in
[ServiceContext.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L25)
___
### promptHelper
`Optional` **promptHelper**: `PromptHelper`
#### Defined in
[ServiceContext.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L23)
@@ -1,37 +0,0 @@
---
id: "StorageContext"
title: "Interface: StorageContext"
sidebar_label: "StorageContext"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### docStore
**docStore**: `BaseDocumentStore`
#### Defined in
[storage/StorageContext.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L15)
___
### indexStore
**indexStore**: `BaseIndexStore`
#### Defined in
[storage/StorageContext.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L16)
___
### vectorStore
**vectorStore**: `VectorStore`
#### Defined in
[storage/StorageContext.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L17)
@@ -1,57 +0,0 @@
---
id: "StreamCallbackResponse"
title: "Interface: StreamCallbackResponse"
sidebar_label: "StreamCallbackResponse"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- `BaseCallbackResponse`
**`StreamCallbackResponse`**
## Properties
### event
**event**: [`Event`](Event.md)
#### Inherited from
BaseCallbackResponse.event
#### Defined in
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L21)
___
### index
**index**: `number`
#### Defined in
[callbacks/CallbackManager.ts:40](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L40)
___
### isDone
`Optional` **isDone**: `boolean`
#### Defined in
[callbacks/CallbackManager.ts:41](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L41)
___
### token
`Optional` **token**: [`StreamToken`](StreamToken.md)
#### Defined in
[callbacks/CallbackManager.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L42)
@@ -1,57 +0,0 @@
---
id: "StreamToken"
title: "Interface: StreamToken"
sidebar_label: "StreamToken"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### choices
**choices**: { `delta`: { `content?`: `string` ; `role?`: `ChatCompletionResponseMessageRoleEnum` } ; `finish_reason`: ``null`` \| `string` ; `index`: `number` }[]
#### Defined in
[callbacks/CallbackManager.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L29)
___
### created
• **created**: `number`
#### Defined in
[callbacks/CallbackManager.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L27)
___
### id
• **id**: `string`
#### Defined in
[callbacks/CallbackManager.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L25)
___
### model
• **model**: `string`
#### Defined in
[callbacks/CallbackManager.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L28)
___
### object
• **object**: `string`
#### Defined in
[callbacks/CallbackManager.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L26)
@@ -1,35 +0,0 @@
---
id: "StructuredOutput"
title: "Interface: StructuredOutput<T>"
sidebar_label: "StructuredOutput"
sidebar_position: 0
custom_edit_url: null
---
StructuredOutput is just a combo of the raw output and the parsed output.
## Type parameters
| Name |
| :------ |
| `T` |
## Properties
### parsedOutput
**parsedOutput**: `T`
#### Defined in
[OutputParser.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L16)
___
### rawOutput
**rawOutput**: `string`
#### Defined in
[OutputParser.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/OutputParser.ts#L15)
@@ -1,27 +0,0 @@
---
id: "SubQuestion"
title: "Interface: SubQuestion"
sidebar_label: "SubQuestion"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### subQuestion
**subQuestion**: `string`
#### Defined in
[QuestionGenerator.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L15)
___
### toolName
**toolName**: `string`
#### Defined in
[QuestionGenerator.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L16)
@@ -1,27 +0,0 @@
---
id: "ToolMetadata"
title: "Interface: ToolMetadata"
sidebar_label: "ToolMetadata"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### description
**description**: `string`
#### Defined in
[Tool.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L4)
___
### name
**name**: `string`
#### Defined in
[Tool.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Tool.ts#L5)
@@ -1,47 +0,0 @@
---
id: "VectorIndexOptions"
title: "Interface: VectorIndexOptions"
sidebar_label: "VectorIndexOptions"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### indexStruct
`Optional` **indexStruct**: [`IndexDict`](../classes/IndexDict.md)
#### Defined in
[BaseIndex.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L94)
___
### nodes
`Optional` **nodes**: [`BaseNode`](../classes/BaseNode.md)[]
#### Defined in
[BaseIndex.ts:93](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L93)
___
### serviceContext
`Optional` **serviceContext**: [`ServiceContext`](ServiceContext.md)
#### Defined in
[BaseIndex.ts:95](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L95)
___
### storageContext
`Optional` **storageContext**: [`StorageContext`](StorageContext.md)
#### Defined in
[BaseIndex.ts:96](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L96)
@@ -1,47 +0,0 @@
---
id: "WalkableFileSystem"
title: "Interface: WalkableFileSystem"
sidebar_label: "WalkableFileSystem"
sidebar_position: 0
custom_edit_url: null
---
## Methods
### readdir
**readdir**(`path`): `Promise`<`string`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `path` | `string` |
#### Returns
`Promise`<`string`[]\>
#### Defined in
[storage/FileSystem.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L17)
___
### stat
**stat**(`path`): `Promise`<`any`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `path` | `string` |
#### Returns
`Promise`<`any`\>
#### Defined in
[storage/FileSystem.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L18)
@@ -1,2 +0,0 @@
label: "Interfaces"
position: 4
-914
View File
@@ -1,914 +0,0 @@
---
id: "modules"
title: "llamaindex"
sidebar_label: "Exports"
sidebar_position: 0.5
custom_edit_url: null
---
## Enumerations
- [ListRetrieverMode](enums/ListRetrieverMode.md)
- [MetadataMode](enums/MetadataMode.md)
- [NodeRelationship](enums/NodeRelationship.md)
- [ObjectType](enums/ObjectType.md)
- [SimilarityType](enums/SimilarityType.md)
## Classes
- [BaseEmbedding](classes/BaseEmbedding.md)
- [BaseIndex](classes/BaseIndex.md)
- [BaseNode](classes/BaseNode.md)
- [CallbackManager](classes/CallbackManager.md)
- [ChatGPTLLMPredictor](classes/ChatGPTLLMPredictor.md)
- [CompactAndRefine](classes/CompactAndRefine.md)
- [CondenseQuestionChatEngine](classes/CondenseQuestionChatEngine.md)
- [ContextChatEngine](classes/ContextChatEngine.md)
- [Document](classes/Document.md)
- [InMemoryFileSystem](classes/InMemoryFileSystem.md)
- [IndexDict](classes/IndexDict.md)
- [IndexList](classes/IndexList.md)
- [IndexNode](classes/IndexNode.md)
- [IndexStruct](classes/IndexStruct.md)
- [LLMQuestionGenerator](classes/LLMQuestionGenerator.md)
- [ListIndex](classes/ListIndex.md)
- [ListIndexLLMRetriever](classes/ListIndexLLMRetriever.md)
- [ListIndexRetriever](classes/ListIndexRetriever.md)
- [OpenAI](classes/OpenAI.md)
- [OpenAIEmbedding](classes/OpenAIEmbedding.md)
- [Refine](classes/Refine.md)
- [Response](classes/Response.md)
- [ResponseSynthesizer](classes/ResponseSynthesizer.md)
- [RetrieverQueryEngine](classes/RetrieverQueryEngine.md)
- [SentenceSplitter](classes/SentenceSplitter.md)
- [SimpleChatEngine](classes/SimpleChatEngine.md)
- [SimpleNodeParser](classes/SimpleNodeParser.md)
- [SimpleResponseBuilder](classes/SimpleResponseBuilder.md)
- [SubQuestionOutputParser](classes/SubQuestionOutputParser.md)
- [SubQuestionQueryEngine](classes/SubQuestionQueryEngine.md)
- [TextFileReader](classes/TextFileReader.md)
- [TextNode](classes/TextNode.md)
- [TreeSummarize](classes/TreeSummarize.md)
- [VectorIndexRetriever](classes/VectorIndexRetriever.md)
- [VectorStoreIndex](classes/VectorStoreIndex.md)
## Interfaces
- [BaseIndexInit](interfaces/BaseIndexInit.md)
- [BaseLLMPredictor](interfaces/BaseLLMPredictor.md)
- [BaseOutputParser](interfaces/BaseOutputParser.md)
- [BaseQueryEngine](interfaces/BaseQueryEngine.md)
- [BaseQuestionGenerator](interfaces/BaseQuestionGenerator.md)
- [BaseReader](interfaces/BaseReader.md)
- [BaseRetriever](interfaces/BaseRetriever.md)
- [BaseTool](interfaces/BaseTool.md)
- [ChatEngine](interfaces/ChatEngine.md)
- [ChatMessage](interfaces/ChatMessage.md)
- [ChatResponse](interfaces/ChatResponse.md)
- [Event](interfaces/Event.md)
- [GenericFileSystem](interfaces/GenericFileSystem.md)
- [LLM](interfaces/LLM.md)
- [NodeParser](interfaces/NodeParser.md)
- [NodeWithEmbedding](interfaces/NodeWithEmbedding.md)
- [NodeWithScore](interfaces/NodeWithScore.md)
- [QueryEngineTool](interfaces/QueryEngineTool.md)
- [RelatedNodeInfo](interfaces/RelatedNodeInfo.md)
- [RetrievalCallbackResponse](interfaces/RetrievalCallbackResponse.md)
- [ServiceContext](interfaces/ServiceContext.md)
- [ServiceContextOptions](interfaces/ServiceContextOptions.md)
- [StorageContext](interfaces/StorageContext.md)
- [StreamCallbackResponse](interfaces/StreamCallbackResponse.md)
- [StreamToken](interfaces/StreamToken.md)
- [StructuredOutput](interfaces/StructuredOutput.md)
- [SubQuestion](interfaces/SubQuestion.md)
- [ToolMetadata](interfaces/ToolMetadata.md)
- [VectorIndexOptions](interfaces/VectorIndexOptions.md)
- [WalkableFileSystem](interfaces/WalkableFileSystem.md)
## Type Aliases
### CompleteFileSystem
Ƭ **CompleteFileSystem**: [`GenericFileSystem`](interfaces/GenericFileSystem.md) & [`WalkableFileSystem`](interfaces/WalkableFileSystem.md)
#### Defined in
[storage/FileSystem.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L49)
___
### CompletionResponse
Ƭ **CompletionResponse**: [`ChatResponse`](interfaces/ChatResponse.md)
#### Defined in
[LLM.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L25)
___
### EventTag
Ƭ **EventTag**: ``"intermediate"`` \| ``"final"``
#### Defined in
[callbacks/CallbackManager.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L11)
___
### EventType
Ƭ **EventType**: ``"retrieve"`` \| ``"llmPredict"`` \| ``"wrapper"``
#### Defined in
[callbacks/CallbackManager.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L12)
___
### RelatedNodeType
Ƭ **RelatedNodeType**: [`RelatedNodeInfo`](interfaces/RelatedNodeInfo.md) \| [`RelatedNodeInfo`](interfaces/RelatedNodeInfo.md)[]
#### Defined in
[Node.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L32)
___
### SimpleDirectoryReaderLoadDataProps
Ƭ **SimpleDirectoryReaderLoadDataProps**: `Object`
#### Type declaration
| Name | Type |
| :------ | :------ |
| `defaultReader?` | [`BaseReader`](interfaces/BaseReader.md) \| ``null`` |
| `directoryPath` | `string` |
| `fileExtToReader?` | `Record`<`string`, [`BaseReader`](interfaces/BaseReader.md)\> |
| `fs?` | [`CompleteFileSystem`](modules.md#completefilesystem) |
#### Defined in
[readers/SimpleDirectoryReader.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/readers/SimpleDirectoryReader.ts#L26)
___
### SimplePrompt
Ƭ **SimplePrompt**: (`input`: `Record`<`string`, `string`\>) => `string`
#### Type declaration
▸ (`input`): `string`
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
NOTE this is a different interface compared to LlamaIndex Python
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
##### Parameters
| Name | Type |
| :------ | :------ |
| `input` | `Record`<`string`, `string`\> |
##### Returns
`string`
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
## Variables
### ALL\_AVAILABLE\_MODELS
• `Const` **ALL\_AVAILABLE\_MODELS**: `Object`
We currently support GPT-3.5 and GPT-4 models
#### Type declaration
| Name | Type |
| :------ | :------ |
| `gpt-3.5-turbo` | `number` |
| `gpt-3.5-turbo-16k` | `number` |
| `gpt-4` | `number` |
| `gpt-4-32k` | `number` |
#### Defined in
[LLM.ts:57](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L57)
___
### DEFAULT\_CHUNK\_OVERLAP
• `Const` **DEFAULT\_CHUNK\_OVERLAP**: ``20``
#### Defined in
[constants.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L5)
___
### DEFAULT\_CHUNK\_OVERLAP\_RATIO
• `Const` **DEFAULT\_CHUNK\_OVERLAP\_RATIO**: ``0.1``
#### Defined in
[constants.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L6)
___
### DEFAULT\_CHUNK\_SIZE
• `Const` **DEFAULT\_CHUNK\_SIZE**: ``1024``
#### Defined in
[constants.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L4)
___
### DEFAULT\_COLLECTION
• `Const` **DEFAULT\_COLLECTION**: ``"data"``
#### Defined in
[storage/constants.ts:1](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L1)
___
### DEFAULT\_CONTEXT\_WINDOW
• `Const` **DEFAULT\_CONTEXT\_WINDOW**: ``3900``
#### Defined in
[constants.ts:1](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L1)
___
### DEFAULT\_DOC\_STORE\_PERSIST\_FILENAME
• `Const` **DEFAULT\_DOC\_STORE\_PERSIST\_FILENAME**: ``"docstore.json"``
#### Defined in
[storage/constants.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L4)
___
### DEFAULT\_EMBEDDING\_DIM
• `Const` **DEFAULT\_EMBEDDING\_DIM**: ``1536``
#### Defined in
[constants.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L10)
___
### DEFAULT\_FS
• `Const` **DEFAULT\_FS**: [`GenericFileSystem`](interfaces/GenericFileSystem.md) \| [`CompleteFileSystem`](modules.md#completefilesystem)
#### Defined in
[storage/FileSystem.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L62)
___
### DEFAULT\_GRAPH\_STORE\_PERSIST\_FILENAME
• `Const` **DEFAULT\_GRAPH\_STORE\_PERSIST\_FILENAME**: ``"graph_store.json"``
#### Defined in
[storage/constants.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L6)
___
### DEFAULT\_INDEX\_STORE\_PERSIST\_FILENAME
• `Const` **DEFAULT\_INDEX\_STORE\_PERSIST\_FILENAME**: ``"index_store.json"``
#### Defined in
[storage/constants.ts:3](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L3)
___
### DEFAULT\_NAMESPACE
• `Const` **DEFAULT\_NAMESPACE**: ``"docstore"``
#### Defined in
[storage/constants.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L7)
___
### DEFAULT\_NUM\_OUTPUTS
• `Const` **DEFAULT\_NUM\_OUTPUTS**: ``256``
#### Defined in
[constants.ts:2](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L2)
___
### DEFAULT\_PADDING
• `Const` **DEFAULT\_PADDING**: ``5``
#### Defined in
[constants.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L11)
___
### DEFAULT\_PERSIST\_DIR
• `Const` **DEFAULT\_PERSIST\_DIR**: ``"./storage"``
#### Defined in
[storage/constants.ts:2](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L2)
___
### DEFAULT\_SIMILARITY\_TOP\_K
• `Const` **DEFAULT\_SIMILARITY\_TOP\_K**: ``2``
#### Defined in
[constants.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L7)
___
### DEFAULT\_VECTOR\_STORE\_PERSIST\_FILENAME
• `Const` **DEFAULT\_VECTOR\_STORE\_PERSIST\_FILENAME**: ``"vector_store.json"``
#### Defined in
[storage/constants.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L5)
___
### GPT4\_MODELS
• `Const` **GPT4\_MODELS**: `Object`
#### Type declaration
| Name | Type |
| :------ | :------ |
| `gpt-4` | `number` |
| `gpt-4-32k` | `number` |
#### Defined in
[LLM.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L44)
___
### TURBO\_MODELS
• `Const` **TURBO\_MODELS**: `Object`
#### Type declaration
| Name | Type |
| :------ | :------ |
| `gpt-3.5-turbo` | `number` |
| `gpt-3.5-turbo-16k` | `number` |
#### Defined in
[LLM.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L49)
___
### globalsHelper
• `Const` **globalsHelper**: `GlobalsHelper`
#### Defined in
[GlobalsHelper.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/GlobalsHelper.ts#L42)
## Functions
### buildToolsText
▸ **buildToolsText**(`tools`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| `tools` | [`ToolMetadata`](interfaces/ToolMetadata.md)[] |
#### Returns
`string`
#### Defined in
[Prompt.ts:198](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L198)
___
### contextSystemPrompt
▸ **contextSystemPrompt**(`input`): `string`
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
NOTE this is a different interface compared to LlamaIndex Python
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Parameters
| Name | Type |
| :------ | :------ |
| `input` | `Record`<`string`, `string`\> |
#### Returns
`string`
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
### defaultChoiceSelectPrompt
▸ **defaultChoiceSelectPrompt**(`input`): `string`
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
NOTE this is a different interface compared to LlamaIndex Python
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Parameters
| Name | Type |
| :------ | :------ |
| `input` | `Record`<`string`, `string`\> |
#### Returns
`string`
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
### defaultCondenseQuestionPrompt
▸ **defaultCondenseQuestionPrompt**(`input`): `string`
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
NOTE this is a different interface compared to LlamaIndex Python
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Parameters
| Name | Type |
| :------ | :------ |
| `input` | `Record`<`string`, `string`\> |
#### Returns
`string`
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
### defaultRefinePrompt
▸ **defaultRefinePrompt**(`input`): `string`
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
NOTE this is a different interface compared to LlamaIndex Python
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Parameters
| Name | Type |
| :------ | :------ |
| `input` | `Record`<`string`, `string`\> |
#### Returns
`string`
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
### defaultSubQuestionPrompt
▸ **defaultSubQuestionPrompt**(`input`): `string`
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
NOTE this is a different interface compared to LlamaIndex Python
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Parameters
| Name | Type |
| :------ | :------ |
| `input` | `Record`<`string`, `string`\> |
#### Returns
`string`
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
### defaultSummaryPrompt
▸ **defaultSummaryPrompt**(`input`): `string`
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
NOTE this is a different interface compared to LlamaIndex Python
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Parameters
| Name | Type |
| :------ | :------ |
| `input` | `Record`<`string`, `string`\> |
#### Returns
`string`
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
### defaultTextQaPrompt
▸ **defaultTextQaPrompt**(`input`): `string`
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
NOTE this is a different interface compared to LlamaIndex Python
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
#### Parameters
| Name | Type |
| :------ | :------ |
| `input` | `Record`<`string`, `string`\> |
#### Returns
`string`
#### Defined in
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
___
### exists
▸ **exists**(`fs`, `path`): `Promise`<`boolean`\>
Checks if a file exists.
Analogous to the os.path.exists function from Python.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `fs` | [`GenericFileSystem`](interfaces/GenericFileSystem.md) | The filesystem to use. |
| `path` | `string` | The path to the file to check. |
#### Returns
`Promise`<`boolean`\>
A promise that resolves to true if the file exists, false otherwise.
#### Defined in
[storage/FileSystem.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L74)
___
### getNodeFS
▸ **getNodeFS**(): [`CompleteFileSystem`](modules.md#completefilesystem)
#### Returns
[`CompleteFileSystem`](modules.md#completefilesystem)
#### Defined in
[storage/FileSystem.ts:51](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L51)
___
### getNodesFromDocument
▸ **getNodesFromDocument**(`document`, `textSplitter`, `includeMetadata?`, `includePrevNextRel?`): [`TextNode`](classes/TextNode.md)[]
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `document` | [`Document`](classes/Document.md) | `undefined` |
| `textSplitter` | [`SentenceSplitter`](classes/SentenceSplitter.md) | `undefined` |
| `includeMetadata` | `boolean` | `true` |
| `includePrevNextRel` | `boolean` | `true` |
#### Returns
[`TextNode`](classes/TextNode.md)[]
#### Defined in
[NodeParser.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L15)
___
### getResponseBuilder
▸ **getResponseBuilder**(`serviceContext?`): [`SimpleResponseBuilder`](classes/SimpleResponseBuilder.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| `serviceContext?` | [`ServiceContext`](interfaces/ServiceContext.md) |
#### Returns
[`SimpleResponseBuilder`](classes/SimpleResponseBuilder.md)
#### Defined in
[ResponseSynthesizer.ts:212](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L212)
___
### getTextSplitsFromDocument
▸ **getTextSplitsFromDocument**(`document`, `textSplitter`): `string`[]
#### Parameters
| Name | Type |
| :------ | :------ |
| `document` | [`Document`](classes/Document.md) |
| `textSplitter` | [`SentenceSplitter`](classes/SentenceSplitter.md) |
#### Returns
`string`[]
#### Defined in
[NodeParser.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L5)
___
### getTopKEmbeddings
▸ **getTopKEmbeddings**(`queryEmbedding`, `embeddings`, `similarityTopK?`, `embeddingIds?`, `similarityCutoff?`): [`number`[], `any`[]]
Get the top K embeddings from a list of embeddings ordered by similarity to the query.
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `queryEmbedding` | `number`[] | `undefined` | |
| `embeddings` | `number`[][] | `undefined` | list of embeddings to consider |
| `similarityTopK` | `number` | `DEFAULT_SIMILARITY_TOP_K` | max number of embeddings to return, default 2 |
| `embeddingIds` | ``null`` \| `any`[] | `null` | ids of embeddings in the embeddings list |
| `similarityCutoff` | ``null`` \| `number` | `null` | minimum similarity score |
#### Returns
[`number`[], `any`[]]
#### Defined in
[Embedding.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L77)
___
### getTopKEmbeddingsLearner
▸ **getTopKEmbeddingsLearner**(`queryEmbedding`, `embeddings`, `similarityTopK?`, `embeddingsIds?`, `queryMode?`): [`number`[], `any`[]]
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `queryEmbedding` | `number`[] | `undefined` |
| `embeddings` | `number`[][] | `undefined` |
| `similarityTopK?` | `number` | `undefined` |
| `embeddingsIds?` | `any`[] | `undefined` |
| `queryMode` | `VectorStoreQueryMode` | `VectorStoreQueryMode.SVM` |
#### Returns
[`number`[], `any`[]]
#### Defined in
[Embedding.ts:119](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L119)
___
### getTopKMMREmbeddings
▸ **getTopKMMREmbeddings**(`queryEmbedding`, `embeddings`, `similarityFn?`, `similarityTopK?`, `embeddingIds?`, `_similarityCutoff?`, `mmrThreshold?`): [`number`[], `any`[]]
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `queryEmbedding` | `number`[] | `undefined` |
| `embeddings` | `number`[][] | `undefined` |
| `similarityFn` | ``null`` \| (...`args`: `any`[]) => `number` | `null` |
| `similarityTopK` | ``null`` \| `number` | `null` |
| `embeddingIds` | ``null`` \| `any`[] | `null` |
| `_similarityCutoff` | ``null`` \| `number` | `null` |
| `mmrThreshold` | ``null`` \| `number` | `null` |
#### Returns
[`number`[], `any`[]]
#### Defined in
[Embedding.ts:131](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L131)
___
### messagesToHistoryStr
▸ **messagesToHistoryStr**(`messages`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| `messages` | [`ChatMessage`](interfaces/ChatMessage.md)[] |
#### Returns
`string`
#### Defined in
[Prompt.ts:300](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L300)
___
### serviceContextFromDefaults
▸ **serviceContextFromDefaults**(`options?`): [`ServiceContext`](interfaces/ServiceContext.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| `options?` | [`ServiceContextOptions`](interfaces/ServiceContextOptions.md) |
#### Returns
[`ServiceContext`](interfaces/ServiceContext.md)
#### Defined in
[ServiceContext.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L32)
___
### serviceContextFromServiceContext
▸ **serviceContextFromServiceContext**(`serviceContext`, `options`): `Object`
#### Parameters
| Name | Type |
| :------ | :------ |
| `serviceContext` | [`ServiceContext`](interfaces/ServiceContext.md) |
| `options` | [`ServiceContextOptions`](interfaces/ServiceContextOptions.md) |
#### Returns
`Object`
| Name | Type |
| :------ | :------ |
| `callbackManager` | [`CallbackManager`](classes/CallbackManager.md) |
| `embedModel` | [`BaseEmbedding`](classes/BaseEmbedding.md) |
| `llmPredictor` | [`BaseLLMPredictor`](interfaces/BaseLLMPredictor.md) |
| `nodeParser` | [`NodeParser`](interfaces/NodeParser.md) |
| `promptHelper` | `PromptHelper` |
#### Defined in
[ServiceContext.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L52)
___
### similarity
▸ **similarity**(`embedding1`, `embedding2`, `mode?`): `number`
The similarity between two embeddings.
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `embedding1` | `number`[] | `undefined` |
| `embedding2` | `number`[] | `undefined` |
| `mode` | [`SimilarityType`](enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
#### Returns
`number`
similartiy score with higher numbers meaning the two embeddings are more similar
#### Defined in
[Embedding.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L22)
___
### storageContextFromDefaults
▸ **storageContextFromDefaults**(`«destructured»`): `Promise`<[`StorageContext`](interfaces/StorageContext.md)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `«destructured»` | `BuilderParams` |
#### Returns
`Promise`<[`StorageContext`](interfaces/StorageContext.md)\>
#### Defined in
[storage/StorageContext.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L28)
___
### walk
▸ **walk**(`fs`, `dirPath`): `AsyncIterable`<`string`\>
Recursively traverses a directory and yields all the paths to the files in it.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `fs` | [`WalkableFileSystem`](interfaces/WalkableFileSystem.md) | The filesystem to use. |
| `dirPath` | `string` | The path to the directory to traverse. |
#### Returns
`AsyncIterable`<`string`\>
#### Defined in
[storage/FileSystem.ts:91](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L91)
+61 -16
View File
@@ -1,33 +1,78 @@
---
sidebar_position: 2
sidebar_position: 3
---
# Concepts
# High-Level Concepts
## High Level API
LlamaIndex.TS helps you build LLM-powered applications (e.g. Q&A, chatbot) over custom data.
- Document: A document represents a text file, PDF file or other contiguous piece of data.
In this high-level concepts guide, you will learn:
- Node: The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
- how an LLM can answer questions using your own data.
- key concepts and modules in LlamaIndex.TS for composing your own query pipeline.
- Indexes: indexes store the Nodes and the embeddings of those nodes.
## Answering Questions Across Your Data
- QueryEngine: Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected nodes from your Index to give the LLM the context it needs to answer your query.
LlamaIndex uses a two stage method when using an LLM with your data:
- ChatEngine: A ChatEngine helps you build a chatbot that will interact with your Indexes.
1. **indexing stage**: preparing a knowledge base, and
2. **querying stage**: retrieving relevant context from the knowledge to assist the LLM in responding to a question
## Low Level API
![](./_static/concepts/rag.jpg)
- SimplePrompt: A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
This process is also known as Retrieval Augmented Generation (RAG).
- LLM: The LLM class is a unified interface over a large language model provider such as OpenAI GPT-4, Anthropic Claude, or Meta LLaMA. You can subclass it to write a connector to your own large language model.
LlamaIndex.TS provides the essential toolkit for making both steps super easy.
- Embedding: An embedding is represented as a vector of floating point numbers. OpenAI's text-embedding-ada-002 is our default embedding model and each embedding it generates consists of 1,536 floating point numbers. Another popular embedding model is BERT which uses 768 floating point numbers to represent each Node. We provide a number of utilities to work with embeddings including 3 similarity calculation options and Maximum Marginal Relevance
Let's explore each stage in detail.
- Reader/Loader: A reader or loader is something that takes in a document in the real world and transforms into a Document class that can then be used in your Index and queries. We currently support plain text files and PDFs with many many more to come.
### Indexing Stage
- TextSplitter: Text splitting strategies are incredibly important to the overall efficacy of the embedding search. Currently, while we do have a default, there's no one size fits all solution. Depending on the source documents, you may want to use different splitting sizes and strategies. Currently we support spliltting by fixed size, splitting by fixed size with overlapping sections, splitting by sentence, and splitting by paragraph.
LlamaIndex.TS help you prepare the knowledge base with a suite of data connectors and indexes.
- Retriever: The Retriever is what actually chooses the Nodes to retrieve from the index. Here, you may wish to try retrieving more or fewer Nodes per query, changing your similarity function, or creating your own retriever for each individual use case in your application. For example, you may wish to have a separate retriever for code content vs. text content.
![](./_static/concepts/indexing.jpg)
- Storage: At some point you're going to want to store your indexes, data and vectors instead of re-running the embedding models every time. IndexStore, DocStore, VectorStore, and KVStore are abstractions that let you do that. Combined, they form the StorageContext. Currently, we allow you to persist your embeddings in files on the filesystem (or a virtual in memory file system), but we are also actively adding integrations to Vector Databases.
[**Data Loaders**](./modules/high_level/data_loader.md):
A data connector (i.e. `Reader`) ingest data from different data sources and data formats into a simple `Document` representation (text and simple metadata).
[**Documents / Nodes**](./modules/high_level/documents_and_nodes.md): A `Document` is a generic container around any data source - for instance, a PDF, an API output, or retrieved data from a database. A `Node` is the atomic unit of data in LlamaIndex and represents a "chunk" of a source `Document`. It's a rich representation that includes metadata and relationships (to other nodes) to enable accurate and expressive retrieval operations.
[**Data Indexes**](./modules/high_level/data_index.md):
Once you've ingested your data, LlamaIndex helps you index data into a format that's easy to retrieve.
Under the hood, LlamaIndex parses the raw documents into intermediate representations, calculates vector embeddings, and stores your data in-memory or to disk.
### Querying Stage
In the querying stage, the query pipeline retrieves the most relevant context given a user query,
and pass that to the LLM (along with the query) to synthesize a response.
This gives the LLM up-to-date knowledge that is not in its original training data,
(also reducing hallucination).
The key challenge in the querying stage is retrieval, orchestration, and reasoning over (potentially many) knowledge bases.
LlamaIndex provides composable modules that help you build and integrate RAG pipelines for Q&A (query engine), chatbot (chat engine), or as part of an agent.
These building blocks can be customized to reflect ranking preferences, as well as composed to reason over multiple knowledge bases in a structured way.
![](./_static/concepts/querying.jpg)
#### Building Blocks
[**Retrievers**](./modules/low_level/retriever.md):
A retriever defines how to efficiently retrieve relevant context from a knowledge base (i.e. index) when given a query.
The specific retrieval logic differs for difference indices, the most popular being dense retrieval against a vector index.
[**Response Synthesizers**](./modules/low_level/response_synthesizer.md):
A response synthesizer generates a response from an LLM, using a user query and a given set of retrieved text chunks.
#### Pipelines
[**Query Engines**](./modules/high_level/query_engine.md):
A query engine is an end-to-end pipeline that allow you to ask question over your data.
It takes in a natural language query, and returns a response, along with reference context retrieved and passed to the LLM.
[**Chat Engines**](./modules/high_level/chat_engine.md):
A chat engine is an end-to-end pipeline for having a conversation with your data
(multiple back-and-forth instead of a single question & answer).
+43
View File
@@ -0,0 +1,43 @@
---
sidebar_position: 4
---
# End to End Examples
We include several end-to-end examples using LlamaIndex.TS in the repository
## [Chat Engine](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/chatEngine.ts)
Read a file and chat about it with the LLM.
## [Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/vectorIndex.ts)
Create a vector index and query it. The vector index will use embeddings to fetch the top k most relevant nodes. By default, the top k is 2.
## [Summary Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/summaryIndex.ts)
Create a list index and query it. This example also use the `LLMRetriever`, which will use the LLM to select the best nodes to use when generating answer.
## [Save / Load an Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/storageContext.ts)
Create and load a vector index. Persistance to disk in LlamaIndex.TS happens automatically once a storage context object is created.
## [Customized Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/vectorIndexCustomize.ts)
Create a vector index and query it, while also configuring the the `LLM`, the `ServiceContext`, and the `similarity_top_k`.
## [OpenAI LLM](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/openai.ts)
Create an OpenAI LLM and directly use it for chat.
## [Llama2 DeuceLLM](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/llamadeuce.ts)
Create a Llama-2 LLM and directly use it for chat.
## [SubQuestionQueryEngine](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/subquestion.ts)
Uses the `SubQuestionQueryEngine`, which breaks complex queries into multiple questions, and then aggreates a response across the answers to all sub-questions.
## [Low Level Modules](https://github.com/run-llama/LlamaIndexTS/blob/main/apps/simple/lowlevel.ts)
This example uses several low-level components, which removes the need for an actual query engine. These components can be used anywhere, in any application, or customized and sub-classed to meet your own needs.
+1 -1
View File
@@ -1,5 +1,5 @@
---
sidebar_position: 0
sidebar_position: 1
---
# Installation and Setup

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