From 88b92f544969cb1d56e1d5383923a499b9c8a57c Mon Sep 17 00:00:00 2001 From: Suvrakamal Das Date: Sat, 30 Mar 2024 21:25:41 +0530 Subject: [PATCH] stack example on RAG using AI Planet's GenAI Stack Create a youtube chabot that can access the youtube transcripts so we can know more about the youtube in details. --- Youtube Transcript Chatbot.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 Youtube Transcript Chatbot.json diff --git a/Youtube Transcript Chatbot.json b/Youtube Transcript Chatbot.json new file mode 100644 index 0000000..0c889a1 --- /dev/null +++ b/Youtube Transcript Chatbot.json @@ -0,0 +1 @@ +{"id":"162c27c2-b3e3-4cb9-9da3-2fe93bff9d2b","data":{"nodes":[{"width":384,"height":386,"id":"HuggingFaceEmbeddingInferenceAPI-nhU3O","type":"genericNode","position":{"x":669.4583744892674,"y":362.8570457808469},"data":{"type":"HuggingFaceEmbeddingInferenceAPI","node":{"template":{"code":{"dynamic":true,"required":true,"placeholder":"","show":false,"multiline":true,"value":"from genflow import CustomComponent\nfrom langchain.embeddings.base import Embeddings\nfrom langchain.embeddings import HuggingFaceInferenceAPIEmbeddings\n\n\nclass HuggingFaceInferenceAPIEmbeddingsComponent(CustomComponent):\n display_name: str = \"HuggingFaceInferenceAPI Embeddings\"\n description: str = \"\"\"Access HuggingFaceEmbedding model via inference api,download models locally.\"\"\"\n documentation: str = \"https://docs.aiplanet.com/components/embeddings#huggingface-inference-api-embeddings\"\n beta = False\n\n def build_config(self):\n return {\n \"inference_api_key\": {\n \"display_name\": \"Inference API Key\",\n \"is_list\": False,\n \"required\": True,\n \"value\": \"\",\n },\n \"model_name\": {\n \"display_name\": \"Model Name\",\n \"is_list\": False,\n \"required\": True,\n \"value\": \"\",\n },\n \"code\": {\"show\": False},\n }\n\n def build(self, inference_api_key: str, model_name: str) -> Embeddings:\n return HuggingFaceInferenceAPIEmbeddings(\n api_key=inference_api_key, model_name=model_name\n )\n","password":false,"name":"code","advanced":false,"type":"code","list":false},"_type":"CustomComponent","inference_api_key":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"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","password":false,"name":"inference_api_key","display_name":"Inference API Key","advanced":false,"dynamic":false,"info":"","type":"str","list":false},"model_name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"hkunlp/instructor-large","password":false,"name":"model_name","display_name":"Model Name","advanced":false,"dynamic":false,"info":"","type":"str","list":false}},"description":"Access HuggingFaceEmbedding model via inference api,download models locally.","base_classes":["Embeddings"],"display_name":"HuggingFaceInferenceAPI Embeddings","custom_fields":{"inference_api_key":null,"model_name":null},"output_types":["HuggingFaceEmbeddingInferenceAPI"],"documentation":"https://docs.aiplanet.com/components/embeddings#huggingface-inference-api-embeddings","beta":false,"error":null},"id":"HuggingFaceEmbeddingInferenceAPI-nhU3O"},"selected":false,"positionAbsolute":{"x":669.4583744892674,"y":362.8570457808469},"dragging":false},{"width":384,"height":366,"id":"HuggingFaceHub-lCKSf","type":"genericNode","position":{"x":667.7469599518786,"y":-544.1172674652211},"data":{"type":"HuggingFaceHub","node":{"template":{"callbacks":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"callbacks","advanced":false,"dynamic":false,"info":"","type":"langchain.callbacks.base.BaseCallbackHandler","list":true},"cache":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"cache","advanced":false,"dynamic":false,"info":"","type":"bool","list":false},"client":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"client","advanced":false,"dynamic":false,"info":"","type":"Any","list":false},"huggingfacehub_api_token":{"required":false,"placeholder":"","show":true,"multiline":false,"password":true,"name":"huggingfacehub_api_token","display_name":"HuggingFace Hub API Token","advanced":false,"dynamic":false,"info":"","type":"str","list":false,"value":""},"metadata":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"metadata","advanced":false,"dynamic":false,"info":"","type":"dict","list":false},"model_kwargs":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"model_kwargs","advanced":true,"dynamic":false,"info":"","type":"dict","list":false},"repo_id":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"mistralai/Mistral-7B-Instruct-v0.2","password":false,"name":"repo_id","advanced":false,"dynamic":false,"info":"","type":"str","list":false},"tags":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"tags","advanced":false,"dynamic":false,"info":"","type":"str","list":true},"task":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"text-generation","password":false,"options":["text-generation","text2text-generation","summarization"],"name":"task","advanced":true,"dynamic":false,"info":"","type":"str","list":true},"verbose":{"required":false,"placeholder":"","show":false,"multiline":false,"value":false,"password":false,"name":"verbose","advanced":false,"dynamic":false,"info":"","type":"bool","list":false},"_type":"HuggingFaceHub"},"description":"HuggingFaceHub models.","base_classes":["HuggingFaceHub","BaseLLM","LLM","BaseLanguageModel"],"display_name":"HuggingFaceHub","custom_fields":{},"output_types":[],"documentation":"https://docs.aiplanet.com/components/large-language-models#huggingfacehub","beta":false,"error":null},"id":"HuggingFaceHub-lCKSf"},"selected":false,"positionAbsolute":{"x":667.7469599518786,"y":-544.1172674652211},"dragging":false},{"width":384,"height":394,"id":"YoutubeLoader-wpR9Q","type":"genericNode","position":{"x":202.70948455290147,"y":-115.27719600735163},"data":{"type":"YoutubeLoader","node":{"template":{"code":{"dynamic":true,"required":true,"placeholder":"","show":false,"multiline":true,"value":"from typing import List\nfrom genflow import CustomComponent\nfrom langchain.document_loaders import YoutubeLoader\nfrom langchain.schema import Document\n\n\nclass YoutubeLoaderComponent(CustomComponent):\n display_name: str = \"Youtube Loader\"\n description: str = \"Downloads the YouTube transcripts and video information.\"\n documentation: str = (\n \"https://docs.aiplanet.com/components/document-loaders#youtubeloader\"\n )\n beta = False\n\n def build_config(self):\n return {\n \"youtube_url\": {\n \"display_name\": \"Video URL\",\n \"is_list\": False,\n \"required\": True,\n \"value\": \"\",\n \"input_types\":[\"Input\"]\n },\n \"language\": {\n \"display_name\": \"Language\",\n \"is_list\": False,\n \"required\": True,\n \"value\": \"en\",\n \"info\": \"language code to extract transcript. please check subtitles/cc to know available transcripts.\",\n },\n \"code\": {\"show\": False},\n # error : \n # \"add_video_info\": {\n # \"display_name\": \"Add Video Information\",\n # \"is_list\": False,\n # \"required\": False,\n # \"value\": False,\n # },\n # translation not working\n # \"translation\": {\n # \"display_name\": \"Translation\",\n # \"is_list\": False,\n # \"required\": True,\n # \"value\": \"en\",\n # },\n }\n\n def build(self, youtube_url: str, language: str) -> List[Document]:\n loader_instance = YoutubeLoader.from_youtube_url(\n youtube_url=youtube_url, add_video_info=False, language=language\n )\n return loader_instance.load()\n","password":false,"name":"code","advanced":false,"type":"code","list":false},"_type":"CustomComponent","language":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"en","password":false,"name":"language","display_name":"Language","advanced":false,"dynamic":false,"info":"language code to extract transcript. please check subtitles/cc to know available transcripts.","type":"str","list":false},"youtube_url":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"https://www.youtube.com/watch?v=pjoQdz0nxf4","password":false,"name":"youtube_url","display_name":"Video URL","advanced":false,"input_types":["Input"],"dynamic":false,"info":"","type":"str","list":false}},"description":"Downloads the YouTube transcripts and video information.","base_classes":["Document"],"display_name":"Youtube Loader","custom_fields":{"language":null,"youtube_url":null},"output_types":["YoutubeLoader"],"documentation":"https://docs.aiplanet.com/components/document-loaders#youtubeloader","beta":false,"error":null},"id":"YoutubeLoader-wpR9Q"},"selected":false,"positionAbsolute":{"x":202.70948455290147,"y":-115.27719600735163},"dragging":false},{"width":384,"height":499,"id":"RecursiveCharacterTextSplitter-N6rcv","type":"genericNode","position":{"x":665.4674064511005,"y":-169.19921916484867},"data":{"type":"RecursiveCharacterTextSplitter","node":{"template":{"code":{"dynamic":true,"required":true,"placeholder":"","show":false,"multiline":true,"value":"from typing import Optional\nfrom genflow import CustomComponent\nfrom langchain.schema import Document\nfrom genflow.utils.util import build_loader_repr_from_documents\n\n\nclass RecursiveCharacterTextSplitterComponent(CustomComponent):\n display_name: str = \"Recursive Character Text Splitter\"\n description: str = \"Split text into chunks of a specified length.\"\n documentation: str = \"https://docs.aiplanet.com/components/text-splitters#recursivecharactertextsplitter\"\n \n def build_config(self):\n return {\n \"documents\": {\n \"display_name\": \"Documents\",\n \"info\": \"The documents to split.\",\n },\n \"separators\": {\n \"display_name\": \"Separators\",\n \"info\": 'The characters to split on.\\nIf left empty defaults to [\"\\\\n\\\\n\", \"\\\\n\", \" \", \"\"].',\n \"is_list\": True,\n },\n \"chunk_size\": {\n \"display_name\": \"Chunk Size\",\n \"info\": \"The maximum length of each chunk.\",\n \"field_type\": \"int\",\n \"value\": 1000,\n },\n \"chunk_overlap\": {\n \"display_name\": \"Chunk Overlap\",\n \"info\": \"The amount of overlap between chunks.\",\n \"field_type\": \"int\",\n \"value\": 200,\n },\n \"code\": {\"show\": False},\n }\n\n def build(\n self,\n documents: list[Document],\n separators: Optional[list[str]] = None,\n chunk_size: Optional[int] = 1000,\n chunk_overlap: Optional[int] = 200,\n ) -> list[Document]:\n \"\"\"\n Split text into chunks of a specified length.\n\n Args:\n separators (list[str]): The characters to split on.\n chunk_size (int): The maximum length of each chunk.\n chunk_overlap (int): The amount of overlap between chunks.\n length_function (function): The function to use to calculate the length of the text.\n\n Returns:\n list[str]: The chunks of text.\n \"\"\"\n from langchain.text_splitter import RecursiveCharacterTextSplitter\n\n if separators == \"\":\n separators = None\n elif separators:\n # check if the separators list has escaped characters\n # if there are escaped characters, unescape them\n separators = [x.encode().decode(\"unicode-escape\") for x in separators]\n\n # Make sure chunk_size and chunk_overlap are ints\n if isinstance(chunk_size, str):\n chunk_size = int(chunk_size)\n if isinstance(chunk_overlap, str):\n chunk_overlap = int(chunk_overlap)\n splitter = RecursiveCharacterTextSplitter(\n separators=separators,\n chunk_size=chunk_size,\n chunk_overlap=chunk_overlap,\n )\n\n docs = splitter.split_documents(documents)\n self.repr_value = build_loader_repr_from_documents(docs)\n return docs\n","password":false,"name":"code","advanced":false,"type":"code","list":false},"_type":"CustomComponent","chunk_overlap":{"required":false,"placeholder":"","show":true,"multiline":false,"value":200,"password":false,"name":"chunk_overlap","display_name":"Chunk Overlap","advanced":false,"dynamic":false,"info":"The amount of overlap between chunks.","type":"int","list":false},"chunk_size":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"1000","password":false,"name":"chunk_size","display_name":"Chunk Size","advanced":false,"dynamic":false,"info":"The maximum length of each chunk.","type":"int","list":false},"documents":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"documents","display_name":"Documents","advanced":false,"dynamic":false,"info":"The documents to split.","type":"Document","list":true},"separators":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"separators","display_name":"Separators","advanced":false,"dynamic":false,"info":"The characters to split on.\nIf left empty defaults to [\"\\n\\n\", \"\\n\", \" \", \"\"].","type":"str","list":true,"value":[""]}},"description":"Split text into chunks of a specified length.","base_classes":["Document"],"display_name":"Recursive Character Text Splitter","custom_fields":{"chunk_overlap":null,"chunk_size":null,"documents":null,"separators":null},"output_types":["RecursiveCharacterTextSplitter"],"documentation":"https://docs.aiplanet.com/components/text-splitters#recursivecharactertextsplitter","beta":true,"error":null},"id":"RecursiveCharacterTextSplitter-N6rcv"},"positionAbsolute":{"x":665.4674064511005,"y":-169.19921916484867},"selected":false,"dragging":false},{"width":384,"height":290,"id":"Chroma-OlGvx","type":"genericNode","position":{"x":1128.9963987828369,"y":331.9833580292556},"data":{"type":"Chroma","node":{"template":{"code":{"dynamic":true,"required":true,"placeholder":"","show":false,"multiline":true,"value":"from typing import Optional, Union\nfrom genflow import CustomComponent\n\nfrom langchain.vectorstores.chroma import Chroma\nfrom langchain.schema import Document\nfrom langchain.vectorstores.base import VectorStore\nfrom langchain.schema import BaseRetriever\nfrom langchain.embeddings.base import Embeddings\nimport chromadb # type: ignore\n\n\nclass ChromaComponent(CustomComponent):\n \"\"\"\n A custom component for implementing a Vector Store using Chroma.\n \"\"\"\n\n display_name: str = \"Chroma\"\n description: str = \"Implementation of Vector Store using Chroma\"\n documentation = \"https://docs.aiplanet.com/components/vector-store#chroma\"\n beta: bool = True\n\n def build_config(self):\n \"\"\"\n Builds the configuration for the component.\n\n Returns:\n - dict: A dictionary containing the configuration options for the component.\n \"\"\"\n return {\n \"collection_name\": {\n \"display_name\": \"Collection Name\",\n \"value\": \"genflow\",\n \"required\": False,\n \"advanced\": True,\n },\n \"persist\": {\n \"display_name\": \"Persist\",\n \"value\": True,\n \"required\": False,\n \"advanced\": True,\n },\n \"persist_directory\": {\n \"display_name\": \"Persist Directory\",\n \"value\": \"/mnt/models/chroma\",\n \"required\": False,\n \"advanced\": True,\n },\n \"code\": {\"show\": False, \"display_name\": \"Code\"},\n \"documents\": {\"display_name\": \"Documents\", \"is_list\": True},\n \"embedding\": {\"display_name\": \"Embedding\"},\n \"chroma_server_cors_allow_origins\": {\n \"display_name\": \"Server CORS Allow Origins\",\n \"advanced\": True,\n },\n \"chroma_server_host\": {\"display_name\": \"Server Host\", \"advanced\": True},\n \"chroma_server_port\": {\"display_name\": \"Server Port\", \"advanced\": True},\n \"chroma_server_grpc_port\": {\n \"display_name\": \"Server gRPC Port\",\n \"advanced\": True,\n },\n \"chroma_server_ssl_enabled\": {\n \"display_name\": \"Server SSL Enabled\",\n \"advanced\": True,\n },\n }\n\n def build(\n self,\n chroma_server_ssl_enabled: bool,\n collection_name: Optional[str] = \"genflow\",\n persist: Optional[bool] = True,\n persist_directory: Optional[str] = \"/mnt/models/chroma\",\n embedding: Optional[Embeddings] = None,\n documents: Optional[Document] = None,\n chroma_server_cors_allow_origins: Optional[str] = None,\n chroma_server_host: Optional[str] = None,\n chroma_server_port: Optional[int] = None,\n chroma_server_grpc_port: Optional[int] = None,\n ) -> Union[VectorStore, BaseRetriever]:\n \"\"\"\n Builds the Vector Store or BaseRetriever object.\n\n Args:\n - collection_name (str): The name of the collection.\n - persist_directory (Optional[str]): The directory to persist the Vector Store to.\n - chroma_server_ssl_enabled (bool): Whether to enable SSL for the Chroma server.\n - persist (bool): Whether to persist the Vector Store or not.\n - embedding (Optional[Embeddings]): The embeddings to use for the Vector Store.\n - documents (Optional[Document]): The documents to use for the Vector Store.\n - chroma_server_cors_allow_origins (Optional[str]): The CORS allow origins for the Chroma server.\n - chroma_server_host (Optional[str]): The host for the Chroma server.\n - chroma_server_port (Optional[int]): The port for the Chroma server.\n - chroma_server_grpc_port (Optional[int]): The gRPC port for the Chroma server.\n\n Returns:\n - Union[VectorStore, BaseRetriever]: The Vector Store or BaseRetriever object.\n \"\"\"\n\n # Chroma settings\n chroma_settings = None\n\n if chroma_server_host is not None:\n chroma_settings = chromadb.config.Settings(\n chroma_server_cors_allow_origins=chroma_server_cors_allow_origins\n or None,\n chroma_server_host=chroma_server_host,\n chroma_server_port=chroma_server_port or None,\n chroma_server_grpc_port=chroma_server_grpc_port or None,\n chroma_server_ssl_enabled=chroma_server_ssl_enabled,\n )\n\n # If documents, then we need to create a Chroma instance using .from_documents\n if documents is not None and embedding is not None:\n return Chroma.from_documents(\n documents=documents, # type: ignore\n persist_directory=persist_directory if persist else None,\n collection_name=collection_name,\n embedding=embedding,\n client_settings=chroma_settings,\n )\n\n if embedding is not None:\n return Chroma(\n persist_directory=persist_directory,\n client_settings=chroma_settings,\n embedding_function=embedding,\n collection_name=collection_name,\n )\n\n return Chroma(\n persist_directory=persist_directory, client_settings=chroma_settings\n )\n","password":false,"name":"code","advanced":false,"type":"code","list":false},"_type":"CustomComponent","chroma_server_cors_allow_origins":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"chroma_server_cors_allow_origins","display_name":"Server CORS Allow Origins","advanced":true,"dynamic":false,"info":"","type":"str","list":false},"chroma_server_grpc_port":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"chroma_server_grpc_port","display_name":"Server gRPC Port","advanced":true,"dynamic":false,"info":"","type":"int","list":false},"chroma_server_host":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"chroma_server_host","display_name":"Server Host","advanced":true,"dynamic":false,"info":"","type":"str","list":false},"chroma_server_port":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"chroma_server_port","display_name":"Server Port","advanced":true,"dynamic":false,"info":"","type":"int","list":false},"chroma_server_ssl_enabled":{"required":true,"placeholder":"","show":true,"multiline":false,"value":false,"password":false,"name":"chroma_server_ssl_enabled","display_name":"Server SSL Enabled","advanced":true,"dynamic":false,"info":"","type":"bool","list":false},"collection_name":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"genflow","password":false,"name":"collection_name","display_name":"Collection Name","advanced":true,"dynamic":false,"info":"","type":"str","list":false},"documents":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"documents","display_name":"Documents","advanced":false,"dynamic":false,"info":"","type":"Document","list":true},"embedding":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"embedding","display_name":"Embedding","advanced":false,"dynamic":false,"info":"","type":"Embeddings","list":false},"persist":{"required":false,"placeholder":"","show":true,"multiline":false,"value":true,"password":false,"name":"persist","display_name":"Persist","advanced":true,"dynamic":false,"info":"","type":"bool","list":false},"persist_directory":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"/mnt/models/chroma","password":false,"name":"persist_directory","display_name":"Persist Directory","advanced":true,"dynamic":false,"info":"","type":"str","list":false}},"description":"Implementation of Vector Store using Chroma","base_classes":["VectorStore","BaseRetriever"],"display_name":"Chroma","custom_fields":{"chroma_server_cors_allow_origins":null,"chroma_server_grpc_port":null,"chroma_server_host":null,"chroma_server_port":null,"chroma_server_ssl_enabled":null,"collection_name":null,"documents":null,"embedding":null,"persist":null,"persist_directory":null},"output_types":["Chroma"],"documentation":"https://docs.aiplanet.com/components/vector-store#chroma","beta":true,"error":null},"id":"Chroma-OlGvx"},"positionAbsolute":{"x":1128.9963987828369,"y":331.9833580292556},"selected":false,"dragging":false},{"width":384,"height":338,"id":"RetrievalQA-N1TI6","type":"genericNode","position":{"x":1995.1372535367432,"y":90.35139473309522},"data":{"type":"RetrievalQA","node":{"template":{"callbacks":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"callbacks","advanced":false,"dynamic":false,"info":"","type":"langchain.callbacks.base.BaseCallbackHandler","list":true},"combine_documents_chain":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"combine_documents_chain","advanced":false,"dynamic":false,"info":"","type":"BaseCombineDocumentsChain","list":false},"memory":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"memory","advanced":false,"dynamic":false,"info":"","type":"BaseMemory","list":false},"retriever":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"retriever","advanced":false,"dynamic":false,"info":"","type":"BaseRetriever","list":false},"input_key":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"query","password":false,"name":"input_key","advanced":true,"dynamic":false,"info":"","type":"str","list":false},"metadata":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"metadata","advanced":false,"dynamic":false,"info":"","type":"dict","list":false},"output_key":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"result","password":false,"name":"output_key","advanced":true,"dynamic":false,"info":"","type":"str","list":false},"return_source_documents":{"required":false,"placeholder":"","show":true,"multiline":false,"value":true,"password":false,"name":"return_source_documents","advanced":true,"dynamic":false,"info":"","type":"bool","list":false},"tags":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"tags","advanced":false,"dynamic":false,"info":"","type":"str","list":true},"verbose":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"verbose","advanced":true,"dynamic":false,"info":"","type":"bool","list":false},"_type":"RetrievalQA"},"description":"Chain for question-answering against an index.","base_classes":["Chain","BaseRetrievalQA","RetrievalQA","Callable"],"display_name":"RetrievalQA","custom_fields":{},"output_types":[],"documentation":"https://docs.aiplanet.com/components/chains#retrievalqa-chain","beta":false,"error":null},"id":"RetrievalQA-N1TI6"},"selected":false,"positionAbsolute":{"x":1995.1372535367432,"y":90.35139473309522},"dragging":false},{"width":384,"height":332,"id":"CombineDocsChain-4CX6I","type":"genericNode","position":{"x":1135.5774774489562,"y":-14.224578733752963},"data":{"type":"CombineDocsChain","node":{"template":{"llm":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"llm","display_name":"LLM","advanced":false,"dynamic":false,"info":"","type":"BaseLanguageModel","list":false},"chain_type":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"stuff","password":false,"options":["stuff","map_reduce","map_rerank","refine"],"name":"chain_type","advanced":false,"dynamic":false,"info":"","type":"str","list":true},"_type":"load_qa_chain"},"description":"Load question answering chain.","base_classes":["BaseCombineDocumentsChain","Callable"],"display_name":"CombineDocsChain","custom_fields":{},"output_types":[],"documentation":"","beta":false,"error":null},"id":"CombineDocsChain-4CX6I"},"positionAbsolute":{"x":1135.5774774489562,"y":-14.224578733752963},"selected":false,"dragging":false},{"width":384,"height":575,"id":"ConversationBufferMemory-8FSWg","type":"genericNode","position":{"x":1132.5351871350813,"y":-604.545689967059},"data":{"type":"ConversationBufferMemory","node":{"template":{"chat_memory":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"chat_memory","advanced":false,"dynamic":false,"info":"","type":"BaseChatMessageHistory","list":false},"ai_prefix":{"required":false,"placeholder":"","show":false,"multiline":false,"value":"AI","password":false,"name":"ai_prefix","advanced":false,"dynamic":false,"info":"","type":"str","list":false},"human_prefix":{"required":false,"placeholder":"","show":false,"multiline":false,"value":"Human","password":false,"name":"human_prefix","advanced":false,"dynamic":false,"info":"","type":"str","list":false},"input_key":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"","password":false,"name":"input_key","advanced":false,"dynamic":false,"info":"The variable to be used as Chat Input when more than one variable is available.","type":"str","list":false},"memory_key":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"chat_history","password":false,"name":"memory_key","advanced":false,"dynamic":false,"info":"","type":"str","list":false},"output_key":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"","password":false,"name":"output_key","advanced":false,"dynamic":false,"info":"The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)","type":"str","list":false},"return_messages":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"return_messages","advanced":false,"dynamic":false,"info":"","type":"bool","list":false},"_type":"ConversationBufferMemory"},"description":"Buffer for storing conversation memory.","base_classes":["BaseMemory","BaseChatMemory","ConversationBufferMemory"],"display_name":"ConversationBufferMemory","custom_fields":{},"output_types":[],"documentation":"https://docs.aiplanet.com/components/memories#conversationbuffermemory","beta":false,"error":null},"id":"ConversationBufferMemory-8FSWg"},"selected":false,"positionAbsolute":{"x":1132.5351871350813,"y":-604.545689967059},"dragging":false}],"edges":[{"source":"YoutubeLoader-wpR9Q","sourceHandle":"{œbaseClassesœ:[œDocumentœ],œdataTypeœ:œYoutubeLoaderœ,œidœ:œYoutubeLoader-wpR9Qœ}","target":"RecursiveCharacterTextSplitter-N6rcv","targetHandle":"{œfieldNameœ:œdocumentsœ,œidœ:œRecursiveCharacterTextSplitter-N6rcvœ,œinputTypesœ:null,œtypeœ:œDocumentœ}","data":{"targetHandle":{"fieldName":"documents","id":"RecursiveCharacterTextSplitter-N6rcv","inputTypes":null,"type":"Document"},"sourceHandle":{"baseClasses":["Document"],"dataType":"YoutubeLoader","id":"YoutubeLoader-wpR9Q"}},"style":{"stroke":"#555"},"className":"stroke-gray-900 stroke-connection","animated":false,"id":"reactflow__edge-YoutubeLoader-wpR9Q{œbaseClassesœ:[œDocumentœ],œdataTypeœ:œYoutubeLoaderœ,œidœ:œYoutubeLoader-wpR9Qœ}-RecursiveCharacterTextSplitter-N6rcv{œfieldNameœ:œdocumentsœ,œidœ:œRecursiveCharacterTextSplitter-N6rcvœ,œinputTypesœ:null,œtypeœ:œDocumentœ}"},{"source":"HuggingFaceEmbeddingInferenceAPI-nhU3O","sourceHandle":"{œbaseClassesœ:[œEmbeddingsœ],œdataTypeœ:œHuggingFaceEmbeddingInferenceAPIœ,œidœ:œHuggingFaceEmbeddingInferenceAPI-nhU3Oœ}","target":"Chroma-OlGvx","targetHandle":"{œfieldNameœ:œembeddingœ,œidœ:œChroma-OlGvxœ,œinputTypesœ:null,œtypeœ:œEmbeddingsœ}","data":{"targetHandle":{"fieldName":"embedding","id":"Chroma-OlGvx","inputTypes":null,"type":"Embeddings"},"sourceHandle":{"baseClasses":["Embeddings"],"dataType":"HuggingFaceEmbeddingInferenceAPI","id":"HuggingFaceEmbeddingInferenceAPI-nhU3O"}},"style":{"stroke":"#555"},"className":"stroke-gray-900 stroke-connection","animated":false,"id":"reactflow__edge-HuggingFaceEmbeddingInferenceAPI-nhU3O{œbaseClassesœ:[œEmbeddingsœ],œdataTypeœ:œHuggingFaceEmbeddingInferenceAPIœ,œidœ:œHuggingFaceEmbeddingInferenceAPI-nhU3Oœ}-Chroma-OlGvx{œfieldNameœ:œembeddingœ,œidœ:œChroma-OlGvxœ,œinputTypesœ:null,œtypeœ:œEmbeddingsœ}"},{"source":"Chroma-OlGvx","sourceHandle":"{œbaseClassesœ:[œVectorStoreœ,œBaseRetrieverœ],œdataTypeœ:œChromaœ,œidœ:œChroma-OlGvxœ}","target":"RetrievalQA-N1TI6","targetHandle":"{œfieldNameœ:œretrieverœ,œidœ:œRetrievalQA-N1TI6œ,œinputTypesœ:null,œtypeœ:œBaseRetrieverœ}","data":{"targetHandle":{"fieldName":"retriever","id":"RetrievalQA-N1TI6","inputTypes":null,"type":"BaseRetriever"},"sourceHandle":{"baseClasses":["VectorStore","BaseRetriever"],"dataType":"Chroma","id":"Chroma-OlGvx"}},"style":{"stroke":"#555"},"className":"stroke-gray-900 stroke-connection","animated":false,"id":"reactflow__edge-Chroma-OlGvx{œbaseClassesœ:[œVectorStoreœ,œBaseRetrieverœ],œdataTypeœ:œChromaœ,œidœ:œChroma-OlGvxœ}-RetrievalQA-N1TI6{œfieldNameœ:œretrieverœ,œidœ:œRetrievalQA-N1TI6œ,œinputTypesœ:null,œtypeœ:œBaseRetrieverœ}"},{"source":"HuggingFaceHub-lCKSf","sourceHandle":"{œbaseClassesœ:[œHuggingFaceHubœ,œBaseLLMœ,œLLMœ,œBaseLanguageModelœ],œdataTypeœ:œHuggingFaceHubœ,œidœ:œHuggingFaceHub-lCKSfœ}","target":"CombineDocsChain-4CX6I","targetHandle":"{œfieldNameœ:œllmœ,œidœ:œCombineDocsChain-4CX6Iœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}","data":{"targetHandle":{"fieldName":"llm","id":"CombineDocsChain-4CX6I","inputTypes":null,"type":"BaseLanguageModel"},"sourceHandle":{"baseClasses":["HuggingFaceHub","BaseLLM","LLM","BaseLanguageModel"],"dataType":"HuggingFaceHub","id":"HuggingFaceHub-lCKSf"}},"style":{"stroke":"#555"},"className":"stroke-gray-900 stroke-connection","animated":false,"id":"reactflow__edge-HuggingFaceHub-lCKSf{œbaseClassesœ:[œHuggingFaceHubœ,œBaseLLMœ,œLLMœ,œBaseLanguageModelœ],œdataTypeœ:œHuggingFaceHubœ,œidœ:œHuggingFaceHub-lCKSfœ}-CombineDocsChain-4CX6I{œfieldNameœ:œllmœ,œidœ:œCombineDocsChain-4CX6Iœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}"},{"source":"CombineDocsChain-4CX6I","sourceHandle":"{œbaseClassesœ:[œBaseCombineDocumentsChainœ,œCallableœ],œdataTypeœ:œCombineDocsChainœ,œidœ:œCombineDocsChain-4CX6Iœ}","target":"RetrievalQA-N1TI6","targetHandle":"{œfieldNameœ:œcombine_documents_chainœ,œidœ:œRetrievalQA-N1TI6œ,œinputTypesœ:null,œtypeœ:œBaseCombineDocumentsChainœ}","data":{"targetHandle":{"fieldName":"combine_documents_chain","id":"RetrievalQA-N1TI6","inputTypes":null,"type":"BaseCombineDocumentsChain"},"sourceHandle":{"baseClasses":["BaseCombineDocumentsChain","Callable"],"dataType":"CombineDocsChain","id":"CombineDocsChain-4CX6I"}},"style":{"stroke":"#555"},"className":"stroke-gray-900 stroke-connection","animated":false,"id":"reactflow__edge-CombineDocsChain-4CX6I{œbaseClassesœ:[œBaseCombineDocumentsChainœ,œCallableœ],œdataTypeœ:œCombineDocsChainœ,œidœ:œCombineDocsChain-4CX6Iœ}-RetrievalQA-N1TI6{œfieldNameœ:œcombine_documents_chainœ,œidœ:œRetrievalQA-N1TI6œ,œinputTypesœ:null,œtypeœ:œBaseCombineDocumentsChainœ}"},{"source":"RecursiveCharacterTextSplitter-N6rcv","sourceHandle":"{œbaseClassesœ:[œDocumentœ],œdataTypeœ:œRecursiveCharacterTextSplitterœ,œidœ:œRecursiveCharacterTextSplitter-N6rcvœ}","target":"Chroma-OlGvx","targetHandle":"{œfieldNameœ:œdocumentsœ,œidœ:œChroma-OlGvxœ,œinputTypesœ:null,œtypeœ:œDocumentœ}","data":{"targetHandle":{"fieldName":"documents","id":"Chroma-OlGvx","inputTypes":null,"type":"Document"},"sourceHandle":{"baseClasses":["Document"],"dataType":"RecursiveCharacterTextSplitter","id":"RecursiveCharacterTextSplitter-N6rcv"}},"style":{"stroke":"#555"},"className":"stroke-gray-900 stroke-connection","animated":false,"id":"reactflow__edge-RecursiveCharacterTextSplitter-N6rcv{œbaseClassesœ:[œDocumentœ],œdataTypeœ:œRecursiveCharacterTextSplitterœ,œidœ:œRecursiveCharacterTextSplitter-N6rcvœ}-Chroma-OlGvx{œfieldNameœ:œdocumentsœ,œidœ:œChroma-OlGvxœ,œinputTypesœ:null,œtypeœ:œDocumentœ}"},{"source":"ConversationBufferMemory-8FSWg","sourceHandle":"{œbaseClassesœ:[œBaseMemoryœ,œBaseChatMemoryœ,œConversationBufferMemoryœ],œdataTypeœ:œConversationBufferMemoryœ,œidœ:œConversationBufferMemory-8FSWgœ}","target":"RetrievalQA-N1TI6","targetHandle":"{œfieldNameœ:œmemoryœ,œidœ:œRetrievalQA-N1TI6œ,œinputTypesœ:null,œtypeœ:œBaseMemoryœ}","data":{"targetHandle":{"fieldName":"memory","id":"RetrievalQA-N1TI6","inputTypes":null,"type":"BaseMemory"},"sourceHandle":{"baseClasses":["BaseMemory","BaseChatMemory","ConversationBufferMemory"],"dataType":"ConversationBufferMemory","id":"ConversationBufferMemory-8FSWg"}},"style":{"stroke":"#555"},"className":"stroke-foreground stroke-connection","animated":false,"id":"reactflow__edge-ConversationBufferMemory-8FSWg{œbaseClassesœ:[œBaseMemoryœ,œBaseChatMemoryœ,œConversationBufferMemoryœ],œdataTypeœ:œConversationBufferMemoryœ,œidœ:œConversationBufferMemory-8FSWgœ}-RetrievalQA-N1TI6{œfieldNameœ:œmemoryœ,œidœ:œRetrievalQA-N1TI6œ,œinputTypesœ:null,œtypeœ:œBaseMemoryœ}"}],"viewport":{"x":58.25380203378984,"y":317.02179817665814,"zoom":0.41209058934708703}},"description":"Chat with your youtube video and know details about it.","name":"Youtube Transcript Chatbot","flow_type":"chat"} \ No newline at end of file