{ "nodes": [ { "width": 300, "height": 420, "id": "openAIEmbeddings_0", "position": { "x": 551.898318794988, "y": 521.0870888518298 }, "type": "customNode", "data": { "id": "openAIEmbeddings_0", "label": "OpenAI Embeddings", "version": 4, "name": "openAIEmbeddings", "type": "OpenAIEmbeddings", "baseClasses": [ "OpenAIEmbeddings", "Embeddings" ], "category": "Embeddings", "description": "OpenAI API to generate embeddings for a given text", "inputParams": [ { "label": "Connect Credential", "name": "credential", "type": "credential", "credentialNames": [ "openAIApi" ], "id": "openAIEmbeddings_0-input-credential-credential" }, { "label": "Model Name", "name": "modelName", "type": "asyncOptions", "loadMethod": "listModels", "default": "text-embedding-ada-002", "id": "openAIEmbeddings_0-input-modelName-asyncOptions" }, { "label": "Strip New Lines", "name": "stripNewLines", "type": "boolean", "optional": true, "additionalParams": true, "id": "openAIEmbeddings_0-input-stripNewLines-boolean" }, { "label": "Batch Size", "name": "batchSize", "type": "number", "optional": true, "additionalParams": true, "id": "openAIEmbeddings_0-input-batchSize-number" }, { "label": "Timeout", "name": "timeout", "type": "number", "optional": true, "additionalParams": true, "id": "openAIEmbeddings_0-input-timeout-number" }, { "label": "BasePath", "name": "basepath", "type": "string", "optional": true, "additionalParams": true, "id": "openAIEmbeddings_0-input-basepath-string" }, { "label": "Dimensions", "name": "dimensions", "type": "number", "optional": true, "additionalParams": true, "id": "openAIEmbeddings_0-input-dimensions-number" } ], "inputAnchors": [], "inputs": { "modelName": "text-embedding-ada-002", "stripNewLines": "", "batchSize": "", "timeout": "", "basepath": "", "dimensions": "" }, "outputAnchors": [ { "id": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", "name": "openAIEmbeddings", "label": "OpenAIEmbeddings", "description": "OpenAI API to generate embeddings for a given text", "type": "OpenAIEmbeddings | Embeddings" } ], "outputs": {}, "selected": false }, "selected": false, "positionAbsolute": { "x": 551.898318794988, "y": 521.0870888518298 }, "dragging": false }, { "width": 300, "height": 426, "id": "recursiveCharacterTextSplitter_0", "position": { "x": 65.52694674492622, "y": -129.28423743229172 }, "type": "customNode", "data": { "id": "recursiveCharacterTextSplitter_0", "label": "Recursive Character Text Splitter", "version": 2, "name": "recursiveCharacterTextSplitter", "type": "RecursiveCharacterTextSplitter", "baseClasses": [ "RecursiveCharacterTextSplitter", "TextSplitter" ], "category": "Text Splitters", "description": "Split documents recursively by different characters - starting with \"\\n\\n\", then \"\\n\", then \" \"", "inputParams": [ { "label": "Chunk Size", "name": "chunkSize", "type": "number", "default": 1000, "optional": true, "id": "recursiveCharacterTextSplitter_0-input-chunkSize-number" }, { "label": "Chunk Overlap", "name": "chunkOverlap", "type": "number", "optional": true, "id": "recursiveCharacterTextSplitter_0-input-chunkOverlap-number" }, { "label": "Custom Separators", "name": "separators", "type": "string", "rows": 4, "description": "Array of custom separators to determine when to split the text, will override the default separators", "placeholder": "[\"|\", \"##\", \">\", \"-\"]", "additionalParams": true, "optional": true, "id": "recursiveCharacterTextSplitter_0-input-separators-string" } ], "inputAnchors": [], "inputs": { "chunkSize": "200", "chunkOverlap": "20" }, "outputAnchors": [ { "id": "recursiveCharacterTextSplitter_0-output-recursiveCharacterTextSplitter-RecursiveCharacterTextSplitter|TextSplitter", "name": "recursiveCharacterTextSplitter", "label": "RecursiveCharacterTextSplitter", "type": "RecursiveCharacterTextSplitter | TextSplitter" } ], "outputs": {}, "selected": false }, "selected": false, "positionAbsolute": { "x": 65.52694674492622, "y": -129.28423743229172 }, "dragging": false }, { "width": 300, "height": 526, "id": "conversationalRetrievalQAChain_0", "position": { "x": 1479.8961773397668, "y": 304.1837648607072 }, "type": "customNode", "data": { "id": "conversationalRetrievalQAChain_0", "label": "Conversational Retrieval QA Chain", "version": 3, "name": "conversationalRetrievalQAChain", "type": "ConversationalRetrievalQAChain", "baseClasses": [ "ConversationalRetrievalQAChain", "BaseChain", "Runnable" ], "category": "Chains", "description": "Document QA - built on RetrievalQAChain to provide a chat history component", "inputParams": [ { "label": "Return Source Documents", "name": "returnSourceDocuments", "type": "boolean", "optional": true, "id": "conversationalRetrievalQAChain_0-input-returnSourceDocuments-boolean" }, { "label": "Rephrase Prompt", "name": "rephrasePrompt", "type": "string", "description": "Using previous chat history, rephrase question into a standalone question", "warning": "Prompt must include input variables: {chat_history} and {question}", "rows": 4, "additionalParams": true, "optional": true, "default": "Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.\n\nChat History:\n{chat_history}\nFollow Up Input: {question}\nStandalone Question:", "id": "conversationalRetrievalQAChain_0-input-rephrasePrompt-string" }, { "label": "Response Prompt", "name": "responsePrompt", "type": "string", "description": "Taking the rephrased question, search for answer from the provided context", "warning": "Prompt must include input variable: {context}", "rows": 4, "additionalParams": true, "optional": true, "default": "You are a helpful assistant. Using the provided context, answer the user's question to the best of your ability using the resources provided.\nIf there is nothing in the context relevant to the question at hand, just say \"Hmm, I'm not sure.\" Don't try to make up an answer.\n------------\n{context}\n------------\nREMEMBER: If there is no relevant information within the context, just say \"Hmm, I'm not sure.\" Don't try to make up an answer.", "id": "conversationalRetrievalQAChain_0-input-responsePrompt-string" } ], "inputAnchors": [ { "label": "Chat Model", "name": "model", "type": "BaseChatModel", "id": "conversationalRetrievalQAChain_0-input-model-BaseChatModel" }, { "label": "Vector Store Retriever", "name": "vectorStoreRetriever", "type": "BaseRetriever", "id": "conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever" }, { "label": "Memory", "name": "memory", "type": "BaseMemory", "optional": true, "description": "If left empty, a default BufferMemory will be used", "id": "conversationalRetrievalQAChain_0-input-memory-BaseMemory" }, { "label": "Input Moderation", "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", "name": "inputModeration", "type": "Moderation", "optional": true, "list": true, "id": "conversationalRetrievalQAChain_0-input-inputModeration-Moderation" } ], "inputs": { "inputModeration": [], "model": "{{chatOpenAI_0.data.instance}}", "vectorStoreRetriever": "{{faiss_0.data.instance}}", "memory": "", "rephrasePrompt": "Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.\n\nChat History:\n{chat_history}\nFollow Up Input: {question}\nStandalone Question:", "responsePrompt": "You are an informative assistant. Using the provided context, answer the user's question to the best of your ability using only the provided context. \n\nIf there is nothing in the context or inputs relevant to the question at hand, just say \"I'm not sure.\" Don't try to make up an answer. \n------------\n{context}\n------------\nREMEMBER: If there is no relevant information within the context, just say \"I'm not sure.\" Don't try to make up an answer. ", "returnSourceDocuments": true }, "outputAnchors": [ { "id": "conversationalRetrievalQAChain_0-output-conversationalRetrievalQAChain-ConversationalRetrievalQAChain|BaseChain|Runnable", "name": "conversationalRetrievalQAChain", "label": "ConversationalRetrievalQAChain", "type": "ConversationalRetrievalQAChain | BaseChain | Runnable" } ], "outputs": {}, "selected": false }, "positionAbsolute": { "x": 1479.8961773397668, "y": 304.1837648607072 }, "selected": false, "dragging": false }, { "width": 300, "height": 664, "id": "chatOpenAI_0", "position": { "x": 1093.9380699660267, "y": -285.2206286861737 }, "type": "customNode", "data": { "id": "chatOpenAI_0", "label": "ChatOpenAI", "version": 6, "name": "chatOpenAI", "type": "ChatOpenAI", "baseClasses": [ "ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable" ], "category": "Chat Models", "description": "Wrapper around OpenAI large language models that use the Chat endpoint", "inputParams": [ { "label": "Connect Credential", "name": "credential", "type": "credential", "credentialNames": [ "openAIApi" ], "id": "chatOpenAI_0-input-credential-credential" }, { "label": "Model Name", "name": "modelName", "type": "asyncOptions", "loadMethod": "listModels", "default": "gpt-3.5-turbo", "id": "chatOpenAI_0-input-modelName-options" }, { "label": "Temperature", "name": "temperature", "type": "number", "step": 0.1, "default": 0.9, "optional": true, "id": "chatOpenAI_0-input-temperature-number" }, { "label": "Max Tokens", "name": "maxTokens", "type": "number", "step": 1, "optional": true, "additionalParams": true, "id": "chatOpenAI_0-input-maxTokens-number" }, { "label": "Top Probability", "name": "topP", "type": "number", "step": 0.1, "optional": true, "additionalParams": true, "id": "chatOpenAI_0-input-topP-number" }, { "label": "Frequency Penalty", "name": "frequencyPenalty", "type": "number", "step": 0.1, "optional": true, "additionalParams": true, "id": "chatOpenAI_0-input-frequencyPenalty-number" }, { "label": "Presence Penalty", "name": "presencePenalty", "type": "number", "step": 0.1, "optional": true, "additionalParams": true, "id": "chatOpenAI_0-input-presencePenalty-number" }, { "label": "Timeout", "name": "timeout", "type": "number", "step": 1, "optional": true, "additionalParams": true, "id": "chatOpenAI_0-input-timeout-number" }, { "label": "BasePath", "name": "basepath", "type": "string", "optional": true, "additionalParams": true, "id": "chatOpenAI_0-input-basepath-string" }, { "label": "BaseOptions", "name": "baseOptions", "type": "json", "optional": true, "additionalParams": true, "id": "chatOpenAI_0-input-baseOptions-json" }, { "label": "Allow Image Uploads", "name": "allowImageUploads", "type": "boolean", "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", "default": false, "optional": true, "id": "chatOpenAI_0-input-allowImageUploads-boolean" }, { "label": "Image Resolution", "description": "This parameter controls the resolution in which the model views the image.", "name": "imageResolution", "type": "options", "options": [ { "label": "Low", "name": "low" }, { "label": "High", "name": "high" }, { "label": "Auto", "name": "auto" } ], "default": "low", "optional": false, "additionalParams": true, "id": "chatOpenAI_0-input-imageResolution-options" } ], "inputAnchors": [ { "label": "Cache", "name": "cache", "type": "BaseCache", "optional": true, "id": "chatOpenAI_0-input-cache-BaseCache" } ], "inputs": { "cache": "", "modelName": "gpt-3.5-turbo-16k", "temperature": "0.6", "maxTokens": "", "topP": "", "frequencyPenalty": "", "presencePenalty": "", "timeout": "", "basepath": "", "baseOptions": "", "allowImageUploads": true, "imageResolution": "low" }, "outputAnchors": [ { "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", "name": "chatOpenAI", "label": "ChatOpenAI", "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" } ], "outputs": {}, "selected": false }, "selected": false, "positionAbsolute": { "x": 1093.9380699660267, "y": -285.2206286861737 }, "dragging": false }, { "id": "textFile_0", "position": { "x": 515.7023372615639, "y": -850.7776811141198 }, "type": "customNode", "data": { "id": "textFile_0", "label": "Text File", "version": 3, "name": "textFile", "type": "Document", "baseClasses": [ "Document" ], "category": "Document Loaders", "description": "Load data from text files", "inputParams": [ { "label": "Txt File", "name": "txtFile", "type": "file", "fileType": ".txt, .html, .aspx, .asp, .cpp, .c, .cs, .css, .go, .h, .java, .js, .less, .ts, .php, .proto, .python, .py, .rst, .ruby, .rb, .rs, .scala, .sc, .scss, .sol, .sql, .swift, .markdown, .md, .tex, .ltx, .vb, .xml", "id": "textFile_0-input-txtFile-file" }, { "label": "Additional Metadata", "name": "metadata", "type": "json", "description": "Additional metadata to be added to the extracted documents", "optional": true, "additionalParams": true, "id": "textFile_0-input-metadata-json" }, { "label": "Omit Metadata Keys", "name": "omitMetadataKeys", "type": "string", "rows": 4, "description": "Each document loader comes with a default set of metadata keys that are extracted from the document. You can use this field to omit some of the default metadata keys. The value should be a list of keys, seperated by comma. Use * to omit all metadata keys execept the ones you specify in the Additional Metadata field", "placeholder": "key1, key2, key3.nestedKey1", "optional": true, "additionalParams": true, "id": "textFile_0-input-omitMetadataKeys-string" } ], "inputAnchors": [ { "label": "Text Splitter", "name": "textSplitter", "type": "TextSplitter", "optional": true, "id": "textFile_0-input-textSplitter-TextSplitter" } ], "inputs": { "textSplitter": "{{recursiveCharacterTextSplitter_0.data.instance}}", "metadata": "", "omitMetadataKeys": "" }, "outputAnchors": [ { "name": "output", "label": "Output", "type": "options", "description": "Array of document objects containing metadata and pageContent", "options": [ { "id": "textFile_0-output-document-Document|json", "name": "document", "label": "Document", "description": "Array of document objects containing metadata and pageContent", "type": "Document | json" }, { "id": "textFile_0-output-text-string|json", "name": "text", "label": "Text", "description": "Concatenated string from pageContent of documents", "type": "string | json" } ], "default": "document" } ], "outputs": { "output": "document" }, "selected": false }, "width": 300, "height": 1263, "selected": false, "positionAbsolute": { "x": 515.7023372615639, "y": -850.7776811141198 }, "dragging": false }, { "id": "faiss_0", "position": { "x": 1011.7164640533672, "y": 539.1164591452028 }, "type": "customNode", "data": { "id": "faiss_0", "label": "Faiss", "version": 1, "name": "faiss", "type": "Faiss", "baseClasses": [ "Faiss", "VectorStoreRetriever", "BaseRetriever" ], "category": "Vector Stores", "description": "Upsert embedded data and perform similarity search upon query using Faiss library from Meta", "inputParams": [ { "label": "Base Path to load", "name": "basePath", "description": "Path to load faiss.index file", "placeholder": "C:\\Users\\User\\Desktop", "type": "string", "id": "faiss_0-input-basePath-string" }, { "label": "Top K", "name": "topK", "description": "Number of top results to fetch. Default to 4", "placeholder": "4", "type": "number", "additionalParams": true, "optional": true, "id": "faiss_0-input-topK-number" } ], "inputAnchors": [ { "label": "Document", "name": "document", "type": "Document", "list": true, "optional": true, "id": "faiss_0-input-document-Document" }, { "label": "Embeddings", "name": "embeddings", "type": "Embeddings", "id": "faiss_0-input-embeddings-Embeddings" } ], "inputs": { "document": [ "{{textFile_0.data.instance}}" ], "embeddings": "{{openAIEmbeddings_0.data.instance}}", "basePath": "/Users/cellith1/Desktop/data/", "topK": "" }, "outputAnchors": [ { "name": "output", "label": "Output", "type": "options", "description": "", "options": [ { "id": "faiss_0-output-retriever-Faiss|VectorStoreRetriever|BaseRetriever", "name": "retriever", "label": "Faiss Retriever", "description": "", "type": "Faiss | VectorStoreRetriever | BaseRetriever" }, { "id": "faiss_0-output-vectorStore-Faiss|SaveableVectorStore|VectorStore", "name": "vectorStore", "label": "Faiss Vector Store", "description": "", "type": "Faiss | SaveableVectorStore | VectorStore" } ], "default": "retriever" } ], "outputs": { "output": "retriever" }, "selected": false }, "width": 300, "height": 455, "selected": false, "dragging": false, "positionAbsolute": { "x": 1011.7164640533672, "y": 539.1164591452028 } } ], "edges": [ { "source": "chatOpenAI_0", "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", "target": "conversationalRetrievalQAChain_0", "targetHandle": "conversationalRetrievalQAChain_0-input-model-BaseChatModel", "type": "buttonedge", "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-model-BaseChatModel", "data": { "label": "" } }, { "source": "openAIEmbeddings_0", "sourceHandle": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", "target": "faiss_0", "targetHandle": "faiss_0-input-embeddings-Embeddings", "type": "buttonedge", "id": "openAIEmbeddings_0-openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-faiss_0-faiss_0-input-embeddings-Embeddings" }, { "source": "faiss_0", "sourceHandle": "faiss_0-output-retriever-Faiss|VectorStoreRetriever|BaseRetriever", "target": "conversationalRetrievalQAChain_0", "targetHandle": "conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever", "type": "buttonedge", "id": "faiss_0-faiss_0-output-retriever-Faiss|VectorStoreRetriever|BaseRetriever-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever" }, { "source": "recursiveCharacterTextSplitter_0", "sourceHandle": "recursiveCharacterTextSplitter_0-output-recursiveCharacterTextSplitter-RecursiveCharacterTextSplitter|TextSplitter", "target": "textFile_0", "targetHandle": "textFile_0-input-textSplitter-TextSplitter", "type": "buttonedge", "id": "recursiveCharacterTextSplitter_0-recursiveCharacterTextSplitter_0-output-recursiveCharacterTextSplitter-RecursiveCharacterTextSplitter|TextSplitter-textFile_0-textFile_0-input-textSplitter-TextSplitter" }, { "source": "textFile_0", "sourceHandle": "textFile_0-output-document-Document|json", "target": "faiss_0", "targetHandle": "faiss_0-input-document-Document", "type": "buttonedge", "id": "textFile_0-textFile_0-output-document-Document|json-faiss_0-faiss_0-input-document-Document" } ] }