-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLangflowAzureOpenAIFinal_.json
1 lines (1 loc) · 81.4 KB
/
LangflowAzureOpenAIFinal_.json
1
{"id":"f2fc4321-5e1f-4c5e-a4fa-92d55cb50f68","data":{"nodes":[{"id":"TextInput-eTSfe","type":"genericNode","position":{"x":-262.2676168979722,"y":23.79032115078755},"data":{"type":"TextInput","node":{"template":{"input_value":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":"Aditya Anand","fileTypes":[],"file_path":"","password":false,"name":"input_value","display_name":"Text","advanced":false,"input_types":["Record","Text"],"dynamic":false,"info":"Text or Record to be passed as input.","load_from_db":false,"title_case":false},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import Optional\n\nfrom langflow.base.io.text import TextComponent\nfrom langflow.field_typing import Text\n\n\nclass TextInput(TextComponent):\n display_name = \"Text Input\"\n description = \"Get text inputs from the Playground.\"\n icon = \"type\"\n\n def build_config(self):\n return {\n \"input_value\": {\n \"display_name\": \"Text\",\n \"input_types\": [\"Record\", \"Text\"],\n \"info\": \"Text or Record to be passed as input.\",\n },\n \"record_template\": {\n \"display_name\": \"Record Template\",\n \"multiline\": True,\n \"info\": \"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n \"advanced\": True,\n },\n }\n\n def build(\n self,\n input_value: Optional[Text] = \"\",\n record_template: Optional[str] = \"\",\n ) -> Text:\n return super().build(input_value=input_value, record_template=record_template)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"record_template":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"record_template","display_name":"Record Template","advanced":true,"dynamic":false,"info":"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.","load_from_db":false,"title_case":false,"input_types":["Text"]},"_type":"CustomComponent"},"description":"Get text inputs from the Playground.","icon":"type","base_classes":["object","str","Text"],"display_name":"Name","documentation":"","custom_fields":{"input_value":null,"record_template":null},"output_types":["Text"],"field_formatters":{},"frozen":false,"field_order":[],"beta":false,"edited":true},"id":"TextInput-eTSfe","description":"Get text inputs from the Playground.","display_name":"Name","edited":false},"selected":false,"width":384,"height":297,"positionAbsolute":{"x":-262.2676168979722,"y":23.79032115078755},"dragging":false},{"id":"ChatOutput-Zrn6E","type":"genericNode","position":{"x":2664.474902699062,"y":222.0265962317244},"data":{"type":"ChatOutput","node":{"template":{"files":{"type":"file","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[".txt",".md",".mdx",".csv",".json",".yaml",".yml",".xml",".html",".htm",".pdf",".docx",".py",".sh",".sql",".js",".ts",".tsx",".jpg",".jpeg",".png",".bmp"],"file_path":"","password":false,"name":"files","display_name":"Files","advanced":true,"dynamic":false,"info":"Files to be sent with the message.","load_from_db":false,"title_case":false,"value":""},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema.message import Message\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n files: Optional[list[str]] = None,\n return_message: Optional[bool] = False,\n ) -> Union[Message, Text]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n files=files,\n return_message=return_message,\n )\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"input_value":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"fileTypes":[],"file_path":"","password":false,"name":"input_value","display_name":"Text","advanced":false,"input_types":["Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false},"return_message":{"type":"bool","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":false,"fileTypes":[],"file_path":"","password":false,"name":"return_message","display_name":"Return Message","advanced":true,"dynamic":false,"info":"Return the message as a Message containing the sender, sender_name, and session_id.","load_from_db":false,"title_case":false},"sender":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"value":"Machine","fileTypes":[],"file_path":"","password":false,"options":["Machine","User"],"name":"sender","display_name":"Sender Type","advanced":true,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"sender_name":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":"AI","fileTypes":[],"file_path":"","password":false,"name":"sender_name","display_name":"Sender Name","advanced":true,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"session_id":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"session_id","display_name":"Session ID","advanced":true,"dynamic":false,"info":"If provided, the message will be stored in the memory.","load_from_db":false,"title_case":false,"input_types":["Text"]},"_type":"CustomComponent"},"description":"Display a chat message in the Playground.","icon":"ChatOutput","base_classes":["Message","object","str","Text"],"display_name":"Chat Output","documentation":"","custom_fields":{"sender":null,"sender_name":null,"input_value":null,"session_id":null,"files":null,"return_message":null},"output_types":["Message","Text"],"field_formatters":{},"frozen":false,"field_order":[],"beta":false,"edited":true},"id":"ChatOutput-Zrn6E","description":"Display a chat message in the Playground.","display_name":"Chat Output","edited":false},"selected":false,"width":384,"height":296,"positionAbsolute":{"x":2664.474902699062,"y":222.0265962317244},"dragging":false},{"id":"AzureOpenAIModel-lY7Ze","type":"genericNode","position":{"x":2179.786380606704,"y":46.001898684804274},"data":{"type":"AzureOpenAIModel","node":{"template":{"input_value":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"input_value","display_name":"Input","advanced":false,"input_types":["Text","Record","Prompt"],"dynamic":false,"info":"","load_from_db":false,"title_case":false},"api_key":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":true,"name":"api_key","display_name":"API Key","advanced":false,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"],"value":""},"api_version":{"type":"str","required":true,"placeholder":"","list":true,"show":true,"multiline":false,"value":"2023-12-01-preview","fileTypes":[],"file_path":"","password":false,"options":["2023-03-15-preview","2023-05-15","2023-06-01-preview","2023-07-01-preview","2023-08-01-preview","2023-09-01-preview","2023-12-01-preview"],"name":"api_version","display_name":"API Version","advanced":true,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"azure_deployment":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"azure_deployment","display_name":"Deployment Name","advanced":false,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"],"value":"gptmax"},"azure_endpoint":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"azure_endpoint","display_name":"Azure Endpoint","advanced":false,"dynamic":false,"info":"Your Azure endpoint, including the resource.. Example: `https://example-resource.azure.openai.com/`","load_from_db":true,"title_case":false,"input_types":["Text"],"value":"azure_endpoint"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import Optional\n\nfrom langchain_openai import AzureChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.constants import STREAM_INFO_TEXT\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.field_typing import Text\n\n\nclass AzureChatOpenAIComponent(LCModelComponent):\n display_name: str = \"Azure OpenAI\"\n description: str = \"Generate text using Azure OpenAI LLMs.\"\n documentation: str = \"https://python.langchain.com/docs/integrations/llms/azure_openai\"\n beta = False\n icon = \"Azure\"\n\n field_order = [\n \"model\",\n \"azure_endpoint\",\n \"azure_deployment\",\n \"api_version\",\n \"api_key\",\n \"temperature\",\n \"max_tokens\",\n \"input_value\",\n \"system_message\",\n \"stream\",\n ]\n\n AZURE_OPENAI_MODELS = [\n \"gpt-35-turbo\",\n \"gpt-35-turbo-16k\",\n \"gpt-35-turbo-instruct\",\n \"gpt-4\",\n \"gpt-4-32k\",\n \"gpt-4-vision\",\n ]\n\n AZURE_OPENAI_API_VERSIONS = [\n \"2023-03-15-preview\",\n \"2023-05-15\",\n \"2023-06-01-preview\",\n \"2023-07-01-preview\",\n \"2023-08-01-preview\",\n \"2023-09-01-preview\",\n \"2023-12-01-preview\",\n ]\n\n def build_config(self):\n return {\n \"model\": {\n \"display_name\": \"Model Name\",\n \"value\": self.AZURE_OPENAI_MODELS[0],\n \"options\": self.AZURE_OPENAI_MODELS,\n },\n \"azure_endpoint\": {\n \"display_name\": \"Azure Endpoint\",\n \"info\": \"Your Azure endpoint, including the resource.. Example: `https://example-resource.azure.openai.com/`\",\n },\n \"azure_deployment\": {\n \"display_name\": \"Deployment Name\",\n },\n \"api_version\": {\n \"display_name\": \"API Version\",\n \"options\": self.AZURE_OPENAI_API_VERSIONS,\n \"value\": self.AZURE_OPENAI_API_VERSIONS[-1],\n \"advanced\": True,\n },\n \"api_key\": {\"display_name\": \"API Key\", \"password\": True},\n \"temperature\": {\n \"display_name\": \"Temperature\",\n \"value\": 0.7,\n },\n \"max_tokens\": {\n \"display_name\": \"Max Tokens\",\n \"advanced\": True,\n \"info\": \"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n },\n \"code\": {\"show\": False},\n \"input_value\": {\"display_name\": \"Input\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\n \"stream\": {\n \"display_name\": \"Stream\",\n \"info\": STREAM_INFO_TEXT,\n \"advanced\": True,\n },\n \"system_message\": {\n \"display_name\": \"System Message\",\n \"info\": \"System message to pass to the model.\",\n \"advanced\": True,\n },\n }\n\n def build(\n self,\n model: str,\n azure_endpoint: str,\n input_value: Text,\n azure_deployment: str,\n api_version: str,\n api_key: str,\n temperature: float,\n system_message: Optional[str] = None,\n max_tokens: Optional[int] = 1000,\n stream: bool = False,\n ) -> Text:\n if api_key:\n secret_api_key = SecretStr(api_key)\n else:\n secret_api_key = None\n try:\n output = AzureChatOpenAI(\n model=model,\n azure_endpoint=azure_endpoint,\n azure_deployment=azure_deployment,\n api_version=api_version,\n api_key=secret_api_key,\n temperature=temperature,\n max_tokens=max_tokens or None,\n )\n except Exception as e:\n raise ValueError(\"Could not connect to AzureOpenAI API.\") from e\n\n return self.get_chat_result(output, stream, input_value, system_message)\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"max_tokens":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":1000,"fileTypes":[],"file_path":"","password":false,"name":"max_tokens","display_name":"Max Tokens","advanced":true,"dynamic":false,"info":"The maximum number of tokens to generate. Set to 0 for unlimited tokens.","load_from_db":false,"title_case":false},"model":{"type":"str","required":true,"placeholder":"","list":true,"show":true,"multiline":false,"value":"gpt-35-turbo","fileTypes":[],"file_path":"","password":false,"options":["gpt-35-turbo","gpt-35-turbo-16k","gpt-35-turbo-instruct","gpt-4","gpt-4-32k","gpt-4-vision"],"name":"model","display_name":"Model Name","advanced":false,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"stream":{"type":"bool","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":false,"fileTypes":[],"file_path":"","password":false,"name":"stream","display_name":"Stream","advanced":true,"dynamic":false,"info":"Stream the response from the model. Streaming works only in Chat.","load_from_db":false,"title_case":false},"system_message":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"system_message","display_name":"System Message","advanced":true,"dynamic":false,"info":"System message to pass to the model.","load_from_db":false,"title_case":false,"input_types":["Text"]},"temperature":{"type":"float","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"value":0.7,"fileTypes":[],"file_path":"","password":false,"name":"temperature","display_name":"Temperature","advanced":false,"dynamic":false,"info":"","rangeSpec":{"step_type":"float","min":-1,"max":1,"step":0.1},"load_from_db":false,"title_case":false},"_type":"CustomComponent"},"description":"Generate text using Azure OpenAI LLMs.","icon":"Azure","base_classes":["object","str","Text"],"display_name":"Azure OpenAI","documentation":"https://python.langchain.com/docs/integrations/llms/azure_openai","custom_fields":{"model":null,"azure_endpoint":null,"input_value":null,"azure_deployment":null,"api_version":null,"api_key":null,"temperature":null,"system_message":null,"max_tokens":null,"stream":null},"output_types":["Text"],"field_formatters":{},"frozen":false,"field_order":["model","azure_endpoint","azure_deployment","api_version","api_key","temperature","max_tokens","input_value","system_message","stream"],"beta":false,"edited":true},"id":"AzureOpenAIModel-lY7Ze","description":"Generate text using Azure OpenAI LLMs.","display_name":"Azure OpenAI","edited":false},"selected":false,"width":384,"height":762,"positionAbsolute":{"x":2179.786380606704,"y":46.001898684804274},"dragging":false},{"id":"Prompt-IzblZ","type":"genericNode","position":{"x":1592.8453826356792,"y":114.68838733644009},"data":{"type":"Prompt","node":{"template":{"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Prompt, TemplateField, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n \"context\": TemplateField(advanced=True),\n \"history\": TemplateField(advanced=True),\n \"Question\": TemplateField(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"template":{"type":"prompt","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":"Hey, answer the user question based on the following context .\n\nThe context is this : {context}\n\nAnd this is the message history : {history}\n\nThe user question is this : {Question}","fileTypes":[],"file_path":"","password":false,"name":"template","display_name":"Template","advanced":false,"input_types":["Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false},"_type":"CustomComponent","context":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"context","display_name":"context","advanced":false,"input_types":["Document","Record","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"},"history":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"history","display_name":"history","advanced":false,"input_types":["Document","Record","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"},"Question":{"field_type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"","fileTypes":[],"file_path":"","password":false,"name":"Question","display_name":"Question","advanced":false,"input_types":["Document","Record","Text"],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"type":"str"}},"description":"Create a prompt template with dynamic variables.","icon":"prompts","is_input":null,"is_output":null,"is_composition":null,"base_classes":["object","str","Text"],"name":"","display_name":"Prompt","documentation":"","custom_fields":{"template":["context","history","Question"]},"output_types":["Text"],"full_path":null,"field_formatters":{},"frozen":false,"field_order":[],"beta":false,"error":null},"id":"Prompt-IzblZ","description":"Create a prompt template with dynamic variables.","display_name":"Prompt"},"selected":false,"width":384,"height":607,"dragging":false,"positionAbsolute":{"x":1592.8453826356792,"y":114.68838733644009}},{"id":"File-3ozyb","type":"genericNode","position":{"x":-1002.2349425843385,"y":1804.956011364767},"data":{"type":"File","node":{"template":{"path":{"type":"file","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[".txt",".md",".mdx",".csv",".json",".yaml",".yml",".xml",".html",".htm",".pdf",".docx",".py",".sh",".sql",".js",".ts",".tsx"],"file_path":"f2fc4321-5e1f-4c5e-a4fa-92d55cb50f68\\Election Commission of India Q&A_new.pdf","password":false,"name":"path","display_name":"Path","advanced":false,"dynamic":false,"info":"Supported file types: txt, md, mdx, csv, json, yaml, yml, xml, html, htm, pdf, docx, py, sh, sql, js, ts, tsx","load_from_db":false,"title_case":false,"value":""},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from pathlib import Path\nfrom typing import Any, Dict\n\nfrom langflow.base.data.utils import TEXT_FILE_TYPES, parse_text_file_to_record\nfrom langflow.custom import CustomComponent\nfrom langflow.schema import Record\n\n\nclass FileComponent(CustomComponent):\n display_name = \"File\"\n description = \"A generic file loader.\"\n icon = \"file-text\"\n\n def build_config(self) -> Dict[str, Any]:\n return {\n \"path\": {\n \"display_name\": \"Path\",\n \"field_type\": \"file\",\n \"file_types\": TEXT_FILE_TYPES,\n \"info\": f\"Supported file types: {', '.join(TEXT_FILE_TYPES)}\",\n },\n \"silent_errors\": {\n \"display_name\": \"Silent Errors\",\n \"advanced\": True,\n \"info\": \"If true, errors will not raise an exception.\",\n },\n }\n\n def load_file(self, path: str, silent_errors: bool = False) -> Record:\n resolved_path = self.resolve_path(path)\n path_obj = Path(resolved_path)\n extension = path_obj.suffix[1:].lower()\n if extension == \"doc\":\n raise ValueError(\"doc files are not supported. Please save as .docx\")\n if extension not in TEXT_FILE_TYPES:\n raise ValueError(f\"Unsupported file type: {extension}\")\n record = parse_text_file_to_record(resolved_path, silent_errors)\n self.status = record if record else \"No data\"\n return record or Record()\n\n def build(\n self,\n path: str,\n silent_errors: bool = False,\n ) -> Record:\n record = self.load_file(path, silent_errors)\n self.status = record\n return record\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"silent_errors":{"type":"bool","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":false,"fileTypes":[],"file_path":"","password":false,"name":"silent_errors","display_name":"Silent Errors","advanced":true,"dynamic":false,"info":"If true, errors will not raise an exception.","load_from_db":false,"title_case":false},"_type":"CustomComponent"},"description":"A generic file loader.","icon":"file-text","base_classes":["Record"],"display_name":"File","documentation":"","custom_fields":{"path":null,"silent_errors":null},"output_types":["Record"],"field_formatters":{},"frozen":false,"field_order":[],"beta":false},"id":"File-3ozyb"},"selected":true,"width":384,"height":289,"dragging":false,"positionAbsolute":{"x":-1002.2349425843385,"y":1804.956011364767}},{"id":"AzureOpenAIEmbeddings-w8HGc","type":"genericNode","position":{"x":376.9299496689075,"y":1646.9226091953005},"data":{"type":"AzureOpenAIEmbeddings","node":{"template":{"api_key":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":true,"name":"api_key","display_name":"API Key","advanced":false,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"],"value":""},"api_version":{"type":"str","required":true,"placeholder":"","list":true,"show":true,"multiline":false,"value":"2023-08-01-preview","fileTypes":[],"file_path":"","password":false,"options":["2022-12-01","2023-03-15-preview","2023-05-15","2023-06-01-preview","2023-07-01-preview","2023-08-01-preview"],"name":"api_version","display_name":"API Version","advanced":true,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"azure_deployment":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"azure_deployment","display_name":"Deployment Name","advanced":false,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"],"value":"gptText"},"azure_endpoint":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"azure_endpoint","display_name":"Azure Endpoint","advanced":false,"dynamic":false,"info":"Your Azure endpoint, including the resource.. Example: `https://example-resource.azure.openai.com/`","load_from_db":true,"title_case":false,"input_types":["Text"],"value":"azure_endpoint"},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from langchain_core.embeddings import Embeddings\nfrom langchain_openai import AzureOpenAIEmbeddings\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.custom import CustomComponent\n\n\nclass AzureOpenAIEmbeddingsComponent(CustomComponent):\n display_name: str = \"Azure OpenAI Embeddings\"\n description: str = \"Generate embeddings using Azure OpenAI models.\"\n documentation: str = \"https://python.langchain.com/docs/integrations/text_embedding/azureopenai\"\n beta = False\n icon = \"Azure\"\n\n API_VERSION_OPTIONS = [\n \"2022-12-01\",\n \"2023-03-15-preview\",\n \"2023-05-15\",\n \"2023-06-01-preview\",\n \"2023-07-01-preview\",\n \"2023-08-01-preview\",\n ]\n\n def build_config(self):\n return {\n \"azure_endpoint\": {\n \"display_name\": \"Azure Endpoint\",\n \"required\": True,\n \"info\": \"Your Azure endpoint, including the resource.. Example: `https://example-resource.azure.openai.com/`\",\n },\n \"azure_deployment\": {\n \"display_name\": \"Deployment Name\",\n \"required\": True,\n },\n \"api_version\": {\n \"display_name\": \"API Version\",\n \"options\": self.API_VERSION_OPTIONS,\n \"value\": self.API_VERSION_OPTIONS[-1],\n \"advanced\": True,\n },\n \"api_key\": {\n \"display_name\": \"API Key\",\n \"required\": True,\n \"password\": True,\n },\n \"code\": {\"show\": False},\n }\n\n def build(\n self,\n azure_endpoint: str,\n azure_deployment: str,\n api_version: str,\n api_key: str,\n ) -> Embeddings:\n if api_key:\n azure_api_key = SecretStr(api_key)\n else:\n azure_api_key = None\n try:\n embeddings = AzureOpenAIEmbeddings(\n azure_endpoint=azure_endpoint,\n azure_deployment=azure_deployment,\n api_version=api_version,\n api_key=azure_api_key,\n )\n\n except Exception as e:\n raise ValueError(\"Could not connect to AzureOpenAIEmbeddings API.\") from e\n\n return embeddings\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"_type":"CustomComponent"},"description":"Generate embeddings using Azure OpenAI models.","icon":"Azure","base_classes":["Embeddings"],"display_name":"Azure OpenAI Embeddings","documentation":"https://python.langchain.com/docs/integrations/text_embedding/azureopenai","custom_fields":{"azure_endpoint":null,"azure_deployment":null,"api_version":null,"api_key":null},"output_types":["Embeddings"],"field_formatters":{},"frozen":false,"field_order":[],"beta":false},"id":"AzureOpenAIEmbeddings-w8HGc"},"selected":false,"width":384,"height":516,"positionAbsolute":{"x":376.9299496689075,"y":1646.9226091953005},"dragging":false},{"id":"CharacterTextSplitter-k2ig1","type":"genericNode","position":{"x":-473.51362997589297,"y":1361.0614759038103},"data":{"type":"CharacterTextSplitter","node":{"template":{"inputs":{"type":"Record","required":true,"placeholder":"","list":true,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"inputs","display_name":"Input","advanced":false,"input_types":["Document","Record"],"dynamic":false,"info":"","load_from_db":false,"title_case":false},"chunk_overlap":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":200,"fileTypes":[],"file_path":"","password":false,"name":"chunk_overlap","display_name":"Chunk Overlap","advanced":false,"dynamic":false,"info":"","load_from_db":false,"title_case":false},"chunk_size":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":1000,"fileTypes":[],"file_path":"","password":false,"name":"chunk_size","display_name":"Chunk Size","advanced":false,"dynamic":false,"info":"","load_from_db":false,"title_case":false},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import List\n\nfrom langchain_text_splitters import CharacterTextSplitter\n\nfrom langflow.custom import CustomComponent\nfrom langflow.schema import Record\nfrom langflow.utils.util import unescape_string\n\n\nclass CharacterTextSplitterComponent(CustomComponent):\n display_name = \"CharacterTextSplitter\"\n description = \"Splitting text that looks at characters.\"\n\n def build_config(self):\n return {\n \"inputs\": {\"display_name\": \"Input\", \"input_types\": [\"Document\", \"Record\"]},\n \"chunk_overlap\": {\"display_name\": \"Chunk Overlap\", \"default\": 200},\n \"chunk_size\": {\"display_name\": \"Chunk Size\", \"default\": 1000},\n \"separator\": {\"display_name\": \"Separator\", \"default\": \"\\n\"},\n }\n\n def build(\n self,\n inputs: List[Record],\n chunk_overlap: int = 200,\n chunk_size: int = 1000,\n separator: str = \"\\n\",\n ) -> List[Record]:\n # separator may come escaped from the frontend\n separator = unescape_string(separator)\n documents = []\n for _input in inputs:\n if isinstance(_input, Record):\n documents.append(_input.to_lc_document())\n else:\n documents.append(_input)\n docs = CharacterTextSplitter(\n chunk_overlap=chunk_overlap,\n chunk_size=chunk_size,\n separator=separator,\n ).split_documents(documents)\n records = self.to_records(docs)\n self.status = records\n return records\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"separator":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":" ","fileTypes":[],"file_path":"","password":false,"name":"separator","display_name":"Separator","advanced":false,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"_type":"CustomComponent"},"description":"Splitting text that looks at characters.","base_classes":["Record"],"display_name":"CharacterTextSplitter","documentation":"","custom_fields":{"inputs":null,"chunk_overlap":null,"chunk_size":null,"separator":null},"output_types":["Record"],"field_formatters":{},"frozen":false,"field_order":[],"beta":false},"id":"CharacterTextSplitter-k2ig1"},"selected":false,"width":384,"height":517,"positionAbsolute":{"x":-473.51362997589297,"y":1361.0614759038103},"dragging":false},{"id":"ChatInput-xTqeI","type":"genericNode","position":{"x":292.94714482169036,"y":-82.01144992455426},"data":{"type":"ChatInput","node":{"template":{"files":{"type":"file","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[".txt",".md",".mdx",".csv",".json",".yaml",".yml",".xml",".html",".htm",".pdf",".docx",".py",".sh",".sql",".js",".ts",".tsx",".jpg",".jpeg",".png",".bmp"],"file_path":"","password":false,"name":"files","display_name":"Files","advanced":true,"dynamic":false,"info":"Files to be sent with the message.","load_from_db":false,"title_case":false,"value":""},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import Optional\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.schema.message import Message\nfrom langflow.field_typing import Text\nfrom typing import Union\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n\n def build_config(self):\n build_config = super().build_config()\n build_config[\"input_value\"] = {\n \"input_types\": [],\n \"display_name\": \"Text\",\n \"multiline\": True,\n }\n build_config[\"return_message\"] = {\n \"display_name\": \"Return Record\",\n \"advanced\": True,\n }\n\n return build_config\n\n def build(\n self,\n sender: Optional[str] = \"User\",\n sender_name: Optional[str] = \"User\",\n input_value: Optional[str] = None,\n files: Optional[list[str]] = None,\n session_id: Optional[str] = None,\n return_message: Optional[bool] = True,\n ) -> Union[Message, Text]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n return_message=return_message,\n )\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"input_value":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"fileTypes":[],"file_path":"","password":false,"name":"input_value","display_name":"Text","advanced":false,"input_types":[],"dynamic":false,"info":"","load_from_db":false,"title_case":false,"value":"I am a NRI. Would my vote be counted in electoral roll in India?"},"return_message":{"type":"bool","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":false,"fileTypes":[],"file_path":"","password":false,"name":"return_message","display_name":"Return Record","advanced":true,"dynamic":false,"info":"","load_from_db":false,"title_case":false},"sender":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"value":"User","fileTypes":[],"file_path":"","password":false,"options":["Machine","User"],"name":"sender","display_name":"Sender Type","advanced":true,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"sender_name":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":"User","fileTypes":[],"file_path":"","password":false,"name":"sender_name","display_name":"Sender Name","advanced":true,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"session_id":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"session_id","display_name":"Session ID","advanced":true,"dynamic":false,"info":"If provided, the message will be stored in the memory.","load_from_db":false,"title_case":false,"input_types":["Text"]},"_type":"CustomComponent"},"description":"Get chat inputs from the Playground.","icon":"ChatInput","base_classes":["Message","object","str","Text"],"display_name":"Chat Input","documentation":"","custom_fields":{"sender":null,"sender_name":null,"input_value":null,"files":null,"session_id":null,"return_message":null},"output_types":["Message","Text"],"field_formatters":{},"frozen":false,"field_order":[],"beta":false,"edited":false},"id":"ChatInput-xTqeI","description":"Get chat inputs from the Playground.","display_name":"Chat Input"},"selected":false,"width":384,"height":297,"positionAbsolute":{"x":292.94714482169036,"y":-82.01144992455426},"dragging":false},{"id":"AstraDBSearch-r2w01","type":"genericNode","position":{"x":1020.7463019062689,"y":751.9392147331705},"data":{"type":"AstraDBSearch","node":{"template":{"embedding":{"type":"Embeddings","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"embedding","display_name":"Embedding","advanced":false,"dynamic":false,"info":"Embedding to use","load_from_db":false,"title_case":false},"input_value":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"input_value","display_name":"Input Value","advanced":false,"dynamic":false,"info":"Input value to search","load_from_db":false,"title_case":false,"input_types":["Text"]},"api_endpoint":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"api_endpoint","display_name":"API Endpoint","advanced":false,"dynamic":false,"info":"API endpoint URL for the Astra DB service.","load_from_db":true,"title_case":false,"input_types":["Text"],"value":"aendpoint"},"batch_size":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"batch_size","display_name":"Batch Size","advanced":true,"dynamic":false,"info":"Optional number of records to process in a single batch.","load_from_db":false,"title_case":false},"bulk_delete_concurrency":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"bulk_delete_concurrency","display_name":"Bulk Delete Concurrency","advanced":true,"dynamic":false,"info":"Optional concurrency level for bulk delete operations.","load_from_db":false,"title_case":false},"bulk_insert_batch_concurrency":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"bulk_insert_batch_concurrency","display_name":"Bulk Insert Batch Concurrency","advanced":true,"dynamic":false,"info":"Optional concurrency level for bulk insert operations.","load_from_db":false,"title_case":false},"bulk_insert_overwrite_concurrency":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"bulk_insert_overwrite_concurrency","display_name":"Bulk Insert Overwrite Concurrency","advanced":true,"dynamic":false,"info":"Optional concurrency level for bulk insert operations that overwrite existing records.","load_from_db":false,"title_case":false},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import List, Optional\n\nfrom langflow.components.vectorstores.AstraDB import AstraDBVectorStoreComponent\nfrom langflow.components.vectorstores.base.model import LCVectorStoreComponent\nfrom langflow.field_typing import Embeddings, Text\nfrom langflow.schema import Record\n\n\nclass AstraDBSearchComponent(LCVectorStoreComponent):\n display_name = \"Astra DB Search\"\n description = \"Searches an existing Astra DB Vector Store.\"\n icon = \"AstraDB\"\n field_order = [\"token\", \"api_endpoint\", \"collection_name\", \"input_value\", \"embedding\"]\n\n def build_config(self):\n return {\n \"search_type\": {\n \"display_name\": \"Search Type\",\n \"options\": [\"Similarity\", \"MMR\"],\n },\n \"input_value\": {\n \"display_name\": \"Input Value\",\n \"info\": \"Input value to search\",\n },\n \"embedding\": {\"display_name\": \"Embedding\", \"info\": \"Embedding to use\"},\n \"collection_name\": {\n \"display_name\": \"Collection Name\",\n \"info\": \"The name of the collection within Astra DB where the vectors will be stored.\",\n },\n \"token\": {\n \"display_name\": \"Astra DB Application Token\",\n \"info\": \"Authentication token for accessing Astra DB.\",\n \"password\": True,\n },\n \"api_endpoint\": {\n \"display_name\": \"API Endpoint\",\n \"info\": \"API endpoint URL for the Astra DB service.\",\n },\n \"namespace\": {\n \"display_name\": \"Namespace\",\n \"info\": \"Optional namespace within Astra DB to use for the collection.\",\n \"advanced\": True,\n },\n \"metric\": {\n \"display_name\": \"Metric\",\n \"info\": \"Optional distance metric for vector comparisons in the vector store.\",\n \"advanced\": True,\n },\n \"batch_size\": {\n \"display_name\": \"Batch Size\",\n \"info\": \"Optional number of records to process in a single batch.\",\n \"advanced\": True,\n },\n \"bulk_insert_batch_concurrency\": {\n \"display_name\": \"Bulk Insert Batch Concurrency\",\n \"info\": \"Optional concurrency level for bulk insert operations.\",\n \"advanced\": True,\n },\n \"bulk_insert_overwrite_concurrency\": {\n \"display_name\": \"Bulk Insert Overwrite Concurrency\",\n \"info\": \"Optional concurrency level for bulk insert operations that overwrite existing records.\",\n \"advanced\": True,\n },\n \"bulk_delete_concurrency\": {\n \"display_name\": \"Bulk Delete Concurrency\",\n \"info\": \"Optional concurrency level for bulk delete operations.\",\n \"advanced\": True,\n },\n \"setup_mode\": {\n \"display_name\": \"Setup Mode\",\n \"info\": \"Configuration mode for setting up the vector store, with options like “Sync”, “Async”, or “Off”.\",\n \"options\": [\"Sync\", \"Async\", \"Off\"],\n \"advanced\": True,\n },\n \"pre_delete_collection\": {\n \"display_name\": \"Pre Delete Collection\",\n \"info\": \"Boolean flag to determine whether to delete the collection before creating a new one.\",\n \"advanced\": True,\n },\n \"metadata_indexing_include\": {\n \"display_name\": \"Metadata Indexing Include\",\n \"info\": \"Optional list of metadata fields to include in the indexing.\",\n \"advanced\": True,\n },\n \"metadata_indexing_exclude\": {\n \"display_name\": \"Metadata Indexing Exclude\",\n \"info\": \"Optional list of metadata fields to exclude from the indexing.\",\n \"advanced\": True,\n },\n \"collection_indexing_policy\": {\n \"display_name\": \"Collection Indexing Policy\",\n \"info\": \"Optional dictionary defining the indexing policy for the collection.\",\n \"advanced\": True,\n },\n \"number_of_results\": {\n \"display_name\": \"Number of Results\",\n \"info\": \"Number of results to return.\",\n \"advanced\": True,\n },\n }\n\n def build(\n self,\n embedding: Embeddings,\n collection_name: str,\n input_value: Text,\n token: str,\n api_endpoint: str,\n search_type: str = \"Similarity\",\n number_of_results: int = 4,\n namespace: Optional[str] = None,\n metric: Optional[str] = None,\n batch_size: Optional[int] = None,\n bulk_insert_batch_concurrency: Optional[int] = None,\n bulk_insert_overwrite_concurrency: Optional[int] = None,\n bulk_delete_concurrency: Optional[int] = None,\n setup_mode: str = \"Sync\",\n pre_delete_collection: bool = False,\n metadata_indexing_include: Optional[List[str]] = None,\n metadata_indexing_exclude: Optional[List[str]] = None,\n collection_indexing_policy: Optional[dict] = None,\n ) -> List[Record]:\n vector_store = AstraDBVectorStoreComponent().build(\n embedding=embedding,\n collection_name=collection_name,\n token=token,\n api_endpoint=api_endpoint,\n namespace=namespace,\n metric=metric,\n batch_size=batch_size,\n bulk_insert_batch_concurrency=bulk_insert_batch_concurrency,\n bulk_insert_overwrite_concurrency=bulk_insert_overwrite_concurrency,\n bulk_delete_concurrency=bulk_delete_concurrency,\n setup_mode=setup_mode,\n pre_delete_collection=pre_delete_collection,\n metadata_indexing_include=metadata_indexing_include,\n metadata_indexing_exclude=metadata_indexing_exclude,\n collection_indexing_policy=collection_indexing_policy,\n )\n try:\n return self.search_with_vector_store(input_value, search_type, vector_store, k=number_of_results)\n except KeyError as e:\n if \"content\" in str(e):\n raise ValueError(\n \"You should ingest data through Langflow (or LangChain) to query it in Langflow. Your collection does not contain a field name 'content'.\"\n )\n else:\n raise e\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"collection_indexing_policy":{"type":"dict","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"collection_indexing_policy","display_name":"Collection Indexing Policy","advanced":true,"dynamic":false,"info":"Optional dictionary defining the indexing policy for the collection.","load_from_db":false,"title_case":false},"collection_name":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"collection_name","display_name":"Collection Name","advanced":false,"dynamic":false,"info":"The name of the collection within Astra DB where the vectors will be stored.","load_from_db":true,"title_case":false,"input_types":["Text"],"value":"collection"},"metadata_indexing_exclude":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"metadata_indexing_exclude","display_name":"Metadata Indexing Exclude","advanced":true,"dynamic":false,"info":"Optional list of metadata fields to exclude from the indexing.","load_from_db":false,"title_case":false,"input_types":["Text"]},"metadata_indexing_include":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"metadata_indexing_include","display_name":"Metadata Indexing Include","advanced":true,"dynamic":false,"info":"Optional list of metadata fields to include in the indexing.","load_from_db":false,"title_case":false,"input_types":["Text"]},"metric":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"metric","display_name":"Metric","advanced":true,"dynamic":false,"info":"Optional distance metric for vector comparisons in the vector store.","load_from_db":false,"title_case":false,"input_types":["Text"]},"namespace":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"namespace","display_name":"Namespace","advanced":true,"dynamic":false,"info":"Optional namespace within Astra DB to use for the collection.","load_from_db":false,"title_case":false,"input_types":["Text"]},"number_of_results":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":4,"fileTypes":[],"file_path":"","password":false,"name":"number_of_results","display_name":"Number of Results","advanced":true,"dynamic":false,"info":"Number of results to return.","load_from_db":false,"title_case":false},"pre_delete_collection":{"type":"bool","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":false,"fileTypes":[],"file_path":"","password":false,"name":"pre_delete_collection","display_name":"Pre Delete Collection","advanced":true,"dynamic":false,"info":"Boolean flag to determine whether to delete the collection before creating a new one.","load_from_db":false,"title_case":false},"search_type":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"value":"Similarity","fileTypes":[],"file_path":"","password":false,"options":["Similarity","MMR"],"name":"search_type","display_name":"Search Type","advanced":false,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"setup_mode":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"value":"Sync","fileTypes":[],"file_path":"","password":false,"options":["Sync","Async","Off"],"name":"setup_mode","display_name":"Setup Mode","advanced":true,"dynamic":false,"info":"Configuration mode for setting up the vector store, with options like “Sync”, “Async”, or “Off”.","load_from_db":false,"title_case":false,"input_types":["Text"]},"token":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":true,"name":"token","display_name":"Astra DB Application Token","advanced":false,"dynamic":false,"info":"Authentication token for accessing Astra DB.","load_from_db":true,"title_case":false,"input_types":["Text"],"value":""},"_type":"CustomComponent"},"description":"Searches an existing Astra DB Vector Store.","icon":"AstraDB","base_classes":["Record"],"display_name":"Astra DB Search","documentation":"","custom_fields":{"embedding":null,"collection_name":null,"input_value":null,"token":null,"api_endpoint":null,"search_type":null,"number_of_results":null,"namespace":null,"metric":null,"batch_size":null,"bulk_insert_batch_concurrency":null,"bulk_insert_overwrite_concurrency":null,"bulk_delete_concurrency":null,"setup_mode":null,"pre_delete_collection":null,"metadata_indexing_include":null,"metadata_indexing_exclude":null,"collection_indexing_policy":null},"output_types":["Record"],"field_formatters":{},"frozen":false,"field_order":["token","api_endpoint","collection_name","input_value","embedding"],"beta":false},"id":"AstraDBSearch-r2w01"},"selected":false,"width":384,"height":721,"positionAbsolute":{"x":1020.7463019062689,"y":751.9392147331705},"dragging":false},{"id":"AstraDB-BGih3","type":"genericNode","position":{"x":960.1819936433349,"y":2048.199417704865},"data":{"type":"AstraDB","node":{"template":{"embedding":{"type":"Embeddings","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"embedding","display_name":"Embedding","advanced":false,"dynamic":false,"info":"Embedding to use","load_from_db":false,"title_case":false},"inputs":{"type":"Record","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"inputs","display_name":"Inputs","advanced":false,"dynamic":false,"info":"Optional list of records to be processed and stored in the vector store.","load_from_db":false,"title_case":false},"api_endpoint":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"api_endpoint","display_name":"API Endpoint","advanced":false,"dynamic":false,"info":"API endpoint URL for the Astra DB service.","load_from_db":true,"title_case":false,"input_types":["Text"],"value":"aendpoint"},"batch_size":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"batch_size","display_name":"Batch Size","advanced":true,"dynamic":false,"info":"Optional number of records to process in a single batch.","load_from_db":false,"title_case":false},"bulk_delete_concurrency":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"bulk_delete_concurrency","display_name":"Bulk Delete Concurrency","advanced":true,"dynamic":false,"info":"Optional concurrency level for bulk delete operations.","load_from_db":false,"title_case":false},"bulk_insert_batch_concurrency":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"bulk_insert_batch_concurrency","display_name":"Bulk Insert Batch Concurrency","advanced":true,"dynamic":false,"info":"Optional concurrency level for bulk insert operations.","load_from_db":false,"title_case":false},"bulk_insert_overwrite_concurrency":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"bulk_insert_overwrite_concurrency","display_name":"Bulk Insert Overwrite Concurrency","advanced":true,"dynamic":false,"info":"Optional concurrency level for bulk insert operations that overwrite existing records.","load_from_db":false,"title_case":false},"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import List, Optional, Union\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Embeddings, VectorStore\nfrom langflow.schema import Record\nfrom langchain_core.retrievers import BaseRetriever\n\n\nclass AstraDBVectorStoreComponent(CustomComponent):\n display_name = \"Astra DB\"\n description = \"Builds or loads an Astra DB Vector Store.\"\n icon = \"AstraDB\"\n field_order = [\"token\", \"api_endpoint\", \"collection_name\", \"inputs\", \"embedding\"]\n\n def build_config(self):\n return {\n \"inputs\": {\n \"display_name\": \"Inputs\",\n \"info\": \"Optional list of records to be processed and stored in the vector store.\",\n },\n \"embedding\": {\"display_name\": \"Embedding\", \"info\": \"Embedding to use\"},\n \"collection_name\": {\n \"display_name\": \"Collection Name\",\n \"info\": \"The name of the collection within Astra DB where the vectors will be stored.\",\n },\n \"token\": {\n \"display_name\": \"Astra DB Application Token\",\n \"info\": \"Authentication token for accessing Astra DB.\",\n \"password\": True,\n },\n \"api_endpoint\": {\n \"display_name\": \"API Endpoint\",\n \"info\": \"API endpoint URL for the Astra DB service.\",\n },\n \"namespace\": {\n \"display_name\": \"Namespace\",\n \"info\": \"Optional namespace within Astra DB to use for the collection.\",\n \"advanced\": True,\n },\n \"metric\": {\n \"display_name\": \"Metric\",\n \"info\": \"Optional distance metric for vector comparisons in the vector store.\",\n \"advanced\": True,\n },\n \"batch_size\": {\n \"display_name\": \"Batch Size\",\n \"info\": \"Optional number of records to process in a single batch.\",\n \"advanced\": True,\n },\n \"bulk_insert_batch_concurrency\": {\n \"display_name\": \"Bulk Insert Batch Concurrency\",\n \"info\": \"Optional concurrency level for bulk insert operations.\",\n \"advanced\": True,\n },\n \"bulk_insert_overwrite_concurrency\": {\n \"display_name\": \"Bulk Insert Overwrite Concurrency\",\n \"info\": \"Optional concurrency level for bulk insert operations that overwrite existing records.\",\n \"advanced\": True,\n },\n \"bulk_delete_concurrency\": {\n \"display_name\": \"Bulk Delete Concurrency\",\n \"info\": \"Optional concurrency level for bulk delete operations.\",\n \"advanced\": True,\n },\n \"setup_mode\": {\n \"display_name\": \"Setup Mode\",\n \"info\": \"Configuration mode for setting up the vector store, with options like “Sync”, “Async”, or “Off”.\",\n \"options\": [\"Sync\", \"Async\", \"Off\"],\n \"advanced\": True,\n },\n \"pre_delete_collection\": {\n \"display_name\": \"Pre Delete Collection\",\n \"info\": \"Boolean flag to determine whether to delete the collection before creating a new one.\",\n \"advanced\": True,\n },\n \"metadata_indexing_include\": {\n \"display_name\": \"Metadata Indexing Include\",\n \"info\": \"Optional list of metadata fields to include in the indexing.\",\n \"advanced\": True,\n },\n \"metadata_indexing_exclude\": {\n \"display_name\": \"Metadata Indexing Exclude\",\n \"info\": \"Optional list of metadata fields to exclude from the indexing.\",\n \"advanced\": True,\n },\n \"collection_indexing_policy\": {\n \"display_name\": \"Collection Indexing Policy\",\n \"info\": \"Optional dictionary defining the indexing policy for the collection.\",\n \"advanced\": True,\n },\n }\n\n def build(\n self,\n embedding: Embeddings,\n token: str,\n api_endpoint: str,\n collection_name: str,\n inputs: Optional[List[Record]] = None,\n namespace: Optional[str] = None,\n metric: Optional[str] = None,\n batch_size: Optional[int] = None,\n bulk_insert_batch_concurrency: Optional[int] = None,\n bulk_insert_overwrite_concurrency: Optional[int] = None,\n bulk_delete_concurrency: Optional[int] = None,\n setup_mode: str = \"Sync\",\n pre_delete_collection: bool = False,\n metadata_indexing_include: Optional[List[str]] = None,\n metadata_indexing_exclude: Optional[List[str]] = None,\n collection_indexing_policy: Optional[dict] = None,\n ) -> Union[VectorStore, BaseRetriever]:\n try:\n from langchain_astradb import AstraDBVectorStore\n from langchain_astradb.utils.astradb import SetupMode\n except ImportError:\n raise ImportError(\n \"Could not import langchain Astra DB integration package. \"\n \"Please install it with `pip install langchain-astradb`.\"\n )\n\n try:\n setup_mode_value = SetupMode[setup_mode.upper()]\n except KeyError:\n raise ValueError(f\"Invalid setup mode: {setup_mode}\")\n if inputs:\n documents = [_input.to_lc_document() for _input in inputs]\n\n vector_store = AstraDBVectorStore.from_documents(\n documents=documents,\n embedding=embedding,\n collection_name=collection_name,\n token=token,\n api_endpoint=api_endpoint,\n namespace=namespace,\n metric=metric,\n batch_size=batch_size,\n bulk_insert_batch_concurrency=bulk_insert_batch_concurrency,\n bulk_insert_overwrite_concurrency=bulk_insert_overwrite_concurrency,\n bulk_delete_concurrency=bulk_delete_concurrency,\n setup_mode=setup_mode_value,\n pre_delete_collection=pre_delete_collection,\n metadata_indexing_include=metadata_indexing_include,\n metadata_indexing_exclude=metadata_indexing_exclude,\n collection_indexing_policy=collection_indexing_policy,\n )\n else:\n vector_store = AstraDBVectorStore(\n embedding=embedding,\n collection_name=collection_name,\n token=token,\n api_endpoint=api_endpoint,\n namespace=namespace,\n metric=metric,\n batch_size=batch_size,\n bulk_insert_batch_concurrency=bulk_insert_batch_concurrency,\n bulk_insert_overwrite_concurrency=bulk_insert_overwrite_concurrency,\n bulk_delete_concurrency=bulk_delete_concurrency,\n setup_mode=setup_mode_value,\n pre_delete_collection=pre_delete_collection,\n metadata_indexing_include=metadata_indexing_include,\n metadata_indexing_exclude=metadata_indexing_exclude,\n collection_indexing_policy=collection_indexing_policy,\n )\n\n return vector_store\n return vector_store\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"collection_indexing_policy":{"type":"dict","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"collection_indexing_policy","display_name":"Collection Indexing Policy","advanced":true,"dynamic":false,"info":"Optional dictionary defining the indexing policy for the collection.","load_from_db":false,"title_case":false},"collection_name":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"collection_name","display_name":"Collection Name","advanced":false,"dynamic":false,"info":"The name of the collection within Astra DB where the vectors will be stored.","load_from_db":true,"title_case":false,"input_types":["Text"],"value":"collection"},"metadata_indexing_exclude":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"metadata_indexing_exclude","display_name":"Metadata Indexing Exclude","advanced":true,"dynamic":false,"info":"Optional list of metadata fields to exclude from the indexing.","load_from_db":false,"title_case":false,"input_types":["Text"]},"metadata_indexing_include":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"metadata_indexing_include","display_name":"Metadata Indexing Include","advanced":true,"dynamic":false,"info":"Optional list of metadata fields to include in the indexing.","load_from_db":false,"title_case":false,"input_types":["Text"]},"metric":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"metric","display_name":"Metric","advanced":true,"dynamic":false,"info":"Optional distance metric for vector comparisons in the vector store.","load_from_db":false,"title_case":false,"input_types":["Text"]},"namespace":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"namespace","display_name":"Namespace","advanced":true,"dynamic":false,"info":"Optional namespace within Astra DB to use for the collection.","load_from_db":false,"title_case":false,"input_types":["Text"]},"pre_delete_collection":{"type":"bool","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":false,"fileTypes":[],"file_path":"","password":false,"name":"pre_delete_collection","display_name":"Pre Delete Collection","advanced":true,"dynamic":false,"info":"Boolean flag to determine whether to delete the collection before creating a new one.","load_from_db":false,"title_case":false},"setup_mode":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"value":"Sync","fileTypes":[],"file_path":"","password":false,"options":["Sync","Async","Off"],"name":"setup_mode","display_name":"Setup Mode","advanced":true,"dynamic":false,"info":"Configuration mode for setting up the vector store, with options like “Sync”, “Async”, or “Off”.","load_from_db":false,"title_case":false,"input_types":["Text"]},"token":{"type":"str","required":true,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":true,"name":"token","display_name":"Astra DB Application Token","advanced":false,"dynamic":false,"info":"Authentication token for accessing Astra DB.","load_from_db":true,"title_case":false,"input_types":["Text"],"value":""},"_type":"CustomComponent"},"description":"Builds or loads an Astra DB Vector Store.","icon":"AstraDB","base_classes":["BaseRetriever","Generic","object","Runnable","RunnableSerializable","Serializable","VectorStore"],"display_name":"Astra DB","documentation":"","custom_fields":{"embedding":null,"token":null,"api_endpoint":null,"collection_name":null,"inputs":null,"namespace":null,"metric":null,"batch_size":null,"bulk_insert_batch_concurrency":null,"bulk_insert_overwrite_concurrency":null,"bulk_delete_concurrency":null,"setup_mode":null,"pre_delete_collection":null,"metadata_indexing_include":null,"metadata_indexing_exclude":null,"collection_indexing_policy":null},"output_types":["VectorStore","BaseRetriever"],"field_formatters":{},"frozen":false,"field_order":["token","api_endpoint","collection_name","inputs","embedding"],"beta":false},"id":"AstraDB-BGih3"},"selected":false,"width":384,"height":581,"dragging":false,"positionAbsolute":{"x":960.1819936433349,"y":2048.199417704865}},{"id":"MemoryComponent-s2qwc","type":"genericNode","position":{"x":278.8335256853211,"y":719.1493197126925},"data":{"type":"MemoryComponent","node":{"template":{"code":{"type":"code","required":true,"placeholder":"","list":false,"show":true,"multiline":true,"value":"from typing import Optional\n\nfrom langflow.base.memory.memory import BaseMemoryComponent\nfrom langflow.field_typing import Text\nfrom langflow.helpers.record import messages_to_text\nfrom langflow.memory import get_messages\nfrom langflow.schema.message import Message\n\n\nclass MemoryComponent(BaseMemoryComponent):\n display_name = \"Chat Memory\"\n description = \"Retrieves stored chat messages given a specific Session ID.\"\n beta: bool = True\n icon = \"history\"\n\n def build_config(self):\n return {\n \"sender\": {\n \"options\": [\"Machine\", \"User\", \"Machine and User\"],\n \"display_name\": \"Sender Type\",\n },\n \"sender_name\": {\"display_name\": \"Sender Name\", \"advanced\": True},\n \"n_messages\": {\n \"display_name\": \"Number of Messages\",\n \"info\": \"Number of messages to retrieve.\",\n },\n \"session_id\": {\n \"display_name\": \"Session ID\",\n \"info\": \"Session ID of the chat history.\",\n \"input_types\": [\"Text\"],\n },\n \"order\": {\n \"options\": [\"Ascending\", \"Descending\"],\n \"display_name\": \"Order\",\n \"info\": \"Order of the messages.\",\n \"advanced\": True,\n },\n \"record_template\": {\n \"display_name\": \"Record Template\",\n \"multiline\": True,\n \"info\": \"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n \"advanced\": True,\n },\n }\n\n def get_messages(self, **kwargs) -> list[Message]:\n # Validate kwargs by checking if it contains the correct keys\n if \"sender\" not in kwargs:\n kwargs[\"sender\"] = None\n if \"sender_name\" not in kwargs:\n kwargs[\"sender_name\"] = None\n if \"session_id\" not in kwargs:\n kwargs[\"session_id\"] = None\n if \"limit\" not in kwargs:\n kwargs[\"limit\"] = 5\n if \"order\" not in kwargs:\n kwargs[\"order\"] = \"Descending\"\n\n kwargs[\"order\"] = \"DESC\" if kwargs[\"order\"] == \"Descending\" else \"ASC\"\n if kwargs[\"sender\"] == \"Machine and User\":\n kwargs[\"sender\"] = None\n return get_messages(**kwargs)\n\n def build(\n self,\n sender: Optional[str] = \"Machine and User\",\n sender_name: Optional[str] = None,\n session_id: Optional[str] = None,\n n_messages: int = 5,\n order: Optional[str] = \"Descending\",\n record_template: Optional[str] = \"{sender_name}: {text}\",\n ) -> Text:\n messages = self.get_messages(\n sender=sender,\n sender_name=sender_name,\n session_id=session_id,\n limit=n_messages,\n order=order,\n )\n messages_str = messages_to_text(template=record_template or \"\", messages=messages)\n self.status = messages_str\n return messages_str\n","fileTypes":[],"file_path":"","password":false,"name":"code","advanced":true,"dynamic":true,"info":"","load_from_db":false,"title_case":false},"n_messages":{"type":"int","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"value":5,"fileTypes":[],"file_path":"","password":false,"name":"n_messages","display_name":"Number of Messages","advanced":false,"dynamic":false,"info":"Number of messages to retrieve.","load_from_db":false,"title_case":false},"order":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"value":"Descending","fileTypes":[],"file_path":"","password":false,"options":["Ascending","Descending"],"name":"order","display_name":"Order","advanced":true,"dynamic":false,"info":"Order of the messages.","load_from_db":false,"title_case":false,"input_types":["Text"]},"record_template":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":true,"value":"{sender_name}: {text}","fileTypes":[],"file_path":"","password":false,"name":"record_template","display_name":"Record Template","advanced":true,"dynamic":false,"info":"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.","load_from_db":false,"title_case":false,"input_types":["Text"]},"sender":{"type":"str","required":false,"placeholder":"","list":true,"show":true,"multiline":false,"value":"Machine and User","fileTypes":[],"file_path":"","password":false,"options":["Machine","User","Machine and User"],"name":"sender","display_name":"Sender Type","advanced":false,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"sender_name":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"sender_name","display_name":"Sender Name","advanced":true,"dynamic":false,"info":"","load_from_db":false,"title_case":false,"input_types":["Text"]},"session_id":{"type":"str","required":false,"placeholder":"","list":false,"show":true,"multiline":false,"fileTypes":[],"file_path":"","password":false,"name":"session_id","display_name":"Session ID","advanced":false,"input_types":["Text"],"dynamic":false,"info":"Session ID of the chat history.","load_from_db":false,"title_case":false},"_type":"CustomComponent"},"description":"Retrieves stored chat messages given a specific Session ID.","icon":"history","base_classes":["object","str","Text"],"display_name":"Chat Memory","documentation":"","custom_fields":{"sender":null,"sender_name":null,"session_id":null,"n_messages":null,"order":null,"record_template":null},"output_types":["Text"],"field_formatters":{},"frozen":false,"field_order":[],"beta":true},"id":"MemoryComponent-s2qwc"},"selected":false,"width":384,"height":505}],"edges":[{"source":"AzureOpenAIModel-lY7Ze","sourceHandle":"{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œAzureOpenAIModelœ,œidœ:œAzureOpenAIModel-lY7Zeœ}","target":"ChatOutput-Zrn6E","targetHandle":"{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-Zrn6Eœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"input_value","id":"ChatOutput-Zrn6E","inputTypes":["Text"],"type":"str"},"sourceHandle":{"baseClasses":["object","str","Text"],"dataType":"AzureOpenAIModel","id":"AzureOpenAIModel-lY7Ze"}},"style":{"stroke":"#555"},"className":"","id":"reactflow__edge-AzureOpenAIModel-lY7Ze{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œAzureOpenAIModelœ,œidœ:œAzureOpenAIModel-lY7Zeœ}-ChatOutput-Zrn6E{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-Zrn6Eœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"},{"source":"File-3ozyb","sourceHandle":"{œbaseClassesœ:[œRecordœ],œdataTypeœ:œFileœ,œidœ:œFile-3ozybœ}","target":"CharacterTextSplitter-k2ig1","targetHandle":"{œfieldNameœ:œinputsœ,œidœ:œCharacterTextSplitter-k2ig1œ,œinputTypesœ:[œDocumentœ,œRecordœ],œtypeœ:œRecordœ}","data":{"targetHandle":{"fieldName":"inputs","id":"CharacterTextSplitter-k2ig1","inputTypes":["Document","Record"],"type":"Record"},"sourceHandle":{"baseClasses":["Record"],"dataType":"File","id":"File-3ozyb"}},"id":"reactflow__edge-File-3ozyb{œbaseClassesœ:[œRecordœ],œdataTypeœ:œFileœ,œidœ:œFile-3ozybœ}-CharacterTextSplitter-k2ig1{œfieldNameœ:œinputsœ,œidœ:œCharacterTextSplitter-k2ig1œ,œinputTypesœ:[œDocumentœ,œRecordœ],œtypeœ:œRecordœ}","className":""},{"source":"Prompt-IzblZ","sourceHandle":"{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-IzblZœ}","target":"AzureOpenAIModel-lY7Ze","targetHandle":"{œfieldNameœ:œinput_valueœ,œidœ:œAzureOpenAIModel-lY7Zeœ,œinputTypesœ:[œTextœ,œRecordœ,œPromptœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"input_value","id":"AzureOpenAIModel-lY7Ze","inputTypes":["Text","Record","Prompt"],"type":"str"},"sourceHandle":{"baseClasses":["object","str","Text"],"dataType":"Prompt","id":"Prompt-IzblZ"}},"id":"reactflow__edge-Prompt-IzblZ{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-IzblZœ}-AzureOpenAIModel-lY7Ze{œfieldNameœ:œinput_valueœ,œidœ:œAzureOpenAIModel-lY7Zeœ,œinputTypesœ:[œTextœ,œRecordœ,œPromptœ],œtypeœ:œstrœ}","className":""},{"source":"ChatInput-xTqeI","sourceHandle":"{œbaseClassesœ:[œMessageœ,œobjectœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-xTqeIœ}","target":"Prompt-IzblZ","targetHandle":"{œfieldNameœ:œQuestionœ,œidœ:œPrompt-IzblZœ,œinputTypesœ:[œDocumentœ,œRecordœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"Question","id":"Prompt-IzblZ","inputTypes":["Document","Record","Text"],"type":"str"},"sourceHandle":{"baseClasses":["Message","object","str","Text"],"dataType":"ChatInput","id":"ChatInput-xTqeI"}},"id":"reactflow__edge-ChatInput-xTqeI{œbaseClassesœ:[œMessageœ,œobjectœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-xTqeIœ}-Prompt-IzblZ{œfieldNameœ:œQuestionœ,œidœ:œPrompt-IzblZœ,œinputTypesœ:[œDocumentœ,œRecordœ,œTextœ],œtypeœ:œstrœ}","className":""},{"source":"AzureOpenAIEmbeddings-w8HGc","sourceHandle":"{œbaseClassesœ:[œEmbeddingsœ],œdataTypeœ:œAzureOpenAIEmbeddingsœ,œidœ:œAzureOpenAIEmbeddings-w8HGcœ}","target":"AstraDBSearch-r2w01","targetHandle":"{œfieldNameœ:œembeddingœ,œidœ:œAstraDBSearch-r2w01œ,œinputTypesœ:null,œtypeœ:œEmbeddingsœ}","data":{"targetHandle":{"fieldName":"embedding","id":"AstraDBSearch-r2w01","inputTypes":null,"type":"Embeddings"},"sourceHandle":{"baseClasses":["Embeddings"],"dataType":"AzureOpenAIEmbeddings","id":"AzureOpenAIEmbeddings-w8HGc"}},"id":"reactflow__edge-AzureOpenAIEmbeddings-w8HGc{œbaseClassesœ:[œEmbeddingsœ],œdataTypeœ:œAzureOpenAIEmbeddingsœ,œidœ:œAzureOpenAIEmbeddings-w8HGcœ}-AstraDBSearch-r2w01{œfieldNameœ:œembeddingœ,œidœ:œAstraDBSearch-r2w01œ,œinputTypesœ:null,œtypeœ:œEmbeddingsœ}","className":""},{"source":"ChatInput-xTqeI","sourceHandle":"{œbaseClassesœ:[œMessageœ,œobjectœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-xTqeIœ}","target":"AstraDBSearch-r2w01","targetHandle":"{œfieldNameœ:œinput_valueœ,œidœ:œAstraDBSearch-r2w01œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"input_value","id":"AstraDBSearch-r2w01","inputTypes":["Text"],"type":"str"},"sourceHandle":{"baseClasses":["Message","object","str","Text"],"dataType":"ChatInput","id":"ChatInput-xTqeI"}},"id":"reactflow__edge-ChatInput-xTqeI{œbaseClassesœ:[œMessageœ,œobjectœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-xTqeIœ}-AstraDBSearch-r2w01{œfieldNameœ:œinput_valueœ,œidœ:œAstraDBSearch-r2w01œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}","className":""},{"source":"AstraDBSearch-r2w01","sourceHandle":"{œbaseClassesœ:[œRecordœ],œdataTypeœ:œAstraDBSearchœ,œidœ:œAstraDBSearch-r2w01œ}","target":"Prompt-IzblZ","targetHandle":"{œfieldNameœ:œcontextœ,œidœ:œPrompt-IzblZœ,œinputTypesœ:[œDocumentœ,œRecordœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"context","id":"Prompt-IzblZ","inputTypes":["Document","Record","Text"],"type":"str"},"sourceHandle":{"baseClasses":["Record"],"dataType":"AstraDBSearch","id":"AstraDBSearch-r2w01"}},"id":"reactflow__edge-AstraDBSearch-r2w01{œbaseClassesœ:[œRecordœ],œdataTypeœ:œAstraDBSearchœ,œidœ:œAstraDBSearch-r2w01œ}-Prompt-IzblZ{œfieldNameœ:œcontextœ,œidœ:œPrompt-IzblZœ,œinputTypesœ:[œDocumentœ,œRecordœ,œTextœ],œtypeœ:œstrœ}","className":""},{"source":"AzureOpenAIEmbeddings-w8HGc","sourceHandle":"{œbaseClassesœ:[œEmbeddingsœ],œdataTypeœ:œAzureOpenAIEmbeddingsœ,œidœ:œAzureOpenAIEmbeddings-w8HGcœ}","target":"AstraDB-BGih3","targetHandle":"{œfieldNameœ:œembeddingœ,œidœ:œAstraDB-BGih3œ,œinputTypesœ:null,œtypeœ:œEmbeddingsœ}","data":{"targetHandle":{"fieldName":"embedding","id":"AstraDB-BGih3","inputTypes":null,"type":"Embeddings"},"sourceHandle":{"baseClasses":["Embeddings"],"dataType":"AzureOpenAIEmbeddings","id":"AzureOpenAIEmbeddings-w8HGc"}},"id":"reactflow__edge-AzureOpenAIEmbeddings-w8HGc{œbaseClassesœ:[œEmbeddingsœ],œdataTypeœ:œAzureOpenAIEmbeddingsœ,œidœ:œAzureOpenAIEmbeddings-w8HGcœ}-AstraDB-BGih3{œfieldNameœ:œembeddingœ,œidœ:œAstraDB-BGih3œ,œinputTypesœ:null,œtypeœ:œEmbeddingsœ}","className":""},{"source":"CharacterTextSplitter-k2ig1","sourceHandle":"{œbaseClassesœ:[œRecordœ],œdataTypeœ:œCharacterTextSplitterœ,œidœ:œCharacterTextSplitter-k2ig1œ}","target":"AstraDB-BGih3","targetHandle":"{œfieldNameœ:œinputsœ,œidœ:œAstraDB-BGih3œ,œinputTypesœ:null,œtypeœ:œRecordœ}","data":{"targetHandle":{"fieldName":"inputs","id":"AstraDB-BGih3","inputTypes":null,"type":"Record"},"sourceHandle":{"baseClasses":["Record"],"dataType":"CharacterTextSplitter","id":"CharacterTextSplitter-k2ig1"}},"id":"reactflow__edge-CharacterTextSplitter-k2ig1{œbaseClassesœ:[œRecordœ],œdataTypeœ:œCharacterTextSplitterœ,œidœ:œCharacterTextSplitter-k2ig1œ}-AstraDB-BGih3{œfieldNameœ:œinputsœ,œidœ:œAstraDB-BGih3œ,œinputTypesœ:null,œtypeœ:œRecordœ}","className":""},{"source":"TextInput-eTSfe","sourceHandle":"{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-eTSfeœ}","target":"MemoryComponent-s2qwc","targetHandle":"{œfieldNameœ:œsession_idœ,œidœ:œMemoryComponent-s2qwcœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"session_id","id":"MemoryComponent-s2qwc","inputTypes":["Text"],"type":"str"},"sourceHandle":{"baseClasses":["object","str","Text"],"dataType":"TextInput","id":"TextInput-eTSfe"}},"id":"reactflow__edge-TextInput-eTSfe{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-eTSfeœ}-MemoryComponent-s2qwc{œfieldNameœ:œsession_idœ,œidœ:œMemoryComponent-s2qwcœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}","className":""},{"source":"MemoryComponent-s2qwc","sourceHandle":"{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-s2qwcœ}","target":"Prompt-IzblZ","targetHandle":"{œfieldNameœ:œhistoryœ,œidœ:œPrompt-IzblZœ,œinputTypesœ:[œDocumentœ,œRecordœ,œTextœ],œtypeœ:œstrœ}","data":{"targetHandle":{"fieldName":"history","id":"Prompt-IzblZ","inputTypes":["Document","Record","Text"],"type":"str"},"sourceHandle":{"baseClasses":["object","str","Text"],"dataType":"MemoryComponent","id":"MemoryComponent-s2qwc"}},"id":"reactflow__edge-MemoryComponent-s2qwc{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-s2qwcœ}-Prompt-IzblZ{œfieldNameœ:œhistoryœ,œidœ:œPrompt-IzblZœ,œinputTypesœ:[œDocumentœ,œRecordœ,œTextœ],œtypeœ:œstrœ}","className":""}],"viewport":{"x":604.2587043000233,"y":-509.89887277097773,"zoom":0.5944094968229352}},"description":"Interactive Language Weaving.","name":"LangflowAzureOpenAIFinal_","last_tested_version":"1.0.0a59","is_component":false}