Compare commits

...

661 Commits

Author SHA1 Message Date
Pierre c0fc9f6e55 Copy api instead of linking it, as it was creating error with link following 2023-12-05 13:35:51 +01:00
Pierre 72d919566c French documentation 2023-12-05 13:32:27 +01:00
yisding d613bbd358 Merge pull request #257 from run-llama/ms/download-community-projects
Feat: Add support for installing templates from community repo
2023-12-04 09:08:01 -08:00
Marcus Schiesser 36f0af5a5d refactor: factor out questions and use strong-typing for question args 2023-12-04 17:07:49 +07:00
Marcus Schiesser 79d7076121 fix: only use community path for community templates 2023-12-04 17:02:53 +07:00
Marcus Schiesser 526b3e74bf fix: using correct path for readme link in terminal 2023-12-04 17:01:44 +07:00
thucpn d03dc21e8a feat: options to download community projects 2023-12-04 13:51:53 +07:00
Gabriel Almeida 42093de872 Fix missing PGVectorStore export (#254) 2023-12-04 11:51:50 +08:00
Simon Suo aa48a5d764 Merge pull request #251 from himself65/himself65-patch-1
docs: broken link on starter.md
2023-12-02 15:22:19 -08:00
Alex Yang 1dedca45ac docs: broken link on starter.md 2023-12-02 17:01:45 -06:00
yisding 3552de1b45 Merge pull request #234 from run-llama/ms/add-multi-modal-retriever
Feat: Adds multi modal retriever
2023-11-30 18:17:33 -08:00
Alex Yang 2b94e36df6 ci: update workflow version (#239) 2023-11-30 19:38:42 -06:00
yisding d1e1de4a8d Merge pull request #243 from run-llama/ms/add-create-llama-doc
doc: added create-llama
2023-11-30 17:28:08 -08:00
yisding 23587e17ad Merge pull request #247 from run-llama/ms/fix-docs
docs: fix links after moving examples
2023-11-30 17:23:19 -08:00
Marcus Schiesser 213f452f0b fix: bugs while testing the example 2023-11-30 17:11:25 +07:00
Marcus Schiesser 27a488539d feat: add multi-modal example and image reader 2023-11-30 11:17:59 +07:00
Marcus Schiesser 283da50d33 refactor: only use one class for multi-modal and normal 2023-11-30 11:17:59 +07:00
Marcus Schiesser a809085715 feat: add MultiModalVectorIndexRetriever 2023-11-30 11:17:59 +07:00
Marcus Schiesser 67321f1cba feat: add deleteDoc and creation of MultiModalVectorStoreIndex - cleaned VectorStoreIndex 2023-11-30 11:17:59 +07:00
Marcus Schiesser 7683186470 feat: added MultiModelVectorStoreIndex 2023-11-30 11:17:59 +07:00
Marcus Schiesser fded43b77e docs: fix links after moving examples 2023-11-30 11:11:38 +07:00
yisding 22ff7da4e0 Merge pull request #246 from run-llama/ms/move-examples
Unify apps/simple and examples - move everything to examples
2023-11-29 09:05:24 -08:00
Marcus Schiesser 844561b6cc chore: unified apps/simple and examples 2023-11-29 11:48:43 +07:00
Marcus Schiesser 52bc1d8387 doc: added create-llama 2023-11-28 13:52:14 +07:00
yisding 8a3ac0c338 Merge pull request #242 from run-llama/seldo-patch-1
Update link to python docs
2023-11-27 18:05:03 -08:00
yisding bb125d7d4f Merge pull request #240 from mtutty/add-pgvector-store
Minor fixes in PGVectorStore
2023-11-27 18:04:38 -08:00
yisding a405716847 Merge pull request #233 from run-llama/ms/create-llama-multi-modal
Feat: add GPT4 Vision support (and file upload) to create-llama
2023-11-27 18:03:29 -08:00
Laurie Voss bad6e03095 Update link to python docs 2023-11-27 17:26:50 -08:00
Michael Tutty 2330fddfbb Fix a field mapping in query method, handle empty embeddingResults in add method 2023-11-27 19:03:17 +00:00
Marcus Schiesser 61dfd74134 feat: removed non-streaming for nextjs 2023-11-24 18:04:14 +07:00
Marcus Schiesser 029ff83979 fix: set maxTokens to 4096 so vision model is not stopping too early (seems to have a lower default than other models) 2023-11-24 18:04:14 +07:00
Marcus Schiesser dbbc4cb2e1 feat: add multi-modal (file upload) and model selection to create-llama 2023-11-24 16:49:05 +07:00
Alex Yang 1cce21cdc2 feat: add loading indicator (#203) 2023-11-24 11:48:54 +08:00
yisding 8b786a51b3 create-llama 0.0.10 2023-11-23 10:56:43 -08:00
yisding ad7537dd84 llamaindex 0.0.37 2023-11-23 10:54:44 -08:00
yisding 3bab23172a changeset 2023-11-23 10:53:30 -08:00
yisding 18c132d494 Merge pull request #228 from run-llama/ms/create-llama-fixes
Several fixes for improving compatibility with Next.JS
2023-11-23 10:50:13 -08:00
Marcus Schiesser d072353e08 fix: copy pdf-parse test doc for npm build 2023-11-23 20:58:43 +07:00
Marcus Schiesser c8bbc101cc feat: remove AssemblyAIReader as it's not working with Next.JS 2023-11-23 18:23:24 +07:00
Marcus Schiesser b93f748998 fix: don't resolve mongodb for next.js 2023-11-23 18:20:15 +07:00
Marcus Schiesser ecb100448a fix: remove forceConsistentCasingInFileNames warning 2023-11-23 18:19:29 +07:00
Marcus Schiesser c749c856b5 fix: add missing clsx package 2023-11-23 18:18:35 +07:00
Marcus Schiesser 0baf278972 fix: transformers.js not working with nextjs 2023-11-23 16:46:18 +07:00
Marcus Schiesser ae7780266a fix: curl test for express (streaming) 2023-11-23 15:56:36 +07:00
Marcus Schiesser 587960aebe fix: use dotenv for npm run generate, use .env for NextJS, fix package versions for pnpm 2023-11-23 15:55:47 +07:00
Marcus Schiesser 4e1b6784f7 fix: pdfparse not working with in ESM version 2023-11-23 14:22:29 +07:00
yisding 8b381f2640 LITS 0.0.36 2023-11-21 22:33:14 -08:00
yisding 0dc7fa6c34 Merge pull request #170 from Swimburger/assemblyai
Add AssemblyAI integration
2023-11-21 21:46:08 -08:00
yisding 2a2bf682bf small fix in example 2023-11-21 21:44:58 -08:00
yisding 87526129fb Merge branch 'main' into assemblyai 2023-11-21 21:39:35 -08:00
yisding 8ed1b7aa46 Merge pull request #179 from mtutty/add-pgvector-store
Add PGVectorStore
2023-11-21 21:35:12 -08:00
yisding 4084bd0ecc Merge branch 'main' into add-pgvector-store 2023-11-21 21:33:41 -08:00
yisding d11eaceaf1 Merge pull request #223 from run-llama/claude-21
support for claude-2.1
2023-11-21 21:30:21 -08:00
yisding 1e6986fbc5 pnpm lockfile 2023-11-21 21:20:30 -08:00
yisding 11a19bdec7 make sweep optional in issues 2023-11-21 21:15:32 -08:00
yisding 51064f1b90 Merge pull request #221 from run-llama/ms/add-clip-embeddings
feat: add clip embedding to llamaindex
2023-11-21 21:04:01 -08:00
yisding 3385cd19e8 support for claude-2.1
Added custom RAG prompt for Claude.
Supporting system message format.
2023-11-21 21:01:54 -08:00
yisding 852f8517df Merge pull request #209 from run-llama/jerry/edit_readme
add .env instructions
2023-11-21 21:01:35 -08:00
Marcus Schiesser bb917f9818 refactor: moved embeddings to embeddings folder 2023-11-21 14:20:10 +07:00
Marcus Schiesser 10248fb29f chore: move clip example 2023-11-21 13:53:38 +07:00
Marcus Schiesser 446dc85bdd fix: usage of transformers.js as CJS 2023-11-21 13:42:40 +07:00
Marcus Schiesser 4aa2c226a9 feat: add clip embedding to llamaindex 2023-11-21 11:01:29 +07:00
Marcus Schiesser bf9ba8313a test clip embeddings 2023-11-21 10:59:37 +07:00
yisding 444b59c557 Merge pull request #218 from run-llama/ms/use-cryptojs
feat: use cryptojs instead of crypto
2023-11-20 18:25:31 -08:00
yisding b2e1df94db Merge remote-tracking branch 'origin/main' into ms/use-cryptojs 2023-11-20 18:24:30 -08:00
yisding b4963cabc8 Merge pull request #204 from run-llama/ms/add-mongodb-vector
Feat: added support for MongoDB as vector DB
2023-11-20 18:09:09 -08:00
Marcus Schiesser 2851024340 feat: use cryptojs instead of crypto (removes nodejs dep) 2023-11-20 13:56:04 +07:00
yisding 7f25a25729 create-llama 0.0.9 2023-11-19 18:30:32 -08:00
yisding acfe23265a changeset 2023-11-19 18:17:57 -08:00
yisding 2c6fbbd7dd Merge pull request #217 from run-llama/seldo/python-gitignore 2023-11-19 17:30:49 -08:00
Laurie Voss f84507f513 Merge branch 'main' of github.com:run-llama/LlamaIndexTS into seldo/python-env 2023-11-19 17:26:50 -08:00
Laurie Voss be6a9e4a48 Default .gitignore should ignore .env 2023-11-19 17:26:25 -08:00
yisding 69e7634619 Merge pull request #216 from run-llama/seldo/python-env 2023-11-19 17:14:42 -08:00
Laurie Voss d18748aba4 Merge branch 'main' of github.com:run-llama/LlamaIndexTS into seldo/deploy-fixes 2023-11-19 17:11:45 -08:00
yisding 27c4ef3410 Merge pull request #215 from run-llama/seldo/deploy-fixes 2023-11-19 16:21:19 -08:00
Laurie Voss a7ee392d3e dotenv must load before chat_router or .env isn't picked up in time 2023-11-19 16:15:41 -08:00
Laurie Voss 4415a6fdef next.config.js has to be different for express/python backends 2023-11-19 15:55:27 -08:00
Laurie Voss 1e1e6e96a1 Handle CORS in prod 2023-11-19 15:54:53 -08:00
Laurie Voss 461d1dfbcc Don't commit .env in the backend 2023-11-19 15:52:57 -08:00
Jerry Liu 3e8c923641 cr 2023-11-17 19:39:23 -08:00
yisding 5975fafefb Merge pull request #208 from run-llama/seldo/express-parsing-bug
fix: generated frontend is sending text/plain
2023-11-17 16:57:42 -08:00
Laurie Voss 71169fd545 fix: generated frontend is sending text/plain so handle that instead of JSON 2023-11-17 15:29:56 -08:00
Logan be895d564d Merge pull request #202 from run-llama/logan/fix_llm_def 2023-11-17 15:02:04 -06:00
yisding f36a27c218 create-llama 0.0.8 2023-11-17 09:06:00 -08:00
yisding 8cdb07f151 changeset 2023-11-17 09:05:24 -08:00
yisding ea403a0ffe Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-11-17 09:04:33 -08:00
yisding 7f0b4e66ae create-llama 0.0.7 2023-11-17 09:04:01 -08:00
yisding 3b226965ba Merge pull request #205 from run-llama/ms/copy-cache-folder
fix: copy cache folder for vercel deployments
2023-11-17 09:03:26 -08:00
Logan Markewich 63daf77412 remove accidental files 2023-11-17 09:57:43 -06:00
Marcus Schiesser df5cbe30a6 fix: missing JSON parsing and improved compatibility with Python 2023-11-17 15:06:31 +07:00
Marcus Schiesser 9e1a536778 docs: createIndex doesn't work 2023-11-17 14:58:20 +07:00
Marcus Schiesser a1db8833ef feat: sync'ed SimpleMongReader with Python 0.9 and tested/fixed mongodb scripts 2023-11-17 14:05:12 +07:00
Marcus Schiesser 95dd0e0158 feat: add mongo db vector support with example 2023-11-17 14:05:12 +07:00
Marcus Schiesser 079a1d5cc3 fix: copy cache folder for vercel deployments 2023-11-17 08:52:42 +07:00
Logan Markewich 2377d1a466 Fix LLM definitions 2023-11-16 15:55:38 -06:00
yisding 9f9f29391e changeset 2023-11-15 16:25:07 -08:00
yisding b64716d3f7 Merge pull request #197 from run-llama/seldo/create-llama-readme
Expanding README docs
2023-11-15 15:56:42 -08:00
Laurie Voss d7a47abe38 Lots of new docs 2023-11-15 15:52:56 -08:00
yisding 58b314a61e create-llama 0.0.6 2023-11-14 20:54:59 -08:00
yisding 4431ec7a5e changeset 2023-11-14 20:53:42 -08:00
yisding 9542026d70 Merge pull request #196 from run-llama/ms/fix-label-for-simple-chat
fix: label for simple chat
2023-11-14 20:49:27 -08:00
Marcus Schiesser cc4c5b64c0 fix: label for simple chat 2023-11-15 11:06:26 +07:00
yisding 82c2aac4a0 update replicate version 2023-11-14 16:41:57 -08:00
yisding a143e0f0f1 new replicate models 2023-11-14 16:40:36 -08:00
yisding db9775dc32 sync examples 2023-11-14 16:20:57 -08:00
yisding 538c0b0740 hopefully fix prettier issue 2023-11-14 16:17:53 -08:00
yisding 21cd88caf6 prettier 2023-11-14 16:06:18 -08:00
yisding 0660d9e2a5 create-llama 0.0.5 2023-11-14 15:04:41 -08:00
yisding 25257f49d7 changeset 2023-11-14 14:50:27 -08:00
yisding dd615f106d fix #182 (thanks @RayFernando1337)
add license
make contextchatengine the default
change git commit message
2023-11-14 14:48:08 -08:00
yisding 5db64d61e0 Merge pull request #155 from team-dev-docs/avb-is-me-patch-1
Add Interactive Tutorials Using Codespaces
2023-11-14 12:08:07 -08:00
yisding ee5e1f94e4 create-llama 0.0.4 2023-11-14 09:16:13 -08:00
yisding 031e926414 changeset 2023-11-14 09:14:30 -08:00
yisding 88b4b3143d Merge pull request #181 from run-llama/logan/update_create_llama_readme
create-llama readme update
2023-11-14 09:09:15 -08:00
yisding c1ce84ecec Update README.md 2023-11-14 09:06:56 -08:00
Logan Markewich d670011363 typo 2023-11-14 10:57:16 -06:00
Logan Markewich c88332366b readme update 2023-11-14 10:30:55 -06:00
yisding cfee282c28 create-llama 0.0.3 2023-11-13 20:19:43 -08:00
yisding 91b42a3539 changeset 2023-11-13 20:15:18 -08:00
yisding 02b1d176c5 Merge pull request #180 from run-llama/fix/create-llama-version
fix: use llamaindex version and not create-llama version
2023-11-13 20:00:05 -08:00
Marcus Schiesser 63d072b8cc fix: use llamaindex version and not create-llama version 2023-11-14 10:50:26 +07:00
yisding 256d44f255 create llama 0.0.2 and llamaindex 0.0.35 2023-11-13 18:10:18 -08:00
yisding e2a6805a31 changeset 2023-11-13 18:09:09 -08:00
yisding d46fc12079 packages 2023-11-13 18:08:30 -08:00
yisding 5ce88f107c Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-11-13 18:01:57 -08:00
yisding 683c4addd9 Merge pull request #153 from run-llama/add/create-llama
Add create-llama CLI tool
2023-11-13 17:58:58 -08:00
yisding db58cf2e68 Update README.md 2023-11-13 17:58:20 -08:00
yisding 1cf535865a Update packages/create-llama/create-app.ts
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-11-13 17:48:15 -08:00
Marcus Schiesser 6042d2a3c7 fix: don't copy backend files for frontend-only 2023-11-13 17:38:40 +07:00
Marcus Schiesser df03819e12 feat: copy test PDF for TS projects and automatically call npm run generate 2023-11-13 16:59:49 +07:00
Marcus Schiesser 072354afb7 fix: remove pnpm-lock 2023-11-13 13:39:17 +07:00
Marcus Schiesser 57c7369aea fix: add cors to express app 2023-11-13 11:36:32 +07:00
Marcus Schiesser f92cdf335f fix: didn't copy UI readme 2023-11-13 10:08:25 +07:00
Michael Tutty 19f3c857d5 Add comment blocks and support for collection filtering 2023-11-11 18:13:41 +00:00
Michael Tutty 7f3da73aa4 Final cleanup, README for example scripts 2023-11-11 17:48:01 +00:00
Michael Tutty c384c2b610 Resolve upstream conflicts 2023-11-11 16:56:45 +00:00
Marcus Schiesser 16d7dd426a fix: align express port with fastapi port 2023-11-10 18:15:14 +07:00
Marcus Schiesser 787b6928d9 feat: updated package version and exchanged PDF for fastapi 2023-11-10 17:48:20 +07:00
Marcus Schiesser ddbdbc5fb5 fix: ensure that no HTML component files are copied if shadcn is selected 2023-11-10 17:38:15 +07:00
Marcus Schiesser d0edf9fb48 feat: add OpenAI key to create-llama 2023-11-10 16:56:35 +07:00
Marcus Schiesser 28d4446aa7 feat: add markdown, regenerate and stop 2023-11-10 16:56:35 +07:00
Marcus Schiesser ab3419ab09 fix: removed launch.json 2023-11-10 16:56:35 +07:00
Marcus Schiesser 457fe1535f fix: add linting for create-llama 2023-11-10 16:56:35 +07:00
Marcus Schiesser 6e90b02052 feat: generate fullstack app with fastapi or express 2023-11-10 16:56:35 +07:00
Marcus Schiesser fdc2680ae8 inline UI HTML components to simplify code generation 2023-11-10 16:56:35 +07:00
Marcus Schiesser 35a398443a inline simple chat engine as a default 2023-11-10 16:56:35 +07:00
Marcus Schiesser b55ce8aa93 remove bun 2023-11-10 16:56:35 +07:00
Marcus Schiesser 74e67ef702 separate template types and components in file system 2023-11-10 16:56:35 +07:00
Marcus Schiesser e689248919 fix: wrap non-streaming result for FastAPI in an result object 2023-11-10 16:56:35 +07:00
Marcus Schiesser 5a527b3fc9 feat: set custom api path for nextjs 2023-11-10 16:56:35 +07:00
Marcus Schiesser 565cc37912 fix: modify streaming fastapi to support vercel/ai 2023-11-10 16:56:35 +07:00
Marcus Schiesser 50e1864a85 added streaming fastapi template 2023-11-10 16:56:35 +07:00
Marcus Schiesser 37ac88fc1b added simple fastapi template 2023-11-10 16:56:35 +07:00
Marcus Schiesser 8ed98bcb07 feat: add streaming express example and align with non-streaming one 2023-11-10 16:56:35 +07:00
Marcus Schiesser b8609ec149 feat: select between HTML and shadcn components 2023-11-10 16:56:35 +07:00
Marcus Schiesser 96eb603bca add support for chat engines to express 2023-11-10 16:56:35 +07:00
Marcus Schiesser 20aaf35fc4 add ContextChatEngine and generator for different chat engines 2023-11-10 16:56:35 +07:00
Marcus Schiesser 151a63a118 unified streaming and non-streaming 2023-11-10 16:56:35 +07:00
Marcus Schiesser 9db2267445 moved components to ui folder (shadcn structure) 2023-11-10 16:56:35 +07:00
Marcus Schiesser 69a7ef063d added streaming for llamaindex 2023-11-10 16:56:35 +07:00
Marcus Schiesser 8527875f0a added support for generating streaming template 2023-11-10 16:56:35 +07:00
Marcus Schiesser 2244da07e6 added first draft of streaming nextjs template 2023-11-10 16:56:35 +07:00
Marcus Schiesser 18bf710549 feat: add simple chat for nextjs template 2023-11-10 16:56:34 +07:00
Marcus Schiesser 9e2e5a3f7f doc: update readmes 2023-11-10 16:56:34 +07:00
Marcus Schiesser 3df7fd6dd1 remove import alias and src folder rewrite 2023-11-10 16:56:34 +07:00
Marcus Schiesser 4371c46c4c add express example, framework selector and use existing package.json (just update it) 2023-11-10 16:56:34 +07:00
Marcus Schiesser fcf7c1275b use repos package version 2023-11-10 16:56:34 +07:00
Marcus Schiesser e6e62fa767 removed URL download 2023-11-10 16:56:34 +07:00
Marcus Schiesser 8e1cb8fb70 use prettier 2023-11-10 16:56:34 +07:00
Marcus Schiesser 00674686cb add test form for nextjs simple (and make generation work) 2023-11-10 16:56:34 +07:00
Marcus Schiesser b350bb2e7a add llama nextjs simple template 2023-11-10 16:56:34 +07:00
Marcus Schiesser e17c704a4b add async-sema 2023-11-10 16:56:34 +07:00
Marcus Schiesser 3259245780 add create-next-app v13.5.6 2023-11-10 16:56:34 +07:00
yisding 63f21084b6 changeset 2023-11-09 19:14:17 -08:00
yisding ced3555248 Merge pull request #178 from run-llama/ms/gpt4-vision
Add support for GPT4 Vision Model
2023-11-09 19:12:22 -08:00
Marcus Schiesser 27eef24611 feat: use context-generator for multi-modal messages 2023-11-10 10:02:51 +07:00
Michael Tutty dcf358f27d Resolve upstream updates/conflicts 2023-11-10 02:16:42 +00:00
Michael Tutty 40afc8c0e2 Add PGVectorStore, dependencies, example scripts 2023-11-10 02:04:35 +00:00
Marcus Schiesser 1dabdbf7d8 feat: allow any type for messages to support GPT-4 vision 2023-11-08 16:39:54 +07:00
yisding d65397a0ba change example to 4-turbo 2023-11-06 12:58:47 -08:00
yisding 8c72500070 0.0.34 2023-11-06 12:58:12 -08:00
yisding 2a27e21e00 changeset 2023-11-06 12:40:36 -08:00
yisding 3bc52a1f2c added 3.5 1106 2023-11-06 12:39:52 -08:00
yisding 9806b5a0a9 0.0.33 2023-11-06 10:59:52 -08:00
yisding 201cd0f5fc packages 2023-11-06 10:59:00 -08:00
yisding 5e2e92c11a changeset 2023-11-06 10:51:02 -08:00
yisding d57657599b new openai models from dev day 2023-11-06 10:50:22 -08:00
yisding 995db834b2 0.0.32 2023-11-02 18:05:56 -07:00
Niels Swimberghe b22bc8a799 Add AssemblyAI integration 2023-10-31 15:43:33 -04:00
yisding dfd22aac46 changeset 2023-10-30 14:00:54 -07:00
yisding 72f62718f1 Merge pull request #160 from mtutty/add-observable-reader
Add observer/callback feature to SimpleDirectoryReader
2023-10-30 13:59:16 -07:00
yisding e938a4d154 minor changes 2023-10-30 13:52:15 -07:00
Michael Tutty 641019262e Add observer/callback feature to SimpleDirectoryReader 2023-10-30 13:52:15 -07:00
yisding fe9056f081 Merge pull request #164 from v4n/main
replace tiktoken with js-tiktoken
2023-10-30 10:56:34 -07:00
V4N fba49b8088 replace tiktoken with js-tiktoken 2023-10-30 10:00:02 -03:00
avb-is-me a5ae1eea30 Update end_to_end.md
Adds interactive Dev-Docs Tutorials
2023-10-27 16:04:32 -07:00
yisding 6e0ee9ec32 pinning babel/traverse for security 2023-10-26 15:50:55 -07:00
yisding a5e3e10e84 dynamic import of string-strip-html 2023-10-26 15:42:25 -07:00
yisding 99afbdd606 Merge pull request #154 from mtutty/add-html-reader
Add HTMLReader, sample app and HTML file
2023-10-26 15:06:51 -07:00
yisding 90c0b83c34 changeset 2023-10-26 15:04:51 -07:00
yisding 68f9dd1ce1 prettier 2023-10-26 15:04:08 -07:00
yisding 51e4b1de99 add HTMLReader to SimpleDirectoryReader 2023-10-26 15:02:04 -07:00
Michael Tutty 08f091a889 Revert .vscode/settings.json changes 2023-10-26 21:04:55 +00:00
Michael Tutty 692e3cc56e Add HTMLReader to core/src/readers, apps/simple example, and apps/simple/data HTML file 2023-10-26 20:21:59 +00:00
yisding bcfbccc381 0.0.31 2023-10-25 16:52:00 -07:00
yisding 8aa8c65d0e changeset 2023-10-25 14:24:12 -07:00
yisding 635d485b69 Merge branch 'main' of github.com:run-llama/LlamaIndexTS 2023-10-25 14:12:03 -07:00
yisding c0630eeebb Merge pull request #152 from TomPenguin/add-similarity-postprocessor
Add SimilarityPostprocessor
2023-10-25 12:54:14 -07:00
TomPenguin 8932be2d49 add preFilters option 2023-10-25 12:42:25 +09:00
TomPenguin 3905486240 remove logging 2023-10-25 12:39:09 +09:00
TomPenguin eedc14b13c fix 2023-10-25 12:36:03 +09:00
TomPenguin 44bb615eee update lock file 2023-10-25 12:23:59 +09:00
yisding 541d387143 packages 2023-10-24 16:34:26 -07:00
yisding a8ad9c10bd Merge pull request #146 from run-llama/fix/allow-readonly-indexes
fix: allow readonly indexes
2023-10-17 19:56:52 -07:00
yisding f1669224da update repository/license in package.json 2023-10-17 16:13:11 -07:00
Marcus Schiesser 2a27061891 fix: allow readonly indexes 2023-10-17 16:40:29 +07:00
yisding 6c55b2de58 changeset 2023-10-16 09:27:47 -07:00
yisding 9b99855c43 Merge pull request #145 from run-llama/feat/changes-for-unc
Feature: Extract ContextGenerator and make HistoryChatEngine pluggable
2023-10-16 09:23:08 -07:00
Marcus Schiesser 0269e88575 fix: added newMessages to SimpleChatHistory to unify interface with SummaryChatHistory 2023-10-16 17:48:29 +07:00
Marcus Schiesser 7fbd43283d fix: send context if there is no memory yet 2023-10-16 17:48:29 +07:00
Marcus Schiesser 226c123b77 fix: prevent context window overflow by including context messages to token calculation 2023-10-16 17:48:29 +07:00
Marcus Schiesser ac271d1006 feat: added StatelessChatEngine and extracted ContextGenerator 2023-10-16 17:48:29 +07:00
yisding af84425689 Merge pull request #144 from run-llama/feat/add-llm-metadata
Feature: Added `LLMMetadata` interface
2023-10-12 18:02:20 -07:00
Marcus Schiesser 512e9c947c fix: using LLM interface is sufficient 2023-10-12 14:16:24 +07:00
Marcus Schiesser e7319376a5 feat: add llm metadata interface 2023-10-11 17:24:46 +07:00
Marcus Schiesser 2a7b493769 fix: use globalshelper for tokenizer 2023-10-11 16:27:13 +07:00
Marcus Schiesser f516a0d2e4 feat: make usage of HistoryChatEngine similar to ContextChatEngine 2023-10-11 16:26:42 +07:00
Yi Ding 62f872122c docs for nextjs app router 2023-10-10 14:34:23 -07:00
yisding 89737d6e00 Merge pull request #140 from run-llama/feat/use-tokenizer-for-summarizer
Feat: Use tokenizer for chat history summarizer
2023-10-09 18:17:27 -07:00
Marcus Schiesser 6a81d54e53 Update packages/core/src/ChatHistory.ts 2023-10-09 18:18:38 +08:00
Marcus Schiesser c0062746eb feat: use tokenizer to ensure we're not running over the context window 2023-10-09 16:55:05 +07:00
Marcus Schiesser 809a904bc8 fix: summarizer issues 2023-10-09 11:51:28 +07:00
Yi Ding 602d27c7b0 0.0.30 2023-10-08 19:16:05 -07:00
yisding aad61e876f Merge pull request #139 from run-llama/esm
Esm
2023-10-07 15:59:50 -07:00
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
Yi Ding 737623443c add something about contributing to the docs 2023-07-17 10:38:34 -07:00
Yi Ding 07c5aeba13 built out the docs 2023-07-17 09:18:39 -07:00
Yi Ding d16113adbb Added JSDoc to our classes 2023-07-14 14:37:41 -07:00
Yi Ding 4649536f33 doc site 2023-07-12 20:53:17 -07:00
Yi Ding df4b1ad8a3 new LLM interface 2023-07-11 10:18:30 -07:00
Yi Ding 6eb44a4c13 Merge branch 'main' into llm 2023-07-10 07:34:04 -07:00
Yi Ding cdf1685f7c new llm abstraction from Simon 2023-07-10 07:24:59 -07:00
yisding 2f468ab132 Merge pull request #8 from run-llama/stream_responses
[Feature] CallbackManager with onLLMStream and onRetrieve
2023-07-10 07:19:15 -07:00
yisding 1e510093ef Merge pull request #10 from run-llama/listindex_fix
fix to get listindex script working
2023-07-10 07:12:20 -07:00
Sourabh Desai f9520d9374 small bugs 2023-07-10 08:14:32 +00:00
Sourabh Desai 2c141d2528 remove spammy console.log 2023-07-10 07:17:14 +00:00
Sourabh Desai bcca3b896c fix to get listindex script working 2023-07-10 06:58:18 +00:00
Abdul Jamjoom 0bec460937 clean-up 2023-07-09 16:46:34 -07:00
Abdul Jamjoom 5d8d344e1f updated tests 2023-07-09 16:42:58 -07:00
Abdul Jamjoom 81e22587eb add callback and event tracking 2023-07-09 16:31:04 -07:00
Yi Ding 539ec0fe3d try smaller chunks 2023-07-06 21:41:13 -07:00
Yi Ding ebf3bc19fd ContextChatEngine v1 2023-07-06 20:59:10 -07:00
Yi Ding 204b8f5316 chatengine 2023-07-06 08:53:09 -07:00
yisding 71dd461a47 Merge pull request #9 from run-llama/subquestion
SubQuestionQueryEngine
2023-07-05 19:39:11 -07:00
Yi Ding 0c881c8fde finished subquestion demo 2023-07-05 08:37:41 -07:00
Abdul Jamjoom 35a6795559 polish 2023-07-04 22:34:49 -07:00
Abdul Jamjoom 968109455d Create the CallbackManager with onLLMStream and onRetrieve 2023-07-04 21:53:45 -07:00
Yi Ding 815a3416f2 more work 2023-07-04 20:53:36 -07:00
Yi Ding 407069ca27 prompt work for question generator 2023-07-04 14:08:04 -07:00
Yi Ding 29d042175e initial work 2023-07-04 14:06:49 -07:00
yisding bbf936e9b4 Merge pull request #7 from run-llama/listindex
List Index
2023-07-04 10:18:35 -07:00
Yi Ding 2212793420 more housekeeping 2023-07-04 09:47:44 -07:00
Abdul Jamjoom 5487de8c37 Merge branch 'main' of github.com:run-llama/llamascript into stream_responses 2023-07-04 09:34:46 -07:00
Abdul Jamjoom 2a038c00ec unstable checkpoint 2023-07-04 09:27:54 -07:00
Yi Ding d6c6aefd0d some housekeeping 2023-07-04 09:22:16 -07:00
Yi Ding 4516363097 make persistence optional 2023-07-04 08:56:31 -07:00
Yi Ding 69dd6d4efa make persistence optional 2023-07-04 08:54:22 -07:00
Sourabh Desai 9ea840142b changes to get test script running 2023-07-04 07:40:41 +00:00
Sourabh Desai a1c45294b3 updates for compilation errors 2023-07-04 05:55:51 +00:00
Sourabh Desai c2ef5057b3 add init functions for list index. Still needs some refactoring + testing 2023-07-03 22:59:28 +00:00
Sourabh Desai b87e6d9ced finish implementation for llm list index retriever 2023-07-03 18:31:32 +00:00
Sourabh Desai 8d618a6bc3 better structuring + adding missing functionality 2023-07-03 16:14:53 +00:00
Sourabh Desai 8d8bee5263 start implementing list index retrievers 2023-07-03 06:42:00 +00:00
Sourabh Desai ed924641ca start implemetation of list index 2023-07-03 05:40:05 +00:00
Yi Ding ce61f9660b turbo update 2023-06-29 21:01:49 -07:00
Yi Ding 072b13cff0 use servicecontext/storagecontext 2023-06-29 21:00:36 -07:00
yisding ff274dde1d Merge pull request #5 from run-llama/nodev3
initial nodev3 work
2023-06-29 17:47:10 -07:00
507 changed files with 104640 additions and 2996 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)
+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": []
}
+10
View File
@@ -0,0 +1,10 @@
name: Bugfix
title: ""
description: Write something like "We notice ... behavior when ... happens instead of ...""
body:
- type: textarea
id: description
attributes:
label: Details
description: More details about the bug
placeholder: The bug might be in ... file
+10
View File
@@ -0,0 +1,10 @@
name: Feature Request
title: ""
description: Write something like "Write an api endpoint that does "..." in the "..." file". If you would like to use sweep.dev prefix with "Sweep:"
body:
- type: textarea
id: description
attributes:
label: Details
description: More details
placeholder: The new endpoint should use the ... class from ... file because it contains ... logic
+10
View File
@@ -0,0 +1,10 @@
name: Refactor
title: ""
description: Write something like "Modify the ... api endpoint to use ... version and ... framework" If you would like to use sweep.dev prefix with "Sweep:"
body:
- type: textarea
id: description
attributes:
label: Details
description: More details
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:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Run lint
run: pnpm run lint
+20
View File
@@ -0,0 +1,20 @@
name: Run Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Run tests
run: pnpm run test
+6
View File
@@ -3,6 +3,7 @@
# dependencies
node_modules
.pnp
.pnpm-store
.pnp.js
# testing
@@ -34,3 +35,8 @@ yarn-error.log*
# vercel
.vercel
dist/
# vs code
.vscode/launch.json
+1
View File
@@ -2,3 +2,4 @@
. "$(dirname -- "$0")/_/husky.sh"
pnpm lint
npx lint-staged
+1
View File
@@ -0,0 +1 @@
18
+6 -2
View File
@@ -1,5 +1,9 @@
{
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
},
"jest.rootPath": "./packages/core"
}
+80
View File
@@ -0,0 +1,80 @@
# Contributing
## Structure
This is a monorepo built with Turborepo
Right now there are two packages of importance:
packages/core which is the main NPM library llamaindex
apps/simple is where the demo code lives
### Turborepo docs
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 LlamaIndexTS directory:
```
npm i -g pnpm ts-node
pnpm install
```
Note: we use pnpm in this repo, which has a lot of the same functionality and CLI options as npm but it does do some things better in a monorepo, like centralizing dependencies and caching.
PNPM's has documentation on its [workspace feature](https://pnpm.io/workspaces) and Turborepo had some [useful documentation also](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks).
### Running Typescript
When we publish to NPM we will have a tsc compiled version of the library in JS. For now, the easiest thing to do is use ts-node.
### Test cases
To run them, run
```
pnpm run test
```
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
To install packages for a specific package or demo application, run
```
pnpm add [NPM Package] --filter [package or application i.e. core or simple]
```
To install packages for every package or application run
```
pnpm add -w [NPM Package]
```
### Docs
To contribute to the docs, go to the docs website folder and run the Docusaurus instance.
```bash
cd apps/docs
pnpm install
pnpm start
```
That should start a webserver which will serve the docs on https://localhost:3000
Any changes you make should be reflected in the browser. If you need to regenerate the API docs and find that your TSDoc isn't getting the updates, feel free to remove apps/docs/api. It will automatically regenerate itself when you run pnpm start again.
+94 -39
View File
@@ -1,64 +1,119 @@
# LlamaScript: LlamaIndex for TS/JS
# LlamaIndex.TS
## Structure
LlamaIndex is a data framework for your LLM application.
This is a monorepo built with Turborepo
Use your own data with large language models (LLMs, OpenAI ChatGPT and others) in Typescript and Javascript.
Right now there are two packages of importance:
Documentation: https://ts.llamaindex.ai/
packages/core which is the main NPM library @llamaindex/core
## What is LlamaIndex.TS?
apps/simple is where the demo code lives
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.
### Turborepo docs
## Getting started with an example:
You can checkout how Turborepo works using the built in [README-turborepo.md](README-turborepo.md)
LlamaIndex.TS requries Node v18 or higher. You can download it from https://nodejs.org or use https://nvm.sh (our preferred option).
## Getting Started
In a new folder:
Install NodeJS. Preferably v18 using nvm or n.
Inside the llamascript directory:
```
npm i -g pnpm ts-node
pnpm install
```bash
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
```
Note: we use pnpm in this repo, which has a lot of the same functionality and CLI options as npm but it does do some things better in a monorepo, like centralizing dependencies and caching.
Create the file example.ts
PNPM's has documentation on its [workspace feature](https://pnpm.io/workspaces) and Turborepo had some [useful documentation also](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks).
```ts
// example.ts
import fs from "fs/promises";
import { Document, VectorStoreIndex } from "llamaindex";
### Running Typescript
async function main() {
// Load essay from abramov.txt in Node
const essay = await fs.readFile(
"node_modules/llamaindex/examples/abramov.txt",
"utf-8",
);
When we publish to NPM we will have a tsc compiled version of the library in JS. For now, the easiest thing to do is use ts-node.
// Create Document object with essay
const document = new Document({ text: essay });
### Test cases
// Split text and create embeddings. Store them in a VectorStoreIndex
const index = await VectorStoreIndex.fromDocuments([document]);
To run them, run
// Query the index
const queryEngine = index.asQueryEngine();
const response = await queryEngine.query(
"What did the author do in college?",
);
```
pnpm run test
// Output response
console.log(response.toString());
}
main();
```
To write new test cases write them in packages/core/src/tests
Then you can run it using
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
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
To install packages for a specific package or demo application, run
```
pnpm add [NPM Package] --filter [package or application i.e. core or simple]
```bash
pnpx ts-node example.ts
```
To install packages for every package or application run
## Playground
Check out our NextJS playground at https://llama-playground.vercel.app/. The source is available at https://github.com/run-llama/ts-playground
## Core concepts for getting started:
- [Document](/packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
- [Node](/packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
- [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.
- [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.
## Note: NextJS:
If you're using NextJS App Router, you'll need to use the NodeJS runtime (default) and add the follow config to your next.config.js to have it use imports/exports in the same way Node does.
```js
export const runtime = "nodejs"; // default
```
pnpm add -w [NPM Package]
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Puts pdf-parse in actual NodeJS mode with NextJS App Router
},
};
module.exports = nextConfig;
```
## 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)
## Bugs? Questions?
Please join our Discord! https://discord.com/invite/eN6D2HQ4aX
-4
View File
@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: ["custom"],
};
+10 -24
View File
@@ -1,34 +1,20 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
# Dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
# Production
/build
# misc
# Generated files
.docusaurus
.cache-loader
# Misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
# vercel
.vercel
npm-debug.log*
yarn-debug.log*
yarn-error.log*
+47
View File
@@ -0,0 +1,47 @@
# Website
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
### Installation
```
$ pnpm
```
### Local Development
```
$ 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
```
$ pnpm build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
### Deployment
Using SSH:
```
$ USE_SSH=true pnpm deploy
```
Not using SSH:
```
$ 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.
-30
View File
@@ -1,30 +0,0 @@
## Getting Started
First, run the development server:
```bash
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
-11
View File
@@ -1,11 +0,0 @@
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
-10
View File
@@ -1,10 +0,0 @@
import { Button, Header } from "ui";
export default function Page() {
return (
<>
<Header text="Docs" />
<Button />
</>
);
}
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
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

