diff --git a/packages/server/marketplaces/PDF QnA.json b/packages/server/marketplaces/PDF QnA.json new file mode 100644 index 000000000..fa481a1f0 --- /dev/null +++ b/packages/server/marketplaces/PDF QnA.json @@ -0,0 +1,456 @@ +{ + "description": "PDF file QnA using conversational retrieval QA chain", + "nodes": [ + { + "width": 300, + "height": 376, + "id": "recursiveCharacterTextSplitter_0", + "position": { + "x": 417.887975676309, + "y": 199.63833359116117 + }, + "type": "customNode", + "data": { + "id": "recursiveCharacterTextSplitter_0", + "label": "Recursive Character Text Splitter", + "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 + }, + { + "label": "Chunk Overlap", + "name": "chunkOverlap", + "type": "number", + "optional": true + } + ], + "inputAnchors": [], + "inputs": { + "chunkSize": 1000, + "chunkOverlap": "" + }, + "outputAnchors": [ + { + "id": "recursiveCharacterTextSplitter_0-output-recursiveCharacterTextSplitter-RecursiveCharacterTextSplitter|TextSplitter", + "name": "recursiveCharacterTextSplitter", + "label": "RecursiveCharacterTextSplitter", + "type": "RecursiveCharacterTextSplitter | TextSplitter" + } + ], + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 417.887975676309, + "y": 199.63833359116117 + }, + "dragging": false + }, + { + "width": 300, + "height": 472, + "id": "openAI_0", + "position": { + "x": 1207.112878089014, + "y": 19.892224585997383 + }, + "type": "customNode", + "data": { + "id": "openAI_0", + "label": "OpenAI", + "name": "openAI", + "type": "OpenAI", + "baseClasses": ["OpenAI", "BaseLLM", "BaseLanguageModel"], + "category": "LLMs", + "description": "Wrapper around OpenAI large language models", + "inputParams": [ + { + "label": "OpenAI Api Key", + "name": "openAIApiKey", + "type": "password" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "options", + "options": [ + { + "label": "text-davinci-003", + "name": "text-davinci-003" + }, + { + "label": "text-davinci-002", + "name": "text-davinci-002" + }, + { + "label": "text-curie-001", + "name": "text-curie-001" + }, + { + "label": "text-babbage-001", + "name": "text-babbage-001" + } + ], + "default": "text-davinci-003", + "optional": true + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "default": 0.7, + "optional": true + } + ], + "inputAnchors": [], + "inputs": { + "modelName": "text-davinci-003", + "temperature": 0.7 + }, + "outputAnchors": [ + { + "id": "openAI_0-output-openAI-OpenAI|BaseLLM|BaseLanguageModel", + "name": "openAI", + "label": "OpenAI", + "type": "OpenAI | BaseLLM | BaseLanguageModel" + } + ], + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1207.112878089014, + "y": 19.892224585997383 + }, + "dragging": false + }, + { + "width": 300, + "height": 278, + "id": "openAIEmbeddings_0", + "position": { + "x": 790.9246671661176, + "y": 621.2742019819876 + }, + "type": "customNode", + "data": { + "id": "openAIEmbeddings_0", + "label": "OpenAI Embeddings", + "name": "openAIEmbeddings", + "type": "OpenAIEmbeddings", + "baseClasses": ["OpenAIEmbeddings", "Embeddings"], + "category": "Embeddings", + "description": "OpenAI API to generate embeddings for a given text", + "inputParams": [ + { + "label": "OpenAI Api Key", + "name": "openAIApiKey", + "type": "password" + } + ], + "inputAnchors": [], + "inputs": {}, + "outputAnchors": [ + { + "id": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "name": "openAIEmbeddings", + "label": "OpenAIEmbeddings", + "type": "OpenAIEmbeddings | Embeddings" + } + ], + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 790.9246671661176, + "y": 621.2742019819876 + }, + "dragging": false + }, + { + "width": 300, + "height": 603, + "id": "pineconeUpsert_0", + "position": { + "x": 1207.9646568749058, + "y": 531.8684248168081 + }, + "type": "customNode", + "data": { + "id": "pineconeUpsert_0", + "label": "Pinecone Upsert Document", + "name": "pineconeUpsert", + "type": "Pinecone", + "baseClasses": ["Pinecone", "BaseRetriever"], + "category": "Vector Stores", + "description": "Upsert documents to Pinecone", + "inputParams": [ + { + "label": "Pinecone Api Key", + "name": "pineconeApiKey", + "type": "password", + "id": "pineconeUpsert_0-input-pineconeApiKey-password" + }, + { + "label": "Pinecone Environment", + "name": "pineconeEnv", + "type": "string", + "id": "pineconeUpsert_0-input-pineconeEnv-string" + }, + { + "label": "Pinecone Index", + "name": "pineconeIndex", + "type": "string", + "id": "pineconeUpsert_0-input-pineconeIndex-string" + } + ], + "inputAnchors": [ + { + "label": "Document", + "name": "document", + "type": "Document", + "id": "pineconeUpsert_0-input-document-Document" + }, + { + "label": "Embeddings", + "name": "embeddings", + "type": "Embeddings", + "id": "pineconeUpsert_0-input-embeddings-Embeddings" + } + ], + "inputs": { + "document": "{{pdfFile_0.data.instance}}", + "embeddings": "{{openAIEmbeddings_0.data.instance}}", + "pineconeEnv": "us-west4-gcp", + "pineconeIndex": "test" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "pineconeUpsert_0-output-retriever-Pinecone|BaseRetriever", + "name": "retriever", + "label": "Pinecone Retriever", + "type": "Pinecone | BaseRetriever" + }, + { + "id": "pineconeUpsert_0-output-vectorStore-Pinecone|VectorStore", + "name": "vectorStore", + "label": "Pinecone Vector Store", + "type": "Pinecone | VectorStore" + } + ], + "default": "retriever" + } + ], + "outputs": { + "output": "retriever" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1207.9646568749058, + "y": 531.8684248168081 + }, + "dragging": false + }, + { + "width": 300, + "height": 455, + "id": "pdfFile_0", + "position": { + "x": 806.583408520452, + "y": 95.94591389235777 + }, + "type": "customNode", + "data": { + "id": "pdfFile_0", + "label": "Pdf File", + "name": "pdfFile", + "type": "Document", + "baseClasses": ["Document"], + "category": "Document Loaders", + "description": "Load data from PDF files", + "inputParams": [ + { + "label": "Pdf File", + "name": "pdfFile", + "type": "file", + "fileType": ".pdf", + "id": "pdfFile_0-input-pdfFile-file" + }, + { + "label": "Usage", + "name": "usage", + "type": "options", + "options": [ + { + "label": "One document per page", + "name": "perPage" + }, + { + "label": "One document per file", + "name": "perFile" + } + ], + "default": "perPage", + "id": "pdfFile_0-input-usage-options" + } + ], + "inputAnchors": [ + { + "label": "Text Splitter", + "name": "textSplitter", + "type": "TextSplitter", + "optional": true, + "id": "pdfFile_0-input-textSplitter-TextSplitter" + } + ], + "inputs": { + "textSplitter": "{{recursiveCharacterTextSplitter_0.data.instance}}", + "usage": "perPage" + }, + "outputAnchors": [ + { + "id": "pdfFile_0-output-pdfFile-Document", + "name": "pdfFile", + "label": "Document", + "type": "Document" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 806.583408520452, + "y": 95.94591389235777 + }, + "dragging": false + }, + { + "width": 300, + "height": 280, + "id": "conversationalRetrievalQAChain_0", + "position": { + "x": 1608.5085986864585, + "y": 415.26454165076757 + }, + "type": "customNode", + "data": { + "id": "conversationalRetrievalQAChain_0", + "label": "Conversational Retrieval QA Chain", + "name": "conversationalRetrievalQAChain", + "type": "ConversationalRetrievalQAChain", + "baseClasses": ["ConversationalRetrievalQAChain", "BaseChain"], + "category": "Chains", + "description": "Document QA - built on RetrievalQAChain to provide a chat history component", + "inputParams": [], + "inputAnchors": [ + { + "label": "LLM", + "name": "llm", + "type": "BaseLLM", + "id": "conversationalRetrievalQAChain_0-input-llm-BaseLLM" + }, + { + "label": "Vector Store Retriever", + "name": "vectorStoreRetriever", + "type": "BaseRetriever", + "id": "conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever" + } + ], + "inputs": { + "llm": "{{openAI_0.data.instance}}", + "vectorStoreRetriever": "{{pineconeUpsert_0.data.instance}}" + }, + "outputAnchors": [ + { + "id": "conversationalRetrievalQAChain_0-output-conversationalRetrievalQAChain-ConversationalRetrievalQAChain|BaseChain", + "name": "conversationalRetrievalQAChain", + "label": "ConversationalRetrievalQAChain", + "type": "ConversationalRetrievalQAChain | BaseChain" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1608.5085986864585, + "y": 415.26454165076757 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "openAIEmbeddings_0", + "sourceHandle": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "target": "pineconeUpsert_0", + "targetHandle": "pineconeUpsert_0-input-embeddings-Embeddings", + "type": "buttonedge", + "id": "openAIEmbeddings_0-openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-pineconeUpsert_0-pineconeUpsert_0-input-embeddings-Embeddings", + "data": { + "label": "" + } + }, + { + "source": "recursiveCharacterTextSplitter_0", + "sourceHandle": "recursiveCharacterTextSplitter_0-output-recursiveCharacterTextSplitter-RecursiveCharacterTextSplitter|TextSplitter", + "target": "pdfFile_0", + "targetHandle": "pdfFile_0-input-textSplitter-TextSplitter", + "type": "buttonedge", + "id": "recursiveCharacterTextSplitter_0-recursiveCharacterTextSplitter_0-output-recursiveCharacterTextSplitter-RecursiveCharacterTextSplitter|TextSplitter-pdfFile_0-pdfFile_0-input-textSplitter-TextSplitter", + "data": { + "label": "" + } + }, + { + "source": "pdfFile_0", + "sourceHandle": "pdfFile_0-output-pdfFile-Document", + "target": "pineconeUpsert_0", + "targetHandle": "pineconeUpsert_0-input-document-Document", + "type": "buttonedge", + "id": "pdfFile_0-pdfFile_0-output-pdfFile-Document-pineconeUpsert_0-pineconeUpsert_0-input-document-Document", + "data": { + "label": "" + } + }, + { + "source": "openAI_0", + "sourceHandle": "openAI_0-output-openAI-OpenAI|BaseLLM|BaseLanguageModel", + "target": "conversationalRetrievalQAChain_0", + "targetHandle": "conversationalRetrievalQAChain_0-input-llm-BaseLLM", + "type": "buttonedge", + "id": "openAI_0-openAI_0-output-openAI-OpenAI|BaseLLM|BaseLanguageModel-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-llm-BaseLLM", + "data": { + "label": "" + } + }, + { + "source": "pineconeUpsert_0", + "sourceHandle": "pineconeUpsert_0-output-retriever-Pinecone|BaseRetriever", + "target": "conversationalRetrievalQAChain_0", + "targetHandle": "conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever", + "type": "buttonedge", + "id": "pineconeUpsert_0-pineconeUpsert_0-output-retriever-Pinecone|BaseRetriever-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever", + "data": { + "label": "" + } + } + ] +}