├── .env ├── .gitignore ├── 01_hello.ts ├── 02_know_u.ts ├── 03_memory.ts ├── 04_vector.ts ├── 05_process.ts ├── 06_rag.ts ├── 07_llama.ts ├── README.md ├── bun.lockb ├── data ├── overment.json └── overment.md ├── package.json └── tsconfig.json /.env: -------------------------------------------------------------------------------- 1 | OPENAI_API_KEY=PASTE_YOUR_API_KEY_HERE -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | -------------------------------------------------------------------------------- /01_hello.ts: -------------------------------------------------------------------------------- 1 | import {ChatOpenAI} from "langchain/chat_models/openai"; 2 | import {HumanMessage, SystemMessage} from "langchain/schema"; 3 | 4 | const query = 'What is the distance between the Earth and the Moon?'; 5 | // const query = `Who's overment?` 6 | const chat = new ChatOpenAI({ 7 | modelName: 'gpt-3.5-turbo', 8 | }); 9 | const { content } = await chat.call([ 10 | new SystemMessage(`If possible, answer ultra-concisely and truthfully. Say "Don't know" otherwise.`), 11 | new HumanMessage(query), 12 | ]); 13 | 14 | console.log(content); -------------------------------------------------------------------------------- /02_know_u.ts: -------------------------------------------------------------------------------- 1 | import {ChatOpenAI} from "langchain/chat_models/openai"; 2 | import {HumanMessage, SystemMessage} from "langchain/schema"; 3 | 4 | const query = `Who's overment?`; 5 | const chat = new ChatOpenAI({ 6 | modelName: 'gpt-3.5-turbo', 7 | }); 8 | const { content: answer } = await chat.call([ 9 | new SystemMessage(` 10 | Hey! I'll use my own words to answer ultra-concisely and truthfully, using only the context below. If not, say "I don't know." 11 | 12 | context### 13 | overment is a guy behind YouTube channel with the same name. 14 | Adam's nickname is overment. 15 | Adam have a YouTube channel. 16 | ### 17 | 18 | Let's chat! 19 | `), 20 | new HumanMessage(query), 21 | ]); 22 | 23 | console.log(answer); -------------------------------------------------------------------------------- /03_memory.ts: -------------------------------------------------------------------------------- 1 | import {ChatOpenAI} from "langchain/chat_models/openai"; 2 | import {HumanMessage, SystemMessage} from "langchain/schema"; 3 | import {TextLoader} from "langchain/document_loaders/fs/text"; 4 | 5 | const query = `Who exactly is Overment?`; 6 | const [overment] = await new TextLoader("./data/overment.md").load() 7 | const docs = overment.pageContent.split('\n').filter(chunk => chunk.trim()); 8 | const chat = new ChatOpenAI({ 9 | modelName: 'gpt-3.5-turbo', 10 | }); 11 | const { content: answer } = await chat.call([ 12 | new SystemMessage(` 13 | I'll use my own words to answer ultra-concisely and truthfully, using only the context below. If not, say "I don't know." 14 | context--- 15 | ${docs.slice(0, 3).join('\n')} 16 | --- 17 | Let's chat! 18 | `), 19 | new HumanMessage(query), 20 | ]); 21 | 22 | console.log(answer); 23 | 24 | -------------------------------------------------------------------------------- /04_vector.ts: -------------------------------------------------------------------------------- 1 | import {ChatOpenAI} from "langchain/chat_models/openai"; 2 | import {HumanMessage, SystemMessage} from "langchain/schema"; 3 | import {TextLoader} from "langchain/document_loaders/fs/text"; 4 | import {RecursiveCharacterTextSplitter} from "langchain/text_splitter"; 5 | import {MemoryVectorStore} from "langchain/vectorstores/memory"; 6 | import {OpenAIEmbeddings} from "langchain/embeddings/openai"; 7 | 8 | const query = `Adam's location?`; 9 | const [overment] = await new TextLoader("./data/overment.md").load() 10 | const splitter = new RecursiveCharacterTextSplitter({ 11 | chunkSize: 150, 12 | chunkOverlap: 0, 13 | }); 14 | const docs = await splitter.createDocuments([overment.pageContent]); 15 | const embeddings = new OpenAIEmbeddings(); 16 | const store = await MemoryVectorStore.fromDocuments(docs, embeddings); 17 | const context = await store.similaritySearch(query, 1); 18 | 19 | const system = ` 20 | I'll use my own words to answer ultra-concisely and truthfully, using only the context below. If not, say "I don't know." 21 | context--- 22 | ${context.map(doc => doc.pageContent)} 23 | --- 24 | Let's chat! 25 | `; 26 | 27 | const chat = new ChatOpenAI({ 28 | modelName: 'gpt-3.5-turbo', 29 | }); 30 | const { content: answer } = await chat.call([ 31 | new SystemMessage(system), 32 | new HumanMessage(query), 33 | ]); 34 | 35 | console.log(answer); -------------------------------------------------------------------------------- /05_process.ts: -------------------------------------------------------------------------------- 1 | import {ChatOpenAI} from "langchain/chat_models/openai"; 2 | import {HumanMessage} from "langchain/schema"; 3 | import {TextLoader} from "langchain/document_loaders/fs/text"; 4 | import { Document } from "langchain/document"; 5 | import {BaseMessage} from "langchain/dist/schema"; 6 | import * as fs from "fs"; 7 | 8 | const [overment] = await new TextLoader("./data/overment.md").load() 9 | const tags = ['traits', 'personal', 'relationships', 'work', 'hobbies'] 10 | const chunks = overment.pageContent.split('\n').filter(chunk => chunk.trim()); 11 | const docs = chunks.map(chunk => new Document({ pageContent: chunk })); 12 | const template = (strings: TemplateStringsArray, doc: string) => ` 13 | Return comma-separated, lower-cased names of the main categories (and nothing more) that matches document provided below. 14 | Categories: ${tags.join(', ')} 15 | Doc###${doc}### 16 | `; 17 | 18 | const chat = new ChatOpenAI({ 19 | modelName: 'gpt-3.5-turbo', 20 | maxConcurrency: 5, 21 | maxRetries: 3, 22 | }); 23 | const results: Promise[] = []; 24 | docs.forEach(doc => { 25 | results.push(chat.call([ 26 | new HumanMessage(template`${doc.pageContent}`), 27 | ])); 28 | }); 29 | 30 | const answers = await Promise.all(results); 31 | const enrichedDocs = answers.map((answer, i) => { 32 | docs[i].metadata = { tags: answer.content, id: i + 1 }; 33 | return docs[i]; 34 | }); 35 | 36 | console.log(enrichedDocs); 37 | 38 | fs.writeFileSync('./data/overment.json', JSON.stringify(enrichedDocs, null, 2)); -------------------------------------------------------------------------------- /06_rag.ts: -------------------------------------------------------------------------------- 1 | import {ChatOpenAI} from "langchain/chat_models/openai"; 2 | import {HumanMessage, SystemMessage} from "langchain/schema"; 3 | import {MemoryVectorStore} from "langchain/vectorstores/memory"; 4 | import {OpenAIEmbeddings} from "langchain/embeddings/openai"; 5 | import * as fs from "fs"; 6 | import {Document} from "langchain/document"; 7 | 8 | const query = `Which projects is overment working on?`; 9 | const docs: Document[] = JSON.parse(fs.readFileSync('./data/overment.json', 'utf8')); 10 | const tags = ['traits', 'personal', 'relationships', 'work', 'hobbies']; 11 | 12 | const chat = new ChatOpenAI({ modelName: 'gpt-3.5-turbo' }); 13 | const relevantTags = await chat.predict(`Return comma-separated tags from this list: ###${tags.join(', ')}### that may include relevant information about this query: ###${query}###`); 14 | const taggedDocs = docs.filter(doc => doc.metadata.tags.split(', ').some((tag: string) => relevantTags.split(', ').includes(tag))); 15 | const embeddings = new OpenAIEmbeddings(); 16 | const store = await MemoryVectorStore.fromDocuments(docs, embeddings); 17 | const context = (await store.similaritySearch(query, 3)).filter(doc => taggedDocs.every(taggedDoc => taggedDoc.metadata.id !== doc.metadata.id)); 18 | 19 | const system = ` 20 | I'll use my own words to answer ultra-concisely and truthfully, using only the context below. If not, say "I don't know." 21 | context--- 22 | ${taggedDocs.map(doc => doc.pageContent)} 23 | ${context.map(doc => doc.pageContent)} 24 | --- 25 | Let's chat! 26 | `; 27 | 28 | console.log(system) 29 | 30 | const { content: answer } = await chat.call([ 31 | new SystemMessage(system), 32 | new HumanMessage(query), 33 | ]); 34 | 35 | console.log(answer); -------------------------------------------------------------------------------- /07_llama.ts: -------------------------------------------------------------------------------- 1 | import {Ollama} from "langchain/llms/ollama"; 2 | 3 | const model = new Ollama({ 4 | baseUrl: "http://localhost:11434", 5 | model: "llama2", 6 | temperature: 0, 7 | }); 8 | 9 | const query = `What is Adam's nickname?`; 10 | const response = await model.predict( 11 | ` 12 | I always skip any introduction and additional comment. I'll use my own words to answer ultra-concisely and truthfully, using only the context below. If not, say "I don't know." 13 | context--- 14 | overment is a guy behind YouTube channel with the same name. 15 | Adam's nickname is overment. 16 | Adam have a YouTube channel. 17 | --- 18 | Ask me anything! I'm ready and always will straight to the point using as few words as possible. 19 | ### 20 | What is Adam's nickname?` 21 | ); 22 | 23 | console.log(`Query:`, query); 24 | console.log(`Response:`, response); 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![AI_Devs #2](https://cloud.overment.com/aidevs-1694672760.png) 2 | 3 | Repozytorium z kodem źródłowym z webinaru **Jak połączyć AI z własnymi danymi? RAG w praktyce!** 4 | Nagranie ze spotkania dostępne jest tutaj: https://www.youtube.com/watch?v=OvyRmJaCnRo 5 | 6 | Szkolenie AI Devs #2 zaczynamy 23 października. Dołącz do nas na https://aidevs.pl 7 | 8 | ⚠️ **UWAGA!** ⚠️ 9 | - Kod źródłowy jest przeznaczony wyłącznie do celów edukacyjnych. Nie należy go używać w środowisku produkcyjnym. 10 | - Kod **nie jest** zoptymalizowany do pracy z dużymi zestawami danych. 11 | - Przed uruchomieniem kodu, ustaw twardy limit $ na swoim koncie 12 | - Podczas webinaru kod był uruchamiany z modelem GPT-4. W repozytorium domyślny model to GPT-3.5-Turbo, którego skuteczność jest niższa. Jeśli masz dostęp do GPT-4, zamień w kodzie parametr modelName na 'gpt-4' 13 | 14 | ## Instalacja 15 | 16 | 1. Pobierz repozytorium na swój komputer 17 | 2. Dodaj swój klucz [OpenAI API](https://platform.openai.com/account/api-keys) do pliku .env 18 | 3. Zainstaluj zależności poleceniem `bun install` 19 | 4. Uruchamiaj poszczególne skrypty poleceniem `bun nazwa_pliku.ts` 20 | 21 | ## Uruchomienie 07_llama.ts 22 | 23 | Uruchominie 07_llama.ts wymaga zainstalowania modelu LLaMA2 na swoim komputerze. 24 | 25 | 1. Zainstaluj https://ollama.ai 26 | 2. Pobierz i uruchom model, np. llama-2 poleceniem `ollama run llama2` 27 | 3. Uruchom skrypt poleceniem `bun 07_llama.ts` 28 | 29 | ## Dołącz do drugiej edycji AI_Devs 30 | 31 | Więcej na temat pracy z dużymi modelami językowymi i łączenia ich z kodem, znajdziesz w drugiej edycji AI_Devs. Dołącz do nas na https://aidevs.pl -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceener/rag/bf84978f4a7c9694e4e98e249f0f6b90ceb74c97/bun.lockb -------------------------------------------------------------------------------- /data/overment.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pageContent": "Adam has various skills but describes himself as \"just curious.\"", 4 | "metadata": { 5 | "tags": "traits, personal, work", 6 | "id": 1 7 | } 8 | }, 9 | { 10 | "pageContent": "Adam have a dog named Alexa.", 11 | "metadata": { 12 | "tags": "personal, relationships, hobbies", 13 | "id": 2 14 | } 15 | }, 16 | { 17 | "pageContent": "Adam lives in Krakow with his fiancée and dog.", 18 | "metadata": { 19 | "tags": "personal,relationships", 20 | "id": 3 21 | } 22 | }, 23 | { 24 | "pageContent": "Adam is involved in a couple of projects like eduweb.pl, ahoy.so, easy.tools, overment.com, heyalice.app, automation.house, and more. ", 25 | "metadata": { 26 | "tags": "work, hobbies", 27 | "id": 4 28 | } 29 | }, 30 | { 31 | "pageContent": "Adam knows JavaScript and Python very well. He's full-stack engineer.", 32 | "metadata": { 33 | "tags": "work, personal", 34 | "id": 5 35 | } 36 | }, 37 | { 38 | "pageContent": "Adam loves music. He listens to Spotify all the time.", 39 | "metadata": { 40 | "tags": "hobbies", 41 | "id": 6 42 | } 43 | }, 44 | { 45 | "pageContent": "Adam's nickname is 'overment'.", 46 | "metadata": { 47 | "tags": "personal", 48 | "id": 7 49 | } 50 | }, 51 | { 52 | "pageContent": "Adam has a youtube channel named 'overment'.", 53 | "metadata": { 54 | "tags": "hobbies", 55 | "id": 8 56 | } 57 | }, 58 | { 59 | "pageContent": "Adam is a big fan of Apple products.", 60 | "metadata": { 61 | "tags": "hobbies", 62 | "id": 9 63 | } 64 | }, 65 | { 66 | "pageContent": "Adam is a big fan of Tesla cars.", 67 | "metadata": { 68 | "tags": "hobbies", 69 | "id": 10 70 | } 71 | } 72 | ] -------------------------------------------------------------------------------- /data/overment.md: -------------------------------------------------------------------------------- 1 | Adam has various skills but describes himself as "just curious." 2 | 3 | Adam have a dog named Alexa. 4 | 5 | Adam lives in Krakow with his fiancée and dog. 6 | 7 | Adam is involved in a couple of projects like eduweb.pl, ahoy.so, easy.tools, overment.com, heyalice.app, automation.house, and more. 8 | 9 | Adam knows JavaScript and Python very well. He's full-stack engineer. 10 | 11 | Adam loves music. He listens to Spotify all the time. 12 | 13 | Adam's nickname is 'overment'. 14 | 15 | Adam has a youtube channel named 'overment'. 16 | 17 | Adam is a big fan of Apple products. 18 | 19 | Adam is a big fan of Tesla cars. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rag", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.ts", 6 | "type": "module", 7 | "scripts": { 8 | "start": "bun app.ts", 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "keywords": [], 12 | "author": "Adam Gospodarczyk ", 13 | "license": "ISC", 14 | "dependencies": { 15 | "@xenova/transformers": "^2.6.0", 16 | "commander": "^11.0.0", 17 | "langchain": "^0.0.148", 18 | "openai": "^4.6.0", 19 | "tiktoken": "^1.0.10" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 | 27 | /* Modules */ 28 | "module": "ESNext", /* Specify what module code is generated. */ 29 | // "rootDir": "./", /* Specify the root folder within your source files. */ 30 | "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ 31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 38 | // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ 39 | // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ 40 | // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ 41 | // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ 42 | // "resolveJsonModule": true, /* Enable importing .json files. */ 43 | // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ 44 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 45 | 46 | /* JavaScript Support */ 47 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 48 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 49 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 50 | 51 | /* Emit */ 52 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 53 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 54 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 55 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 56 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 57 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 58 | // "outDir": "./", /* Specify an output folder for all emitted files. */ 59 | // "removeComments": true, /* Disable emitting comments. */ 60 | // "noEmit": true, /* Disable emitting files from a compilation. */ 61 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 62 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ 63 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 64 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 65 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 66 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 67 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 68 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 69 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 70 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 71 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 72 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 73 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 74 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 75 | 76 | /* Interop Constraints */ 77 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 78 | // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ 79 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 80 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 81 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 82 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 83 | 84 | /* Type Checking */ 85 | "strict": true, /* Enable all strict type-checking options. */ 86 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 87 | // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 88 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 89 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 90 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 91 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 92 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 93 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 94 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 95 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 96 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 97 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 98 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 99 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 100 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 101 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 102 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 103 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 104 | 105 | /* Completeness */ 106 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 107 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 108 | } 109 | } 110 | --------------------------------------------------------------------------------