id
stringlengths
14
17
text
stringlengths
42
2.11k
4e9727215e95-1100
", metadata: { reliable: false }, }),];const taggedDocuments = await metadataTagger.transformDocuments(documents);console.log(taggedDocuments);/* [ Document { pageContent: 'Review of The Bee Movie\n' + 'By Roger Ebert\n' + 'This is the greatest movie ever made. 4 out of 5 stars. ', metad...
4e9727215e95-1101
For example, let's say you wanted to index a set of movie reviews. You could initialize the document transformer as follows:
4e9727215e95-1102
import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langchain/chat_models/openai";import { Document } from "langchain/document";const zodSchema = z.object({ movie_title: z.string(), critic: z.string(), tone: z.enum(["posit...
4e9727215e95-1103
', metadata: { movie_title: 'The Godfather', critic: 'Anonymous', tone: 'negative', rating: 1, reliable: false } } ]*/ API Reference:createMetadataTaggerFromZod from langchain/document_transformers/openai_functionsChatOpenAI from langchain/chat_models/openaiDocument fro...
4e9727215e95-1104
import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langchain/chat_models/openai";import { Document } from "langchain/document";import { PromptTemplate } from "langchain/prompts";const taggingChainTemplate = `Extract the desi...
4e9727215e95-1105
', metadata: { movie_title: 'The Bee Movie', critic: 'Roger Ebert', tone: 'positive', rating: 4 } }, Document { pageContent: 'Review of The Godfather\n' + 'By Anonymous\n' + '\n' + 'This movie was super boring. 1 out of 5 stars. ', metadata: { ...
4e9727215e95-1106
You can use it in the exact same way.import { Document } from "langchain/document";import { CharacterTextSplitter } from "langchain/text_splitter";const text = "foo bar baz 123";const splitter = new CharacterTextSplitter({ separator: " ", chunkSize: 7, chunkOverlap: 3,});const output = await splitter.createDocuments...
4e9727215e95-1107
Get startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersIntegrationsText splittersSplit by characterSplit code and markupContextual chunk headersCustom text splittersRecursively split by characterTokenTextSplitterText embedding modelsVector storesRetrieversExper...
4e9727215e95-1108
Split by characterThis is the simplest method. This splits based on characters (by default "\n\n") and measure chunk length by number of characters.How the text is split: by single characterHow the chunk size is measured: by number of charactersCharacterTextSplitterBesides the RecursiveCharacterTextSplitter, there is a...
4e9727215e95-1109
Paragraphs: Skip to main content🦜️🔗 LangChainDocsUse casesAPILangSmithPython DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersIntegrationsText splittersSplit by characterSplit code and markupContextual chunk headersCustom text splittersRecursi...
4e9727215e95-1110
Popular languages like JavaScript, Python, Solidity, and Rust are supported as well as Latex, HTML, and Markdown.Usage​Initialize a standard RecursiveCharacterTextSplitter with the fromLanguage factory method. Below are some examples for various languages.JavaScript​import { SupportedTextSplitterLanguages, RecursiveC...
4e9727215e95-1111
");', metadata: { loc: [Object] } }, Document { pageContent: '}\n// Call the function', metadata: { loc: [Object] } }, Document { pageContent: 'helloWorld();', metadata: { loc: [Object] } } ]*/API Reference:SupportedTextSplitterLanguages from langchain/text_splitterRecursiveChar...
4e9727215e95-1112
")', metadata: { loc: [Object] } }, Document { pageContent: '# Call the function', metadata: { loc: [Object] } }, Document { pageContent: 'hello_world()', metadata: { loc: [Object] } } ]*/API Reference:RecursiveCharacterTextSplitter from langchain/text_splitterHTML​import { Recu...
4e9727215e95-1113
</div> </body></html>`;const splitter = RecursiveCharacterTextSplitter.fromLanguage("html", { chunkSize: 175, chunkOverlap: 20,});const output = await splitter.createDocuments([text]);console.log(output);/* [ Document { pageContent: '<!DOCTYPE html>\n<html>', metadata: { loc: [Object] } }, Docume...
4e9727215e95-1114
Reference:RecursiveCharacterTextSplitter from langchain/text_splitterLatex​import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const text = `\\begin{document}\\title{🦜️🔗 LangChain}⚡ Building applications with LLMs through composability ⚡\\section{Quick Install}\\begin{verbatim}Hopefully this code...
4e9727215e95-1115
', metadata: { loc: [Object] } }, Document { pageContent: '\\end{document}', metadata: { loc: [Object] } } ]*/API Reference:RecursiveCharacterTextSplitter from langchain/text_splitterPreviousSplit by characterNextContextual chunk headersCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCo...
4e9727215e95-1116
Popular languages like JavaScript, Python, Solidity, and Rust are supported as well as Latex, HTML, and Markdown.Usage​Initialize a standard RecursiveCharacterTextSplitter with the fromLanguage factory method. Below are some examples for various languages.JavaScript​import { SupportedTextSplitterLanguages, RecursiveC...
4e9727215e95-1117
");', metadata: { loc: [Object] } }, Document { pageContent: '}\n// Call the function', metadata: { loc: [Object] } }, Document { pageContent: 'helloWorld();', metadata: { loc: [Object] } } ]*/API Reference:SupportedTextSplitterLanguages from langchain/text_splitterRecursiveChar...
4e9727215e95-1118
")', metadata: { loc: [Object] } }, Document { pageContent: '# Call the function', metadata: { loc: [Object] } }, Document { pageContent: 'hello_world()', metadata: { loc: [Object] } } ]*/API Reference:RecursiveCharacterTextSplitter from langchain/text_splitterHTML​import { Recu...
4e9727215e95-1119
</div> </body></html>`;const splitter = RecursiveCharacterTextSplitter.fromLanguage("html", { chunkSize: 175, chunkOverlap: 20,});const output = await splitter.createDocuments([text]);console.log(output);/* [ Document { pageContent: '<!DOCTYPE html>\n<html>', metadata: { loc: [Object] } }, Docume...
4e9727215e95-1120
Reference:RecursiveCharacterTextSplitter from langchain/text_splitterLatex​import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const text = `\\begin{document}\\title{🦜️🔗 LangChain}⚡ Building applications with LLMs through composability ⚡\\section{Quick Install}\\begin{verbatim}Hopefully this code...
4e9727215e95-1121
ModulesData connectionDocument transformersText splittersSplit code and markupSplit code and markupCodeTextSplitter allows you to split your code and markup with support for multiple languages.LangChain supports a variety of different markup and programming language-specific text splitters to split your text based on l...
4e9727215e95-1122
");', metadata: { loc: [Object] } }, Document { pageContent: '}\n// Call the function', metadata: { loc: [Object] } }, Document { pageContent: 'helloWorld();', metadata: { loc: [Object] } } ]*/API Reference:SupportedTextSplitterLanguages from langchain/text_splitterRecursiveChar...
4e9727215e95-1123
")', metadata: { loc: [Object] } }, Document { pageContent: '# Call the function', metadata: { loc: [Object] } }, Document { pageContent: 'hello_world()', metadata: { loc: [Object] } } ]*/API Reference:RecursiveCharacterTextSplitter from langchain/text_splitterHTML​import { Recu...
4e9727215e95-1124
</div> </body></html>`;const splitter = RecursiveCharacterTextSplitter.fromLanguage("html", { chunkSize: 175, chunkOverlap: 20,});const output = await splitter.createDocuments([text]);console.log(output);/* [ Document { pageContent: '<!DOCTYPE html>\n<html>', metadata: { loc: [Object] } }, Docume...
4e9727215e95-1125
Reference:RecursiveCharacterTextSplitter from langchain/text_splitterLatex​import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const text = `\\begin{document}\\title{🦜️🔗 LangChain}⚡ Building applications with LLMs through composability ⚡\\section{Quick Install}\\begin{verbatim}Hopefully this code...
4e9727215e95-1126
Split code and markupCodeTextSplitter allows you to split your code and markup with support for multiple languages.LangChain supports a variety of different markup and programming language-specific text splitters to split your text based on language-specific syntax. This results in more semantically self-contained chu...
4e9727215e95-1127
");', metadata: { loc: [Object] } }, Document { pageContent: '}\n// Call the function', metadata: { loc: [Object] } }, Document { pageContent: 'helloWorld();', metadata: { loc: [Object] } } ]*/API Reference:SupportedTextSplitterLanguages from langchain/text_splitterRecursiveChar...
4e9727215e95-1128
")', metadata: { loc: [Object] } }, Document { pageContent: '# Call the function', metadata: { loc: [Object] } }, Document { pageContent: 'hello_world()', metadata: { loc: [Object] } } ]*/API Reference:RecursiveCharacterTextSplitter from langchain/text_splitterHTML​import { Recu...
4e9727215e95-1129
</div> </body></html>`;const splitter = RecursiveCharacterTextSplitter.fromLanguage("html", { chunkSize: 175, chunkOverlap: 20,});const output = await splitter.createDocuments([text]);console.log(output);/* [ Document { pageContent: '<!DOCTYPE html>\n<html>', metadata: { loc: [Object] } }, Docume...
4e9727215e95-1130
Reference:RecursiveCharacterTextSplitter from langchain/text_splitterLatex​import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const text = `\\begin{document}\\title{🦜️🔗 LangChain}⚡ Building applications with LLMs through composability ⚡\\section{Quick Install}\\begin{verbatim}Hopefully this code...
4e9727215e95-1131
CodeTextSplitter allows you to split your code and markup with support for multiple languages. LangChain supports a variety of different markup and programming language-specific text splitters to split your text based on language-specific syntax. This results in more semantically self-contained chunks that are more u...
4e9727215e95-1132
import { SupportedTextSplitterLanguages, RecursiveCharacterTextSplitter,} from "langchain/text_splitter";console.log(SupportedTextSplitterLanguages); // Array of supported languages/* [ 'cpp', 'go', 'java', 'js', 'php', 'proto', 'python', 'rst', 'ruby', 'rust', 'scala', 'swif...
4e9727215e95-1133
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const pythonCode = `def hello_world(): print("Hello, World! ")# Call the functionhello_world()`;const splitter = RecursiveCharacterTextSplitter.fromLanguage("python", { chunkSize: 32, chunkOverlap: 0,});const pythonOutput = await splitter.creat...
4e9727215e95-1134
</div> </body></html>`;const splitter = RecursiveCharacterTextSplitter.fromLanguage("html", { chunkSize: 175, chunkOverlap: 20,});const output = await splitter.createDocuments([text]);console.log(output);/* [ Document { pageContent: '<!DOCTYPE html>\n<html>', metadata: { loc: [Object] } }, Docume...
4e9727215e95-1135
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const text = `\\begin{document}\\title{🦜️🔗 LangChain}⚡ Building applications with LLMs through composability ⚡\\section{Quick Install}\\begin{verbatim}Hopefully this code block isn't splityarn add langchain\\end{verbatim}As an open source projec...
4e9727215e95-1136
Paragraphs: Skip to main content🦜️🔗 LangChainDocsUse casesAPILangSmithPython DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersIntegrationsText splittersSplit by characterSplit code and markupContextual chunk headersCustom text splittersRecursi...
4e9727215e95-1137
Including additional contextual information directly in each chunk in the form of headers can help deal with arbitrary queries.Here's an example:import { OpenAI } from "langchain/llms/openai";import { RetrievalQAChain, loadQAStuffChain } from "langchain/chains";import { CharacterTextSplitter } from "langchain/text_spli...
4e9727215e95-1138
", "metadata": { "loc": { "lines": { "from": 1, "to": 1 } } } }, { "pageContent": "DOCUMENT NAME: Jim Interview\n\n---\n\nMy favorite color is blue. ", "metadata": { "loc": { "lines": { ...
4e9727215e95-1139
Including additional contextual information directly in each chunk in the form of headers can help deal with arbitrary queries.Here's an example:import { OpenAI } from "langchain/llms/openai";import { RetrievalQAChain, loadQAStuffChain } from "langchain/chains";import { CharacterTextSplitter } from "langchain/text_spli...
4e9727215e95-1140
", "metadata": { "loc": { "lines": { "from": 1, "to": 1 } } } }, { "pageContent": "DOCUMENT NAME: Jim Interview\n\n---\n\nMy favorite color is blue. ", "metadata": { "loc": { "lines": { ...
4e9727215e95-1141
Including additional contextual information directly in each chunk in the form of headers can help deal with arbitrary queries.Here's an example:import { OpenAI } from "langchain/llms/openai";import { RetrievalQAChain, loadQAStuffChain } from "langchain/chains";import { CharacterTextSplitter } from "langchain/text_spli...
4e9727215e95-1142
", "metadata": { "loc": { "lines": { "from": 1, "to": 1 } } } }, { "pageContent": "DOCUMENT NAME: Jim Interview\n\n---\n\nMy favorite color is blue. ", "metadata": { "loc": { "lines": { ...
4e9727215e95-1143
Including additional contextual information directly in each chunk in the form of headers can help deal with arbitrary queries.Here's an example:import { OpenAI } from "langchain/llms/openai";import { RetrievalQAChain, loadQAStuffChain } from "langchain/chains";import { CharacterTextSplitter } from "langchain/text_spli...
4e9727215e95-1144
", "metadata": { "loc": { "lines": { "from": 1, "to": 1 } } } }, { "pageContent": "DOCUMENT NAME: Jim Interview\n\n---\n\nMy favorite color is blue. ", "metadata": { "loc": { "lines": { ...
4e9727215e95-1145
import { OpenAI } from "langchain/llms/openai";import { RetrievalQAChain, loadQAStuffChain } from "langchain/chains";import { CharacterTextSplitter } from "langchain/text_splitter";import { OpenAIEmbeddings } from "langchain/embeddings/openai";import { HNSWLib } from "langchain/vectorstores/hnswlib";const splitter = ne...
4e9727215e95-1146
", "metadata": { "loc": { "lines": { "from": 1, "to": 1 } } } }, { "pageContent": "DOCUMENT NAME: Jim Interview\n\n---\n\nMy favorite color is blue. ", "metadata": { "loc": { "lines": { ...
4e9727215e95-1147
Paragraphs: Skip to main content🦜️🔗 LangChainDocsUse casesAPILangSmithPython DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersIntegrationsText splittersSplit by characterSplit code and markupContextual chunk headersCustom text splittersRecursi...
4e9727215e95-1148
ModulesData connectionDocument transformersText splittersCustom text splittersCustom text splittersIf you want to implement your own custom Text Splitter, you only need to subclass TextSplitter and implement a single method: splitText. The method takes a string and returns a list of strings. The returned strings will b...
4e9727215e95-1149
Paragraphs: Skip to main content🦜️🔗 LangChainDocsUse casesAPILangSmithPython DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersIntegrationsText splittersSplit by characterSplit code and markupContextual chunk headersCustom text splittersRecursi...
4e9727215e95-1150
In the example below we set these values to be small (for illustration purposes), but in practice they default to 1000 and 200 respectively.import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const text = `Hi.\n\nI'm Harrison.\n\nHow? Are? You?\nOkay then f f f f.This is a weird text to write, but ...
4e9727215e95-1151
Get startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersIntegrationsText splittersSplit by characterSplit code and markupContextual chunk headersCustom text splittersRecursively split by characterTokenTextSplitterText embedding modelsVector storesRetrieversExper...
4e9727215e95-1152
In the example below we set these values to be small (for illustration purposes), but in practice they default to 1000 and 200 respectively.import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const text = `Hi.\n\nI'm Harrison.\n\nHow? Are? You?\nOkay then f f f f.This is a weird text to write, but ...
4e9727215e95-1153
ModulesData connectionDocument transformersText splittersRecursively split by characterRecursively split by characterThis text splitter is the recommended one for generic text. It is parameterized by a list of characters. It tries to split on them in order until the chunks are small enough. The default list is ["\n\n",...
4e9727215e95-1154
You?\nOkay then f f f f.This is a weird text to write, but gotta test the splittingggg some how.\n\nBye!\n\n-H.`;const splitter = new RecursiveCharacterTextSplitter({ chunkSize: 10, chunkOverlap: 1,});const output = await splitter.createDocuments([text]);You'll note that in the above example we are splitting a raw te...
4e9727215e95-1155
Recursively split by characterThis text splitter is the recommended one for generic text. It is parameterized by a list of characters. It tries to split on them in order until the chunks are small enough. The default list is ["\n\n", "\n", " ", ""]. This has the effect of trying to keep all paragraphs (and then sentenc...
4e9727215e95-1156
We can also split documents directly.import { Document } from "langchain/document";import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const text = `Hi.\n\nI'm Harrison.\n\nHow? Are? You?\nOkay then f f f f.This is a weird text to write, but gotta test the splittingggg some how.\n\nBye!\n\n-H.`;con...
4e9727215e95-1157
Paragraphs: Skip to main content🦜️🔗 LangChainDocsUse casesAPILangSmithPython DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersIntegrationsText splittersSplit by characterSplit code and markupContextual chunk headersCustom text splittersRecursi...
4e9727215e95-1158
Get startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersIntegrationsText splittersSplit by characterSplit code and markupContextual chunk headersCustom text splittersRecursively split by characterTokenTextSplitterText embedding modelsVector storesRetrieversExper...
4e9727215e95-1159
TokenTextSplitterFinally, TokenTextSplitter splits a raw text string by first converting the text into BPE tokens, then split these tokens into chunks and convert the tokens within a single chunk back into text.import { Document } from "langchain/document";import { TokenTextSplitter } from "langchain/text_splitter";con...
4e9727215e95-1160
Paragraphs: Skip to main content🦜️🔗 LangChainDocsUse casesAPILangSmithPython DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsHow-toIntegrationsVector storesRetrieversExperimentalCaching embeddingsChainsMemoryAgentsCallbac...
4e9727215e95-1161
Embeddings occasionally have different embedding methods for queries versus documents, so the embedding class exposes a embedQuery and embedDocuments method.import { OpenAIEmbeddings } from "langchain/embeddings/openai";/* Create instance */const embeddings = new OpenAIEmbeddings();/* Embed queries */const res = await ...
4e9727215e95-1162
0.001373733, -0.015552171, 0.019534737, -0.016169721, 0.007316074, 0.008273906, 0.011418369, -0.01390117, -0.033347685, 0.011248227, 0.0042503807, -0.012792102, -0.0014595914, 0.028356876, 0.025407761, 0.00076445413, -0.016308354, 0.017455231, -0.016396577, 0.008557475, -0.03312083, 0.031...
4e9727215e95-1163
0.0030656934, -0.0113742575, -0.0020322427, 0.005069579, 0.0022701253, 0.036095154, -0.027449455, -0.008475555, 0.015388331, 0.018917186, 0.0018999106, -0.003349262, 0.020895867, -0.014480911, -0.025042271, 0.012546342, 0.013850759, 0.0069253794, 0.008588983, -0.015199285, -0.0029585673, -0.00...
4e9727215e95-1164
0.002720268, 0.025088841, -0.012153786, 0.012928754, 0.013054766, -0.010395928, -0.0035566676, 0.0040008575, 0.008600268, -0.020678446, -0.0019106456, 0.012178987, -0.019241918, 0.030444318, -0.03102397, 0.0035692686, -0.007749692, -0.00604854, -0.01781799, 0.004860884, -0.0156127...
4e9727215e95-1165
-0.033241767, 0.031200387, 0.03238489, -0.0212833, 0.0032416396, 0.005443686, -0.007749692, 0.0060201874,
4e9727215e95-1166
0.006281661, 0.016923312, 0.003528315, 0.0076740854, -0.01881348, 0.026109532, 0.024660403, 0.005472039, -0.0016712243, -0.0048136297, 0.018397642, 0.003011669, -0.011385117, -0.0020193304, 0.005138109, 0.0022335495, 0.03603922, -0.027495656, -0.008575066, 0.015436378, 0.018851284...
4e9727215e95-1167
0.0077763423, -0.0260478, -0.0114384955, -0.0022683728, -0.016509168, 0.041797023, 0.01787183, 0.00552271, -0.0049789557, 0.018146982, -0.01542166, 0.033752076, 0.006112323, 0.023872782, -0.016535373, -0.006623321, 0.016116094, -0.0061090477, -0.0044155475, -0.016627092, -0.022...
4e9727215e95-1168
0.017688395, 0.015225122, 0.0046186363, -0.0045007137, 0.024265857, 0.03244183, 0.0038848957, -0.03244183, -0.018893827, -0.0018065092, 0.023440398, -0.021763276, 0.015120302,
4e9727215e95-1169
0.01568371, -0.010861984, 0.011739853, -0.024501702, -0.005214801, 0.022955606, 0.001315165, -0.00492327, 0.0020358032, -0.003468891, -0.031079166, 0.0055259857, 0.0028547104, 0.012087069, 0.007992534, -0.0076256637, 0.008110457, 0.002998838, -0.024265857, 0.006977089, -0.015185...
4e9727215e95-1170
Get startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsHow-toIntegrationsVector storesRetrieversExperimentalCaching embeddingsChainsMemoryAgentsCallbacksModulesGuidesEcosystemAdditional resourcesCommunity navigatorAPI referenceModulesData c...
4e9727215e95-1171
Embeddings occasionally have different embedding methods for queries versus documents, so the embedding class exposes a embedQuery and embedDocuments method.import { OpenAIEmbeddings } from "langchain/embeddings/openai";/* Create instance */const embeddings = new OpenAIEmbeddings();/* Embed queries */const res = await ...
4e9727215e95-1172
0.001373733, -0.015552171, 0.019534737, -0.016169721, 0.007316074, 0.008273906, 0.011418369, -0.01390117, -0.033347685, 0.011248227, 0.0042503807, -0.012792102, -0.0014595914, 0.028356876, 0.025407761, 0.00076445413, -0.016308354, 0.017455231, -0.016396577, 0.008557475, -0.03312083, 0.031...
4e9727215e95-1173
0.0030656934, -0.0113742575, -0.0020322427, 0.005069579, 0.0022701253, 0.036095154, -0.027449455, -0.008475555, 0.015388331, 0.018917186, 0.0018999106, -0.003349262, 0.020895867, -0.014480911, -0.025042271, 0.012546342, 0.013850759, 0.0069253794, 0.008588983, -0.015199285, -0.0029585673, -0.00...
4e9727215e95-1174
0.002720268, 0.025088841, -0.012153786, 0.012928754, 0.013054766, -0.010395928, -0.0035566676, 0.0040008575, 0.008600268, -0.020678446, -0.0019106456, 0.012178987, -0.019241918, 0.030444318, -0.03102397, 0.0035692686, -0.007749692, -0.00604854, -0.01781799, 0.004860884, -0.0156127...
4e9727215e95-1175
-0.033241767, 0.031200387, 0.03238489, -0.0212833, 0.0032416396, 0.005443686, -0.007749692, 0.0060201874,
4e9727215e95-1176
0.006281661, 0.016923312, 0.003528315, 0.0076740854, -0.01881348, 0.026109532, 0.024660403, 0.005472039, -0.0016712243, -0.0048136297, 0.018397642, 0.003011669, -0.011385117, -0.0020193304, 0.005138109, 0.0022335495, 0.03603922, -0.027495656, -0.008575066, 0.015436378, 0.018851284...
4e9727215e95-1177
0.0077763423, -0.0260478, -0.0114384955, -0.0022683728, -0.016509168, 0.041797023, 0.01787183, 0.00552271, -0.0049789557, 0.018146982, -0.01542166, 0.033752076, 0.006112323, 0.023872782, -0.016535373, -0.006623321, 0.016116094, -0.0061090477, -0.0044155475, -0.016627092, -0.022...
4e9727215e95-1178
0.017688395, 0.015225122, 0.0046186363, -0.0045007137, 0.024265857, 0.03244183, 0.0038848957, -0.03244183, -0.018893827, -0.0018065092, 0.023440398, -0.021763276, 0.015120302,
4e9727215e95-1179
0.01568371, -0.010861984, 0.011739853, -0.024501702, -0.005214801, 0.022955606, 0.001315165, -0.00492327, 0.0020358032, -0.003468891, -0.031079166, 0.0055259857, 0.0028547104, 0.012087069, 0.007992534, -0.0076256637, 0.008110457, 0.002998838, -0.024265857, 0.006977089, -0.015185...
4e9727215e95-1180
Get startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsHow-toIntegrationsVector storesRetrieversExperimentalCaching embeddingsChainsMemoryAgentsCallbacksModulesGuidesEcosystemAdditional resourcesCommunity navigatorAPI reference ModulesData...
4e9727215e95-1181
Embeddings occasionally have different embedding methods for queries versus documents, so the embedding class exposes a embedQuery and embedDocuments method.import { OpenAIEmbeddings } from "langchain/embeddings/openai";/* Create instance */const embeddings = new OpenAIEmbeddings();/* Embed queries */const res = await ...
4e9727215e95-1182
0.001373733, -0.015552171, 0.019534737, -0.016169721, 0.007316074, 0.008273906, 0.011418369, -0.01390117, -0.033347685, 0.011248227, 0.0042503807, -0.012792102, -0.0014595914, 0.028356876, 0.025407761, 0.00076445413, -0.016308354, 0.017455231, -0.016396577, 0.008557475, -0.03312083, 0.031...
4e9727215e95-1183
0.0030656934, -0.0113742575, -0.0020322427, 0.005069579, 0.0022701253, 0.036095154, -0.027449455, -0.008475555, 0.015388331, 0.018917186, 0.0018999106, -0.003349262, 0.020895867, -0.014480911, -0.025042271, 0.012546342, 0.013850759, 0.0069253794, 0.008588983, -0.015199285, -0.0029585673, -0.00...
4e9727215e95-1184
0.002720268, 0.025088841, -0.012153786, 0.012928754, 0.013054766, -0.010395928, -0.0035566676, 0.0040008575, 0.008600268, -0.020678446, -0.0019106456, 0.012178987, -0.019241918, 0.030444318, -0.03102397, 0.0035692686, -0.007749692, -0.00604854, -0.01781799, 0.004860884, -0.0156127...
4e9727215e95-1185
-0.033241767, 0.031200387, 0.03238489, -0.0212833, 0.0032416396, 0.005443686, -0.007749692, 0.0060201874,
4e9727215e95-1186
0.006281661, 0.016923312, 0.003528315, 0.0076740854, -0.01881348, 0.026109532, 0.024660403, 0.005472039, -0.0016712243, -0.0048136297, 0.018397642, 0.003011669, -0.011385117, -0.0020193304, 0.005138109, 0.0022335495, 0.03603922, -0.027495656, -0.008575066, 0.015436378, 0.018851284...
4e9727215e95-1187
0.0077763423, -0.0260478, -0.0114384955, -0.0022683728, -0.016509168, 0.041797023, 0.01787183, 0.00552271, -0.0049789557, 0.018146982, -0.01542166, 0.033752076, 0.006112323, 0.023872782, -0.016535373, -0.006623321, 0.016116094, -0.0061090477, -0.0044155475, -0.016627092, -0.022...
4e9727215e95-1188
0.017688395, 0.015225122, 0.0046186363, -0.0045007137, 0.024265857, 0.03244183, 0.0038848957, -0.03244183, -0.018893827, -0.0018065092, 0.023440398, -0.021763276, 0.015120302,
4e9727215e95-1189
0.01568371, -0.010861984, 0.011739853, -0.024501702, -0.005214801, 0.022955606, 0.001315165, -0.00492327, 0.0020358032, -0.003468891, -0.031079166, 0.0055259857, 0.0028547104, 0.012087069, 0.007992534, -0.0076256637, 0.008110457, 0.002998838, -0.024265857, 0.006977089, -0.015185...
4e9727215e95-1190
ModulesData connectionText embedding modelsOn this pageText embedding modelsThe Embeddings class is a class designed for interfacing with text embedding models. There are lots of embedding model providers (OpenAI, Cohere, Hugging Face, etc) - this class is designed to provide a standard interface for all of them.Embedd...
4e9727215e95-1191
Embeddings occasionally have different embedding methods for queries versus documents, so the embedding class exposes a embedQuery and embedDocuments method.import { OpenAIEmbeddings } from "langchain/embeddings/openai";/* Create instance */const embeddings = new OpenAIEmbeddings();/* Embed queries */const res = await ...
4e9727215e95-1192
0.001373733, -0.015552171, 0.019534737, -0.016169721, 0.007316074, 0.008273906, 0.011418369, -0.01390117, -0.033347685, 0.011248227, 0.0042503807, -0.012792102, -0.0014595914, 0.028356876, 0.025407761, 0.00076445413, -0.016308354, 0.017455231, -0.016396577, 0.008557475, -0.03312083, 0.031...
4e9727215e95-1193
0.0030656934, -0.0113742575, -0.0020322427, 0.005069579, 0.0022701253, 0.036095154, -0.027449455, -0.008475555, 0.015388331, 0.018917186, 0.0018999106, -0.003349262, 0.020895867, -0.014480911, -0.025042271, 0.012546342, 0.013850759, 0.0069253794, 0.008588983, -0.015199285, -0.0029585673, -0.00...
4e9727215e95-1194
0.002720268, 0.025088841, -0.012153786, 0.012928754, 0.013054766, -0.010395928, -0.0035566676, 0.0040008575, 0.008600268, -0.020678446, -0.0019106456, 0.012178987, -0.019241918, 0.030444318, -0.03102397, 0.0035692686, -0.007749692, -0.00604854, -0.01781799, 0.004860884, -0.0156127...
4e9727215e95-1195
-0.033241767, 0.031200387, 0.03238489, -0.0212833, 0.0032416396, 0.005443686, -0.007749692, 0.0060201874,
4e9727215e95-1196
0.006281661, 0.016923312, 0.003528315, 0.0076740854, -0.01881348, 0.026109532, 0.024660403, 0.005472039, -0.0016712243, -0.0048136297, 0.018397642, 0.003011669, -0.011385117, -0.0020193304, 0.005138109, 0.0022335495, 0.03603922, -0.027495656, -0.008575066, 0.015436378, 0.018851284...
4e9727215e95-1197
0.0077763423, -0.0260478, -0.0114384955, -0.0022683728, -0.016509168, 0.041797023, 0.01787183, 0.00552271, -0.0049789557, 0.018146982, -0.01542166, 0.033752076, 0.006112323, 0.023872782, -0.016535373, -0.006623321, 0.016116094, -0.0061090477, -0.0044155475, -0.016627092, -0.022...
4e9727215e95-1198
0.017688395, 0.015225122, 0.0046186363, -0.0045007137, 0.024265857, 0.03244183, 0.0038848957, -0.03244183, -0.018893827, -0.0018065092, 0.023440398, -0.021763276, 0.015120302,
4e9727215e95-1199
0.01568371, -0.010861984, 0.011739853, -0.024501702, -0.005214801, 0.022955606, 0.001315165, -0.00492327, 0.0020358032, -0.003468891, -0.031079166, 0.0055259857, 0.0028547104, 0.012087069, 0.007992534, -0.0076256637, 0.008110457, 0.002998838, -0.024265857, 0.006977089, -0.015185...