diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Graph Vector Store RAG.json b/src/backend/base/langflow/initial_setup/starter_projects/Graph Vector Store RAG.json index 0e69957deb55..4db206300a11 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Graph Vector Store RAG.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Graph Vector Store RAG.json @@ -9,16 +9,12 @@ "dataType": "OpenAIEmbeddings", "id": "OpenAIEmbeddings-jyvkr", "name": "embeddings", - "output_types": [ - "Embeddings" - ] + "output_types": ["Embeddings"] }, "targetHandle": { "fieldName": "embedding_model", "id": "AstraDBGraph-jr8pY", - "inputTypes": [ - "Embeddings" - ], + "inputTypes": ["Embeddings"], "type": "other" } }, @@ -37,16 +33,12 @@ "dataType": "ChatInput", "id": "ChatInput-ZCSfi", "name": "message", - "output_types": [ - "Message" - ] + "output_types": ["Message"] }, "targetHandle": { "fieldName": "search_query", "id": "AstraDBGraph-jr8pY", - "inputTypes": [ - "Message" - ], + "inputTypes": ["Message"], "type": "str" } }, @@ -65,16 +57,12 @@ "dataType": "AstraDBGraph", "id": "AstraDBGraph-jr8pY", "name": "search_results", - "output_types": [ - "Data" - ] + "output_types": ["Data"] }, "targetHandle": { "fieldName": "data", "id": "ParseData-T6FGT", - "inputTypes": [ - "Data" - ], + "inputTypes": ["Data"], "type": "other" } }, @@ -93,17 +81,12 @@ "dataType": "ParseData", "id": "ParseData-alciW", "name": "text", - "output_types": [ - "Message" - ] + "output_types": ["Message"] }, "targetHandle": { "fieldName": "context", "id": "Prompt-2M2d5", - "inputTypes": [ - "Message", - "Text" - ], + "inputTypes": ["Message", "Text"], "type": "str" } }, @@ -122,17 +105,12 @@ "dataType": "ChatInput", "id": "ChatInput-DA114", "name": "message", - "output_types": [ - "Message" - ] + "output_types": ["Message"] }, "targetHandle": { "fieldName": "question", "id": "Prompt-2M2d5", - "inputTypes": [ - "Message", - "Text" - ], + "inputTypes": ["Message", "Text"], "type": "str" } }, @@ -151,16 +129,12 @@ "dataType": "Prompt", "id": "Prompt-rmO8w", "name": "prompt", - "output_types": [ - "Message" - ] + "output_types": ["Message"] }, "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-a26gL", - "inputTypes": [ - "Message" - ], + "inputTypes": ["Message"], "type": "str" } }, @@ -179,18 +153,12 @@ "dataType": "OpenAIModel", "id": "OpenAIModel-LnWKb", "name": "text_output", - "output_types": [ - "Message" - ] + "output_types": ["Message"] }, "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-XL9ho", - "inputTypes": [ - "Data", - "DataFrame", - "Message" - ], + "inputTypes": ["Data", "DataFrame", "Message"], "type": "str" } }, @@ -209,17 +177,12 @@ "dataType": "URL", "id": "URL-qOh1r", "name": "data", - "output_types": [ - "Data" - ] + "output_types": ["Data"] }, "targetHandle": { "fieldName": "data_input", "id": "LanguageRecursiveTextSplitter-jefpx", - "inputTypes": [ - "Document", - "Data" - ], + "inputTypes": ["Document", "Data"], "type": "other" } }, @@ -238,17 +201,12 @@ "dataType": "LanguageRecursiveTextSplitter", "id": "LanguageRecursiveTextSplitter-KDtC3", "name": "data", - "output_types": [ - "Data" - ] + "output_types": ["Data"] }, "targetHandle": { "fieldName": "data_input", "id": "HtmlLinkExtractor-exHgk", - "inputTypes": [ - "Document", - "Data" - ], + "inputTypes": ["Document", "Data"], "type": "other" } }, @@ -270,9 +228,7 @@ "targetHandle": { "fieldName": "ingest_data", "id": "AstraDBGraph-FX0tA", - "inputTypes": [ - "Data" - ], + "inputTypes": ["Data"], "type": "other" } }, @@ -288,16 +244,12 @@ "dataType": "OpenAIEmbeddings", "id": "OpenAIEmbeddings-fcwMC", "name": "embeddings", - "output_types": [ - "Embeddings" - ] + "output_types": ["Embeddings"] }, "targetHandle": { "fieldName": "embedding_model", "id": "AstraDBGraph-FX0tA", - "inputTypes": [ - "Embeddings" - ], + "inputTypes": ["Embeddings"], "type": "other" } }, @@ -313,16 +265,12 @@ "dataType": "AstraDBGraph", "id": "AstraDBGraph-xJiDN", "name": "search_results", - "output_types": [ - "Data" - ] + "output_types": ["Data"] }, "targetHandle": { "fieldName": "data", "id": "ParseData-alciW", - "inputTypes": [ - "Data" - ], + "inputTypes": ["Data"], "type": "other" } }, @@ -338,16 +286,12 @@ "dataType": "OpenAIEmbeddings", "id": "OpenAIEmbeddings-XKhhV", "name": "embeddings", - "output_types": [ - "Embeddings" - ] + "output_types": ["Embeddings"] }, "targetHandle": { "fieldName": "embedding_model", "id": "AstraDBGraph-uza6S", - "inputTypes": [ - "Embeddings" - ], + "inputTypes": ["Embeddings"], "type": "other" } }, @@ -363,16 +307,12 @@ "dataType": "HtmlLinkExtractor", "id": "HtmlLinkExtractor-LWuvQ", "name": "data", - "output_types": [ - "Data" - ] + "output_types": ["Data"] }, "targetHandle": { "fieldName": "ingest_data", "id": "AstraDBGraph-uza6S", - "inputTypes": [ - "Data" - ], + "inputTypes": ["Data"], "type": "other" } }, @@ -388,9 +328,7 @@ "data": { "id": "ChatInput-DA114", "node": { - "base_classes": [ - "Message" - ], + "base_classes": ["Message"], "beta": false, "conditional_paths": [], "custom_fields": {}, @@ -424,9 +362,7 @@ "name": "message", "selected": "Message", "tool_mode": true, - "types": [ - "Message" - ], + "types": ["Message"], "value": "__UNDEFINED__" } ], @@ -439,9 +375,7 @@ "display_name": "Background Color", "dynamic": false, "info": "The background color of the icon.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "background_color", @@ -461,9 +395,7 @@ "display_name": "Icon", "dynamic": false, "info": "The icon of the message.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "chat_icon", @@ -566,10 +498,7 @@ "dynamic": false, "info": "Type of sender.", "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "placeholder": "", "required": false, "show": true, @@ -585,9 +514,7 @@ "display_name": "Sender Name", "dynamic": false, "info": "Name of the sender.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "sender_name", @@ -607,9 +534,7 @@ "display_name": "Session ID", "dynamic": false, "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "session_id", @@ -645,9 +570,7 @@ "display_name": "Text Color", "dynamic": false, "info": "The text color of the name", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "text_color", @@ -689,9 +612,7 @@ "data": { "id": "OpenAIEmbeddings-fcwMC", "node": { - "base_classes": [ - "Embeddings" - ], + "base_classes": ["Embeddings"], "beta": false, "category": "embeddings", "conditional_paths": [], @@ -737,14 +658,10 @@ "display_name": "Embeddings", "method": "build_embeddings", "name": "embeddings", - "required_inputs": [ - "openai_api_key" - ], + "required_inputs": ["openai_api_key"], "selected": "Embeddings", "tool_mode": true, - "types": [ - "Embeddings" - ], + "types": ["Embeddings"], "value": "__UNDEFINED__" } ], @@ -774,9 +691,7 @@ "display_name": "Client", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "client", @@ -846,9 +761,7 @@ "display_name": "Deployment", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "deployment", @@ -954,9 +867,7 @@ "display_name": "OpenAI API Base", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "openai_api_base", @@ -976,9 +887,7 @@ "display_name": "OpenAI API Key", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": true, "name": "openai_api_key", "password": true, @@ -995,9 +904,7 @@ "display_name": "OpenAI API Type", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "openai_api_type", @@ -1017,9 +924,7 @@ "display_name": "OpenAI API Version", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "openai_api_version", @@ -1039,9 +944,7 @@ "display_name": "OpenAI Organization", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "openai_organization", @@ -1061,9 +964,7 @@ "display_name": "OpenAI Proxy", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "openai_proxy", @@ -1147,9 +1048,7 @@ "display_name": "TikToken Model Name", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "tiktoken_model_name", @@ -1193,9 +1092,7 @@ "display_name": "Astra DB Graph", "id": "AstraDBGraph-jr8pY", "node": { - "base_classes": [ - "Data" - ], + "base_classes": ["Data"], "beta": false, "conditional_paths": [], "custom_fields": {}, @@ -1241,16 +1138,10 @@ "display_name": "Search Results", "method": "search_documents", "name": "search_results", - "required_inputs": [ - "api_endpoint", - "collection_name", - "token" - ], + "required_inputs": ["api_endpoint", "collection_name", "token"], "selected": "Data", "tool_mode": true, - "types": [ - "Data" - ], + "types": ["Data"], "value": "__UNDEFINED__" }, { @@ -1262,9 +1153,7 @@ "required_inputs": [], "selected": "DataFrame", "tool_mode": true, - "types": [ - "DataFrame" - ], + "types": ["DataFrame"], "value": "__UNDEFINED__" } ], @@ -1277,9 +1166,7 @@ "display_name": "API Endpoint", "dynamic": false, "info": "API endpoint URL for the Astra DB service.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": false, "name": "api_endpoint", "password": true, @@ -1288,7 +1175,7 @@ "show": true, "title_case": false, "type": "str", - "value": "" + "value": "ASTRA_DB_API_ENDPOINT" }, "batch_size": { "_input_type": "IntInput", @@ -1418,9 +1305,7 @@ "display_name": "Embedding Model", "dynamic": false, "info": "Allows an embedding model configuration.", - "input_types": [ - "Embeddings" - ], + "input_types": ["Embeddings"], "list": false, "name": "embedding_model", "placeholder": "", @@ -1437,9 +1322,7 @@ "display_name": "Ingest Data", "dynamic": false, "info": "", - "input_types": [ - "Data" - ], + "input_types": ["Data"], "list": false, "name": "ingest_data", "placeholder": "", @@ -1504,9 +1387,7 @@ "tool_mode": false, "trace_as_metadata": true, "type": "str", - "value": [ - "" - ] + "value": [""] }, "metadata_indexing_include": { "_input_type": "StrInput", @@ -1534,11 +1415,7 @@ "dynamic": false, "info": "Optional distance metric for vector comparisons in the vector store.", "name": "metric", - "options": [ - "cosine", - "dot_product", - "euclidean" - ], + "options": ["cosine", "dot_product", "euclidean"], "placeholder": "", "required": false, "show": true, @@ -1606,9 +1483,7 @@ "display_name": "Search Query", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "multiline": true, @@ -1673,10 +1548,7 @@ "dynamic": false, "info": "Configuration mode for setting up the vector store, with options like 'Sync', or 'Off'.", "name": "setup_mode", - "options": [ - "Sync", - "Off" - ], + "options": ["Sync", "Off"], "placeholder": "", "required": false, "show": true, @@ -1710,9 +1582,7 @@ "display_name": "Astra DB Application Token", "dynamic": false, "info": "Authentication token for accessing Astra DB.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": false, "name": "token", "password": true, @@ -1721,7 +1591,7 @@ "show": true, "title_case": false, "type": "str", - "value": "" + "value": "ASTRA_DB_APPLICATION_TOKEN" } }, "tool_mode": false @@ -1747,10 +1617,7 @@ "display_name": "Parse Data", "id": "ParseData-alciW", "node": { - "base_classes": [ - "Data", - "Message" - ], + "base_classes": ["Data", "Message"], "beta": false, "conditional_paths": [], "custom_fields": {}, @@ -1758,11 +1625,7 @@ "display_name": "Parse Data", "documentation": "", "edited": false, - "field_order": [ - "data", - "template", - "sep" - ], + "field_order": ["data", "template", "sep"], "frozen": false, "icon": "message-square", "legacy": false, @@ -1781,9 +1644,7 @@ "name": "text", "selected": "Message", "tool_mode": true, - "types": [ - "Message" - ], + "types": ["Message"], "value": "__UNDEFINED__" }, { @@ -1794,9 +1655,7 @@ "name": "data_list", "selected": "Data", "tool_mode": true, - "types": [ - "Data" - ], + "types": ["Data"], "value": "__UNDEFINED__" } ], @@ -1827,9 +1686,7 @@ "display_name": "Data", "dynamic": false, "info": "The data to convert to text.", - "input_types": [ - "Data" - ], + "input_types": ["Data"], "list": true, "name": "data", "placeholder": "", @@ -1866,9 +1723,7 @@ "display_name": "Template", "dynamic": false, "info": "The template to use for formatting the data. It can contain the keys {text}, {data} or any other key in the Data.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "multiline": true, @@ -1905,25 +1760,17 @@ "data": { "id": "Prompt-rmO8w", "node": { - "base_classes": [ - "Message" - ], + "base_classes": ["Message"], "beta": false, "conditional_paths": [], "custom_fields": { - "template": [ - "context", - "question" - ] + "template": ["context", "question"] }, "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", "documentation": "", "edited": false, - "field_order": [ - "template", - "tool_placeholder" - ], + "field_order": ["template", "tool_placeholder"], "frozen": false, "icon": "prompts", "legacy": false, @@ -1939,9 +1786,7 @@ "name": "prompt", "selected": "Message", "tool_mode": true, - "types": [ - "Message" - ], + "types": ["Message"], "value": "__UNDEFINED__" } ], @@ -1974,10 +1819,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Message", - "Text" - ], + "input_types": ["Message", "Text"], "list": false, "load_from_db": false, "multiline": true, @@ -1997,10 +1839,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Message", - "Text" - ], + "input_types": ["Message", "Text"], "list": false, "load_from_db": false, "multiline": true, @@ -2036,9 +1875,7 @@ "display_name": "Tool Placeholder", "dynamic": false, "info": "A placeholder input for tool mode.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "tool_placeholder", @@ -2074,10 +1911,7 @@ "data": { "id": "OpenAIModel-LnWKb", "node": { - "base_classes": [ - "LanguageModel", - "Message" - ], + "base_classes": ["LanguageModel", "Message"], "beta": false, "conditional_paths": [], "custom_fields": {}, @@ -2114,9 +1948,7 @@ "required_inputs": [], "selected": "Message", "tool_mode": true, - "types": [ - "Message" - ], + "types": ["Message"], "value": "__UNDEFINED__" }, { @@ -2125,14 +1957,10 @@ "display_name": "Language Model", "method": "build_model", "name": "model_output", - "required_inputs": [ - "api_key" - ], + "required_inputs": ["api_key"], "selected": "LanguageModel", "tool_mode": true, - "types": [ - "LanguageModel" - ], + "types": ["LanguageModel"], "value": "__UNDEFINED__" } ], @@ -2145,9 +1973,7 @@ "display_name": "OpenAI API Key", "dynamic": false, "info": "The OpenAI API Key to use for the OpenAI model.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": true, "name": "api_key", "password": true, @@ -2182,9 +2008,7 @@ "display_name": "Input", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "input_value", @@ -2350,9 +2174,7 @@ "display_name": "System Message", "dynamic": false, "info": "System message to pass to the model.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "system_message", @@ -2433,9 +2255,7 @@ "data": { "id": "ChatOutput-KIkbc", "node": { - "base_classes": [ - "Message" - ], + "base_classes": ["Message"], "beta": false, "conditional_paths": [], "custom_fields": {}, @@ -2469,9 +2289,7 @@ "name": "message", "selected": "Message", "tool_mode": true, - "types": [ - "Message" - ], + "types": ["Message"], "value": "__UNDEFINED__" } ], @@ -2484,9 +2302,7 @@ "display_name": "Background Color", "dynamic": false, "info": "The background color of the icon.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "background_color", @@ -2506,9 +2322,7 @@ "display_name": "Icon", "dynamic": false, "info": "The icon of the message.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "chat_icon", @@ -2564,9 +2378,7 @@ "display_name": "Data Template", "dynamic": false, "info": "Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "data_template", @@ -2586,11 +2398,7 @@ "display_name": "Text", "dynamic": false, "info": "Message to be passed as output.", - "input_types": [ - "Data", - "DataFrame", - "Message" - ], + "input_types": ["Data", "DataFrame", "Message"], "list": false, "load_from_db": false, "name": "input_value", @@ -2611,10 +2419,7 @@ "dynamic": false, "info": "Type of sender.", "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "placeholder": "", "required": false, "show": true, @@ -2630,9 +2435,7 @@ "display_name": "Sender Name", "dynamic": false, "info": "Name of the sender.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "sender_name", @@ -2652,9 +2455,7 @@ "display_name": "Session ID", "dynamic": false, "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "session_id", @@ -2690,9 +2491,7 @@ "display_name": "Text Color", "dynamic": false, "info": "The text color of the name", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "text_color", @@ -2728,10 +2527,7 @@ "data": { "id": "URL-qOh1r", "node": { - "base_classes": [ - "Data", - "Message" - ], + "base_classes": ["Data", "Message"], "beta": false, "category": "data", "conditional_paths": [], @@ -2740,10 +2536,7 @@ "display_name": "URL", "documentation": "", "edited": false, - "field_order": [ - "urls", - "format" - ], + "field_order": ["urls", "format"], "frozen": false, "icon": "layout-template", "key": "URL", @@ -2761,9 +2554,7 @@ "name": "data", "selected": "Data", "tool_mode": true, - "types": [ - "Data" - ], + "types": ["Data"], "value": "__UNDEFINED__" }, { @@ -2774,9 +2565,7 @@ "name": "text", "selected": "Message", "tool_mode": true, - "types": [ - "Message" - ], + "types": ["Message"], "value": "__UNDEFINED__" }, { @@ -2787,9 +2576,7 @@ "name": "dataframe", "selected": "DataFrame", "tool_mode": true, - "types": [ - "DataFrame" - ], + "types": ["DataFrame"], "value": "__UNDEFINED__" } ], @@ -2823,10 +2610,7 @@ "dynamic": false, "info": "Output Format. Use 'Text' to extract the text from the HTML or 'Raw HTML' for the raw HTML content.", "name": "format", - "options": [ - "Text", - "Raw HTML" - ], + "options": ["Text", "Raw HTML"], "placeholder": "", "required": false, "show": true, @@ -2842,9 +2626,7 @@ "display_name": "URLs", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": true, "load_from_db": false, "name": "urls", @@ -2896,9 +2678,7 @@ "data": { "id": "LanguageRecursiveTextSplitter-KDtC3", "node": { - "base_classes": [ - "Data" - ], + "base_classes": ["Data"], "beta": false, "category": "vectorstores", "conditional_paths": [], @@ -2946,16 +2726,10 @@ "display_name": "Search Results", "method": "search_documents", "name": "search_results", - "required_inputs": [ - "api_endpoint", - "collection_name", - "token" - ], + "required_inputs": ["api_endpoint", "collection_name", "token"], "selected": "Data", "tool_mode": true, - "types": [ - "Data" - ], + "types": ["Data"], "value": "__UNDEFINED__" }, { @@ -2967,9 +2741,7 @@ "required_inputs": [], "selected": "DataFrame", "tool_mode": true, - "types": [ - "DataFrame" - ], + "types": ["DataFrame"], "value": "__UNDEFINED__" } ], @@ -2983,9 +2755,7 @@ "display_name": "API Endpoint", "dynamic": false, "info": "API endpoint URL for the Astra DB service.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": false, "name": "api_endpoint", "password": true, @@ -2994,7 +2764,7 @@ "show": true, "title_case": false, "type": "str", - "value": "" + "value": "ASTRA_DB_API_ENDPOINT" }, "batch_size": { "_input_type": "IntInput", @@ -3124,9 +2894,7 @@ "display_name": "Embedding Model", "dynamic": false, "info": "Allows an embedding model configuration.", - "input_types": [ - "Embeddings" - ], + "input_types": ["Embeddings"], "list": false, "name": "embedding_model", "placeholder": "", @@ -3143,9 +2911,7 @@ "display_name": "Ingest Data", "dynamic": false, "info": "", - "input_types": [ - "Data" - ], + "input_types": ["Data"], "list": false, "name": "ingest_data", "placeholder": "", @@ -3238,11 +3004,7 @@ "dynamic": false, "info": "Optional distance metric for vector comparisons in the vector store.", "name": "metric", - "options": [ - "cosine", - "dot_product", - "euclidean" - ], + "options": ["cosine", "dot_product", "euclidean"], "placeholder": "", "required": false, "show": true, @@ -3309,9 +3071,7 @@ "display_name": "Search Query", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "multiline": true, @@ -3375,10 +3135,7 @@ "dynamic": false, "info": "Configuration mode for setting up the vector store, with options like 'Sync', or 'Off'.", "name": "setup_mode", - "options": [ - "Sync", - "Off" - ], + "options": ["Sync", "Off"], "placeholder": "", "required": false, "show": true, @@ -3412,9 +3169,7 @@ "display_name": "Astra DB Application Token", "dynamic": false, "info": "Authentication token for accessing Astra DB.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": false, "name": "token", "password": true, @@ -3423,7 +3178,7 @@ "show": true, "title_case": false, "type": "str", - "value": "" + "value": "ASTRA_DB_APPLICATION_TOKEN" } }, "tool_mode": false @@ -3448,9 +3203,7 @@ "data": { "id": "LanguageRecursiveTextSplitter-jefpx", "node": { - "base_classes": [ - "Data" - ], + "base_classes": ["Data"], "beta": false, "category": "langchain_utilities", "conditional_paths": [], @@ -3483,9 +3236,7 @@ "required_inputs": [], "selected": "Data", "tool_mode": true, - "types": [ - "Data" - ], + "types": ["Data"], "value": "__UNDEFINED__" } ], @@ -3596,10 +3347,7 @@ "display_name": "Input", "dynamic": false, "info": "The texts to split.", - "input_types": [ - "Document", - "Data" - ], + "input_types": ["Document", "Data"], "list": false, "name": "data_input", "placeholder": "", @@ -3635,9 +3383,7 @@ "data": { "id": "HtmlLinkExtractor-LWuvQ", "node": { - "base_classes": [ - "Data" - ], + "base_classes": ["Data"], "beta": false, "category": "langchain_utilities", "conditional_paths": [], @@ -3646,11 +3392,7 @@ "display_name": "HTML Link Extractor", "documentation": "https://python.langchain.com/v0.2/api_reference/community/graph_vectorstores/langchain_community.graph_vectorstores.extractors.html_link_extractor.HtmlLinkExtractor.html", "edited": false, - "field_order": [ - "kind", - "drop_fragments", - "data_input" - ], + "field_order": ["kind", "drop_fragments", "data_input"], "frozen": false, "icon": "LangChain", "key": "HtmlLinkExtractor", @@ -3669,9 +3411,7 @@ "required_inputs": [], "selected": "Data", "tool_mode": true, - "types": [ - "Data" - ], + "types": ["Data"], "value": "__UNDEFINED__" } ], @@ -3703,10 +3443,7 @@ "display_name": "Input", "dynamic": false, "info": "The texts from which to extract links.", - "input_types": [ - "Document", - "Data" - ], + "input_types": ["Document", "Data"], "list": false, "name": "data_input", "placeholder": "", @@ -3777,9 +3514,7 @@ "data": { "id": "OpenAIEmbeddings-XKhhV", "node": { - "base_classes": [ - "Embeddings" - ], + "base_classes": ["Embeddings"], "beta": false, "category": "embeddings", "conditional_paths": [], @@ -3826,14 +3561,10 @@ "display_name": "Embeddings", "method": "build_embeddings", "name": "embeddings", - "required_inputs": [ - "openai_api_key" - ], + "required_inputs": ["openai_api_key"], "selected": "Embeddings", "tool_mode": true, - "types": [ - "Embeddings" - ], + "types": ["Embeddings"], "value": "__UNDEFINED__" } ], @@ -3864,9 +3595,7 @@ "display_name": "Client", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "client", @@ -3938,9 +3667,7 @@ "display_name": "Deployment", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "deployment", @@ -4050,9 +3777,7 @@ "display_name": "OpenAI API Base", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "openai_api_base", @@ -4072,9 +3797,7 @@ "display_name": "OpenAI API Key", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": true, "name": "openai_api_key", "password": true, @@ -4091,9 +3814,7 @@ "display_name": "OpenAI API Type", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "openai_api_type", @@ -4113,9 +3834,7 @@ "display_name": "OpenAI API Version", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "openai_api_version", @@ -4135,9 +3854,7 @@ "display_name": "OpenAI Organization", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "openai_organization", @@ -4157,9 +3874,7 @@ "display_name": "OpenAI Proxy", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "openai_proxy", @@ -4247,9 +3962,7 @@ "display_name": "TikToken Model Name", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "load_from_db": false, "name": "tiktoken_model_name", @@ -4364,10 +4077,7 @@ "data": { "id": "AstraDBGraph-xJiDN", "node": { - "base_classes": [ - "Data", - "DataFrame" - ], + "base_classes": ["Data", "DataFrame"], "beta": false, "category": "vectorstores", "conditional_paths": [], @@ -4415,16 +4125,10 @@ "display_name": "Search Results", "method": "search_documents", "name": "search_results", - "required_inputs": [ - "api_endpoint", - "collection_name", - "token" - ], + "required_inputs": ["api_endpoint", "collection_name", "token"], "selected": "Data", "tool_mode": true, - "types": [ - "Data" - ], + "types": ["Data"], "value": "__UNDEFINED__" }, { @@ -4436,9 +4140,7 @@ "required_inputs": [], "selected": "DataFrame", "tool_mode": true, - "types": [ - "DataFrame" - ], + "types": ["DataFrame"], "value": "__UNDEFINED__" } ], @@ -4452,9 +4154,7 @@ "display_name": "API Endpoint", "dynamic": false, "info": "API endpoint URL for the Astra DB service.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": true, "name": "api_endpoint", "password": true, @@ -4599,9 +4299,7 @@ "display_name": "Embedding Model", "dynamic": false, "info": "Allows an embedding model configuration.", - "input_types": [ - "Embeddings" - ], + "input_types": ["Embeddings"], "list": false, "list_add_label": "Add More", "name": "embedding_model", @@ -4619,9 +4317,7 @@ "display_name": "Ingest Data", "dynamic": false, "info": "", - "input_types": [ - "Data" - ], + "input_types": ["Data"], "list": false, "list_add_label": "Add More", "name": "ingest_data", @@ -4720,11 +4416,7 @@ "dynamic": false, "info": "Optional distance metric for vector comparisons in the vector store.", "name": "metric", - "options": [ - "cosine", - "dot_product", - "euclidean" - ], + "options": ["cosine", "dot_product", "euclidean"], "options_metadata": [], "placeholder": "", "required": false, @@ -4795,9 +4487,7 @@ "display_name": "Search Query", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "list_add_label": "Add More", "load_from_db": false, @@ -4866,10 +4556,7 @@ "dynamic": false, "info": "Configuration mode for setting up the vector store, with options like 'Sync', or 'Off'.", "name": "setup_mode", - "options": [ - "Sync", - "Off" - ], + "options": ["Sync", "Off"], "options_metadata": [], "placeholder": "", "required": false, @@ -4904,9 +4591,7 @@ "display_name": "Astra DB Application Token", "dynamic": false, "info": "Authentication token for accessing Astra DB.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": true, "name": "token", "password": true, @@ -4940,10 +4625,7 @@ "data": { "id": "AstraDBGraph-uza6S", "node": { - "base_classes": [ - "Data", - "DataFrame" - ], + "base_classes": ["Data", "DataFrame"], "beta": false, "category": "vectorstores", "conditional_paths": [], @@ -4991,16 +4673,10 @@ "display_name": "Search Results", "method": "search_documents", "name": "search_results", - "required_inputs": [ - "api_endpoint", - "collection_name", - "token" - ], + "required_inputs": ["api_endpoint", "collection_name", "token"], "selected": "Data", "tool_mode": true, - "types": [ - "Data" - ], + "types": ["Data"], "value": "__UNDEFINED__" }, { @@ -5012,9 +4688,7 @@ "required_inputs": [], "selected": "DataFrame", "tool_mode": true, - "types": [ - "DataFrame" - ], + "types": ["DataFrame"], "value": "__UNDEFINED__" } ], @@ -5028,9 +4702,7 @@ "display_name": "API Endpoint", "dynamic": false, "info": "API endpoint URL for the Astra DB service.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": true, "name": "api_endpoint", "password": true, @@ -5175,9 +4847,7 @@ "display_name": "Embedding Model", "dynamic": false, "info": "Allows an embedding model configuration.", - "input_types": [ - "Embeddings" - ], + "input_types": ["Embeddings"], "list": false, "list_add_label": "Add More", "name": "embedding_model", @@ -5195,9 +4865,7 @@ "display_name": "Ingest Data", "dynamic": false, "info": "", - "input_types": [ - "Data" - ], + "input_types": ["Data"], "list": false, "list_add_label": "Add More", "name": "ingest_data", @@ -5296,11 +4964,7 @@ "dynamic": false, "info": "Optional distance metric for vector comparisons in the vector store.", "name": "metric", - "options": [ - "cosine", - "dot_product", - "euclidean" - ], + "options": ["cosine", "dot_product", "euclidean"], "options_metadata": [], "placeholder": "", "required": false, @@ -5371,9 +5035,7 @@ "display_name": "Search Query", "dynamic": false, "info": "", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "list": false, "list_add_label": "Add More", "load_from_db": false, @@ -5442,10 +5104,7 @@ "dynamic": false, "info": "Configuration mode for setting up the vector store, with options like 'Sync', or 'Off'.", "name": "setup_mode", - "options": [ - "Sync", - "Off" - ], + "options": ["Sync", "Off"], "options_metadata": [], "placeholder": "", "required": false, @@ -5480,9 +5139,7 @@ "display_name": "Astra DB Application Token", "dynamic": false, "info": "Authentication token for accessing Astra DB.", - "input_types": [ - "Message" - ], + "input_types": ["Message"], "load_from_db": true, "name": "token", "password": true, @@ -5526,8 +5183,5 @@ "is_component": false, "last_tested_version": "1.1.1", "name": "Graph RAG", - "tags": [ - "rag", - "q-a" - ] -} \ No newline at end of file + "tags": ["rag", "q-a"] +} diff --git a/src/frontend/tests/assets/test_audio_file.wav b/src/frontend/tests/assets/test_audio_file.wav new file mode 100644 index 000000000000..abd61d7d2961 Binary files /dev/null and b/src/frontend/tests/assets/test_audio_file.wav differ diff --git a/src/frontend/tests/core/integrations/Financial Report Parser.spec.ts b/src/frontend/tests/core/integrations/Financial Report Parser.spec.ts new file mode 100644 index 000000000000..145d95aff32f --- /dev/null +++ b/src/frontend/tests/core/integrations/Financial Report Parser.spec.ts @@ -0,0 +1,64 @@ +import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; +import path from "path"; +import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; +import { getAllResponseMessage } from "../../utils/get-all-response-message"; +import { initialGPTsetup } from "../../utils/initialGPTsetup"; +import { waitForOpenModalWithChatInput } from "../../utils/wait-for-open-modal"; +import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes"; + +withEventDeliveryModes( + "Financial Report Parser", + { tag: ["@release", "@starter-projects"] }, + async ({ page }) => { + test.skip( + !process?.env?.OPENAI_API_KEY, + "OPENAI_API_KEY required to run this test", + ); + + if (!process.env.CI) { + dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + } + + await page.goto("/"); + await awaitBootstrapTest(page); + + await page.getByTestId("side_nav_options_all-templates").click(); + await page + .getByRole("heading", { name: "Financial Report Parser" }) + .click(); + + await page.waitForSelector('[data-testid="fit_view"]', { + timeout: 100000, + }); + + await initialGPTsetup(page); + + await page.getByTestId("playground-btn-flow-io").click(); + + await page.waitForSelector('[data-testid="button-send"]', { + timeout: 3000, + }); + + await page.getByTestId("button-send").click(); + + try { + await page.waitForSelector('[data-testid="button-stop"]', { + timeout: 180000, + state: "hidden", + }); + } catch (error) { + console.log("Timeout error"); + test.skip(true, "Timeout error"); + } + + await page.waitForSelector(".markdown", { timeout: 3000 }); + const textContents = await page + .locator(".markdown") + .last() + .allTextContents(); + const concatAllText = textContents.join(" ").toLowerCase(); + expect(concatAllText.length).toBeGreaterThan(10); + expect(concatAllText).toContain("ebitida"); + }, +); diff --git a/src/frontend/tests/core/integrations/Gmail Agent.spec.ts b/src/frontend/tests/core/integrations/Gmail Agent.spec.ts new file mode 100644 index 000000000000..1078f9c87a44 --- /dev/null +++ b/src/frontend/tests/core/integrations/Gmail Agent.spec.ts @@ -0,0 +1,93 @@ +import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; +import { readFileSync } from "fs"; +import path from "path"; +import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; +import { getAllResponseMessage } from "../../utils/get-all-response-message"; +import { initialGPTsetup } from "../../utils/initialGPTsetup"; +import { waitForOpenModalWithChatInput } from "../../utils/wait-for-open-modal"; +import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes"; + +withEventDeliveryModes( + "Gmail Agent", + { tag: ["@release", "@starter-projects"] }, + async ({ page }) => { + test.skip( + !process?.env?.OPENAI_API_KEY, + "OPENAI_API_KEY required to run this test", + ); + + test.skip( + !process?.env?.COMPOSIO_API_KEY, + "COMPOSIO_API_KEY required to run this test", + ); + + if (!process.env.CI) { + dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + } + + await page.goto("/"); + await awaitBootstrapTest(page); + + await page.getByTestId("side_nav_options_all-templates").click(); + await page.getByRole("heading", { name: "Gmail Agent" }).click(); + + await page.waitForSelector('[data-testid="fit_view"]', { + timeout: 100000, + }); + + await initialGPTsetup(page); + + await page + .getByTestId("popover-anchor-input-api_key") + .last() + .fill(process.env.COMPOSIO_API_KEY ?? ""); + + await page.getByTestId("refresh-button-app_names").last().click(); + + await page.waitForSelector( + '[data-testid="popover-anchor-input-auth_status"]', + { + timeout: 30000, + state: "visible", + }, + ); + + const authStatus = await page + .getByTestId("popover-anchor-input-auth_status") + .last() + .inputValue(); + + await page.waitForTimeout(500); + + expect(authStatus).toBe("✅"); + + await page.getByTestId("playground-btn-flow-io").click(); + + await page.waitForSelector('[data-testid="button-send"]', { + timeout: 3000, + }); + + await page + .getByTestId("input-chat-playground") + .fill("Send an email to johndoe@test.com wishing him a happy birthday!"); + + await page.getByTestId("button-send").click(); + + await page.waitForSelector('[data-testid="div-chat-message"]', { + timeout: 3000, + }); + + await page.waitForSelector(".markdown", { timeout: 3000 }); + + const textContents = await page + .locator(".markdown") + .last() + .allTextContents(); + + const concatAllText = textContents.join(" "); + + expect(concatAllText).toContain("email"); + expect(concatAllText).toContain("successfully"); + }, +); diff --git a/src/frontend/tests/core/integrations/Graph Rag.spec.ts b/src/frontend/tests/core/integrations/Graph Rag.spec.ts new file mode 100644 index 000000000000..c564c25653f8 --- /dev/null +++ b/src/frontend/tests/core/integrations/Graph Rag.spec.ts @@ -0,0 +1,104 @@ +import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; +import { readFileSync } from "fs"; +import path from "path"; +import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; +import { getAllResponseMessage } from "../../utils/get-all-response-message"; +import { initialGPTsetup } from "../../utils/initialGPTsetup"; +import { waitForOpenModalWithChatInput } from "../../utils/wait-for-open-modal"; +import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes"; + +withEventDeliveryModes( + "Graph Rag", + { tag: ["@release", "@starter-projects"] }, + async ({ page }) => { + test.skip( + !process?.env?.OPENAI_API_KEY, + "OPENAI_API_KEY required to run this test", + ); + + test.skip( + !process?.env?.ASTRA_DB_API_ENDPOINT, + "ASTRA_DB_API_ENDPOINT required to run this test", + ); + + test.skip( + !process?.env?.ASTRA_DB_APPLICATION_TOKEN, + "ASTRA_DB_APPLICATION_TOKEN required to run this test", + ); + + if (!process.env.CI) { + dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + } + + await page.goto("/"); + await awaitBootstrapTest(page); + + await page.getByTestId("side_nav_options_all-templates").click(); + await page.getByRole("heading", { name: "Graph Rag" }).click(); + + await page.waitForSelector('[data-testid="fit_view"]', { + timeout: 100000, + }); + + await initialGPTsetup(page); + + await page + .getByTestId("popover-anchor-input-token") + .nth(0) + .fill(process.env.ASTRA_DB_APPLICATION_TOKEN ?? ""); + + await page + .getByTestId("popover-anchor-input-token") + .nth(1) + .fill(process.env.ASTRA_DB_APPLICATION_TOKEN ?? ""); + + await page + .getByTestId("popover-anchor-input-api_endpoint") + .nth(0) + .fill(process.env.ASTRA_DB_API_ENDPOINT ?? ""); + + await page + .getByTestId("popover-anchor-input-api_endpoint") + .nth(1) + .fill(process.env.ASTRA_DB_API_ENDPOINT ?? ""); + + await page.getByTestId("button_run_astra db graph").last().click(); + + try { + await page.waitForSelector("text=built successfully", { + timeout: 30000 * 3, + }); + } catch (e) { + console.log("Build timeout"); + test.skip(); + } + + await page.getByTestId("playground-btn-flow-io").click(); + + await page.waitForSelector('[data-testid="button-send"]', { + timeout: 3000, + }); + + await page.getByTestId("button-send").click(); + + await page.waitForSelector('[data-testid="div-chat-message"]', { + timeout: 30000 * 3, + }); + + await page.waitForSelector(".markdown", { timeout: 3000 }); + + const textContents = await page + .locator(".markdown") + .last() + .allTextContents(); + + const concatAllText = textContents.join(" "); + + expect(concatAllText).toContain("Haskell"); + expect(concatAllText).toContain("reverseWords"); + expect(concatAllText).toContain("words"); + expect(concatAllText).toContain("map reverse"); + expect(concatAllText).toContain("unwords"); + }, +); diff --git a/src/frontend/tests/core/integrations/Meeting Summary.spec.ts b/src/frontend/tests/core/integrations/Meeting Summary.spec.ts new file mode 100644 index 000000000000..afc048359e2f --- /dev/null +++ b/src/frontend/tests/core/integrations/Meeting Summary.spec.ts @@ -0,0 +1,92 @@ +import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; +import { readFileSync } from "fs"; +import path from "path"; +import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; +import { getAllResponseMessage } from "../../utils/get-all-response-message"; +import { initialGPTsetup } from "../../utils/initialGPTsetup"; +import { waitForOpenModalWithChatInput } from "../../utils/wait-for-open-modal"; +import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes"; + +withEventDeliveryModes( + "Meeting Summary", + { tag: ["@release", "@starter-projects"] }, + async ({ page }) => { + test.skip( + !process?.env?.OPENAI_API_KEY, + "OPENAI_API_KEY required to run this test", + ); + + test.skip( + !process?.env?.ASSEMBLYAI_API_KEY, + "ASSEMBLYAI_API_KEY required to run this test", + ); + + if (!process.env.CI) { + dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + } + + await page.goto("/"); + await awaitBootstrapTest(page); + + await page.getByTestId("side_nav_options_all-templates").click(); + await page.getByRole("heading", { name: "Meeting Summary" }).click(); + + await page.waitForSelector('[data-testid="fit_view"]', { + timeout: 100000, + }); + + await initialGPTsetup(page); + + await page + .getByTestId("popover-anchor-input-api_key") + .nth(0) + .fill(process.env.ASSEMBLYAI_API_KEY ?? ""); + + await page + .getByTestId("popover-anchor-input-api_key") + .nth(3) + .fill(process.env.ASSEMBLYAI_API_KEY ?? ""); + + const audioFilePath = path.join( + __dirname, + "../../assets/test_audio_file.wav", + ); + await page.getByTestId("button_upload_file").click(); + + const fileChooserPromise = page.waitForEvent("filechooser"); + await page.getByTestId("button_upload_file").click(); + const fileChooser = await fileChooserPromise; + await fileChooser.setFiles(audioFilePath); + + await page.waitForTimeout(2000); + + await page.getByTestId("button_run_chat output").last().click(); + + await page.waitForSelector("text=built successfully", { timeout: 30000 }); + + await page.getByTestId("playground-btn-flow-io").click(); + + await page.waitForSelector('[data-testid="button-send"]', { + timeout: 3000, + }); + + await page.waitForSelector(".markdown", { timeout: 3000 }); + + const textContents = await page + .locator(".markdown") + .last() + .allTextContents(); + + const concatAllText = textContents.join(" "); + + expect(concatAllText.length).toBeGreaterThan(50); + expect(concatAllText).toContain("Pair"); + expect(concatAllText).toContain("beer"); + expect(concatAllText).toContain("Address"); + expect(concatAllText).toContain("Consider"); + expect(concatAllText).toContain("pickle"); + expect(concatAllText).toContain("Note"); + expect(concatAllText).toContain("Recognize"); + }, +); diff --git a/src/frontend/tests/core/integrations/News Aggregator.spec.ts b/src/frontend/tests/core/integrations/News Aggregator.spec.ts new file mode 100644 index 000000000000..c17d74ccc056 --- /dev/null +++ b/src/frontend/tests/core/integrations/News Aggregator.spec.ts @@ -0,0 +1,79 @@ +import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; +import path from "path"; +import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; +import { initialGPTsetup } from "../../utils/initialGPTsetup"; +import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes"; + +withEventDeliveryModes( + "News Aggregator", + { tag: ["@release", "@starter-projects"] }, + async ({ page }) => { + test.skip( + !process?.env?.AGENTQL_API_KEY, + "AGENTQL_API_KEY required to run this test", + ); + + test.skip( + !process?.env?.OPENAI_API_KEY, + "OPENAI_API_KEY required to run this test", + ); + + if (!process.env.CI) { + dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + } + + await page.goto("/"); + await awaitBootstrapTest(page); + + await page.getByTestId("side_nav_options_all-templates").click(); + await page.getByRole("heading", { name: "News Aggregator" }).click(); + + await page.waitForSelector('[data-testid="fit_view"]', { + timeout: 100000, + }); + + await initialGPTsetup(page, { + skipAdjustScreenView: true, + skipAddNewApiKeys: true, + skipSelectGptModel: true, + }); + + await page + .getByTestId("popover-anchor-input-api_key") + .nth(0) + .fill(process?.env?.AGENTQL_API_KEY ?? ""); + + await page + .getByTestId("popover-anchor-input-api_key") + .nth(1) + .fill(process?.env?.OPENAI_API_KEY ?? ""); + + await page.getByTestId("playground-btn-flow-io").click(); + + await page.waitForSelector('[data-testid="button-send"]', { + timeout: 3000, + }); + + await page.getByTestId("input-chat-playground").fill("what is langflow?"); + + await page.getByTestId("button-send").click(); + + await page.waitForSelector("text=Finished", { timeout: 10000 }); + + await page.waitForSelector(".markdown", { timeout: 3000 }); + + const textContents = await page + .locator(".markdown") + .last() + .allTextContents(); + + const concatAllText = textContents.join(" "); + + expect(concatAllText.length).toBeGreaterThan(100); + + expect(concatAllText).toContain("Langflow"); + expect(concatAllText).toContain("open-source"); + expect(concatAllText).toContain("framework"); + }, +); diff --git a/src/frontend/tests/core/integrations/Portfolio Website Code Generator.spec.ts b/src/frontend/tests/core/integrations/Portfolio Website Code Generator.spec.ts new file mode 100644 index 000000000000..9efd78426c36 --- /dev/null +++ b/src/frontend/tests/core/integrations/Portfolio Website Code Generator.spec.ts @@ -0,0 +1,89 @@ +import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; +import { readFileSync } from "fs"; +import path from "path"; +import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; +import { initialGPTsetup } from "../../utils/initialGPTsetup"; +import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes"; + +withEventDeliveryModes( + "Portfolio Website Code Generator", + { tag: ["@release", "@starter-projects"] }, + async ({ page }) => { + test.skip( + !process?.env?.ANTHROPIC_API_KEY, + "ANTHROPIC_API_KEY required to run this test", + ); + + if (!process.env.CI) { + dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + } + + await page.goto("/"); + await awaitBootstrapTest(page); + + await page.getByTestId("side_nav_options_all-templates").click(); + await page + .getByRole("heading", { name: "Portfolio Website Code Generator" }) + .click(); + + await page.waitForSelector('[data-testid="fit_view"]', { + timeout: 100000, + }); + + await initialGPTsetup(page, { + skipAdjustScreenView: true, + skipSelectGptModel: true, + }); + + await page + .getByTestId("popover-anchor-input-api_key") + .last() + .fill(process.env.ANTHROPIC_API_KEY ?? ""); + + await page + .getByTestId("popover-anchor-input-api_key") + .first() + .fill(process.env.ANTHROPIC_API_KEY ?? ""); + + const filePath = path.join(__dirname, "../../assets/test_file.txt"); + await page.getByTestId("button_upload_file").click(); + + const fileChooserPromise = page.waitForEvent("filechooser"); + await page.getByTestId("button_upload_file").click(); + const fileChooser = await fileChooserPromise; + await fileChooser.setFiles(filePath); + + await page.waitForTimeout(2000); + + await page.getByTestId("playground-btn-flow-io").click(); + + await page.waitForSelector('[data-testid="button-send"]', { + timeout: 3000, + }); + + await page.getByTestId("button-send").click(); + + await page.waitForSelector("text=DOCTYPE html", { timeout: 30000 }); + + await page.waitForSelector(".markdown", { timeout: 3000 }); + + const textContents = await page + .locator(".markdown") + .last() + .allTextContents(); + + const concatAllText = textContents.join(" ").toLowerCase(); + + expect(concatAllText.length).toBeGreaterThan(200); + + expect(concatAllText).toContain("html"); + expect(concatAllText).toContain(""); + expect(concatAllText).toContain(""); + expect(concatAllText).toContain(""); + expect(concatAllText).toContain("responsive"); + expect(concatAllText).toContain("section"); + expect(concatAllText).toContain("header"); + expect(concatAllText).toContain("class="); + }, +); diff --git a/src/frontend/tests/core/integrations/Price Deal Finder.spec.ts b/src/frontend/tests/core/integrations/Price Deal Finder.spec.ts new file mode 100644 index 000000000000..1134480cb915 --- /dev/null +++ b/src/frontend/tests/core/integrations/Price Deal Finder.spec.ts @@ -0,0 +1,113 @@ +import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; +import path from "path"; +import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; +import { initialGPTsetup } from "../../utils/initialGPTsetup"; +import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes"; + +withEventDeliveryModes( + "Price Deal Finder", + { tag: ["@release", "@starter-projects"] }, + async ({ page }) => { + test.skip( + !process?.env?.AGENTQL_API_KEY, + "AGENTQL_API_KEY required to run this test", + ); + + test.skip( + !process?.env?.OPENAI_API_KEY, + "OPENAI_API_KEY required to run this test", + ); + + test.skip( + !process?.env?.TAVILY_API_KEY, + "TAVILY_API_KEY required to run this test", + ); + + if (!process.env.CI) { + dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + } + + await awaitBootstrapTest(page); + + await page.getByTestId("side_nav_options_all-templates").click(); + await page.getByRole("heading", { name: "Price Deal Finder" }).click(); + + await page.waitForSelector('[data-testid="fit_view"]', { + timeout: 100000, + }); + + await initialGPTsetup(page, { + skipAdjustScreenView: true, + skipAddNewApiKeys: true, + skipSelectGptModel: true, + }); + + await page + .getByTestId("popover-anchor-input-api_key") + .nth(0) + .fill(process?.env?.TAVILY_API_KEY ?? ""); + + await page + .getByTestId("popover-anchor-input-api_key") + .nth(1) + .fill(process?.env?.AGENTQL_API_KEY ?? ""); + + await page + .getByTestId("popover-anchor-input-api_key") + .nth(2) + .fill(process?.env?.OPENAI_API_KEY ?? ""); + + await page.getByTestId("playground-btn-flow-io").click(); + + await page.waitForSelector('[data-testid="button-send"]', { + timeout: 3000, + }); + + const product = randomProduct(); + + await page.getByTestId("input-chat-playground").fill(product); + + await page.getByTestId("button-send").click(); + + try { + await page.waitForSelector('[data-testid="button-stop"]', { + timeout: 180000, + state: "hidden", + }); + } catch (error) { + console.log("Timeout error"); + test.skip(true, "Timeout error"); + } + + await page.waitForSelector(".markdown", { timeout: 3000 }); + + const textContents = await page + .locator(".markdown") + .last() + .allTextContents(); + + const concatAllText = textContents.join(" ").toLowerCase(); + + expect(concatAllText.length).toBeGreaterThan(100); + + const zeldaChapter = product.split(" ")[1]; + expect(concatAllText).toContain(zeldaChapter); + }, +); + +const randomProduct = () => { + const products = [ + "Zelda Tears of the Kingdom", + "Zelda Ocarina of Time", + "Zelda Majora's Mask", + "Zelda The Wind Waker", + "Zelda Twilight Princess", + "Zelda Skyward Sword", + "Zelda Breath of the Wild", + "Zelda Link's Awakening", + "Zelda Link to the Past", + ]; + + return products[Math.floor(Math.random() * products.length)].toLowerCase(); +}; diff --git a/src/frontend/tests/core/integrations/Research Translation Loop.spec.ts b/src/frontend/tests/core/integrations/Research Translation Loop.spec.ts new file mode 100644 index 000000000000..302007feb0d3 --- /dev/null +++ b/src/frontend/tests/core/integrations/Research Translation Loop.spec.ts @@ -0,0 +1,73 @@ +import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; +import path from "path"; +import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; +import { initialGPTsetup } from "../../utils/initialGPTsetup"; +import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes"; + +withEventDeliveryModes( + "Research Translation Loop.spec", + { tag: ["@release", "@starter-projects"] }, + async ({ page }) => { + test.skip( + !process?.env?.ANTHROPIC_API_KEY, + "ANTHROPIC_API_KEY required to run this test", + ); + + if (!process.env.CI) { + dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + } + + await awaitBootstrapTest(page); + + await page.getByTestId("side_nav_options_all-templates").click(); + await page + .getByRole("heading", { name: "Research Translation Loop" }) + .click(); + + await page.waitForSelector('[data-testid="fit_view"]', { + timeout: 100000, + }); + + await initialGPTsetup(page, { + skipAdjustScreenView: true, + skipAddNewApiKeys: true, + skipSelectGptModel: true, + }); + + await page + .getByTestId("popover-anchor-input-api_key") + .last() + .fill(process.env.ANTHROPIC_API_KEY ?? ""); + + await page.waitForSelector('[data-testid="dropdown_str_model_name"]', { + timeout: 5000, + }); + + await page.getByTestId("dropdown_str_model_name").click(); + + await page.keyboard.press("Enter"); + + await page.getByTestId("playground-btn-flow-io").click(); + + await page.waitForSelector('[data-testid="button-send"]', { + timeout: 3000, + }); + + await page.getByTestId("input-chat-playground").fill("This is a test"); + + await page.getByTestId("button-send").click(); + + await page.waitForSelector('[data-testid="div-chat-message"]', { + timeout: 30000, + }); + + const textContents = await page + .getByTestId("div-chat-message") + .allTextContents(); + + const concatAllText = textContents.join(" ").toLowerCase(); + + expect(concatAllText.length).toBeGreaterThan(300); + }, +); diff --git a/src/frontend/tests/core/integrations/Youtube Analysis.spec.ts b/src/frontend/tests/core/integrations/Youtube Analysis.spec.ts new file mode 100644 index 000000000000..30ca6acede90 --- /dev/null +++ b/src/frontend/tests/core/integrations/Youtube Analysis.spec.ts @@ -0,0 +1,73 @@ +import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; +import { readFileSync } from "fs"; +import path from "path"; +import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; +import { getAllResponseMessage } from "../../utils/get-all-response-message"; +import { initialGPTsetup } from "../../utils/initialGPTsetup"; +import { waitForOpenModalWithChatInput } from "../../utils/wait-for-open-modal"; +import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes"; + +withEventDeliveryModes( + "Youtube Analysis", + { tag: ["@release", "@starter-projects"] }, + async ({ page }) => { + test.skip( + !process?.env?.OPENAI_API_KEY, + "OPENAI_API_KEY required to run this test", + ); + + test.skip( + !process?.env?.YOUTUBE_API_KEY, + "YOUTUBE_API_KEY required to run this test", + ); + + if (!process.env.CI) { + dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + } + + await page.goto("/"); + await awaitBootstrapTest(page); + + await page.getByTestId("side_nav_options_all-templates").click(); + await page.getByRole("heading", { name: "Youtube Analysis" }).click(); + + await page.waitForSelector('[data-testid="fit_view"]', { + timeout: 100000, + }); + + await initialGPTsetup(page); + + await page + .getByTestId("popover-anchor-input-api_key") + .nth(0) + .fill(process.env.YOUTUBE_API_KEY ?? ""); + + await page.getByTestId("button_run_chat output").last().click(); + + await page.waitForSelector("text=built successfully", { timeout: 30000 }); + + await page.getByTestId("playground-btn-flow-io").click(); + + await page.waitForSelector('[data-testid="button-send"]', { + timeout: 3000, + }); + + await page.waitForSelector("text=Finished", { timeout: 10000 }); + + await page.waitForSelector(".markdown", { timeout: 3000 }); + + const textContents = await page + .locator(".markdown") + .last() + .allTextContents(); + + const concatAllText = textContents.join(" "); + + expect(concatAllText.length).toBeGreaterThan(200); + expect(concatAllText).toContain("Recommendations"); + expect(concatAllText).toContain("Synthesis"); + expect(concatAllText).toContain("Audience Reception"); + expect(concatAllText).toContain("Content Summary"); + }, +);