+78
View File
@@ -0,0 +1,78 @@
---
sidebar_position: 3
---
# High-Level Concepts
LlamaIndex.TS helps you build LLM-powered applications (e.g. Q&A, chatbot) over custom data.
In this high-level concepts guide, you will learn:
- how an LLM can answer questions using your own data.
- key concepts and modules in LlamaIndex.TS for composing your own query pipeline.
## Answering Questions Across Your Data
LlamaIndex uses a two stage method when using an LLM with your data:
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
![](./_static/concepts/rag.jpg)
This process is also known as Retrieval Augmented Generation (RAG).
LlamaIndex.TS provides the essential toolkit for making both steps super easy.
Let's explore each stage in detail.
### Indexing Stage
LlamaIndex.TS help you prepare the knowledge base with a suite of data connectors and indexes.
![](./_static/concepts/indexing.jpg)
[**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).
+45
View File
@@ -0,0 +1,45 @@
---
sidebar_position: 4
---
# End to End Examples
We include several end-to-end examples using LlamaIndex.TS in the repository
Check out the examples below or try them out and complete them in minutes with interactive Github Codespace tutorials provided by Dev-Docs [here](https://codespaces.new/team-dev-docs/lits-dev-docs-playground?devcontainer_path=.devcontainer%2Fjavascript_ltsquickstart%2Fdevcontainer.json):
## [Chat Engine](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/chatEngine.ts)
Read a file and chat about it with the LLM.
## [Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/vectorIndex.ts)
Create a vector index and query it. The vector index will use embeddings to fetch the top k most relevant nodes. By default, the top k is 2.
## [Summary Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/summaryIndex.ts)
Create a list index and query it. This example also use the `LLMRetriever`, which will use the LLM to select the best nodes to use when generating answer.
## [Save / Load an Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/storageContext.ts)
Create and load a vector index. Persistance to disk in LlamaIndex.TS happens automatically once a storage context object is created.
## [Customized Vector Index](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/vectorIndexCustomize.ts)
Create a vector index and query it, while also configuring the the `LLM`, the `ServiceContext`, and the `similarity_top_k`.
## [OpenAI LLM](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/openai.ts)
Create an OpenAI LLM and directly use it for chat.
## [Llama2 DeuceLLM](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/llamadeuce.ts)
Create a Llama-2 LLM and directly use it for chat.
## [SubQuestionQueryEngine](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/subquestion.ts)
Uses the `SubQuestionQueryEngine`, which breaks complex queries into multiple questions, and then aggreates a response across the answers to all sub-questions.
## [Low Level Modules](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/lowlevel.ts)
This example uses several low-level components, which removes the need for an actual query engine. These components can be used anywhere, in any application, or customized and sub-classed to meet your own needs.
+29
View File
@@ -0,0 +1,29 @@
---
sidebar_position: 5
---
# Environments
LlamaIndex currently officially supports NodeJS 18 and NodeJS 20.
## NextJS App Router
If you're using NextJS App Router route handlers/serverless functions, you'll need to use the NodeJS mode:
```js
export const runtime = "nodejs"; // default
```
and you'll need to add an exception for pdf-parse in your next.config.js
```js
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["pdf-parse"], // Puts pdf-parse in actual NodeJS mode with NextJS App Router
},
};
module.exports = nextConfig;
```
+63
View File
@@ -0,0 +1,63 @@
---
sidebar_position: 1
---
# Installation and Setup
Make sure you have NodeJS v18 or higher.
## Using create-llama
The easiest way to get started with LlamaIndex is by using `create-llama`. This CLI tool enables you to quickly start building a new LlamaIndex application, with everything set up for you.
Just run
<Tabs>
<TabItem value="1" label="npm" default>
```bash
npx create-llama@latest
```
</TabItem>
<TabItem value="2" label="Yarn">
```bash
yarn create llama
```
</TabItem>
<TabItem value="3" label="pnpm">
```bash
pnpm create llama@latest
```
</TabItem>
</Tabs>
to get started. Once your app is generated, run
```bash npm2yarn
npm run dev
```
to start the development server. You can then visit [http://localhost:3000](http://localhost:3000) to see your app
## Installation from NPM
```bash npm2yarn
npm install llamaindex
```
### Environment variables
Our examples use OpenAI by default. You'll need to set up your Open AI key like so:
```bash
export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
```
If you want to have it automatically loaded every time, add it to your .zshrc/.bashrc.
WARNING: do not check in your OpenAI key into version control.
+56
View File
@@ -0,0 +1,56 @@
---
sidebar_position: 0
slug: /
---
# What is LlamaIndex.TS?
LlamaIndex.TS is a data framework for LLM applications to ingest, structure, and access private or domain-specific data. While a python package is also available (see [here](https://docs.llamaindex.ai/en/stable/)), LlamaIndex.TS offers core features in a simple package, optimized for usage with TypeScript.
## 🚀 Why LlamaIndex.TS?
At their core, LLMs offer a natural language interface between humans and inferred data. Widely available models come pre-trained on huge amounts of publicly available data, from Wikipedia and mailing lists to textbooks and source code.
Applications built on top of LLMs often require augmenting these models with private or domain-specific data. Unfortunately, that data can be distributed across siloed applications and data stores. It's behind APIs, in SQL databases, or trapped in PDFs and slide decks.
That's where **LlamaIndex.TS** comes in.
## 🦙 How can LlamaIndex.TS help?
LlamaIndex.TS provides the following tools:
- **Data loading** ingest your existing `.txt`, `.pdf`, `.csv`, `.md` and `.docx` data directly
- **Data indexes** structure your data in intermediate representations that are easy and performant for LLMs to consume.
- **Engines** provide natural language access to your data. For example:
- Query engines are powerful retrieval interfaces for knowledge-augmented output.
- Chat engines are conversational interfaces for multi-message, "back and forth" interactions with your data.
## 👨‍👩‍👧‍👦 Who is LlamaIndex for?
LlamaIndex.TS provides a core set of tools, essential for anyone building LLM apps with JavaScript and TypeScript.
Our high-level API allows beginner users to use LlamaIndex.TS to ingest and query their data.
For more complex applications, our lower-level APIs allow advanced users to customize and extend any module—data connectors, indices, retrievers, and query engines, to fit their needs.
## Getting Started
`npm install llamaindex`
Our documentation includes [Installation Instructions](./installation.md) and a [Starter Tutorial](./starter.md) to build your first application.
Once you're up and running, [High-Level Concepts](./concepts.md) has an overview of LlamaIndex's modular architecture. For more hands-on practical examples, look through our [End-to-End Tutorials](./end_to_end.md).
## 🗺️ Ecosystem
To download or contribute, find LlamaIndex on:
- Github: https://github.com/run-llama/LlamaIndexTS
- NPM: https://www.npmjs.com/package/llamaindex
## Community
Need help? Have a feature suggestion? Join the LlamaIndex community:
- Twitter: https://twitter.com/llama_index
- Discord https://discord.gg/dGcwcsnxhU
+3
View File
@@ -0,0 +1,3 @@
label: "Modules"
collapsed: false
position: 5
@@ -0,0 +1 @@
label: High-Level Modules
@@ -0,0 +1,20 @@
---
sidebar_position: 4
---
# ChatEngine
The chat engine is a quick and simple way to chat with the data in your index.
```typescript
const retriever = index.asRetriever();
const chatEngine = new ContextChatEngine({ retriever });
// start chatting
const response = await chatEngine.chat(query);
```
## Api References
- [ContextChatEngine](../../api/classes/ContextChatEngine.md)
- [CondenseQuestionChatEngine](../../api/classes/ContextChatEngine.md)
@@ -0,0 +1,23 @@
---
sidebar_position: 2
---
# Index
An index is the basic container and organization for your data. LlamaIndex.TS supports two indexes:
- `VectorStoreIndex` - will send the top-k `Node`s to the LLM when generating a response. The default top-k is 2.
- `SummaryIndex` - will send every `Node` in the index to the LLM in order to generate a response
```typescript
import { Document, VectorStoreIndex } from "llamaindex";
const document = new Document({ text: "test" });
const index = await VectorStoreIndex.fromDocuments([document]);
```
## API Reference
- [SummaryIndex](../../api/classes/SummaryIndex.md)
- [VectorStoreIndex](../../api/classes/VectorStoreIndex.md)
@@ -0,0 +1,17 @@
---
sidebar_position: 1
---
# Reader / Loader
LlamaIndex.TS supports easy loading of files from folders using the `SimpleDirectoryReader` class. Currently, `.txt`, `.pdf`, `.csv`, `.md` and `.docx` files are supported, with more planned in the future!
```typescript
import { SimpleDirectoryReader } from "llamaindex";
documents = new SimpleDirectoryReader().loadData("./data");
```
## API Reference
- [SimpleDirectoryReader](../../api/classes/SimpleDirectoryReader.md)
@@ -0,0 +1,18 @@
---
sidebar_position: 0
---
# Documents and Nodes
`Document`s and `Node`s are the basic building blocks of any index. While the API for these objects is similar, `Document` objects represent entire files, while `Node`s are smaller pieces of that original document, that are suitable for an LLM and Q&A.
```typescript
import { Document } from "llamaindex";
document = new Document({ text: "text", metadata: { key: "val" } });
```
## API Reference
- [Document](../../api/classes/Document.md)
- [TextNode](../../api/classes/TextNode.md)
@@ -0,0 +1,36 @@
---
sidebar_position: 3
---
# QueryEngine
A query engine wraps a `Retriever` and a `ResponseSynthesizer` into a pipeline, that will use the query string to fetech nodes and then send them to the LLM to generate a response.
```typescript
const queryEngine = index.asQueryEngine();
const response = await queryEngine.query("query string");
```
## Sub Question Query Engine
The basic concept of the Sub Question Query Engine is that it splits a single query into multiple queries, gets an answer for each of those queries, and then combines those different answers into a single coherent response for the user. You can think of it as the "think this through step by step" prompt technique but iterating over your data sources!
### Getting Started
The easiest way to start trying the Sub Question Query Engine is running the subquestion.ts file in [examples](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/subquestion.ts).
```bash
npx ts-node subquestion.ts
```
### Tools
SubQuestionQueryEngine is implemented with Tools. The basic idea of Tools is that they are executable options for the large language model. In this case, our SubQuestionQueryEngine relies on QueryEngineTool, which as you guessed it is a tool to run queries on a QueryEngine. This allows us to give the model an option to query different documents for different questions for example. You could also imagine that the SubQuestionQueryEngine could use a Tool that searches for something on the web or gets an answer using Wolfram Alpha.
You can learn more about Tools by taking a look at the LlamaIndex Python documentation https://gpt-index.readthedocs.io/en/latest/core_modules/agent_modules/tools/root.html
## API Reference
- [RetrieverQueryEngine](../../api/classes/RetrieverQueryEngine.md)
- [SubQuestionQueryEngine](../../api/classes/SubQuestionQueryEngine.md)
- [QueryEngineTool](../../api/interfaces/QueryEngineTool.md)
+31
View File
@@ -0,0 +1,31 @@
# Core Modules
LlamaIndex.TS offers several core modules, seperated into high-level modules for quickly getting started, and low-level modules for customizing key components as you need.
## High-Level Modules
- [**Document**](./high_level/documents_and_nodes.md): A document represents a text file, PDF file or other contiguous piece of data.
- [**Node**](./high_level/documents_and_nodes.md): 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.
- [**Reader/Loader**](./high_level/data_loader.md): 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.
- [**Indexes**](./high_level/data_index.md): indexes store the Nodes and the embeddings of those nodes.
- [**QueryEngine**](./high_level/query_engine.md): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected nodes from your Index to give the LLM the context it needs to answer your query.
- [**ChatEngine**](./high_level/chat_engine.md): A ChatEngine helps you build a chatbot that will interact with your Indexes.
## Low Level Module
- [**LLM**](./low_level/llm.md): The LLM class is a unified interface over a large language model provider such as OpenAI GPT-4, Anthropic Claude, or Meta LLaMA. You can subclass it to write a connector to your own large language model.
- [**Embedding**](./low_level/embedding.md): 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
- [**TextSplitter/NodeParser**](./low_level/node_parser.md): 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. The text splitter is used by the NodeParser when splitting `Document`s into `Node`s.
- [**Retriever**](./low_level/retriever.md): 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.
- [**ResponseSynthesizer**](./low_level/response_synthesizer.md): The ResponseSynthesizer is responsible for taking a query string, and using a list of `Node`s to generate a response. This can take many forms, like iterating over all the context and refining an answer, or building a tree of summaries and returning the root summary.
- [**Storage**](./low_level/storage.md): 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.
@@ -0,0 +1 @@
label: Low-Level Modules
@@ -0,0 +1,22 @@
---
sidebar_position: 1
---
# Embedding
The embedding model in LlamaIndex is responsible for creating numerical representations of text. By default, LlamaIndex will use the `text-embedding-ada-002` model from OpenAI.
This can be explicitly set in the `ServiceContext` object.
```typescript
import { OpenAIEmbedding, serviceContextFromDefaults } from "llamaindex";
const openaiEmbeds = new OpenAIEmbedding();
const serviceContext = serviceContextFromDefaults({ embedModel: openaiEmbeds });
```
## API Reference
- [OpenAIEmbedding](../../api/classes/OpenAIEmbedding.md)
- [ServiceContext](../../api/interfaces/ServiceContext.md)
+22
View File
@@ -0,0 +1,22 @@
---
sidebar_position: 0
---
# LLM
The LLM is responsible for reading text and generating natural language responses to queries. By default, LlamaIndex.TS uses `gpt-3.5-turbo`.
The LLM can be explicitly set in the `ServiceContext` object.
```typescript
import { OpenAI, serviceContextFromDefaults } from "llamaindex";
const openaiLLM = new OpenAI({ model: "gpt-3.5-turbo", temperature: 0 });
const serviceContext = serviceContextFromDefaults({ llm: openaiLLM });
```
## API Reference
- [OpenAI](../../api/classes/OpenAI.md)
- [ServiceContext](../../api/interfaces/ServiceContext.md)
@@ -0,0 +1,33 @@
---
sidebar_position: 3
---
# NodeParser
The `NodeParser` in LlamaIndex is responbile for splitting `Document` objects into more manageable `Node` objects. When you call `.fromDocuments()`, the `NodeParser` from the `ServiceContext` is used to do this automatically for you. Alternatively, you can use it to split documents ahead of time.
```typescript
import { Document, SimpleNodeParser } from "llamaindex";
const nodeParser = new SimpleNodeParser();
const nodes = nodeParser.getNodesFromDocuments([
new Document({ text: "I am 10 years old. John is 20 years old." }),
]);
```
## TextSplitter
The underlying text splitter will split text by sentences. It can also be used as a standalone module for splitting raw text.
```typescript
import { SentenceSplitter } from "llamaindex";
const splitter = new SentenceSplitter({ chunkSize: 1 });
const textSplits = splitter.splitText("Hello World");
```
## API Reference
- [SimpleNodeParser](../../api/classes/SimpleNodeParser.md)
- [SentenceSplitter](../../api/classes/SentenceSplitter.md)
@@ -0,0 +1,51 @@
---
sidebar_position: 6
---
# ResponseSynthesizer
The ResponseSynthesizer is responsible for sending the query, nodes, and prompt templates to the LLM to generate a response. There are a few key modes for generating a response:
- `Refine`: "create and refine" an answer by sequentially going through each retrieved text chunk.
This makes a separate LLM call per Node. Good for more detailed answers.
- `CompactAndRefine` (default): "compact" the prompt during each LLM call by stuffing as
many text chunks that can fit within the maximum prompt size. If there are
too many chunks to stuff in one prompt, "create and refine" an answer by going through
multiple compact prompts. The same as `refine`, but should result in less LLM calls.
- `TreeSummarize`: Given a set of text chunks and the query, recursively construct a tree
and return the root node as the response. Good for summarization purposes.
- `SimpleResponseBuilder`: Given a set of text chunks and the query, apply the query to each text
chunk while accumulating the responses into an array. Returns a concatenated string of all
responses. Good for when you need to run the same query separately against each text
chunk.
```typescript
import { NodeWithScore, ResponseSynthesizer, TextNode } from "llamaindex";
const responseSynthesizer = new ResponseSynthesizer();
const nodesWithScore: NodeWithScore[] = [
{
node: new TextNode({ text: "I am 10 years old." }),
score: 1,
},
{
node: new TextNode({ text: "John is 20 years old." }),
score: 0.5,
},
];
const response = await responseSynthesizer.synthesize(
"What age am I?",
nodesWithScore,
);
console.log(response.response);
```
## API Reference
- [ResponseSynthesizer](../../api/classes/ResponseSynthesizer.md)
- [Refine](../../api/classes/Refine.md)
- [CompactAndRefine](../../api/classes/CompactAndRefine.md)
- [TreeSummarize](../../api/classes/TreeSummarize.md)
- [SimpleResponseBuilder](../../api/classes/SimpleResponseBuilder.md)
@@ -0,0 +1,21 @@
---
sidebar_position: 5
---
# Retriever
A retriever in LlamaIndex is what is used to fetch `Node`s from an index using a query string. Aa `VectorIndexRetriever` will fetch the top-k most similar nodes. Meanwhile, a `SummaryIndexRetriever` will fetch all nodes no matter the query.
```typescript
const retriever = vector_index.asRetriever();
retriever.similarityTopK = 3;
// Fetch nodes!
const nodesWithScore = await retriever.retrieve("query string");
```
## API Reference
- [SummaryIndexRetriever](../../api/classes/SummaryIndexRetriever.md)
- [SummaryIndexLLMRetriever](../../api/classes/SummaryIndexLLMRetriever.md)
- [VectorIndexRetriever](../../api/classes/VectorIndexRetriever.md)
@@ -0,0 +1,26 @@
---
sidebar_position: 7
---
# Storage
Storage in LlamaIndex.TS works automatically once you've configured a `StorageContext` object. Just configure the `persistDir` and attach it to an index.
Right now, only saving and loading from disk is supported, with future integrations planned!
```typescript
import { Document, VectorStoreIndex, storageContextFromDefaults } from "./src";
const storageContext = await storageContextFromDefaults({
persistDir: "./storage",
});
const document = new Document({ text: "Test Text" });
const index = await VectorStoreIndex.fromDocuments([document], {
storageContext,
});
```
## API Reference
- [StorageContext](../../api/interfaces/StorageContext.md)
+56
View File
@@ -0,0 +1,56 @@
---
sidebar_position: 2
---
# Starter Tutorial
Once you have [installed LlamaIndex.TS using NPM](installation) and set up your OpenAI key, you're ready to start your first app:
In a new folder:
```bash npm2yarn
npm install typescript
npm install @types/node
npx tsc --init # if needed
```
Create the file `example.ts`. This code will load some example data, create a document, index it (which creates embeddings using OpenAI), and then creates query engine to answer questions about the data.
```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.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
```
Ready to learn more? Check out our NextJS playground at https://llama-playground.vercel.app/. The source is available at https://github.com/run-llama/ts-playground
+156
View File
@@ -0,0 +1,156 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "LlamaIndex.TS",
tagline: "Unleash the power of LLMs over your data in TypeScript",
favicon: "img/favicon.png",
// Set the production url of your site here
url: "https://ts.llamaindex.ai",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "run-llama", // Usually your GitHub org/user name.
projectName: "LlamaIndex.TS", // Usually your repo name.
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en", "fr"],
},
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// editUrl:
// "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
remarkPlugins: [
[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }],
],
},
blog: false,
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: "img/favicon.png", // TODO change this
navbar: {
title: "LlamaIndex.TS",
logo: {
alt: "LlamaIndex.TS",
src: "img/favicon.png",
},
items: [
{
type: "docSidebar",
sidebarId: "mySidebar",
position: "left",
label: "Docs",
},
{
type: "localeDropdown",
position: "left",
},
{
href: "https://github.com/run-llama/LlamaIndexTS",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "API",
to: "/api",
},
],
},
{
title: "Community",
items: [
{
label: "Discord",
href: "https://discord.com/invite/eN6D2HQ4aX",
},
{
label: "Twitter",
href: "https://twitter.com/LlamaIndex",
},
],
},
{
title: "More",
items: [
{
label: "GitHub",
href: "https://github.com/run-llama/LlamaIndexTS",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} LlamaIndex. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
algolia: {
// The application ID provided by Algolia
appId: "DYKPM6G4CX",
// Public API key: it is safe to commit it
apiKey: "c4ff3789f20bb72a5d735082aef17719",
indexName: "ts-llamaindex",
// Optional: see doc section below
contextualSearch: true,
},
}),
plugins: [
[
"docusaurus-plugin-typedoc",
{
entryPoints: ["../../packages/core/src/index.ts"],
tsconfig: "../../packages/core/tsconfig.json",
readme: "none",
sourceLinkTemplate:
"https://github.com/run-llama/LlamaIndexTS/blob/{gitRevision}/{path}#L{line}",
sidebar: {
position: 6,
},
},
],
],
};
module.exports = config;
@@ -0,0 +1 @@
../../../../docs/_static
@@ -0,0 +1,2 @@
label: "API"
position: 6
@@ -0,0 +1,318 @@
---
id: "Anthropic"
title: "Class: Anthropic"
sidebar_label: "Anthropic"
sidebar_position: 0
custom_edit_url: null
---
Anthropic LLM implementation
## Implements
- [`LLM`](../interfaces/LLM.md)
## Constructors
### constructor
**new Anthropic**(`init?`)
#### Parameters
| Name | Type |
| :------ | :-------------------------------------- |
| `init?` | `Partial`<[`Anthropic`](Anthropic.md)\> |
#### Defined in
[packages/core/src/llm/LLM.ts:667](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L667)
## Properties
### apiKey
`Optional` **apiKey**: `string` = `undefined`
#### Defined in
[packages/core/src/llm/LLM.ts:660](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L660)
---
### callbackManager
`Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
#### Defined in
[packages/core/src/llm/LLM.ts:665](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L665)
---
### hasStreaming
**hasStreaming**: `boolean` = `true`
#### Implementation of
[LLM](../interfaces/LLM.md).[hasStreaming](../interfaces/LLM.md#hasstreaming)
#### Defined in
[packages/core/src/llm/LLM.ts:651](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L651)
---
### maxRetries
**maxRetries**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:661](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L661)
---
### maxTokens
`Optional` **maxTokens**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:657](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L657)
---
### model
**model**: `"claude-2"` \| `"claude-instant-1"`
#### Defined in
[packages/core/src/llm/LLM.ts:654](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L654)
---
### session
**session**: `AnthropicSession`
#### Defined in
[packages/core/src/llm/LLM.ts:663](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L663)
---
### temperature
**temperature**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:655](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L655)
---
### timeout
`Optional` **timeout**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:662](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L662)
---
### topP
**topP**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:656](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L656)
## Accessors
### metadata
`get` **metadata**(): `Object`
#### Returns
`Object`
| Name | Type |
| :-------------- | :----------------------------------- |
| `contextWindow` | `number` |
| `maxTokens` | `undefined` \| `number` |
| `model` | `"claude-2"` \| `"claude-instant-1"` |
| `temperature` | `number` |
| `tokenizer` | `undefined` |
| `topP` | `number` |
#### Implementation of
[LLM](../interfaces/LLM.md).[metadata](../interfaces/LLM.md#metadata)
#### Defined in
[packages/core/src/llm/LLM.ts:691](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L691)
## Methods
### chat
**chat**<`T`, `R`\>(`messages`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
Get a chat response from the LLM
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
#### Parameters
| Name | Type | Description |
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | The return type of chat() and complete() are set by the "streaming" parameter being set to True. |
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
| `streaming?` | `T` | - |
#### Returns
`Promise`<`R`\>
#### Implementation of
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
#### Defined in
[packages/core/src/llm/LLM.ts:719](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L719)
---
### complete
**complete**<`T`, `R`\>(`prompt`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
Get a prompt completion from the LLM
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
#### Parameters
| Name | Type | Description |
| :------------- | :-------------------------------- | :--------------------- |
| `prompt` | `string` | the prompt to complete |
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
| `streaming?` | `T` | - |
#### Returns
`Promise`<`R`\>
#### Implementation of
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
#### Defined in
[packages/core/src/llm/LLM.ts:776](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L776)
---
### mapMessagesToPrompt
**mapMessagesToPrompt**(`messages`): `string`
#### Parameters
| Name | Type |
| :--------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
#### Returns
`string`
#### Defined in
[packages/core/src/llm/LLM.ts:702](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L702)
---
### streamChat
`Protected` **streamChat**(`messages`, `parentEvent?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
#### Parameters
| Name | Type |
| :------------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`AsyncGenerator`<`string`, `void`, `unknown`\>
#### Defined in
[packages/core/src/llm/LLM.ts:751](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L751)
---
### streamComplete
`Protected` **streamComplete**(`prompt`, `parentEvent?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
#### Parameters
| Name | Type |
| :------------- | :-------------------------------- |
| `prompt` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`AsyncGenerator`<`string`, `void`, `unknown`\>
#### Defined in
[packages/core/src/llm/LLM.ts:794](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L794)
---
### tokens
**tokens**(`messages`): `number`
Calculates the number of tokens needed for the given chat messages
#### Parameters
| Name | Type |
| :--------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
#### Returns
`number`
#### Implementation of
[LLM](../interfaces/LLM.md).[tokens](../interfaces/LLM.md#tokens)
#### Defined in
[packages/core/src/llm/LLM.ts:687](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L687)
@@ -0,0 +1,289 @@
---
id: "BaseDocumentStore"
title: "Class: BaseDocumentStore"
sidebar_label: "BaseDocumentStore"
sidebar_position: 0
custom_edit_url: null
---
## Constructors
### constructor
**new BaseDocumentStore**()
## Methods
### addDocuments
`Abstract` **addDocuments**(`docs`, `allowUpdate`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------------ | :------------------------------------------------------- |
| `docs` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
| `allowUpdate` | `boolean` |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L27)
---
### deleteDocument
`Abstract` **deleteDocument**(`docId`, `raiseError`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :----------- | :-------- |
| `docId` | `string` |
| `raiseError` | `boolean` |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L34)
---
### deleteRefDoc
`Abstract` **deleteRefDoc**(`refDocId`, `raiseError`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :----------- | :-------- |
| `refDocId` | `string` |
| `raiseError` | `boolean` |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L48)
---
### docs
`Abstract` **docs**(): `Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
#### Returns
`Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L25)
---
### documentExists
`Abstract` **documentExists**(`docId`): `Promise`<`boolean`\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `docId` | `string` |
#### Returns
`Promise`<`boolean`\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L36)
---
### getAllRefDocInfo
`Abstract` **getAllRefDocInfo**(): `Promise`<`undefined` \| `Record`<`string`, [`RefDocInfo`](../interfaces/RefDocInfo.md)\>\>
#### Returns
`Promise`<`undefined` \| `Record`<`string`, [`RefDocInfo`](../interfaces/RefDocInfo.md)\>\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L44)
---
### getDocument
`Abstract` **getDocument**(`docId`, `raiseError`): `Promise`<`undefined` \| [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
#### Parameters
| Name | Type |
| :----------- | :-------- |
| `docId` | `string` |
| `raiseError` | `boolean` |
#### Returns
`Promise`<`undefined` \| [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L29)
---
### getDocumentHash
`Abstract` **getDocumentHash**(`docId`): `Promise`<`undefined` \| `string`\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `docId` | `string` |
#### Returns
`Promise`<`undefined` \| `string`\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L41)
---
### getNode
**getNode**(`nodeId`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
#### Parameters
| Name | Type | Default value |
| :----------- | :-------- | :------------ |
| `nodeId` | `string` | `undefined` |
| `raiseError` | `boolean` | `true` |
#### Returns
`Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L57)
---
### getNodeDict
**getNodeDict**(`nodeIdDict`): `Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
#### Parameters
| Name | Type |
| :----------- | :------- |
| `nodeIdDict` | `Object` |
#### Returns
`Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L65)
---
### getNodes
**getNodes**(`nodeIds`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
#### Parameters
| Name | Type | Default value |
| :----------- | :--------- | :------------ |
| `nodeIds` | `string`[] | `undefined` |
| `raiseError` | `boolean` | `true` |
#### Returns
`Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L51)
---
### getRefDocInfo
`Abstract` **getRefDocInfo**(`refDocId`): `Promise`<`undefined` \| [`RefDocInfo`](../interfaces/RefDocInfo.md)\>
#### Parameters
| Name | Type |
| :--------- | :------- |
| `refDocId` | `string` |
#### Returns
`Promise`<`undefined` \| [`RefDocInfo`](../interfaces/RefDocInfo.md)\>
#### Defined in
[packages/core/src/storage/docStore/types.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L46)
---
### persist
**persist**(`persistPath?`, `fs?`): `void`
#### Parameters
| Name | Type | Default value |
| :------------ | :-------------------------------------------------------- | :------------------- |
| `persistPath` | `string` | `defaultPersistPath` |
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `undefined` |
#### Returns
`void`
#### Defined in
[packages/core/src/storage/docStore/types.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L17)
---
### setDocumentHash
`Abstract` **setDocumentHash**(`docId`, `docHash`): `void`
#### Parameters
| Name | Type |
| :-------- | :------- |
| `docId` | `string` |
| `docHash` | `string` |
#### Returns
`void`
#### Defined in
[packages/core/src/storage/docStore/types.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L39)
@@ -0,0 +1,83 @@
---
id: "BaseEmbedding"
title: "Class: BaseEmbedding"
sidebar_label: "BaseEmbedding"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- **`BaseEmbedding`**
↳ [`MultiModalEmbedding`](MultiModalEmbedding.md)
↳ [`OpenAIEmbedding`](OpenAIEmbedding.md)
## Constructors
### constructor
**new BaseEmbedding**()
## Methods
### getQueryEmbedding
`Abstract` **getQueryEmbedding**(`query`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `query` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Defined in
[packages/core/src/embeddings/types.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L23)
---
### getTextEmbedding
`Abstract` **getTextEmbedding**(`text`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :----- | :------- |
| `text` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Defined in
[packages/core/src/embeddings/types.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L22)
---
### similarity
**similarity**(`embedding1`, `embedding2`, `mode?`): `number`
#### Parameters
| Name | Type | Default value |
| :----------- | :--------------------------------------------- | :----------------------- |
| `embedding1` | `number`[] | `undefined` |
| `embedding2` | `number`[] | `undefined` |
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
#### Returns
`number`
#### Defined in
[packages/core/src/embeddings/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L14)
@@ -0,0 +1,164 @@
---
id: "BaseInMemoryKVStore"
title: "Class: BaseInMemoryKVStore"
sidebar_label: "BaseInMemoryKVStore"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`BaseKVStore`](BaseKVStore.md)
**`BaseInMemoryKVStore`**
## Constructors
### constructor
**new BaseInMemoryKVStore**()
#### Inherited from
[BaseKVStore](BaseKVStore.md).[constructor](BaseKVStore.md#constructor)
## Methods
### delete
`Abstract` **delete**(`key`, `collection?`): `Promise`<`boolean`\>
#### Parameters
| Name | Type |
| :------------ | :------- |
| `key` | `string` |
| `collection?` | `string` |
#### Returns
`Promise`<`boolean`\>
#### Inherited from
[BaseKVStore](BaseKVStore.md).[delete](BaseKVStore.md#delete)
#### Defined in
[packages/core/src/storage/kvStore/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L14)
---
### get
`Abstract` **get**(`key`, `collection?`): `Promise`<`StoredValue`\>
#### Parameters
| Name | Type |
| :------------ | :------- |
| `key` | `string` |
| `collection?` | `string` |
#### Returns
`Promise`<`StoredValue`\>
#### Inherited from
[BaseKVStore](BaseKVStore.md).[get](BaseKVStore.md#get)
#### Defined in
[packages/core/src/storage/kvStore/types.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L12)
---
### getAll
`Abstract` **getAll**(`collection?`): `Promise`<`Record`<`string`, `StoredValue`\>\>
#### Parameters
| Name | Type |
| :------------ | :------- |
| `collection?` | `string` |
#### Returns
`Promise`<`Record`<`string`, `StoredValue`\>\>
#### Inherited from
[BaseKVStore](BaseKVStore.md).[getAll](BaseKVStore.md#getall)
#### Defined in
[packages/core/src/storage/kvStore/types.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L13)
---
### persist
`Abstract` **persist**(`persistPath`, `fs?`): `void`
#### Parameters
| Name | Type |
| :------------ | :-------------------------------------------------------- |
| `persistPath` | `string` |
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
#### Returns
`void`
#### Defined in
[packages/core/src/storage/kvStore/types.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L18)
---
### put
`Abstract` **put**(`key`, `val`, `collection?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------------ | :------------------------- |
| `key` | `string` |
| `val` | `Record`<`string`, `any`\> |
| `collection?` | `string` |
#### Returns
`Promise`<`void`\>
#### Inherited from
[BaseKVStore](BaseKVStore.md).[put](BaseKVStore.md#put)
#### Defined in
[packages/core/src/storage/kvStore/types.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L7)
---
### fromPersistPath
`Static` **fromPersistPath**(`persistPath`): [`BaseInMemoryKVStore`](BaseInMemoryKVStore.md)
#### Parameters
| Name | Type |
| :------------ | :------- |
| `persistPath` | `string` |
#### Returns
[`BaseInMemoryKVStore`](BaseInMemoryKVStore.md)
#### Defined in
[packages/core/src/storage/kvStore/types.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L19)
@@ -0,0 +1,218 @@
---
id: "BaseIndex"
title: "Class: BaseIndex<T>"
sidebar_label: "BaseIndex"
sidebar_position: 0
custom_edit_url: null
---
Indexes are the data structure that we store our nodes and embeddings in so
they can be retrieved for our queries.
## Type parameters
| Name |
| :--- |
| `T` |
## Hierarchy
- **`BaseIndex`**
↳ [`KeywordTableIndex`](KeywordTableIndex.md)
↳ [`SummaryIndex`](SummaryIndex.md)
↳ [`VectorStoreIndex`](VectorStoreIndex.md)
## Constructors
### constructor
**new BaseIndex**<`T`\>(`init`)
#### Type parameters
| Name |
| :--- |
| `T` |
#### Parameters
| Name | Type |
| :----- | :------------------------------------------------------ |
| `init` | [`BaseIndexInit`](../interfaces/BaseIndexInit.md)<`T`\> |
#### Defined in
[packages/core/src/indices/BaseIndex.ts:161](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L161)
## Properties
### docStore
**docStore**: [`BaseDocumentStore`](BaseDocumentStore.md)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L156)
---
### indexStore
`Optional` **indexStore**: [`BaseIndexStore`](BaseIndexStore.md)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:158](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L158)
---
### indexStruct
**indexStruct**: `T`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L159)
---
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:154](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L154)
---
### storageContext
**storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L155)
---
### vectorStore
`Optional` **vectorStore**: [`VectorStore`](../interfaces/VectorStore.md)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L157)
## Methods
### asQueryEngine
`Abstract` **asQueryEngine**(`options?`): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
Create a new query engine from the index. It will also create a retriever
and response synthezier if they are not provided.
#### Parameters
| Name | Type | Description |
| :----------------------------- | :------------------------------------------------ | :--------------------------------------------------------------- |
| `options?` | `Object` | you can supply your own custom Retriever and ResponseSynthesizer |
| `options.responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) | - |
| `options.retriever?` | [`BaseRetriever`](../interfaces/BaseRetriever.md) | - |
#### Returns
[`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:181](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L181)
---
### asRetriever
`Abstract` **asRetriever**(`options?`): [`BaseRetriever`](../interfaces/BaseRetriever.md)
Create a new retriever from the index.
#### Parameters
| Name | Type |
| :--------- | :---- |
| `options?` | `any` |
#### Returns
[`BaseRetriever`](../interfaces/BaseRetriever.md)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:174](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L174)
---
### deleteRefDoc
`Abstract` **deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :-------------------- | :-------- |
| `refDocId` | `string` |
| `deleteFromDocStore?` | `boolean` |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/indices/BaseIndex.ts:199](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L199)
---
### insert
**insert**(`document`): `Promise`<`void`\>
Insert a document into the index.
#### Parameters
| Name | Type |
| :--------- | :----------------------------------------------------- |
| `document` | [`Document`](Document.md)<[`Metadata`](../#metadata)\> |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/indices/BaseIndex.ts:190](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L190)
---
### insertNodes
`Abstract` **insertNodes**(`nodes`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------------------------------------------------------- |
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/indices/BaseIndex.ts:198](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L198)
@@ -0,0 +1,108 @@
---
id: "BaseIndexStore"
title: "Class: BaseIndexStore"
sidebar_label: "BaseIndexStore"
sidebar_position: 0
custom_edit_url: null
---
## Constructors
### constructor
**new BaseIndexStore**()
## Methods
### addIndexStruct
`Abstract` **addIndexStruct**(`indexStruct`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------------ | :------------------------------ |
| `indexStruct` | [`IndexStruct`](IndexStruct.md) |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/storage/indexStore/types.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/types.ts#L13)
---
### deleteIndexStruct
`Abstract` **deleteIndexStruct**(`key`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :---- | :------- |
| `key` | `string` |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/storage/indexStore/types.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/types.ts#L15)
---
### getIndexStruct
`Abstract` **getIndexStruct**(`structId?`): `Promise`<`undefined` \| [`IndexStruct`](IndexStruct.md)\>
#### Parameters
| Name | Type |
| :---------- | :------- |
| `structId?` | `string` |
#### Returns
`Promise`<`undefined` \| [`IndexStruct`](IndexStruct.md)\>
#### Defined in
[packages/core/src/storage/indexStore/types.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/types.ts#L17)
---
### getIndexStructs
`Abstract` **getIndexStructs**(): `Promise`<[`IndexStruct`](IndexStruct.md)[]\>
#### Returns
`Promise`<[`IndexStruct`](IndexStruct.md)[]\>
#### Defined in
[packages/core/src/storage/indexStore/types.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/types.ts#L11)
---
### persist
**persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
#### Parameters
| Name | Type | Default value |
| :------------ | :-------------------------------------------------------- | :------------------- |
| `persistPath` | `string` | `defaultPersistPath` |
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `undefined` |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/storage/indexStore/types.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/indexStore/types.ts#L19)
@@ -0,0 +1,105 @@
---
id: "BaseKVStore"
title: "Class: BaseKVStore"
sidebar_label: "BaseKVStore"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- **`BaseKVStore`**
↳ [`SimpleKVStore`](SimpleKVStore.md)
↳ [`BaseInMemoryKVStore`](BaseInMemoryKVStore.md)
## Constructors
### constructor
**new BaseKVStore**()
## Methods
### delete
`Abstract` **delete**(`key`, `collection?`): `Promise`<`boolean`\>
#### Parameters
| Name | Type |
| :------------ | :------- |
| `key` | `string` |
| `collection?` | `string` |
#### Returns
`Promise`<`boolean`\>
#### Defined in
[packages/core/src/storage/kvStore/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L14)
---
### get
`Abstract` **get**(`key`, `collection?`): `Promise`<`StoredValue`\>
#### Parameters
| Name | Type |
| :------------ | :------- |
| `key` | `string` |
| `collection?` | `string` |
#### Returns
`Promise`<`StoredValue`\>
#### Defined in
[packages/core/src/storage/kvStore/types.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L12)
---
### getAll
`Abstract` **getAll**(`collection?`): `Promise`<`Record`<`string`, `StoredValue`\>\>
#### Parameters
| Name | Type |
| :------------ | :------- |
| `collection?` | `string` |
#### Returns
`Promise`<`Record`<`string`, `StoredValue`\>\>
#### Defined in
[packages/core/src/storage/kvStore/types.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L13)
---
### put
`Abstract` **put**(`key`, `val`, `collection?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------------ | :------------------------- |
| `key` | `string` |
| `val` | `Record`<`string`, `any`\> |
| `collection?` | `string` |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/storage/kvStore/types.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/kvStore/types.ts#L7)
@@ -0,0 +1,320 @@
---
id: "BaseNode"
title: "Class: BaseNode<T>"
sidebar_label: "BaseNode"
sidebar_position: 0
custom_edit_url: null
---
Generic abstract class for retrievable nodes
## Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------- |
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
## Hierarchy
- **`BaseNode`**
↳ [`TextNode`](TextNode.md)
## Constructors
### constructor
**new BaseNode**<`T`\>(`init?`)
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------- |
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
#### Parameters
| Name | Type |
| :------ | :------------------------------------------ |
| `init?` | `Partial`<[`BaseNode`](BaseNode.md)<`T`\>\> |
#### Defined in
[packages/core/src/Node.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L60)
## Properties
### embedding
`Optional` **embedding**: `number`[]
#### Defined in
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
---
### excludedEmbedMetadataKeys
**excludedEmbedMetadataKeys**: `string`[] = `[]`
#### Defined in
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
---
### excludedLlmMetadataKeys
**excludedLlmMetadataKeys**: `string`[] = `[]`
#### Defined in
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
---
### hash
**hash**: `string` = `""`
#### Defined in
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
---
### id\_
**id\_**: `string`
The unique ID of the Node/Document. The trailing underscore is here
to avoid collisions with the id keyword in Python.
Set to a UUID by default.
#### Defined in
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
---
### metadata
**metadata**: `T`
#### Defined in
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
---
### relationships
**relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
#### Defined in
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
## Accessors
### childNodes
`get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
#### Defined in
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
---
### nextNode
`get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Defined in
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
---
### parentNode
`get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Defined in
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
---
### prevNode
`get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Defined in
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
---
### sourceNode
`get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Defined in
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
## Methods
### asRelatedNodeInfo
**asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Defined in
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
---
### generateHash
`Abstract` **generateHash**(): `string`
#### Returns
`string`
#### Defined in
[packages/core/src/Node.ts:124](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L124)
---
### getContent
`Abstract` **getContent**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------------- | :----------------------------------------- |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Defined in
[packages/core/src/Node.ts:66](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L66)
---
### getEmbedding
**getEmbedding**(): `number`[]
#### Returns
`number`[]
#### Defined in
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
---
### getMetadataStr
`Abstract` **getMetadataStr**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------------- | :----------------------------------------- |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Defined in
[packages/core/src/Node.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L67)
---
### getType
`Abstract` **getType**(): [`ObjectType`](../enums/ObjectType.md)
#### Returns
[`ObjectType`](../enums/ObjectType.md)
#### Defined in
[packages/core/src/Node.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L64)
---
### setContent
`Abstract` **setContent**(`value`): `void`
#### Parameters
| Name | Type |
| :------ | :---- |
| `value` | `any` |
#### Returns
`void`
#### Defined in
[packages/core/src/Node.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L68)
---
### toJSON
**toJSON**(): `Record`<`string`, `any`\>
Used with built in JSON.stringify
#### Returns
`Record`<`string`, `any`\>
#### Defined in
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
@@ -0,0 +1,83 @@
---
id: "CallbackManager"
title: "Class: CallbackManager"
sidebar_label: "CallbackManager"
sidebar_position: 0
custom_edit_url: null
---
## Implements
- `CallbackManagerMethods`
## Constructors
### constructor
**new CallbackManager**(`handlers?`)
#### Parameters
| Name | Type |
| :---------- | :----------------------- |
| `handlers?` | `CallbackManagerMethods` |
#### Defined in
[packages/core/src/callbacks/CallbackManager.ts:86](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/callbacks/CallbackManager.ts#L86)
## Properties
### onLLMStream
`Optional` **onLLMStream**: (`params`: [`StreamCallbackResponse`](../interfaces/StreamCallbackResponse.md)) => `void` \| `Promise`<`void`\>
#### Type declaration
▸ (`params`): `void` \| `Promise`<`void`\>
##### Parameters
| Name | Type |
| :------- | :------------------------------------------------------------------ |
| `params` | [`StreamCallbackResponse`](../interfaces/StreamCallbackResponse.md) |
##### Returns
`void` \| `Promise`<`void`\>
#### Implementation of
CallbackManagerMethods.onLLMStream
#### Defined in
[packages/core/src/callbacks/CallbackManager.ts:83](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/callbacks/CallbackManager.ts#L83)
---
### onRetrieve
`Optional` **onRetrieve**: (`params`: [`RetrievalCallbackResponse`](../interfaces/RetrievalCallbackResponse.md)) => `void` \| `Promise`<`void`\>
#### Type declaration
▸ (`params`): `void` \| `Promise`<`void`\>
##### Parameters
| Name | Type |
| :------- | :------------------------------------------------------------------------ |
| `params` | [`RetrievalCallbackResponse`](../interfaces/RetrievalCallbackResponse.md) |
##### Returns
`void` \| `Promise`<`void`\>
#### Implementation of
CallbackManagerMethods.onRetrieve
#### Defined in
[packages/core/src/callbacks/CallbackManager.ts:84](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/callbacks/CallbackManager.ts#L84)
@@ -0,0 +1,251 @@
---
id: "ClipEmbedding"
title: "Class: ClipEmbedding"
sidebar_label: "ClipEmbedding"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`MultiModalEmbedding`](MultiModalEmbedding.md)
**`ClipEmbedding`**
## Constructors
### constructor
**new ClipEmbedding**()
#### Inherited from
[MultiModalEmbedding](MultiModalEmbedding.md).[constructor](MultiModalEmbedding.md#constructor)
## Properties
### modelType
**modelType**: [`ClipEmbeddingModelType`](../enums/ClipEmbeddingModelType.md) = `ClipEmbeddingModelType.XENOVA_CLIP_VIT_BASE_PATCH16`
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L11)
---
### processor
`Private` **processor**: `any`
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L15)
---
### textModel
`Private` **textModel**: `any`
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L17)
---
### tokenizer
`Private` **tokenizer**: `any`
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L14)
---
### visionModel
`Private` **visionModel**: `any`
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L16)
## Methods
### getImageEmbedding
**getImageEmbedding**(`image`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :--------------------------- |
| `image` | [`ImageType`](../#imagetype) |
#### Returns
`Promise`<`number`[]\>
#### Overrides
[MultiModalEmbedding](MultiModalEmbedding.md).[getImageEmbedding](MultiModalEmbedding.md#getimageembedding)
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L61)
---
### getImageEmbeddings
**getImageEmbeddings**(`images`): `Promise`<`number`[][]\>
#### Parameters
| Name | Type |
| :------- | :----------------------------- |
| `images` | [`ImageType`](../#imagetype)[] |
#### Returns
`Promise`<`number`[][]\>
#### Inherited from
[MultiModalEmbedding](MultiModalEmbedding.md).[getImageEmbeddings](MultiModalEmbedding.md#getimageembeddings)
#### Defined in
[packages/core/src/embeddings/MultiModalEmbedding.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/MultiModalEmbedding.ts#L11)
---
### getProcessor
**getProcessor**(): `Promise`<`any`\>
#### Returns
`Promise`<`any`\>
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L27)
---
### getQueryEmbedding
**getQueryEmbedding**(`query`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `query` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Overrides
[MultiModalEmbedding](MultiModalEmbedding.md).[getQueryEmbedding](MultiModalEmbedding.md#getqueryembedding)
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L76)
---
### getTextEmbedding
**getTextEmbedding**(`text`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :----- | :------- |
| `text` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Overrides
[MultiModalEmbedding](MultiModalEmbedding.md).[getTextEmbedding](MultiModalEmbedding.md#gettextembedding)
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L68)
---
### getTextModel
**getTextModel**(): `Promise`<`any`\>
#### Returns
`Promise`<`any`\>
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L48)
---
### getTokenizer
**getTokenizer**(): `Promise`<`any`\>
#### Returns
`Promise`<`any`\>
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L19)
---
### getVisionModel
**getVisionModel**(): `Promise`<`any`\>
#### Returns
`Promise`<`any`\>
#### Defined in
[packages/core/src/embeddings/ClipEmbedding.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/ClipEmbedding.ts#L35)
---
### similarity
**similarity**(`embedding1`, `embedding2`, `mode?`): `number`
#### Parameters
| Name | Type | Default value |
| :----------- | :--------------------------------------------- | :----------------------- |
| `embedding1` | `number`[] | `undefined` |
| `embedding2` | `number`[] | `undefined` |
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
#### Returns
`number`
#### Inherited from
[MultiModalEmbedding](MultiModalEmbedding.md).[similarity](MultiModalEmbedding.md#similarity)
#### Defined in
[packages/core/src/embeddings/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L14)
@@ -0,0 +1,134 @@
---
id: "CompactAndRefine"
title: "Class: CompactAndRefine"
sidebar_label: "CompactAndRefine"
sidebar_position: 0
custom_edit_url: null
---
CompactAndRefine is a slight variation of Refine that first compacts the text chunks into the smallest possible number of chunks.
## Hierarchy
- [`Refine`](Refine.md)
**`CompactAndRefine`**
## Constructors
### constructor
**new CompactAndRefine**(`serviceContext`, `textQATemplate?`, `refineTemplate?`)
#### Parameters
| Name | Type |
| :---------------- | :-------------------------------------------------- |
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
| `textQATemplate?` | (`__namedParameters`: `Object`) => `string` |
| `refineTemplate?` | (`__namedParameters`: `Object`) => `string` |
#### Inherited from
[Refine](Refine.md).[constructor](Refine.md#constructor)
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:82](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L82)
## Properties
### refineTemplate
**refineTemplate**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Inherited from
[Refine](Refine.md).[refineTemplate](Refine.md#refinetemplate)
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L80)
---
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
[Refine](Refine.md).[serviceContext](Refine.md#servicecontext)
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L78)
---
### textQATemplate
**textQATemplate**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Inherited from
[Refine](Refine.md).[textQATemplate](Refine.md#textqatemplate)
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:79](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L79)
## Methods
### getResponse
**getResponse**(`query`, `textChunks`, `parentEvent?`, `prevResponse?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :-------------- | :-------------------------------- |
| `query` | `string` |
| `textChunks` | `string`[] |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
| `prevResponse?` | `string` |
#### Returns
`Promise`<`string`\>
#### Overrides
[Refine](Refine.md).[getResponse](Refine.md#getresponse)
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:185](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L185)
@@ -0,0 +1,170 @@
---
id: "CondenseQuestionChatEngine"
title: "Class: CondenseQuestionChatEngine"
sidebar_label: "CondenseQuestionChatEngine"
sidebar_position: 0
custom_edit_url: null
---
CondenseQuestionChatEngine is used in conjunction with a Index (for example VectorStoreIndex).
It does two steps on taking a user's chat message: first, it condenses the chat message
with the previous chat history into a question with more context.
Then, it queries the underlying Index using the new question with context and returns
the response.
CondenseQuestionChatEngine performs well when the input is primarily questions about the
underlying data. It performs less well when the chat messages are not questions about the
data, or are very referential to previous context.
## Implements
- [`ChatEngine`](../interfaces/ChatEngine.md)
## Constructors
### constructor
**new CondenseQuestionChatEngine**(`init`)
#### Parameters
| Name | Type |
| :---------------------------- | :---------------------------------------------------- |
| `init` | `Object` |
| `init.chatHistory` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `init.condenseMessagePrompt?` | (`__namedParameters`: `Object`) => `string` |
| `init.queryEngine` | [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md) |
| `init.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Defined in
[packages/core/src/ChatEngine.ts:122](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L122)
## Properties
### chatHistory
**chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
#### Defined in
[packages/core/src/ChatEngine.ts:118](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L118)
---
### condenseMessagePrompt
**condenseMessagePrompt**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Defined in
[packages/core/src/ChatEngine.ts:120](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L120)
---
### queryEngine
**queryEngine**: [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
#### Defined in
[packages/core/src/ChatEngine.ts:117](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L117)
---
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[packages/core/src/ChatEngine.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L119)
## Methods
### chat
**chat**<`T`, `R`\>(`message`, `chatHistory?`, `streaming?`): `Promise`<`R`\>
Send message along with the class's current chat history to the LLM.
#### Type parameters
| Name | Type |
| :--- | :---------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`Response`](Response.md) |
#### Parameters
| Name | Type | Description |
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------- |
| `message` | [`MessageContent`](../#messagecontent) | |
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
| `streaming?` | `T` | optional streaming flag, which auto-sets the return value if True. |
#### Returns
`Promise`<`R`\>
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[chat](../interfaces/ChatEngine.md#chat)
#### Defined in
[packages/core/src/ChatEngine.ts:147](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L147)
---
### condenseQuestion
`Private` **condenseQuestion**(`chatHistory`, `question`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
#### Parameters
| Name | Type |
| :------------ | :---------------------------------------------- |
| `chatHistory` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `question` | `string` |
#### Returns
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
#### Defined in
[packages/core/src/ChatEngine.ts:136](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L136)
---
### reset
**reset**(): `void`
Resets the chat history so that it's empty.
#### Returns
`void`
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
#### Defined in
[packages/core/src/ChatEngine.ts:169](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L169)
@@ -0,0 +1,142 @@
---
id: "ContextChatEngine"
title: "Class: ContextChatEngine"
sidebar_label: "ContextChatEngine"
sidebar_position: 0
custom_edit_url: null
---
ContextChatEngine uses the Index to get the appropriate context for each query.
The context is stored in the system prompt, and the chat history is preserved,
ideally allowing the appropriate context to be surfaced for each query.
## Implements
- [`ChatEngine`](../interfaces/ChatEngine.md)
## Constructors
### constructor
**new ContextChatEngine**(`init`)
#### Parameters
| Name | Type |
| :-------------------------- | :------------------------------------------------------------------ |
| `init` | `Object` |
| `init.chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `init.chatModel?` | [`LLM`](../interfaces/LLM.md) |
| `init.contextSystemPrompt?` | (`__namedParameters`: `Object`) => `string` |
| `init.nodePostprocessors?` | [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[] |
| `init.retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
#### Defined in
[packages/core/src/ChatEngine.ts:243](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L243)
## Properties
### chatHistory
**chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
#### Defined in
[packages/core/src/ChatEngine.ts:240](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L240)
---
### chatModel
**chatModel**: [`LLM`](../interfaces/LLM.md)
#### Defined in
[packages/core/src/ChatEngine.ts:239](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L239)
---
### contextGenerator
**contextGenerator**: [`ContextGenerator`](../interfaces/ContextGenerator.md)
#### Defined in
[packages/core/src/ChatEngine.ts:241](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L241)
## Methods
### chat
**chat**<`T`, `R`\>(`message`, `chatHistory?`, `streaming?`): `Promise`<`R`\>
Send message along with the class's current chat history to the LLM.
#### Type parameters
| Name | Type |
| :--- | :---------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`Response`](Response.md) |
#### Parameters
| Name | Type | Description |
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------- |
| `message` | [`MessageContent`](../#messagecontent) | |
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
| `streaming?` | `T` | optional streaming flag, which auto-sets the return value if True. |
#### Returns
`Promise`<`R`\>
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[chat](../interfaces/ChatEngine.md#chat)
#### Defined in
[packages/core/src/ChatEngine.ts:259](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L259)
---
### reset
**reset**(): `void`
Resets the chat history so that it's empty.
#### Returns
`void`
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
#### Defined in
[packages/core/src/ChatEngine.ts:336](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L336)
---
### streamChat
`Protected` **streamChat**(`message`, `chatHistory?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
#### Parameters
| Name | Type |
| :------------- | :---------------------------------------------- |
| `message` | [`MessageContent`](../#messagecontent) |
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
#### Returns
`AsyncGenerator`<`string`, `void`, `unknown`\>
#### Defined in
[packages/core/src/ChatEngine.ts:300](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L300)
@@ -0,0 +1,119 @@
---
id: "DefaultContextGenerator"
title: "Class: DefaultContextGenerator"
sidebar_label: "DefaultContextGenerator"
sidebar_position: 0
custom_edit_url: null
---
## Implements
- [`ContextGenerator`](../interfaces/ContextGenerator.md)
## Constructors
### constructor
**new DefaultContextGenerator**(`init`)
#### Parameters
| Name | Type |
| :-------------------------- | :------------------------------------------------------------------ |
| `init` | `Object` |
| `init.contextSystemPrompt?` | (`__namedParameters`: `Object`) => `string` |
| `init.nodePostprocessors?` | [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[] |
| `init.retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
#### Defined in
[packages/core/src/ChatEngine.ts:188](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L188)
## Properties
### contextSystemPrompt
**contextSystemPrompt**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Defined in
[packages/core/src/ChatEngine.ts:185](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L185)
---
### nodePostprocessors
**nodePostprocessors**: [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[]
#### Defined in
[packages/core/src/ChatEngine.ts:186](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L186)
---
### retriever
**retriever**: [`BaseRetriever`](../interfaces/BaseRetriever.md)
#### Defined in
[packages/core/src/ChatEngine.ts:184](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L184)
## Methods
### applyNodePostprocessors
`Private` **applyNodePostprocessors**(`nodes`): [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
#### Parameters
| Name | Type |
| :------ | :------------------------------------------------------------------------------- |
| `nodes` | [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[] |
#### Returns
[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
#### Defined in
[packages/core/src/ChatEngine.ts:199](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L199)
---
### generate
**generate**(`message`, `parentEvent?`): `Promise`<[`Context`](../interfaces/Context.md)\>
#### Parameters
| Name | Type |
| :------------- | :-------------------------------- |
| `message` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<[`Context`](../interfaces/Context.md)\>
#### Implementation of
[ContextGenerator](../interfaces/ContextGenerator.md).[generate](../interfaces/ContextGenerator.md#generate)
#### Defined in
[packages/core/src/ChatEngine.ts:206](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L206)
@@ -0,0 +1,504 @@
---
id: "Document"
title: "Class: Document<T>"
sidebar_label: "Document"
sidebar_position: 0
custom_edit_url: null
---
A document is just a special text node with a docId.
## Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------- |
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
## Hierarchy
- [`TextNode`](TextNode.md)<`T`\>
**`Document`**
## Constructors
### constructor
**new Document**<`T`\>(`init?`)
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------- |
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
#### Parameters
| Name | Type |
| :------ | :------------------------------------------ |
| `init?` | `Partial`<[`Document`](Document.md)<`T`\>\> |
#### Overrides
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
#### Defined in
[packages/core/src/Node.ts:254](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L254)
## Properties
### embedding
`Optional` **embedding**: `number`[]
#### Inherited from
[TextNode](TextNode.md).[embedding](TextNode.md#embedding)
#### Defined in
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
---
### endCharIdx
`Optional` **endCharIdx**: `number`
#### Inherited from
[TextNode](TextNode.md).[endCharIdx](TextNode.md#endcharidx)
#### Defined in
[packages/core/src/Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L157)
---
### excludedEmbedMetadataKeys
**excludedEmbedMetadataKeys**: `string`[] = `[]`
#### Inherited from
[TextNode](TextNode.md).[excludedEmbedMetadataKeys](TextNode.md#excludedembedmetadatakeys)
#### Defined in
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
---
### excludedLlmMetadataKeys
**excludedLlmMetadataKeys**: `string`[] = `[]`
#### Inherited from
[TextNode](TextNode.md).[excludedLlmMetadataKeys](TextNode.md#excludedllmmetadatakeys)
#### Defined in
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
---
### hash
**hash**: `string` = `""`
#### Inherited from
[TextNode](TextNode.md).[hash](TextNode.md#hash)
#### Defined in
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
---
### id\_
**id\_**: `string`
The unique ID of the Node/Document. The trailing underscore is here
to avoid collisions with the id keyword in Python.
Set to a UUID by default.
#### Inherited from
[TextNode](TextNode.md).[id\_](TextNode.md#id_)
#### Defined in
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
---
### metadata
**metadata**: `T`
#### Inherited from
[TextNode](TextNode.md).[metadata](TextNode.md#metadata)
#### Defined in
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
---
### metadataSeparator
**metadataSeparator**: `string` = `"\n"`
#### Inherited from
[TextNode](TextNode.md).[metadataSeparator](TextNode.md#metadataseparator)
#### Defined in
[packages/core/src/Node.ts:160](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L160)
---
### relationships
**relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
#### Inherited from
[TextNode](TextNode.md).[relationships](TextNode.md#relationships)
#### Defined in
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
---
### startCharIdx
`Optional` **startCharIdx**: `number`
#### Inherited from
[TextNode](TextNode.md).[startCharIdx](TextNode.md#startcharidx)
#### Defined in
[packages/core/src/Node.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L156)
---
### text
**text**: `string` = `""`
#### Inherited from
[TextNode](TextNode.md).[text](TextNode.md#text)
#### Defined in
[packages/core/src/Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L155)
## Accessors
### childNodes
`get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
#### Inherited from
TextNode.childNodes
#### Defined in
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
---
### nextNode
`get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.nextNode
#### Defined in
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
---
### parentNode
`get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.parentNode
#### Defined in
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
---
### prevNode
`get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.prevNode
#### Defined in
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
---
### sourceNode
`get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.sourceNode
#### Defined in
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
## Methods
### asRelatedNodeInfo
**asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
[TextNode](TextNode.md).[asRelatedNodeInfo](TextNode.md#asrelatednodeinfo)
#### Defined in
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
---
### generateHash
**generateHash**(): `string`
Generate a hash of the text node.
The ID is not part of the hash as it can change independent of content.
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[generateHash](TextNode.md#generatehash)
#### Defined in
[packages/core/src/Node.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L178)
---
### getContent
**getContent**(`metadataMode?`): `string`
#### Parameters
| Name | Type | Default value |
| :------------- | :----------------------------------------- | :------------------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getContent](TextNode.md#getcontent)
#### Defined in
[packages/core/src/Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L192)
---
### getEmbedding
**getEmbedding**(): `number`[]
#### Returns
`number`[]
#### Inherited from
[TextNode](TextNode.md).[getEmbedding](TextNode.md#getembedding)
#### Defined in
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
---
### getMetadataStr
**getMetadataStr**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------------- | :----------------------------------------- |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getMetadataStr](TextNode.md#getmetadatastr)
#### Defined in
[packages/core/src/Node.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L197)
---
### getNodeInfo
**getNodeInfo**(): `Object`
#### Returns
`Object`
| Name | Type |
| :------ | :---------------------- |
| `end` | `undefined` \| `number` |
| `start` | `undefined` \| `number` |
#### Inherited from
[TextNode](TextNode.md).[getNodeInfo](TextNode.md#getnodeinfo)
#### Defined in
[packages/core/src/Node.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L224)
---
### getText
**getText**(): `string`
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getText](TextNode.md#gettext)
#### Defined in
[packages/core/src/Node.ts:228](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L228)
---
### getType
**getType**(): [`ObjectType`](../enums/ObjectType.md)
#### Returns
[`ObjectType`](../enums/ObjectType.md)
#### Overrides
[TextNode](TextNode.md).[getType](TextNode.md#gettype)
#### Defined in
[packages/core/src/Node.ts:263](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L263)
---
### setContent
**setContent**(`value`): `void`
#### Parameters
| Name | Type |
| :------ | :------- |
| `value` | `string` |
#### Returns
`void`
#### Inherited from
[TextNode](TextNode.md).[setContent](TextNode.md#setcontent)
#### Defined in
[packages/core/src/Node.ts:218](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L218)
---
### toJSON
**toJSON**(): `Record`<`string`, `any`\>
Used with built in JSON.stringify
#### Returns
`Record`<`string`, `any`\>
#### Inherited from
[TextNode](TextNode.md).[toJSON](TextNode.md#tojson)
#### Defined in
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
@@ -0,0 +1,109 @@
---
id: "HTMLReader"
title: "Class: HTMLReader"
sidebar_label: "HTMLReader"
sidebar_position: 0
custom_edit_url: null
---
Extract the significant text from an arbitrary HTML document.
The contents of any head, script, style, and xml tags are removed completely.
The URLs for a[href] tags are extracted, along with the inner text of the tag.
All other tags are removed, and the inner text is kept intact.
Html entities (e.g., &amp;) are not decoded.
## Implements
- [`BaseReader`](../interfaces/BaseReader.md)
## Constructors
### constructor
**new HTMLReader**()
## Methods
### getOptions
**getOptions**(): `Object`
Wrapper for our configuration options passed to string-strip-html library
#### Returns
`Object`
An object of options for the underlying library
| Name | Type |
| :------------------------------- | :--------- |
| `skipHtmlDecoding` | `boolean` |
| `stripTogetherWithTheirContents` | `string`[] |
**`See`**
https://codsen.com/os/string-strip-html/examples
#### Defined in
[packages/core/src/readers/HTMLReader.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/HTMLReader.ts#L48)
---
### loadData
**loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
Public method for this reader.
Required by BaseReader interface.
#### Parameters
| Name | Type | Default value | Description |
| :----- | :-------------------------------------------------------- | :------------ | :------------------------------------------------- |
| `file` | `string` | `undefined` | Path/name of the file to be loaded. |
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` | fs wrapper interface for getting the file content. |
#### Returns
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
Promise<Document[]> A Promise object, eventually yielding zero or one Document parsed from the HTML content of the specified file.
#### Implementation of
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
#### Defined in
[packages/core/src/readers/HTMLReader.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/HTMLReader.ts#L21)
---
### parseContent
**parseContent**(`html`, `options?`): `Promise`<`string`\>
Wrapper for string-strip-html usage.
#### Parameters
| Name | Type | Description |
| :-------- | :------- | :---------------------------------------------- |
| `html` | `string` | Raw HTML content to be parsed. |
| `options` | `any` | An object of options for the underlying library |
#### Returns
`Promise`<`string`\>
The HTML content, stripped of unwanted tags and attributes
**`See`**
getOptions
#### Defined in
[packages/core/src/readers/HTMLReader.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/HTMLReader.ts#L38)
@@ -0,0 +1,120 @@
---
id: "HistoryChatEngine"
title: "Class: HistoryChatEngine"
sidebar_label: "HistoryChatEngine"
sidebar_position: 0
custom_edit_url: null
---
HistoryChatEngine is a ChatEngine that uses a `ChatHistory` object
to keeps track of chat's message history.
A `ChatHistory` object is passed as a parameter for each call to the `chat` method,
so the state of the chat engine is preserved between calls.
Optionally, a `ContextGenerator` can be used to generate an additional context for each call to `chat`.
## Constructors
### constructor
**new HistoryChatEngine**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------------------------------------------------------ |
| `init?` | `Partial`<[`HistoryChatEngine`](HistoryChatEngine.md)\> |
#### Defined in
[packages/core/src/ChatEngine.ts:381](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L381)
## Properties
### contextGenerator
`Optional` **contextGenerator**: [`ContextGenerator`](../interfaces/ContextGenerator.md)
#### Defined in
[packages/core/src/ChatEngine.ts:379](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L379)
---
### llm
**llm**: [`LLM`](../interfaces/LLM.md)
#### Defined in
[packages/core/src/ChatEngine.ts:378](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L378)
## Methods
### chat
**chat**<`T`, `R`\>(`message`, `chatHistory`, `streaming?`): `Promise`<`R`\>
#### Type parameters
| Name | Type |
| :--- | :---------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`Response`](Response.md) |
#### Parameters
| Name | Type |
| :------------ | :-------------------------------------------- |
| `message` | [`MessageContent`](../#messagecontent) |
| `chatHistory` | [`ChatHistory`](../interfaces/ChatHistory.md) |
| `streaming?` | `T` |
#### Returns
`Promise`<`R`\>
#### Defined in
[packages/core/src/ChatEngine.ts:386](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L386)
---
### prepareRequestMessages
`Private` **prepareRequestMessages**(`message`, `chatHistory`): `Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)[]\>
#### Parameters
| Name | Type |
| :------------ | :-------------------------------------------- |
| `message` | [`MessageContent`](../#messagecontent) |
| `chatHistory` | [`ChatHistory`](../interfaces/ChatHistory.md) |
#### Returns
`Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)[]\>
#### Defined in
[packages/core/src/ChatEngine.ts:433](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L433)
---
### streamChat
`Protected` **streamChat**(`message`, `chatHistory`): `AsyncGenerator`<`string`, `void`, `unknown`\>
#### Parameters
| Name | Type |
| :------------ | :-------------------------------------------- |
| `message` | [`MessageContent`](../#messagecontent) |
| `chatHistory` | [`ChatHistory`](../interfaces/ChatHistory.md) |
#### Returns
`AsyncGenerator`<`string`, `void`, `unknown`\>
#### Defined in
[packages/core/src/ChatEngine.ts:407](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L407)
@@ -0,0 +1,518 @@
---
id: "ImageDocument"
title: "Class: ImageDocument<T>"
sidebar_label: "ImageDocument"
sidebar_position: 0
custom_edit_url: null
---
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
## Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------- |
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
## Hierarchy
- [`ImageNode`](ImageNode.md)<`T`\>
**`ImageDocument`**
## Constructors
### constructor
**new ImageDocument**<`T`\>(`init`)
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------- |
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
#### Parameters
| Name | Type |
| :----- | :----------------------------------------------------------------- |
| `init` | [`ImageNodeConstructorProps`](../#imagenodeconstructorprops)<`T`\> |
#### Overrides
[ImageNode](ImageNode.md).[constructor](ImageNode.md#constructor)
#### Defined in
[packages/core/src/Node.ts:310](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L310)
## Properties
### embedding
`Optional` **embedding**: `number`[]
#### Inherited from
[ImageNode](ImageNode.md).[embedding](ImageNode.md#embedding)
#### Defined in
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
---
### endCharIdx
`Optional` **endCharIdx**: `number`
#### Inherited from
[ImageNode](ImageNode.md).[endCharIdx](ImageNode.md#endcharidx)
#### Defined in
[packages/core/src/Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L157)
---
### excludedEmbedMetadataKeys
**excludedEmbedMetadataKeys**: `string`[] = `[]`
#### Inherited from
[ImageNode](ImageNode.md).[excludedEmbedMetadataKeys](ImageNode.md#excludedembedmetadatakeys)
#### Defined in
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
---
### excludedLlmMetadataKeys
**excludedLlmMetadataKeys**: `string`[] = `[]`
#### Inherited from
[ImageNode](ImageNode.md).[excludedLlmMetadataKeys](ImageNode.md#excludedllmmetadatakeys)
#### Defined in
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
---
### hash
**hash**: `string` = `""`
#### Inherited from
[ImageNode](ImageNode.md).[hash](ImageNode.md#hash)
#### Defined in
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
---
### id\_
**id\_**: `string`
The unique ID of the Node/Document. The trailing underscore is here
to avoid collisions with the id keyword in Python.
Set to a UUID by default.
#### Inherited from
[ImageNode](ImageNode.md).[id\_](ImageNode.md#id_)
#### Defined in
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
---
### image
**image**: [`ImageType`](../#imagetype)
#### Inherited from
[ImageNode](ImageNode.md).[image](ImageNode.md#image)
#### Defined in
[packages/core/src/Node.ts:297](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L297)
---
### metadata
**metadata**: `T`
#### Inherited from
[ImageNode](ImageNode.md).[metadata](ImageNode.md#metadata)
#### Defined in
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
---
### metadataSeparator
**metadataSeparator**: `string` = `"\n"`
#### Inherited from
[ImageNode](ImageNode.md).[metadataSeparator](ImageNode.md#metadataseparator)
#### Defined in
[packages/core/src/Node.ts:160](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L160)
---
### relationships
**relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
#### Inherited from
[ImageNode](ImageNode.md).[relationships](ImageNode.md#relationships)
#### Defined in
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
---
### startCharIdx
`Optional` **startCharIdx**: `number`
#### Inherited from
[ImageNode](ImageNode.md).[startCharIdx](ImageNode.md#startcharidx)
#### Defined in
[packages/core/src/Node.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L156)
---
### text
**text**: `string` = `""`
#### Inherited from
[ImageNode](ImageNode.md).[text](ImageNode.md#text)
#### Defined in
[packages/core/src/Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L155)
## Accessors
### childNodes
`get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
#### Inherited from
ImageNode.childNodes
#### Defined in
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
---
### nextNode
`get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
ImageNode.nextNode
#### Defined in
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
---
### parentNode
`get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
ImageNode.parentNode
#### Defined in
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
---
### prevNode
`get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
ImageNode.prevNode
#### Defined in
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
---
### sourceNode
`get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
ImageNode.sourceNode
#### Defined in
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
## Methods
### asRelatedNodeInfo
**asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
[ImageNode](ImageNode.md).[asRelatedNodeInfo](ImageNode.md#asrelatednodeinfo)
#### Defined in
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
---
### generateHash
**generateHash**(): `string`
Generate a hash of the text node.
The ID is not part of the hash as it can change independent of content.
#### Returns
`string`
#### Inherited from
[ImageNode](ImageNode.md).[generateHash](ImageNode.md#generatehash)
#### Defined in
[packages/core/src/Node.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L178)
---
### getContent
**getContent**(`metadataMode?`): `string`
#### Parameters
| Name | Type | Default value |
| :------------- | :----------------------------------------- | :------------------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
#### Returns
`string`
#### Inherited from
[ImageNode](ImageNode.md).[getContent](ImageNode.md#getcontent)
#### Defined in
[packages/core/src/Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L192)
---
### getEmbedding
**getEmbedding**(): `number`[]
#### Returns
`number`[]
#### Inherited from
[ImageNode](ImageNode.md).[getEmbedding](ImageNode.md#getembedding)
#### Defined in
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
---
### getMetadataStr
**getMetadataStr**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------------- | :----------------------------------------- |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Inherited from
[ImageNode](ImageNode.md).[getMetadataStr](ImageNode.md#getmetadatastr)
#### Defined in
[packages/core/src/Node.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L197)
---
### getNodeInfo
**getNodeInfo**(): `Object`
#### Returns
`Object`
| Name | Type |
| :------ | :---------------------- |
| `end` | `undefined` \| `number` |
| `start` | `undefined` \| `number` |
#### Inherited from
[ImageNode](ImageNode.md).[getNodeInfo](ImageNode.md#getnodeinfo)
#### Defined in
[packages/core/src/Node.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L224)
---
### getText
**getText**(): `string`
#### Returns
`string`
#### Inherited from
[ImageNode](ImageNode.md).[getText](ImageNode.md#gettext)
#### Defined in
[packages/core/src/Node.ts:228](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L228)
---
### getType
**getType**(): [`ObjectType`](../enums/ObjectType.md)
#### Returns
[`ObjectType`](../enums/ObjectType.md)
#### Overrides
[ImageNode](ImageNode.md).[getType](ImageNode.md#gettype)
#### Defined in
[packages/core/src/Node.ts:318](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L318)
---
### setContent
**setContent**(`value`): `void`
#### Parameters
| Name | Type |
| :------ | :------- |
| `value` | `string` |
#### Returns
`void`
#### Inherited from
[ImageNode](ImageNode.md).[setContent](ImageNode.md#setcontent)
#### Defined in
[packages/core/src/Node.ts:218](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L218)
---
### toJSON
**toJSON**(): `Record`<`string`, `any`\>
Used with built in JSON.stringify
#### Returns
`Record`<`string`, `any`\>
#### Inherited from
[ImageNode](ImageNode.md).[toJSON](ImageNode.md#tojson)
#### Defined in
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
@@ -0,0 +1,516 @@
---
id: "ImageNode"
title: "Class: ImageNode<T>"
sidebar_label: "ImageNode"
sidebar_position: 0
custom_edit_url: null
---
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
## Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------- |
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
## Hierarchy
- [`TextNode`](TextNode.md)<`T`\>
**`ImageNode`**
↳↳ [`ImageDocument`](ImageDocument.md)
## Constructors
### constructor
**new ImageNode**<`T`\>(`init`)
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------- |
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
#### Parameters
| Name | Type |
| :----- | :----------------------------------------------------------------- |
| `init` | [`ImageNodeConstructorProps`](../#imagenodeconstructorprops)<`T`\> |
#### Overrides
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
#### Defined in
[packages/core/src/Node.ts:299](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L299)
## Properties
### embedding
`Optional` **embedding**: `number`[]
#### Inherited from
[TextNode](TextNode.md).[embedding](TextNode.md#embedding)
#### Defined in
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
---
### endCharIdx
`Optional` **endCharIdx**: `number`
#### Inherited from
[TextNode](TextNode.md).[endCharIdx](TextNode.md#endcharidx)
#### Defined in
[packages/core/src/Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L157)
---
### excludedEmbedMetadataKeys
**excludedEmbedMetadataKeys**: `string`[] = `[]`
#### Inherited from
[TextNode](TextNode.md).[excludedEmbedMetadataKeys](TextNode.md#excludedembedmetadatakeys)
#### Defined in
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
---
### excludedLlmMetadataKeys
**excludedLlmMetadataKeys**: `string`[] = `[]`
#### Inherited from
[TextNode](TextNode.md).[excludedLlmMetadataKeys](TextNode.md#excludedllmmetadatakeys)
#### Defined in
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
---
### hash
**hash**: `string` = `""`
#### Inherited from
[TextNode](TextNode.md).[hash](TextNode.md#hash)
#### Defined in
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
---
### id\_
**id\_**: `string`
The unique ID of the Node/Document. The trailing underscore is here
to avoid collisions with the id keyword in Python.
Set to a UUID by default.
#### Inherited from
[TextNode](TextNode.md).[id\_](TextNode.md#id_)
#### Defined in
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
---
### image
**image**: [`ImageType`](../#imagetype)
#### Defined in
[packages/core/src/Node.ts:297](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L297)
---
### metadata
**metadata**: `T`
#### Inherited from
[TextNode](TextNode.md).[metadata](TextNode.md#metadata)
#### Defined in
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
---
### metadataSeparator
**metadataSeparator**: `string` = `"\n"`
#### Inherited from
[TextNode](TextNode.md).[metadataSeparator](TextNode.md#metadataseparator)
#### Defined in
[packages/core/src/Node.ts:160](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L160)
---
### relationships
**relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
#### Inherited from
[TextNode](TextNode.md).[relationships](TextNode.md#relationships)
#### Defined in
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
---
### startCharIdx
`Optional` **startCharIdx**: `number`
#### Inherited from
[TextNode](TextNode.md).[startCharIdx](TextNode.md#startcharidx)
#### Defined in
[packages/core/src/Node.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L156)
---
### text
**text**: `string` = `""`
#### Inherited from
[TextNode](TextNode.md).[text](TextNode.md#text)
#### Defined in
[packages/core/src/Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L155)
## Accessors
### childNodes
`get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
#### Inherited from
TextNode.childNodes
#### Defined in
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
---
### nextNode
`get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.nextNode
#### Defined in
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
---
### parentNode
`get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.parentNode
#### Defined in
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
---
### prevNode
`get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.prevNode
#### Defined in
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
---
### sourceNode
`get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.sourceNode
#### Defined in
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
## Methods
### asRelatedNodeInfo
**asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
[TextNode](TextNode.md).[asRelatedNodeInfo](TextNode.md#asrelatednodeinfo)
#### Defined in
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
---
### generateHash
**generateHash**(): `string`
Generate a hash of the text node.
The ID is not part of the hash as it can change independent of content.
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[generateHash](TextNode.md#generatehash)
#### Defined in
[packages/core/src/Node.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L178)
---
### getContent
**getContent**(`metadataMode?`): `string`
#### Parameters
| Name | Type | Default value |
| :------------- | :----------------------------------------- | :------------------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getContent](TextNode.md#getcontent)
#### Defined in
[packages/core/src/Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L192)
---
### getEmbedding
**getEmbedding**(): `number`[]
#### Returns
`number`[]
#### Inherited from
[TextNode](TextNode.md).[getEmbedding](TextNode.md#getembedding)
#### Defined in
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
---
### getMetadataStr
**getMetadataStr**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------------- | :----------------------------------------- |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getMetadataStr](TextNode.md#getmetadatastr)
#### Defined in
[packages/core/src/Node.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L197)
---
### getNodeInfo
**getNodeInfo**(): `Object`
#### Returns
`Object`
| Name | Type |
| :------ | :---------------------- |
| `end` | `undefined` \| `number` |
| `start` | `undefined` \| `number` |
#### Inherited from
[TextNode](TextNode.md).[getNodeInfo](TextNode.md#getnodeinfo)
#### Defined in
[packages/core/src/Node.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L224)
---
### getText
**getText**(): `string`
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getText](TextNode.md#gettext)
#### Defined in
[packages/core/src/Node.ts:228](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L228)
---
### getType
**getType**(): [`ObjectType`](../enums/ObjectType.md)
#### Returns
[`ObjectType`](../enums/ObjectType.md)
#### Overrides
[TextNode](TextNode.md).[getType](TextNode.md#gettype)
#### Defined in
[packages/core/src/Node.ts:304](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L304)
---
### setContent
**setContent**(`value`): `void`
#### Parameters
| Name | Type |
| :------ | :------- |
| `value` | `string` |
#### Returns
`void`
#### Inherited from
[TextNode](TextNode.md).[setContent](TextNode.md#setcontent)
#### Defined in
[packages/core/src/Node.ts:218](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L218)
---
### toJSON
**toJSON**(): `Record`<`string`, `any`\>
Used with built in JSON.stringify
#### Returns
`Record`<`string`, `any`\>
#### Inherited from
[TextNode](TextNode.md).[toJSON](TextNode.md#tojson)
#### Defined in
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
@@ -0,0 +1,129 @@
---
id: "InMemoryFileSystem"
title: "Class: InMemoryFileSystem"
sidebar_label: "InMemoryFileSystem"
sidebar_position: 0
custom_edit_url: null
---
A filesystem implementation that stores files in memory.
## Implements
- [`GenericFileSystem`](../interfaces/GenericFileSystem.md)
## Constructors
### constructor
**new InMemoryFileSystem**()
## Properties
### files
`Private` **files**: `Record`<`string`, `any`\> = `{}`
#### Defined in
[packages/core/src/storage/FileSystem.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/FileSystem.ts#L25)
## Methods
### access
**access**(`path`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :----- | :------- |
| `path` | `string` |
#### Returns
`Promise`<`void`\>
#### Implementation of
[GenericFileSystem](../interfaces/GenericFileSystem.md).[access](../interfaces/GenericFileSystem.md#access)
#### Defined in
[packages/core/src/storage/FileSystem.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/FileSystem.ts#L38)
---
### mkdir
**mkdir**(`path`, `options?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :--------- | :------- |
| `path` | `string` |
| `options?` | `any` |
#### Returns
`Promise`<`void`\>
#### Implementation of
[GenericFileSystem](../interfaces/GenericFileSystem.md).[mkdir](../interfaces/GenericFileSystem.md#mkdir)
#### Defined in
[packages/core/src/storage/FileSystem.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/FileSystem.ts#L44)
---
### readFile
**readFile**(`path`, `options?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :--------- | :------- |
| `path` | `string` |
| `options?` | `any` |
#### Returns
`Promise`<`string`\>
#### Implementation of
[GenericFileSystem](../interfaces/GenericFileSystem.md).[readFile](../interfaces/GenericFileSystem.md#readfile)
#### Defined in
[packages/core/src/storage/FileSystem.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/FileSystem.ts#L31)
---
### writeFile
**writeFile**(`path`, `content`, `options?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :--------- | :------- |
| `path` | `string` |
| `content` | `string` |
| `options?` | `any` |
#### Returns
`Promise`<`void`\>
#### Implementation of
[GenericFileSystem](../interfaces/GenericFileSystem.md).[writeFile](../interfaces/GenericFileSystem.md#writefile)
#### Defined in
[packages/core/src/storage/FileSystem.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/FileSystem.ts#L27)
@@ -0,0 +1,161 @@
---
id: "IndexDict"
title: "Class: IndexDict"
sidebar_label: "IndexDict"
sidebar_position: 0
custom_edit_url: null
---
The underlying structure of each index.
## Hierarchy
- [`IndexStruct`](IndexStruct.md)
**`IndexDict`**
## Constructors
### constructor
**new IndexDict**(`indexId?`, `summary?`)
#### Parameters
| Name | Type | Default value |
| :-------- | :---------- | :------------ |
| `indexId` | `string` | `undefined` |
| `summary` | `undefined` | `undefined` |
#### Inherited from
[IndexStruct](IndexStruct.md).[constructor](IndexStruct.md#constructor)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L19)
## Properties
### indexId
**indexId**: `string`
#### Inherited from
[IndexStruct](IndexStruct.md).[indexId](IndexStruct.md#indexid)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L16)
---
### nodesDict
**nodesDict**: `Record`<`string`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\> = `{}`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:46](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L46)
---
### summary
`Optional` **summary**: `string`
#### Inherited from
[IndexStruct](IndexStruct.md).[summary](IndexStruct.md#summary)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L17)
---
### type
**type**: [`IndexStructType`](../enums/IndexStructType.md) = `IndexStructType.SIMPLE_DICT`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:47](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L47)
## Methods
### addNode
**addNode**(`node`, `textId?`): `void`
#### Parameters
| Name | Type |
| :-------- | :----------------------------------------------------- |
| `node` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\> |
| `textId?` | `string` |
#### Returns
`void`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L56)
---
### delete
**delete**(`nodeId`): `void`
#### Parameters
| Name | Type |
| :------- | :------- |
| `nodeId` | `string` |
#### Returns
`void`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L69)
---
### getSummary
**getSummary**(): `string`
#### Returns
`string`
#### Overrides
[IndexStruct](IndexStruct.md).[getSummary](IndexStruct.md#getsummary)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L49)
---
### toJson
**toJson**(): `Record`<`string`, `unknown`\>
#### Returns
`Record`<`string`, `unknown`\>
#### Overrides
[IndexStruct](IndexStruct.md).[toJson](IndexStruct.md#tojson)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L61)
@@ -0,0 +1,140 @@
---
id: "IndexList"
title: "Class: IndexList"
sidebar_label: "IndexList"
sidebar_position: 0
custom_edit_url: null
---
The underlying structure of each index.
## Hierarchy
- [`IndexStruct`](IndexStruct.md)
**`IndexList`**
## Constructors
### constructor
**new IndexList**(`indexId?`, `summary?`)
#### Parameters
| Name | Type | Default value |
| :-------- | :---------- | :------------ |
| `indexId` | `string` | `undefined` |
| `summary` | `undefined` | `undefined` |
#### Inherited from
[IndexStruct](IndexStruct.md).[constructor](IndexStruct.md#constructor)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L19)
## Properties
### indexId
**indexId**: `string`
#### Inherited from
[IndexStruct](IndexStruct.md).[indexId](IndexStruct.md#indexid)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L16)
---
### nodes
**nodes**: `string`[] = `[]`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L94)
---
### summary
`Optional` **summary**: `string`
#### Inherited from
[IndexStruct](IndexStruct.md).[summary](IndexStruct.md#summary)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L17)
---
### type
**type**: [`IndexStructType`](../enums/IndexStructType.md) = `IndexStructType.LIST`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:95](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L95)
## Methods
### addNode
**addNode**(`node`): `void`
#### Parameters
| Name | Type |
| :----- | :----------------------------------------------------- |
| `node` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\> |
#### Returns
`void`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:97](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L97)
---
### getSummary
**getSummary**(): `string`
#### Returns
`string`
#### Inherited from
[IndexStruct](IndexStruct.md).[getSummary](IndexStruct.md#getsummary)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L31)
---
### toJson
**toJson**(): `Record`<`string`, `unknown`\>
#### Returns
`Record`<`string`, `unknown`\>
#### Overrides
[IndexStruct](IndexStruct.md).[toJson](IndexStruct.md#tojson)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L101)
@@ -0,0 +1,514 @@
---
id: "IndexNode"
title: "Class: IndexNode<T>"
sidebar_label: "IndexNode"
sidebar_position: 0
custom_edit_url: null
---
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
## Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------- |
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
## Hierarchy
- [`TextNode`](TextNode.md)<`T`\>
**`IndexNode`**
## Constructors
### constructor
**new IndexNode**<`T`\>(`init?`)
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------- |
| `T` | extends [`Metadata`](../#metadata) = [`Metadata`](../#metadata) |
#### Parameters
| Name | Type |
| :------ | :-------------------------------------------- |
| `init?` | `Partial`<[`IndexNode`](IndexNode.md)<`T`\>\> |
#### Overrides
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
#### Defined in
[packages/core/src/Node.ts:236](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L236)
## Properties
### embedding
`Optional` **embedding**: `number`[]
#### Inherited from
[TextNode](TextNode.md).[embedding](TextNode.md#embedding)
#### Defined in
[packages/core/src/Node.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L51)
---
### endCharIdx
`Optional` **endCharIdx**: `number`
#### Inherited from
[TextNode](TextNode.md).[endCharIdx](TextNode.md#endcharidx)
#### Defined in
[packages/core/src/Node.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L157)
---
### excludedEmbedMetadataKeys
**excludedEmbedMetadataKeys**: `string`[] = `[]`
#### Inherited from
[TextNode](TextNode.md).[excludedEmbedMetadataKeys](TextNode.md#excludedembedmetadatakeys)
#### Defined in
[packages/core/src/Node.ts:55](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L55)
---
### excludedLlmMetadataKeys
**excludedLlmMetadataKeys**: `string`[] = `[]`
#### Inherited from
[TextNode](TextNode.md).[excludedLlmMetadataKeys](TextNode.md#excludedllmmetadatakeys)
#### Defined in
[packages/core/src/Node.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L56)
---
### hash
**hash**: `string` = `""`
#### Inherited from
[TextNode](TextNode.md).[hash](TextNode.md#hash)
#### Defined in
[packages/core/src/Node.ts:58](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L58)
---
### id\_
**id\_**: `string`
The unique ID of the Node/Document. The trailing underscore is here
to avoid collisions with the id keyword in Python.
Set to a UUID by default.
#### Inherited from
[TextNode](TextNode.md).[id\_](TextNode.md#id_)
#### Defined in
[packages/core/src/Node.ts:50](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L50)
---
### indexId
**indexId**: `string` = `""`
#### Defined in
[packages/core/src/Node.ts:234](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L234)
---
### metadata
**metadata**: `T`
#### Inherited from
[TextNode](TextNode.md).[metadata](TextNode.md#metadata)
#### Defined in
[packages/core/src/Node.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L54)
---
### metadataSeparator
**metadataSeparator**: `string` = `"\n"`
#### Inherited from
[TextNode](TextNode.md).[metadataSeparator](TextNode.md#metadataseparator)
#### Defined in
[packages/core/src/Node.ts:160](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L160)
---
### relationships
**relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../#relatednodetype)<`T`\>\>\> = `{}`
#### Inherited from
[TextNode](TextNode.md).[relationships](TextNode.md#relationships)
#### Defined in
[packages/core/src/Node.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L57)
---
### startCharIdx
`Optional` **startCharIdx**: `number`
#### Inherited from
[TextNode](TextNode.md).[startCharIdx](TextNode.md#startcharidx)
#### Defined in
[packages/core/src/Node.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L156)
---
### text
**text**: `string` = `""`
#### Inherited from
[TextNode](TextNode.md).[text](TextNode.md#text)
#### Defined in
[packages/core/src/Node.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L155)
## Accessors
### childNodes
`get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>[]
#### Inherited from
TextNode.childNodes
#### Defined in
[packages/core/src/Node.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L112)
---
### nextNode
`get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.nextNode
#### Defined in
[packages/core/src/Node.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L92)
---
### parentNode
`get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.parentNode
#### Defined in
[packages/core/src/Node.ts:102](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L102)
---
### prevNode
`get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.prevNode
#### Defined in
[packages/core/src/Node.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L80)
---
### sourceNode
`get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
TextNode.sourceNode
#### Defined in
[packages/core/src/Node.ts:70](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L70)
## Methods
### asRelatedNodeInfo
**asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Returns
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)<`T`\>
#### Inherited from
[TextNode](TextNode.md).[asRelatedNodeInfo](TextNode.md#asrelatednodeinfo)
#### Defined in
[packages/core/src/Node.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L134)
---
### generateHash
**generateHash**(): `string`
Generate a hash of the text node.
The ID is not part of the hash as it can change independent of content.
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[generateHash](TextNode.md#generatehash)
#### Defined in
[packages/core/src/Node.ts:178](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L178)
---
### getContent
**getContent**(`metadataMode?`): `string`
#### Parameters
| Name | Type | Default value |
| :------------- | :----------------------------------------- | :------------------ |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getContent](TextNode.md#getcontent)
#### Defined in
[packages/core/src/Node.ts:192](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L192)
---
### getEmbedding
**getEmbedding**(): `number`[]
#### Returns
`number`[]
#### Inherited from
[TextNode](TextNode.md).[getEmbedding](TextNode.md#getembedding)
#### Defined in
[packages/core/src/Node.ts:126](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L126)
---
### getMetadataStr
**getMetadataStr**(`metadataMode`): `string`
#### Parameters
| Name | Type |
| :------------- | :----------------------------------------- |
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getMetadataStr](TextNode.md#getmetadatastr)
#### Defined in
[packages/core/src/Node.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L197)
---
### getNodeInfo
**getNodeInfo**(): `Object`
#### Returns
`Object`
| Name | Type |
| :------ | :---------------------- |
| `end` | `undefined` \| `number` |
| `start` | `undefined` \| `number` |
#### Inherited from
[TextNode](TextNode.md).[getNodeInfo](TextNode.md#getnodeinfo)
#### Defined in
[packages/core/src/Node.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L224)
---
### getText
**getText**(): `string`
#### Returns
`string`
#### Inherited from
[TextNode](TextNode.md).[getText](TextNode.md#gettext)
#### Defined in
[packages/core/src/Node.ts:228](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L228)
---
### getType
**getType**(): [`ObjectType`](../enums/ObjectType.md)
#### Returns
[`ObjectType`](../enums/ObjectType.md)
#### Overrides
[TextNode](TextNode.md).[getType](TextNode.md#gettype)
#### Defined in
[packages/core/src/Node.ts:245](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L245)
---
### setContent
**setContent**(`value`): `void`
#### Parameters
| Name | Type |
| :------ | :------- |
| `value` | `string` |
#### Returns
`void`
#### Inherited from
[TextNode](TextNode.md).[setContent](TextNode.md#setcontent)
#### Defined in
[packages/core/src/Node.ts:218](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L218)
---
### toJSON
**toJSON**(): `Record`<`string`, `any`\>
Used with built in JSON.stringify
#### Returns
`Record`<`string`, `any`\>
#### Inherited from
[TextNode](TextNode.md).[toJSON](TextNode.md#tojson)
#### Defined in
[packages/core/src/Node.ts:146](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Node.ts#L146)
@@ -0,0 +1,84 @@
---
id: "IndexStruct"
title: "Class: IndexStruct"
sidebar_label: "IndexStruct"
sidebar_position: 0
custom_edit_url: null
---
The underlying structure of each index.
## Hierarchy
- **`IndexStruct`**
↳ [`IndexDict`](IndexDict.md)
↳ [`IndexList`](IndexList.md)
↳ [`KeywordTable`](KeywordTable.md)
## Constructors
### constructor
**new IndexStruct**(`indexId?`, `summary?`)
#### Parameters
| Name | Type | Default value |
| :-------- | :---------- | :------------ |
| `indexId` | `string` | `undefined` |
| `summary` | `undefined` | `undefined` |
#### Defined in
[packages/core/src/indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L19)
## Properties
### indexId
**indexId**: `string`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L16)
---
### summary
`Optional` **summary**: `string`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L17)
## Methods
### getSummary
**getSummary**(): `string`
#### Returns
`string`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L31)
---
### toJson
**toJson**(): `Record`<`string`, `unknown`\>
#### Returns
`Record`<`string`, `unknown`\>
#### Defined in
[packages/core/src/indices/BaseIndex.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L24)
@@ -0,0 +1,162 @@
---
id: "KeywordTable"
title: "Class: KeywordTable"
sidebar_label: "KeywordTable"
sidebar_position: 0
custom_edit_url: null
---
The underlying structure of each index.
## Hierarchy
- [`IndexStruct`](IndexStruct.md)
**`KeywordTable`**
## Constructors
### constructor
**new KeywordTable**(`indexId?`, `summary?`)
#### Parameters
| Name | Type | Default value |
| :-------- | :---------- | :------------ |
| `indexId` | `string` | `undefined` |
| `summary` | `undefined` | `undefined` |
#### Inherited from
[IndexStruct](IndexStruct.md).[constructor](IndexStruct.md#constructor)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L19)
## Properties
### indexId
**indexId**: `string`
#### Inherited from
[IndexStruct](IndexStruct.md).[indexId](IndexStruct.md#indexid)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L16)
---
### summary
`Optional` **summary**: `string`
#### Inherited from
[IndexStruct](IndexStruct.md).[summary](IndexStruct.md#summary)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L17)
---
### table
**table**: `Map`<`string`, `Set`<`string`\>\>
#### Defined in
[packages/core/src/indices/BaseIndex.ts:112](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L112)
---
### type
**type**: [`IndexStructType`](../enums/IndexStructType.md) = `IndexStructType.KEYWORD_TABLE`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:113](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L113)
## Methods
### addNode
**addNode**(`keywords`, `nodeId`): `void`
#### Parameters
| Name | Type |
| :--------- | :--------- |
| `keywords` | `string`[] |
| `nodeId` | `string` |
#### Returns
`void`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:114](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L114)
---
### deleteNode
**deleteNode**(`keywords`, `nodeId`): `void`
#### Parameters
| Name | Type |
| :--------- | :--------- |
| `keywords` | `string`[] |
| `nodeId` | `string` |
#### Returns
`void`
#### Defined in
[packages/core/src/indices/BaseIndex.ts:123](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L123)
---
### getSummary
**getSummary**(): `string`
#### Returns
`string`
#### Inherited from
[IndexStruct](IndexStruct.md).[getSummary](IndexStruct.md#getsummary)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L31)
---
### toJson
**toJson**(): `Record`<`string`, `unknown`\>
#### Returns
`Record`<`string`, `unknown`\>
#### Overrides
[IndexStruct](IndexStruct.md).[toJson](IndexStruct.md#tojson)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L131)
@@ -0,0 +1,382 @@
---
id: "KeywordTableIndex"
title: "Class: KeywordTableIndex"
sidebar_label: "KeywordTableIndex"
sidebar_position: 0
custom_edit_url: null
---
The KeywordTableIndex, an index that extracts keywords from each Node and builds a mapping from each keyword to the corresponding Nodes of that keyword.
## Hierarchy
- [`BaseIndex`](BaseIndex.md)<[`KeywordTable`](KeywordTable.md)\>
**`KeywordTableIndex`**
## Constructors
### constructor
**new KeywordTableIndex**(`init`)
#### Parameters
| Name | Type |
| :----- | :------------------------------------------------------------------------------------ |
| `init` | [`BaseIndexInit`](../interfaces/BaseIndexInit.md)<[`KeywordTable`](KeywordTable.md)\> |
#### Overrides
[BaseIndex](BaseIndex.md).[constructor](BaseIndex.md#constructor)
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L49)
## Properties
### docStore
**docStore**: [`BaseDocumentStore`](BaseDocumentStore.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[docStore](BaseIndex.md#docstore)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:156](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L156)
---
### indexStore
`Optional` **indexStore**: [`BaseIndexStore`](BaseIndexStore.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[indexStore](BaseIndex.md#indexstore)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:158](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L158)
---
### indexStruct
**indexStruct**: [`KeywordTable`](KeywordTable.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[indexStruct](BaseIndex.md#indexstruct)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:159](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L159)
---
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[serviceContext](BaseIndex.md#servicecontext)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:154](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L154)
---
### storageContext
**storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[storageContext](BaseIndex.md#storagecontext)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:155](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L155)
---
### vectorStore
`Optional` **vectorStore**: [`VectorStore`](../interfaces/VectorStore.md)
#### Inherited from
[BaseIndex](BaseIndex.md).[vectorStore](BaseIndex.md#vectorstore)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:157](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L157)
## Methods
### asQueryEngine
**asQueryEngine**(`options?`): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
Create a new query engine from the index. It will also create a retriever
and response synthezier if they are not provided.
#### Parameters
| Name | Type | Description |
| :----------------------------- | :------------------------------------------------------------------ | :--------------------------------------------------------------- |
| `options?` | `Object` | you can supply your own custom Retriever and ResponseSynthesizer |
| `options.nodePostprocessors?` | [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[] | - |
| `options.preFilters?` | `unknown` | - |
| `options.responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) | - |
| `options.retriever?` | [`BaseRetriever`](../interfaces/BaseRetriever.md) | - |
#### Returns
[`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
#### Overrides
[BaseIndex](BaseIndex.md).[asQueryEngine](BaseIndex.md#asqueryengine)
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:130](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L130)
---
### asRetriever
**asRetriever**(`options?`): [`BaseRetriever`](../interfaces/BaseRetriever.md)
Create a new retriever from the index.
#### Parameters
| Name | Type |
| :--------- | :---- |
| `options?` | `any` |
#### Returns
[`BaseRetriever`](../interfaces/BaseRetriever.md)
#### Overrides
[BaseIndex](BaseIndex.md).[asRetriever](BaseIndex.md#asretriever)
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L119)
---
### deleteNode
**deleteNode**(`nodeId`): `void`
#### Parameters
| Name | Type |
| :------- | :------- |
| `nodeId` | `string` |
#### Returns
`void`
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:224](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L224)
---
### deleteNodes
**deleteNodes**(`nodeIds`, `deleteFromDocStore`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------------------- | :--------- |
| `nodeIds` | `string`[] |
| `deleteFromDocStore` | `boolean` |
#### Returns
`Promise`<`void`\>
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:242](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L242)
---
### deleteRefDoc
**deleteRefDoc**(`refDocId`, `deleteFromDocStore?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :-------------------- | :-------- |
| `refDocId` | `string` |
| `deleteFromDocStore?` | `boolean` |
#### Returns
`Promise`<`void`\>
#### Overrides
[BaseIndex](BaseIndex.md).[deleteRefDoc](BaseIndex.md#deleterefdoc)
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:256](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L256)
---
### insert
**insert**(`document`): `Promise`<`void`\>
Insert a document into the index.
#### Parameters
| Name | Type |
| :--------- | :----------------------------------------------------- |
| `document` | [`Document`](Document.md)<[`Metadata`](../#metadata)\> |
#### Returns
`Promise`<`void`\>
#### Inherited from
[BaseIndex](BaseIndex.md).[insert](BaseIndex.md#insert)
#### Defined in
[packages/core/src/indices/BaseIndex.ts:190](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseIndex.ts#L190)
---
### insertNodes
**insertNodes**(`nodes`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------------------------------------------------------- |
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
#### Returns
`Promise`<`void`\>
#### Overrides
[BaseIndex](BaseIndex.md).[insertNodes](BaseIndex.md#insertnodes)
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:214](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L214)
---
### buildIndexFromNodes
`Static` **buildIndexFromNodes**(`nodes`, `docStore`, `serviceContext`): `Promise`<[`KeywordTable`](KeywordTable.md)\>
Get keywords for nodes and place them into the index.
#### Parameters
| Name | Type |
| :--------------- | :------------------------------------------------------- |
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
| `docStore` | [`BaseDocumentStore`](BaseDocumentStore.md) |
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Returns
`Promise`<[`KeywordTable`](KeywordTable.md)\>
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:197](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L197)
---
### extractKeywords
`Static` **extractKeywords**(`text`, `serviceContext`): `Promise`<`Set`<`string`\>\>
#### Parameters
| Name | Type |
| :--------------- | :-------------------------------------------------- |
| `text` | `string` |
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Returns
`Promise`<`Set`<`string`\>\>
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:145](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L145)
---
### fromDocuments
`Static` **fromDocuments**(`documents`, `args?`): `Promise`<[`KeywordTableIndex`](KeywordTableIndex.md)\>
High level API: split documents, get keywords, and build index.
#### Parameters
| Name | Type |
| :--------------------- | :------------------------------------------------------- |
| `documents` | [`Document`](Document.md)<[`Metadata`](../#metadata)\>[] |
| `args` | `Object` |
| `args.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
| `args.storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
#### Returns
`Promise`<[`KeywordTableIndex`](KeywordTableIndex.md)\>
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:164](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L164)
---
### init
`Static` **init**(`options`): `Promise`<[`KeywordTableIndex`](KeywordTableIndex.md)\>
#### Parameters
| Name | Type |
| :-------- | :-------------------- |
| `options` | `KeywordIndexOptions` |
#### Returns
`Promise`<[`KeywordTableIndex`](KeywordTableIndex.md)\>
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndex.ts:53](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndex.ts#L53)
@@ -0,0 +1,244 @@
---
id: "KeywordTableLLMRetriever"
title: "Class: KeywordTableLLMRetriever"
sidebar_label: "KeywordTableLLMRetriever"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- `BaseKeywordTableRetriever`
**`KeywordTableLLMRetriever`**
## Constructors
### constructor
**new KeywordTableLLMRetriever**(`«destructured»`)
#### Parameters
| Name | Type |
| :------------------------------- | :------------------------------------------ |
| `«destructured»` | `Object` |
|  `index` | [`KeywordTableIndex`](KeywordTableIndex.md) |
|  `keywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
|  `maxKeywordsPerQuery` | `number` |
|  `numChunksPerQuery` | `number` |
|  `queryKeywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
#### Inherited from
BaseKeywordTableRetriever.constructor
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L31)
## Properties
### docstore
`Protected` **docstore**: [`BaseDocumentStore`](BaseDocumentStore.md)
#### Inherited from
BaseKeywordTableRetriever.docstore
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L23)
---
### index
`Protected` **index**: [`KeywordTableIndex`](KeywordTableIndex.md)
#### Inherited from
BaseKeywordTableRetriever.index
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L21)
---
### indexStruct
`Protected` **indexStruct**: [`KeywordTable`](KeywordTable.md)
#### Inherited from
BaseKeywordTableRetriever.indexStruct
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L22)
---
### keywordExtractTemplate
`Protected` **keywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Inherited from
BaseKeywordTableRetriever.keywordExtractTemplate
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L28)
---
### maxKeywordsPerQuery
`Protected` **maxKeywordsPerQuery**: `number`
#### Inherited from
BaseKeywordTableRetriever.maxKeywordsPerQuery
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L26)
---
### numChunksPerQuery
`Protected` **numChunksPerQuery**: `number`
#### Inherited from
BaseKeywordTableRetriever.numChunksPerQuery
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L27)
---
### queryKeywordExtractTemplate
`Protected` **queryKeywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Inherited from
BaseKeywordTableRetriever.queryKeywordExtractTemplate
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L29)
---
### serviceContext
`Protected` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
BaseKeywordTableRetriever.serviceContext
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L24)
## Methods
### getKeywords
**getKeywords**(`query`): `Promise`<`string`[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `query` | `string` |
#### Returns
`Promise`<`string`[]\>
#### Overrides
BaseKeywordTableRetriever.getKeywords
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L88)
---
### getServiceContext
**getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
#### Returns
[`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
BaseKeywordTableRetriever.getServiceContext
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:81](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L81)
---
### retrieve
**retrieve**(`query`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `query` | `string` |
#### Returns
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
#### Inherited from
BaseKeywordTableRetriever.retrieve
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L59)
@@ -0,0 +1,244 @@
---
id: "KeywordTableRAKERetriever"
title: "Class: KeywordTableRAKERetriever"
sidebar_label: "KeywordTableRAKERetriever"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- `BaseKeywordTableRetriever`
**`KeywordTableRAKERetriever`**
## Constructors
### constructor
**new KeywordTableRAKERetriever**(`«destructured»`)
#### Parameters
| Name | Type |
| :------------------------------- | :------------------------------------------ |
| `«destructured»` | `Object` |
|  `index` | [`KeywordTableIndex`](KeywordTableIndex.md) |
|  `keywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
|  `maxKeywordsPerQuery` | `number` |
|  `numChunksPerQuery` | `number` |
|  `queryKeywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
#### Inherited from
BaseKeywordTableRetriever.constructor
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L31)
## Properties
### docstore
`Protected` **docstore**: [`BaseDocumentStore`](BaseDocumentStore.md)
#### Inherited from
BaseKeywordTableRetriever.docstore
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L23)
---
### index
`Protected` **index**: [`KeywordTableIndex`](KeywordTableIndex.md)
#### Inherited from
BaseKeywordTableRetriever.index
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L21)
---
### indexStruct
`Protected` **indexStruct**: [`KeywordTable`](KeywordTable.md)
#### Inherited from
BaseKeywordTableRetriever.indexStruct
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L22)
---
### keywordExtractTemplate
`Protected` **keywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Inherited from
BaseKeywordTableRetriever.keywordExtractTemplate
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L28)
---
### maxKeywordsPerQuery
`Protected` **maxKeywordsPerQuery**: `number`
#### Inherited from
BaseKeywordTableRetriever.maxKeywordsPerQuery
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L26)
---
### numChunksPerQuery
`Protected` **numChunksPerQuery**: `number`
#### Inherited from
BaseKeywordTableRetriever.numChunksPerQuery
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L27)
---
### queryKeywordExtractTemplate
`Protected` **queryKeywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Inherited from
BaseKeywordTableRetriever.queryKeywordExtractTemplate
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L29)
---
### serviceContext
`Protected` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
BaseKeywordTableRetriever.serviceContext
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L24)
## Methods
### getKeywords
**getKeywords**(`query`): `Promise`<`string`[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `query` | `string` |
#### Returns
`Promise`<`string`[]\>
#### Overrides
BaseKeywordTableRetriever.getKeywords
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:114](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L114)
---
### getServiceContext
**getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
#### Returns
[`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
BaseKeywordTableRetriever.getServiceContext
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:81](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L81)
---
### retrieve
**retrieve**(`query`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `query` | `string` |
#### Returns
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
#### Inherited from
BaseKeywordTableRetriever.retrieve
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L59)
@@ -0,0 +1,244 @@
---
id: "KeywordTableSimpleRetriever"
title: "Class: KeywordTableSimpleRetriever"
sidebar_label: "KeywordTableSimpleRetriever"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- `BaseKeywordTableRetriever`
**`KeywordTableSimpleRetriever`**
## Constructors
### constructor
**new KeywordTableSimpleRetriever**(`«destructured»`)
#### Parameters
| Name | Type |
| :------------------------------- | :------------------------------------------ |
| `«destructured»` | `Object` |
|  `index` | [`KeywordTableIndex`](KeywordTableIndex.md) |
|  `keywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
|  `maxKeywordsPerQuery` | `number` |
|  `numChunksPerQuery` | `number` |
|  `queryKeywordExtractTemplate?` | (`__namedParameters`: `Object`) => `string` |
#### Inherited from
BaseKeywordTableRetriever.constructor
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L31)
## Properties
### docstore
`Protected` **docstore**: [`BaseDocumentStore`](BaseDocumentStore.md)
#### Inherited from
BaseKeywordTableRetriever.docstore
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L23)
---
### index
`Protected` **index**: [`KeywordTableIndex`](KeywordTableIndex.md)
#### Inherited from
BaseKeywordTableRetriever.index
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L21)
---
### indexStruct
`Protected` **indexStruct**: [`KeywordTable`](KeywordTable.md)
#### Inherited from
BaseKeywordTableRetriever.indexStruct
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L22)
---
### keywordExtractTemplate
`Protected` **keywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Inherited from
BaseKeywordTableRetriever.keywordExtractTemplate
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L28)
---
### maxKeywordsPerQuery
`Protected` **maxKeywordsPerQuery**: `number`
#### Inherited from
BaseKeywordTableRetriever.maxKeywordsPerQuery
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L26)
---
### numChunksPerQuery
`Protected` **numChunksPerQuery**: `number`
#### Inherited from
BaseKeywordTableRetriever.numChunksPerQuery
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L27)
---
### queryKeywordExtractTemplate
`Protected` **queryKeywordExtractTemplate**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Inherited from
BaseKeywordTableRetriever.queryKeywordExtractTemplate
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L29)
---
### serviceContext
`Protected` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
BaseKeywordTableRetriever.serviceContext
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L24)
## Methods
### getKeywords
**getKeywords**(`query`): `Promise`<`string`[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `query` | `string` |
#### Returns
`Promise`<`string`[]\>
#### Overrides
BaseKeywordTableRetriever.getKeywords
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:105](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L105)
---
### getServiceContext
**getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
#### Returns
[`ServiceContext`](../interfaces/ServiceContext.md)
#### Inherited from
BaseKeywordTableRetriever.getServiceContext
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:81](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L81)
---
### retrieve
**retrieve**(`query`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `query` | `string` |
#### Returns
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
#### Inherited from
BaseKeywordTableRetriever.retrieve
#### Defined in
[packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/keyword/KeywordTableIndexRetriever.ts#L59)
@@ -0,0 +1,98 @@
---
id: "LLMQuestionGenerator"
title: "Class: LLMQuestionGenerator"
sidebar_label: "LLMQuestionGenerator"
sidebar_position: 0
custom_edit_url: null
---
LLMQuestionGenerator uses the LLM to generate new questions for the LLM using tools and a user query.
## Implements
- [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md)
## Constructors
### constructor
**new LLMQuestionGenerator**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------------------------------------------------------------ |
| `init?` | `Partial`<[`LLMQuestionGenerator`](LLMQuestionGenerator.md)\> |
#### Defined in
[packages/core/src/QuestionGenerator.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QuestionGenerator.ts#L34)
## Properties
### llm
**llm**: [`LLM`](../interfaces/LLM.md)
#### Defined in
[packages/core/src/QuestionGenerator.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QuestionGenerator.ts#L30)
---
### outputParser
**outputParser**: [`BaseOutputParser`](../interfaces/BaseOutputParser.md)<[`StructuredOutput`](../interfaces/StructuredOutput.md)<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>\>
#### Defined in
[packages/core/src/QuestionGenerator.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QuestionGenerator.ts#L32)
---
### prompt
**prompt**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Defined in
[packages/core/src/QuestionGenerator.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QuestionGenerator.ts#L31)
## Methods
### generate
**generate**(`tools`, `query`): `Promise`<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
#### Parameters
| Name | Type |
| :------ | :------------------------------------------------ |
| `tools` | [`ToolMetadata`](../interfaces/ToolMetadata.md)[] |
| `query` | `string` |
#### Returns
`Promise`<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
#### Implementation of
[BaseQuestionGenerator](../interfaces/BaseQuestionGenerator.md).[generate](../interfaces/BaseQuestionGenerator.md#generate)
#### Defined in
[packages/core/src/QuestionGenerator.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QuestionGenerator.ts#L40)
@@ -0,0 +1,325 @@
---
id: "LlamaDeuce"
title: "Class: LlamaDeuce"
sidebar_label: "LlamaDeuce"
sidebar_position: 0
custom_edit_url: null
---
Llama2 LLM implementation
## Implements
- [`LLM`](../interfaces/LLM.md)
## Constructors
### constructor
**new LlamaDeuce**(`init?`)
#### Parameters
| Name | Type |
| :------ | :---------------------------------------- |
| `init?` | `Partial`<[`LlamaDeuce`](LlamaDeuce.md)\> |
#### Defined in
[packages/core/src/llm/LLM.ts:434](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L434)
## Properties
### chatStrategy
**chatStrategy**: [`DeuceChatStrategy`](../enums/DeuceChatStrategy.md)
#### Defined in
[packages/core/src/llm/LLM.ts:427](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L427)
---
### hasStreaming
**hasStreaming**: `boolean`
#### Implementation of
[LLM](../interfaces/LLM.md).[hasStreaming](../interfaces/LLM.md#hasstreaming)
#### Defined in
[packages/core/src/llm/LLM.ts:432](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L432)
---
### maxTokens
`Optional` **maxTokens**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:430](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L430)
---
### model
**model**: `"Llama-2-70b-chat-old"` \| `"Llama-2-70b-chat-4bit"` \| `"Llama-2-13b-chat-old"` \| `"Llama-2-13b-chat-4bit"` \| `"Llama-2-7b-chat-old"` \| `"Llama-2-7b-chat-4bit"`
#### Defined in
[packages/core/src/llm/LLM.ts:426](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L426)
---
### replicateSession
**replicateSession**: `ReplicateSession`
#### Defined in
[packages/core/src/llm/LLM.ts:431](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L431)
---
### temperature
**temperature**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:428](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L428)
---
### topP
**topP**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:429](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L429)
## Accessors
### metadata
`get` **metadata**(): `Object`
#### Returns
`Object`
| Name | Type |
| :-------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `contextWindow` | `number` |
| `maxTokens` | `undefined` \| `number` |
| `model` | `"Llama-2-70b-chat-old"` \| `"Llama-2-70b-chat-4bit"` \| `"Llama-2-13b-chat-old"` \| `"Llama-2-13b-chat-4bit"` \| `"Llama-2-7b-chat-old"` \| `"Llama-2-7b-chat-4bit"` |
| `temperature` | `number` |
| `tokenizer` | `undefined` |
| `topP` | `number` |
#### Implementation of
[LLM](../interfaces/LLM.md).[metadata](../interfaces/LLM.md#metadata)
#### Defined in
[packages/core/src/llm/LLM.ts:454](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L454)
## Methods
### chat
**chat**<`T`, `R`\>(`messages`, `_parentEvent?`, `streaming?`): `Promise`<`R`\>
Get a chat response from the LLM
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
#### Parameters
| Name | Type | Description |
| :-------------- | :---------------------------------------------- | :----------------------------------------------------------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | The return type of chat() and complete() are set by the "streaming" parameter being set to True. |
| `_parentEvent?` | [`Event`](../interfaces/Event.md) | - |
| `streaming?` | `T` | - |
#### Returns
`Promise`<`R`\>
#### Implementation of
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
#### Defined in
[packages/core/src/llm/LLM.ts:592](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L592)
---
### complete
**complete**<`T`, `R`\>(`prompt`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
Get a prompt completion from the LLM
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
#### Parameters
| Name | Type | Description |
| :------------- | :-------------------------------- | :--------------------- |
| `prompt` | `string` | the prompt to complete |
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
| `streaming?` | `T` | - |
#### Returns
`Promise`<`R`\>
#### Implementation of
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
#### Defined in
[packages/core/src/llm/LLM.ts:632](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L632)
---
### mapMessageTypeA16Z
**mapMessageTypeA16Z**(`messageType`): `string`
#### Parameters
| Name | Type |
| :------------ | :------------------------------- |
| `messageType` | [`MessageType`](../#messagetype) |
#### Returns
`string`
#### Defined in
[packages/core/src/llm/LLM.ts:501](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L501)
---
### mapMessagesToPrompt
**mapMessagesToPrompt**(`messages`): `Object`
#### Parameters
| Name | Type |
| :--------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
#### Returns
`Object`
| Name | Type |
| :------------- | :------- |
| `prompt` | `string` |
| `systemPrompt` | `any` |
#### Defined in
[packages/core/src/llm/LLM.ts:465](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L465)
---
### mapMessagesToPromptA16Z
**mapMessagesToPromptA16Z**(`messages`): `Object`
#### Parameters
| Name | Type |
| :--------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
#### Returns
`Object`
| Name | Type |
| :------------- | :---------- |
| `prompt` | `string` |
| `systemPrompt` | `undefined` |
#### Defined in
[packages/core/src/llm/LLM.ts:487](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L487)
---
### mapMessagesToPromptMeta
**mapMessagesToPromptMeta**(`messages`, `opts?`): `Object`
#### Parameters
| Name | Type |
| :-------------------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `opts?` | `Object` |
| `opts.replicate4Bit?` | `boolean` |
| `opts.withBos?` | `boolean` |
| `opts.withNewlines?` | `boolean` |
#### Returns
`Object`
| Name | Type |
| :------------- | :------- |
| `prompt` | `string` |
| `systemPrompt` | `any` |
#### Defined in
[packages/core/src/llm/LLM.ts:514](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L514)
---
### tokens
**tokens**(`messages`): `number`
Calculates the number of tokens needed for the given chat messages
#### Parameters
| Name | Type |
| :--------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
#### Returns
`number`
#### Implementation of
[LLM](../interfaces/LLM.md).[tokens](../interfaces/LLM.md#tokens)
#### Defined in
[packages/core/src/llm/LLM.ts:450](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L450)
@@ -0,0 +1,161 @@
---
id: "MarkdownReader"
title: "Class: MarkdownReader"
sidebar_label: "MarkdownReader"
sidebar_position: 0
custom_edit_url: null
---
Extract text from markdown files.
Returns dictionary with keys as headers and values as the text between headers.
## Implements
- [`BaseReader`](../interfaces/BaseReader.md)
## Constructors
### constructor
**new MarkdownReader**(`removeHyperlinks?`, `removeImages?`)
#### Parameters
| Name | Type | Default value | Description |
| :------------------ | :-------- | :------------ | :---------------------------------------------- |
| `removeHyperlinks?` | `boolean` | `true` | Indicates whether hyperlinks should be removed. |
| `removeImages?` | `boolean` | `true` | Indicates whether images should be removed. |
#### Defined in
[packages/core/src/readers/MarkdownReader.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L19)
## Properties
### \_removeHyperlinks
`Private` **\_removeHyperlinks**: `boolean`
#### Defined in
[packages/core/src/readers/MarkdownReader.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L12)
---
### \_removeImages
`Private` **\_removeImages**: `boolean`
#### Defined in
[packages/core/src/readers/MarkdownReader.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L13)
## Methods
### loadData
**loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
#### Parameters
| Name | Type | Default value |
| :----- | :-------------------------------------------------------- | :------------ |
| `file` | `string` | `undefined` |
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
#### Returns
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
#### Implementation of
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
#### Defined in
[packages/core/src/readers/MarkdownReader.ts:90](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L90)
---
### markdownToTups
**markdownToTups**(`markdownText`): `MarkdownTuple`[]
Convert a markdown file to a dictionary.
The keys are the headers and the values are the text under each header.
#### Parameters
| Name | Type | Description |
| :------------- | :------- | :---------------------------- |
| `markdownText` | `string` | The markdown text to convert. |
#### Returns
`MarkdownTuple`[]
- An array of tuples, where each tuple contains a header (or null) and its corresponding text.
#### Defined in
[packages/core/src/readers/MarkdownReader.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L30)
---
### parseTups
**parseTups**(`content`): `MarkdownTuple`[]
#### Parameters
| Name | Type |
| :-------- | :------- |
| `content` | `string` |
#### Returns
`MarkdownTuple`[]
#### Defined in
[packages/core/src/readers/MarkdownReader.ts:79](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L79)
---
### removeHyperlinks
**removeHyperlinks**(`content`): `string`
#### Parameters
| Name | Type |
| :-------- | :------- |
| `content` | `string` |
#### Returns
`string`
#### Defined in
[packages/core/src/readers/MarkdownReader.ts:74](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L74)
---
### removeImages
**removeImages**(`content`): `string`
#### Parameters
| Name | Type |
| :-------- | :------- |
| `content` | `string` |
#### Returns
`string`
#### Defined in
[packages/core/src/readers/MarkdownReader.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/MarkdownReader.ts#L69)
@@ -0,0 +1,223 @@
---
id: "MongoDBAtlasVectorSearch"
title: "Class: MongoDBAtlasVectorSearch"
sidebar_label: "MongoDBAtlasVectorSearch"
sidebar_position: 0
custom_edit_url: null
---
## Implements
- [`VectorStore`](../interfaces/VectorStore.md)
## Constructors
### constructor
**new MongoDBAtlasVectorSearch**(`init`)
#### Parameters
| Name | Type |
| :----- | :-------------------------------------------------------------------------------------------------------------------------- |
| `init` | `Partial`<[`MongoDBAtlasVectorSearch`](MongoDBAtlasVectorSearch.md)\> & { `collectionName`: `string` ; `dbName`: `string` } |
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L36)
## Properties
### collection
`Private` **collection**: `Collection`<`Document`\>
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L34)
---
### embeddingKey
**embeddingKey**: `string`
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:29](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L29)
---
### flatMetadata
**flatMetadata**: `boolean` = `true`
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:25](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L25)
---
### idKey
**idKey**: `string`
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L30)
---
### indexName
**indexName**: `string`
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L28)
---
### insertOptions
`Optional` **insertOptions**: `BulkWriteOptions`
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L33)
---
### metadataKey
**metadataKey**: `string`
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L32)
---
### mongodbClient
**mongodbClient**: `MongoClient`
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L27)
---
### storesText
**storesText**: `boolean` = `true`
#### Implementation of
[VectorStore](../interfaces/VectorStore.md).[storesText](../interfaces/VectorStore.md#storestext)
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L24)
---
### textKey
**textKey**: `string`
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:31](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L31)
## Accessors
### client
`get` **client**(): `any`
#### Returns
`any`
#### Implementation of
VectorStore.client
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:103](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L103)
## Methods
### add
**add**(`nodes`): `Promise`<`string`[]\>
#### Parameters
| Name | Type |
| :------ | :------------------------------------------------------- |
| `nodes` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
#### Returns
`Promise`<`string`[]\>
#### Implementation of
[VectorStore](../interfaces/VectorStore.md).[add](../interfaces/VectorStore.md#add)
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L65)
---
### delete
**delete**(`refDocId`, `deleteOptions?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :--------------- | :------- |
| `refDocId` | `string` |
| `deleteOptions?` | `any` |
#### Returns
`Promise`<`void`\>
#### Implementation of
[VectorStore](../interfaces/VectorStore.md).[delete](../interfaces/VectorStore.md#delete)
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:94](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L94)
---
### query
**query**(`query`, `options?`): `Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
#### Parameters
| Name | Type |
| :--------- | :------------------------------------------------------ |
| `query` | [`VectorStoreQuery`](../interfaces/VectorStoreQuery.md) |
| `options?` | `any` |
#### Returns
`Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
#### Implementation of
[VectorStore](../interfaces/VectorStore.md).[query](../interfaces/VectorStore.md#query)
#### Defined in
[packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts:107](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/MongoDBAtlasVectorStore.ts#L107)
@@ -0,0 +1,139 @@
---
id: "MultiModalEmbedding"
title: "Class: MultiModalEmbedding"
sidebar_label: "MultiModalEmbedding"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`BaseEmbedding`](BaseEmbedding.md)
**`MultiModalEmbedding`**
↳↳ [`ClipEmbedding`](ClipEmbedding.md)
## Constructors
### constructor
**new MultiModalEmbedding**()
#### Inherited from
[BaseEmbedding](BaseEmbedding.md).[constructor](BaseEmbedding.md#constructor)
## Methods
### getImageEmbedding
`Abstract` **getImageEmbedding**(`images`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------- | :--------------------------- |
| `images` | [`ImageType`](../#imagetype) |
#### Returns
`Promise`<`number`[]\>
#### Defined in
[packages/core/src/embeddings/MultiModalEmbedding.ts:9](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/MultiModalEmbedding.ts#L9)
---
### getImageEmbeddings
**getImageEmbeddings**(`images`): `Promise`<`number`[][]\>
#### Parameters
| Name | Type |
| :------- | :----------------------------- |
| `images` | [`ImageType`](../#imagetype)[] |
#### Returns
`Promise`<`number`[][]\>
#### Defined in
[packages/core/src/embeddings/MultiModalEmbedding.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/MultiModalEmbedding.ts#L11)
---
### getQueryEmbedding
`Abstract` **getQueryEmbedding**(`query`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `query` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Inherited from
[BaseEmbedding](BaseEmbedding.md).[getQueryEmbedding](BaseEmbedding.md#getqueryembedding)
#### Defined in
[packages/core/src/embeddings/types.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L23)
---
### getTextEmbedding
`Abstract` **getTextEmbedding**(`text`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :----- | :------- |
| `text` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Inherited from
[BaseEmbedding](BaseEmbedding.md).[getTextEmbedding](BaseEmbedding.md#gettextembedding)
#### Defined in
[packages/core/src/embeddings/types.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L22)
---
### similarity
**similarity**(`embedding1`, `embedding2`, `mode?`): `number`
#### Parameters
| Name | Type | Default value |
| :----------- | :--------------------------------------------- | :----------------------- |
| `embedding1` | `number`[] | `undefined` |
| `embedding2` | `number`[] | `undefined` |
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
#### Returns
`number`
#### Inherited from
[BaseEmbedding](BaseEmbedding.md).[similarity](BaseEmbedding.md#similarity)
#### Defined in
[packages/core/src/embeddings/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L14)
@@ -0,0 +1,135 @@
---
id: "NotionReader"
title: "Class: NotionReader"
sidebar_label: "NotionReader"
sidebar_position: 0
custom_edit_url: null
---
Notion pages are retrieved recursively and converted to Document objects.
Notion Database can also be loaded, and [the serialization method can be customized](https://github.com/TomPenguin/notion-md-crawler/tree/main).
[Note] To use this reader, must be created the Notion integration must be created in advance
Please refer to [this document](https://www.notion.so/help/create-integrations-with-the-notion-api) for details.
## Implements
- [`BaseReader`](../interfaces/BaseReader.md)
## Constructors
### constructor
**new NotionReader**(`options`)
Constructor for the NotionReader class
#### Parameters
| Name | Type | Description |
| :-------- | :-------------------- | :----------------------------------- |
| `options` | `NotionReaderOptions` | Configuration options for the reader |
#### Defined in
[packages/core/src/readers/NotionReader.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/NotionReader.ts#L33)
## Properties
### crawl
`Private` **crawl**: (`rootPageId`: `string`) => `Promise`<`Pages`\>
#### Type declaration
▸ (`rootPageId`): `Promise`<`Pages`\>
##### Parameters
| Name | Type |
| :----------- | :------- |
| `rootPageId` | `string` |
##### Returns
`Promise`<`Pages`\>
#### Defined in
[packages/core/src/readers/NotionReader.ts:27](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/NotionReader.ts#L27)
## Methods
### loadData
**loadData**(`rootPageId`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
Loads recursively Notion pages and converts them to an array of Document objects
#### Parameters
| Name | Type | Description |
| :----------- | :------- | :---------------------- |
| `rootPageId` | `string` | The root Notion page ID |
#### Returns
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
A Promise that resolves to an array of Document objects
#### Implementation of
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
#### Defined in
[packages/core/src/readers/NotionReader.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/NotionReader.ts#L63)
---
### loadPages
**loadPages**(`rootPageId`): `Promise`<`Pages`\>
Loads recursively the Notion page with the specified root page ID.
#### Parameters
| Name | Type | Description |
| :----------- | :------- | :---------------------- |
| `rootPageId` | `string` | The root Notion page ID |
#### Returns
`Promise`<`Pages`\>
A Promise that resolves to a Pages object(Convertible with the `toDocuments` method)
#### Defined in
[packages/core/src/readers/NotionReader.ts:54](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/NotionReader.ts#L54)
---
### toDocuments
**toDocuments**(`pages`): [`Document`](Document.md)<[`Metadata`](../#metadata)\>[]
Converts Pages to an array of Document objects
#### Parameters
| Name | Type | Description |
| :------ | :------ | :-------------------------------------------------------- |
| `pages` | `Pages` | The Notion pages to convert (Return value of `loadPages`) |
#### Returns
[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]
An array of Document objects
#### Defined in
[packages/core/src/readers/NotionReader.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/NotionReader.ts#L42)
@@ -0,0 +1,338 @@
---
id: "OpenAI"
title: "Class: OpenAI"
sidebar_label: "OpenAI"
sidebar_position: 0
custom_edit_url: null
---
OpenAI LLM implementation
## Implements
- [`LLM`](../interfaces/LLM.md)
## Constructors
### constructor
**new OpenAI**(`init?`)
#### Parameters
| Name | Type |
| :------ | :-------------------------------------------------------------------- |
| `init?` | `Partial`<[`OpenAI`](OpenAI.md)\> & { `azure?`: `AzureOpenAIConfig` } |
#### Defined in
[packages/core/src/llm/LLM.ts:152](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L152)
## Properties
### additionalChatOptions
`Optional` **additionalChatOptions**: `Omit`<`Partial`<`ChatCompletionCreateParams`\>, `"model"` \| `"temperature"` \| `"max_tokens"` \| `"messages"` \| `"top_p"` \| `"streaming"`\>
#### Defined in
[packages/core/src/llm/LLM.ts:135](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L135)
---
### additionalSessionOptions
`Optional` **additionalSessionOptions**: `Omit`<`Partial`<`ClientOptions`\>, `"apiKey"` \| `"timeout"` \| `"maxRetries"`\>
#### Defined in
[packages/core/src/llm/LLM.ts:145](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L145)
---
### apiKey
`Optional` **apiKey**: `string` = `undefined`
#### Defined in
[packages/core/src/llm/LLM.ts:141](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L141)
---
### callbackManager
`Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
#### Defined in
[packages/core/src/llm/LLM.ts:150](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L150)
---
### hasStreaming
**hasStreaming**: `boolean` = `true`
#### Implementation of
[LLM](../interfaces/LLM.md).[hasStreaming](../interfaces/LLM.md#hasstreaming)
#### Defined in
[packages/core/src/llm/LLM.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L128)
---
### maxRetries
**maxRetries**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:142](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L142)
---
### maxTokens
`Optional` **maxTokens**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:134](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L134)
---
### model
**model**: `"gpt-3.5-turbo"` \| `"gpt-3.5-turbo-1106"` \| `"gpt-3.5-turbo-16k"` \| `"gpt-4"` \| `"gpt-4-32k"` \| `"gpt-4-1106-preview"` \| `"gpt-4-vision-preview"`
#### Defined in
[packages/core/src/llm/LLM.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L131)
---
### session
**session**: `OpenAISession`
#### Defined in
[packages/core/src/llm/LLM.ts:144](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L144)
---
### temperature
**temperature**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:132](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L132)
---
### timeout
`Optional` **timeout**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:143](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L143)
---
### topP
**topP**: `number`
#### Defined in
[packages/core/src/llm/LLM.ts:133](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L133)
## Accessors
### metadata
`get` **metadata**(): `Object`
#### Returns
`Object`
| Name | Type |
| :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `contextWindow` | `number` |
| `maxTokens` | `undefined` \| `number` |
| `model` | `"gpt-3.5-turbo"` \| `"gpt-3.5-turbo-1106"` \| `"gpt-3.5-turbo-16k"` \| `"gpt-4"` \| `"gpt-4-32k"` \| `"gpt-4-1106-preview"` \| `"gpt-4-vision-preview"` |
| `temperature` | `number` |
| `tokenizer` | [`CL100K_BASE`](../enums/Tokenizers.md#cl100k_base) |
| `topP` | `number` |
#### Implementation of
[LLM](../interfaces/LLM.md).[metadata](../interfaces/LLM.md#metadata)
#### Defined in
[packages/core/src/llm/LLM.ts:206](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L206)
## Methods
### chat
**chat**<`T`, `R`\>(`messages`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
Get a chat response from the LLM
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
#### Parameters
| Name | Type | Description |
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | The return type of chat() and complete() are set by the "streaming" parameter being set to True. |
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
| `streaming?` | `T` | - |
#### Returns
`Promise`<`R`\>
#### Implementation of
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
#### Defined in
[packages/core/src/llm/LLM.ts:249](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L249)
---
### complete
**complete**<`T`, `R`\>(`prompt`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
Get a prompt completion from the LLM
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
#### Parameters
| Name | Type | Description |
| :------------- | :-------------------------------- | :--------------------- |
| `prompt` | `string` | the prompt to complete |
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
| `streaming?` | `T` | - |
#### Returns
`Promise`<`R`\>
#### Implementation of
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
#### Defined in
[packages/core/src/llm/LLM.ts:286](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L286)
---
### mapMessageType
**mapMessageType**(`messageType`): `"function"` \| `"user"` \| `"assistant"` \| `"system"`
#### Parameters
| Name | Type |
| :------------ | :------------------------------- |
| `messageType` | [`MessageType`](../#messagetype) |
#### Returns
`"function"` \| `"user"` \| `"assistant"` \| `"system"`
#### Defined in
[packages/core/src/llm/LLM.ts:232](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L232)
---
### streamChat
`Protected` **streamChat**(`messages`, `parentEvent?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
#### Parameters
| Name | Type |
| :------------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`AsyncGenerator`<`string`, `void`, `unknown`\>
#### Defined in
[packages/core/src/llm/LLM.ts:300](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L300)
---
### streamComplete
`Protected` **streamComplete**(`query`, `parentEvent?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
#### Parameters
| Name | Type |
| :------------- | :-------------------------------- |
| `query` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`AsyncGenerator`<`string`, `void`, `unknown`\>
#### Defined in
[packages/core/src/llm/LLM.ts:362](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L362)
---
### tokens
**tokens**(`messages`): `number`
Calculates the number of tokens needed for the given chat messages
#### Parameters
| Name | Type |
| :--------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
#### Returns
`number`
#### Implementation of
[LLM](../interfaces/LLM.md).[tokens](../interfaces/LLM.md#tokens)
#### Defined in
[packages/core/src/llm/LLM.ts:217](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L217)
@@ -0,0 +1,187 @@
---
id: "OpenAIEmbedding"
title: "Class: OpenAIEmbedding"
sidebar_label: "OpenAIEmbedding"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`BaseEmbedding`](BaseEmbedding.md)
**`OpenAIEmbedding`**
## Constructors
### constructor
**new OpenAIEmbedding**(`init?`)
#### Parameters
| Name | Type |
| :------ | :-------------------------------------------------------------------------------------- |
| `init?` | `Partial`<[`OpenAIEmbedding`](OpenAIEmbedding.md)\> & { `azure?`: `AzureOpenAIConfig` } |
#### Overrides
[BaseEmbedding](BaseEmbedding.md).[constructor](BaseEmbedding.md#constructor)
#### Defined in
[packages/core/src/embeddings/OpenAIEmbedding.ts:30](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L30)
## Properties
### additionalSessionOptions
`Optional` **additionalSessionOptions**: `Omit`<`Partial`<`ClientOptions`\>, `"apiKey"` \| `"timeout"` \| `"maxRetries"`\>
#### Defined in
[packages/core/src/embeddings/OpenAIEmbedding.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L23)
---
### apiKey
`Optional` **apiKey**: `string` = `undefined`
#### Defined in
[packages/core/src/embeddings/OpenAIEmbedding.ts:20](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L20)
---
### maxRetries
**maxRetries**: `number`
#### Defined in
[packages/core/src/embeddings/OpenAIEmbedding.ts:21](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L21)
---
### model
**model**: [`TEXT_EMBED_ADA_002`](../enums/OpenAIEmbeddingModelType.md#text_embed_ada_002)
#### Defined in
[packages/core/src/embeddings/OpenAIEmbedding.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L17)
---
### session
**session**: `OpenAISession`
#### Defined in
[packages/core/src/embeddings/OpenAIEmbedding.ts:28](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L28)
---
### timeout
`Optional` **timeout**: `number`
#### Defined in
[packages/core/src/embeddings/OpenAIEmbedding.ts:22](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L22)
## Methods
### getOpenAIEmbedding
`Private` **getOpenAIEmbedding**(`input`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `input` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Defined in
[packages/core/src/embeddings/OpenAIEmbedding.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L76)
---
### getQueryEmbedding
**getQueryEmbedding**(`query`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `query` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Overrides
[BaseEmbedding](BaseEmbedding.md).[getQueryEmbedding](BaseEmbedding.md#getqueryembedding)
#### Defined in
[packages/core/src/embeddings/OpenAIEmbedding.ts:89](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L89)
---
### getTextEmbedding
**getTextEmbedding**(`text`): `Promise`<`number`[]\>
#### Parameters
| Name | Type |
| :----- | :------- |
| `text` | `string` |
#### Returns
`Promise`<`number`[]\>
#### Overrides
[BaseEmbedding](BaseEmbedding.md).[getTextEmbedding](BaseEmbedding.md#gettextembedding)
#### Defined in
[packages/core/src/embeddings/OpenAIEmbedding.ts:85](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/OpenAIEmbedding.ts#L85)
---
### similarity
**similarity**(`embedding1`, `embedding2`, `mode?`): `number`
#### Parameters
| Name | Type | Default value |
| :----------- | :--------------------------------------------- | :----------------------- |
| `embedding1` | `number`[] | `undefined` |
| `embedding2` | `number`[] | `undefined` |
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
#### Returns
`number`
#### Inherited from
[BaseEmbedding](BaseEmbedding.md).[similarity](BaseEmbedding.md#similarity)
#### Defined in
[packages/core/src/embeddings/types.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/embeddings/types.ts#L14)
@@ -0,0 +1,44 @@
---
id: "PDFReader"
title: "Class: PDFReader"
sidebar_label: "PDFReader"
sidebar_position: 0
custom_edit_url: null
---
Read the text of a PDF
## Implements
- [`BaseReader`](../interfaces/BaseReader.md)
## Constructors
### constructor
**new PDFReader**()
## Methods
### loadData
**loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
#### Parameters
| Name | Type | Default value |
| :----- | :-------------------------------------------------------- | :------------ |
| `file` | `string` | `undefined` |
| `fs` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` |
#### Returns
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
#### Implementation of
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
#### Defined in
[packages/core/src/readers/PDFReader.ts:11](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/PDFReader.ts#L11)
@@ -0,0 +1,293 @@
---
id: "PGVectorStore"
title: "Class: PGVectorStore"
sidebar_label: "PGVectorStore"
sidebar_position: 0
custom_edit_url: null
---
Provides support for writing and querying vector data in Postgres.
## Implements
- [`VectorStore`](../interfaces/VectorStore.md)
## Constructors
### constructor
**new PGVectorStore**()
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L40)
## Properties
### collection
`Private` **collection**: `string` = `""`
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:18](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L18)
---
### db
`Optional` **db**: `Client`
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L38)
---
### storesText
**storesText**: `boolean` = `true`
#### Implementation of
[VectorStore](../interfaces/VectorStore.md).[storesText](../interfaces/VectorStore.md#storestext)
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:16](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L16)
## Methods
### add
**add**(`embeddingResults`): `Promise`<`string`[]\>
Adds vector record(s) to the table.
NOTE: Uses the collection property controlled by setCollection/getCollection.
#### Parameters
| Name | Type | Description |
| :----------------- | :------------------------------------------------------- | :-------------------------------------------------------------- |
| `embeddingResults` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] | The Nodes to be inserted, optionally including metadata tuples. |
#### Returns
`Promise`<`string`[]\>
A list of zero or more id values for the created records.
#### Implementation of
[VectorStore](../interfaces/VectorStore.md).[add](../interfaces/VectorStore.md#add)
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:144](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L144)
---
### checkSchema
`Private` **checkSchema**(`db`): `Promise`<`Client`\>
#### Parameters
| Name | Type |
| :--- | :------- |
| `db` | `Client` |
#### Returns
`Promise`<`Client`\>
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:90](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L90)
---
### clearCollection
**clearCollection**(): `Promise`<`QueryResult`<`any`\>\>
Delete all vector records for the specified collection.
NOTE: Uses the collection property controlled by setCollection/getCollection.
#### Returns
`Promise`<`QueryResult`<`any`\>\>
The result of the delete query.
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:128](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L128)
---
### client
**client**(): `Promise`<`Client`\>
Connects to the database specified in environment vars.
This method also checks and creates the vector extension,
the destination table and indexes if not found.
#### Returns
`Promise`<`Client`\>
A connection to the database, or the error encountered while connecting/setting up.
#### Implementation of
[VectorStore](../interfaces/VectorStore.md).[client](../interfaces/VectorStore.md#client)
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:119](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L119)
---
### delete
**delete**(`refDocId`, `deleteKwargs?`): `Promise`<`void`\>
Deletes a single record from the database by id.
NOTE: Uses the collection property controlled by setCollection/getCollection.
#### Parameters
| Name | Type | Description |
| :-------------- | :------- | :---------------------------------------------------- |
| `refDocId` | `string` | Unique identifier for the record to delete. |
| `deleteKwargs?` | `any` | Required by VectorStore interface. Currently ignored. |
#### Returns
`Promise`<`void`\>
Promise that resolves if the delete query did not throw an error.
#### Implementation of
[VectorStore](../interfaces/VectorStore.md).[delete](../interfaces/VectorStore.md#delete)
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:196](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L196)
---
### getCollection
**getCollection**(): `string`
Getter for the collection property.
Using a collection allows for simple segregation of vector data,
e.g. by user, source, or access-level.
Leave/set blank to ignore the collection value when querying.
#### Returns
`string`
The currently-set collection value. Default is empty string.
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L60)
---
### getDb
`Private` **getDb**(): `Promise`<`Client`\>
#### Returns
`Promise`<`Client`\>
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L64)
---
### persist
**persist**(`persistPath`, `fs?`): `Promise`<`void`\>
Required by VectorStore interface. Currently ignored.
#### Parameters
| Name | Type |
| :------------ | :-------------------------------------------------------- |
| `persistPath` | `string` |
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
#### Returns
`Promise`<`void`\>
Resolved Promise.
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:269](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L269)
---
### query
**query**(`query`, `options?`): `Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
Query the vector store for the closest matching data to the query embeddings
#### Parameters
| Name | Type | Description |
| :--------- | :------------------------------------------------------ | :---------------------------------------------------- |
| `query` | [`VectorStoreQuery`](../interfaces/VectorStoreQuery.md) | The VectorStoreQuery to be used |
| `options?` | `any` | Required by VectorStore interface. Currently ignored. |
#### Returns
`Promise`<[`VectorStoreQueryResult`](../interfaces/VectorStoreQueryResult.md)\>
Zero or more Document instances with data from the vector store.
#### Implementation of
[VectorStore](../interfaces/VectorStore.md).[query](../interfaces/VectorStore.md#query)
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:217](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L217)
---
### setCollection
**setCollection**(`coll`): `void`
Setter for the collection property.
Using a collection allows for simple segregation of vector data,
e.g. by user, source, or access-level.
Leave/set blank to ignore the collection value when querying.
#### Parameters
| Name | Type | Description |
| :----- | :------- | :----------------------- |
| `coll` | `string` | Name for the collection. |
#### Returns
`void`
#### Defined in
[packages/core/src/storage/vectorStore/PGVectorStore.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/vectorStore/PGVectorStore.ts#L49)
@@ -0,0 +1,105 @@
---
id: "PapaCSVReader"
title: "Class: PapaCSVReader"
sidebar_label: "PapaCSVReader"
sidebar_position: 0
custom_edit_url: null
---
papaparse-based csv parser
**`Implements`**
BaseReader
## Implements
- [`BaseReader`](../interfaces/BaseReader.md)
## Constructors
### constructor
**new PapaCSVReader**(`concatRows?`, `colJoiner?`, `rowJoiner?`, `papaConfig?`)
Constructs a new instance of the class.
#### Parameters
| Name | Type | Default value | Description |
| :------------ | :--------------------------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------- |
| `concatRows?` | `boolean` | `true` | whether to concatenate all rows into one document.If set to False, a Document will be created for each row.True by default. |
| `colJoiner?` | `string` | `", "` | - |
| `rowJoiner?` | `string` | `"\n"` | Separator to use for joining each row.Only used when `concat_rows=True`.Set to "\n" by default. |
| `papaConfig?` | `ParseConfig`<`any`, `undefined`\> | `undefined` | - |
#### Defined in
[packages/core/src/readers/CSVReader.ts:23](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L23)
## Properties
### colJoiner
`Private` **colJoiner**: `string`
#### Defined in
[packages/core/src/readers/CSVReader.ts:13](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L13)
---
### concatRows
`Private` **concatRows**: `boolean`
#### Defined in
[packages/core/src/readers/CSVReader.ts:12](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L12)
---
### papaConfig
`Private` `Optional` **papaConfig**: `ParseConfig`<`any`, `undefined`\>
#### Defined in
[packages/core/src/readers/CSVReader.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L15)
---
### rowJoiner
`Private` **rowJoiner**: `string`
#### Defined in
[packages/core/src/readers/CSVReader.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L14)
## Methods
### loadData
**loadData**(`file`, `fs?`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
Loads data from csv files
#### Parameters
| Name | Type | Default value | Description |
| :----- | :-------------------------------------------------------- | :------------ | :------------------------------------------- |
| `file` | `string` | `undefined` | The path to the file to load. |
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `DEFAULT_FS` | The file system to use for reading the file. |
#### Returns
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
#### Implementation of
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
#### Defined in
[packages/core/src/readers/CSVReader.ts:41](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/CSVReader.ts#L41)
@@ -0,0 +1,261 @@
---
id: "Portkey"
title: "Class: Portkey"
sidebar_label: "Portkey"
sidebar_position: 0
custom_edit_url: null
---
Unified language model interface
## Implements
- [`LLM`](../interfaces/LLM.md)
## Constructors
### constructor
**new Portkey**(`init?`)
#### Parameters
| Name | Type |
| :------ | :---------------------------------- |
| `init?` | `Partial`<[`Portkey`](Portkey.md)\> |
#### Defined in
[packages/core/src/llm/LLM.ts:812](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L812)
## Properties
### apiKey
`Optional` **apiKey**: `string` = `undefined`
#### Defined in
[packages/core/src/llm/LLM.ts:805](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L805)
---
### baseURL
`Optional` **baseURL**: `string` = `undefined`
#### Defined in
[packages/core/src/llm/LLM.ts:806](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L806)
---
### callbackManager
`Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
#### Defined in
[packages/core/src/llm/LLM.ts:810](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L810)
---
### hasStreaming
**hasStreaming**: `boolean` = `true`
#### Implementation of
[LLM](../interfaces/LLM.md).[hasStreaming](../interfaces/LLM.md#hasstreaming)
#### Defined in
[packages/core/src/llm/LLM.ts:803](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L803)
---
### llms
`Optional` **llms**: `null` \| [`LLMOptions`] = `undefined`
#### Defined in
[packages/core/src/llm/LLM.ts:808](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L808)
---
### mode
`Optional` **mode**: `string` = `undefined`
#### Defined in
[packages/core/src/llm/LLM.ts:807](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L807)
---
### session
**session**: `PortkeySession`
#### Defined in
[packages/core/src/llm/LLM.ts:809](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L809)
## Accessors
### metadata
`get` **metadata**(): [`LLMMetadata`](../interfaces/LLMMetadata.md)
#### Returns
[`LLMMetadata`](../interfaces/LLMMetadata.md)
#### Implementation of
[LLM](../interfaces/LLM.md).[metadata](../interfaces/LLM.md#metadata)
#### Defined in
[packages/core/src/llm/LLM.ts:830](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L830)
## Methods
### chat
**chat**<`T`, `R`\>(`messages`, `parentEvent?`, `streaming?`, `params?`): `Promise`<`R`\>
Get a chat response from the LLM
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
#### Parameters
| Name | Type | Description |
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | The return type of chat() and complete() are set by the "streaming" parameter being set to True. |
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
| `streaming?` | `T` | - |
| `params?` | `Record`<`string`, `any`\> | - |
#### Returns
`Promise`<`R`\>
#### Implementation of
[LLM](../interfaces/LLM.md).[chat](../interfaces/LLM.md#chat)
#### Defined in
[packages/core/src/llm/LLM.ts:834](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L834)
---
### complete
**complete**<`T`, `R`\>(`prompt`, `parentEvent?`, `streaming?`): `Promise`<`R`\>
Get a prompt completion from the LLM
#### Type parameters
| Name | Type |
| :--- | :-------------------------------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`ChatResponse`](../interfaces/ChatResponse.md) |
#### Parameters
| Name | Type | Description |
| :------------- | :-------------------------------- | :--------------------- |
| `prompt` | `string` | the prompt to complete |
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
| `streaming?` | `T` | - |
#### Returns
`Promise`<`R`\>
#### Implementation of
[LLM](../interfaces/LLM.md).[complete](../interfaces/LLM.md#complete)
#### Defined in
[packages/core/src/llm/LLM.ts:858](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L858)
---
### streamChat
**streamChat**(`messages`, `parentEvent?`, `params?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
#### Parameters
| Name | Type |
| :------------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
| `params?` | `Record`<`string`, `any`\> |
#### Returns
`AsyncGenerator`<`string`, `void`, `unknown`\>
#### Defined in
[packages/core/src/llm/LLM.ts:873](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L873)
---
### streamComplete
**streamComplete**(`query`, `parentEvent?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
#### Parameters
| Name | Type |
| :------------- | :-------------------------------- |
| `query` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`AsyncGenerator`<`string`, `void`, `unknown`\>
#### Defined in
[packages/core/src/llm/LLM.ts:920](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L920)
---
### tokens
**tokens**(`messages`): `number`
Calculates the number of tokens needed for the given chat messages
#### Parameters
| Name | Type |
| :--------- | :---------------------------------------------- |
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
#### Returns
`number`
#### Implementation of
[LLM](../interfaces/LLM.md).[tokens](../interfaces/LLM.md#tokens)
#### Defined in
[packages/core/src/llm/LLM.ts:826](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/llm/LLM.ts#L826)
@@ -0,0 +1,198 @@
---
id: "PromptHelper"
title: "Class: PromptHelper"
sidebar_label: "PromptHelper"
sidebar_position: 0
custom_edit_url: null
---
A collection of helper functions for working with prompts.
## Constructors
### constructor
**new PromptHelper**(`contextWindow?`, `numOutput?`, `chunkOverlapRatio?`, `chunkSizeLimit?`, `tokenizer?`, `separator?`)
#### Parameters
| Name | Type | Default value |
| :------------------ | :---------------------------------- | :---------------------------- |
| `contextWindow` | `number` | `DEFAULT_CONTEXT_WINDOW` |
| `numOutput` | `number` | `DEFAULT_NUM_OUTPUTS` |
| `chunkOverlapRatio` | `number` | `DEFAULT_CHUNK_OVERLAP_RATIO` |
| `chunkSizeLimit?` | `number` | `undefined` |
| `tokenizer?` | (`text`: `string`) => `Uint32Array` | `undefined` |
| `separator` | `string` | `" "` |
#### Defined in
[packages/core/src/PromptHelper.ts:40](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L40)
## Properties
### chunkOverlapRatio
**chunkOverlapRatio**: `number` = `DEFAULT_CHUNK_OVERLAP_RATIO`
#### Defined in
[packages/core/src/PromptHelper.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L35)
---
### chunkSizeLimit
`Optional` **chunkSizeLimit**: `number`
#### Defined in
[packages/core/src/PromptHelper.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L36)
---
### contextWindow
**contextWindow**: `number` = `DEFAULT_CONTEXT_WINDOW`
#### Defined in
[packages/core/src/PromptHelper.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L33)
---
### numOutput
**numOutput**: `number` = `DEFAULT_NUM_OUTPUTS`
#### Defined in
[packages/core/src/PromptHelper.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L34)
---
### separator
**separator**: `string` = `" "`
#### Defined in
[packages/core/src/PromptHelper.ts:38](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L38)
---
### tokenizer
**tokenizer**: (`text`: `string`) => `Uint32Array`
#### Type declaration
▸ (`text`): `Uint32Array`
##### Parameters
| Name | Type |
| :----- | :------- |
| `text` | `string` |
##### Returns
`Uint32Array`
#### Defined in
[packages/core/src/PromptHelper.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L37)
## Methods
### getAvailableChunkSize
`Private` **getAvailableChunkSize**(`prompt`, `numChunks?`, `padding?`): `number`
Find the maximum size of each chunk given a prompt.
#### Parameters
| Name | Type | Default value |
| :---------- | :--------------------------------- | :------------ |
| `prompt` | [`SimplePrompt`](../#simpleprompt) | `undefined` |
| `numChunks` | `number` | `1` |
| `padding` | `number` | `5` |
#### Returns
`number`
#### Defined in
[packages/core/src/PromptHelper.ts:76](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L76)
---
### getAvailableContextSize
`Private` **getAvailableContextSize**(`prompt`): `number`
Given a prompt, return the maximum size of the inputs to the prompt.
#### Parameters
| Name | Type |
| :------- | :--------------------------------- |
| `prompt` | [`SimplePrompt`](../#simpleprompt) |
#### Returns
`number`
#### Defined in
[packages/core/src/PromptHelper.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L61)
---
### getTextSplitterGivenPrompt
**getTextSplitterGivenPrompt**(`prompt`, `numChunks?`, `padding?`): [`SentenceSplitter`](SentenceSplitter.md)
Creates a text splitter with the correct chunk sizes and overlaps given a prompt.
#### Parameters
| Name | Type | Default value |
| :---------- | :--------------------------------- | :---------------- |
| `prompt` | [`SimplePrompt`](../#simpleprompt) | `undefined` |
| `numChunks` | `number` | `1` |
| `padding` | `number` | `DEFAULT_PADDING` |
#### Returns
[`SentenceSplitter`](SentenceSplitter.md)
#### Defined in
[packages/core/src/PromptHelper.ts:99](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L99)
---
### repack
**repack**(`prompt`, `textChunks`, `padding?`): `string`[]
Repack resplits the strings based on the optimal text splitter.
#### Parameters
| Name | Type | Default value |
| :----------- | :--------------------------------- | :---------------- |
| `prompt` | [`SimplePrompt`](../#simpleprompt) | `undefined` |
| `textChunks` | `string`[] | `undefined` |
| `padding` | `number` | `DEFAULT_PADDING` |
#### Returns
`string`[]
#### Defined in
[packages/core/src/PromptHelper.ts:120](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/PromptHelper.ts#L120)
@@ -0,0 +1,167 @@
---
id: "Refine"
title: "Class: Refine"
sidebar_label: "Refine"
sidebar_position: 0
custom_edit_url: null
---
A response builder that uses the query to ask the LLM generate a better response using multiple text chunks.
## Hierarchy
- **`Refine`**
↳ [`CompactAndRefine`](CompactAndRefine.md)
## Implements
- `BaseResponseBuilder`
## Constructors
### constructor
**new Refine**(`serviceContext`, `textQATemplate?`, `refineTemplate?`)
#### Parameters
| Name | Type |
| :---------------- | :-------------------------------------------------- |
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
| `textQATemplate?` | (`__namedParameters`: `Object`) => `string` |
| `refineTemplate?` | (`__namedParameters`: `Object`) => `string` |
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:82](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L82)
## Properties
### refineTemplate
**refineTemplate**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:80](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L80)
---
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L78)
---
### textQATemplate
**textQATemplate**: (`__namedParameters`: `Object`) => `string`
#### Type declaration
▸ (`«destructured»`): `string`
##### Parameters
| Name | Type |
| :--------------- | :------- |
| `«destructured»` | `Object` |
##### Returns
`string`
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:79](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L79)
## Methods
### getResponse
**getResponse**(`query`, `textChunks`, `parentEvent?`, `prevResponse?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :-------------- | :-------------------------------- |
| `query` | `string` |
| `textChunks` | `string`[] |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
| `prevResponse?` | `string` |
#### Returns
`Promise`<`string`\>
#### Implementation of
BaseResponseBuilder.getResponse
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:92](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L92)
---
### giveResponseSingle
`Private` **giveResponseSingle**(`queryStr`, `textChunk`, `parentEvent?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------------- | :-------------------------------- |
| `queryStr` | `string` |
| `textChunk` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<`string`\>
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:117](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L117)
---
### refineResponseSingle
`Private` **refineResponseSingle**(`response`, `queryStr`, `textChunk`, `parentEvent?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------------- | :-------------------------------- |
| `response` | `string` |
| `queryStr` | `string` |
| `textChunk` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<`string`\>
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:153](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L153)
@@ -0,0 +1,74 @@
---
id: "Response"
title: "Class: Response"
sidebar_label: "Response"
sidebar_position: 0
custom_edit_url: null
---
Respone is the output of a LLM
## Constructors
### constructor
**new Response**(`response`, `sourceNodes?`)
#### Parameters
| Name | Type |
| :------------- | :------------------------------------------------------- |
| `response` | `string` |
| `sourceNodes?` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] |
#### Defined in
[packages/core/src/Response.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Response.ts#L10)
## Properties
### response
**response**: `string`
#### Defined in
[packages/core/src/Response.ts:7](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Response.ts#L7)
---
### sourceNodes
`Optional` **sourceNodes**: [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]
#### Defined in
[packages/core/src/Response.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Response.ts#L8)
## Methods
### getFormattedSources
**getFormattedSources**(): `void`
#### Returns
`void`
#### Defined in
[packages/core/src/Response.ts:15](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Response.ts#L15)
---
### toString
**toString**(): `string`
#### Returns
`string`
#### Defined in
[packages/core/src/Response.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/Response.ts#L19)
@@ -0,0 +1,80 @@
---
id: "ResponseSynthesizer"
title: "Class: ResponseSynthesizer"
sidebar_label: "ResponseSynthesizer"
sidebar_position: 0
custom_edit_url: null
---
A ResponseSynthesizer is used to generate a response from a query and a list of nodes.
## Constructors
### constructor
**new ResponseSynthesizer**(`«destructured»?`)
#### Parameters
| Name | Type |
| :------------------- | :-------------------------------------------------- |
| `«destructured»` | `Object` |
|  `metadataMode?` | [`MetadataMode`](../enums/MetadataMode.md) |
|  `responseBuilder?` | `BaseResponseBuilder` |
|  `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:295](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L295)
## Properties
### metadataMode
**metadataMode**: [`MetadataMode`](../enums/MetadataMode.md)
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:293](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L293)
---
### responseBuilder
**responseBuilder**: `BaseResponseBuilder`
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:291](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L291)
---
### serviceContext
**serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:292](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L292)
## Methods
### synthesize
**synthesize**(`query`, `nodesWithScore`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
#### Parameters
| Name | Type |
| :--------------- | :------------------------------------------------------------------------------- |
| `query` | `string` |
| `nodesWithScore` | [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[] |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<[`Response`](Response.md)\>
#### Defined in
[packages/core/src/ResponseSynthesizer.ts:310](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ResponseSynthesizer.ts#L310)
@@ -0,0 +1,140 @@
---
id: "RetrieverQueryEngine"
title: "Class: RetrieverQueryEngine"
sidebar_label: "RetrieverQueryEngine"
sidebar_position: 0
custom_edit_url: null
---
A query engine that uses a retriever to query an index and then synthesizes the response.
## Implements
- [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
## Constructors
### constructor
**new RetrieverQueryEngine**(`retriever`, `responseSynthesizer?`, `preFilters?`, `nodePostprocessors?`)
#### Parameters
| Name | Type |
| :--------------------- | :------------------------------------------------------------------ |
| `retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
| `responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) |
| `preFilters?` | `unknown` |
| `nodePostprocessors?` | [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[] |
#### Defined in
[packages/core/src/QueryEngine.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L37)
## Properties
### nodePostprocessors
**nodePostprocessors**: [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)[]
#### Defined in
[packages/core/src/QueryEngine.ts:34](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L34)
---
### preFilters
`Optional` **preFilters**: `unknown`
#### Defined in
[packages/core/src/QueryEngine.ts:35](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L35)
---
### responseSynthesizer
**responseSynthesizer**: [`ResponseSynthesizer`](ResponseSynthesizer.md)
#### Defined in
[packages/core/src/QueryEngine.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L33)
---
### retriever
**retriever**: [`BaseRetriever`](../interfaces/BaseRetriever.md)
#### Defined in
[packages/core/src/QueryEngine.ts:32](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L32)
## Methods
### applyNodePostprocessors
`Private` **applyNodePostprocessors**(`nodes`): [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
#### Parameters
| Name | Type |
| :------ | :------------------------------------------------------------------------------- |
| `nodes` | [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[] |
#### Returns
[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
#### Defined in
[packages/core/src/QueryEngine.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L52)
---
### query
**query**(`query`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
Query the query engine and get a response.
#### Parameters
| Name | Type |
| :------------- | :-------------------------------- |
| `query` | `string` |
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<[`Response`](Response.md)\>
#### Implementation of
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[query](../interfaces/BaseQueryEngine.md#query)
#### Defined in
[packages/core/src/QueryEngine.ts:69](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L69)
---
### retrieve
`Private` **retrieve**(`query`, `parentEvent`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
#### Parameters
| Name | Type |
| :------------ | :-------------------------------- |
| `query` | `string` |
| `parentEvent` | [`Event`](../interfaces/Event.md) |
#### Returns
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]\>
#### Defined in
[packages/core/src/QueryEngine.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/QueryEngine.ts#L59)
@@ -0,0 +1,271 @@
---
id: "SentenceSplitter"
title: "Class: SentenceSplitter"
sidebar_label: "SentenceSplitter"
sidebar_position: 0
custom_edit_url: null
---
SentenceSplitter is our default text splitter that supports splitting into sentences, paragraphs, or fixed length chunks with overlap.
One of the advantages of SentenceSplitter is that even in the fixed length chunks it will try to keep sentences together.
## Constructors
### constructor
**new SentenceSplitter**(`options?`)
#### Parameters
| Name | Type |
| :----------------------------- | :------------------------------------------------- |
| `options?` | `Object` |
| `options.chunkOverlap?` | `number` |
| `options.chunkSize?` | `number` |
| `options.chunkingTokenizerFn?` | (`text`: `string`) => `null` \| `RegExpMatchArray` |
| `options.paragraphSeparator?` | `string` |
| `options.splitLongSentences?` | `boolean` |
| `options.tokenizer?` | `any` |
| `options.tokenizerDecoder?` | `any` |
#### Defined in
[packages/core/src/TextSplitter.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L67)
## Properties
### chunkOverlap
`Private` **chunkOverlap**: `number`
#### Defined in
[packages/core/src/TextSplitter.ts:60](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L60)
---
### chunkSize
`Private` **chunkSize**: `number`
#### Defined in
[packages/core/src/TextSplitter.ts:59](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L59)
---
### chunkingTokenizerFn
`Private` **chunkingTokenizerFn**: (`text`: `string`) => `null` \| `RegExpMatchArray`
#### Type declaration
▸ (`text`): `null` \| `RegExpMatchArray`
##### Parameters
| Name | Type |
| :----- | :------- |
| `text` | `string` |
##### Returns
`null` \| `RegExpMatchArray`
#### Defined in
[packages/core/src/TextSplitter.ts:64](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L64)
---
### paragraphSeparator
`Private` **paragraphSeparator**: `string`
#### Defined in
[packages/core/src/TextSplitter.ts:63](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L63)
---
### splitLongSentences
`Private` **splitLongSentences**: `boolean`
#### Defined in
[packages/core/src/TextSplitter.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L65)
---
### tokenizer
`Private` **tokenizer**: `any`
#### Defined in
[packages/core/src/TextSplitter.ts:61](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L61)
---
### tokenizerDecoder
`Private` **tokenizerDecoder**: `any`
#### Defined in
[packages/core/src/TextSplitter.ts:62](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L62)
## Methods
### combineTextSplits
**combineTextSplits**(`newSentenceSplits`, `effectiveChunkSize`): `TextSplit`[]
#### Parameters
| Name | Type |
| :------------------- | :----------- |
| `newSentenceSplits` | `SplitRep`[] |
| `effectiveChunkSize` | `number` |
#### Returns
`TextSplit`[]
#### Defined in
[packages/core/src/TextSplitter.ts:205](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L205)
---
### getEffectiveChunkSize
`Private` **getEffectiveChunkSize**(`extraInfoStr?`): `number`
#### Parameters
| Name | Type |
| :-------------- | :------- |
| `extraInfoStr?` | `string` |
#### Returns
`number`
#### Defined in
[packages/core/src/TextSplitter.ts:104](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L104)
---
### getParagraphSplits
**getParagraphSplits**(`text`, `effectiveChunkSize?`): `string`[]
#### Parameters
| Name | Type |
| :-------------------- | :------- |
| `text` | `string` |
| `effectiveChunkSize?` | `number` |
#### Returns
`string`[]
#### Defined in
[packages/core/src/TextSplitter.ts:121](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L121)
---
### getSentenceSplits
**getSentenceSplits**(`text`, `effectiveChunkSize?`): `string`[]
#### Parameters
| Name | Type |
| :-------------------- | :------- |
| `text` | `string` |
| `effectiveChunkSize?` | `number` |
#### Returns
`string`[]
#### Defined in
[packages/core/src/TextSplitter.ts:147](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L147)
---
### processSentenceSplits
`Private` **processSentenceSplits**(`sentenceSplits`, `effectiveChunkSize`): `SplitRep`[]
Splits sentences into chunks if necessary.
This isn't great behavior because it can split down the middle of a
word or in non-English split down the middle of a Unicode codepoint
so the splitting is turned off by default. If you need it, please
set the splitLongSentences option to true.
#### Parameters
| Name | Type |
| :------------------- | :--------- |
| `sentenceSplits` | `string`[] |
| `effectiveChunkSize` | `number` |
#### Returns
`SplitRep`[]
#### Defined in
[packages/core/src/TextSplitter.ts:176](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L176)
---
### splitText
**splitText**(`text`, `extraInfoStr?`): `string`[]
#### Parameters
| Name | Type |
| :-------------- | :------- |
| `text` | `string` |
| `extraInfoStr?` | `string` |
#### Returns
`string`[]
#### Defined in
[packages/core/src/TextSplitter.ts:297](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L297)
---
### splitTextWithOverlaps
**splitTextWithOverlaps**(`text`, `extraInfoStr?`): `TextSplit`[]
#### Parameters
| Name | Type |
| :-------------- | :------- |
| `text` | `string` |
| `extraInfoStr?` | `string` |
#### Returns
`TextSplit`[]
#### Defined in
[packages/core/src/TextSplitter.ts:269](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/TextSplitter.ts#L269)
@@ -0,0 +1,62 @@
---
id: "SimilarityPostprocessor"
title: "Class: SimilarityPostprocessor"
sidebar_label: "SimilarityPostprocessor"
sidebar_position: 0
custom_edit_url: null
---
## Implements
- [`BaseNodePostprocessor`](../interfaces/BaseNodePostprocessor.md)
## Constructors
### constructor
**new SimilarityPostprocessor**(`options?`)
#### Parameters
| Name | Type |
| :-------------------------- | :------- |
| `options?` | `Object` |
| `options.similarityCutoff?` | `number` |
#### Defined in
[packages/core/src/indices/BaseNodePostprocessor.ts:10](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseNodePostprocessor.ts#L10)
## Properties
### similarityCutoff
`Optional` **similarityCutoff**: `number`
#### Defined in
[packages/core/src/indices/BaseNodePostprocessor.ts:8](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseNodePostprocessor.ts#L8)
## Methods
### postprocessNodes
**postprocessNodes**(`nodes`): [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
#### Parameters
| Name | Type |
| :------ | :------------------------------------------------------------------------------- |
| `nodes` | [`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[] |
#### Returns
[`NodeWithScore`](../interfaces/NodeWithScore.md)<[`Metadata`](../#metadata)\>[]
#### Implementation of
[BaseNodePostprocessor](../interfaces/BaseNodePostprocessor.md).[postprocessNodes](../interfaces/BaseNodePostprocessor.md#postprocessnodes)
#### Defined in
[packages/core/src/indices/BaseNodePostprocessor.ts:14](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/indices/BaseNodePostprocessor.ts#L14)
@@ -0,0 +1,125 @@
---
id: "SimpleChatEngine"
title: "Class: SimpleChatEngine"
sidebar_label: "SimpleChatEngine"
sidebar_position: 0
custom_edit_url: null
---
SimpleChatEngine is the simplest possible chat engine. Useful for using your own custom prompts.
## Implements
- [`ChatEngine`](../interfaces/ChatEngine.md)
## Constructors
### constructor
**new SimpleChatEngine**(`init?`)
#### Parameters
| Name | Type |
| :------ | :---------------------------------------------------- |
| `init?` | `Partial`<[`SimpleChatEngine`](SimpleChatEngine.md)\> |
#### Defined in
[packages/core/src/ChatEngine.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L51)
## Properties
### chatHistory
**chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
#### Defined in
[packages/core/src/ChatEngine.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L48)
---
### llm
**llm**: [`LLM`](../interfaces/LLM.md)
#### Defined in
[packages/core/src/ChatEngine.ts:49](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L49)
## Methods
### chat
**chat**<`T`, `R`\>(`message`, `chatHistory?`, `streaming?`): `Promise`<`R`\>
Send message along with the class's current chat history to the LLM.
#### Type parameters
| Name | Type |
| :--- | :---------------------------------------------------------------------------------------------- |
| `T` | extends `undefined` \| `boolean` = `undefined` |
| `R` | `T` extends `true` ? `AsyncGenerator`<`string`, `void`, `unknown`\> : [`Response`](Response.md) |
#### Parameters
| Name | Type | Description |
| :------------- | :---------------------------------------------- | :----------------------------------------------------------------- |
| `message` | [`MessageContent`](../#messagecontent) | |
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
| `streaming?` | `T` | optional streaming flag, which auto-sets the return value if True. |
#### Returns
`Promise`<`R`\>
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[chat](../interfaces/ChatEngine.md#chat)
#### Defined in
[packages/core/src/ChatEngine.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L56)
---
### reset
**reset**(): `void`
Resets the chat history so that it's empty.
#### Returns
`void`
#### Implementation of
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
#### Defined in
[packages/core/src/ChatEngine.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L101)
---
### streamChat
`Protected` **streamChat**(`message`, `chatHistory?`): `AsyncGenerator`<`string`, `void`, `unknown`\>
#### Parameters
| Name | Type |
| :------------- | :---------------------------------------------- |
| `message` | [`MessageContent`](../#messagecontent) |
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
#### Returns
`AsyncGenerator`<`string`, `void`, `unknown`\>
#### Defined in
[packages/core/src/ChatEngine.ts:78](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatEngine.ts#L78)
@@ -0,0 +1,145 @@
---
id: "SimpleChatHistory"
title: "Class: SimpleChatHistory"
sidebar_label: "SimpleChatHistory"
sidebar_position: 0
custom_edit_url: null
---
A ChatHistory is used to keep the state of back and forth chat messages
## Implements
- [`ChatHistory`](../interfaces/ChatHistory.md)
## Constructors
### constructor
**new SimpleChatHistory**(`init?`)
#### Parameters
| Name | Type |
| :------ | :------------------------------------------------------ |
| `init?` | `Partial`<[`SimpleChatHistory`](SimpleChatHistory.md)\> |
#### Defined in
[packages/core/src/ChatHistory.ts:39](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L39)
## Properties
### messages
**messages**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
#### Implementation of
[ChatHistory](../interfaces/ChatHistory.md).[messages](../interfaces/ChatHistory.md#messages)
#### Defined in
[packages/core/src/ChatHistory.ts:36](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L36)
---
### messagesBefore
`Private` **messagesBefore**: `number`
#### Defined in
[packages/core/src/ChatHistory.ts:37](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L37)
## Methods
### addMessage
**addMessage**(`message`): `void`
Adds a message to the chat history.
#### Parameters
| Name | Type |
| :-------- | :-------------------------------------------- |
| `message` | [`ChatMessage`](../interfaces/ChatMessage.md) |
#### Returns
`void`
#### Implementation of
[ChatHistory](../interfaces/ChatHistory.md).[addMessage](../interfaces/ChatHistory.md#addmessage)
#### Defined in
[packages/core/src/ChatHistory.ts:44](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L44)
---
### newMessages
**newMessages**(): [`ChatMessage`](../interfaces/ChatMessage.md)[]
Returns the new messages since the last call to this function (or since calling the constructor)
#### Returns
[`ChatMessage`](../interfaces/ChatMessage.md)[]
#### Implementation of
[ChatHistory](../interfaces/ChatHistory.md).[newMessages](../interfaces/ChatHistory.md#newmessages)
#### Defined in
[packages/core/src/ChatHistory.ts:56](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L56)
---
### requestMessages
**requestMessages**(`transientMessages?`): `Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)[]\>
Returns the messages that should be used as input to the LLM.
#### Parameters
| Name | Type |
| :------------------- | :---------------------------------------------- |
| `transientMessages?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
#### Returns
`Promise`<[`ChatMessage`](../interfaces/ChatMessage.md)[]\>
#### Implementation of
[ChatHistory](../interfaces/ChatHistory.md).[requestMessages](../interfaces/ChatHistory.md#requestmessages)
#### Defined in
[packages/core/src/ChatHistory.ts:48](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L48)
---
### reset
**reset**(): `void`
Resets the chat history so that it's empty.
#### Returns
`void`
#### Implementation of
[ChatHistory](../interfaces/ChatHistory.md).[reset](../interfaces/ChatHistory.md#reset)
#### Defined in
[packages/core/src/ChatHistory.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/ChatHistory.ts#L52)
@@ -0,0 +1,88 @@
---
id: "SimpleDirectoryReader"
title: "Class: SimpleDirectoryReader"
sidebar_label: "SimpleDirectoryReader"
sidebar_position: 0
custom_edit_url: null
---
Read all of the documents in a directory.
By default, supports the list of file types
in the FILE_EXT_TO_READER map.
## Implements
- [`BaseReader`](../interfaces/BaseReader.md)
## Constructors
### constructor
**new SimpleDirectoryReader**(`observer?`)
#### Parameters
| Name | Type |
| :---------- | :--------------- |
| `observer?` | `ReaderCallback` |
#### Defined in
[packages/core/src/readers/SimpleDirectoryReader.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleDirectoryReader.ts#L65)
## Properties
### observer
`Private` `Optional` **observer**: `ReaderCallback`
#### Defined in
[packages/core/src/readers/SimpleDirectoryReader.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleDirectoryReader.ts#L65)
## Methods
### doObserverCheck
`Private` **doObserverCheck**(`category`, `name`, `status`, `message?`): `boolean`
#### Parameters
| Name | Type |
| :--------- | :------------------------ |
| `category` | `"file"` \| `"directory"` |
| `name` | `string` |
| `status` | `ReaderStatus` |
| `message?` | `string` |
#### Returns
`boolean`
#### Defined in
[packages/core/src/readers/SimpleDirectoryReader.ts:135](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleDirectoryReader.ts#L135)
---
### loadData
**loadData**(`«destructured»`): `Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
#### Parameters
| Name | Type |
| :--------------- | :----------------------------------------------------------------------------- |
| `«destructured»` | [`SimpleDirectoryReaderLoadDataProps`](../#simpledirectoryreaderloaddataprops) |
#### Returns
`Promise`<[`Document`](Document.md)<[`Metadata`](../#metadata)\>[]\>
#### Implementation of
[BaseReader](../interfaces/BaseReader.md).[loadData](../interfaces/BaseReader.md#loaddata)
#### Defined in
[packages/core/src/readers/SimpleDirectoryReader.ts:67](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/readers/SimpleDirectoryReader.ts#L67)
@@ -0,0 +1,480 @@
---
id: "SimpleDocumentStore"
title: "Class: SimpleDocumentStore"
sidebar_label: "SimpleDocumentStore"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- `KVDocumentStore`
**`SimpleDocumentStore`**
## Constructors
### constructor
**new SimpleDocumentStore**(`kvStore?`, `namespace?`)
#### Parameters
| Name | Type |
| :----------- | :---------------------------------- |
| `kvStore?` | [`SimpleKVStore`](SimpleKVStore.md) |
| `namespace?` | `string` |
#### Overrides
KVDocumentStore.constructor
#### Defined in
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:19](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L19)
## Properties
### kvStore
`Private` **kvStore**: [`SimpleKVStore`](SimpleKVStore.md)
#### Defined in
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:17](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L17)
## Methods
### addDocuments
**addDocuments**(`docs`, `allowUpdate?`): `Promise`<`void`\>
#### Parameters
| Name | Type | Default value |
| :------------ | :------------------------------------------------------- | :------------ |
| `docs` | [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[] | `undefined` |
| `allowUpdate` | `boolean` | `true` |
#### Returns
`Promise`<`void`\>
#### Inherited from
KVDocumentStore.addDocuments
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:33](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L33)
---
### deleteDocument
**deleteDocument**(`docId`, `raiseError?`, `removeRefDocNode?`): `Promise`<`void`\>
#### Parameters
| Name | Type | Default value |
| :----------------- | :-------- | :------------ |
| `docId` | `string` | `undefined` |
| `raiseError` | `boolean` | `true` |
| `removeRefDocNode` | `boolean` | `true` |
#### Returns
`Promise`<`void`\>
#### Inherited from
KVDocumentStore.deleteDocument
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:131](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L131)
---
### deleteRefDoc
**deleteRefDoc**(`refDocId`, `raiseError?`): `Promise`<`void`\>
#### Parameters
| Name | Type | Default value |
| :----------- | :-------- | :------------ |
| `refDocId` | `string` | `undefined` |
| `raiseError` | `boolean` | `true` |
#### Returns
`Promise`<`void`\>
#### Inherited from
KVDocumentStore.deleteRefDoc
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:148](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L148)
---
### docs
**docs**(): `Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
#### Returns
`Promise`<`Record`<`string`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
#### Inherited from
KVDocumentStore.docs
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:24](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L24)
---
### documentExists
**documentExists**(`docId`): `Promise`<`boolean`\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `docId` | `string` |
#### Returns
`Promise`<`boolean`\>
#### Inherited from
KVDocumentStore.documentExists
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:105](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L105)
---
### getAllRefDocInfo
**getAllRefDocInfo**(): `Promise`<`undefined` \| `Record`<`string`, [`RefDocInfo`](../interfaces/RefDocInfo.md)\>\>
#### Returns
`Promise`<`undefined` \| `Record`<`string`, [`RefDocInfo`](../interfaces/RefDocInfo.md)\>\>
#### Inherited from
KVDocumentStore.getAllRefDocInfo
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:93](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L93)
---
### getDocument
**getDocument**(`docId`, `raiseError?`): `Promise`<`undefined` \| [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
#### Parameters
| Name | Type | Default value |
| :----------- | :-------- | :------------ |
| `docId` | `string` | `undefined` |
| `raiseError` | `boolean` | `true` |
#### Returns
`Promise`<`undefined` \| [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
#### Inherited from
KVDocumentStore.getDocument
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L73)
---
### getDocumentHash
**getDocumentHash**(`docId`): `Promise`<`undefined` \| `string`\>
#### Parameters
| Name | Type |
| :------ | :------- |
| `docId` | `string` |
#### Returns
`Promise`<`undefined` \| `string`\>
#### Inherited from
KVDocumentStore.getDocumentHash
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:174](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L174)
---
### getNode
**getNode**(`nodeId`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
#### Parameters
| Name | Type | Default value |
| :----------- | :-------- | :------------ |
| `nodeId` | `string` | `undefined` |
| `raiseError` | `boolean` | `true` |
#### Returns
`Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>
#### Inherited from
KVDocumentStore.getNode
#### Defined in
[packages/core/src/storage/docStore/types.ts:57](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L57)
---
### getNodeDict
**getNodeDict**(`nodeIdDict`): `Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
#### Parameters
| Name | Type |
| :----------- | :------- |
| `nodeIdDict` | `Object` |
#### Returns
`Promise`<`Record`<`number`, [`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>\>\>
#### Inherited from
KVDocumentStore.getNodeDict
#### Defined in
[packages/core/src/storage/docStore/types.ts:65](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L65)
---
### getNodes
**getNodes**(`nodeIds`, `raiseError?`): `Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
#### Parameters
| Name | Type | Default value |
| :----------- | :--------- | :------------ |
| `nodeIds` | `string`[] | `undefined` |
| `raiseError` | `boolean` | `true` |
#### Returns
`Promise`<[`BaseNode`](BaseNode.md)<[`Metadata`](../#metadata)\>[]\>
#### Inherited from
KVDocumentStore.getNodes
#### Defined in
[packages/core/src/storage/docStore/types.ts:51](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/types.ts#L51)
---
### getRefDocInfo
**getRefDocInfo**(`refDocId`): `Promise`<`undefined` \| [`RefDocInfo`](../interfaces/RefDocInfo.md)\>
#### Parameters
| Name | Type |
| :--------- | :------- |
| `refDocId` | `string` |
#### Returns
`Promise`<`undefined` \| [`RefDocInfo`](../interfaces/RefDocInfo.md)\>
#### Inherited from
KVDocumentStore.getRefDocInfo
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:88](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L88)
---
### persist
**persist**(`persistPath?`, `fs?`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------------ | :-------------------------------------------------------- |
| `persistPath` | `string` |
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
#### Returns
`Promise`<`void`\>
#### Overrides
KVDocumentStore.persist
#### Defined in
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:52](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L52)
---
### refDocExists
**refDocExists**(`refDocId`): `Promise`<`boolean`\>
#### Parameters
| Name | Type |
| :--------- | :------- |
| `refDocId` | `string` |
#### Returns
`Promise`<`boolean`\>
#### Inherited from
KVDocumentStore.refDocExists
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:101](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L101)
---
### setDocumentHash
**setDocumentHash**(`docId`, `docHash`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :-------- | :------- |
| `docId` | `string` |
| `docHash` | `string` |
#### Returns
`Promise`<`void`\>
#### Inherited from
KVDocumentStore.setDocumentHash
#### Defined in
[packages/core/src/storage/docStore/KVDocumentStore.ts:169](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/KVDocumentStore.ts#L169)
---
### toDict
**toDict**(): `SaveDict`
#### Returns
`SaveDict`
#### Defined in
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:73](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L73)
---
### fromDict
`Static` **fromDict**(`saveDict`, `namespace?`): [`SimpleDocumentStore`](SimpleDocumentStore.md)
#### Parameters
| Name | Type |
| :----------- | :--------- |
| `saveDict` | `SaveDict` |
| `namespace?` | `string` |
#### Returns
[`SimpleDocumentStore`](SimpleDocumentStore.md)
#### Defined in
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:68](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L68)
---
### fromPersistDir
`Static` **fromPersistDir**(`persistDir?`, `namespace?`, `fsModule?`): `Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
#### Parameters
| Name | Type | Default value |
| :----------- | :-------------------------------------------------------- | :-------------------- |
| `persistDir` | `string` | `DEFAULT_PERSIST_DIR` |
| `namespace?` | `string` | `undefined` |
| `fsModule?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) | `undefined` |
#### Returns
`Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
#### Defined in
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:26](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L26)
---
### fromPersistPath
`Static` **fromPersistPath**(`persistPath`, `namespace?`, `fs?`): `Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
#### Parameters
| Name | Type |
| :------------ | :-------------------------------------------------------- |
| `persistPath` | `string` |
| `namespace?` | `string` |
| `fs?` | [`GenericFileSystem`](../interfaces/GenericFileSystem.md) |
#### Returns
`Promise`<[`SimpleDocumentStore`](SimpleDocumentStore.md)\>
#### Defined in
[packages/core/src/storage/docStore/SimpleDocumentStore.ts:42](https://github.com/run-llama/LlamaIndexTS/blob/d613bbd/packages/core/src/storage/docStore/SimpleDocumentStore.ts#L42)

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