1.0 Alpha (#1599)
* Update model kwargs and temperature values
* Update keyboard shortcuts for advanced editing
* make Message field have no handles
* Update OpenAI API Key handling in OpenAIEmbeddingsComponent
* Remove unnecessary field_type key from CustomComponent class
* Update required field behavior in CustomComponent class
* Refactor AzureOpenAIModel.py: Removed unnecessary "required" attribute from input parameters
* Update BaiduQianfanChatModel and OpenAIModel configurations
* Fix range_spec step type validation
* Update RangeSpec step_type default value to "float"
* Fix Save debounce
* Update parameterUtils to use debounce instead of throttle
* Update input type options in schemas and graph base classes
* Refactor run_flow_with_caching endpoint to include simplified and experimental versions
* Add PythonFunctionComponent and test case for it
* Add nest_asyncio to fix event loop issue
* Refactor test_initial_setup.py to use RunOutputs instead of ResultData
* Remove unused code in test_endpoints.py
* Add asyncio loop to uvicorn command
* Refactor load_session method to handle coroutine result
* Fixed saving
* Fixed debouncing
* Add InputType and OutputType literals to schema.py
* Update input type in Graph class
* Add new schema for simplified API request
* Add delete_messages function and update test_successful_run assertions
* Add STREAM_INFO_TEXT constant to model components
* Add session_id to simplified_run_flow_with_caching endpoint
* Add field_typing import to OpenAIModel.py
* update starter projects
* Add constants for Langflow base module
* Update setup.py to include latest component versions
* Update Starter Examples
* sets starter_project fixture to Basic Prompting
* Refactor test_endpoints.py: Update test names and add new tests for different output types
* Update HuggingFace Spaces link and add image for dark mode
* Remove filepath reference
* Update Vertex params in base.py
* Add tests for different input types
* Add type annotations and improve test coverage
* Add duplicate space link to README
* Update HuggingFace Spaces badge in README
* Add Python 3.10 installation requirement to README
* Refactor flow running endpoints
* Refactor SimplifiedAPIRequest and add documentation for Tweaks
* Refactor input_request parameter in simplified_run_flow function
* Add support for retrieving specific component output
* Add custom Uvicorn worker for Langflow application
* Add asyncio loop to LangflowApplication initialization
* Update Makefile with new variables and start command
* Fix indentation in Makefile
* Refactor run_graph function to add support for running a JSON flow
* Refactor getChatInputField function and update API code
* Update HuggingFace Spaces documentation with duplication process
* Add asyncio event loop to uvicorn command
* Add installation of backend in start target
* udpate some starter projects
* Fix formatting in hugging-face-spaces.mdx
* Update installation instructions for Langflow
* set examples order
* Update start command in Makefile
* Add installation and usage instructions for Langflow
* Update Langflow installation and usage instructions
* Fix langflow command in README.md
* Fix broken link to HuggingFace Spaces guide
* Add new SVG assets for blog post, chat bot, and cloud docs
* Refactor example rendering in NewFlowModal
* Add new SVG file for short bio section
* Remove unused import and add new component
* Update title in usage.mdx
* Update HuggingFace Spaces heading in usage.mdx
* Update usage instructions in getting-started/usage.mdx
* Update cache option in usage documentation
* Remove 'advanced' flag from 'n_messages' parameter in MemoryComponent.py
* Refactor code to improve performance and readability
* Update project names and flow examples
* fix document qa example
* Remove commented out code in sidebars.js
* Delete unused documentation files
* Fix bug in login functionality
* Remove global variables from components
* Fix bug in login functionality
* fix modal returning to input
* Update max-width of chat message sender name
* Update styling for chat message component
* Refactor OpenAIEmbeddingsComponent signature
* Update usage.mdx file
* Update path in Makefile
* Add new migration and what's new documentation files
* Add new chapters and migration guides
* Update version to 0.0.13 in pyproject.toml
* new locks
* Update dependencies in pyproject.toml
* general fixes
* Update dependencies in pyproject.toml and poetry.lock files
* add padding to modal
* ✨ (undrawCards/index.tsx): update the SVG used for BasicPrompt component to undraw_short_bio_re_fmx0.svg to match the desired design
♻️ (undrawCards/index.tsx): adjust the width and height of the BasicPrompt SVG to 65% to improve the visual appearance
* Commented out components/data in sidebars.js
* Refactor component names in outputs.mdx
* Update embedded chat script URL
* Add data component and fix formatting in outputs component
* Update dependencies in poetry.lock and pyproject.toml
* Update dependencies in poetry.lock and pyproject.toml
* Refactor code to improve performance and readability
* Update dependencies in poetry.lock and pyproject.toml
* Fixed IO Modal updates
* Remove dead code at API Modal
* Fixed overflow at CodeTabsComponent tweaks page
* ✨ (NewFlowModal/index.tsx): update the name of the example from "Blog Writter" to "Blog Writer" for better consistency and clarity
* Update dependencies versions
* Update langflow-base to version 0.0.15 and fix setup_env script
* Update dependencies in pyproject.toml
* Lock dependencies in parallel
* Add logging statement to setup_app function
* Fix Ace not having type="module" and breaking build
* Update authentication settings for access token cookie
* Update package versions in package-lock.json
* Add scripts directory to Dockerfile
* Add setup_env command to build_and_run target
* Remove unnecessary make command in setup_env
* Remove unnecessary installation step in build_and_run
* Add debug configuration for CLI
* 🔧 chore(Makefile): refactor build_langflow target to use a separate script for updating dependencies and building
✨ feat(update_dependencies.py): add script to update pyproject.toml dependency version based on langflow-base version in src/backend/base/pyproject.toml
* Add number_of_results parameter to AstraDBSearchComponent
* Update HuggingFace Spaces links
* Remove duplicate imports in hugging-face-spaces.mdx
* Add number_of_results parameter to vector search components
* Fixed supabase not commited
* Revert "Fixed supabase not commited"
This reverts commit afb10a6262.
* Update duplicate-space.png image
* Delete unused files and components
* Add/update script to update dependencies
* Add .bak files to .gitignore
* Update version numbers and remove unnecessary dependencies
* Update langflow-base dependency path
* Add Text import to VertexAiModel.py
* Update langflow-base version to 0.0.16 and update dependencies
* Delete start projects and commit session in delete_start_projects function
* Refactor backend startup script to handle autologin option
* Update poetry installation script to include pipx update check
* Update pipx installation script for different operating systems
* Update Makefile to improve setup process
* Add error handling on streaming and fix streaming bug on error
* Added description to Blog Writer
* Sort base classes alphabetically
* Update duplicate-space.png image
* update position on langflow prompt chaining
* Add Langflow CLI and first steps documentation
* Add exception handling for missing 'content' field in search_with_vector_store method
* Remove unused import and update type hinting
* fix bug on egdes after creating group component
* Refactor APIRequest class and update model imports
* Remove unused imports and fix formatting issues
* Refactor reactflowUtils and styleUtils
* Add CLI documentation to getting-started/cli.mdx
* Add CLI usage instructions
* Add ZoomableImage component to first-steps.mdx
* Update CLI and first steps documentation
* Remove duplicate import and add new imports for ThemedImage and useBaseUrl
* Update Langflow CLI documentation link
* Remove first-steps.mdx and update index.mdx and sidebars.js
* Update Docusaurus dependencies
* Add AstraDB RAG Flow guide
* Remove unused imports
* Remove unnecessary import statement
* Refactor guide for better readability
* Add data component documentation
* Update component headings and add prompt template
* Fix logging level and version display
* Add datetime import and buffer for alembic log
* Update flow names in NewFlowModal and documentation
* Add starter projects to sidebars.js
* Fix error handling in DirectoryReader class
* Handle exception when loading components in setup.py
* Update version numbers in pyproject.toml files
* Update build_langflow_base and build_langflow_backup in Makefile
* Added docs
* Update dependencies and build process
* Add Admonition component for API Key documentation
* Update API endpoint in async-api.mdx
* Remove async-api guidelines
* Fix UnicodeDecodeError in DirectoryReader
* Update dependency version and fix encoding issues
* Add conditional build and publish for base and main projects
* Update version to 1.0.0a2 in pyproject.toml
* Remove duplicate imports and unnecessary code in custom-component.mdx
* Fix poetry lock command in Makefile
* Update package versions in pyproject.toml
* Remove unused components and update imports
* 📦 chore(pre-release-base.yml): add pre-release workflow for base project
📦 chore(pre-release-langflow.yml): add pre-release workflow for langflow project
* Add ChatLiteLLMModelComponent to models package
* Add frontend installation and build steps
* Add Dockerfile for building and pushing base image
* Add emoji package and nest-asyncio dependency
* 📝 (components.mdx): update margin style of ZoomableImage to improve spacing
📝 (features.mdx): update margin style of ZoomableImage to improve spacing
📝 (login.mdx): update margin style of ZoomableImage to improve spacing
* Fix module import error in validate.py
* Fix error message in directory_reader.py
* Update version import and handle ImportError
* Add cryptography and langchain-openai dependencies
* Update poetry installation and remove poetry-monorepo-dependency-plugin
* Update workflow and Dockerfile for Langflow base pre-release
* Update display names and descriptions for AstraDB components
* Update installation instructions for Langflow
* Update Astra DB links and remove unnecessary imports
* Rename AstraDB
* Add new components and images
* Update HuggingFace Spaces URLs
* Update Langflow documentation and add new starter projects
* Update flow name to "Basic Prompting (Hello, world!)" in relevant files
* Update Basic Prompting flow name to "Ahoy World!"
* Remove HuggingFace Spaces documentation
* Add new files and update sidebars.js
* Remove async-tasks.mdx and update sidebars.js
* Update starter project URLs
* Enable migration of global variables
* Update OpenAIEmbeddings deployment and model
* 📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (inputs.mdx): add margin to image style to improve spacing and center alignment
📝 (rag-with-astradb.mdx): add margin to image styles to improve spacing and readability
* Update welcome message in index.mdx
* Add global variable feature to Langflow documentation
* Reorganized sidebar categories
* Update migration documentation
* Refactor SplitTextComponent class to accept inputs of type Record and Text
* Adjust embeddings docs
* ✨ (cardComponent/index.tsx): add a minimum height to the card component to ensure consistent layout and prevent content from overlapping when the card is empty or has minimal content
* Update flow name from "Ahoy World!" to "Hello, world!"
* Update documentation for embeddings, models, and vector stores
* Update CreateRecordComponent and parameterUtils.ts
* Add documentation for Text and Record types
* Remove commented lines in sidebars.js
* Add run_flow_from_json function to load.py
* Update Langflow package to run flow from JSON file
* Fix type annotations and import errors
* Refactor tests and fix test data
---------
Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: carlosrcoelho <carlosrodrigo.coelho@gmail.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Matheus <jacquesmats@gmail.com>
This commit is contained in:
parent
20f640c4ce
commit
05cd6e4fd7
853 changed files with 59936 additions and 15456 deletions
|
|
@ -1,4 +1,4 @@
|
|||
export const custom = `from langflow import CustomComponent
|
||||
export const custom = `from langflow.custom import CustomComponent
|
||||
|
||||
from langchain.llms.base import BaseLLM
|
||||
from langchain.chains import LLMChain
|
||||
|
|
|
|||
358
src/frontend/tests/end-to-end/assets/ChatTest.json
Normal file
358
src/frontend/tests/end-to-end/assets/ChatTest.json
Normal file
|
|
@ -0,0 +1,358 @@
|
|||
{
|
||||
"id": "3f5e860d-1676-4fba-9d86-06db9f51e43a",
|
||||
"data": {
|
||||
"nodes": [
|
||||
{
|
||||
"id": "ChatInput-7hPDT",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 687,
|
||||
"y": 41.9375
|
||||
},
|
||||
"data": {
|
||||
"type": "ChatInput",
|
||||
"node": {
|
||||
"template": {
|
||||
"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 import Record\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Used to get user input from the chat.\"\n icon = \"ChatInput\"\n\n def build(\n self,\n sender: Optional[str] = \"User\",\n sender_name: Optional[str] = \"User\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n ) -> Union[Text, Record]:\n return super().build(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\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": "Message",
|
||||
"advanced": false,
|
||||
"input_types": ["Text"],
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"load_from_db": false,
|
||||
"title_case": false
|
||||
},
|
||||
"return_record": {
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": false,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "return_record",
|
||||
"display_name": "Return Record",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "Return the message as a record 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": "User",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"options": ["Machine", "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,
|
||||
"value": "User",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "sender_name",
|
||||
"display_name": "Sender Name",
|
||||
"advanced": false,
|
||||
"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": "Used to get user input from the chat.",
|
||||
"icon": "ChatInput",
|
||||
"base_classes": ["Text", "object", "str", "Record"],
|
||||
"display_name": "Chat Input",
|
||||
"documentation": "",
|
||||
"custom_fields": {
|
||||
"sender": null,
|
||||
"sender_name": null,
|
||||
"input_value": null,
|
||||
"session_id": null,
|
||||
"return_record": null
|
||||
},
|
||||
"output_types": ["Text", "Record"],
|
||||
"field_formatters": {},
|
||||
"frozen": false,
|
||||
"field_order": [],
|
||||
"beta": false
|
||||
},
|
||||
"id": "ChatInput-7hPDT"
|
||||
},
|
||||
"selected": false,
|
||||
"width": 384,
|
||||
"height": 569,
|
||||
"positionAbsolute": {
|
||||
"x": 687,
|
||||
"y": 41.9375
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"id": "ChatOutput-4sm9Z",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 4.939451516507972,
|
||||
"y": 103.3695231904992
|
||||
},
|
||||
"data": {
|
||||
"type": "ChatOutput",
|
||||
"node": {
|
||||
"template": {
|
||||
"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 import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Used to send a message to the chat.\"\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 return_record: Optional[bool] = False,\n ) -> Union[Text, Record]:\n return super().build(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\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": "Message",
|
||||
"advanced": false,
|
||||
"input_types": ["Text"],
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"load_from_db": false,
|
||||
"title_case": false
|
||||
},
|
||||
"return_record": {
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": false,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "return_record",
|
||||
"display_name": "Return Record",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "Return the message as a record 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": 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,
|
||||
"value": "AI",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "sender_name",
|
||||
"display_name": "Sender Name",
|
||||
"advanced": false,
|
||||
"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": "Used to send a message to the chat.",
|
||||
"icon": "ChatOutput",
|
||||
"base_classes": ["Text", "object", "str", "Record"],
|
||||
"display_name": "Chat Output",
|
||||
"documentation": "",
|
||||
"custom_fields": {
|
||||
"sender": null,
|
||||
"sender_name": null,
|
||||
"input_value": null,
|
||||
"session_id": null,
|
||||
"return_record": null
|
||||
},
|
||||
"output_types": ["Text", "Record"],
|
||||
"field_formatters": {},
|
||||
"frozen": false,
|
||||
"field_order": [],
|
||||
"beta": false
|
||||
},
|
||||
"id": "ChatOutput-4sm9Z"
|
||||
},
|
||||
"selected": true,
|
||||
"width": 384,
|
||||
"height": 569,
|
||||
"positionAbsolute": {
|
||||
"x": 4.939451516507972,
|
||||
"y": 103.3695231904992
|
||||
},
|
||||
"dragging": false
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "ChatOutput-4sm9Z",
|
||||
"sourceHandle": "{œbaseClassesœ:[œTextœ,œobjectœ,œstrœ,œRecordœ],œdataTypeœ:œChatOutputœ,œidœ:œChatOutput-4sm9Zœ}",
|
||||
"target": "ChatInput-7hPDT",
|
||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatInput-7hPDTœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||
"data": {
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "ChatInput-7hPDT",
|
||||
"inputTypes": ["Text"],
|
||||
"type": "str"
|
||||
},
|
||||
"sourceHandle": {
|
||||
"baseClasses": ["Text", "object", "str", "Record"],
|
||||
"dataType": "ChatOutput",
|
||||
"id": "ChatOutput-4sm9Z"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"id": "reactflow__edge-ChatOutput-4sm9Z{œbaseClassesœ:[œTextœ,œobjectœ,œstrœ,œRecordœ],œdataTypeœ:œChatOutputœ,œidœ:œChatOutput-4sm9Zœ}-ChatInput-7hPDT{œfieldNameœ:œinput_valueœ,œidœ:œChatInput-7hPDTœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||
}
|
||||
],
|
||||
"viewport": {
|
||||
"x": 316.78239920440234,
|
||||
"y": 182.84104875768622,
|
||||
"zoom": 0.6070974421975234
|
||||
}
|
||||
},
|
||||
"description": "flow to test ChatInput and output",
|
||||
"name": "ChatITest",
|
||||
"last_tested_version": "1.0.0a0",
|
||||
"is_component": false
|
||||
}
|
||||
|
|
@ -10,7 +10,10 @@
|
|||
"height": 631,
|
||||
"id": "ChatOpenAI-Hz56M",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 543.1816229116944, "y": 942.891611351432 },
|
||||
"position": {
|
||||
"x": 543.1816229116944,
|
||||
"y": 942.891611351432
|
||||
},
|
||||
"data": {
|
||||
"type": "ChatOpenAI",
|
||||
"node": {
|
||||
|
|
@ -238,7 +241,10 @@
|
|||
"height": 387,
|
||||
"id": "AgentInitializer-QiQ4x",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 1036.6064439140812, "y": 645.1919693466587 },
|
||||
"position": {
|
||||
"x": 1036.6064439140812,
|
||||
"y": 645.1919693466587
|
||||
},
|
||||
"data": {
|
||||
"type": "AgentInitializer",
|
||||
"node": {
|
||||
|
|
@ -316,7 +322,10 @@
|
|||
"height": 437,
|
||||
"id": "PythonFunctionTool-kX99N",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 553.050119331742, "y": 412.9533535948685 },
|
||||
"position": {
|
||||
"x": 553.050119331742,
|
||||
"y": 412.9533535948685
|
||||
},
|
||||
"data": {
|
||||
"type": "PythonFunctionTool",
|
||||
"node": {
|
||||
|
|
@ -380,7 +389,9 @@
|
|||
"sourceHandle": "{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-Hz56Mœ}",
|
||||
"target": "AgentInitializer-QiQ4x",
|
||||
"targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-QiQ4xœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-ChatOpenAI-Hz56M{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-Hz56Mœ}-AgentInitializer-QiQ4x{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-QiQ4xœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
|
|
@ -409,7 +420,9 @@
|
|||
"sourceHandle": "{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-kX99Nœ}",
|
||||
"target": "AgentInitializer-QiQ4x",
|
||||
"targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-QiQ4xœ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-PythonFunctionTool-kX99N{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-kX99Nœ}-AgentInitializer-QiQ4x{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-QiQ4xœ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
|
|
@ -446,7 +459,10 @@
|
|||
{
|
||||
"id": "CustomComponent-w4WCp",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 536, "y": 337 },
|
||||
"position": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -456,7 +472,7 @@
|
|||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"value": "from langflow.custom import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
|
|
@ -478,11 +494,18 @@
|
|||
},
|
||||
"id": "CustomComponent-w4WCp"
|
||||
},
|
||||
"positionAbsolute": { "x": 536, "y": 337 }
|
||||
"positionAbsolute": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"viewport": { "x": 0, "y": 0, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"id": "e43cf2c8-cd64-4936-8170-b207a8b109c4",
|
||||
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
|
||||
|
|
@ -497,7 +520,10 @@
|
|||
"height": 631,
|
||||
"id": "ChatOpenAI-7GFF0",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 543.1816229116944, "y": 942.891611351432 },
|
||||
"position": {
|
||||
"x": 543.1816229116944,
|
||||
"y": 942.891611351432
|
||||
},
|
||||
"data": {
|
||||
"type": "ChatOpenAI",
|
||||
"node": {
|
||||
|
|
@ -725,7 +751,10 @@
|
|||
"height": 387,
|
||||
"id": "AgentInitializer-YJgqs",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 1036.6064439140812, "y": 645.1919693466587 },
|
||||
"position": {
|
||||
"x": 1036.6064439140812,
|
||||
"y": 645.1919693466587
|
||||
},
|
||||
"data": {
|
||||
"type": "AgentInitializer",
|
||||
"node": {
|
||||
|
|
@ -803,7 +832,10 @@
|
|||
"height": 437,
|
||||
"id": "PythonFunctionTool-gqQDg",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 553.050119331742, "y": 412.9533535948685 },
|
||||
"position": {
|
||||
"x": 553.050119331742,
|
||||
"y": 412.9533535948685
|
||||
},
|
||||
"data": {
|
||||
"type": "PythonFunctionTool",
|
||||
"node": {
|
||||
|
|
@ -867,7 +899,9 @@
|
|||
"sourceHandle": "{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-7GFF0œ}",
|
||||
"target": "AgentInitializer-YJgqs",
|
||||
"targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-YJgqsœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-ChatOpenAI-7GFF0{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-7GFF0œ}-AgentInitializer-YJgqs{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-YJgqsœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
|
|
@ -896,7 +930,9 @@
|
|||
"sourceHandle": "{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-gqQDgœ}",
|
||||
"target": "AgentInitializer-YJgqs",
|
||||
"targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-YJgqsœ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-PythonFunctionTool-gqQDg{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-gqQDgœ}-AgentInitializer-YJgqs{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-YJgqsœ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
|
|
@ -933,7 +969,10 @@
|
|||
{
|
||||
"id": "CustomComponent-iF9Zr",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 536, "y": 337 },
|
||||
"position": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -943,7 +982,7 @@
|
|||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"value": "from langflow.custom import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
|
|
@ -965,11 +1004,18 @@
|
|||
},
|
||||
"id": "CustomComponent-iF9Zr"
|
||||
},
|
||||
"positionAbsolute": { "x": 536, "y": 337 }
|
||||
"positionAbsolute": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"viewport": { "x": 0, "y": 0, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"id": "88a0e6a1-8144-4bff-b28c-d312ae5c8a10",
|
||||
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
|
||||
|
|
@ -984,7 +1030,10 @@
|
|||
"height": 631,
|
||||
"id": "ChatOpenAI-cljAK",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 543.1816229116944, "y": 942.891611351432 },
|
||||
"position": {
|
||||
"x": 543.1816229116944,
|
||||
"y": 942.891611351432
|
||||
},
|
||||
"data": {
|
||||
"type": "ChatOpenAI",
|
||||
"node": {
|
||||
|
|
@ -1212,7 +1261,10 @@
|
|||
"height": 387,
|
||||
"id": "AgentInitializer-grV0u",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 1036.6064439140812, "y": 645.1919693466587 },
|
||||
"position": {
|
||||
"x": 1036.6064439140812,
|
||||
"y": 645.1919693466587
|
||||
},
|
||||
"data": {
|
||||
"type": "AgentInitializer",
|
||||
"node": {
|
||||
|
|
@ -1290,7 +1342,10 @@
|
|||
"height": 437,
|
||||
"id": "PythonFunctionTool-SctM2",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 553.050119331742, "y": 412.9533535948685 },
|
||||
"position": {
|
||||
"x": 553.050119331742,
|
||||
"y": 412.9533535948685
|
||||
},
|
||||
"data": {
|
||||
"type": "PythonFunctionTool",
|
||||
"node": {
|
||||
|
|
@ -1354,7 +1409,9 @@
|
|||
"sourceHandle": "{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-cljAKœ}",
|
||||
"target": "AgentInitializer-grV0u",
|
||||
"targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-grV0uœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-ChatOpenAI-cljAK{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-cljAKœ}-AgentInitializer-grV0u{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-grV0uœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
|
|
@ -1383,7 +1440,9 @@
|
|||
"sourceHandle": "{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-SctM2œ}",
|
||||
"target": "AgentInitializer-grV0u",
|
||||
"targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-grV0uœ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-PythonFunctionTool-SctM2{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-SctM2œ}-AgentInitializer-grV0u{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-grV0uœ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
|
|
@ -1420,7 +1479,10 @@
|
|||
{
|
||||
"id": "CustomComponent-z5kAP",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 536, "y": 337 },
|
||||
"position": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -1430,7 +1492,7 @@
|
|||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"value": "from langflow.custom import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
|
|
@ -1452,11 +1514,18 @@
|
|||
},
|
||||
"id": "CustomComponent-z5kAP"
|
||||
},
|
||||
"positionAbsolute": { "x": 536, "y": 337 }
|
||||
"positionAbsolute": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"viewport": { "x": 0, "y": 0, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"id": "3128b556-35c7-4ced-a834-70fbeb1a410f",
|
||||
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
|
||||
|
|
@ -1469,7 +1538,10 @@
|
|||
{
|
||||
"id": "CustomComponent-ZieNZ",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 536, "y": 337 },
|
||||
"position": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -1479,7 +1551,7 @@
|
|||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"value": "from langflow.custom import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
|
|
@ -1501,11 +1573,18 @@
|
|||
},
|
||||
"id": "CustomComponent-ZieNZ"
|
||||
},
|
||||
"positionAbsolute": { "x": 536, "y": 337 }
|
||||
"positionAbsolute": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"viewport": { "x": 0, "y": 0, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"id": "d3f2c379-9df5-49a0-b33d-d855c2085949",
|
||||
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
|
||||
|
|
@ -1518,7 +1597,10 @@
|
|||
{
|
||||
"id": "CustomComponent-CcHG0",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 536, "y": 337 },
|
||||
"position": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -1528,7 +1610,7 @@
|
|||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"value": "from langflow.custom import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
|
|
@ -1550,11 +1632,18 @@
|
|||
},
|
||||
"id": "CustomComponent-CcHG0"
|
||||
},
|
||||
"positionAbsolute": { "x": 536, "y": 337 }
|
||||
"positionAbsolute": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"viewport": { "x": 0, "y": 0, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"id": "74afff1f-b540-43d5-bc66-d18f39d65d57",
|
||||
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
|
||||
|
|
@ -1567,7 +1656,10 @@
|
|||
{
|
||||
"id": "CustomComponent-Q8qSr",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 536, "y": 337 },
|
||||
"position": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -1577,7 +1669,7 @@
|
|||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"value": "from langflow.custom import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
|
|
@ -1599,11 +1691,18 @@
|
|||
},
|
||||
"id": "CustomComponent-Q8qSr"
|
||||
},
|
||||
"positionAbsolute": { "x": 536, "y": 337 }
|
||||
"positionAbsolute": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"viewport": { "x": 0, "y": 0, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"id": "b0b1c893-6194-4748-ae10-b5f604b271c2",
|
||||
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
|
||||
|
|
@ -1616,7 +1715,10 @@
|
|||
{
|
||||
"id": "CustomComponent-Lgoca",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 536, "y": 337 },
|
||||
"position": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -1626,7 +1728,7 @@
|
|||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"value": "from langflow.custom import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
|
|
@ -1648,11 +1750,18 @@
|
|||
},
|
||||
"id": "CustomComponent-Lgoca"
|
||||
},
|
||||
"positionAbsolute": { "x": 536, "y": 337 }
|
||||
"positionAbsolute": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"viewport": { "x": 0, "y": 0, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"id": "edf1051d-509b-46a2-84c6-b94bdcdc3a4f",
|
||||
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
|
||||
|
|
@ -1665,7 +1774,10 @@
|
|||
{
|
||||
"id": "CustomComponent-6OJGW",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 536, "y": 337 },
|
||||
"position": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -1675,7 +1787,7 @@
|
|||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"value": "from langflow.custom import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
|
|
@ -1697,11 +1809,18 @@
|
|||
},
|
||||
"id": "CustomComponent-6OJGW"
|
||||
},
|
||||
"positionAbsolute": { "x": 536, "y": 337 }
|
||||
"positionAbsolute": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"viewport": { "x": 0, "y": 0, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"id": "65b2a4e0-4084-418a-aa86-ee914acb0ab5",
|
||||
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
|
||||
|
|
@ -1714,7 +1833,10 @@
|
|||
{
|
||||
"id": "CustomComponent-tcE83",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 536, "y": 337 },
|
||||
"position": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -1724,7 +1846,7 @@
|
|||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"value": "from langflow.custom import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
|
|
@ -1746,11 +1868,18 @@
|
|||
},
|
||||
"id": "CustomComponent-tcE83"
|
||||
},
|
||||
"positionAbsolute": { "x": 536, "y": 337 }
|
||||
"positionAbsolute": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"viewport": { "x": 0, "y": 0, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"id": "534e412b-d37b-4133-8029-e5ed139fd55c",
|
||||
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
|
||||
|
|
@ -1765,7 +1894,10 @@
|
|||
"height": 631,
|
||||
"id": "ChatOpenAI-mQEi3",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 543.1816229116944, "y": 942.891611351432 },
|
||||
"position": {
|
||||
"x": 543.1816229116944,
|
||||
"y": 942.891611351432
|
||||
},
|
||||
"data": {
|
||||
"type": "ChatOpenAI",
|
||||
"node": {
|
||||
|
|
@ -1993,7 +2125,10 @@
|
|||
"height": 387,
|
||||
"id": "AgentInitializer-EE8R4",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 1036.6064439140812, "y": 645.1919693466587 },
|
||||
"position": {
|
||||
"x": 1036.6064439140812,
|
||||
"y": 645.1919693466587
|
||||
},
|
||||
"data": {
|
||||
"type": "AgentInitializer",
|
||||
"node": {
|
||||
|
|
@ -2071,7 +2206,10 @@
|
|||
"height": 437,
|
||||
"id": "PythonFunctionTool-YKkDL",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 553.050119331742, "y": 412.9533535948685 },
|
||||
"position": {
|
||||
"x": 553.050119331742,
|
||||
"y": 412.9533535948685
|
||||
},
|
||||
"data": {
|
||||
"type": "PythonFunctionTool",
|
||||
"node": {
|
||||
|
|
@ -2135,7 +2273,9 @@
|
|||
"sourceHandle": "{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-mQEi3œ}",
|
||||
"target": "AgentInitializer-EE8R4",
|
||||
"targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-EE8R4œ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-ChatOpenAI-mQEi3{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-mQEi3œ}-AgentInitializer-EE8R4{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-EE8R4œ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
|
|
@ -2164,7 +2304,9 @@
|
|||
"sourceHandle": "{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-YKkDLœ}",
|
||||
"target": "AgentInitializer-EE8R4",
|
||||
"targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-EE8R4œ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-PythonFunctionTool-YKkDL{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-YKkDLœ}-AgentInitializer-EE8R4{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-EE8R4œ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
|
|
@ -2201,7 +2343,10 @@
|
|||
{
|
||||
"id": "CustomComponent-T38LS",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 536, "y": 337 },
|
||||
"position": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -2211,7 +2356,7 @@
|
|||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"value": "from langflow.custom import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
|
|
@ -2233,11 +2378,18 @@
|
|||
},
|
||||
"id": "CustomComponent-T38LS"
|
||||
},
|
||||
"positionAbsolute": { "x": 536, "y": 337 }
|
||||
"positionAbsolute": {
|
||||
"x": 536,
|
||||
"y": 337
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"viewport": { "x": 0, "y": 0, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"id": "ec36a3b7-7b5f-4663-983c-833bcec4d851",
|
||||
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
|
||||
|
|
@ -2252,7 +2404,10 @@
|
|||
"height": 631,
|
||||
"id": "ChatOpenAI-E1XSb",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 543.1816229116944, "y": 942.891611351432 },
|
||||
"position": {
|
||||
"x": 543.1816229116944,
|
||||
"y": 942.891611351432
|
||||
},
|
||||
"data": {
|
||||
"type": "ChatOpenAI",
|
||||
"node": {
|
||||
|
|
@ -2480,7 +2635,10 @@
|
|||
"height": 387,
|
||||
"id": "AgentInitializer-goPm2",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 1036.6064439140812, "y": 645.1919693466587 },
|
||||
"position": {
|
||||
"x": 1036.6064439140812,
|
||||
"y": 645.1919693466587
|
||||
},
|
||||
"data": {
|
||||
"type": "AgentInitializer",
|
||||
"node": {
|
||||
|
|
@ -2558,7 +2716,10 @@
|
|||
"height": 437,
|
||||
"id": "PythonFunctionTool-SQikY",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 553.050119331742, "y": 412.9533535948685 },
|
||||
"position": {
|
||||
"x": 553.050119331742,
|
||||
"y": 412.9533535948685
|
||||
},
|
||||
"data": {
|
||||
"type": "PythonFunctionTool",
|
||||
"node": {
|
||||
|
|
@ -2622,7 +2783,9 @@
|
|||
"sourceHandle": "{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-E1XSbœ}",
|
||||
"target": "AgentInitializer-goPm2",
|
||||
"targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-goPm2œ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-ChatOpenAI-E1XSb{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-E1XSbœ}-AgentInitializer-goPm2{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-goPm2œ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
|
|
@ -2651,7 +2814,9 @@
|
|||
"sourceHandle": "{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-SQikYœ}",
|
||||
"target": "AgentInitializer-goPm2",
|
||||
"targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-goPm2œ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-PythonFunctionTool-SQikY{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-SQikYœ}-AgentInitializer-goPm2{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-goPm2œ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
532
src/frontend/tests/end-to-end/assets/flow_group_test.json
Normal file
532
src/frontend/tests/end-to-end/assets/flow_group_test.json
Normal file
|
|
@ -0,0 +1,532 @@
|
|||
{
|
||||
"id": "8404c1fc-1bce-43b4-a8bc-3febea587fc8",
|
||||
"data": {
|
||||
"nodes": [
|
||||
{
|
||||
"id": "PythonFunctionTool-RfJui",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 117.54690105175428,
|
||||
"y": -84.2465475108354
|
||||
},
|
||||
"data": {
|
||||
"type": "PythonFunctionTool",
|
||||
"node": {
|
||||
"template": {
|
||||
"code": {
|
||||
"type": "code",
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "\ndef python_function(text: str) -> str:\n \"\"\"This is a default python function that returns the input text\"\"\"\n return text\n",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false
|
||||
},
|
||||
"description": {
|
||||
"type": "str",
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "Returns the Text you send. This is a testing tool.",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "description",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false,
|
||||
"input_types": ["Text"]
|
||||
},
|
||||
"name": {
|
||||
"type": "str",
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": "PythonFunction",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "name",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false,
|
||||
"input_types": ["Text"]
|
||||
},
|
||||
"return_direct": {
|
||||
"type": "bool",
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": false,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "return_direct",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false
|
||||
},
|
||||
"_type": "PythonFunctionTool"
|
||||
},
|
||||
"description": "Python function to be executed.",
|
||||
"base_classes": ["BaseTool", "Tool"],
|
||||
"display_name": "PythonFunctionTool",
|
||||
"documentation": "",
|
||||
"custom_fields": {},
|
||||
"output_types": [],
|
||||
"field_formatters": {},
|
||||
"pinned": false,
|
||||
"beta": false
|
||||
},
|
||||
"id": "PythonFunctionTool-RfJui"
|
||||
},
|
||||
"selected": true,
|
||||
"width": 384,
|
||||
"height": 466,
|
||||
"positionAbsolute": {
|
||||
"x": 117.54690105175428,
|
||||
"y": -84.2465475108354
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"id": "AgentInitializer-tPdJw",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 677.68677055088,
|
||||
"y": 127.19859565276168
|
||||
},
|
||||
"data": {
|
||||
"type": "AgentInitializer",
|
||||
"node": {
|
||||
"template": {
|
||||
"llm": {
|
||||
"type": "BaseLanguageModel",
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "llm",
|
||||
"display_name": "Language Model",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false
|
||||
},
|
||||
"memory": {
|
||||
"type": "BaseChatMemory",
|
||||
"required": false,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "memory",
|
||||
"display_name": "Memory",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false
|
||||
},
|
||||
"tools": {
|
||||
"type": "Tool",
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": true,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "tools",
|
||||
"display_name": "Tools",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false
|
||||
},
|
||||
"agent": {
|
||||
"type": "str",
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": true,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": "zero-shot-react-description",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"options": [
|
||||
"zero-shot-react-description",
|
||||
"react-docstore",
|
||||
"self-ask-with-search",
|
||||
"conversational-react-description",
|
||||
"chat-zero-shot-react-description",
|
||||
"chat-conversational-react-description",
|
||||
"structured-chat-zero-shot-react-description",
|
||||
"openai-functions",
|
||||
"openai-multi-functions",
|
||||
"JsonAgent",
|
||||
"CSVAgent",
|
||||
"VectorStoreAgent",
|
||||
"VectorStoreRouterAgent",
|
||||
"SQLAgent"
|
||||
],
|
||||
"name": "agent",
|
||||
"display_name": "Agent Type",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false,
|
||||
"input_types": ["Text"]
|
||||
},
|
||||
"code": {
|
||||
"type": "code",
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from typing import Callable, List, Optional, Union\n\nfrom langchain.agents import AgentExecutor, AgentType, initialize_agent, types\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import BaseChatMemory, BaseLanguageModel, Tool\n\n\nclass AgentInitializerComponent(CustomComponent):\n display_name: str = \"Agent Initializer\"\n description: str = \"Initialize a Langchain Agent.\"\n documentation: str = \"https://python.langchain.com/docs/modules/agents/agent_types/\"\n\n def build_config(self):\n agents = list(types.AGENT_TO_CLASS.keys())\n # field_type and required are optional\n return {\n \"agent\": {\"options\": agents, \"value\": agents[0], \"display_name\": \"Agent Type\"},\n \"max_iterations\": {\"display_name\": \"Max Iterations\", \"value\": 10},\n \"memory\": {\"display_name\": \"Memory\"},\n \"tools\": {\"display_name\": \"Tools\"},\n \"llm\": {\"display_name\": \"Language Model\"},\n \"code\": {\"advanced\": True},\n }\n\n def build(\n self,\n agent: str,\n llm: BaseLanguageModel,\n tools: List[Tool],\n max_iterations: int,\n memory: Optional[BaseChatMemory] = None,\n ) -> Union[AgentExecutor, Callable]:\n agent = AgentType(agent)\n if memory:\n return initialize_agent(\n tools=tools,\n llm=llm,\n agent=agent,\n memory=memory,\n return_intermediate_steps=True,\n handle_parsing_errors=True,\n max_iterations=max_iterations,\n )\n return initialize_agent(\n tools=tools,\n llm=llm,\n agent=agent,\n return_intermediate_steps=True,\n handle_parsing_errors=True,\n max_iterations=max_iterations,\n )\n",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": true,
|
||||
"dynamic": true,
|
||||
"info": "",
|
||||
"title_case": false
|
||||
},
|
||||
"max_iterations": {
|
||||
"type": "int",
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": 10,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "max_iterations",
|
||||
"display_name": "Max Iterations",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false
|
||||
},
|
||||
"_type": "CustomComponent"
|
||||
},
|
||||
"description": "Initialize a Langchain Agent.",
|
||||
"base_classes": [
|
||||
"Runnable",
|
||||
"Chain",
|
||||
"Serializable",
|
||||
"object",
|
||||
"AgentExecutor",
|
||||
"Generic",
|
||||
"RunnableSerializable",
|
||||
"Callable"
|
||||
],
|
||||
"display_name": "Agent Initializer",
|
||||
"documentation": "https://python.langchain.com/docs/modules/agents/agent_types/",
|
||||
"custom_fields": {
|
||||
"agent": null,
|
||||
"llm": null,
|
||||
"tools": null,
|
||||
"max_iterations": null,
|
||||
"memory": null
|
||||
},
|
||||
"output_types": ["AgentExecutor", "Callable"],
|
||||
"field_formatters": {},
|
||||
"pinned": false,
|
||||
"beta": true
|
||||
},
|
||||
"id": "AgentInitializer-tPdJw"
|
||||
},
|
||||
"selected": false,
|
||||
"width": 384,
|
||||
"height": 522
|
||||
},
|
||||
{
|
||||
"id": "ChatOpenAISpecs-stxRM",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 18.226716205350385,
|
||||
"y": 432.6122491402193
|
||||
},
|
||||
"data": {
|
||||
"type": "ChatOpenAISpecs",
|
||||
"node": {
|
||||
"template": {
|
||||
"code": {
|
||||
"type": "code",
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from typing import Optional, Union\n\nfrom langchain.llms import BaseLLM\nfrom langchain_community.chat_models.openai import ChatOpenAI\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import BaseLanguageModel, NestedDict\n\n\nclass ChatOpenAIComponent(CustomComponent):\n display_name = \"ChatOpenAI\"\n description = \"`OpenAI` Chat large language models API.\"\n icon = \"OpenAI\"\n\n def build_config(self):\n return {\n \"max_tokens\": {\n \"display_name\": \"Max Tokens\",\n \"advanced\": False,\n \"required\": False,\n },\n \"model_kwargs\": {\n \"display_name\": \"Model Kwargs\",\n \"advanced\": True,\n \"required\": False,\n },\n \"model_name\": {\n \"display_name\": \"Model Name\",\n \"advanced\": False,\n \"required\": False,\n \"options\": [\n \"gpt-4-turbo-preview\",\n \"gpt-4-0125-preview\",\n \"gpt-4-1106-preview\",\n \"gpt-4-vision-preview\",\n \"gpt-3.5-turbo-0125\",\n \"gpt-3.5-turbo-1106\",\n ],\n },\n \"openai_api_base\": {\n \"display_name\": \"OpenAI API Base\",\n \"advanced\": False,\n \"required\": False,\n \"info\": (\n \"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\\n\\n\"\n \"You can change this to use other APIs like JinaChat, LocalAI and Prem.\"\n ),\n },\n \"openai_api_key\": {\n \"display_name\": \"OpenAI API Key\",\n \"advanced\": False,\n \"required\": False,\n \"password\": True,\n },\n \"temperature\": {\n \"display_name\": \"Temperature\",\n \"advanced\": False,\n \"required\": False,\n \"value\": 0.7,\n },\n }\n\n def build(\n self,\n max_tokens: Optional[int] = 256,\n model_kwargs: NestedDict = {},\n model_name: str = \"gpt-4-1106-preview\",\n openai_api_base: Optional[str] = None,\n openai_api_key: Optional[str] = None,\n temperature: float = 0.7,\n ) -> Union[BaseLanguageModel, BaseLLM]:\n if not openai_api_base:\n openai_api_base = \"https://api.openai.com/v1\"\n return ChatOpenAI(\n max_tokens=max_tokens,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=openai_api_key,\n temperature=temperature,\n )\n",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "code",
|
||||
"advanced": false,
|
||||
"dynamic": true,
|
||||
"info": "",
|
||||
"title_case": false
|
||||
},
|
||||
"max_tokens": {
|
||||
"type": "int",
|
||||
"required": false,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": 256,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "max_tokens",
|
||||
"display_name": "Max Tokens",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false
|
||||
},
|
||||
"model_kwargs": {
|
||||
"type": "NestedDict",
|
||||
"required": false,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": {},
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "model_kwargs",
|
||||
"display_name": "Model Kwargs",
|
||||
"advanced": true,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false
|
||||
},
|
||||
"model_name": {
|
||||
"type": "str",
|
||||
"required": false,
|
||||
"placeholder": "",
|
||||
"list": true,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": "gpt-4-1106-preview",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"options": [
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-1106-preview",
|
||||
"gpt-4-vision-preview",
|
||||
"gpt-3.5-turbo-0125",
|
||||
"gpt-3.5-turbo-1106"
|
||||
],
|
||||
"name": "model_name",
|
||||
"display_name": "Model Name",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false,
|
||||
"input_types": ["Text"]
|
||||
},
|
||||
"openai_api_base": {
|
||||
"type": "str",
|
||||
"required": false,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"name": "openai_api_base",
|
||||
"display_name": "OpenAI API Base",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.",
|
||||
"title_case": false,
|
||||
"input_types": ["Text"]
|
||||
},
|
||||
"openai_api_key": {
|
||||
"type": "str",
|
||||
"required": false,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": true,
|
||||
"name": "openai_api_key",
|
||||
"display_name": "OpenAI API Key",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"title_case": false,
|
||||
"input_types": ["Text"]
|
||||
},
|
||||
"temperature": {
|
||||
"type": "float",
|
||||
"required": false,
|
||||
"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": {
|
||||
"min": -1,
|
||||
"max": 1,
|
||||
"step": 0.1
|
||||
},
|
||||
"title_case": false
|
||||
},
|
||||
"_type": "CustomComponent"
|
||||
},
|
||||
"description": "`OpenAI` Chat large language models API.",
|
||||
"icon": "OpenAI",
|
||||
"base_classes": [
|
||||
"Runnable",
|
||||
"BaseLLM",
|
||||
"Serializable",
|
||||
"BaseLanguageModel",
|
||||
"object",
|
||||
"Generic",
|
||||
"RunnableSerializable"
|
||||
],
|
||||
"display_name": "ChatOpenAI",
|
||||
"documentation": "",
|
||||
"custom_fields": {
|
||||
"max_tokens": null,
|
||||
"model_kwargs": null,
|
||||
"model_name": null,
|
||||
"openai_api_base": null,
|
||||
"openai_api_key": null,
|
||||
"temperature": null
|
||||
},
|
||||
"output_types": ["BaseLanguageModel", "BaseLLM"],
|
||||
"field_formatters": {},
|
||||
"pinned": false,
|
||||
"beta": true
|
||||
},
|
||||
"id": "ChatOpenAISpecs-stxRM"
|
||||
},
|
||||
"selected": false,
|
||||
"width": 384,
|
||||
"height": 666,
|
||||
"positionAbsolute": {
|
||||
"x": 18.226716205350385,
|
||||
"y": 432.6122491402193
|
||||
},
|
||||
"dragging": false
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "ChatOpenAISpecs-stxRM",
|
||||
"sourceHandle": "{œbaseClassesœ:[œRunnableœ,œBaseLLMœ,œSerializableœ,œBaseLanguageModelœ,œobjectœ,œGenericœ,œRunnableSerializableœ],œdataTypeœ:œChatOpenAISpecsœ,œidœ:œChatOpenAISpecs-stxRMœ}",
|
||||
"target": "AgentInitializer-tPdJw",
|
||||
"targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-tPdJwœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
||||
"data": {
|
||||
"targetHandle": {
|
||||
"fieldName": "llm",
|
||||
"id": "AgentInitializer-tPdJw",
|
||||
"inputTypes": null,
|
||||
"type": "BaseLanguageModel"
|
||||
},
|
||||
"sourceHandle": {
|
||||
"baseClasses": [
|
||||
"Runnable",
|
||||
"BaseLLM",
|
||||
"Serializable",
|
||||
"BaseLanguageModel",
|
||||
"object",
|
||||
"Generic",
|
||||
"RunnableSerializable"
|
||||
],
|
||||
"dataType": "ChatOpenAISpecs",
|
||||
"id": "ChatOpenAISpecs-stxRM"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-foreground stroke-connection",
|
||||
"id": "reactflow__edge-ChatOpenAISpecs-stxRM{œbaseClassesœ:[œRunnableœ,œBaseLLMœ,œSerializableœ,œBaseLanguageModelœ,œobjectœ,œGenericœ,œRunnableSerializableœ],œdataTypeœ:œChatOpenAISpecsœ,œidœ:œChatOpenAISpecs-stxRMœ}-AgentInitializer-tPdJw{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-tPdJwœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}"
|
||||
},
|
||||
{
|
||||
"source": "PythonFunctionTool-RfJui",
|
||||
"sourceHandle": "{œbaseClassesœ:[œBaseToolœ,œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-RfJuiœ}",
|
||||
"target": "AgentInitializer-tPdJw",
|
||||
"targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-tPdJwœ,œinputTypesœ:null,œtypeœ:œToolœ}",
|
||||
"data": {
|
||||
"targetHandle": {
|
||||
"fieldName": "tools",
|
||||
"id": "AgentInitializer-tPdJw",
|
||||
"inputTypes": null,
|
||||
"type": "Tool"
|
||||
},
|
||||
"sourceHandle": {
|
||||
"baseClasses": ["BaseTool", "Tool"],
|
||||
"dataType": "PythonFunctionTool",
|
||||
"id": "PythonFunctionTool-RfJui"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-foreground stroke-connection",
|
||||
"id": "reactflow__edge-PythonFunctionTool-RfJui{œbaseClassesœ:[œBaseToolœ,œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-RfJuiœ}-AgentInitializer-tPdJw{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-tPdJwœ,œinputTypesœ:null,œtypeœ:œToolœ}"
|
||||
}
|
||||
],
|
||||
"viewport": {
|
||||
"x": 37.63043052737157,
|
||||
"y": 71.47518177614131,
|
||||
"zoom": 0.5140569133280332
|
||||
}
|
||||
},
|
||||
"description": "Uncover Business Opportunities with NLP.",
|
||||
"name": "Untitled document (20)",
|
||||
"last_tested_version": "0.7.0a0",
|
||||
"is_component": false
|
||||
}
|
||||
|
|
@ -8,7 +8,10 @@
|
|||
"height": 461,
|
||||
"id": "CustomComponent-MtJjl",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 534.3712097224906, "y": -135.01908566635723 },
|
||||
"position": {
|
||||
"x": 534.3712097224906,
|
||||
"y": -135.01908566635723
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -20,7 +23,7 @@
|
|||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\nfrom langflow.field_typing import Data\nfrom pathlib import Path\nfrom platformdirs import user_cache_dir\nimport os\n\nclass Component(CustomComponent):\n documentation: str = \"http://docs.langflow.org/components/custom\"\n\n def build_config(self):\n return {\"text_input\":{\"display_name\":\"Text Input\", \"input_types\":[\"str\"]},\"save_path\":{\"display_name\":\"Save Path\",\n \"info\":\"Put the full path with the file name and extension\",\"value\":Path(user_cache_dir(\"langflow\"))/\"text.t1.txt\"}}\n\n def build(self, text_input:str,save_path:str) -> str:\n try:\n # Create the directory if it doesn't exist\n os.makedirs(os.path.dirname(save_path), exist_ok=True)\n\n # Open the file in write mode and save the text\n with open(save_path, 'w') as file:\n file.write(text_input)\n except Exception as e:\n raise e\n self.status = text_input\n return text_input",
|
||||
"value": "from langflow.custom import CustomComponent\nfrom langflow.field_typing import Data\nfrom pathlib import Path\nfrom platformdirs import user_cache_dir\nimport os\n\nclass Component(CustomComponent):\n documentation: str = \"http://docs.langflow.org/components/custom\"\n\n def build_config(self):\n return {\"text_input\":{\"display_name\":\"Text Input\", \"input_types\":[\"str\"]},\"save_path\":{\"display_name\":\"Save Path\",\n \"info\":\"Put the full path with the file name and extension\",\"value\":Path(user_cache_dir(\"langflow\"))/\"text.t1.txt\"}}\n\n def build(self, text_input:str,save_path:str) -> str:\n try:\n # Create the directory if it doesn't exist\n os.makedirs(os.path.dirname(save_path), exist_ok=True)\n\n # Open the file in write mode and save the text\n with open(save_path, 'w') as file:\n file.write(text_input)\n except Exception as e:\n raise e\n self.status = text_input\n return text_input",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
|
|
@ -69,7 +72,10 @@
|
|||
"base_classes": ["str"],
|
||||
"display_name": "text checkpoint",
|
||||
"documentation": "http://docs.langflow.org/components/custom",
|
||||
"custom_fields": { "save_path": null, "text_input": null },
|
||||
"custom_fields": {
|
||||
"save_path": null,
|
||||
"text_input": null
|
||||
},
|
||||
"output_types": ["str"],
|
||||
"field_formatters": {},
|
||||
"beta": true
|
||||
|
|
@ -78,14 +84,20 @@
|
|||
},
|
||||
"selected": false,
|
||||
"dragging": false,
|
||||
"positionAbsolute": { "x": 534.3712097224906, "y": -135.01908566635723 }
|
||||
"positionAbsolute": {
|
||||
"x": 534.3712097224906,
|
||||
"y": -135.01908566635723
|
||||
}
|
||||
},
|
||||
{
|
||||
"width": 384,
|
||||
"height": 453,
|
||||
"id": "CustomComponent-7NQoq",
|
||||
"type": "genericNode",
|
||||
"position": { "x": 27.487979888011637, "y": -414.43998171034826 },
|
||||
"position": {
|
||||
"x": 27.487979888011637,
|
||||
"y": -414.43998171034826
|
||||
},
|
||||
"data": {
|
||||
"type": "CustomComponent",
|
||||
"node": {
|
||||
|
|
@ -131,7 +143,7 @@
|
|||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langflow import CustomComponent\nfrom typing import Optional, List, Dict, Union\nfrom langflow.field_typing import (\n AgentExecutor,\n BaseChatMemory,\n BaseLanguageModel,\n BaseLLM,\n BaseLoader,\n BaseMemory,\n BaseOutputParser,\n BasePromptTemplate,\n BaseRetriever,\n Callable,\n Chain,\n ChatPromptTemplate,\n Data,\n Document,\n Embeddings,\n NestedDict,\n Object,\n PromptTemplate,\n TextSplitter,\n Tool,\n VectorStore,\n)\n\nfrom openai import OpenAI\nimport os\nimport ffmpeg\n\nclass Component(CustomComponent):\n display_name: str = \"Whisper Transcriber\"\n description: str = \"Converts audio to text using OpenAI's Whisper.\"\n\n def build_config(self):\n return {\"audio\": {\"field_type\": \"file\", \"suffixes\": [\".mp3\", \".mp4\", \".m4a\"]}, \"OpenAIKey\": {\"field_type\": \"str\", \"password\": True}}\n\n def calculate_segment_duration(self, audio_path, target_chunk_size_mb=24):\n # Calculate the target chunk size in bytes\n target_chunk_size_bytes = target_chunk_size_mb * 1024 * 1024\n\n # Use ffprobe to get the audio file information\n ffprobe_output = ffmpeg.probe(audio_path)\n print(ffprobe_output)\n # Convert duration to float\n duration = float(ffprobe_output[\"format\"][\"duration\"])\n\n # Calculate the approximate bitrate\n bitrate = os.path.getsize(audio_path) / duration\n\n # Calculate the segment duration to achieve the target chunk size\n segment_duration = target_chunk_size_bytes / bitrate\n\n return segment_duration\n\n def split_audio_into_chunks(self, audio_path, target_chunk_size_mb=24):\n # Calculate the segment duration\n segment_duration = self.calculate_segment_duration(audio_path, target_chunk_size_mb)\n\n # Create a directory to store the chunks\n output_directory = f\"{os.path.splitext(audio_path)[0]}_chunks\"\n os.makedirs(output_directory, exist_ok=True)\n\n # Use ffmpeg-python to split the audio file into chunks\n (\n ffmpeg.input(audio_path)\n .output(f\"{output_directory}/%03d{os.path.splitext(audio_path)[1]}\", codec=\"copy\", f=\"segment\", segment_time=segment_duration)\n .run()\n )\n\n # Get the list of generated chunk files\n chunks = [os.path.join(output_directory, file) for file in os.listdir(output_directory)]\n\n return chunks\n\n def build(self, audio: str, OpenAIKey: str) -> str:\n # Split audio into chunks\n audio_chunks = self.split_audio_into_chunks(audio)\n\n client = OpenAI(api_key=OpenAIKey)\n transcripts = []\n\n try:\n for chunk in audio_chunks:\n with open(chunk, \"rb\") as chunk_file:\n transcript = client.audio.transcriptions.create(\n model=\"whisper-1\",\n file=chunk_file,\n response_format=\"text\"\n )\n transcripts.append(transcript)\n finally:\n # Clean up temporary chunk files\n for chunk in audio_chunks:\n os.remove(chunk)\n\n # Concatenate transcripts into the final response\n final_response = \"\\n\".join(transcripts)\n self.status = final_response\n return final_response\n",
|
||||
"value": "from langflow.custom import CustomComponent\nfrom typing import Optional, List, Dict, Union\nfrom langflow.field_typing import (\n AgentExecutor,\n BaseChatMemory,\n BaseLanguageModel,\n BaseLLM,\n BaseLoader,\n BaseMemory,\n BaseOutputParser,\n BasePromptTemplate,\n BaseRetriever,\n Callable,\n Chain,\n ChatPromptTemplate,\n Data,\n Document,\n Embeddings,\n NestedDict,\n Object,\n PromptTemplate,\n TextSplitter,\n Tool,\n VectorStore,\n)\n\nfrom openai import OpenAI\nimport os\nimport ffmpeg\n\nclass Component(CustomComponent):\n display_name: str = \"Whisper Transcriber\"\n description: str = \"Converts audio to text using OpenAI's Whisper.\"\n\n def build_config(self):\n return {\"audio\": {\"field_type\": \"file\", \"suffixes\": [\".mp3\", \".mp4\", \".m4a\"]}, \"OpenAIKey\": {\"field_type\": \"str\", \"password\": True}}\n\n def calculate_segment_duration(self, audio_path, target_chunk_size_mb=24):\n # Calculate the target chunk size in bytes\n target_chunk_size_bytes = target_chunk_size_mb * 1024 * 1024\n\n # Use ffprobe to get the audio file information\n ffprobe_output = ffmpeg.probe(audio_path)\n print(ffprobe_output)\n # Convert duration to float\n duration = float(ffprobe_output[\"format\"][\"duration\"])\n\n # Calculate the approximate bitrate\n bitrate = os.path.getsize(audio_path) / duration\n\n # Calculate the segment duration to achieve the target chunk size\n segment_duration = target_chunk_size_bytes / bitrate\n\n return segment_duration\n\n def split_audio_into_chunks(self, audio_path, target_chunk_size_mb=24):\n # Calculate the segment duration\n segment_duration = self.calculate_segment_duration(audio_path, target_chunk_size_mb)\n\n # Create a directory to store the chunks\n output_directory = f\"{os.path.splitext(audio_path)[0]}_chunks\"\n os.makedirs(output_directory, exist_ok=True)\n\n # Use ffmpeg-python to split the audio file into chunks\n (\n ffmpeg.input(audio_path)\n .output(f\"{output_directory}/%03d{os.path.splitext(audio_path)[1]}\", codec=\"copy\", f=\"segment\", segment_time=segment_duration)\n .run()\n )\n\n # Get the list of generated chunk files\n chunks = [os.path.join(output_directory, file) for file in os.listdir(output_directory)]\n\n return chunks\n\n def build(self, audio: str, OpenAIKey: str) -> str:\n # Split audio into chunks\n audio_chunks = self.split_audio_into_chunks(audio)\n\n client = OpenAI(api_key=OpenAIKey)\n transcripts = []\n\n try:\n for chunk in audio_chunks:\n with open(chunk, \"rb\") as chunk_file:\n transcript = client.audio.transcriptions.create(\n model=\"whisper-1\",\n file=chunk_file,\n response_format=\"text\"\n )\n transcripts.append(transcript)\n finally:\n # Clean up temporary chunk files\n for chunk in audio_chunks:\n os.remove(chunk)\n\n # Concatenate transcripts into the final response\n final_response = \"\\n\".join(transcripts)\n self.status = final_response\n return final_response\n",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
|
|
@ -146,7 +158,10 @@
|
|||
"base_classes": ["str"],
|
||||
"display_name": "Whisper Transcriber",
|
||||
"documentation": "",
|
||||
"custom_fields": { "OpenAIKey": null, "audio": null },
|
||||
"custom_fields": {
|
||||
"OpenAIKey": null,
|
||||
"audio": null
|
||||
},
|
||||
"output_types": ["str"],
|
||||
"field_formatters": {},
|
||||
"beta": true
|
||||
|
|
@ -180,13 +195,19 @@
|
|||
"id": "CustomComponent-7NQoq"
|
||||
}
|
||||
},
|
||||
"style": { "stroke": "#555" },
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"animated": false,
|
||||
"id": "reactflow__edge-CustomComponent-7NQoq{œbaseClassesœ:[œstrœ],œdataTypeœ:œCustomComponentœ,œidœ:œCustomComponent-7NQoqœ}-CustomComponent-MtJjl{œfieldNameœ:œtext_inputœ,œidœ:œCustomComponent-MtJjlœ,œinputTypesœ:[œstrœ],œtypeœ:œstrœ}"
|
||||
}
|
||||
],
|
||||
"viewport": { "x": 119.37759169012509, "y": 351.3082742479685, "zoom": 1 }
|
||||
"viewport": {
|
||||
"x": 119.37759169012509,
|
||||
"y": 351.3082742479685,
|
||||
"zoom": 1
|
||||
}
|
||||
},
|
||||
"is_component": false,
|
||||
"updated_at": "2023-12-13T23:51:56.874099",
|
||||
|
|
@ -1,27 +1,29 @@
|
|||
import { test } from "@playwright/test";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(16000);
|
||||
// test.setTimeout(140000);
|
||||
});
|
||||
test.describe("Auto_login tests", () => {
|
||||
test("auto_login sign in", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/langflow.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
});
|
||||
|
||||
test("auto_login block_admin", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/langflow.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.goto("http:localhost:3000/login");
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.goto("/login");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.goto("http:localhost:3000/admin");
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.goto("/admin");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.goto("http:localhost:3000/admin/login");
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.goto("/admin/login");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(5000);
|
||||
});
|
||||
});
|
||||
46
src/frontend/tests/end-to-end/chat_io.spec.ts
Normal file
46
src/frontend/tests/end-to-end/chat_io.spec.ts
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import { test } from "@playwright/test";
|
||||
import { readFileSync } from "fs";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(20000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("chat_io_teste", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
|
||||
// Read your file into a buffer.
|
||||
const jsonContent = readFileSync(
|
||||
"tests/end-to-end/assets/ChatTest.json",
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
// Create the DataTransfer and File
|
||||
const dataTransfer = await page.evaluateHandle((data) => {
|
||||
const dt = new DataTransfer();
|
||||
// Convert the buffer to a hex array
|
||||
const file = new File([data], "ChatTest.json", {
|
||||
type: "application/json",
|
||||
});
|
||||
dt.items.add(file);
|
||||
return dt;
|
||||
}, jsonContent);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
// Now dispatch
|
||||
await page.dispatchEvent(
|
||||
'//*[@id="react-flow-id"]/div[1]/div[1]/div',
|
||||
"drop",
|
||||
{
|
||||
dataTransfer,
|
||||
}
|
||||
);
|
||||
await page.getByLabel("fit view").click();
|
||||
await page.getByText("Run", { exact: true }).click();
|
||||
await page.getByPlaceholder("Send a message...").click();
|
||||
await page.getByPlaceholder("Send a message...").fill("teste");
|
||||
await page.getByRole("button").nth(1).click();
|
||||
});
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.waitForTimeout(2000);
|
||||
test.setTimeout(120000);
|
||||
});
|
||||
test("CodeAreaModalComponent", async ({ page }) => {
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
|
@ -7,6 +10,9 @@ test("CodeAreaModalComponent", async ({ page }) => {
|
|||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("pythonfunctiontool");
|
||||
|
||||
|
|
@ -18,117 +24,35 @@ test("CodeAreaModalComponent", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.locator('//*[@id="code-input-0"]').click();
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
await page.getByTestId("code-button-modal").click();
|
||||
|
||||
let value = await page.locator('//*[@id="codeValue"]').inputValue();
|
||||
|
||||
if (
|
||||
value !=
|
||||
'def python_function(text: str) -> str: """This is a default python function that returns the input text""" return text'
|
||||
) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
const code =
|
||||
'def python_function(text: str) -> str:\n """This is a default python function that returns the input text"""\n return text';
|
||||
const wCode =
|
||||
'def python_function(text: str) -> st: """This is a default python function that returns the input text""" return text';
|
||||
const assertCode =
|
||||
'def python_function(text: str) -> str: """This is a default python function that returns the input text""" return text';
|
||||
await page
|
||||
.locator("#CodeEditor div")
|
||||
.filter({ hasText: "def python_function(text: str" })
|
||||
.nth(1)
|
||||
.click();
|
||||
await page.locator("textarea").press("Control+a");
|
||||
await page.locator("textarea").fill(wCode);
|
||||
await page.locator('//*[@id="checkAndSaveBtn"]').click();
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
await page.locator('//*[@id="showcode"]').click();
|
||||
expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showdescription"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
expect(
|
||||
await page.locator('//*[@id="showdescription"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showname"]').click();
|
||||
expect(await page.locator('//*[@id="showname"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showreturn_direct"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showreturn_direct"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showcode"]').click();
|
||||
expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showdescription"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showdescription"]').isChecked()
|
||||
await page.getByText("invalid syntax (<unknown>, line 1)").isVisible()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showname"]').click();
|
||||
expect(await page.locator('//*[@id="showname"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showreturn_direct"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showreturn_direct"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showcode"]').click();
|
||||
expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showdescription"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showdescription"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showname"]').click();
|
||||
expect(await page.locator('//*[@id="showname"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showreturn_direct"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showreturn_direct"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showcode"]').click();
|
||||
expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showdescription"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showdescription"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showname"]').click();
|
||||
expect(await page.locator('//*[@id="showname"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showreturn_direct"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showreturn_direct"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showcode"]').click();
|
||||
expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
const plusButtonLocator = page.locator('//*[@id="code-input-0"]');
|
||||
const elementCount = await plusButtonLocator.count();
|
||||
if (elementCount === 0) {
|
||||
expect(true).toBeTruthy();
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
await page.locator('//*[@id="showcode"]').click();
|
||||
expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="code-area-edit0"]').click();
|
||||
|
||||
let value = await page.locator('//*[@id="codeValue"]').inputValue();
|
||||
|
||||
if (
|
||||
value !=
|
||||
'def python_function(text: str) -> str: """This is a default python function that returns the input text""" return text'
|
||||
) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="checkAndSaveBtn"]').click();
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
await page.locator('//*[@id="code-input-0"]').click();
|
||||
}
|
||||
await page.locator("textarea").press("Control+a");
|
||||
await page.locator("textarea").fill(wCode);
|
||||
await page.locator("textarea").fill(code);
|
||||
await page.locator('//*[@id="checkAndSaveBtn"]').click();
|
||||
expect(await page.getByText("Code is ready to run").isVisible()).toBeTruthy();
|
||||
await page.getByTestId("code-button-modal").click();
|
||||
expect(await page.locator('//*[@id="codeValue"]').inputValue()).toBe(
|
||||
assertCode
|
||||
);
|
||||
});
|
||||
|
|
|
|||
17
src/frontend/tests/end-to-end/curl_api_generation.spec.ts
Normal file
17
src/frontend/tests/end-to-end/curl_api_generation.spec.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("curl_api_generation", async ({ page, context }) => {
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
|
||||
await page.getByRole("heading", { name: "Data Ingestion" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "cURL" }).click();
|
||||
await page.getByRole("button", { name: "Copy Code" }).click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText()
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
expect(clipboardContent.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
|
@ -1,24 +1,17 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(3000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test.describe("drag and drop test", () => {
|
||||
/// <reference lib="dom"/>
|
||||
test("drop collection", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/langflow.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
|
||||
// Read your file into a buffer.
|
||||
const jsonContent = readFileSync(
|
||||
"tests/onlyFront/assets/collection.json",
|
||||
"tests/end-to-end/assets/collection.json",
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
|
|
@ -42,9 +35,7 @@ test.describe("drag and drop test", () => {
|
|||
}
|
||||
);
|
||||
|
||||
await page
|
||||
.getByTestId("edit-flow-button-e9ac1bdc-429b-475d-ac03-d26f9a2a3210-0")
|
||||
.click();
|
||||
await page.getByText("Edit Flow").first().click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
const genericNoda = page.getByTestId("div-generic-node");
|
||||
260
src/frontend/tests/end-to-end/dropdownComponent.spec.ts
Normal file
260
src/frontend/tests/end-to-end/dropdownComponent.spec.ts
Normal file
|
|
@ -0,0 +1,260 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(4000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("dropDownComponent", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("amazon");
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page
|
||||
.getByTestId("model_specsAmazon Bedrock")
|
||||
.first()
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByTestId("dropdown-model_id-display").click();
|
||||
await page.getByTestId("ai21.j2-grande-instruct-0-option").click();
|
||||
|
||||
let value = await page.getByTestId("dropdown-model_id-display").innerText();
|
||||
if (value !== "ai21.j2-grande-instruct") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("dropdown-model_id-display").click();
|
||||
await page.getByTestId("ai21.j2-jumbo-instruct-1-option").click();
|
||||
|
||||
value = await page.getByTestId("dropdown-model_id-display").innerText();
|
||||
if (value !== "ai21.j2-jumbo-instruct") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
value = await page.getByTestId("dropdown-edit-model_id-display").innerText();
|
||||
if (value !== "ai21.j2-jumbo-instruct") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="showcache"]').click();
|
||||
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showcache"]').click();
|
||||
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showcredentials_profile_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showcredentials_profile_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showcredentials_profile_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showcredentials_profile_name"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showendpoint_url"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showendpoint_url"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showendpoint_url"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showendpoint_url"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showregion_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showregion_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showregion_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showregion_name"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showstreaming"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showstreaming"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showstreaming"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showstreaming"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showmodel_id
|
||||
await page.locator('//*[@id="showmodel_id"]').click();
|
||||
expect(await page.locator('//*[@id="showmodel_id"]').isChecked()).toBeFalsy();
|
||||
|
||||
// showmodel_id
|
||||
await page.locator('//*[@id="showmodel_id"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_id"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showcache"]').click();
|
||||
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showcache"]').click();
|
||||
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showcredentials_profile_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showcredentials_profile_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showcredentials_profile_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showcredentials_profile_name"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showendpoint_url"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showendpoint_url"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showendpoint_url"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showendpoint_url"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showregion_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showregion_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showregion_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showregion_name"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showstreaming"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showstreaming"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showstreaming"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showstreaming"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showmodel_id
|
||||
await page.locator('//*[@id="showmodel_id"]').click();
|
||||
expect(await page.locator('//*[@id="showmodel_id"]').isChecked()).toBeFalsy();
|
||||
|
||||
// showmodel_id
|
||||
await page.locator('//*[@id="showmodel_id"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_id"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.getByTestId("dropdown-edit-model_id-display").click();
|
||||
await page.getByTestId("ai21.j2-ultra-v1-5-option").click();
|
||||
|
||||
value = await page.getByTestId("dropdown-edit-model_id-display").innerText();
|
||||
if (value !== "ai21.j2-ultra-v1") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
value = await page.getByTestId("dropdown-model_id-display").innerText();
|
||||
if (value !== "ai21.j2-ultra-v1") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
await page.getByTestId("code-button-modal").click();
|
||||
await page
|
||||
.locator("#CodeEditor div")
|
||||
.filter({ hasText: "from typing import" })
|
||||
.nth(1)
|
||||
.click();
|
||||
await page.locator("textarea").press("Control+a");
|
||||
const emptyOptionsCode = `from typing import Optional
|
||||
from langchain.llms.base import BaseLLM
|
||||
from langchain_community.llms.bedrock import Bedrock
|
||||
|
||||
from langflow.interface.custom.custom_component import CustomComponent
|
||||
|
||||
|
||||
class AmazonBedrockComponent(CustomComponent):
|
||||
display_name: str = "Amazon Bedrock"
|
||||
description: str = "LLM model from Amazon Bedrock."
|
||||
icon = "Amazon"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
"model_id": {
|
||||
"display_name": "Model Id",
|
||||
"options": [],
|
||||
},
|
||||
"credentials_profile_name": {"display_name": "Credentials Profile Name"},
|
||||
"streaming": {"display_name": "Streaming", "field_type": "bool"},
|
||||
"endpoint_url": {"display_name": "Endpoint URL"},
|
||||
"region_name": {"display_name": "Region Name"},
|
||||
"model_kwargs": {"display_name": "Model Kwargs"},
|
||||
"cache": {"display_name": "Cache"},
|
||||
"code": {"advanced": True},
|
||||
}
|
||||
|
||||
def build(
|
||||
self,
|
||||
model_id: str = "anthropic.claude-instant-v1",
|
||||
credentials_profile_name: Optional[str] = None,
|
||||
region_name: Optional[str] = None,
|
||||
model_kwargs: Optional[dict] = None,
|
||||
endpoint_url: Optional[str] = None,
|
||||
streaming: bool = False,
|
||||
cache: Optional[bool] = None,
|
||||
) -> BaseLLM:
|
||||
try:
|
||||
output = Bedrock(
|
||||
credentials_profile_name=credentials_profile_name,
|
||||
model_id=model_id,
|
||||
region_name=region_name,
|
||||
model_kwargs=model_kwargs,
|
||||
endpoint_url=endpoint_url,
|
||||
streaming=streaming,
|
||||
cache=cache,
|
||||
) # type: ignore
|
||||
except Exception as e:
|
||||
raise ValueError("Could not connect to AmazonBedrock API.") from e
|
||||
return output
|
||||
|
||||
`;
|
||||
await page.locator("textarea").fill(emptyOptionsCode);
|
||||
await page.getByRole("button", { name: "Check & Save" }).click();
|
||||
await page.getByText("No parameters are available for display.").isVisible();
|
||||
});
|
||||
|
|
@ -1,29 +1,25 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(5000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("FloatComponent", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/backend_12112023.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("llamacpp");
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page
|
||||
.locator('//*[@id="llmsLlamaCpp"]')
|
||||
.locator('//*[@id="model_specsLlamaCpp"]')
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
|
@ -102,18 +98,6 @@ test("FloatComponent", async ({ page }) => {
|
|||
await page.locator('//*[@id="showmax_tokens"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showmetadata
|
||||
await page.locator('//*[@id="showmetadata"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmetadata"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showmodel_kwargs
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showmodel_path
|
||||
await page.locator('//*[@id="showmodel_path"]').click();
|
||||
expect(
|
||||
|
|
@ -271,16 +255,6 @@ test("FloatComponent", async ({ page }) => {
|
|||
await page.locator('//*[@id="showmax_tokens"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
// showmetadata
|
||||
await page.locator('//*[@id="showmetadata"]').click();
|
||||
expect(await page.locator('//*[@id="showmetadata"]').isChecked()).toBeFalsy();
|
||||
|
||||
// showmodel_kwargs
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
// showmodel_path
|
||||
await page.locator('//*[@id="showmodel_path"]').click();
|
||||
expect(
|
||||
|
|
@ -1,35 +1,32 @@
|
|||
import { Page, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(6000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
|
||||
test.describe("Flow Page tests", () => {
|
||||
async function goToFlowPage(page: Page) {
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.getByRole("button", { name: "New Project" }).click();
|
||||
}
|
||||
|
||||
test("save", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/backend_12112023.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("custom");
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page
|
||||
.locator('//*[@id="custom_componentsCustomComponent"]')
|
||||
.locator('//*[@id="helpersCustom Component"]')
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
29
src/frontend/tests/end-to-end/group.spec.ts
Normal file
29
src/frontend/tests/end-to-end/group.spec.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.describe("group node test", () => {
|
||||
/// <reference lib="dom"/>
|
||||
test("group and ungroup updating values", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
|
||||
await page.getByRole("heading", { name: "Data Ingestion" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByLabel("fit view").click();
|
||||
await page.keyboard.down("Control");
|
||||
await page
|
||||
.getByTestId("title-OpenAIEmbeddings")
|
||||
.click({ modifiers: ["Control"] });
|
||||
await page.getByTestId("title-URL").click({ modifiers: ["Control"] });
|
||||
await page
|
||||
.getByTestId("title-Recursive Character Text Splitter")
|
||||
.click({ modifiers: ["Control"] });
|
||||
await page.keyboard.up("Control");
|
||||
await page.getByRole("button", { name: "Group" }).click();
|
||||
await page.getByTestId(/input-collection_name_Chroma-.*/).click();
|
||||
await page.getByTestId(/input-collection_name_Chroma-.*/).fill("test");
|
||||
await page.getByTestId("title-Group").click();
|
||||
await page.keyboard.press("Control+g");
|
||||
const value = await page.getByTestId("input-collection_name").inputValue();
|
||||
expect(value).toBe("test");
|
||||
});
|
||||
});
|
||||
|
|
@ -1,22 +1,18 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(8000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("InputComponent", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/langflow.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("Chroma");
|
||||
|
||||
|
|
@ -28,12 +24,12 @@ test("InputComponent", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.locator("#input-8").click();
|
||||
await page.getByTestId("input-collection_name").click();
|
||||
await page
|
||||
.locator("#input-8")
|
||||
.getByTestId("input-collection_name")
|
||||
.fill("collection_name_test_123123123!@#$&*(&%$@");
|
||||
|
||||
let value = await page.locator("#input-8").inputValue();
|
||||
let value = await page.getByTestId("input-collection_name").inputValue();
|
||||
|
||||
if (value != "collection_name_test_123123123!@#$&*(&%$@") {
|
||||
expect(false).toBeTruthy();
|
||||
|
|
@ -61,9 +57,9 @@ test("InputComponent", async ({ page }) => {
|
|||
await page.locator('//*[@id="showchroma_server_host"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showchroma_server_http_port"]').click();
|
||||
await page.locator('//*[@id="showchroma_server_port"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showchroma_server_http_port"]').isChecked()
|
||||
await page.locator('//*[@id="showchroma_server_port"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showchroma_server_ssl_enabled"]').click();
|
||||
|
|
@ -76,19 +72,11 @@ test("InputComponent", async ({ page }) => {
|
|||
await page.locator('//*[@id="showcollection_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showpersist"]').click();
|
||||
expect(await page.locator('//*[@id="showpersist"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showpersist_directory"]').click();
|
||||
await page.locator('//*[@id="showindex_directory"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showpersist_directory"]').isChecked()
|
||||
await page.locator('//*[@id="showindex_directory"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showchroma_server_cors_allow_origins"]').click();
|
||||
expect(
|
||||
await page
|
||||
|
|
@ -106,9 +94,9 @@ test("InputComponent", async ({ page }) => {
|
|||
await page.locator('//*[@id="showchroma_server_host"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showchroma_server_http_port"]').click();
|
||||
await page.locator('//*[@id="showchroma_server_port"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showchroma_server_http_port"]').isChecked()
|
||||
await page.locator('//*[@id="showchroma_server_port"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showchroma_server_ssl_enabled"]').click();
|
||||
|
|
@ -116,33 +104,27 @@ test("InputComponent", async ({ page }) => {
|
|||
await page.locator('//*[@id="showchroma_server_ssl_enabled"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showpersist"]').click();
|
||||
expect(await page.locator('//*[@id="showpersist"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showpersist_directory"]').click();
|
||||
await page.locator('//*[@id="showindex_directory"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showpersist_directory"]').isChecked()
|
||||
await page.locator('//*[@id="showindex_directory"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
let valueEditNode = await page.locator('//*[@id="input-5"]').inputValue();
|
||||
let valueEditNode = await page
|
||||
.getByTestId("input-collection_name-edit")
|
||||
.inputValue();
|
||||
|
||||
if (valueEditNode != "collection_name_test_123123123!@#$&*(&%$@") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="input-5"]').click();
|
||||
await page.getByTestId("input-collection_name-edit").click();
|
||||
await page
|
||||
.locator('//*[@id="input-5"]')
|
||||
.fill("NEW_collection_name_test_123123123!@#$&*(&%$@");
|
||||
.getByTestId("input-collection_name-edit")
|
||||
.fill("NEW_collection_name_test_123123123!@#$&*(&%$@ÇÇÇÀõe");
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
const plusButtonLocator = page.locator("#input-8");
|
||||
const plusButtonLocator = page.getByTestId("input-collection_name");
|
||||
const elementCount = await plusButtonLocator.count();
|
||||
if (elementCount === 0) {
|
||||
expect(true).toBeTruthy();
|
||||
|
|
@ -159,9 +141,9 @@ test("InputComponent", async ({ page }) => {
|
|||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
let value = await page.locator("#input-8").inputValue();
|
||||
let value = await page.getByTestId("input-collection_name").inputValue();
|
||||
|
||||
if (value != "NEW_collection_name_test_123123123!@#$&*(&%$@") {
|
||||
if (value != "NEW_collection_name_test_123123123!@#$&*(&%$@ÇÇÇÀõe") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
}
|
||||
203
src/frontend/tests/end-to-end/intComponent.spec.ts
Normal file
203
src/frontend/tests/end-to-end/intComponent.spec.ts
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(9000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("IntComponent", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page
|
||||
.getByTestId("modelsOpenAI")
|
||||
.first()
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByTestId("int-input-max_tokens").click();
|
||||
await page
|
||||
.getByTestId("int-input-max_tokens")
|
||||
.fill("123456789123456789123456789");
|
||||
|
||||
let value = await page.getByTestId("int-input-max_tokens").inputValue();
|
||||
|
||||
if (value != "123456789123456789123456789") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("int-input-max_tokens").click();
|
||||
await page.getByTestId("int-input-max_tokens").fill("0");
|
||||
|
||||
value = await page.getByTestId("int-input-max_tokens").inputValue();
|
||||
|
||||
if (value != "0") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
value = await page.getByTestId("edit-int-input-max_tokens").inputValue();
|
||||
|
||||
if (value != "0") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("edit-int-input-max_tokens").click();
|
||||
await page
|
||||
.getByTestId("edit-int-input-max_tokens")
|
||||
.fill("123456789123456789123456789");
|
||||
|
||||
await page.locator('//*[@id="showinput_value"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showinput_value"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_base"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_base"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_key"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_key"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showstream"]').click();
|
||||
expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showtemperature"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtemperature"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showinput_value"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showinput_value"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_name"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_base"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_base"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_key"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_key"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showstream"]').click();
|
||||
expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showtemperature"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtemperature"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showinput_value"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showinput_value"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showmodel_name"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_base"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_base"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showopenai_api_key"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showopenai_api_key"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showstream"]').click();
|
||||
expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showtemperature"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtemperature"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
const plusButtonLocator = page.getByTestId("int-input-max_tokens");
|
||||
const elementCount = await plusButtonLocator.count();
|
||||
if (elementCount === 0) {
|
||||
expect(true).toBeTruthy();
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
await page.locator('//*[@id="showtimeout"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtimeout"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
const valueEditNode = await page
|
||||
.getByTestId("edit-int-input-max_tokens")
|
||||
.inputValue();
|
||||
|
||||
if (valueEditNode != "123456789123456789123456789") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
await page.getByTestId("int-input-max_tokens").click();
|
||||
await page.getByTestId("int-input-max_tokens").fill("3");
|
||||
|
||||
let value = await page.getByTestId("int-input-max_tokens").inputValue();
|
||||
|
||||
if (value != "3") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("int-input-max_tokens").click();
|
||||
await page.getByTestId("int-input-max_tokens").fill("-3");
|
||||
|
||||
value = await page.getByTestId("int-input-max_tokens").inputValue();
|
||||
|
||||
if (value != "0") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -1,22 +1,18 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(20000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("KeypairListComponent", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/backend_12112023.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("csv");
|
||||
|
||||
|
|
@ -51,32 +47,14 @@ test("KeypairListComponent", async ({ page }) => {
|
|||
}
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
await page.locator('//*[@id="keypair1"]').click();
|
||||
await page.locator('//*[@id="keypair1"]').fill("testtesttesttest1");
|
||||
await page.locator('//*[@id="keypair0"]').click();
|
||||
await page.locator('//*[@id="keypair0"]').fill("testtesttesttest1");
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
await page.locator('//*[@id="keypair101"]').click();
|
||||
await page.locator('//*[@id="keypair101"]').fill("testtesttesttesttesttest1");
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
await page.locator('//*[@id="plusbtn1"]').click();
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
await page.locator('//*[@id="keypair2"]').click();
|
||||
await page.locator('//*[@id="keypair2"]').fill("testtesttesttest2");
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
await page.locator('//*[@id="keypair102"]').click();
|
||||
await page.locator('//*[@id="keypair102"]').fill("testtesttesttesttesttest2");
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
await page.locator('//*[@id="minusbtn1"]').click();
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
const keyPairVerification = page.locator('//*[@id="keypair102"]');
|
||||
const keyPairVerification = page.locator('//*[@id="keypair100"]');
|
||||
const elementKeyCount = await keyPairVerification.count();
|
||||
|
||||
if (elementKeyCount === 0) {
|
||||
if (elementKeyCount === 1) {
|
||||
expect(true).toBeTruthy();
|
||||
} else {
|
||||
expect(false).toBeTruthy();
|
||||
|
|
@ -113,53 +91,22 @@ test("KeypairListComponent", async ({ page }) => {
|
|||
|
||||
await page.locator('//*[@id="editNodekeypair0"]').click();
|
||||
await page.locator('//*[@id="editNodekeypair0"]').fill("testtesttesttest");
|
||||
await page.locator('//*[@id="editNodekeypair100"]').click();
|
||||
await page
|
||||
.locator('//*[@id="editNodekeypair100"]')
|
||||
.fill("test test test test test test");
|
||||
|
||||
const plusButtonLocator = page.locator('//*[@id="plusbtn0"]');
|
||||
const elementCount = await plusButtonLocator.count();
|
||||
if (elementCount > 0) {
|
||||
await plusButtonLocator.click();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="editNodekeypair1"]').click();
|
||||
await page.locator('//*[@id="editNodekeypair1"]').fill("testtesttesttest1");
|
||||
await page.locator('//*[@id="editNodekeypair101"]').first().click();
|
||||
await page
|
||||
.locator('//*[@id="editNodekeypair101"]')
|
||||
.fill("testtesttesttesttesttest1");
|
||||
await page.locator('//*[@id="editNodeplusbtn1"]').click();
|
||||
|
||||
await page.locator('//*[@id="editNodekeypair2"]').click();
|
||||
await page.locator('//*[@id="editNodekeypair2"]').fill("testtesttesttest2");
|
||||
await page.locator('//*[@id="editNodekeypair102"]').click();
|
||||
await page
|
||||
.locator('//*[@id="editNodekeypair102"]')
|
||||
.fill("testtesttesttesttesttest2");
|
||||
|
||||
await page.locator('//*[@id="editNodeminusbtn1"]').click();
|
||||
|
||||
const keyPairVerification = page.locator('//*[@id="editNodekeypair102"]');
|
||||
const keyPairVerification = page.locator('//*[@id="editNodekeypair0"]');
|
||||
const elementKeyCount = await keyPairVerification.count();
|
||||
|
||||
if (elementKeyCount === 0) {
|
||||
if (elementKeyCount === 1) {
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
const key1 = await page.locator('//*[@id="keypair0"]').inputValue();
|
||||
const value1 = await page.locator('//*[@id="keypair100"]').inputValue();
|
||||
const key2 = await page.locator('//*[@id="keypair1"]').inputValue();
|
||||
const value2 = await page.locator('//*[@id="keypair101"]').inputValue();
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
if (
|
||||
key1 === "testtesttesttest" &&
|
||||
value1 === "test test test test test test" &&
|
||||
key2 === "testtesttesttest2" &&
|
||||
value2 === "testtesttesttesttesttest2"
|
||||
value1 === "test test test test test test"
|
||||
) {
|
||||
expect(true).toBeTruthy();
|
||||
} else {
|
||||
90
src/frontend/tests/end-to-end/langflowShortcuts.spec.ts
Normal file
90
src/frontend/tests/end-to-end/langflowShortcuts.spec.ts
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import uaParser from "ua-parser-js";
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(11000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("LangflowShortcuts", async ({ page }) => {
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
let control = "Control";
|
||||
|
||||
if (userAgentInfo.os.name.includes("Mac")) {
|
||||
control = "Meta";
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("llamacpp");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.locator('//*[@id="model_specsLlamaCpp"]')
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByTestId("title-LlamaCpp").click();
|
||||
await page.keyboard.press(`${control}+e`);
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
await page.getByTestId("title-LlamaCpp").click();
|
||||
await page.keyboard.press(`${control}+d`);
|
||||
|
||||
let numberOfNodes = await page.getByTestId("title-LlamaCpp").count();
|
||||
if (numberOfNodes != 2) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div[2]/div/div[1]/div/div[1]/div/div/div[1]'
|
||||
)
|
||||
.click();
|
||||
await page.keyboard.press("Backspace");
|
||||
|
||||
numberOfNodes = await page.getByTestId("title-LlamaCpp").count();
|
||||
if (numberOfNodes != 1) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("title-LlamaCpp").click();
|
||||
await page.keyboard.press(`${control}+c`);
|
||||
|
||||
await page.getByTestId("title-LlamaCpp").click();
|
||||
await page.keyboard.press(`${control}+v`);
|
||||
|
||||
numberOfNodes = await page.getByTestId("title-LlamaCpp").count();
|
||||
if (numberOfNodes != 2) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page
|
||||
.locator(
|
||||
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div[2]/div/div[1]/div/div[1]/div/div/div[1]'
|
||||
)
|
||||
.click();
|
||||
await page.keyboard.press("Backspace");
|
||||
|
||||
await page.getByTestId("title-LlamaCpp").click();
|
||||
await page.keyboard.press(`${control}+x`);
|
||||
|
||||
numberOfNodes = await page.getByTestId("title-LlamaCpp").count();
|
||||
if (numberOfNodes != 0) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
await page.keyboard.press(`${control}+v`);
|
||||
numberOfNodes = await page.getByTestId("title-LlamaCpp").count();
|
||||
if (numberOfNodes != 1) {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
});
|
||||
|
|
@ -1,22 +1,18 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(12000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("NestedComponent", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/backend_12112023.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("pinecone");
|
||||
|
||||
|
|
@ -31,75 +27,17 @@ test("NestedComponent", async ({ page }) => {
|
|||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
// showindex_name
|
||||
await page.locator('//*[@id="showindex_name"]').click();
|
||||
//showpool_threads
|
||||
await page.locator('//*[@id="showpool_threads"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showindex_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
// shownamespace
|
||||
await page.locator('//*[@id="shownamespace"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="shownamespace"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
// showpinecone_api_key
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
|
||||
await page.locator('//*[@id="showpool_threads"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showpinecone_env
|
||||
await page.locator('//*[@id="showpinecone_env"]').click();
|
||||
//showtext_key
|
||||
await page.locator('//*[@id="showtext_key"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_env"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showsearch_kwargs
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showindex_name
|
||||
await page.locator('//*[@id="showindex_name"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showindex_name"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// shownamespace
|
||||
await page.locator('//*[@id="shownamespace"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="shownamespace"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showpinecone_api_key
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
// showpinecone_env
|
||||
await page.locator('//*[@id="showpinecone_env"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_env"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
// showsearch_kwargs
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').isChecked()
|
||||
).toBeFalsy();
|
||||
expect(await page.locator('//*[@id="showtext_key"]').isChecked()).toBeFalsy();
|
||||
|
||||
// showindex_name
|
||||
await page.locator('//*[@id="showindex_name"]').click();
|
||||
|
|
@ -120,21 +58,14 @@ test("NestedComponent", async ({ page }) => {
|
|||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
|
||||
).toBeTruthy();
|
||||
).toBeFalsy();
|
||||
|
||||
// showpinecone_env
|
||||
await page.locator('//*[@id="showpinecone_env"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_env"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showsearch_kwargs
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
).toBeFalsy();
|
||||
|
||||
// showindex_name
|
||||
await page.locator('//*[@id="showindex_name"]').click();
|
||||
|
|
@ -155,21 +86,14 @@ test("NestedComponent", async ({ page }) => {
|
|||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
|
||||
).toBeFalsy();
|
||||
).toBeTruthy();
|
||||
|
||||
// showpinecone_env
|
||||
await page.locator('//*[@id="showpinecone_env"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_env"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
// showsearch_kwargs
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').isChecked()
|
||||
).toBeFalsy();
|
||||
).toBeTruthy();
|
||||
|
||||
// showindex_name
|
||||
await page.locator('//*[@id="showindex_name"]').click();
|
||||
|
|
@ -190,21 +114,14 @@ test("NestedComponent", async ({ page }) => {
|
|||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
|
||||
).toBeTruthy();
|
||||
).toBeFalsy();
|
||||
|
||||
// showpinecone_env
|
||||
await page.locator('//*[@id="showpinecone_env"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_env"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showsearch_kwargs
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showsearch_kwargs"]').isChecked()
|
||||
).toBeTruthy();
|
||||
).toBeFalsy();
|
||||
|
||||
// showindex_name
|
||||
await page.locator('//*[@id="showindex_name"]').click();
|
||||
|
|
@ -223,6 +140,34 @@ test("NestedComponent", async ({ page }) => {
|
|||
// showpinecone_api_key
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showpinecone_env
|
||||
await page.locator('//*[@id="showpinecone_env"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_env"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showindex_name
|
||||
await page.locator('//*[@id="showindex_name"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showindex_name"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
// shownamespace
|
||||
await page.locator('//*[@id="shownamespace"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="shownamespace"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
// showpinecone_api_key
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
|
@ -234,7 +179,47 @@ test("NestedComponent", async ({ page }) => {
|
|||
await page.locator('//*[@id="showpinecone_env"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
// showindex_name
|
||||
await page.locator('//*[@id="showindex_name"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showindex_name"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// shownamespace
|
||||
await page.locator('//*[@id="shownamespace"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="shownamespace"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showpinecone_api_key
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showpinecone_env
|
||||
await page.locator('//*[@id="showpinecone_env"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpinecone_env"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
//showpool_threads
|
||||
await page.locator('//*[@id="showpool_threads"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showpool_threads"]').isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
//showtext_key
|
||||
await page.locator('//*[@id="showtext_key"]').click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="showtext_key"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
await page.getByTestId("div-dict-input").click();
|
||||
});
|
||||
|
|
@ -1,32 +1,40 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(13000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("PromptTemplateComponent", async ({ page }) => {
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("promptTemplate");
|
||||
await page.getByPlaceholder("Search").fill("prompt");
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page
|
||||
.locator('//*[@id="promptsPromptTemplate"]')
|
||||
.locator('//*[@id="inputsPrompt"]')
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByTestId("prompt-input-0").click();
|
||||
await page.getByTestId("prompt-input-template").click();
|
||||
|
||||
// await page.getByTestId("edit-prompt-sanitized").click();
|
||||
// await page.getByTestId("modal-title").click();
|
||||
await page
|
||||
.getByTestId("modal-prompt-input-0")
|
||||
.getByTestId("modal-prompt-input-template")
|
||||
.fill("{prompt} example {prompt1}");
|
||||
|
||||
let value = await page.getByTestId("modal-prompt-input-0").inputValue();
|
||||
let value = await page
|
||||
.getByTestId("modal-prompt-input-template")
|
||||
.inputValue();
|
||||
|
||||
if (value != "{prompt} example {prompt1}") {
|
||||
expect(false).toBeTruthy();
|
||||
|
|
@ -45,35 +53,38 @@ test("PromptTemplateComponent", async ({ page }) => {
|
|||
await page.getByTestId("genericModalBtnSave").click();
|
||||
|
||||
await page.getByTestId("div-textarea-prompt").click();
|
||||
await page.getByTestId("text-area-modal").fill("prompt_value_!@#!@#");
|
||||
await page.getByTestId("textarea-prompt").fill("prompt_value_!@#!@#");
|
||||
|
||||
value = await page.getByTestId("text-area-modal").inputValue();
|
||||
value = await page.getByTestId("textarea-prompt").inputValue();
|
||||
|
||||
if (value != "prompt_value_!@#!@#") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("genericModalBtnSave").click();
|
||||
await page.getByTestId("save-button-modal").click();
|
||||
|
||||
const replace = await page.getByTestId("replace-button");
|
||||
if (replace) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
|
||||
await page.getByTestId("div-textarea-prompt1").click();
|
||||
await page
|
||||
.getByTestId("text-area-modal")
|
||||
.getByTestId("textarea-prompt1")
|
||||
.fill("prompt_name_test_123123!@#!@#");
|
||||
|
||||
value = await page.getByTestId("text-area-modal").inputValue();
|
||||
value = await page.getByTestId("textarea-prompt1").inputValue();
|
||||
|
||||
if (value != "prompt_name_test_123123!@#!@#") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
value = await page.getByTestId("text-area-modal").inputValue();
|
||||
value = await page.getByTestId("textarea-prompt1").inputValue();
|
||||
|
||||
if (value != "prompt_name_test_123123!@#!@#") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("genericModalBtnSave").click();
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
|
|
|
|||
17
src/frontend/tests/end-to-end/python_api_generation.spec.ts
Normal file
17
src/frontend/tests/end-to-end/python_api_generation.spec.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("python_api_generation", async ({ page, context }) => {
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
|
||||
await page.getByRole("heading", { name: "Data Ingestion" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "Python API" }).click();
|
||||
await page.getByRole("button", { name: "Copy Code" }).click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText()
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
expect(clipboardContent.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
import { Page, expect, test } from "@playwright/test";
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(14000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test.describe("save component tests", () => {
|
||||
async function saveComponent(page: Page, pattern: RegExp, n: number) {
|
||||
for (let i = 0; i < n; i++) {
|
||||
|
|
@ -11,22 +14,15 @@ test.describe("save component tests", () => {
|
|||
|
||||
/// <reference lib="dom"/>
|
||||
test("save group component tests", async ({ page }) => {
|
||||
//make front work withoput backend
|
||||
await page.routeFromHAR("harFiles/langflow.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
// Read your file into a buffer.
|
||||
const jsonContent = readFileSync(
|
||||
"tests/onlyFront/assets/collection.json",
|
||||
"tests/end-to-end/assets/flow_group_test.json",
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
|
|
@ -34,32 +30,32 @@ test.describe("save component tests", () => {
|
|||
const dataTransfer = await page.evaluateHandle((data) => {
|
||||
const dt = new DataTransfer();
|
||||
// Convert the buffer to a hex array
|
||||
const file = new File([data], "flowtest.json", {
|
||||
const file = new File([data], "flow_group_test.json", {
|
||||
type: "application/json",
|
||||
});
|
||||
dt.items.add(file);
|
||||
return dt;
|
||||
}, jsonContent);
|
||||
|
||||
page.waitForTimeout(2000);
|
||||
|
||||
// Now dispatch
|
||||
await page.dispatchEvent(
|
||||
'//*[@id="root"]/div/div[1]/div[2]/div[3]/div/div',
|
||||
"//*[@id='react-flow-id']/div[1]/div[1]/div",
|
||||
"drop",
|
||||
{
|
||||
dataTransfer,
|
||||
}
|
||||
);
|
||||
|
||||
await page
|
||||
.getByTestId("edit-flow-button-e9ac1bdc-429b-475d-ac03-d26f9a2a3210-0")
|
||||
.click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
const genericNoda = page.getByTestId("div-generic-node");
|
||||
const elementCount = await genericNoda.count();
|
||||
if (elementCount > 0) {
|
||||
expect(true).toBeTruthy();
|
||||
}
|
||||
await page
|
||||
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[3]')
|
||||
.click();
|
||||
|
||||
await page.getByTestId("title-PythonFunctionTool").click({
|
||||
modifiers: ["Control"],
|
||||
|
|
@ -68,7 +64,7 @@ test.describe("save component tests", () => {
|
|||
modifiers: ["Control"],
|
||||
});
|
||||
|
||||
await page.getByTestId("title-AgentInitializer").click({
|
||||
await page.getByTestId("title-Agent Initializer").click({
|
||||
modifiers: ["Control"],
|
||||
});
|
||||
|
||||
|
|
@ -87,9 +83,13 @@ test.describe("save component tests", () => {
|
|||
}
|
||||
|
||||
await page.getByTestId("title-Group").click();
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("save-button-modal").click();
|
||||
await page.getByTestId("delete-button-modal").click();
|
||||
await page.getByTestId("icon-SaveAll").click();
|
||||
|
||||
const replaceButton = page.getByTestId("replace-button");
|
||||
|
||||
if (replaceButton) {
|
||||
await replaceButton.click();
|
||||
}
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("group");
|
||||
|
|
@ -1,22 +1,18 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// await page.waitForTimeout(15000);
|
||||
// test.setTimeout(120000);
|
||||
});
|
||||
test("ToggleComponent", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/langflow.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("directoryLoader");
|
||||
|
||||
|
|
@ -38,29 +34,27 @@ test("ToggleComponent", async ({ page }) => {
|
|||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
await page.locator('//*[@id="toggle-1"]').click();
|
||||
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeFalsy();
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
expect(await page.getByTestId("toggle-load_hidden").isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="toggle-1"]').click();
|
||||
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeTruthy();
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
expect(await page.getByTestId("toggle-load_hidden").isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="toggle-1"]').click();
|
||||
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeFalsy();
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
expect(await page.getByTestId("toggle-load_hidden").isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="toggle-1"]').click();
|
||||
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeTruthy();
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
expect(await page.getByTestId("toggle-load_hidden").isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="toggle-1"]').click();
|
||||
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeFalsy();
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
expect(await page.getByTestId("toggle-load_hidden").isChecked()).toBeFalsy();
|
||||
|
||||
await page.getByTestId("div-generic-node").click();
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="toggle-edit-1"]').isChecked()
|
||||
).toBeFalsy();
|
||||
expect(await page.getByTestId("toggle-load_hidden").isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showglob"]').click();
|
||||
expect(await page.locator('//*[@id="showglob"]').isChecked()).toBeFalsy();
|
||||
|
|
@ -129,7 +123,7 @@ test("ToggleComponent", async ({ page }) => {
|
|||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
const plusButtonLocator = page.locator('//*[@id="toggle-1"]');
|
||||
const plusButtonLocator = page.getByTestId("toggle-load_hidden");
|
||||
const elementCount = await plusButtonLocator.count();
|
||||
if (elementCount === 0) {
|
||||
expect(true).toBeTruthy();
|
||||
|
|
@ -145,24 +139,34 @@ test("ToggleComponent", async ({ page }) => {
|
|||
).toBeTruthy();
|
||||
|
||||
expect(
|
||||
await page.locator('//*[@id="toggle-edit-1"]').isChecked()
|
||||
await page.getByTestId("toggle-edit-load_hidden").isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
await page.locator('//*[@id="toggle-1"]').click();
|
||||
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeTruthy();
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
expect(
|
||||
await page.getByTestId("toggle-load_hidden").isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="toggle-1"]').click();
|
||||
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeFalsy();
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
expect(
|
||||
await page.getByTestId("toggle-load_hidden").isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="toggle-1"]').click();
|
||||
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeTruthy();
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
expect(
|
||||
await page.getByTestId("toggle-load_hidden").isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="toggle-1"]').click();
|
||||
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeFalsy();
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
expect(
|
||||
await page.getByTestId("toggle-load_hidden").isChecked()
|
||||
).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="toggle-1"]').click();
|
||||
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeTruthy();
|
||||
await page.getByTestId("toggle-load_hidden").click();
|
||||
expect(
|
||||
await page.getByTestId("toggle-load_hidden").isChecked()
|
||||
).toBeTruthy();
|
||||
}
|
||||
});
|
||||
38
src/frontend/tests/end-to-end/tweaks_test.spec.ts
Normal file
38
src/frontend/tests/end-to-end/tweaks_test.spec.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("curl_api_generation", async ({ page, context }) => {
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
|
||||
await page.getByRole("heading", { name: "Data Ingestion" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
await page.getByRole("tab", { name: "cURL" }).click();
|
||||
await page.getByRole("button", { name: "Copy Code" }).click();
|
||||
const handle = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText()
|
||||
);
|
||||
const clipboardContent = await handle.jsonValue();
|
||||
const oldValue = clipboardContent;
|
||||
expect(clipboardContent.length).toBeGreaterThan(0);
|
||||
await page.getByRole("tab", { name: "Tweaks" }).click();
|
||||
await page
|
||||
.getByRole("heading", { name: "URL" })
|
||||
.locator("div")
|
||||
.first()
|
||||
.click();
|
||||
await page.getByRole("textbox", { name: "Type something..." }).click();
|
||||
await page
|
||||
.getByRole("textbox", { name: "Type something..." })
|
||||
.press("Control+a");
|
||||
await page.getByRole("textbox", { name: "Type something..." }).fill("teste");
|
||||
await page.getByRole("tab", { name: "cURL" }).click();
|
||||
await page.getByRole("button", { name: "Copy Code" }).click();
|
||||
const handle2 = await page.evaluateHandle(() =>
|
||||
navigator.clipboard.readText()
|
||||
);
|
||||
const clipboardContent2 = await handle2.jsonValue();
|
||||
const newValue = clipboardContent2;
|
||||
expect(oldValue).not.toBe(newValue);
|
||||
expect(clipboardContent2.length).toBeGreaterThan(clipboardContent.length);
|
||||
});
|
||||
25
src/frontend/tests/globalTeardown.ts
Normal file
25
src/frontend/tests/globalTeardown.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// tests/globalTeardown.ts
|
||||
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
export default async () => {
|
||||
try {
|
||||
console.log("Removing the temp database");
|
||||
// Check if the file exists in the path
|
||||
// this file is in src/frontend/tests/globalTeardown.ts
|
||||
// temp is in src/frontend/temp
|
||||
const tempDbPath = path.join(__dirname, "..", "temp");
|
||||
console.log("tempDbPath", tempDbPath);
|
||||
// Remove the temp database
|
||||
fs.rmSync(tempDbPath);
|
||||
// Check if the file is removed
|
||||
if (!fs.existsSync(tempDbPath)) {
|
||||
console.log("Successfully removed the temp database");
|
||||
} else {
|
||||
console.error("Error while removing the temp database");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error while removing the temp database:", error);
|
||||
}
|
||||
};
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("dropDownComponent", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/backend_12112023.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("amazon");
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page
|
||||
.getByTestId("llmsAmazon Bedrock")
|
||||
.first()
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByTestId("dropdown-2-display").click();
|
||||
await page.getByTestId("ai21.j2-grande-instruct-0-option").click();
|
||||
|
||||
let value = await page.getByTestId("dropdown-2-display").innerText();
|
||||
if (value !== "ai21.j2-grande-instruct") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("dropdown-2-display").click();
|
||||
await page.getByTestId("ai21.j2-jumbo-instruct-1-option").click();
|
||||
|
||||
value = await page.getByTestId("dropdown-2-display").innerText();
|
||||
if (value !== "ai21.j2-jumbo-instruct") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
value = await page.getByTestId("dropdown-edit-1-display").innerText();
|
||||
if (value !== "ai21.j2-jumbo-instruct") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
// showcode
|
||||
await page.locator('//*[@id="showcode"]').click();
|
||||
expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy();
|
||||
|
||||
// showmodel_id
|
||||
await page.locator('//*[@id="showmodel_id"]').click();
|
||||
expect(await page.locator('//*[@id="showmodel_id"]').isChecked()).toBeFalsy();
|
||||
|
||||
// showcode
|
||||
await page.locator('//*[@id="showcode"]').click();
|
||||
expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy();
|
||||
|
||||
// showmodel_id
|
||||
await page.locator('//*[@id="showmodel_id"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_id"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
// showcode
|
||||
await page.locator('//*[@id="showcode"]').click();
|
||||
expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy();
|
||||
|
||||
// showmodel_id
|
||||
await page.locator('//*[@id="showmodel_id"]').click();
|
||||
expect(await page.locator('//*[@id="showmodel_id"]').isChecked()).toBeFalsy();
|
||||
|
||||
// showcode
|
||||
await page.locator('//*[@id="showcode"]').click();
|
||||
expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy();
|
||||
|
||||
// showmodel_id
|
||||
await page.locator('//*[@id="showmodel_id"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showmodel_id"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
await page.getByTestId("dropdown-edit-1-display").click();
|
||||
await page.getByTestId("ai21.j2-ultra-v1-5-option").click();
|
||||
|
||||
value = await page.getByTestId("dropdown-edit-1-display").innerText();
|
||||
if (value !== "ai21.j2-ultra-v1") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
value = await page.getByTestId("dropdown-2-display").innerText();
|
||||
if (value !== "ai21.j2-ultra-v1") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
});
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
test.describe("group node test", () => {
|
||||
/// <reference lib="dom"/>
|
||||
test("group and ungroup updating values", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/langflow.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
|
||||
// Read your file into a buffer.
|
||||
const jsonContent = readFileSync(
|
||||
"tests/onlyFront/assets/collection.json",
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
// Create the DataTransfer and File
|
||||
const dataTransfer = await page.evaluateHandle((data) => {
|
||||
const dt = new DataTransfer();
|
||||
// Convert the buffer to a hex array
|
||||
const file = new File([data], "flowtest.json", {
|
||||
type: "application/json",
|
||||
});
|
||||
dt.items.add(file);
|
||||
return dt;
|
||||
}, jsonContent);
|
||||
|
||||
page.waitForTimeout(2000);
|
||||
|
||||
await page.dispatchEvent(
|
||||
'//*[@id="root"]/div/div[1]/div[2]/div[3]/div/div',
|
||||
"drop",
|
||||
{
|
||||
dataTransfer,
|
||||
}
|
||||
);
|
||||
|
||||
await page
|
||||
.getByTestId("edit-flow-button-e9ac1bdc-429b-475d-ac03-d26f9a2a3210-0")
|
||||
.click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
const genericNoda = page.getByTestId("div-generic-node");
|
||||
const elementCount = await genericNoda.count();
|
||||
if (elementCount > 0) {
|
||||
expect(true).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("title-PythonFunctionTool").click({
|
||||
modifiers: ["Control"],
|
||||
});
|
||||
await page.getByTestId("title-ChatOpenAI").click({
|
||||
modifiers: ["Control"],
|
||||
});
|
||||
|
||||
await page.getByTestId("title-AgentInitializer").click({
|
||||
modifiers: ["Control"],
|
||||
});
|
||||
|
||||
await page.getByRole("button", { name: "Group" }).click();
|
||||
|
||||
const textArea = page.getByTestId("div-textarea-description");
|
||||
const elementCountText = await textArea.count();
|
||||
if (elementCountText > 0) {
|
||||
expect(true).toBeTruthy();
|
||||
}
|
||||
|
||||
const groupNode = page.getByTestId("title-Group");
|
||||
const elementGroup = await groupNode.count();
|
||||
if (elementGroup > 0) {
|
||||
expect(true).toBeTruthy();
|
||||
}
|
||||
|
||||
// Now dispatch
|
||||
});
|
||||
});
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("IntComponent", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/backend_12112023.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.route("**/api/v1/flows/", async (route) => {
|
||||
const json = {
|
||||
id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
};
|
||||
await route.fulfill({ json, status: 201 });
|
||||
});
|
||||
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("getrequest");
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page
|
||||
.getByTestId("utilitiesGET Request")
|
||||
.first()
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.locator('//*[@id="int-input-2"]').click();
|
||||
await page
|
||||
.locator('//*[@id="int-input-2"]')
|
||||
.fill("123456789123456789123456789");
|
||||
|
||||
let value = await page.locator('//*[@id="int-input-2"]').inputValue();
|
||||
|
||||
if (value != "123456789123456789123456789") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="int-input-2"]').click();
|
||||
await page.locator('//*[@id="int-input-2"]').fill("0");
|
||||
|
||||
value = await page.locator('//*[@id="int-input-2"]').inputValue();
|
||||
|
||||
if (value != "0") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
value = await page.locator('//*[@id="edit-int-input-2"]').inputValue();
|
||||
|
||||
if (value != "0") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="edit-int-input-2"]').click();
|
||||
await page
|
||||
.locator('//*[@id="edit-int-input-2"]')
|
||||
.fill("123456789123456789123456789");
|
||||
|
||||
await page.locator('//*[@id="showheaders"]').click();
|
||||
expect(await page.locator('//*[@id="showheaders"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showtimeout"]').click();
|
||||
expect(await page.locator('//*[@id="showtimeout"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showurl"]').click();
|
||||
expect(await page.locator('//*[@id="showurl"]').isChecked()).toBeFalsy();
|
||||
|
||||
await page.locator('//*[@id="showheaders"]').click();
|
||||
expect(await page.locator('//*[@id="showheaders"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="showurl"]').click();
|
||||
expect(await page.locator('//*[@id="showurl"]').isChecked()).toBeTruthy();
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
|
||||
const plusButtonLocator = page.locator('//*[@id="int-input-2"]');
|
||||
const elementCount = await plusButtonLocator.count();
|
||||
if (elementCount === 0) {
|
||||
expect(true).toBeTruthy();
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
await page.locator('//*[@id="showtimeout"]').click();
|
||||
expect(
|
||||
await page.locator('//*[@id="showtimeout"]').isChecked()
|
||||
).toBeTruthy();
|
||||
|
||||
const valueEditNode = await page
|
||||
.locator('//*[@id="edit-int-input-2"]')
|
||||
.inputValue();
|
||||
|
||||
if (valueEditNode != "123456789123456789123456789") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||
await page.locator('//*[@id="int-input-2"]').click();
|
||||
await page.locator('//*[@id="int-input-2"]').fill("3");
|
||||
|
||||
let value = await page.locator('//*[@id="int-input-2"]').inputValue();
|
||||
|
||||
if (value != "3") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
|
||||
await page.locator('//*[@id="int-input-2"]').click();
|
||||
await page.locator('//*[@id="int-input-2"]').fill("-3");
|
||||
|
||||
value = await page.locator('//*[@id="int-input-2"]').inputValue();
|
||||
|
||||
if (value != "0") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
import { test } from "@playwright/test";
|
||||
|
||||
test.describe("Login Tests", () => {
|
||||
test("Login_Success", async ({ page }) => {
|
||||
// await page.route("**/api/v1/login", async (route) => {
|
||||
// const json = {
|
||||
// access_token:
|
||||
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhMWNlM2FkOS1iZTE2LTRiNjgtOGRhYi1hYjA4YTVjMmZjZTkiLCJleHAiOjE2OTUyNTIwNTh9.MBYFwMhTcZnsW_L7p4qavUhSDylCllJQWUCJdU1wX8o",
|
||||
// refresh_token:
|
||||
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhMWNlM2FkOS1iZTE2LTRiNjgtOGRhYi1hYjA4YTVjMmZjZTkiLCJ0eXBlIjoicmYiLCJleHAiOjE2OTUyNTI2NTh9.a4wL9-XK_zyTyrXduBFgCsODFXrqiByVr5HOeiCbiQA",
|
||||
// token_type: "bearer",
|
||||
// };
|
||||
// await route.fulfill({ json });
|
||||
// });
|
||||
// await page.goto("http://localhost:3000/");
|
||||
// await page.waitForURL("http://localhost:3000/login");
|
||||
// await page.waitForURL("http://localhost:3000/login", { timeout: 100 });
|
||||
// await page.getByPlaceholder("Username").click();
|
||||
// await page.getByPlaceholder("Username").fill("test");
|
||||
// await page.getByPlaceholder("Password").click();
|
||||
// await page.getByPlaceholder("Password").fill("test");
|
||||
// await page.getByRole("button", { name: "Sign in" }).click();
|
||||
// await page.getByRole("button", { name: "Community Examples" }).click();
|
||||
// await page.waitForSelector(".community-pages-flows-panel");
|
||||
// expect(
|
||||
// await page
|
||||
// .locator(".community-pages-flows-panel")
|
||||
// .evaluate((el) => el.children)
|
||||
// ).toBeTruthy();
|
||||
// });
|
||||
// test("Login Error", async ({ page }) => {
|
||||
// await page.route("**/api/v1/login", async (route) => {
|
||||
// const json = { detail: "Incorrect username or password" };
|
||||
// await route.fulfill({ json, status: 401 });
|
||||
// });
|
||||
// await page.goto("http://localhost:3000/");
|
||||
// await page.waitForURL("http://localhost:3000/login");
|
||||
// await page.waitForURL("http://localhost:3000/login", { timeout: 100 });
|
||||
// await page.getByPlaceholder("Username").click();
|
||||
// await page.getByPlaceholder("Username").fill("test");
|
||||
// await page.getByPlaceholder("Password").click();
|
||||
// await page.getByPlaceholder("Password").fill("test5");
|
||||
// await page.getByRole("button", { name: "Sign in" }).click();
|
||||
// await page.getByRole("heading", { name: "Error signing in" }).click();
|
||||
// });
|
||||
// test("Login create account wrong form", async ({ page }) => {
|
||||
// const fullfillForm = async (username, password, confirmPassword) => {
|
||||
// await page.getByPlaceholder("Username").click();
|
||||
// await page.getByPlaceholder("Username").fill(username);
|
||||
// await page.getByPlaceholder("Password", { exact: true }).click();
|
||||
// await page.getByPlaceholder("Password", { exact: true }).fill(password);
|
||||
// await page.getByPlaceholder("Confirm your password").click();
|
||||
// await page
|
||||
// .getByPlaceholder("Confirm your password")
|
||||
// .fill(confirmPassword);
|
||||
// };
|
||||
// await page.goto("http://localhost:3000/");
|
||||
// await page.waitForURL("http://localhost:3000/login");
|
||||
// await page.waitForURL("http://localhost:3000/login", { timeout: 100 });
|
||||
// await page
|
||||
// .getByRole("button", { name: "Don't have an account? Sign Up" })
|
||||
// .click();
|
||||
// await page.getByText("Sign up to Langflow").click();
|
||||
// await page.goto("http://localhost:3000/signup");
|
||||
// await page.getByText("Sign up to Langflow").click();
|
||||
// await fullfillForm("name", "vazz", "vazz5");
|
||||
// expect(
|
||||
// await page.getByRole("button", { name: "Sign up" }).isDisabled()
|
||||
// ).toBeTruthy();
|
||||
// await fullfillForm("", "vazz", "vazz");
|
||||
// expect(
|
||||
// await page.getByRole("button", { name: "Sign up" }).isDisabled()
|
||||
// ).toBeTruthy();
|
||||
// await fullfillForm("name", "", "");
|
||||
// expect(
|
||||
// await page.getByRole("button", { name: "Sign up" }).isDisabled()
|
||||
// ).toBeTruthy();
|
||||
// await fullfillForm("", "", "");
|
||||
// expect(
|
||||
// await page.getByRole("button", { name: "Sign up" }).isDisabled()
|
||||
// ).toBeTruthy();
|
||||
// });
|
||||
// test("Login create account success", async ({ page }) => {
|
||||
// await page.route("**/api/v1/users/", async (route) => {
|
||||
// const json = {
|
||||
// id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210",
|
||||
// username: "teste",
|
||||
// profile_image: null,
|
||||
// is_active: false,
|
||||
// is_superuser: false,
|
||||
// create_at: "2023-09-21T01:45:51.873303",
|
||||
// updated_at: "2023-09-21T01:45:51.873305",
|
||||
// last_login_at: null,
|
||||
// };
|
||||
// await route.fulfill({ json, status: 201 });
|
||||
// });
|
||||
// const submitForm = async (username, password, confirmPassword) => {
|
||||
// await page.getByPlaceholder("Username").click();
|
||||
// await page.getByPlaceholder("Username").fill(username);
|
||||
// await page.getByPlaceholder("Password", { exact: true }).click();
|
||||
// await page.getByPlaceholder("Password", { exact: true }).fill(password);
|
||||
// await page.getByPlaceholder("Confirm your password").click();
|
||||
// await page
|
||||
// .getByPlaceholder("Confirm your password")
|
||||
// .fill(confirmPassword);
|
||||
// };
|
||||
// await page.goto("http://localhost:3000/");
|
||||
// await page.waitForURL("http://localhost:3000/login");
|
||||
// await page.waitForURL("http://localhost:3000/login", { timeout: 100 });
|
||||
// await page
|
||||
// .getByRole("button", { name: "Don't have an account? Sign Up" })
|
||||
// .click();
|
||||
// await page.getByText("Sign up to Langflow").click();
|
||||
// await page.goto("http://localhost:3000/signup");
|
||||
// await page.getByText("Sign up to Langflow").click();
|
||||
// await submitForm("teste", "pass", "pass");
|
||||
// await page.getByRole("button", { name: "Sign up" }).click();
|
||||
// await page.waitForURL("http://localhost:3000/login", { timeout: 1000 });
|
||||
// await page.getByText("Account created! Await admin activation.").click();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue