From 4a7bdcfd10eb27b3ce7b1a4f9b358bc37a1e7f05 Mon Sep 17 00:00:00 2001 From: Chris Trevino Date: Thu, 30 Mar 2023 12:58:31 -0700 Subject: [PATCH 001/150] update the semver used for langchain --- poetry.lock | 405 +++++++++++++++++++++++++------------------------ pyproject.toml | 2 +- 2 files changed, 205 insertions(+), 202 deletions(-) diff --git a/poetry.lock b/poetry.lock index 46aa8b702..7f6365839 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand. [[package]] name = "aiohttp" @@ -220,14 +220,14 @@ files = [ [[package]] name = "beautifulsoup4" -version = "4.11.2" +version = "4.12.0" description = "Screen-scraping library" category = "main" optional = false python-versions = ">=3.6.0" files = [ - {file = "beautifulsoup4-4.11.2-py3-none-any.whl", hash = "sha256:0e79446b10b3ecb499c1556f7e228a53e64a2bfcebd455f370d8927cb5b59e39"}, - {file = "beautifulsoup4-4.11.2.tar.gz", hash = "sha256:bc4bdda6717de5a2987436fb8d72f45dc90dd856bdfd512a1314ce90349a0106"}, + {file = "beautifulsoup4-4.12.0-py3-none-any.whl", hash = "sha256:2130a5ad7f513200fae61a17abb5e338ca980fa28c439c0571014bc0217e9591"}, + {file = "beautifulsoup4-4.12.0.tar.gz", hash = "sha256:c5fceeaec29d09c84970e47c65f2f0efe57872f7cff494c9691a26ec0ff13234"}, ] [package.dependencies] @@ -239,37 +239,37 @@ lxml = ["lxml"] [[package]] name = "black" -version = "23.1.0" +version = "23.3.0" description = "The uncompromising code formatter." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "black-23.1.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:b6a92a41ee34b883b359998f0c8e6eb8e99803aa8bf3123bf2b2e6fec505a221"}, - {file = "black-23.1.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:57c18c5165c1dbe291d5306e53fb3988122890e57bd9b3dcb75f967f13411a26"}, - {file = "black-23.1.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:9880d7d419bb7e709b37e28deb5e68a49227713b623c72b2b931028ea65f619b"}, - {file = "black-23.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e6663f91b6feca5d06f2ccd49a10f254f9298cc1f7f49c46e498a0771b507104"}, - {file = "black-23.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:9afd3f493666a0cd8f8df9a0200c6359ac53940cbde049dcb1a7eb6ee2dd7074"}, - {file = "black-23.1.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:bfffba28dc52a58f04492181392ee380e95262af14ee01d4bc7bb1b1c6ca8d27"}, - {file = "black-23.1.0-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:c1c476bc7b7d021321e7d93dc2cbd78ce103b84d5a4cf97ed535fbc0d6660648"}, - {file = "black-23.1.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:382998821f58e5c8238d3166c492139573325287820963d2f7de4d518bd76958"}, - {file = "black-23.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bf649fda611c8550ca9d7592b69f0637218c2369b7744694c5e4902873b2f3a"}, - {file = "black-23.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:121ca7f10b4a01fd99951234abdbd97728e1240be89fde18480ffac16503d481"}, - {file = "black-23.1.0-cp37-cp37m-macosx_10_16_x86_64.whl", hash = "sha256:a8471939da5e824b891b25751955be52ee7f8a30a916d570a5ba8e0f2eb2ecad"}, - {file = "black-23.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8178318cb74f98bc571eef19068f6ab5613b3e59d4f47771582f04e175570ed8"}, - {file = "black-23.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:a436e7881d33acaf2536c46a454bb964a50eff59b21b51c6ccf5a40601fbef24"}, - {file = "black-23.1.0-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:a59db0a2094d2259c554676403fa2fac3473ccf1354c1c63eccf7ae65aac8ab6"}, - {file = "black-23.1.0-cp38-cp38-macosx_10_16_universal2.whl", hash = "sha256:0052dba51dec07ed029ed61b18183942043e00008ec65d5028814afaab9a22fd"}, - {file = "black-23.1.0-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:49f7b39e30f326a34b5c9a4213213a6b221d7ae9d58ec70df1c4a307cf2a1580"}, - {file = "black-23.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:162e37d49e93bd6eb6f1afc3e17a3d23a823042530c37c3c42eeeaf026f38468"}, - {file = "black-23.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:8b70eb40a78dfac24842458476135f9b99ab952dd3f2dab738c1881a9b38b753"}, - {file = "black-23.1.0-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:a29650759a6a0944e7cca036674655c2f0f63806ddecc45ed40b7b8aa314b651"}, - {file = "black-23.1.0-cp39-cp39-macosx_10_16_universal2.whl", hash = "sha256:bb460c8561c8c1bec7824ecbc3ce085eb50005883a6203dcfb0122e95797ee06"}, - {file = "black-23.1.0-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:c91dfc2c2a4e50df0026f88d2215e166616e0c80e86004d0003ece0488db2739"}, - {file = "black-23.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a951cc83ab535d248c89f300eccbd625e80ab880fbcfb5ac8afb5f01a258ac9"}, - {file = "black-23.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:0680d4380db3719ebcfb2613f34e86c8e6d15ffeabcf8ec59355c5e7b85bb555"}, - {file = "black-23.1.0-py3-none-any.whl", hash = "sha256:7a0f701d314cfa0896b9001df70a530eb2472babb76086344e688829efd97d32"}, - {file = "black-23.1.0.tar.gz", hash = "sha256:b0bd97bea8903f5a2ba7219257a44e3f1f9d00073d6cc1add68f0beec69692ac"}, + {file = "black-23.3.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:0945e13506be58bf7db93ee5853243eb368ace1c08a24c65ce108986eac65915"}, + {file = "black-23.3.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:67de8d0c209eb5b330cce2469503de11bca4085880d62f1628bd9972cc3366b9"}, + {file = "black-23.3.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:7c3eb7cea23904399866c55826b31c1f55bbcd3890ce22ff70466b907b6775c2"}, + {file = "black-23.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32daa9783106c28815d05b724238e30718f34155653d4d6e125dc7daec8e260c"}, + {file = "black-23.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:35d1381d7a22cc5b2be2f72c7dfdae4072a3336060635718cc7e1ede24221d6c"}, + {file = "black-23.3.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:a8a968125d0a6a404842fa1bf0b349a568634f856aa08ffaff40ae0dfa52e7c6"}, + {file = "black-23.3.0-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:c7ab5790333c448903c4b721b59c0d80b11fe5e9803d8703e84dcb8da56fec1b"}, + {file = "black-23.3.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:a6f6886c9869d4daae2d1715ce34a19bbc4b95006d20ed785ca00fa03cba312d"}, + {file = "black-23.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f3c333ea1dd6771b2d3777482429864f8e258899f6ff05826c3a4fcc5ce3f70"}, + {file = "black-23.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:11c410f71b876f961d1de77b9699ad19f939094c3a677323f43d7a29855fe326"}, + {file = "black-23.3.0-cp37-cp37m-macosx_10_16_x86_64.whl", hash = "sha256:1d06691f1eb8de91cd1b322f21e3bfc9efe0c7ca1f0e1eb1db44ea367dff656b"}, + {file = "black-23.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:50cb33cac881766a5cd9913e10ff75b1e8eb71babf4c7104f2e9c52da1fb7de2"}, + {file = "black-23.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:e114420bf26b90d4b9daa597351337762b63039752bdf72bf361364c1aa05925"}, + {file = "black-23.3.0-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:48f9d345675bb7fbc3dd85821b12487e1b9a75242028adad0333ce36ed2a6d27"}, + {file = "black-23.3.0-cp38-cp38-macosx_10_16_universal2.whl", hash = "sha256:714290490c18fb0126baa0fca0a54ee795f7502b44177e1ce7624ba1c00f2331"}, + {file = "black-23.3.0-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:064101748afa12ad2291c2b91c960be28b817c0c7eaa35bec09cc63aa56493c5"}, + {file = "black-23.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:562bd3a70495facf56814293149e51aa1be9931567474993c7942ff7d3533961"}, + {file = "black-23.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:e198cf27888ad6f4ff331ca1c48ffc038848ea9f031a3b40ba36aced7e22f2c8"}, + {file = "black-23.3.0-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:3238f2aacf827d18d26db07524e44741233ae09a584273aa059066d644ca7b30"}, + {file = "black-23.3.0-cp39-cp39-macosx_10_16_universal2.whl", hash = "sha256:f0bd2f4a58d6666500542b26354978218a9babcdc972722f4bf90779524515f3"}, + {file = "black-23.3.0-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:92c543f6854c28a3c7f39f4d9b7694f9a6eb9d3c5e2ece488c327b6e7ea9b266"}, + {file = "black-23.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a150542a204124ed00683f0db1f5cf1c2aaaa9cc3495b7a3b5976fb136090ab"}, + {file = "black-23.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:6b39abdfb402002b8a7d030ccc85cf5afff64ee90fa4c5aebc531e3ad0175ddb"}, + {file = "black-23.3.0-py3-none-any.whl", hash = "sha256:ec751418022185b0c1bb7d7736e6933d40bbb14c14a0abcf9123d1b159f98dd4"}, + {file = "black-23.3.0.tar.gz", hash = "sha256:1c7b8d606e728a41ea1ccbd7264677e494e87cf630e399262ced92d4a8dac940"}, ] [package.dependencies] @@ -502,21 +502,23 @@ files = [ [[package]] name = "comm" -version = "0.1.2" +version = "0.1.3" description = "Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc." category = "dev" optional = false python-versions = ">=3.6" files = [ - {file = "comm-0.1.2-py3-none-any.whl", hash = "sha256:9f3abf3515112fa7c55a42a6a5ab358735c9dccc8b5910a9d8e3ef5998130666"}, - {file = "comm-0.1.2.tar.gz", hash = "sha256:3e2f5826578e683999b93716285b3b1f344f157bf75fa9ce0a797564e742f062"}, + {file = "comm-0.1.3-py3-none-any.whl", hash = "sha256:16613c6211e20223f215fc6d3b266a247b6e2641bf4e0a3ad34cb1aff2aa3f37"}, + {file = "comm-0.1.3.tar.gz", hash = "sha256:a61efa9daffcfbe66fd643ba966f846a624e4e6d6767eda9cf6e993aadaab93e"}, ] [package.dependencies] traitlets = ">=5.3" [package.extras] +lint = ["black (>=22.6.0)", "mdformat (>0.7)", "mdformat-gfm (>=0.3.5)", "ruff (>=0.0.156)"] test = ["pytest"] +typing = ["mypy (>=0.990)"] [[package]] name = "dataclasses-json" @@ -723,14 +725,14 @@ grpcio-gcp = ["grpcio-gcp (>=0.2.2,<1.0dev)"] [[package]] name = "google-api-python-client" -version = "2.81.0" +version = "2.83.0" description = "Google API Client Library for Python" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "google-api-python-client-2.81.0.tar.gz", hash = "sha256:8faab0b9b19d3797b455d33320c643253b6761fd0d3f3adb54792ab155d0795a"}, - {file = "google_api_python_client-2.81.0-py2.py3-none-any.whl", hash = "sha256:ad6700ae3a76ead8956d7f30935978cea308530e342ad8c1e26a4e40fc05c054"}, + {file = "google-api-python-client-2.83.0.tar.gz", hash = "sha256:d07509f1b2d2b2427363b454db996f7a15e1751a48cfcaf28427050560dd51cf"}, + {file = "google_api_python_client-2.83.0-py2.py3-none-any.whl", hash = "sha256:afa7fe2a5d77e8f136cdb8f40a120dd6660c2292f791c1b22734dfe786bd1dac"}, ] [package.dependencies] @@ -742,14 +744,14 @@ uritemplate = ">=3.0.1,<5" [[package]] name = "google-auth" -version = "2.16.2" +version = "2.17.0" description = "Google Authentication Library" category = "main" optional = false python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*" files = [ - {file = "google-auth-2.16.2.tar.gz", hash = "sha256:07e14f34ec288e3f33e00e2e3cc40c8942aa5d4ceac06256a28cd8e786591420"}, - {file = "google_auth-2.16.2-py2.py3-none-any.whl", hash = "sha256:2fef3cf94876d1a0e204afece58bb4d83fb57228aaa366c64045039fda6770a2"}, + {file = "google-auth-2.17.0.tar.gz", hash = "sha256:f51d26ebb3e5d723b9a7dbd310b6c88654ef1ad1fc35750d1fdba48ca4d82f52"}, + {file = "google_auth-2.17.0-py2.py3-none-any.whl", hash = "sha256:45ba9b4b3e49406de3c5451697820694b2f6ce8a6b75bb187852fdae231dab94"}, ] [package.dependencies] @@ -798,14 +800,14 @@ requests = "*" [[package]] name = "googleapis-common-protos" -version = "1.58.0" +version = "1.59.0" description = "Common protobufs used in Google APIs" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "googleapis-common-protos-1.58.0.tar.gz", hash = "sha256:c727251ec025947d545184ba17e3578840fc3a24a0516a020479edab660457df"}, - {file = "googleapis_common_protos-1.58.0-py2.py3-none-any.whl", hash = "sha256:ca3befcd4580dab6ad49356b46bf165bb68ff4b32389f028f1abd7c10ab9519a"}, + {file = "googleapis-common-protos-1.59.0.tar.gz", hash = "sha256:4168fcb568a826a52f23510412da405abd93f4d23ba544bb68d943b14ba3cb44"}, + {file = "googleapis_common_protos-1.59.0-py2.py3-none-any.whl", hash = "sha256:b287dc48449d1d41af0c69f4ea26242b5ae4c3d7249a38b0984c86a4caffff1f"}, ] [package.dependencies] @@ -923,14 +925,14 @@ files = [ [[package]] name = "httplib2" -version = "0.21.0" +version = "0.22.0" description = "A comprehensive HTTP client library." category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ - {file = "httplib2-0.21.0-py3-none-any.whl", hash = "sha256:987c8bb3eb82d3fa60c68699510a692aa2ad9c4bd4f123e51dfb1488c14cdd01"}, - {file = "httplib2-0.21.0.tar.gz", hash = "sha256:fc144f091c7286b82bec71bdbd9b27323ba709cc612568d3000893bfd9cb4b34"}, + {file = "httplib2-0.22.0-py3-none-any.whl", hash = "sha256:14ae0a53c1ba8f3d37e9e27cf37eabb0fb9980f435ba405d546948b009dd64dc"}, + {file = "httplib2-0.22.0.tar.gz", hash = "sha256:d7a10bc5ef5ab08322488bde8c726eeee5c8618723fdb399597ec58f3d82df81"}, ] [package.dependencies] @@ -970,14 +972,14 @@ testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packag [[package]] name = "ipykernel" -version = "6.21.3" +version = "6.22.0" description = "IPython Kernel for Jupyter" category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "ipykernel-6.21.3-py3-none-any.whl", hash = "sha256:24ebd9715e317c185e37156ab3a87382410185230dde7aeffce389d6c7d4428a"}, - {file = "ipykernel-6.21.3.tar.gz", hash = "sha256:c8ff581905d70e7299bc1473a2f7c113bec1744fb3746d58e5b4b93bd8ee7001"}, + {file = "ipykernel-6.22.0-py3-none-any.whl", hash = "sha256:1ae6047c1277508933078163721bbb479c3e7292778a04b4bacf0874550977d6"}, + {file = "ipykernel-6.22.0.tar.gz", hash = "sha256:302558b81f1bc22dc259fb2a0c5c7cf2f4c0bdb21b50484348f7bafe7fb71421"}, ] [package.dependencies] @@ -1004,14 +1006,14 @@ test = ["flaky", "ipyparallel", "pre-commit", "pytest (>=7.0)", "pytest-asyncio" [[package]] name = "ipython" -version = "8.11.0" +version = "8.12.0" description = "IPython: Productive Interactive Computing" category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "ipython-8.11.0-py3-none-any.whl", hash = "sha256:5b54478e459155a326bf5f42ee4f29df76258c0279c36f21d71ddb560f88b156"}, - {file = "ipython-8.11.0.tar.gz", hash = "sha256:735cede4099dbc903ee540307b9171fbfef4aa75cfcacc5a273b2cda2f02be04"}, + {file = "ipython-8.12.0-py3-none-any.whl", hash = "sha256:1c183bf61b148b00bcebfa5d9b39312733ae97f6dad90d7e9b4d86c8647f498c"}, + {file = "ipython-8.12.0.tar.gz", hash = "sha256:a950236df04ad75b5bc7f816f9af3d74dc118fd42f2ff7e80e8e60ca1f182e2d"}, ] [package.dependencies] @@ -1027,6 +1029,7 @@ prompt-toolkit = ">=3.0.30,<3.0.37 || >3.0.37,<3.1.0" pygments = ">=2.4.0" stack-data = "*" traitlets = ">=5" +typing-extensions = {version = "*", markers = "python_version < \"3.10\""} [package.extras] all = ["black", "curio", "docrepr", "ipykernel", "ipyparallel", "ipywidgets", "matplotlib", "matplotlib (!=3.2.0)", "nbconvert", "nbformat", "notebook", "numpy (>=1.21)", "pandas", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio", "qtconsole", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "trio", "typing-extensions"] @@ -1063,14 +1066,14 @@ testing = ["Django (<3.1)", "attrs", "colorama", "docopt", "pytest (<7.0.0)"] [[package]] name = "jupyter-client" -version = "8.0.3" +version = "8.1.0" description = "Jupyter protocol implementation and client libraries" category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "jupyter_client-8.0.3-py3-none-any.whl", hash = "sha256:be48ac6bd659cbbddb7a674cf06b3b8afbf53f228253cf58bde604c03bd487b0"}, - {file = "jupyter_client-8.0.3.tar.gz", hash = "sha256:ed65498bea6d876ef9d8da3e0db3dd33c5d129f5b2645f56ae03993782966bd0"}, + {file = "jupyter_client-8.1.0-py3-none-any.whl", hash = "sha256:d5b8e739d7816944be50f81121a109788a3d92732ecf1ad1e4dadebc948818fe"}, + {file = "jupyter_client-8.1.0.tar.gz", hash = "sha256:3fbab64100a0dcac7701b1e0f1a4412f1ccb45546ff2ad9bc4fcbe4e19804811"}, ] [package.dependencies] @@ -1108,14 +1111,14 @@ test = ["ipykernel", "pre-commit", "pytest", "pytest-cov", "pytest-timeout"] [[package]] name = "langchain" -version = "0.0.113" +version = "0.0.127" description = "Building applications with LLMs through composability" category = "main" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langchain-0.0.113-py3-none-any.whl", hash = "sha256:9e146d116fd3b9b2210c8c447cabfa20ef27c26ea3f2bc986eab97d1dad0aab6"}, - {file = "langchain-0.0.113.tar.gz", hash = "sha256:a494fe02bc63da4bcda7da8d7f4a346522fbc87f0a4955b72519ec2ed86bf906"}, + {file = "langchain-0.0.127-py3-none-any.whl", hash = "sha256:04ba053881e6098e80e0f4afc8922f3fe78923b160fd12d856aebce49c261918"}, + {file = "langchain-0.0.127.tar.gz", hash = "sha256:e8a3b67fd86a6f79c4334f0a7588c9476fcb57b27a8fb0e617f47c01eaab8be8"}, ] [package.dependencies] @@ -1123,14 +1126,14 @@ aiohttp = ">=3.8.3,<4.0.0" dataclasses-json = ">=0.5.7,<0.6.0" numpy = ">=1,<2" pydantic = ">=1,<2" -PyYAML = ">=6,<7" +PyYAML = ">=5.4.1" requests = ">=2,<3" SQLAlchemy = ">=1,<2" tenacity = ">=8.1.0,<9.0.0" [package.extras] -all = ["aleph-alpha-client (>=2.15.0,<3.0.0)", "anthropic (>=0.2.2,<0.3.0)", "beautifulsoup4 (>=4,<5)", "cohere (>=3,<4)", "deeplake (>=3.2.9,<4.0.0)", "elasticsearch (>=8,<9)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-search-results (>=2,<3)", "huggingface_hub (>=0,<1)", "jinja2 (>=3,<4)", "manifest-ml (>=0.0.1,<0.0.2)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (>=0,<1)", "opensearch-py (>=2.0.0,<3.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pypdf (>=3.4.0,<4.0.0)", "qdrant-client (>=1.0.4,<2.0.0)", "redis (>=4,<5)", "sentence-transformers (>=2,<3)", "spacy (>=3,<4)", "tensorflow-text (>=2.11.0,<3.0.0)", "tiktoken (>=0,<1)", "torch (>=1,<2)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"] -llms = ["anthropic (>=0.2.2,<0.3.0)", "cohere (>=3,<4)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (>=0,<1)", "torch (>=1,<2)", "transformers (>=4,<5)"] +all = ["aleph-alpha-client (>=2.15.0,<3.0.0)", "anthropic (>=0.2.4,<0.3.0)", "beautifulsoup4 (>=4,<5)", "boto3 (>=1.26.96,<2.0.0)", "cohere (>=3,<4)", "deeplake (>=3.2.9,<4.0.0)", "elasticsearch (>=8,<9)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-search-results (>=2,<3)", "huggingface_hub (>=0,<1)", "jina (>=3.14,<4.0)", "jinja2 (>=3,<4)", "manifest-ml (>=0.0.1,<0.0.2)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (>=0,<1)", "opensearch-py (>=2.0.0,<3.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "qdrant-client (>=1.0.4,<2.0.0)", "redis (>=4,<5)", "sentence-transformers (>=2,<3)", "spacy (>=3,<4)", "tensorflow-text (>=2.11.0,<3.0.0)", "tiktoken (>=0.3.2,<0.4.0)", "torch (>=1,<2)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"] +llms = ["anthropic (>=0.2.4,<0.3.0)", "cohere (>=3,<4)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (>=0,<1)", "torch (>=1,<2)", "transformers (>=4,<5)"] [[package]] name = "marshmallow" @@ -1468,19 +1471,19 @@ files = [ [[package]] name = "platformdirs" -version = "3.1.1" +version = "3.2.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-3.1.1-py3-none-any.whl", hash = "sha256:e5986afb596e4bb5bde29a79ac9061aa955b94fca2399b7aaac4090860920dd8"}, - {file = "platformdirs-3.1.1.tar.gz", hash = "sha256:024996549ee88ec1a9aa99ff7f8fc819bb59e2c3477b410d90a16d32d6e707aa"}, + {file = "platformdirs-3.2.0-py3-none-any.whl", hash = "sha256:ebe11c0d7a805086e99506aa331612429a72ca7cd52a1f0d277dc4adc20cb10e"}, + {file = "platformdirs-3.2.0.tar.gz", hash = "sha256:d5b638ca397f25f979350ff789db335903d7ea010ab28903f57b27e1b16c2b08"}, ] [package.extras] docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] [[package]] name = "prompt-toolkit" @@ -1615,48 +1618,48 @@ files = [ [[package]] name = "pydantic" -version = "1.10.6" +version = "1.10.7" description = "Data validation and settings management using python type hints" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "pydantic-1.10.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f9289065611c48147c1dd1fd344e9d57ab45f1d99b0fb26c51f1cf72cd9bcd31"}, - {file = "pydantic-1.10.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8c32b6bba301490d9bb2bf5f631907803135e8085b6aa3e5fe5a770d46dd0160"}, - {file = "pydantic-1.10.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd9b9e98068fa1068edfc9eabde70a7132017bdd4f362f8b4fd0abed79c33083"}, - {file = "pydantic-1.10.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c84583b9df62522829cbc46e2b22e0ec11445625b5acd70c5681ce09c9b11c4"}, - {file = "pydantic-1.10.6-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:b41822064585fea56d0116aa431fbd5137ce69dfe837b599e310034171996084"}, - {file = "pydantic-1.10.6-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:61f1f08adfaa9cc02e0cbc94f478140385cbd52d5b3c5a657c2fceb15de8d1fb"}, - {file = "pydantic-1.10.6-cp310-cp310-win_amd64.whl", hash = "sha256:32937835e525d92c98a1512218db4eed9ddc8f4ee2a78382d77f54341972c0e7"}, - {file = "pydantic-1.10.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bbd5c531b22928e63d0cb1868dee76123456e1de2f1cb45879e9e7a3f3f1779b"}, - {file = "pydantic-1.10.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e277bd18339177daa62a294256869bbe84df1fb592be2716ec62627bb8d7c81d"}, - {file = "pydantic-1.10.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89f15277d720aa57e173954d237628a8d304896364b9de745dcb722f584812c7"}, - {file = "pydantic-1.10.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b243b564cea2576725e77aeeda54e3e0229a168bc587d536cd69941e6797543d"}, - {file = "pydantic-1.10.6-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3ce13a558b484c9ae48a6a7c184b1ba0e5588c5525482681db418268e5f86186"}, - {file = "pydantic-1.10.6-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3ac1cd4deed871dfe0c5f63721e29debf03e2deefa41b3ed5eb5f5df287c7b70"}, - {file = "pydantic-1.10.6-cp311-cp311-win_amd64.whl", hash = "sha256:b1eb6610330a1dfba9ce142ada792f26bbef1255b75f538196a39e9e90388bf4"}, - {file = "pydantic-1.10.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4ca83739c1263a044ec8b79df4eefc34bbac87191f0a513d00dd47d46e307a65"}, - {file = "pydantic-1.10.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ea4e2a7cb409951988e79a469f609bba998a576e6d7b9791ae5d1e0619e1c0f2"}, - {file = "pydantic-1.10.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:53de12b4608290992a943801d7756f18a37b7aee284b9ffa794ee8ea8153f8e2"}, - {file = "pydantic-1.10.6-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:60184e80aac3b56933c71c48d6181e630b0fbc61ae455a63322a66a23c14731a"}, - {file = "pydantic-1.10.6-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:415a3f719ce518e95a92effc7ee30118a25c3d032455d13e121e3840985f2efd"}, - {file = "pydantic-1.10.6-cp37-cp37m-win_amd64.whl", hash = "sha256:72cb30894a34d3a7ab6d959b45a70abac8a2a93b6480fc5a7bfbd9c935bdc4fb"}, - {file = "pydantic-1.10.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3091d2eaeda25391405e36c2fc2ed102b48bac4b384d42b2267310abae350ca6"}, - {file = "pydantic-1.10.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:751f008cd2afe812a781fd6aa2fb66c620ca2e1a13b6a2152b1ad51553cb4b77"}, - {file = "pydantic-1.10.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:12e837fd320dd30bd625be1b101e3b62edc096a49835392dcf418f1a5ac2b832"}, - {file = "pydantic-1.10.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:587d92831d0115874d766b1f5fddcdde0c5b6c60f8c6111a394078ec227fca6d"}, - {file = "pydantic-1.10.6-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:476f6674303ae7965730a382a8e8d7fae18b8004b7b69a56c3d8fa93968aa21c"}, - {file = "pydantic-1.10.6-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:3a2be0a0f32c83265fd71a45027201e1278beaa82ea88ea5b345eea6afa9ac7f"}, - {file = "pydantic-1.10.6-cp38-cp38-win_amd64.whl", hash = "sha256:0abd9c60eee6201b853b6c4be104edfba4f8f6c5f3623f8e1dba90634d63eb35"}, - {file = "pydantic-1.10.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6195ca908045054dd2d57eb9c39a5fe86409968b8040de8c2240186da0769da7"}, - {file = "pydantic-1.10.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:43cdeca8d30de9a897440e3fb8866f827c4c31f6c73838e3a01a14b03b067b1d"}, - {file = "pydantic-1.10.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c19eb5163167489cb1e0161ae9220dadd4fc609a42649e7e84a8fa8fff7a80f"}, - {file = "pydantic-1.10.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:012c99a9c0d18cfde7469aa1ebff922e24b0c706d03ead96940f5465f2c9cf62"}, - {file = "pydantic-1.10.6-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:528dcf7ec49fb5a84bf6fe346c1cc3c55b0e7603c2123881996ca3ad79db5bfc"}, - {file = "pydantic-1.10.6-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:163e79386c3547c49366e959d01e37fc30252285a70619ffc1b10ede4758250a"}, - {file = "pydantic-1.10.6-cp39-cp39-win_amd64.whl", hash = "sha256:189318051c3d57821f7233ecc94708767dd67687a614a4e8f92b4a020d4ffd06"}, - {file = "pydantic-1.10.6-py3-none-any.whl", hash = "sha256:acc6783751ac9c9bc4680379edd6d286468a1dc8d7d9906cd6f1186ed682b2b0"}, - {file = "pydantic-1.10.6.tar.gz", hash = "sha256:cf95adb0d1671fc38d8c43dd921ad5814a735e7d9b4d9e437c088002863854fd"}, + {file = "pydantic-1.10.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e79e999e539872e903767c417c897e729e015872040e56b96e67968c3b918b2d"}, + {file = "pydantic-1.10.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:01aea3a42c13f2602b7ecbbea484a98169fb568ebd9e247593ea05f01b884b2e"}, + {file = "pydantic-1.10.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:516f1ed9bc2406a0467dd777afc636c7091d71f214d5e413d64fef45174cfc7a"}, + {file = "pydantic-1.10.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae150a63564929c675d7f2303008d88426a0add46efd76c3fc797cd71cb1b46f"}, + {file = "pydantic-1.10.7-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ecbbc51391248116c0a055899e6c3e7ffbb11fb5e2a4cd6f2d0b93272118a209"}, + {file = "pydantic-1.10.7-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f4a2b50e2b03d5776e7f21af73e2070e1b5c0d0df255a827e7c632962f8315af"}, + {file = "pydantic-1.10.7-cp310-cp310-win_amd64.whl", hash = "sha256:a7cd2251439988b413cb0a985c4ed82b6c6aac382dbaff53ae03c4b23a70e80a"}, + {file = "pydantic-1.10.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:68792151e174a4aa9e9fc1b4e653e65a354a2fa0fed169f7b3d09902ad2cb6f1"}, + {file = "pydantic-1.10.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:dfe2507b8ef209da71b6fb5f4e597b50c5a34b78d7e857c4f8f3115effaef5fe"}, + {file = "pydantic-1.10.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10a86d8c8db68086f1e30a530f7d5f83eb0685e632e411dbbcf2d5c0150e8dcd"}, + {file = "pydantic-1.10.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d75ae19d2a3dbb146b6f324031c24f8a3f52ff5d6a9f22f0683694b3afcb16fb"}, + {file = "pydantic-1.10.7-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:464855a7ff7f2cc2cf537ecc421291b9132aa9c79aef44e917ad711b4a93163b"}, + {file = "pydantic-1.10.7-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:193924c563fae6ddcb71d3f06fa153866423ac1b793a47936656e806b64e24ca"}, + {file = "pydantic-1.10.7-cp311-cp311-win_amd64.whl", hash = "sha256:b4a849d10f211389502059c33332e91327bc154acc1845f375a99eca3afa802d"}, + {file = "pydantic-1.10.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cc1dde4e50a5fc1336ee0581c1612215bc64ed6d28d2c7c6f25d2fe3e7c3e918"}, + {file = "pydantic-1.10.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e0cfe895a504c060e5d36b287ee696e2fdad02d89e0d895f83037245218a87fe"}, + {file = "pydantic-1.10.7-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:670bb4683ad1e48b0ecb06f0cfe2178dcf74ff27921cdf1606e527d2617a81ee"}, + {file = "pydantic-1.10.7-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:950ce33857841f9a337ce07ddf46bc84e1c4946d2a3bba18f8280297157a3fd1"}, + {file = "pydantic-1.10.7-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:c15582f9055fbc1bfe50266a19771bbbef33dd28c45e78afbe1996fd70966c2a"}, + {file = "pydantic-1.10.7-cp37-cp37m-win_amd64.whl", hash = "sha256:82dffb306dd20bd5268fd6379bc4bfe75242a9c2b79fec58e1041fbbdb1f7914"}, + {file = "pydantic-1.10.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8c7f51861d73e8b9ddcb9916ae7ac39fb52761d9ea0df41128e81e2ba42886cd"}, + {file = "pydantic-1.10.7-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6434b49c0b03a51021ade5c4daa7d70c98f7a79e95b551201fff682fc1661245"}, + {file = "pydantic-1.10.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64d34ab766fa056df49013bb6e79921a0265204c071984e75a09cbceacbbdd5d"}, + {file = "pydantic-1.10.7-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:701daea9ffe9d26f97b52f1d157e0d4121644f0fcf80b443248434958fd03dc3"}, + {file = "pydantic-1.10.7-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:cf135c46099ff3f919d2150a948ce94b9ce545598ef2c6c7bf55dca98a304b52"}, + {file = "pydantic-1.10.7-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b0f85904f73161817b80781cc150f8b906d521fa11e3cdabae19a581c3606209"}, + {file = "pydantic-1.10.7-cp38-cp38-win_amd64.whl", hash = "sha256:9f6f0fd68d73257ad6685419478c5aece46432f4bdd8d32c7345f1986496171e"}, + {file = "pydantic-1.10.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c230c0d8a322276d6e7b88c3f7ce885f9ed16e0910354510e0bae84d54991143"}, + {file = "pydantic-1.10.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:976cae77ba6a49d80f461fd8bba183ff7ba79f44aa5cfa82f1346b5626542f8e"}, + {file = "pydantic-1.10.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d45fc99d64af9aaf7e308054a0067fdcd87ffe974f2442312372dfa66e1001d"}, + {file = "pydantic-1.10.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d2a5ebb48958754d386195fe9e9c5106f11275867051bf017a8059410e9abf1f"}, + {file = "pydantic-1.10.7-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:abfb7d4a7cd5cc4e1d1887c43503a7c5dd608eadf8bc615413fc498d3e4645cd"}, + {file = "pydantic-1.10.7-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:80b1fab4deb08a8292d15e43a6edccdffa5377a36a4597bb545b93e79c5ff0a5"}, + {file = "pydantic-1.10.7-cp39-cp39-win_amd64.whl", hash = "sha256:d71e69699498b020ea198468e2480a2f1e7433e32a3a99760058c6520e2bea7e"}, + {file = "pydantic-1.10.7-py3-none-any.whl", hash = "sha256:0cd181f1d0b1d00e2b705f1bf1ac7799a2d938cce3376b8007df62b29be3c2c6"}, + {file = "pydantic-1.10.7.tar.gz", hash = "sha256:cfc83c0678b6ba51b0532bea66860617c4cd4251ecf76e9846fa5a9f3454e97e"}, ] [package.dependencies] @@ -1713,26 +1716,26 @@ six = ">=1.5" [[package]] name = "pywin32" -version = "305" +version = "306" description = "Python for Window Extensions" category = "dev" optional = false python-versions = "*" files = [ - {file = "pywin32-305-cp310-cp310-win32.whl", hash = "sha256:421f6cd86e84bbb696d54563c48014b12a23ef95a14e0bdba526be756d89f116"}, - {file = "pywin32-305-cp310-cp310-win_amd64.whl", hash = "sha256:73e819c6bed89f44ff1d690498c0a811948f73777e5f97c494c152b850fad478"}, - {file = "pywin32-305-cp310-cp310-win_arm64.whl", hash = "sha256:742eb905ce2187133a29365b428e6c3b9001d79accdc30aa8969afba1d8470f4"}, - {file = "pywin32-305-cp311-cp311-win32.whl", hash = "sha256:19ca459cd2e66c0e2cc9a09d589f71d827f26d47fe4a9d09175f6aa0256b51c2"}, - {file = "pywin32-305-cp311-cp311-win_amd64.whl", hash = "sha256:326f42ab4cfff56e77e3e595aeaf6c216712bbdd91e464d167c6434b28d65990"}, - {file = "pywin32-305-cp311-cp311-win_arm64.whl", hash = "sha256:4ecd404b2c6eceaca52f8b2e3e91b2187850a1ad3f8b746d0796a98b4cea04db"}, - {file = "pywin32-305-cp36-cp36m-win32.whl", hash = "sha256:48d8b1659284f3c17b68587af047d110d8c44837736b8932c034091683e05863"}, - {file = "pywin32-305-cp36-cp36m-win_amd64.whl", hash = "sha256:13362cc5aa93c2beaf489c9c9017c793722aeb56d3e5166dadd5ef82da021fe1"}, - {file = "pywin32-305-cp37-cp37m-win32.whl", hash = "sha256:a55db448124d1c1484df22fa8bbcbc45c64da5e6eae74ab095b9ea62e6d00496"}, - {file = "pywin32-305-cp37-cp37m-win_amd64.whl", hash = "sha256:109f98980bfb27e78f4df8a51a8198e10b0f347257d1e265bb1a32993d0c973d"}, - {file = "pywin32-305-cp38-cp38-win32.whl", hash = "sha256:9dd98384da775afa009bc04863426cb30596fd78c6f8e4e2e5bbf4edf8029504"}, - {file = "pywin32-305-cp38-cp38-win_amd64.whl", hash = "sha256:56d7a9c6e1a6835f521788f53b5af7912090674bb84ef5611663ee1595860fc7"}, - {file = "pywin32-305-cp39-cp39-win32.whl", hash = "sha256:9d968c677ac4d5cbdaa62fd3014ab241718e619d8e36ef8e11fb930515a1e918"}, - {file = "pywin32-305-cp39-cp39-win_amd64.whl", hash = "sha256:50768c6b7c3f0b38b7fb14dd4104da93ebced5f1a50dc0e834594bff6fbe1271"}, + {file = "pywin32-306-cp310-cp310-win32.whl", hash = "sha256:06d3420a5155ba65f0b72f2699b5bacf3109f36acbe8923765c22938a69dfc8d"}, + {file = "pywin32-306-cp310-cp310-win_amd64.whl", hash = "sha256:84f4471dbca1887ea3803d8848a1616429ac94a4a8d05f4bc9c5dcfd42ca99c8"}, + {file = "pywin32-306-cp311-cp311-win32.whl", hash = "sha256:e65028133d15b64d2ed8f06dd9fbc268352478d4f9289e69c190ecd6818b6407"}, + {file = "pywin32-306-cp311-cp311-win_amd64.whl", hash = "sha256:a7639f51c184c0272e93f244eb24dafca9b1855707d94c192d4a0b4c01e1100e"}, + {file = "pywin32-306-cp311-cp311-win_arm64.whl", hash = "sha256:70dba0c913d19f942a2db25217d9a1b726c278f483a919f1abfed79c9cf64d3a"}, + {file = "pywin32-306-cp312-cp312-win32.whl", hash = "sha256:383229d515657f4e3ed1343da8be101000562bf514591ff383ae940cad65458b"}, + {file = "pywin32-306-cp312-cp312-win_amd64.whl", hash = "sha256:37257794c1ad39ee9be652da0462dc2e394c8159dfd913a8a4e8eb6fd346da0e"}, + {file = "pywin32-306-cp312-cp312-win_arm64.whl", hash = "sha256:5821ec52f6d321aa59e2db7e0a35b997de60c201943557d108af9d4ae1ec7040"}, + {file = "pywin32-306-cp37-cp37m-win32.whl", hash = "sha256:1c73ea9a0d2283d889001998059f5eaaba3b6238f767c9cf2833b13e6a685f65"}, + {file = "pywin32-306-cp37-cp37m-win_amd64.whl", hash = "sha256:72c5f621542d7bdd4fdb716227be0dd3f8565c11b280be6315b06ace35487d36"}, + {file = "pywin32-306-cp38-cp38-win32.whl", hash = "sha256:e4c092e2589b5cf0d365849e73e02c391c1349958c5ac3e9d5ccb9a28e017b3a"}, + {file = "pywin32-306-cp38-cp38-win_amd64.whl", hash = "sha256:e8ac1ae3601bee6ca9f7cb4b5363bf1c0badb935ef243c4733ff9a393b1690c0"}, + {file = "pywin32-306-cp39-cp39-win32.whl", hash = "sha256:e25fd5b485b55ac9c057f67d94bc203f3f6595078d1fb3b458c9c28b7153a802"}, + {file = "pywin32-306-cp39-cp39-win_amd64.whl", hash = "sha256:39b61c15272833b5c329a2989999dcae836b1eed650252ab1b7bfbe1d59f30f4"}, ] [[package]] @@ -1787,89 +1790,89 @@ files = [ [[package]] name = "pyzmq" -version = "25.0.1" +version = "25.0.2" description = "Python bindings for 0MQ" category = "dev" optional = false python-versions = ">=3.6" files = [ - {file = "pyzmq-25.0.1-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:94f65e13e6df035b0ae90d49adfe7891aa4e7bdeaa65265729fecc04ab3eb0fe"}, - {file = "pyzmq-25.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f0399450d970990705ce47ed65f5efed3e4627dfc80628c3798100e7b72e023b"}, - {file = "pyzmq-25.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f29709b0431668a967d7ff0394b00a865e7b7dde827ee0a47938b705b7c4aec3"}, - {file = "pyzmq-25.0.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4fee9420b34c0ab426f105926a701a3d73f878fe77f07a1b92e0b78d1e2c795c"}, - {file = "pyzmq-25.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:57be375c6bc66b0f685cd298e5c1c3d7ee34a254145b8087aed6e25db372b0f3"}, - {file = "pyzmq-25.0.1-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:a3309b2c5a5be3d48c9ade77b340361764449aa22854ac65935b1e6c0cdabe2c"}, - {file = "pyzmq-25.0.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7574d24579e83ee8c5d3b14769e7ba895161c43a601e911dd89d449e545e00ad"}, - {file = "pyzmq-25.0.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:041d617091258133e602919b28fdce4d3e2f8aedcd1e8b34c599653bc288d59e"}, - {file = "pyzmq-25.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7897ba8c3fedc6b3023bad676ceb69dbf90c077ff18ae3133ba43db47417cc72"}, - {file = "pyzmq-25.0.1-cp310-cp310-win32.whl", hash = "sha256:c462f70dadbd4649e572ca7cd1e7cf3305a8c2afc53b84214c0a7c0c3af8a657"}, - {file = "pyzmq-25.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:e3a721710992cf0e213bbb7be48fb0f32202e8d01f556c196c870373bb9ad4f4"}, - {file = "pyzmq-25.0.1-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:b0a0fcf56279b9f3acc9b36a83feb7640c51b0db444b6870e4406d002be1d514"}, - {file = "pyzmq-25.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:95aff52fc847ea5755d2370f86e379ba2ed6eb67a0a6f90f0e8e99c553693b81"}, - {file = "pyzmq-25.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b55366e6c11e1ef7403d072b9867b62cf63eebd31dd038ef65bc8d65572854f6"}, - {file = "pyzmq-25.0.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:64a2bc72bcad705ee42a8fe877478ddadb7e260e806562833d3d814125e28a44"}, - {file = "pyzmq-25.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ca66aa24422d7f324acd5cb7fc7df616eb6f0205e059393fb108702e33e90c7"}, - {file = "pyzmq-25.0.1-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:58d5dfec2e2befd09b04c4683b3c984d2203cf6e054d0f9786be3826737ad612"}, - {file = "pyzmq-25.0.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3549292d65987e422e2c9f105b1485448381f489d8a6b6b040fc8b8f497bd578"}, - {file = "pyzmq-25.0.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5b1ca8b0df50d1ac88857ffe9ebd1347e0a5bb5f6e1d99940fdd7df0ffdefb49"}, - {file = "pyzmq-25.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a1a107e89cdcf799060ba4fa85fd3c942e19df7b24eb2600618b2406cc73c18e"}, - {file = "pyzmq-25.0.1-cp311-cp311-win32.whl", hash = "sha256:0f22ba4e9041549a5a3f5a545169dda52fa0aa7b5ef46b336cbe6679c4c3c134"}, - {file = "pyzmq-25.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:0644c0d5c73e4bfeee8148f638ab16ad783df1c4d6c2f968552a26a43fb002a1"}, - {file = "pyzmq-25.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:c5eb4b17d73b1fc208a4faa6b5918983ccc961770aa37741891f61db302dae4e"}, - {file = "pyzmq-25.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:649dd55948144a108041397f07c1299086ce1c85c2e166831db3a33dac1d0c7f"}, - {file = "pyzmq-25.0.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c99fd8d3efc138d6a7fb1e822133f62bb18ffec66dc6d398dcb2ac2ab8eb2cb0"}, - {file = "pyzmq-25.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:d72d69d4bb37c05a446d10bc40b391cf8fb7572654fb73fa69e7d2a395197e65"}, - {file = "pyzmq-25.0.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:036dbf8373aed4ccf56d58c561b23601b8f33919ec1093d8c77b37ac1259702d"}, - {file = "pyzmq-25.0.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:861c37649c75a2ecfc2034a32b9d5ca744e1e0cddcbf65afbd8027cf7d9755be"}, - {file = "pyzmq-25.0.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:92f04d63aecbb71d41f7db5f988167ef429f96d8197fd46684688cdb513e8a2e"}, - {file = "pyzmq-25.0.1-cp36-cp36m-win32.whl", hash = "sha256:866a4e918f1f4b2f83e9982b817df257910e3e50e456ffa74f141a10adcd11d1"}, - {file = "pyzmq-25.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:ec29c880b82cd38a63810a93b77e13f167e05732049101947772eed9ae805097"}, - {file = "pyzmq-25.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0241a334e39aa74e4ba0ae5f9e29521f1b48b8d56bf707f25f322c04eb423e99"}, - {file = "pyzmq-25.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3b7032f55b1ed2cd8c349a89e467dca2338b7765fab82cb64c3504e49adaf51"}, - {file = "pyzmq-25.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:960f98f562ee6a50ecf283bc62479d00f5ee10e9068a21683b9e961cd87c9261"}, - {file = "pyzmq-25.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:835da498b71570d56e5526de4d5b36fa10dd9b8a82e2c405f963afeb51ff5bdc"}, - {file = "pyzmq-25.0.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:21de2ef6099fa8d6a3c2dc15aaca58e9f9ffdcc7b82a246590aa9564815699d9"}, - {file = "pyzmq-25.0.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:1e448a5a294958e915a7e1b664e6fbfcd3814989d381fb068673317f6f3ea3f8"}, - {file = "pyzmq-25.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:40d909bdc8a2d64ad260925154712602ee6a0425ae0b08bce78a19adfdc2f05b"}, - {file = "pyzmq-25.0.1-cp37-cp37m-win32.whl", hash = "sha256:6ff37f2b818df25c887fd40bb434569db7ff66b35f5dfff6f40cc476aee92e3f"}, - {file = "pyzmq-25.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:f66ee27a0221771bbaa2cce456e8ca890569c3d18b08b955eb6420c12516537c"}, - {file = "pyzmq-25.0.1-cp38-cp38-macosx_10_15_universal2.whl", hash = "sha256:1003bbae89435eadec03b4fa3bb6516dd1529fb09ae5704284f7400cc77009ba"}, - {file = "pyzmq-25.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dde7a65a8bfa88aa1721add504320f8344272542291ce4e7c77993fa32901567"}, - {file = "pyzmq-25.0.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:20b6155429d3b57e9e7bd11f1680985ef8b5b0868f1a64073fb8c01326c7c80c"}, - {file = "pyzmq-25.0.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e37a764cbf91c1ed9a02e4fede79a414284aca2a0b7d92d82a3c7b82d678ec2d"}, - {file = "pyzmq-25.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa56a362066b3a853a64d35693a08046f640961efcc0e7643768916403e72e70"}, - {file = "pyzmq-25.0.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c4bdf1241886d39d816535d3ef9fc325bbf02470c9fd5f2cb62706eeb834f7f2"}, - {file = "pyzmq-25.0.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:446acbac24427ef42bff61a807ddcad8d03df78fb976184a4d7d6f4b1e7d8a67"}, - {file = "pyzmq-25.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b39847501d229e5fab155d88a565edfb182cdd3f7046f15a7f2df9c77cdc422d"}, - {file = "pyzmq-25.0.1-cp38-cp38-win32.whl", hash = "sha256:cba6b81b653d789d76e438c2e77b49f610b23e84b3bb43b99100f08a0a5d637b"}, - {file = "pyzmq-25.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:6eca6b90c4fb290efd27582780b5eaf048887a32b2c5fcd6330819192cb07b38"}, - {file = "pyzmq-25.0.1-cp39-cp39-macosx_10_15_universal2.whl", hash = "sha256:58207a6709e53b723105bac6bb3c6795ee134f7e71351f39c09d52ac235c6b0d"}, - {file = "pyzmq-25.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c62084f37682e7ee4064e8310078be4f6f7687bf528ae5761e2ba7216c5b8949"}, - {file = "pyzmq-25.0.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:9c44e9f04f8ed99c6f2e9e49f29d400d7557dd9e9e3f64e1e8a595aedc4258a2"}, - {file = "pyzmq-25.0.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c635d1c40d341835066931a018e378428dfbe0347ed4bb45a6b57f7d8c34196e"}, - {file = "pyzmq-25.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eef93b5574c9ff36b4be376555efd369bd55b99bcc7be72f23bd38102dd9392b"}, - {file = "pyzmq-25.0.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:44bc81099ab33388f6c061c1b194307d877428cb2b18282d0385584d5c73ed72"}, - {file = "pyzmq-25.0.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6d988844ed6caa21b0076b64671e83a136d93c57f1ae5a72b915661af55d313b"}, - {file = "pyzmq-25.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9d5eb6e88ae8a8734f239ffe1ed90559a426cf5b859b8ee66e0cd43fc5daf5c9"}, - {file = "pyzmq-25.0.1-cp39-cp39-win32.whl", hash = "sha256:f6b45db9de4c8adbf5fda58e827a32315d282cfb01e54dc74e7c7ccc0988c010"}, - {file = "pyzmq-25.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:47eeb94b78aa442568b85ad28f85bd37a9c3c34d052cbf8ebf8622c45f23a9cd"}, - {file = "pyzmq-25.0.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:0ed7475f3adf0c7750d75740b3267947b501a33f4625ceae709fda2e75ec9ed7"}, - {file = "pyzmq-25.0.1-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:6d09c22ed4d0afcc662d17c2429a03fc1fae7fe7e3bc1f413e744bccfeaabdc3"}, - {file = "pyzmq-25.0.1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:703ec5f5a8369c09d8f3eb626358bdb590a2b1375bcce8b7da01b3a03f8b8668"}, - {file = "pyzmq-25.0.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20aea31cc0d1f6c3fb4685db08b4c771545cf3fed3c4b4c8942c0a4e97042ec8"}, - {file = "pyzmq-25.0.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:b1c03b942557bb366fd3dc377a15763d5d688de1328228136c75e50f968333cc"}, - {file = "pyzmq-25.0.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4e8a5ced9d92837f52ccdae6351c627b5012669727bc3eede2dc0f581eca1d0e"}, - {file = "pyzmq-25.0.1-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:d78f840d88244272fb7252e47522b1179833aff7ec64583bda3d21259c9c2c20"}, - {file = "pyzmq-25.0.1-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c3f78fa80780e24d294f9421123cb3bd3b68677953c53da85273a22d1c983298"}, - {file = "pyzmq-25.0.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f6de4305e02560111a5d4555758faa85d44a5bff70cccff58dbf30c81a079f0"}, - {file = "pyzmq-25.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:34a1b1a8ce9b20e01aba71b9279d9b1d4e5980a6a4e42092180e16628a444ca1"}, - {file = "pyzmq-25.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:625759a0112af7c3fb560de5724d749729f00b901f7625d1a3f3fb38897544b1"}, - {file = "pyzmq-25.0.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8cff159b21438c24476a49865f3d5700c9cc5833600661bc0e672decec2ff357"}, - {file = "pyzmq-25.0.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4cc47652d990de9ef967c494c526d73920ef064fef0444355a7cebec6fc50542"}, - {file = "pyzmq-25.0.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44db5162a6881f7d740dec65917f38f9bfbc5ad9a10e06d7d5deebb27eb63939"}, - {file = "pyzmq-25.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:f38bf2c60a3f7b87cf5177043eb7a331a4f53bc9305a2452decbd42ad0c98741"}, - {file = "pyzmq-25.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:b1cf4becd15669bc62a41c1b1bb742e22ac25965134e4254cde82a4dc2554b1b"}, - {file = "pyzmq-25.0.1.tar.gz", hash = "sha256:44a24f7ce44e70d20e2a4c9ba5af70b4611df7a4b920eed2c8e0bdd5a5af225f"}, + {file = "pyzmq-25.0.2-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:ac178e666c097c8d3deb5097b58cd1316092fc43e8ef5b5fdb259b51da7e7315"}, + {file = "pyzmq-25.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:659e62e1cbb063151c52f5b01a38e1df6b54feccfa3e2509d44c35ca6d7962ee"}, + {file = "pyzmq-25.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8280ada89010735a12b968ec3ea9a468ac2e04fddcc1cede59cb7f5178783b9c"}, + {file = "pyzmq-25.0.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9b5eeb5278a8a636bb0abdd9ff5076bcbb836cd2302565df53ff1fa7d106d54"}, + {file = "pyzmq-25.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a2e5fe42dfe6b73ca120b97ac9f34bfa8414feb15e00e37415dbd51cf227ef6"}, + {file = "pyzmq-25.0.2-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:827bf60e749e78acb408a6c5af6688efbc9993e44ecc792b036ec2f4b4acf485"}, + {file = "pyzmq-25.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7b504ae43d37e282301da586529e2ded8b36d4ee2cd5e6db4386724ddeaa6bbc"}, + {file = "pyzmq-25.0.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:cb1f69a0a2a2b1aae8412979dd6293cc6bcddd4439bf07e4758d864ddb112354"}, + {file = "pyzmq-25.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2b9c9cc965cdf28381e36da525dcb89fc1571d9c54800fdcd73e3f73a2fc29bd"}, + {file = "pyzmq-25.0.2-cp310-cp310-win32.whl", hash = "sha256:24abbfdbb75ac5039205e72d6c75f10fc39d925f2df8ff21ebc74179488ebfca"}, + {file = "pyzmq-25.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:6a821a506822fac55d2df2085a52530f68ab15ceed12d63539adc32bd4410f6e"}, + {file = "pyzmq-25.0.2-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:9af0bb0277e92f41af35e991c242c9c71920169d6aa53ade7e444f338f4c8128"}, + {file = "pyzmq-25.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:54a96cf77684a3a537b76acfa7237b1e79a8f8d14e7f00e0171a94b346c5293e"}, + {file = "pyzmq-25.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88649b19ede1cab03b96b66c364cbbf17c953615cdbc844f7f6e5f14c5e5261c"}, + {file = "pyzmq-25.0.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:715cff7644a80a7795953c11b067a75f16eb9fc695a5a53316891ebee7f3c9d5"}, + {file = "pyzmq-25.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:312b3f0f066b4f1d17383aae509bacf833ccaf591184a1f3c7a1661c085063ae"}, + {file = "pyzmq-25.0.2-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:d488c5c8630f7e782e800869f82744c3aca4aca62c63232e5d8c490d3d66956a"}, + {file = "pyzmq-25.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:38d9f78d69bcdeec0c11e0feb3bc70f36f9b8c44fc06e5d06d91dc0a21b453c7"}, + {file = "pyzmq-25.0.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3059a6a534c910e1d5d068df42f60d434f79e6cc6285aa469b384fa921f78cf8"}, + {file = "pyzmq-25.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:6526d097b75192f228c09d48420854d53dfbc7abbb41b0e26f363ccb26fbc177"}, + {file = "pyzmq-25.0.2-cp311-cp311-win32.whl", hash = "sha256:5c5fbb229e40a89a2fe73d0c1181916f31e30f253cb2d6d91bea7927c2e18413"}, + {file = "pyzmq-25.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:ed15e3a2c3c2398e6ae5ce86d6a31b452dfd6ad4cd5d312596b30929c4b6e182"}, + {file = "pyzmq-25.0.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:032f5c8483c85bf9c9ca0593a11c7c749d734ce68d435e38c3f72e759b98b3c9"}, + {file = "pyzmq-25.0.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:374b55516393bfd4d7a7daa6c3b36d6dd6a31ff9d2adad0838cd6a203125e714"}, + {file = "pyzmq-25.0.2-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:08bfcc21b5997a9be4fefa405341320d8e7f19b4d684fb9c0580255c5bd6d695"}, + {file = "pyzmq-25.0.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:1a843d26a8da1b752c74bc019c7b20e6791ee813cd6877449e6a1415589d22ff"}, + {file = "pyzmq-25.0.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:b48616a09d7df9dbae2f45a0256eee7b794b903ddc6d8657a9948669b345f220"}, + {file = "pyzmq-25.0.2-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:d4427b4a136e3b7f85516c76dd2e0756c22eec4026afb76ca1397152b0ca8145"}, + {file = "pyzmq-25.0.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:26b0358e8933990502f4513c991c9935b6c06af01787a36d133b7c39b1df37fa"}, + {file = "pyzmq-25.0.2-cp36-cp36m-win32.whl", hash = "sha256:c8fedc3ccd62c6b77dfe6f43802057a803a411ee96f14e946f4a76ec4ed0e117"}, + {file = "pyzmq-25.0.2-cp36-cp36m-win_amd64.whl", hash = "sha256:2da6813b7995b6b1d1307329c73d3e3be2fd2d78e19acfc4eff2e27262732388"}, + {file = "pyzmq-25.0.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a35960c8b2f63e4ef67fd6731851030df68e4b617a6715dd11b4b10312d19fef"}, + {file = "pyzmq-25.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eef2a0b880ab40aca5a878933376cb6c1ec483fba72f7f34e015c0f675c90b20"}, + {file = "pyzmq-25.0.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:85762712b74c7bd18e340c3639d1bf2f23735a998d63f46bb6584d904b5e401d"}, + {file = "pyzmq-25.0.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:64812f29d6eee565e129ca14b0c785744bfff679a4727137484101b34602d1a7"}, + {file = "pyzmq-25.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:510d8e55b3a7cd13f8d3e9121edf0a8730b87d925d25298bace29a7e7bc82810"}, + {file = "pyzmq-25.0.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b164cc3c8acb3d102e311f2eb6f3c305865ecb377e56adc015cb51f721f1dda6"}, + {file = "pyzmq-25.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:28fdb9224a258134784a9cf009b59265a9dde79582fb750d4e88a6bcbc6fa3dc"}, + {file = "pyzmq-25.0.2-cp37-cp37m-win32.whl", hash = "sha256:dd771a440effa1c36d3523bc6ba4e54ff5d2e54b4adcc1e060d8f3ca3721d228"}, + {file = "pyzmq-25.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:9bdc40efb679b9dcc39c06d25629e55581e4c4f7870a5e88db4f1c51ce25e20d"}, + {file = "pyzmq-25.0.2-cp38-cp38-macosx_10_15_universal2.whl", hash = "sha256:1f82906a2d8e4ee310f30487b165e7cc8ed09c009e4502da67178b03083c4ce0"}, + {file = "pyzmq-25.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:21ec0bf4831988af43c8d66ba3ccd81af2c5e793e1bf6790eb2d50e27b3c570a"}, + {file = "pyzmq-25.0.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:abbce982a17c88d2312ec2cf7673985d444f1beaac6e8189424e0a0e0448dbb3"}, + {file = "pyzmq-25.0.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9e1d2f2d86fc75ed7f8845a992c5f6f1ab5db99747fb0d78b5e4046d041164d2"}, + {file = "pyzmq-25.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a2e92ff20ad5d13266bc999a29ed29a3b5b101c21fdf4b2cf420c09db9fb690e"}, + {file = "pyzmq-25.0.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:edbbf06cc2719889470a8d2bf5072bb00f423e12de0eb9ffec946c2c9748e149"}, + {file = "pyzmq-25.0.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:77942243ff4d14d90c11b2afd8ee6c039b45a0be4e53fb6fa7f5e4fd0b59da39"}, + {file = "pyzmq-25.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ab046e9cb902d1f62c9cc0eca055b1d11108bdc271caf7c2171487298f229b56"}, + {file = "pyzmq-25.0.2-cp38-cp38-win32.whl", hash = "sha256:ad761cfbe477236802a7ab2c080d268c95e784fe30cafa7e055aacd1ca877eb0"}, + {file = "pyzmq-25.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:8560756318ec7c4c49d2c341012167e704b5a46d9034905853c3d1ade4f55bee"}, + {file = "pyzmq-25.0.2-cp39-cp39-macosx_10_15_universal2.whl", hash = "sha256:ab2c056ac503f25a63f6c8c6771373e2a711b98b304614151dfb552d3d6c81f6"}, + {file = "pyzmq-25.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:cca8524b61c0eaaa3505382dc9b9a3bc8165f1d6c010fdd1452c224225a26689"}, + {file = "pyzmq-25.0.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:cfb9f7eae02d3ac42fbedad30006b7407c984a0eb4189a1322241a20944d61e5"}, + {file = "pyzmq-25.0.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5eaeae038c68748082137d6896d5c4db7927e9349237ded08ee1bbd94f7361c9"}, + {file = "pyzmq-25.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a31992a8f8d51663ebf79df0df6a04ffb905063083d682d4380ab8d2c67257c"}, + {file = "pyzmq-25.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:6a979e59d2184a0c8f2ede4b0810cbdd86b64d99d9cc8a023929e40dce7c86cc"}, + {file = "pyzmq-25.0.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:1f124cb73f1aa6654d31b183810febc8505fd0c597afa127c4f40076be4574e0"}, + {file = "pyzmq-25.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:65c19a63b4a83ae45d62178b70223adeee5f12f3032726b897431b6553aa25af"}, + {file = "pyzmq-25.0.2-cp39-cp39-win32.whl", hash = "sha256:83d822e8687621bed87404afc1c03d83fa2ce39733d54c2fd52d8829edb8a7ff"}, + {file = "pyzmq-25.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:24683285cc6b7bf18ad37d75b9db0e0fefe58404e7001f1d82bf9e721806daa7"}, + {file = "pyzmq-25.0.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4a4b4261eb8f9ed71f63b9eb0198dd7c934aa3b3972dac586d0ef502ba9ab08b"}, + {file = "pyzmq-25.0.2-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:62ec8d979f56c0053a92b2b6a10ff54b9ec8a4f187db2b6ec31ee3dd6d3ca6e2"}, + {file = "pyzmq-25.0.2-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:affec1470351178e892121b3414c8ef7803269f207bf9bef85f9a6dd11cde264"}, + {file = "pyzmq-25.0.2-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffc71111433bd6ec8607a37b9211f4ef42e3d3b271c6d76c813669834764b248"}, + {file = "pyzmq-25.0.2-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:6fadc60970714d86eff27821f8fb01f8328dd36bebd496b0564a500fe4a9e354"}, + {file = "pyzmq-25.0.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:269968f2a76c0513490aeb3ba0dc3c77b7c7a11daa894f9d1da88d4a0db09835"}, + {file = "pyzmq-25.0.2-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:f7c8b8368e84381ae7c57f1f5283b029c888504aaf4949c32e6e6fb256ec9bf0"}, + {file = "pyzmq-25.0.2-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:25e6873a70ad5aa31e4a7c41e5e8c709296edef4a92313e1cd5fc87bbd1874e2"}, + {file = "pyzmq-25.0.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b733076ff46e7db5504c5e7284f04a9852c63214c74688bdb6135808531755a3"}, + {file = "pyzmq-25.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:a6f6ae12478fdc26a6d5fdb21f806b08fa5403cd02fd312e4cb5f72df078f96f"}, + {file = "pyzmq-25.0.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:67da1c213fbd208906ab3470cfff1ee0048838365135a9bddc7b40b11e6d6c89"}, + {file = "pyzmq-25.0.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:531e36d9fcd66f18de27434a25b51d137eb546931033f392e85674c7a7cea853"}, + {file = "pyzmq-25.0.2-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:34a6fddd159ff38aa9497b2e342a559f142ab365576284bc8f77cb3ead1f79c5"}, + {file = "pyzmq-25.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b491998ef886662c1f3d49ea2198055a9a536ddf7430b051b21054f2a5831800"}, + {file = "pyzmq-25.0.2-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:5d496815074e3e3d183fe2c7fcea2109ad67b74084c254481f87b64e04e9a471"}, + {file = "pyzmq-25.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:56a94ab1d12af982b55ca96c6853db6ac85505e820d9458ac76364c1998972f4"}, + {file = "pyzmq-25.0.2.tar.gz", hash = "sha256:6b8c1bbb70e868dc88801aa532cae6bd4e3b5233784692b786f17ad2962e5149"}, ] [package.dependencies] @@ -1941,14 +1944,14 @@ files = [ [[package]] name = "setuptools" -version = "67.6.0" +version = "67.6.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "setuptools-67.6.0-py3-none-any.whl", hash = "sha256:b78aaa36f6b90a074c1fa651168723acbf45d14cb1196b6f02c0fd07f17623b2"}, - {file = "setuptools-67.6.0.tar.gz", hash = "sha256:2ee892cd5f29f3373097f5a814697e397cf3ce313616df0af11231e2ad118077"}, + {file = "setuptools-67.6.1-py3-none-any.whl", hash = "sha256:e728ca814a823bf7bf60162daf9db95b93d532948c4c0bea762ce62f60189078"}, + {file = "setuptools-67.6.1.tar.gz", hash = "sha256:257de92a9d50a60b8e22abfcbb771571fde0dbf3ec234463212027a4eeecbe9a"}, ] [package.extras] @@ -2214,14 +2217,14 @@ test = ["black (>=22.3.0,<23.0.0)", "coverage (>=6.2,<7.0)", "isort (>=5.0.6,<6. [[package]] name = "types-pyyaml" -version = "6.0.12.8" +version = "6.0.12.9" description = "Typing stubs for PyYAML" category = "main" optional = false python-versions = "*" files = [ - {file = "types-PyYAML-6.0.12.8.tar.gz", hash = "sha256:19304869a89d49af00be681e7b267414df213f4eb89634c4495fa62e8f942b9f"}, - {file = "types_PyYAML-6.0.12.8-py3-none-any.whl", hash = "sha256:5314a4b2580999b2ea06b2e5f9a7763d860d6e09cdf21c0e9561daa9cbd60178"}, + {file = "types-PyYAML-6.0.12.9.tar.gz", hash = "sha256:c51b1bd6d99ddf0aa2884a7a328810ebf70a4262c292195d3f4f9a0005f9eeb6"}, + {file = "types_PyYAML-6.0.12.9-py3-none-any.whl", hash = "sha256:5aed5aa66bd2d2e158f75dda22b059570ede988559f030cf294871d3b647e3e8"}, ] [[package]] @@ -2419,4 +2422,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "9acd2b7396be651321ac517873a398d1631a76918fefdb003f7f587f031d9ba1" +content-hash = "cd26951fcc1e0161bbb8be3cd9694f6d0d99c57e4c6f431ff00c435960da7593" diff --git a/pyproject.toml b/pyproject.toml index 2d2d3e4d6..4150cf0d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ google-search-results = "^2.4.1" google-api-python-client = "^2.79.0" typer = "^0.7.0" gunicorn = "^20.1.0" -langchain = "^0.0.113" +langchain = "~0.0.113" openai = "^0.27.2" types-pyyaml = "^6.0.12.8" From 1d1c19beca40f5700aa3e9d00f9f0d62b47e8470 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 10 Apr 2023 20:35:07 -0300 Subject: [PATCH 002/150] added button to open modal --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index ff13af901..287d3a068 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -117,6 +117,15 @@ export default function GenericNode({ )} ))} +
+ {" "} + +
Output
From 36b191d06bc3e213018e46565b5ffffd76dd538a Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 10 Apr 2023 21:04:42 -0300 Subject: [PATCH 003/150] custom icon on node modal and change type on contexts --- .../src/CustomNodes/GenericNode/index.tsx | 14 ++- src/frontend/src/contexts/index.tsx | 16 ++- src/frontend/src/modals/NodeModal/index.tsx | 113 ++++++++++++++++++ 3 files changed, 133 insertions(+), 10 deletions(-) create mode 100644 src/frontend/src/modals/NodeModal/index.tsx diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 287d3a068..a35f14452 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -10,6 +10,8 @@ import { typesContext } from "../../contexts/typesContext"; import { useContext, useRef } from "react"; import { NodeDataType } from "../../types/flow"; import { alertContext } from "../../contexts/alertContext"; +import { PopUpContext } from "../../contexts/popUpContext"; +import NodeModal from "../../modals/NodeModal"; export default function GenericNode({ data, @@ -21,6 +23,7 @@ export default function GenericNode({ const { setErrorData } = useContext(alertContext); const showError = useRef(true); const { types, deleteNode } = useContext(typesContext); + const {openPopUp} = useContext(PopUpContext) const Icon = nodeIcons[types[data.type]]; if (!Icon) { if (showError.current) { @@ -124,7 +127,16 @@ export default function GenericNode({ )} > {" "} - +
Output diff --git a/src/frontend/src/contexts/index.tsx b/src/frontend/src/contexts/index.tsx index 310606ea5..783bd108c 100644 --- a/src/frontend/src/contexts/index.tsx +++ b/src/frontend/src/contexts/index.tsx @@ -12,15 +12,13 @@ export default function ContextWrapper({ children }: { children: ReactNode }) { <> - - - - - {children} - - - - + + + + {children} + + + diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx new file mode 100644 index 000000000..2d0476d8d --- /dev/null +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -0,0 +1,113 @@ +import { Dialog, Transition } from "@headlessui/react"; +import { + XMarkIcon, +} from "@heroicons/react/24/outline"; +import { Fragment, useContext, useRef, useState } from "react"; +import { PopUpContext } from "../../contexts/popUpContext"; +import { NodeDataType } from "../../types/flow"; +import { nodeColors, nodeIcons } from "../../utils"; +import { typesContext } from "../../contexts/typesContext"; + +export default function NodeModal({ data }: { data: NodeDataType }) { + const [open, setOpen] = useState(true); + const { closePopUp } = useContext(PopUpContext); + const { types } = useContext(typesContext); + const ref = useRef(); + function setModalOpen(x: boolean) { + setOpen(x); + if (x === false) { + setTimeout(() => { + closePopUp(); + }, 300); + } + } + const Icon = nodeIcons[types[data.type]]; + return ( + + + +
+ + +
+
+ + +
+ +
+
+
+ +
+ + Edit text + +
+
+
+
+
+
content
+
+
+
+
+ +
+
+
+
+
+
+
+
+ ); +} From 1df0757a54a6ca23d1a9f2a09032fdf82b1be398 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 10 Apr 2023 21:07:40 -0300 Subject: [PATCH 004/150] custom title --- src/frontend/src/modals/NodeModal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx index 2d0476d8d..7ce868885 100644 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -80,7 +80,7 @@ export default function NodeModal({ data }: { data: NodeDataType }) { as="h3" className="text-lg font-medium dark:text-white leading-10 text-gray-900" > - Edit text + {data.type}
From 596263c42f929f8c4c24d55ec495f1f65f25ab18 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 10 Apr 2023 21:23:25 -0300 Subject: [PATCH 005/150] showing all properties of the node template --- .../src/modals/NodeModal/components/index.tsx | 1 + src/frontend/src/modals/NodeModal/index.tsx | 26 +++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 src/frontend/src/modals/NodeModal/components/index.tsx diff --git a/src/frontend/src/modals/NodeModal/components/index.tsx b/src/frontend/src/modals/NodeModal/components/index.tsx new file mode 100644 index 000000000..a7d78d90e --- /dev/null +++ b/src/frontend/src/modals/NodeModal/components/index.tsx @@ -0,0 +1 @@ +export const value=0 \ No newline at end of file diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx index 7ce868885..8b6f3e851 100644 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -1,7 +1,5 @@ import { Dialog, Transition } from "@headlessui/react"; -import { - XMarkIcon, -} from "@heroicons/react/24/outline"; +import { XMarkIcon } from "@heroicons/react/24/outline"; import { Fragment, useContext, useRef, useState } from "react"; import { PopUpContext } from "../../contexts/popUpContext"; import { NodeDataType } from "../../types/flow"; @@ -68,13 +66,13 @@ export default function NodeModal({ data }: { data: NodeDataType }) {
- +
-
content
+
+ {Object.keys(data.node.template) + .filter((t) => t.charAt(0) !== "_") + .map((t: string, idx) => ( +
{t}
+ ))} +
From 09db0734d752094b98cb6769a9e70ec9f55f207b Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 11 Apr 2023 20:21:30 -0300 Subject: [PATCH 006/150] str type components for options =false --- .../components/textAreaComponent/index.tsx | 1 - .../NodeModal/components/ModalField/index.tsx | 57 +++++++++++++++++++ src/frontend/src/modals/NodeModal/index.tsx | 31 +++++++++- 3 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 src/frontend/src/modals/NodeModal/components/ModalField/index.tsx diff --git a/src/frontend/src/components/textAreaComponent/index.tsx b/src/frontend/src/components/textAreaComponent/index.tsx index df61e1ae1..9efdfacbc 100644 --- a/src/frontend/src/components/textAreaComponent/index.tsx +++ b/src/frontend/src/components/textAreaComponent/index.tsx @@ -1,7 +1,6 @@ import { ArrowTopRightOnSquareIcon } from "@heroicons/react/24/outline"; import { useContext, useEffect, useState } from "react"; import { PopUpContext } from "../../contexts/popUpContext"; -import CodeAreaModal from "../../modals/codeAreaModal"; import TextAreaModal from "../../modals/textAreaModal"; import { TextAreaComponentType } from "../../types/components"; diff --git a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx new file mode 100644 index 000000000..f786f2bb1 --- /dev/null +++ b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx @@ -0,0 +1,57 @@ +import { useContext } from "react"; +import { TabsContext } from "../../../../contexts/tabsContext"; +import InputListComponent from "../../../../components/inputListComponent"; +import Dropdown from "../../../../components/dropdownComponent"; +import TextAreaComponent from "../../../../components/textAreaComponent"; +import InputComponent from "../../../../components/inputComponent"; + +export default function ModalField({ data, title, required, id, name, type }) { + const { save } = useContext(TabsContext); + console.log(name); + console.log(data.node.template[name].options); + + return ( +
+ {type === "str" && !data.node.template[name].options ? ( +
+ {data.node.template[name].list ? ( + { + data.node.template[name].value = t; + save(); + }} + /> + ) : data.node.template[name].multiline ? ( + { + data.node.template[name].value = t; + save(); + }} + /> + ) : ( + { + data.node.template[name].value = t; + save(); + }} + /> + )} +
+ ) : ( +
{name}
+ )} +
+ ); +} diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx index 8b6f3e851..e346914d8 100644 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -3,8 +3,9 @@ import { XMarkIcon } from "@heroicons/react/24/outline"; import { Fragment, useContext, useRef, useState } from "react"; import { PopUpContext } from "../../contexts/popUpContext"; import { NodeDataType } from "../../types/flow"; -import { nodeColors, nodeIcons } from "../../utils"; +import { nodeColors, nodeIcons, snakeToNormalCase } from "../../utils"; import { typesContext } from "../../contexts/typesContext"; +import ModalField from "./components/ModalField"; export default function NodeModal({ data }: { data: NodeDataType }) { const [open, setOpen] = useState(true); @@ -86,10 +87,36 @@ export default function NodeModal({ data }: { data: NodeDataType }) {
+ {/* str, code, bool, float, int,prompt, file, */} {Object.keys(data.node.template) .filter((t) => t.charAt(0) !== "_") .map((t: string, idx) => ( -
{t}
+
+ { + + } +
))}
From 4ddd47da10b9900cf8fd63012aa99f6f3b331409 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 11 Apr 2023 20:24:48 -0300 Subject: [PATCH 007/150] added bool toogle button --- .../NodeModal/components/ModalField/index.tsx | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx index f786f2bb1..7841c4499 100644 --- a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx +++ b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx @@ -1,14 +1,16 @@ -import { useContext } from "react"; +import { useContext, useState } from "react"; import { TabsContext } from "../../../../contexts/tabsContext"; import InputListComponent from "../../../../components/inputListComponent"; import Dropdown from "../../../../components/dropdownComponent"; import TextAreaComponent from "../../../../components/textAreaComponent"; import InputComponent from "../../../../components/inputComponent"; +import ToggleComponent from "../../../../components/toggleComponent"; export default function ModalField({ data, title, required, id, name, type }) { const { save } = useContext(TabsContext); - console.log(name); - console.log(data.node.template[name].options); + const [enabled, setEnabled] = useState( + data.node.template[name]?.value ?? false + ); return (
@@ -49,8 +51,21 @@ export default function ModalField({ data, title, required, id, name, type }) { /> )}
+ ) : type === "bool" ? ( +
+ {" "} + { + data.node.template[name].value = t; + setEnabled(t); + save(); + }} + /> +
) : ( -
{name}
+
)}
); From fef9f254d6676e4b1474dec4e5c31d9f5ece6f8b Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 11 Apr 2023 20:27:28 -0300 Subject: [PATCH 008/150] added floatComponent --- .../NodeModal/components/ModalField/index.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx index 7841c4499..3e33b56d8 100644 --- a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx +++ b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx @@ -5,6 +5,7 @@ import Dropdown from "../../../../components/dropdownComponent"; import TextAreaComponent from "../../../../components/textAreaComponent"; import InputComponent from "../../../../components/inputComponent"; import ToggleComponent from "../../../../components/toggleComponent"; +import FloatComponent from "../../../../components/floatComponent"; export default function ModalField({ data, title, required, id, name, type }) { const { save } = useContext(TabsContext); @@ -64,9 +65,16 @@ export default function ModalField({ data, title, required, id, name, type }) { }} />
- ) : ( -
- )} + ) : type ==="float"?( + { + data.node.template[name].value = t; + save(); + }} + /> + ):(
{name}
)}
); } From 74b7a17afc81aef685efcd8552531625c898ac3e Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 11 Apr 2023 20:29:04 -0300 Subject: [PATCH 009/150] added DropdownComponent --- .../NodeModal/components/ModalField/index.tsx | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx index 3e33b56d8..a319c5031 100644 --- a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx +++ b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx @@ -9,7 +9,7 @@ import FloatComponent from "../../../../components/floatComponent"; export default function ModalField({ data, title, required, id, name, type }) { const { save } = useContext(TabsContext); - const [enabled, setEnabled] = useState( + const [enabled, setEnabled] = useState( data.node.template[name]?.value ?? false ); @@ -65,16 +65,24 @@ export default function ModalField({ data, title, required, id, name, type }) { }} /> - ) : type ==="float"?( - { - data.node.template[name].value = t; - save(); - }} - /> - ):(
{name}
)} + ) : type === "float" ? ( + { + data.node.template[name].value = t; + save(); + }} + /> + ) : type === "str" && data.node.template[name].options ? ( + (data.node.template[name].value = newValue)} + value={data.node.template[name].value ?? "Choose an option"} + > + ) : ( +
{name}
+ )} ); } From 8413c4c6c0d0b6b70b111d0101ec63abc5243f0d Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 11 Apr 2023 20:37:40 -0300 Subject: [PATCH 010/150] added template for complicated type --- .../NodeModal/components/ModalField/index.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx index a319c5031..17ba5545f 100644 --- a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx +++ b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx @@ -6,6 +6,7 @@ import TextAreaComponent from "../../../../components/textAreaComponent"; import InputComponent from "../../../../components/inputComponent"; import ToggleComponent from "../../../../components/toggleComponent"; import FloatComponent from "../../../../components/floatComponent"; +import IntComponent from "../../../../components/intComponent"; export default function ModalField({ data, title, required, id, name, type }) { const { save } = useContext(TabsContext); @@ -80,6 +81,21 @@ export default function ModalField({ data, title, required, id, name, type }) { onSelect={(newValue) => (data.node.template[name].value = newValue)} value={data.node.template[name].value ?? "Choose an option"} > + ) : type === "int" ? ( + { + data.node.template[name].value = t; + save(); + }} + /> + ) : type === "file" ? ( +
file
+ ) : type === "prompt" ? ( +
code
+ ) : type === "code" ? ( +
code
) : (
{name}
)} From 394d6d4b4b0501fab1b9509cfbc6d790612cf20b Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 11 Apr 2023 20:41:22 -0300 Subject: [PATCH 011/150] added file component --- .../NodeModal/components/ModalField/index.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx index 17ba5545f..7d747c73e 100644 --- a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx +++ b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx @@ -7,6 +7,7 @@ import InputComponent from "../../../../components/inputComponent"; import ToggleComponent from "../../../../components/toggleComponent"; import FloatComponent from "../../../../components/floatComponent"; import IntComponent from "../../../../components/intComponent"; +import InputFileComponent from "../../../../components/inputFileComponent"; export default function ModalField({ data, title, required, id, name, type }) { const { save } = useContext(TabsContext); @@ -91,7 +92,19 @@ export default function ModalField({ data, title, required, id, name, type }) { }} /> ) : type === "file" ? ( -
file
+ { + data.node.template[name].value = t; + }} + fileTypes={data.node.template[name].fileTypes} + suffixes={data.node.template[name].suffixes} + onFileChange={(t: string) => { + data.node.template[name].content = t; + save(); + }} + > ) : type === "prompt" ? (
code
) : type === "code" ? ( From 3224cd8ed787813da10f1bbaea7ec7cc1a21d077 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 11 Apr 2023 20:43:07 -0300 Subject: [PATCH 012/150] comment text area component --- .../NodeModal/components/ModalField/index.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx index 7d747c73e..a6a16efbd 100644 --- a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx +++ b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx @@ -34,14 +34,15 @@ export default function ModalField({ data, title, required, id, name, type }) { }} /> ) : data.node.template[name].multiline ? ( - { - data.node.template[name].value = t; - save(); - }} - /> + // { + // data.node.template[name].value = t; + // save(); + // }} + // /> +
text area component
) : ( Date: Wed, 12 Apr 2023 19:57:52 -0300 Subject: [PATCH 013/150] first styling in nodeModal --- .../src/CustomNodes/GenericNode/index.tsx | 4 +- .../NodeModal/components/ModalField/index.tsx | 100 +++++++++++------- 2 files changed, 66 insertions(+), 38 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index a35f14452..5ed25268e 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -122,7 +122,7 @@ export default function GenericNode({ ))}
@@ -135,7 +135,7 @@ export default function GenericNode({ className="hover:text-blue-500" > {" "} - see all{" "} + show advanced{" "}
diff --git a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx index a6a16efbd..d0d7901e1 100644 --- a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx +++ b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx @@ -8,6 +8,8 @@ import ToggleComponent from "../../../../components/toggleComponent"; import FloatComponent from "../../../../components/floatComponent"; import IntComponent from "../../../../components/intComponent"; import InputFileComponent from "../../../../components/inputFileComponent"; +import PromptAreaComponent from "../../../../components/promptComponent"; +import CodeAreaComponent from "../../../../components/codeAreaComponent"; export default function ModalField({ data, title, required, id, name, type }) { const { save } = useContext(TabsContext); @@ -16,9 +18,10 @@ export default function ModalField({ data, title, required, id, name, type }) { ); return ( -
+
+ {title} {type === "str" && !data.node.template[name].options ? ( -
+
{data.node.template[name].list ? ( ) : data.node.template[name].multiline ? ( - // { - // data.node.template[name].value = t; - // save(); - // }} - // /> -
text area component
+ { + data.node.template[name].value = t; + save(); + }} + /> ) : ( ) : type === "bool" ? ( -
+
{" "}
) : type === "float" ? ( - { - data.node.template[name].value = t; - save(); - }} - /> +
+ { + data.node.template[name].value = t; + save(); + }} + /> +
) : type === "str" && data.node.template[name].options ? ( - (data.node.template[name].value = newValue)} - value={data.node.template[name].value ?? "Choose an option"} - > +
+ (data.node.template[name].value = newValue)} + value={data.node.template[name].value ?? "Choose an option"} + > +
) : type === "int" ? ( - { - data.node.template[name].value = t; - save(); - }} - /> +
+ { + data.node.template[name].value = t; + save(); + }} + /> +
) : type === "file" ? ( +
+
) : type === "prompt" ? ( -
code
+
+ { + data.node.template[name].value = t; + save(); + }} + /> +
) : type === "code" ? ( -
code
+
+ { + data.node.template[name].value = t; + save(); + }} + /> +
) : ( -
{name}
+
{type}
)}
); From 4206a2183ca0e196e27b05fb2801523e912f7a2f Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 12 Apr 2023 20:22:57 -0300 Subject: [PATCH 014/150] added LIFO history to popUp context --- src/frontend/src/contexts/popUpContext.tsx | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/frontend/src/contexts/popUpContext.tsx b/src/frontend/src/contexts/popUpContext.tsx index 1d4d28bc7..efa263146 100644 --- a/src/frontend/src/contexts/popUpContext.tsx +++ b/src/frontend/src/contexts/popUpContext.tsx @@ -1,33 +1,33 @@ import { createContext } from "react"; import React, { useState } from "react"; -//context to set JSX element on the DOM +// context to set JSX element on the DOM export const PopUpContext = createContext({ openPopUp: (popUpElement: JSX.Element) => {}, - closePopUp: () => {}, + closePopUp: () => {}, }); interface PopUpProviderProps { - children: React.ReactNode; + children: React.ReactNode; } const PopUpProvider = ({ children }: PopUpProviderProps) => { - const [popUpElement, setPopUpElement] = useState(null); + const [popUpElements, setPopUpElements] = useState([]); - const openPopUp = (element: JSX.Element) => { - setPopUpElement(element); - }; + const openPopUp = (element: JSX.Element) => { + setPopUpElements(prevPopUps => [element, ...prevPopUps]); + }; - const closePopUp = () => { - setPopUpElement(null); - }; + const closePopUp = () => { + setPopUpElements(prevPopUps => prevPopUps.slice(1)); + }; - return ( - - {children} - {popUpElement} - - ); + return ( + + {children} + {popUpElements[0]} + + ); }; export default PopUpProvider; From e97a1289888296afa2d675fa66271e1981a9c9b2 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 13 Apr 2023 00:36:05 -0300 Subject: [PATCH 015/150] align inputs --- .../NodeModal/components/ModalField/index.tsx | 87 ++++++++++--------- src/frontend/src/modals/NodeModal/index.tsx | 59 ++++++------- 2 files changed, 76 insertions(+), 70 deletions(-) diff --git a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx index d0d7901e1..d0d907551 100644 --- a/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx +++ b/src/frontend/src/modals/NodeModal/components/ModalField/index.tsx @@ -10,18 +10,27 @@ import IntComponent from "../../../../components/intComponent"; import InputFileComponent from "../../../../components/inputFileComponent"; import PromptAreaComponent from "../../../../components/promptComponent"; import CodeAreaComponent from "../../../../components/codeAreaComponent"; +import { classNames } from "../../../../utils"; export default function ModalField({ data, title, required, id, name, type }) { const { save } = useContext(TabsContext); const [enabled, setEnabled] = useState( data.node.template[name]?.value ?? false ); + const display = + type === "str" || + type === "int" || + type === "prompt" || + type === "bool" || + type === "float" || + type === "file" || + type === "code"; return ( -
- {title} +
+ {display && {title}} {type === "str" && !data.node.template[name].options ? ( -
+
{data.node.template[name].list ? (
) : type === "float" ? ( -
+
) : type === "str" && data.node.template[name].options ? ( -
+
(data.node.template[name].value = newValue)} @@ -90,7 +99,7 @@ export default function ModalField({ data, title, required, id, name, type }) { >
) : type === "int" ? ( -
+
) : type === "file" ? ( -
- { - data.node.template[name].value = t; - }} - fileTypes={data.node.template[name].fileTypes} - suffixes={data.node.template[name].suffixes} - onFileChange={(t: string) => { - data.node.template[name].content = t; - save(); - }} - > +
+ { + data.node.template[name].value = t; + }} + fileTypes={data.node.template[name].fileTypes} + suffixes={data.node.template[name].suffixes} + onFileChange={(t: string) => { + data.node.template[name].content = t; + save(); + }} + >
) : type === "prompt" ? ( -
- { - data.node.template[name].value = t; - save(); - }} - /> +
+ { + data.node.template[name].value = t; + save(); + }} + />
) : type === "code" ? ( -
- { - data.node.template[name].value = t; - save(); - }} - /> +
+ { + data.node.template[name].value = t; + save(); + }} + />
) : ( -
{type}
+
)}
); diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx index e346914d8..07f316215 100644 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -85,39 +85,36 @@ export default function NodeModal({ data }: { data: NodeDataType }) {
-
-
- {/* str, code, bool, float, int,prompt, file, */} +
+
{Object.keys(data.node.template) .filter((t) => t.charAt(0) !== "_") - .map((t: string, idx) => ( -
- { - - } -
- ))} + .map((t: string, idx) => { + return ( + + ); + })}
From ba271ff85fa8e080171a314dbe2c28d66ba55396 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 13 Apr 2023 00:47:55 -0300 Subject: [PATCH 016/150] advanced icon --- .../src/CustomNodes/GenericNode/index.tsx | 53 ++++++++++--------- src/frontend/src/modals/NodeModal/index.tsx | 2 +- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 5ed25268e..cce14fd49 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -1,4 +1,4 @@ -import { TrashIcon } from "@heroicons/react/24/outline"; +import { Cog6ToothIcon, TrashIcon } from "@heroicons/react/24/outline"; import { classNames, nodeColors, @@ -23,7 +23,7 @@ export default function GenericNode({ const { setErrorData } = useContext(alertContext); const showError = useRef(true); const { types, deleteNode } = useContext(typesContext); - const {openPopUp} = useContext(PopUpContext) + const { openPopUp } = useContext(PopUpContext); const Icon = nodeIcons[types[data.type]]; if (!Icon) { if (showError.current) { @@ -54,17 +54,32 @@ export default function GenericNode({ />
{data.type}
- +
+ + +
-
+
{data.node.description}
@@ -73,7 +88,7 @@ export default function GenericNode({ .filter((t) => t.charAt(0) !== "_") .map((t: string, idx) => (
- {idx === 0 ? ( + {/* {idx === 0 ? (
) : ( <> - )} + )} */} {data.node.template[t].show ? ( {" "} -
-
+ {/*
Output -
+
*/} - Finish editing + Done
From 040695dfa627d95ee36de5ecb35e7ab437f74846 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 13 Apr 2023 00:52:35 -0300 Subject: [PATCH 017/150] open pop up on input click --- .../components/codeAreaComponent/index.tsx | 17 +++- .../components/inputFileComponent/index.tsx | 1 + .../src/components/promptComponent/index.tsx | 83 +++++++++++++------ .../components/textAreaComponent/index.tsx | 2 +- src/frontend/src/modals/NodeModal/index.tsx | 59 ++++++------- 5 files changed, 106 insertions(+), 56 deletions(-) diff --git a/src/frontend/src/components/codeAreaComponent/index.tsx b/src/frontend/src/components/codeAreaComponent/index.tsx index 756296970..2086b467c 100644 --- a/src/frontend/src/components/codeAreaComponent/index.tsx +++ b/src/frontend/src/components/codeAreaComponent/index.tsx @@ -19,9 +19,24 @@ export default function CodeAreaComponent({ } }, [disabled, onChange]); return ( -
+
{ + openPopUp( + { + setMyValue(t); + onChange(t); + }} + /> + ); + }} className={ "truncate block w-full text-gray-500 px-3 py-2 rounded-md border border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" + (disabled ? " bg-gray-200" : "") diff --git a/src/frontend/src/components/inputFileComponent/index.tsx b/src/frontend/src/components/inputFileComponent/index.tsx index 36d13e918..cb915bce5 100644 --- a/src/frontend/src/components/inputFileComponent/index.tsx +++ b/src/frontend/src/components/inputFileComponent/index.tsx @@ -69,6 +69,7 @@ export default function InputFileComponent({ >
{ - if (disabled) { - setMyValue(""); - onChange(""); - } - }, [disabled, onChange]); - return ( -
-
- - {myValue !== "" ? myValue : 'Text empty'} - - -
-
- ); +export default function PromptAreaComponent({ + value, + onChange, + disabled, +}: TextAreaComponentType) { + const [myValue, setMyValue] = useState(value); + const { openPopUp } = useContext(PopUpContext); + useEffect(() => { + if (disabled) { + setMyValue(""); + onChange(""); + } + }, [disabled, onChange]); + return ( +
+
+ { + openPopUp( + { + setMyValue(t); + onChange(t); + }} + /> + ); + }} + className={ + "truncate block w-full text-gray-500 px-3 py-2 rounded-md border border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" + + (disabled ? " bg-gray-200" : "") + } + > + {myValue !== "" ? myValue : "Text empty"} + + +
+
+ ); } diff --git a/src/frontend/src/components/textAreaComponent/index.tsx b/src/frontend/src/components/textAreaComponent/index.tsx index 9efdfacbc..153de4ffa 100644 --- a/src/frontend/src/components/textAreaComponent/index.tsx +++ b/src/frontend/src/components/textAreaComponent/index.tsx @@ -16,7 +16,7 @@ export default function TextAreaComponent({ value, onChange, disabled }:TextArea return (
- {openPopUp( {setMyValue(t); onChange(t);}}/>)}} className={ "truncate block w-full text-gray-500 px-3 py-2 rounded-md border border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" + (disabled ? " bg-gray-200" : "") diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx index aad1a32fd..16c615524 100644 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -87,34 +87,37 @@ export default function NodeModal({ data }: { data: NodeDataType }) {
- {Object.keys(data.node.template) - .filter((t) => t.charAt(0) !== "_") - .map((t: string, idx) => { - return ( - - ); - })} + { + //&& data.node.template[t].advanced + Object.keys(data.node.template) + .filter((t) => t.charAt(0) !== "_") + .map((t: string, idx) => { + return ( + + ); + }) + }
From a78a71c997c2d24b0113f81088804c93f270975d Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 13 Apr 2023 01:10:13 -0300 Subject: [PATCH 018/150] required in advanced icon and items, need new variable from backend --- .../src/CustomNodes/GenericNode/index.tsx | 11 +++++++++++ .../NodeModal/components/ModalField/index.tsx | 15 +++++++++++++-- .../src/modals/NodeModal/components/index.tsx | 1 - 3 files changed, 24 insertions(+), 3 deletions(-) delete mode 100644 src/frontend/src/modals/NodeModal/components/index.tsx diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index cce14fd49..ab3b8f9f1 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -12,6 +12,7 @@ import { NodeDataType } from "../../types/flow"; import { alertContext } from "../../contexts/alertContext"; import { PopUpContext } from "../../contexts/popUpContext"; import NodeModal from "../../modals/NodeModal"; +import { relative } from "path"; export default function GenericNode({ data, @@ -56,11 +57,21 @@ export default function GenericNode({
+
+
+ ) +} \ No newline at end of file diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 11516f004..6393df55b 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -19,6 +19,7 @@ import { TabsContext } from "../../contexts/tabsContext"; import { ChatType } from "../../types/chat"; import ChatMessage from "./chatMessage"; import { NodeType } from "../../types/flow"; +import ChatTrigger from "./chatTrigger"; const _ = require("lodash"); @@ -258,34 +259,7 @@ export default function Chat({ flow, reactFlowInstance }: ChatType) {
- -
-
- -
-
-
+ ); } diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx new file mode 100644 index 000000000..93e4ed3d4 --- /dev/null +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -0,0 +1,102 @@ +import { Dialog, Transition } from "@headlessui/react"; +import { XMarkIcon, ClipboardDocumentListIcon } from "@heroicons/react/24/outline"; +import { Fragment, useContext, useRef, useState } from "react"; +import { PopUpContext } from "../../contexts/popUpContext"; + +export default function TextAreaModal(){ + const [open, setOpen] = useState(true); + const { closePopUp } = useContext(PopUpContext); + const ref = useRef(); + function setModalOpen(x:boolean){ + setOpen(x); + if(x === false){ + setTimeout(() => {closePopUp()}, 300); + } + } + return ( + + + +
+ + +
+
+ + +
+ +
+
+
+
+
+
+ + Edit text + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ ) +} \ No newline at end of file From 8ed1ea92d41c442183a384e14db1e67ee673cbde Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 24 Apr 2023 20:03:05 -0300 Subject: [PATCH 040/150] clean chat area --- .../src/CustomNodes/GenericNode/index.tsx | 2 +- .../chatComponent/chatTrigger/index.tsx | 16 +- src/frontend/src/modals/chatModal/index.tsx | 157 +++++++----------- src/frontend/src/utils.ts | 2 +- 4 files changed, 72 insertions(+), 105 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index ff13af901..f362ca8ff 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -38,7 +38,7 @@ export default function GenericNode({
diff --git a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx index f1841caba..6c4bbadde 100644 --- a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx +++ b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx @@ -1,8 +1,12 @@ import { Transition } from "@headlessui/react"; -import { Bars3CenterLeftIcon } from "@heroicons/react/24/outline"; +import { Bars3CenterLeftIcon, ChatBubbleBottomCenterTextIcon } from "@heroicons/react/24/outline"; import { nodeColors } from "../../../utils"; +import { PopUpContext } from "../../../contexts/popUpContext"; +import { useContext } from "react"; +import ChatModal from "../../../modals/chatModal"; export default function ChatTrigger({open, setOpen}){ + const {openPopUp} = useContext(PopUpContext) return( -
-
+
+
diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index 93e4ed3d4..6c232939f 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -1,102 +1,65 @@ import { Dialog, Transition } from "@headlessui/react"; -import { XMarkIcon, ClipboardDocumentListIcon } from "@heroicons/react/24/outline"; +import { + XMarkIcon, + ClipboardDocumentListIcon, +} from "@heroicons/react/24/outline"; import { Fragment, useContext, useRef, useState } from "react"; import { PopUpContext } from "../../contexts/popUpContext"; -export default function TextAreaModal(){ - const [open, setOpen] = useState(true); - const { closePopUp } = useContext(PopUpContext); - const ref = useRef(); - function setModalOpen(x:boolean){ - setOpen(x); - if(x === false){ - setTimeout(() => {closePopUp()}, 300); - } - } - return ( - - - -
- +export default function ChatModal() { + const [open, setOpen] = useState(true); + const { closePopUp } = useContext(PopUpContext); + const ref = useRef(); + function setModalOpen(x: boolean) { + setOpen(x); + if (x === false) { + setTimeout(() => { + closePopUp(); + }, 300); + } + } + return ( + + + +
+ -
-
- - -
- -
-
-
-
-
-
- - Edit text - -
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
- ) -} \ No newline at end of file +
+
+ + +
+
+
+
input area
+
+
+
+
+
+
+
+ ); +} diff --git a/src/frontend/src/utils.ts b/src/frontend/src/utils.ts index 405d56297..608035ff8 100644 --- a/src/frontend/src/utils.ts +++ b/src/frontend/src/utils.ts @@ -78,7 +78,7 @@ export const nodeColors: {[char: string]: string} = { tools: "#FF3434", memories: "#F5B85A", advanced: "#000000", - chat: "#454173", + chat: "#198BF6", thought:"#272541", embeddings:"#42BAA7", documentloaders:"#7AAE42", From 2c0b846f5411ffb090ba3341d84b0a3b64be1607 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 24 Apr 2023 21:02:23 -0300 Subject: [PATCH 041/150] migrate chat logic to chat modal --- .../chatComponent/chatTrigger/index.tsx | 4 +- .../src/components/chatComponent/index.tsx | 2 +- src/frontend/src/contexts/index.tsx | 6 +- src/frontend/src/modals/chatModal/index.tsx | 215 +++++++++++++++++- 4 files changed, 214 insertions(+), 13 deletions(-) diff --git a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx index 6c4bbadde..2f08ae92a 100644 --- a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx +++ b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx @@ -5,7 +5,7 @@ import { PopUpContext } from "../../../contexts/popUpContext"; import { useContext } from "react"; import ChatModal from "../../../modals/chatModal"; -export default function ChatTrigger({open, setOpen}){ +export default function ChatTrigger({open, setOpen,flow}){ const {openPopUp} = useContext(PopUpContext) return( { setOpen(true); - openPopUp() + openPopUp() }} >
diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 6393df55b..c18deb8de 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -259,7 +259,7 @@ export default function Chat({ flow, reactFlowInstance }: ChatType) {
- + ); } diff --git a/src/frontend/src/contexts/index.tsx b/src/frontend/src/contexts/index.tsx index 310606ea5..06c576b83 100644 --- a/src/frontend/src/contexts/index.tsx +++ b/src/frontend/src/contexts/index.tsx @@ -13,12 +13,10 @@ export default function ContextWrapper({ children }: { children: ReactNode }) { - - + - {children} + {children} - diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index 6c232939f..5d3c8df81 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -2,14 +2,177 @@ import { Dialog, Transition } from "@headlessui/react"; import { XMarkIcon, ClipboardDocumentListIcon, + LockClosedIcon, + PaperAirplaneIcon, } from "@heroicons/react/24/outline"; -import { Fragment, useContext, useRef, useState } from "react"; +import { Fragment, useContext, useEffect, useRef, useState } from "react"; import { PopUpContext } from "../../contexts/popUpContext"; +import { NodeType } from "../../types/flow"; +import { TabsContext } from "../../contexts/tabsContext"; +import { alertContext } from "../../contexts/alertContext"; +import { classNames, snakeToNormalCase } from "../../utils"; +import { sendAll } from "../../controllers/API"; +import { typesContext } from "../../contexts/typesContext"; +import ChatMessage from "../../components/chatComponent/chatMessage"; +const _ = require("lodash"); + +export default function ChatModal({ flow }) { + const { updateFlow, lockChat, setLockChat, flows, tabIndex } = + useContext(TabsContext); + const [saveChat, setSaveChat] = useState(false); + const [chatValue, setChatValue] = useState(""); + const [chatHistory, setChatHistory] = useState(flow.chat); + const { reactFlowInstance } = useContext(typesContext); + const { setErrorData, setNoticeData } = useContext(alertContext); + const addChatHistory = ( + message: string, + isSend: boolean, + thought?: string + ) => { + let tabsChange = false; + setChatHistory((old) => { + let newChat = _.cloneDeep(old); + if (JSON.stringify(flow.chat) !== JSON.stringify(old)) { + tabsChange = true; + return old; + } + if (thought) { + newChat.push({ message, isSend, thought }); + } else { + newChat.push({ message, isSend }); + } + return newChat; + }); + if (tabsChange) { + if (thought) { + updateFlow({ + ..._.cloneDeep(flow), + chat: [...flow.chat, { isSend, message, thought }], + }); + } else { + updateFlow({ + ..._.cloneDeep(flow), + chat: [...flow.chat, { isSend, message }], + }); + } + } + setSaveChat((chat) => !chat); + }; + useEffect(() => { + updateFlow({ ..._.cloneDeep(flow), chat: chatHistory }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [saveChat]); + useEffect(() => { + setChatHistory(flow.chat); + }, [flow]); + useEffect(() => { + if (ref.current) ref.current.scrollIntoView({ behavior: "smooth" }); + }, [chatHistory]); + + function validateNode(n: NodeType): Array { + if (!n.data?.node?.template || !Object.keys(n.data.node.template)) { + setNoticeData({ + title: + "We've noticed a potential issue with a node in the flow. Please review it and, if necessary, submit a bug report with your exported flow file. Thank you for your help!", + }); + return []; + } + + const { + type, + node: { template }, + } = n.data; + + return Object.keys(template).reduce( + (errors: Array, t) => + errors.concat( + template[t].required && + template[t].show && + (!template[t].value || template[t].value === "") && + !reactFlowInstance + .getEdges() + .some( + (e) => + e.targetHandle.split("|")[1] === t && + e.targetHandle.split("|")[2] === n.id + ) + ? [ + `${type} is missing ${ + template.display_name + ? template.display_name + : snakeToNormalCase(template[t].name) + }.`, + ] + : [] + ), + [] as string[] + ); + } + + function validateNodes() { + console.log(reactFlowInstance) + return reactFlowInstance + .getNodes() + .flatMap((n: NodeType) => validateNode(n)); + } + + const ref = useRef(null); + + function sendMessage() { + if (chatValue !== "") { + let nodeValidationErrors = validateNodes(); + if (nodeValidationErrors.length === 0) { + setLockChat(true); + let message = chatValue; + setChatValue(""); + addChatHistory(message, true); + + sendAll({ + ...reactFlowInstance.toObject(), + message, + chatHistory, + name: flow.name, + description: flow.description, + }) + .then((r) => { + addChatHistory(r.data.result, false, r.data.thought); + setLockChat(false); + }) + .catch((error) => { + setErrorData({ + title: error.message ?? "Unknown Error", + list: [error.response.data.detail], + }); + setLockChat(false); + let lastMessage; + setChatHistory((chatHistory) => { + let newChat = chatHistory; + + lastMessage = newChat.pop().message; + return newChat; + }); + setChatValue(lastMessage); + }); + } else { + setErrorData({ + title: "Oops! Looks like you missed some required information:", + list: nodeValidationErrors, + }); + } + } else { + setErrorData({ + title: "Error sending message", + list: ["The message cannot be empty."], + }); + } + } + function clearChat() { + setChatHistory([]); + updateFlow({ ..._.cloneDeep(flow), chat: [] }); + } -export default function ChatModal() { const [open, setOpen] = useState(true); const { closePopUp } = useContext(PopUpContext); - const ref = useRef(); function setModalOpen(x: boolean) { setOpen(x); if (x === false) { @@ -50,10 +213,50 @@ export default function ChatModal() { leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" > -
-
+
+ {chatHistory.map((c, i) => ( + + ))} +
+
+
+
+ { + if (event.key === "Enter" && !lockChat) { + sendMessage(); + } + }} + type="text" + disabled={lockChat} + value={lockChat ? "Thinking..." : chatValue} + onChange={(e) => { + setChatValue(e.target.value); + }} + className={classNames( + lockChat + ? "bg-gray-500 text-white" + : "dark:bg-gray-700", + "form-input block w-full rounded-md border-gray-300 dark:border-gray-600 dark:text-white pr-10 sm:text-sm" + )} + placeholder={"Send a message..."} + /> +
+ +
-
input area
From 020e9c8461fe7131005849d5ce08e2eacc6196bc Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 24 Apr 2023 21:10:51 -0300 Subject: [PATCH 042/150] chat modal working --- src/frontend/src/modals/chatModal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index 5d3c8df81..99f1b4ee0 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -213,7 +213,7 @@ export default function ChatModal({ flow }) { leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" > -
+
{chatHistory.map((c, i) => ( ))} From 68870301f3df0df7e95fc9f643f8e850f938628e Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 24 Apr 2023 22:04:25 -0300 Subject: [PATCH 043/150] chat modal messages firts version finished --- .../modals/chatModal/chatMessage/index.tsx | 69 +++++++++++++++++++ src/frontend/src/modals/chatModal/index.tsx | 6 +- 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 src/frontend/src/modals/chatModal/chatMessage/index.tsx diff --git a/src/frontend/src/modals/chatModal/chatMessage/index.tsx b/src/frontend/src/modals/chatModal/chatMessage/index.tsx new file mode 100644 index 000000000..c29c1c12c --- /dev/null +++ b/src/frontend/src/modals/chatModal/chatMessage/index.tsx @@ -0,0 +1,69 @@ +import { + ChatBubbleLeftEllipsisIcon, + ChatBubbleOvalLeftEllipsisIcon, + PlusSmallIcon, +} from "@heroicons/react/24/outline"; +import { useState } from "react"; +import { ChatMessageType } from "../../../types/chat"; +import { classNames } from "../../../utils"; +import { UserIcon } from "@heroicons/react/24/solid"; +var Convert = require("ansi-to-html"); +var convert = new Convert({ newline: true }); + +export default function ChatMessage({ chat }: { chat: ChatMessageType }) { + const [hidden, setHidden] = useState(true); + return ( +
+
+ {!chat.isSend && 🦜} + {chat.isSend && } +
+ {!chat.isSend ? ( +
+
+ {hidden && chat.thought && chat.thought !== "" && ( +
setHidden((prev) => !prev)} + className="absolute -top-1 -left-2 cursor-pointer" + > + +
+ )} + {chat.thought && chat.thought !== "" && !hidden && ( +
setHidden((prev) => !prev)} + className=" text-start inline-block w-full pb-3 pt-3 px-5 cursor-pointer" + dangerouslySetInnerHTML={{ + __html: convert.toHtml(chat.thought), + }} + >
+ )} + {chat.thought && chat.thought !== "" && !hidden &&

} +
+ {chat.message} +
+
+
+ ) : ( +
+
+ {chat.message} +
+
+ )} +
+ ); +} diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index 99f1b4ee0..b66acf612 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -13,7 +13,7 @@ import { alertContext } from "../../contexts/alertContext"; import { classNames, snakeToNormalCase } from "../../utils"; import { sendAll } from "../../controllers/API"; import { typesContext } from "../../contexts/typesContext"; -import ChatMessage from "../../components/chatComponent/chatMessage"; +import ChatMessage from "./chatMessage"; const _ = require("lodash"); export default function ChatModal({ flow }) { @@ -212,8 +212,8 @@ export default function ChatModal({ flow }) { leaveFrom="opacity-100 translate-y-0 sm:scale-100" leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" > - -
+ +
{chatHistory.map((c, i) => ( ))} From 152525deccd13447c0936d4373f15970dc387596 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 24 Apr 2023 23:10:51 -0300 Subject: [PATCH 044/150] chat clear --- src/frontend/package-lock.json | 8 ++++---- src/frontend/package.json | 2 +- .../src/modals/chatModal/chatMessage/index.tsx | 5 +++-- src/frontend/src/modals/chatModal/index.tsx | 14 +++++++++++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index 35d27c5f4..8491f6873 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -31,7 +31,7 @@ "react-cookie": "^4.1.1", "react-dom": "^18.2.0", "react-error-boundary": "^4.0.2", - "react-icons": "^4.7.1", + "react-icons": "^4.8.0", "react-laag": "^2.0.5", "react-router-dom": "^6.8.1", "react-scripts": "5.0.1", @@ -15040,9 +15040,9 @@ "integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==" }, "node_modules/react-icons": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.7.1.tgz", - "integrity": "sha512-yHd3oKGMgm7zxo3EA7H2n7vxSoiGmHk5t6Ou4bXsfcgWyhfDKMpyKfhHR6Bjnn63c+YXBLBPUql9H4wPJM6sXw==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.8.0.tgz", + "integrity": "sha512-N6+kOLcihDiAnj5Czu637waJqSnwlMNROzVZMhfX68V/9bu9qHaMIJC4UdozWoOk57gahFCNHwVvWzm0MTzRjg==", "peerDependencies": { "react": "*" } diff --git a/src/frontend/package.json b/src/frontend/package.json index 6eba117fc..feb11e814 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -26,7 +26,7 @@ "react-cookie": "^4.1.1", "react-dom": "^18.2.0", "react-error-boundary": "^4.0.2", - "react-icons": "^4.7.1", + "react-icons": "^4.8.0", "react-laag": "^2.0.5", "react-router-dom": "^6.8.1", "react-scripts": "5.0.1", diff --git a/src/frontend/src/modals/chatModal/chatMessage/index.tsx b/src/frontend/src/modals/chatModal/chatMessage/index.tsx index c29c1c12c..0cec858a4 100644 --- a/src/frontend/src/modals/chatModal/chatMessage/index.tsx +++ b/src/frontend/src/modals/chatModal/chatMessage/index.tsx @@ -7,6 +7,7 @@ import { useState } from "react"; import { ChatMessageType } from "../../../types/chat"; import { classNames } from "../../../utils"; import { UserIcon } from "@heroicons/react/24/solid"; +import {AiFillRobot} from "react-icons/ai" var Convert = require("ansi-to-html"); var convert = new Convert({ newline: true }); @@ -21,10 +22,10 @@ export default function ChatMessage({ chat }: { chat: ChatMessageType }) { >
- {!chat.isSend && 🦜} + {!chat.isSend && } {chat.isSend && }
{!chat.isSend ? ( diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index b66acf612..56213b031 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -14,6 +14,8 @@ import { classNames, snakeToNormalCase } from "../../utils"; import { sendAll } from "../../controllers/API"; import { typesContext } from "../../contexts/typesContext"; import ChatMessage from "./chatMessage"; +import { FaEraser } from "react-icons/fa"; + const _ = require("lodash"); export default function ChatModal({ flow }) { @@ -110,7 +112,7 @@ export default function ChatModal({ flow }) { } function validateNodes() { - console.log(reactFlowInstance) + console.log(reactFlowInstance); return reactFlowInstance .getNodes() .flatMap((n: NodeType) => validateNode(n)); @@ -198,7 +200,7 @@ export default function ChatModal({ flow }) { leaveFrom="opacity-100" leaveTo="opacity-0" > -
+
@@ -212,7 +214,13 @@ export default function ChatModal({ flow }) { leaveFrom="opacity-100 translate-y-0 sm:scale-100" leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" > - + +
+ +
{chatHistory.map((c, i) => ( From 7c166162731ad46a2ef8fad4bb5e5643ccc41484 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 24 Apr 2023 23:21:22 -0300 Subject: [PATCH 045/150] chat popUp not using popUp context --- .../chatComponent/chatTrigger/index.tsx | 1 - .../src/components/chatComponent/index.tsx | 240 +----------------- src/frontend/src/modals/chatModal/index.tsx | 5 +- 3 files changed, 6 insertions(+), 240 deletions(-) diff --git a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx index 2f08ae92a..9d5f67e0c 100644 --- a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx +++ b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx @@ -22,7 +22,6 @@ export default function ChatTrigger({open, setOpen,flow}){ -
-
- {chatHistory.map((c, i) => ( - - ))} -
-
-
-
- { - if (event.key === "Enter" && !lockChat) { - sendMessage(); - } - }} - type="text" - disabled={lockChat} - value={lockChat ? "Thinking..." : chatValue} - onChange={(e) => { - setChatValue(e.target.value); - }} - className={classNames( - lockChat ? "bg-gray-500 text-white" : "dark:bg-gray-700", - "form-input block w-full rounded-md border-gray-300 dark:border-gray-600 dark:text-white pr-10 sm:text-sm" - )} - placeholder={"Send a message..."} - /> -
- -
-
-
-
-
- - + + ); } diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index 56213b031..15bc2a89a 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -1,7 +1,5 @@ import { Dialog, Transition } from "@headlessui/react"; import { - XMarkIcon, - ClipboardDocumentListIcon, LockClosedIcon, PaperAirplaneIcon, } from "@heroicons/react/24/outline"; @@ -18,7 +16,7 @@ import { FaEraser } from "react-icons/fa"; const _ = require("lodash"); -export default function ChatModal({ flow }) { +export default function ChatModal({ flow,open, setOpen }) { const { updateFlow, lockChat, setLockChat, flows, tabIndex } = useContext(TabsContext); const [saveChat, setSaveChat] = useState(false); @@ -173,7 +171,6 @@ export default function ChatModal({ flow }) { updateFlow({ ..._.cloneDeep(flow), chat: [] }); } - const [open, setOpen] = useState(true); const { closePopUp } = useContext(PopUpContext); function setModalOpen(x: boolean) { setOpen(x); From ce7e9d02543ed5434bb7a4de58cd83c88225a283 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 24 Apr 2023 23:31:42 -0300 Subject: [PATCH 046/150] shortcut on ctrl shift k --- .../src/components/chatComponent/index.tsx | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 99e663713..5997deebf 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -1,31 +1,31 @@ -import { Transition } from "@headlessui/react"; import { - Bars3CenterLeftIcon, - LockClosedIcon, - PaperAirplaneIcon, - XMarkIcon, -} from "@heroicons/react/24/outline"; -import { - MouseEventHandler, - useContext, useEffect, useRef, useState, } from "react"; -import { sendAll } from "../../controllers/API"; -import { alertContext } from "../../contexts/alertContext"; -import { classNames, nodeColors, snakeToNormalCase } from "../../utils"; -import { TabsContext } from "../../contexts/tabsContext"; + import { ChatType } from "../../types/chat"; -import ChatMessage from "./chatMessage"; -import { NodeType } from "../../types/flow"; import ChatTrigger from "./chatTrigger"; import ChatModal from "../../modals/chatModal"; const _ = require("lodash"); export default function Chat({ flow }: ChatType) { + const [open, setOpen] = useState(false); + useEffect(() => { + const handleKeyDown = (event: KeyboardEvent) => { + console.log(event) + if (event.key === "K" && event.shiftKey && (event.metaKey||event.ctrlKey)) { + console.log("dfdsfds") + setOpen(oldState=>!oldState); + } + }; + document.addEventListener("keydown", handleKeyDown); + return () => { + document.removeEventListener("keydown", handleKeyDown); + }; + }, []); return ( <> From 7af5f68861483012909d5a7f1c8f6966005e44b1 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Tue, 25 Apr 2023 14:31:57 -0300 Subject: [PATCH 047/150] feat(validate): add debounced validation for nodes in GenericNode component fix(validate): set validation status to "success" or "error" based on response status feat(validate): add state for validation status and outline color in GenericNode component refactor(validate): use useDebouncedCallback hook for debouncing validation function refactor(validate): simplify useEffect dependencies in GenericNode component --- src/backend/langflow/api/validate.py | 2 +- .../src/CustomNodes/GenericNode/index.tsx | 341 +++++++++--------- 2 files changed, 180 insertions(+), 163 deletions(-) diff --git a/src/backend/langflow/api/validate.py b/src/backend/langflow/api/validate.py index d80010be4..e1b5a3a1a 100644 --- a/src/backend/langflow/api/validate.py +++ b/src/backend/langflow/api/validate.py @@ -46,7 +46,7 @@ def post_validate_node(node_id: str, data: dict): node = graph.get_node(node_id) if node is not None: _ = node.build() - return node.params + return str(node.params) raise Exception(f"Node {node_id} not found") except Exception as e: logger.exception(e) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index c96591cc9..93497c0fc 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -1,186 +1,203 @@ import { TrashIcon } from "@heroicons/react/24/outline"; +import { useDebouncedCallback } from "use-debounce"; import { - classNames, - nodeColors, - nodeIcons, - snakeToNormalCase, + classNames, + nodeColors, + nodeIcons, + snakeToNormalCase, } from "../../utils"; import ParameterComponent from "./components/parameterComponent"; import { typesContext } from "../../contexts/typesContext"; import { useContext, useState, useEffect, useRef } from "react"; import { NodeDataType } from "../../types/flow"; import { alertContext } from "../../contexts/alertContext"; -import { useCallback } from 'react'; +import { useCallback } from "react"; export default function GenericNode({ - data, - selected, + data, + selected, }: { - data: NodeDataType; - selected: boolean; + data: NodeDataType; + selected: boolean; }) { - const { setErrorData } = useContext(alertContext); - const showError = useRef(true); - const { types, deleteNode } = useContext(typesContext); - const Icon = nodeIcons[types[data.type]]; + const { setErrorData } = useContext(alertContext); + const showError = useRef(true); + const { types, deleteNode } = useContext(typesContext); + const Icon = nodeIcons[types[data.type]]; + const [validationStatus, setValidationStatus] = useState("idle"); + // State for outline color + const [isGreenOutline, setIsGreenOutline] = useState(false); + const [isRedOutline, setIsRedOutline] = useState(false); + const { reactFlowInstance } = useContext(typesContext); - // State for outline color - const [isGreenOutline, setIsGreenOutline] = useState(false); - const [isRedOutline, setIsRedOutline] = useState(false); - const { reactFlowInstance } = useContext(typesContext); + const debouncedValidateNode = useDebouncedCallback(async () => { + // Check if the validationStatus is "success" + if (validationStatus === "success") return; - const validateNode = useCallback(async () => { - try { - const response = await fetch(`/validate/node/${data.id}`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(reactFlowInstance.toObject()), - }); + try { + const response = await fetch(`/validate/node/${data.id}`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(reactFlowInstance.toObject()), + }); - if (response.status === 200) { - setIsGreenOutline(true); - setIsRedOutline(false); - } else if (response.status === 500) { - setIsRedOutline(true); - setIsGreenOutline(false); - } - } catch (error) { - console.error('Error validating node:', error); - setIsRedOutline(true); - } - }, [data.id, reactFlowInstance]); + if (response.status === 200) { + setValidationStatus("success"); + } else if (response.status === 500) { + setValidationStatus("error"); + } + } catch (error) { + console.error("Error validating node:", error); + setValidationStatus("error"); + } + }, 1000); - useEffect(() => { - validateNode(); - }, [ - validateNode, - ...Object.values(data.node.template).flatMap((t) => Object.values(t)), + const validateNode = useCallback(() => { + debouncedValidateNode(); + }, [debouncedValidateNode]); - ]); + useEffect(() => { + validateNode(); + }, [ + validateNode, + ...Object.values(data.node.template).flatMap((t) => Object.values(t)), + ]); - useEffect(() => { - if (isGreenOutline) { - setTimeout(() => { - setIsGreenOutline(false); - }, 1000); - } - }, [isGreenOutline]); + useEffect(() => { + if (validationStatus === "success") { + setIsGreenOutline(true); + setIsRedOutline(false); + setTimeout(() => { + setIsGreenOutline(false); + }, 1000); + } else if (validationStatus === "error") { + setIsRedOutline(true); + setIsGreenOutline(false); + } else { + setIsGreenOutline(false); + setIsRedOutline(false); + } + }, [validationStatus]); - const outlineColor = isGreenOutline ? 'animate-pulse-green' : isRedOutline ? 'border-red-outline' : ''; + const outlineColor = isGreenOutline + ? "animate-pulse-green" + : isRedOutline + ? "border-red-outline" + : ""; - if (!Icon) { - if (showError.current) { - setErrorData({ - title: data.type - ? `The ${data.type} node could not be rendered, please review your json file` - : "There was a node that can't be rendered, please review your json file", - }); - showError.current = false; - } - deleteNode(data.id); - return; - } + if (!Icon) { + if (showError.current) { + setErrorData({ + title: data.type + ? `The ${data.type} node could not be rendered, please review your json file` + : "There was a node that can't be rendered, please review your json file", + }); + showError.current = false; + } + deleteNode(data.id); + return; + } - return ( -
-
-
- -
{data.type}
-
- -
+ return ( +
+
+
+ +
{data.type}
+
+ +
-
-
- {data.node.description} -
+
+
+ {data.node.description} +
- <> - {Object.keys(data.node.template) - .filter((t) => t.charAt(0) !== "_") - .map((t: string, idx) => ( -
- {idx === 0 ? ( -
- !key.startsWith("_") && data.node.template[key].show - ).length === 0 - ? "hidden" - : "" - )} - > - Inputs -
- ) : ( - <> - )} - {data.node.template[t].show ? ( - - ) : ( - <> - )} -
- ))} -
- Output -
- - -
-
- ); + <> + {Object.keys(data.node.template) + .filter((t) => t.charAt(0) !== "_") + .map((t: string, idx) => ( +
+ {idx === 0 ? ( +
+ !key.startsWith("_") && data.node.template[key].show + ).length === 0 + ? "hidden" + : "" + )} + > + Inputs +
+ ) : ( + <> + )} + {data.node.template[t].show ? ( + + ) : ( + <> + )} +
+ ))} +
+ Output +
+ + +
+
+ ); } From ff9a2e66637be9bec990ec5e419d8e9ce0c7e889 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Tue, 25 Apr 2023 14:39:34 -0300 Subject: [PATCH 048/150] feat(frontend): add use-debounce package to dependencies in package.json --- src/frontend/package-lock.json | 12 ++++++++++++ src/frontend/package.json | 1 + 2 files changed, 13 insertions(+) diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index df61239c5..8e7c578ec 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -38,6 +38,7 @@ "reactflow": "^11.5.5", "tailwindcss": "^3.2.6", "typescript": "^4.9.5", + "use-debounce": "^9.0.4", "web-vitals": "^2.1.4" } }, @@ -17015,6 +17016,17 @@ "requires-port": "^1.0.0" } }, + "node_modules/use-debounce": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/use-debounce/-/use-debounce-9.0.4.tgz", + "integrity": "sha512-6X8H/mikbrt0XE8e+JXRtZ8yYVvKkdYRfmIhWZYsP8rcNs9hk3APV8Ua2mFkKRLcJKVdnX2/Vwrmg2GWKUQEaQ==", + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, "node_modules/use-sync-external-store": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", diff --git a/src/frontend/package.json b/src/frontend/package.json index b669569e3..bdc24b488 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -33,6 +33,7 @@ "reactflow": "^11.5.5", "tailwindcss": "^3.2.6", "typescript": "^4.9.5", + "use-debounce": "^9.0.4", "web-vitals": "^2.1.4" }, "scripts": { From f8f62834646fe651a7fe067ec3525e825aa86c59 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 25 Apr 2023 15:29:02 -0300 Subject: [PATCH 049/150] websocket first implementation --- src/frontend/src/modals/chatModal/index.tsx | 45 ++++++++++++++++----- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index 15bc2a89a..cb9397b46 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -1,22 +1,19 @@ import { Dialog, Transition } from "@headlessui/react"; -import { - LockClosedIcon, - PaperAirplaneIcon, -} from "@heroicons/react/24/outline"; +import { LockClosedIcon, PaperAirplaneIcon } from "@heroicons/react/24/outline"; import { Fragment, useContext, useEffect, useRef, useState } from "react"; import { PopUpContext } from "../../contexts/popUpContext"; -import { NodeType } from "../../types/flow"; +import { FlowType, NodeType } from "../../types/flow"; import { TabsContext } from "../../contexts/tabsContext"; import { alertContext } from "../../contexts/alertContext"; import { classNames, snakeToNormalCase } from "../../utils"; -import { sendAll } from "../../controllers/API"; import { typesContext } from "../../contexts/typesContext"; import ChatMessage from "./chatMessage"; import { FaEraser } from "react-icons/fa"; +import { sendAllProps } from "../../types/api"; const _ = require("lodash"); -export default function ChatModal({ flow,open, setOpen }) { +export default function ChatModal({ flow, open, setOpen }:{open:boolean,setOpen:Function,flow:FlowType}) { const { updateFlow, lockChat, setLockChat, flows, tabIndex } = useContext(TabsContext); const [saveChat, setSaveChat] = useState(false); @@ -24,6 +21,7 @@ export default function ChatModal({ flow,open, setOpen }) { const [chatHistory, setChatHistory] = useState(flow.chat); const { reactFlowInstance } = useContext(typesContext); const { setErrorData, setNoticeData } = useContext(alertContext); + const [ws, setWs] = useState(null); const addChatHistory = ( message: string, isSend: boolean, @@ -58,6 +56,31 @@ export default function ChatModal({ flow,open, setOpen }) { } setSaveChat((chat) => !chat); }; + + useEffect(() => { + const newWs = new WebSocket(`/chat/${flow.id}`); + newWs.onopen = () => { + console.log('WebSocket connection established!'); + }; + newWs.onmessage = (event) => { + const data = JSON.parse(event.data); + console.log('Received data:', data); + // Do something with the data received from the WebSocket + }; + setWs(newWs); + + return () => { + newWs.close(); + }; + }, []); + + async function sendAll(data: sendAllProps) { + if (ws) { + ws.send(JSON.stringify(data)); + } + return {data:{result:"sdsdsad",thought:"dsdsad"}} + } + useEffect(() => { updateFlow({ ..._.cloneDeep(flow), chat: chatHistory }); // eslint-disable-next-line react-hooks/exhaustive-deps @@ -213,9 +236,11 @@ export default function ChatModal({ flow,open, setOpen }) { >
-
From e4fdfdd6498ff252630d3305773465079d5fb767 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 25 Apr 2023 15:40:21 -0300 Subject: [PATCH 050/150] added new icon --- .../src/assets/Gooey Ring-5s-271px.svg | 40 +++++++++++++++++++ .../src/components/chatComponent/index.tsx | 2 - .../modals/chatModal/chatMessage/index.tsx | 4 +- src/frontend/src/modals/chatModal/index.tsx | 2 +- 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 src/frontend/src/assets/Gooey Ring-5s-271px.svg diff --git a/src/frontend/src/assets/Gooey Ring-5s-271px.svg b/src/frontend/src/assets/Gooey Ring-5s-271px.svg new file mode 100644 index 000000000..6c3433420 --- /dev/null +++ b/src/frontend/src/assets/Gooey Ring-5s-271px.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 5997deebf..0b251ee16 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -15,9 +15,7 @@ export default function Chat({ flow }: ChatType) { const [open, setOpen] = useState(false); useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { - console.log(event) if (event.key === "K" && event.shiftKey && (event.metaKey||event.ctrlKey)) { - console.log("dfdsfds") setOpen(oldState=>!oldState); } }; diff --git a/src/frontend/src/modals/chatModal/chatMessage/index.tsx b/src/frontend/src/modals/chatModal/chatMessage/index.tsx index 0cec858a4..d49d5244d 100644 --- a/src/frontend/src/modals/chatModal/chatMessage/index.tsx +++ b/src/frontend/src/modals/chatModal/chatMessage/index.tsx @@ -25,8 +25,8 @@ export default function ChatMessage({ chat }: { chat: ChatMessageType }) { "rounded-full w-8 h-8 flex items-center my-3 justify-center",chat.isSend?"bg-black":"bg-black" )} > - {!chat.isSend && } - {chat.isSend && } + {!chat.isSend && } + {chat.isSend && }
{!chat.isSend ? (
diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index cb9397b46..c1a0645ad 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -58,7 +58,7 @@ export default function ChatModal({ flow, open, setOpen }:{open:boolean,setOpen: }; useEffect(() => { - const newWs = new WebSocket(`/chat/${flow.id}`); + const newWs = new WebSocket(`ws://backend:7860/chat/${flow.id}`); newWs.onopen = () => { console.log('WebSocket connection established!'); }; From e1544aadae4a1b66c5414216760393d1fcb8b894 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Tue, 25 Apr 2023 16:35:17 -0300 Subject: [PATCH 051/150] chore(pyproject.toml): add websockets dependency refactor(chat_manager.py): remove redundant json.dumps() and convert BaseModel to dict before sending to websocket --- poetry.lock | 144 +++++++++++------------ pyproject.toml | 1 + src/backend/langflow/api/chat_manager.py | 11 +- 3 files changed, 81 insertions(+), 75 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6616801b0..01f7dc4a6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -4530,82 +4530,82 @@ files = [ [[package]] name = "websockets" -version = "11.0.1" +version = "11.0.2" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "websockets-11.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3d30cc1a90bcbf9e22e1f667c1c5a7428e2d37362288b4ebfd5118eb0b11afa9"}, - {file = "websockets-11.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dc77283a7c7b2b24e00fe8c3c4f7cf36bba4f65125777e906aae4d58d06d0460"}, - {file = "websockets-11.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0929c2ebdf00cedda77bf77685693e38c269011236e7c62182fee5848c29a4fa"}, - {file = "websockets-11.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db234da3aff01e8483cf0015b75486c04d50dbf90004bd3e5b46d384e1bd6c9e"}, - {file = "websockets-11.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7fdfbed727ce6b4b5e6622d15a6efb2098b2d9e22ba4dc54b2e3ce80f982045"}, - {file = "websockets-11.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5f3d0d177b3db3d1d02cce7ba6c0063586499ac28afe0c992be74ffc40d9257"}, - {file = "websockets-11.0.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:25ea5dbd3b00c56b034639dc6fe4d1dd095b8205bab1782d9a47cb020695fdf4"}, - {file = "websockets-11.0.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:dbeada3b8f1f6d9497840f761906c4236f912a42da4515520168bc7c525b52b0"}, - {file = "websockets-11.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:892959b627eedcdf98ac7022f9f71f050a59624b380b67862da10c32ea3c221a"}, - {file = "websockets-11.0.1-cp310-cp310-win32.whl", hash = "sha256:fc0a96a6828bfa6f1ccec62b54630bcdcc205d483f5a8806c0a8abb26101c54b"}, - {file = "websockets-11.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:3a88375b648a2c479532943cc19a018df1e5fcea85d5f31963c0b22794d1bdc1"}, - {file = "websockets-11.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3cf18bbd44b36749b7b66f047a30a40b799b8c0bd9a1b9173cba86a234b4306b"}, - {file = "websockets-11.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:deb0dd98ea4e76b833f0bfd7a6042b51115360d5dfcc7c1daa72dfc417b3327a"}, - {file = "websockets-11.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:45a85dc6b3ff76239379feb4355aadebc18d6e587c8deb866d11060755f4d3ea"}, - {file = "websockets-11.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d68bd2a3e9fff6f7043c0a711cb1ebba9f202c196a3943d0c885650cd0b6464"}, - {file = "websockets-11.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cfd0b9b18d64c51e5cd322e16b5bf4fe490db65c9f7b18fd5382c824062ead7e"}, - {file = "websockets-11.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef0e6253c36e42f2637cfa3ff9b3903df60d05ec040c718999f6a0644ce1c497"}, - {file = "websockets-11.0.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:12180bc1d72c6a9247472c1dee9dfd7fc2e23786f25feee7204406972d8dab39"}, - {file = "websockets-11.0.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:a797da96d4127e517a5cb0965cd03fd6ec21e02667c1258fa0579501537fbe5c"}, - {file = "websockets-11.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:07cc20655fb16aeef1a8f03236ba8671c61d332580b996b6396a5b7967ba4b3d"}, - {file = "websockets-11.0.1-cp311-cp311-win32.whl", hash = "sha256:a01c674e0efe0f14aec7e722ed0e0e272fa2f10e8ea8260837e1f4f5dc4b3e53"}, - {file = "websockets-11.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:2796f097841619acf053245f266a4f66cb27c040f0d9097e5f21301aab95ff43"}, - {file = "websockets-11.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:54d084756c50dfc8086dce97b945f210ca43950154e1e04a44a30c6e6a2bcbb1"}, - {file = "websockets-11.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fe2aed5963ca267c40a2d29b1ee4e8ab008ac8d5daa284fdda9275201b8a334"}, - {file = "websockets-11.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84e92dbac318a84fef722f38ca57acef19cbb89527aba5d420b96aa2656970ee"}, - {file = "websockets-11.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec4e87eb9916b481216b1fede7d8913be799915f5216a0c801867cbed8eeb903"}, - {file = "websockets-11.0.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d4e0990b6a04b07095c969969da659eecf9069cf8e7b8f49c8f5ee1bb50e3352"}, - {file = "websockets-11.0.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c90343fd0774749d23c1891dd8b3e9210f9afd30986673ce0f9d5857f5cb1562"}, - {file = "websockets-11.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ac042e8ba9d7f2618e84af27927fdce0f3e03528eb74f343977486c093868389"}, - {file = "websockets-11.0.1-cp37-cp37m-win32.whl", hash = "sha256:385c5391becb9b58e0a4f33345e12762fd857ccf9fbf6fee428669929ba45e4c"}, - {file = "websockets-11.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:aef1602db81096ce3d3847865128c8879635bdad7963fb2b7df290edb9e9150a"}, - {file = "websockets-11.0.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:52ba83ea132390e426f9a7b48848248a2dc0e7120ca8c65d5a8fc1efaa4eb51b"}, - {file = "websockets-11.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:007ed0d62f7e06eeb6e3a848b0d83b9fbd9e14674a59a61326845f27d20d7452"}, - {file = "websockets-11.0.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f888b9565ca1d1c25ab827d184f57f4772ffbfa6baf5710b873b01936cc335ee"}, - {file = "websockets-11.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db78535b791840a584c48cf3f4215eae38a7e2f43271ecd27ce4ba8a798beaaa"}, - {file = "websockets-11.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fa1c23ed3a02732fba906ec337df65d4cc23f9f453635e1a803c285b59c7d987"}, - {file = "websockets-11.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e039f106d48d3c241f1943bccfb383bd38ec39900d6dcaad0c73cc5fe129f346"}, - {file = "websockets-11.0.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b0ed24a3aa4213029e100257e5e73c5f912e70ca35630081de94b7f9e2cf4a9b"}, - {file = "websockets-11.0.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:d5a3022f9291bf2d35ebf65929297d625e68effd3a5647b8eb8b89d51b09394c"}, - {file = "websockets-11.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:1cb23597819f68ac6a6d133a002a1b3ef12a22850236b083242c93f81f206d5a"}, - {file = "websockets-11.0.1-cp38-cp38-win32.whl", hash = "sha256:349dd1fa56a30d530555988be98013688de67809f384671883f8bf8b8c9de984"}, - {file = "websockets-11.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:87ae582cf2319e45bc457a57232daded27a3c771263cab42fb8864214bbd74ea"}, - {file = "websockets-11.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a88815a0c6253ad1312ef186620832fb347706c177730efec34e3efe75e0e248"}, - {file = "websockets-11.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d5a6fa353b5ef36970c3bd1cd7cecbc08bb8f2f1a3d008b0691208cf34ebf5b0"}, - {file = "websockets-11.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5ffe6fc5e5fe9f2634cdc59b805e4ba1fcccf3a5622f5f36c3c7c287f606e283"}, - {file = "websockets-11.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b138f4bf8a64c344e12c76283dac279d11adab89ac62ae4a32ac8490d3c94832"}, - {file = "websockets-11.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aedd94422745da60672a901f53de1f50b16e85408b18672b9b210db4a776b5a6"}, - {file = "websockets-11.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4667d4e41fa37fa3d836b2603b8b40d6887fa4838496d48791036394f7ace39"}, - {file = "websockets-11.0.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:43e0de552be624e5c0323ff4fcc9f0b4a9a6dc6e0116b8aa2cbb6e0d3d2baf09"}, - {file = "websockets-11.0.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ceeef57b9aec8f27e523de4da73c518ece7721aefe7064f18aa28baabfe61b94"}, - {file = "websockets-11.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9d91279d57f6546eaf43671d1de50621e0578f13c2f17c96c458a72d170698d7"}, - {file = "websockets-11.0.1-cp39-cp39-win32.whl", hash = "sha256:29282631da3bfeb5db497e4d3d94d56ee36222fbebd0b51014e68a2e70736fb1"}, - {file = "websockets-11.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:e2654e94c705ce9b768441d8e3a387a84951ca1056efdc4a26a4a6ee723c01b6"}, - {file = "websockets-11.0.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:60a19d4ff5f451254f8623f6aa4169065f73a50ec7b59ab6b9dcddff4aa00267"}, - {file = "websockets-11.0.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2a58e83f82098d062ae5d4cbe7073b8783999c284d6f079f2fefe87cd8957ac8"}, - {file = "websockets-11.0.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b91657b65355954e47f0df874917fa200426b3a7f4e68073326a8cfc2f6deef8"}, - {file = "websockets-11.0.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53b8e1ee01eb5b8be5c8a69ae26b0820dbc198d092ad50b3451adc3cdd55d455"}, - {file = "websockets-11.0.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:5d8d5d17371ed9eb9f0e3a8d326bdf8172700164c2e705bc7f1905a719a189be"}, - {file = "websockets-11.0.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:e53419201c6c1439148feb99de6b307651a88b8defd41348cc23bbe2a290de1d"}, - {file = "websockets-11.0.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:718d19c494637f28e651031b3df6a791b9e86e0097c65ed5e8ec49b400b1210e"}, - {file = "websockets-11.0.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f7b2544eb3e7bc39ce59812371214cd97762080dab90c3afc857890039384753"}, - {file = "websockets-11.0.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec4a887d2236e3878c07033ad5566f6b4d5d954b85f92a219519a1745d0c93e9"}, - {file = "websockets-11.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:ae59a9f0a77ecb0cbdedea7d206a547ff136e8bfbc7d2d98772fb02d398797bb"}, - {file = "websockets-11.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ef35cef161f76031f833146f895e7e302196e01c704c00d269c04d8e18f3ac37"}, - {file = "websockets-11.0.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79b6548e57ab18f071b9bfe3ffe02af7184dd899bc674e2817d8fe7e9e7489ec"}, - {file = "websockets-11.0.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a8d9793f3fb0da16232503df14411dabafed5a81fc9077dc430cfc6f60e71179"}, - {file = "websockets-11.0.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42aa05e890fcf1faed8e535c088a1f0f27675827cbacf62d3024eb1e6d4c9e0c"}, - {file = "websockets-11.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:5d4f4b341100d313b08149d7031eb6d12738ac758b0c90d2f9be8675f401b019"}, - {file = "websockets-11.0.1-py3-none-any.whl", hash = "sha256:85b4127f7da332feb932eee833c70e5e1670469e8c9de7ef3874aa2a91a6fbb2"}, - {file = "websockets-11.0.1.tar.gz", hash = "sha256:369410925b240b30ef1c1deadbd6331e9cd865ad0b8966bf31e276cc8e0da159"}, + {file = "websockets-11.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:580cc95c58118f8c39106be71e24d0b7e1ad11a155f40a2ee687f99b3e5e432e"}, + {file = "websockets-11.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:143782041e95b63083b02107f31cda999f392903ae331de1307441f3a4557d51"}, + {file = "websockets-11.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8df63dcd955eb6b2e371d95aacf8b7c535e482192cff1b6ce927d8f43fb4f552"}, + {file = "websockets-11.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca9b2dced5cbbc5094678cc1ec62160f7b0fe4defd601cd28a36fde7ee71bbb5"}, + {file = "websockets-11.0.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0eeeea3b01c97fd3b5049a46c908823f68b59bf0e18d79b231d8d6764bc81ee"}, + {file = "websockets-11.0.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:502683c5dedfc94b9f0f6790efb26aa0591526e8403ad443dce922cd6c0ec83b"}, + {file = "websockets-11.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d3cc3e48b6c9f7df8c3798004b9c4b92abca09eeea5e1b0a39698f05b7a33b9d"}, + {file = "websockets-11.0.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:808b8a33c961bbd6d33c55908f7c137569b09ea7dd024bce969969aa04ecf07c"}, + {file = "websockets-11.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:34a6f8996964ccaa40da42ee36aa1572adcb1e213665e24aa2f1037da6080909"}, + {file = "websockets-11.0.2-cp310-cp310-win32.whl", hash = "sha256:8f24cd758cbe1607a91b720537685b64e4d39415649cac9177cd1257317cf30c"}, + {file = "websockets-11.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:3b87cd302f08ea9e74fdc080470eddbed1e165113c1823fb3ee6328bc40ca1d3"}, + {file = "websockets-11.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3565a8f8c7bdde7c29ebe46146bd191290413ee6f8e94cf350609720c075b0a1"}, + {file = "websockets-11.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f97e03d4d5a4f0dca739ea274be9092822f7430b77d25aa02da6775e490f6846"}, + {file = "websockets-11.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8f392587eb2767afa8a34e909f2fec779f90b630622adc95d8b5e26ea8823cb8"}, + {file = "websockets-11.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7742cd4524622cc7aa71734b51294644492a961243c4fe67874971c4d3045982"}, + {file = "websockets-11.0.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:46dda4bc2030c335abe192b94e98686615f9274f6b56f32f2dd661fb303d9d12"}, + {file = "websockets-11.0.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d6b2bfa1d884c254b841b0ff79373b6b80779088df6704f034858e4d705a4802"}, + {file = "websockets-11.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1df2413266bf48430ef2a752c49b93086c6bf192d708e4a9920544c74cd2baa6"}, + {file = "websockets-11.0.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:cf45d273202b0c1cec0f03a7972c655b93611f2e996669667414557230a87b88"}, + {file = "websockets-11.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a09cce3dacb6ad638fdfa3154d9e54a98efe7c8f68f000e55ca9c716496ca67"}, + {file = "websockets-11.0.2-cp311-cp311-win32.whl", hash = "sha256:2174a75d579d811279855df5824676d851a69f52852edb0e7551e0eeac6f59a4"}, + {file = "websockets-11.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:c78ca3037a954a4209b9f900e0eabbc471fb4ebe96914016281df2c974a93e3e"}, + {file = "websockets-11.0.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3a2100b02d1aaf66dc48ff1b2a72f34f6ebc575a02bc0350cc8e9fbb35940166"}, + {file = "websockets-11.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dca9708eea9f9ed300394d4775beb2667288e998eb6f542cdb6c02027430c599"}, + {file = "websockets-11.0.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:320ddceefd2364d4afe6576195201a3632a6f2e6d207b0c01333e965b22dbc84"}, + {file = "websockets-11.0.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2a573c8d71b7af937852b61e7ccb37151d719974146b5dc734aad350ef55a02"}, + {file = "websockets-11.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:13bd5bebcd16a4b5e403061b8b9dcc5c77e7a71e3c57e072d8dff23e33f70fba"}, + {file = "websockets-11.0.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:95c09427c1c57206fe04277bf871b396476d5a8857fa1b99703283ee497c7a5d"}, + {file = "websockets-11.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2eb042734e710d39e9bc58deab23a65bd2750e161436101488f8af92f183c239"}, + {file = "websockets-11.0.2-cp37-cp37m-win32.whl", hash = "sha256:5875f623a10b9ba154cb61967f940ab469039f0b5e61c80dd153a65f024d9fb7"}, + {file = "websockets-11.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:634239bc844131863762865b75211a913c536817c0da27f691400d49d256df1d"}, + {file = "websockets-11.0.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:3178d965ec204773ab67985a09f5696ca6c3869afeed0bb51703ea404a24e975"}, + {file = "websockets-11.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:955fcdb304833df2e172ce2492b7b47b4aab5dcc035a10e093d911a1916f2c87"}, + {file = "websockets-11.0.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cb46d2c7631b2e6f10f7c8bac7854f7c5e5288f024f1c137d4633c79ead1e3c0"}, + {file = "websockets-11.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25aae96c1060e85836552a113495db6d857400288161299d77b7b20f2ac569f2"}, + {file = "websockets-11.0.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2abeeae63154b7f63d9f764685b2d299e9141171b8b896688bd8baec6b3e2303"}, + {file = "websockets-11.0.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:daa1e8ea47507555ed7a34f8b49398d33dff5b8548eae3de1dc0ef0607273a33"}, + {file = "websockets-11.0.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:954eb789c960fa5daaed3cfe336abc066941a5d456ff6be8f0e03dd89886bb4c"}, + {file = "websockets-11.0.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:3ffe251a31f37e65b9b9aca5d2d67fd091c234e530f13d9dce4a67959d5a3fba"}, + {file = "websockets-11.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:adf6385f677ed2e0b021845b36f55c43f171dab3a9ee0ace94da67302f1bc364"}, + {file = "websockets-11.0.2-cp38-cp38-win32.whl", hash = "sha256:aa7b33c1fb2f7b7b9820f93a5d61ffd47f5a91711bc5fa4583bbe0c0601ec0b2"}, + {file = "websockets-11.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:220d5b93764dd70d7617f1663da64256df7e7ea31fc66bc52c0e3750ee134ae3"}, + {file = "websockets-11.0.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:0fb4480556825e4e6bf2eebdbeb130d9474c62705100c90e59f2f56459ddab42"}, + {file = "websockets-11.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ec00401846569aaf018700249996143f567d50050c5b7b650148989f956547af"}, + {file = "websockets-11.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:87c69f50281126dcdaccd64d951fb57fbce272578d24efc59bce72cf264725d0"}, + {file = "websockets-11.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:232b6ba974f5d09b1b747ac232f3a3d8f86de401d7b565e837cc86988edf37ac"}, + {file = "websockets-11.0.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:392d409178db1e46d1055e51cc850136d302434e12d412a555e5291ab810f622"}, + {file = "websockets-11.0.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4fe2442091ff71dee0769a10449420fd5d3b606c590f78dd2b97d94b7455640"}, + {file = "websockets-11.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ede13a6998ba2568b21825809d96e69a38dc43184bdeebbde3699c8baa21d015"}, + {file = "websockets-11.0.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:4c54086b2d2aec3c3cb887ad97e9c02c6be9f1d48381c7419a4aa932d31661e4"}, + {file = "websockets-11.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e37a76ccd483a6457580077d43bc3dfe1fd784ecb2151fcb9d1c73f424deaeba"}, + {file = "websockets-11.0.2-cp39-cp39-win32.whl", hash = "sha256:d1881518b488a920434a271a6e8a5c9481a67c4f6352ebbdd249b789c0467ddc"}, + {file = "websockets-11.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:25e265686ea385f22a00cc2b719b880797cd1bb53b46dbde969e554fb458bfde"}, + {file = "websockets-11.0.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ce69f5c742eefd039dce8622e99d811ef2135b69d10f9aa79fbf2fdcc1e56cd7"}, + {file = "websockets-11.0.2-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b985ba2b9e972cf99ddffc07df1a314b893095f62c75bc7c5354a9c4647c6503"}, + {file = "websockets-11.0.2-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1b52def56d2a26e0e9c464f90cadb7e628e04f67b0ff3a76a4d9a18dfc35e3dd"}, + {file = "websockets-11.0.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d70a438ef2a22a581d65ad7648e949d4ccd20e3c8ed7a90bbc46df4e60320891"}, + {file = "websockets-11.0.2-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:752fbf420c71416fb1472fec1b4cb8631c1aa2be7149e0a5ba7e5771d75d2bb9"}, + {file = "websockets-11.0.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:dd906b0cdc417ea7a5f13bb3c6ca3b5fd563338dc596996cb0fdd7872d691c0a"}, + {file = "websockets-11.0.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e79065ff6549dd3c765e7916067e12a9c91df2affea0ac51bcd302aaf7ad207"}, + {file = "websockets-11.0.2-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:46388a050d9e40316e58a3f0838c63caacb72f94129eb621a659a6e49bad27ce"}, + {file = "websockets-11.0.2-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c7de298371d913824f71b30f7685bb07ad13969c79679cca5b1f7f94fec012f"}, + {file = "websockets-11.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:6d872c972c87c393e6a49c1afbdc596432df8c06d0ff7cd05aa18e885e7cfb7c"}, + {file = "websockets-11.0.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:b444366b605d2885f0034dd889faf91b4b47668dd125591e2c64bfde611ac7e1"}, + {file = "websockets-11.0.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8b967a4849db6b567dec3f7dd5d97b15ce653e3497b8ce0814e470d5e074750"}, + {file = "websockets-11.0.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2acdc82099999e44fa7bd8c886f03c70a22b1d53ae74252f389be30d64fd6004"}, + {file = "websockets-11.0.2-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:518ed6782d9916c5721ebd61bb7651d244178b74399028302c8617d0620af291"}, + {file = "websockets-11.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:58477b041099bb504e1a5ddd8aa86302ed1d5c6995bdd3db2b3084ef0135d277"}, + {file = "websockets-11.0.2-py3-none-any.whl", hash = "sha256:5004c087d17251938a52cce21b3dbdabeecbbe432ce3f5bbbf15d8692c36eac9"}, + {file = "websockets-11.0.2.tar.gz", hash = "sha256:b1a69701eb98ed83dd099de4a686dc892c413d974fa31602bc00aca7cb988ac9"}, ] [[package]] @@ -4801,4 +4801,4 @@ cffi = ["cffi (>=1.11)"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "f0a23552d8cbd3d38722a69698cf823cdd19a90b707538837da64a933f8d13b4" +content-hash = "1320f2d5466c6569ee0563cc81b28d8c8897c8f07b4e0912c231c6e4033a2bf8" diff --git a/pyproject.toml b/pyproject.toml index bc0753c5d..4136785ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ fake-useragent = "^1.1.3" docstring-parser = "^0.15" psycopg2-binary = "^2.9.6" pyarrow = "^11.0.0" +websockets = "^11.0.2" [tool.poetry.group.dev.dependencies] black = "^23.1.0" diff --git a/src/backend/langflow/api/chat_manager.py b/src/backend/langflow/api/chat_manager.py index 5ce7d2452..bc9b2dc2d 100644 --- a/src/backend/langflow/api/chat_manager.py +++ b/src/backend/langflow/api/chat_manager.py @@ -89,7 +89,7 @@ class ChatManager: async def send_json(self, client_id: str, message: ChatMessage): websocket = self.active_connections[client_id] - await websocket.send_json(json.dumps(message.dict())) + await websocket.send_json(message.dict()) async def process_message(self, client_id: str, payload: Dict): # Process the graph data and chat message @@ -136,11 +136,16 @@ class ChatManager: try: chat_history = self.chat_history.get_history(client_id) - await websocket.send_json(json.dumps(chat_history)) + # iterate and make BaseModel into dict + chat_history = [chat.dict() for chat in chat_history] + await websocket.send_json(chat_history) while True: json_payload = await websocket.receive_json() - payload = json.loads(json_payload) + try: + payload = json.loads(json_payload) + except TypeError: + payload = json_payload with self.cache_manager.set_client_id(client_id): await self.process_message(client_id, payload) except Exception as e: From 4fd659703fa9cb9107cebb81505d154a902a358d Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 25 Apr 2023 16:35:44 -0300 Subject: [PATCH 052/150] socket small changes --- src/frontend/src/components/chatComponent/index.tsx | 2 +- .../src/modals/chatModal/chatMessage/index.tsx | 10 ++++------ src/frontend/src/modals/chatModal/index.tsx | 3 +-- src/frontend/src/svg.d.ts | 5 +++++ 4 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 src/frontend/src/svg.d.ts diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 0b251ee16..8108f3f36 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -26,7 +26,7 @@ export default function Chat({ flow }: ChatType) { }, []); return ( <> - + ); diff --git a/src/frontend/src/modals/chatModal/chatMessage/index.tsx b/src/frontend/src/modals/chatModal/chatMessage/index.tsx index d49d5244d..d960a149b 100644 --- a/src/frontend/src/modals/chatModal/chatMessage/index.tsx +++ b/src/frontend/src/modals/chatModal/chatMessage/index.tsx @@ -1,13 +1,11 @@ import { - ChatBubbleLeftEllipsisIcon, ChatBubbleOvalLeftEllipsisIcon, - PlusSmallIcon, } from "@heroicons/react/24/outline"; import { useState } from "react"; import { ChatMessageType } from "../../../types/chat"; import { classNames } from "../../../utils"; +import AiIcon from "../../../assets/Gooey Ring-5s-271px.svg" import { UserIcon } from "@heroicons/react/24/solid"; -import {AiFillRobot} from "react-icons/ai" var Convert = require("ansi-to-html"); var convert = new Convert({ newline: true }); @@ -22,11 +20,11 @@ export default function ChatMessage({ chat }: { chat: ChatMessageType }) { >
- {!chat.isSend && } - {chat.isSend && } + {!chat.isSend && } + {chat.isSend && }
{!chat.isSend ? (
diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index c1a0645ad..f0783a744 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -58,7 +58,7 @@ export default function ChatModal({ flow, open, setOpen }:{open:boolean,setOpen: }; useEffect(() => { - const newWs = new WebSocket(`ws://backend:7860/chat/${flow.id}`); + const newWs = new WebSocket(`ws://localhost:7860/chat/${flow.id}`); newWs.onopen = () => { console.log('WebSocket connection established!'); }; @@ -133,7 +133,6 @@ export default function ChatModal({ flow, open, setOpen }:{open:boolean,setOpen: } function validateNodes() { - console.log(reactFlowInstance); return reactFlowInstance .getNodes() .flatMap((n: NodeType) => validateNode(n)); diff --git a/src/frontend/src/svg.d.ts b/src/frontend/src/svg.d.ts new file mode 100644 index 000000000..a6e109e02 --- /dev/null +++ b/src/frontend/src/svg.d.ts @@ -0,0 +1,5 @@ +declare module '*.svg' { + const content: any; + export default content; + } + \ No newline at end of file From 9053eb81a0b1808dfd82008643c461d81708d4b1 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 25 Apr 2023 16:36:11 -0300 Subject: [PATCH 053/150] package-lock.json update --- package-lock.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..6d722a3cc --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "reactFlow", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} From 3c93e7308269a8982f16e8d7125b396955f900f1 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 25 Apr 2023 16:41:14 -0300 Subject: [PATCH 054/150] new poetry config for websocket --- poetry.lock | 161 ++++++++++++++++++++++++++----------------------- pyproject.toml | 1 + 2 files changed, 88 insertions(+), 74 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6616801b0..5419d50c1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. +# This file is automatically @generated by Poetry and should not be changed by hand. [[package]] name = "aiohttp" @@ -3837,7 +3837,7 @@ files = [ ] [package.dependencies] -greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and platform_machine == \"aarch64\" or python_version >= \"3\" and platform_machine == \"ppc64le\" or python_version >= \"3\" and platform_machine == \"x86_64\" or python_version >= \"3\" and platform_machine == \"amd64\" or python_version >= \"3\" and platform_machine == \"AMD64\" or python_version >= \"3\" and platform_machine == \"win32\" or python_version >= \"3\" and platform_machine == \"WIN32\""} +greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"} [package.extras] aiomysql = ["aiomysql", "greenlet (!=0.4.17)"] @@ -4016,6 +4016,10 @@ category = "main" optional = false python-versions = ">=3.8.0" files = [ + {file = "torch-2.0.0-1-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:c9090bda7d2eeeecd74f51b721420dbeb44f838d4536cc1b284e879417e3064a"}, + {file = "torch-2.0.0-1-cp311-cp311-manylinux2014_aarch64.whl", hash = "sha256:bd42db2a48a20574d2c33489e120e9f32789c4dc13c514b0c44272972d14a2d7"}, + {file = "torch-2.0.0-1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:8969aa8375bcbc0c2993e7ede0a7f889df9515f18b9b548433f412affed478d9"}, + {file = "torch-2.0.0-1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:ab2da16567cb55b67ae39e32d520d68ec736191d88ac79526ca5874754c32203"}, {file = "torch-2.0.0-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:7a9319a67294ef02459a19738bbfa8727bb5307b822dadd708bc2ccf6c901aca"}, {file = "torch-2.0.0-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:9f01fe1f6263f31bd04e1757946fd63ad531ae37f28bb2dbf66f5c826ee089f4"}, {file = "torch-2.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:527f4ae68df7b8301ee6b1158ca56350282ea633686537b30dbb5d7b4a52622a"}, @@ -4233,6 +4237,15 @@ category = "main" optional = false python-versions = "*" files = [ + {file = "triton-2.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:38806ee9663f4b0f7cd64790e96c579374089e58f49aac4a6608121aa55e2505"}, + {file = "triton-2.0.0-1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:226941c7b8595219ddef59a1fdb821e8c744289a132415ddd584facedeb475b1"}, + {file = "triton-2.0.0-1-cp36-cp36m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4c9fc8c89874bc48eb7e7b2107a9b8d2c0bf139778637be5bfccb09191685cfd"}, + {file = "triton-2.0.0-1-cp37-cp37m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d2684b6a60b9f174f447f36f933e9a45f31db96cb723723ecd2dcfd1c57b778b"}, + {file = "triton-2.0.0-1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9d4978298b74fcf59a75fe71e535c092b023088933b2f1df933ec32615e4beef"}, + {file = "triton-2.0.0-1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:74f118c12b437fb2ca25e1a04759173b517582fcf4c7be11913316c764213656"}, + {file = "triton-2.0.0-1-pp37-pypy37_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9618815a8da1d9157514f08f855d9e9ff92e329cd81c0305003eb9ec25cc5add"}, + {file = "triton-2.0.0-1-pp38-pypy38_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1aca3303629cd3136375b82cb9921727f804e47ebee27b2677fef23005c3851a"}, + {file = "triton-2.0.0-1-pp39-pypy39_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e3e13aa8b527c9b642e3a9defcc0fbd8ffbe1c80d8ac8c15a01692478dc64d8a"}, {file = "triton-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f05a7e64e4ca0565535e3d5d3405d7e49f9d308505bb7773d21fb26a4c008c2"}, {file = "triton-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb4b99ca3c6844066e516658541d876c28a5f6e3a852286bbc97ad57134827fd"}, {file = "triton-2.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47b4d70dc92fb40af553b4460492c31dc7d3a114a979ffb7a5cdedb7eb546c08"}, @@ -4530,82 +4543,82 @@ files = [ [[package]] name = "websockets" -version = "11.0.1" +version = "11.0.2" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "websockets-11.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3d30cc1a90bcbf9e22e1f667c1c5a7428e2d37362288b4ebfd5118eb0b11afa9"}, - {file = "websockets-11.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dc77283a7c7b2b24e00fe8c3c4f7cf36bba4f65125777e906aae4d58d06d0460"}, - {file = "websockets-11.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0929c2ebdf00cedda77bf77685693e38c269011236e7c62182fee5848c29a4fa"}, - {file = "websockets-11.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db234da3aff01e8483cf0015b75486c04d50dbf90004bd3e5b46d384e1bd6c9e"}, - {file = "websockets-11.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7fdfbed727ce6b4b5e6622d15a6efb2098b2d9e22ba4dc54b2e3ce80f982045"}, - {file = "websockets-11.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5f3d0d177b3db3d1d02cce7ba6c0063586499ac28afe0c992be74ffc40d9257"}, - {file = "websockets-11.0.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:25ea5dbd3b00c56b034639dc6fe4d1dd095b8205bab1782d9a47cb020695fdf4"}, - {file = "websockets-11.0.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:dbeada3b8f1f6d9497840f761906c4236f912a42da4515520168bc7c525b52b0"}, - {file = "websockets-11.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:892959b627eedcdf98ac7022f9f71f050a59624b380b67862da10c32ea3c221a"}, - {file = "websockets-11.0.1-cp310-cp310-win32.whl", hash = "sha256:fc0a96a6828bfa6f1ccec62b54630bcdcc205d483f5a8806c0a8abb26101c54b"}, - {file = "websockets-11.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:3a88375b648a2c479532943cc19a018df1e5fcea85d5f31963c0b22794d1bdc1"}, - {file = "websockets-11.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3cf18bbd44b36749b7b66f047a30a40b799b8c0bd9a1b9173cba86a234b4306b"}, - {file = "websockets-11.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:deb0dd98ea4e76b833f0bfd7a6042b51115360d5dfcc7c1daa72dfc417b3327a"}, - {file = "websockets-11.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:45a85dc6b3ff76239379feb4355aadebc18d6e587c8deb866d11060755f4d3ea"}, - {file = "websockets-11.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d68bd2a3e9fff6f7043c0a711cb1ebba9f202c196a3943d0c885650cd0b6464"}, - {file = "websockets-11.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cfd0b9b18d64c51e5cd322e16b5bf4fe490db65c9f7b18fd5382c824062ead7e"}, - {file = "websockets-11.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef0e6253c36e42f2637cfa3ff9b3903df60d05ec040c718999f6a0644ce1c497"}, - {file = "websockets-11.0.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:12180bc1d72c6a9247472c1dee9dfd7fc2e23786f25feee7204406972d8dab39"}, - {file = "websockets-11.0.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:a797da96d4127e517a5cb0965cd03fd6ec21e02667c1258fa0579501537fbe5c"}, - {file = "websockets-11.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:07cc20655fb16aeef1a8f03236ba8671c61d332580b996b6396a5b7967ba4b3d"}, - {file = "websockets-11.0.1-cp311-cp311-win32.whl", hash = "sha256:a01c674e0efe0f14aec7e722ed0e0e272fa2f10e8ea8260837e1f4f5dc4b3e53"}, - {file = "websockets-11.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:2796f097841619acf053245f266a4f66cb27c040f0d9097e5f21301aab95ff43"}, - {file = "websockets-11.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:54d084756c50dfc8086dce97b945f210ca43950154e1e04a44a30c6e6a2bcbb1"}, - {file = "websockets-11.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fe2aed5963ca267c40a2d29b1ee4e8ab008ac8d5daa284fdda9275201b8a334"}, - {file = "websockets-11.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84e92dbac318a84fef722f38ca57acef19cbb89527aba5d420b96aa2656970ee"}, - {file = "websockets-11.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec4e87eb9916b481216b1fede7d8913be799915f5216a0c801867cbed8eeb903"}, - {file = "websockets-11.0.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d4e0990b6a04b07095c969969da659eecf9069cf8e7b8f49c8f5ee1bb50e3352"}, - {file = "websockets-11.0.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c90343fd0774749d23c1891dd8b3e9210f9afd30986673ce0f9d5857f5cb1562"}, - {file = "websockets-11.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ac042e8ba9d7f2618e84af27927fdce0f3e03528eb74f343977486c093868389"}, - {file = "websockets-11.0.1-cp37-cp37m-win32.whl", hash = "sha256:385c5391becb9b58e0a4f33345e12762fd857ccf9fbf6fee428669929ba45e4c"}, - {file = "websockets-11.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:aef1602db81096ce3d3847865128c8879635bdad7963fb2b7df290edb9e9150a"}, - {file = "websockets-11.0.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:52ba83ea132390e426f9a7b48848248a2dc0e7120ca8c65d5a8fc1efaa4eb51b"}, - {file = "websockets-11.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:007ed0d62f7e06eeb6e3a848b0d83b9fbd9e14674a59a61326845f27d20d7452"}, - {file = "websockets-11.0.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f888b9565ca1d1c25ab827d184f57f4772ffbfa6baf5710b873b01936cc335ee"}, - {file = "websockets-11.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db78535b791840a584c48cf3f4215eae38a7e2f43271ecd27ce4ba8a798beaaa"}, - {file = "websockets-11.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fa1c23ed3a02732fba906ec337df65d4cc23f9f453635e1a803c285b59c7d987"}, - {file = "websockets-11.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e039f106d48d3c241f1943bccfb383bd38ec39900d6dcaad0c73cc5fe129f346"}, - {file = "websockets-11.0.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b0ed24a3aa4213029e100257e5e73c5f912e70ca35630081de94b7f9e2cf4a9b"}, - {file = "websockets-11.0.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:d5a3022f9291bf2d35ebf65929297d625e68effd3a5647b8eb8b89d51b09394c"}, - {file = "websockets-11.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:1cb23597819f68ac6a6d133a002a1b3ef12a22850236b083242c93f81f206d5a"}, - {file = "websockets-11.0.1-cp38-cp38-win32.whl", hash = "sha256:349dd1fa56a30d530555988be98013688de67809f384671883f8bf8b8c9de984"}, - {file = "websockets-11.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:87ae582cf2319e45bc457a57232daded27a3c771263cab42fb8864214bbd74ea"}, - {file = "websockets-11.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a88815a0c6253ad1312ef186620832fb347706c177730efec34e3efe75e0e248"}, - {file = "websockets-11.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d5a6fa353b5ef36970c3bd1cd7cecbc08bb8f2f1a3d008b0691208cf34ebf5b0"}, - {file = "websockets-11.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5ffe6fc5e5fe9f2634cdc59b805e4ba1fcccf3a5622f5f36c3c7c287f606e283"}, - {file = "websockets-11.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b138f4bf8a64c344e12c76283dac279d11adab89ac62ae4a32ac8490d3c94832"}, - {file = "websockets-11.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aedd94422745da60672a901f53de1f50b16e85408b18672b9b210db4a776b5a6"}, - {file = "websockets-11.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4667d4e41fa37fa3d836b2603b8b40d6887fa4838496d48791036394f7ace39"}, - {file = "websockets-11.0.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:43e0de552be624e5c0323ff4fcc9f0b4a9a6dc6e0116b8aa2cbb6e0d3d2baf09"}, - {file = "websockets-11.0.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ceeef57b9aec8f27e523de4da73c518ece7721aefe7064f18aa28baabfe61b94"}, - {file = "websockets-11.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9d91279d57f6546eaf43671d1de50621e0578f13c2f17c96c458a72d170698d7"}, - {file = "websockets-11.0.1-cp39-cp39-win32.whl", hash = "sha256:29282631da3bfeb5db497e4d3d94d56ee36222fbebd0b51014e68a2e70736fb1"}, - {file = "websockets-11.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:e2654e94c705ce9b768441d8e3a387a84951ca1056efdc4a26a4a6ee723c01b6"}, - {file = "websockets-11.0.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:60a19d4ff5f451254f8623f6aa4169065f73a50ec7b59ab6b9dcddff4aa00267"}, - {file = "websockets-11.0.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2a58e83f82098d062ae5d4cbe7073b8783999c284d6f079f2fefe87cd8957ac8"}, - {file = "websockets-11.0.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b91657b65355954e47f0df874917fa200426b3a7f4e68073326a8cfc2f6deef8"}, - {file = "websockets-11.0.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53b8e1ee01eb5b8be5c8a69ae26b0820dbc198d092ad50b3451adc3cdd55d455"}, - {file = "websockets-11.0.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:5d8d5d17371ed9eb9f0e3a8d326bdf8172700164c2e705bc7f1905a719a189be"}, - {file = "websockets-11.0.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:e53419201c6c1439148feb99de6b307651a88b8defd41348cc23bbe2a290de1d"}, - {file = "websockets-11.0.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:718d19c494637f28e651031b3df6a791b9e86e0097c65ed5e8ec49b400b1210e"}, - {file = "websockets-11.0.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f7b2544eb3e7bc39ce59812371214cd97762080dab90c3afc857890039384753"}, - {file = "websockets-11.0.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec4a887d2236e3878c07033ad5566f6b4d5d954b85f92a219519a1745d0c93e9"}, - {file = "websockets-11.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:ae59a9f0a77ecb0cbdedea7d206a547ff136e8bfbc7d2d98772fb02d398797bb"}, - {file = "websockets-11.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ef35cef161f76031f833146f895e7e302196e01c704c00d269c04d8e18f3ac37"}, - {file = "websockets-11.0.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79b6548e57ab18f071b9bfe3ffe02af7184dd899bc674e2817d8fe7e9e7489ec"}, - {file = "websockets-11.0.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a8d9793f3fb0da16232503df14411dabafed5a81fc9077dc430cfc6f60e71179"}, - {file = "websockets-11.0.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42aa05e890fcf1faed8e535c088a1f0f27675827cbacf62d3024eb1e6d4c9e0c"}, - {file = "websockets-11.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:5d4f4b341100d313b08149d7031eb6d12738ac758b0c90d2f9be8675f401b019"}, - {file = "websockets-11.0.1-py3-none-any.whl", hash = "sha256:85b4127f7da332feb932eee833c70e5e1670469e8c9de7ef3874aa2a91a6fbb2"}, - {file = "websockets-11.0.1.tar.gz", hash = "sha256:369410925b240b30ef1c1deadbd6331e9cd865ad0b8966bf31e276cc8e0da159"}, + {file = "websockets-11.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:580cc95c58118f8c39106be71e24d0b7e1ad11a155f40a2ee687f99b3e5e432e"}, + {file = "websockets-11.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:143782041e95b63083b02107f31cda999f392903ae331de1307441f3a4557d51"}, + {file = "websockets-11.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8df63dcd955eb6b2e371d95aacf8b7c535e482192cff1b6ce927d8f43fb4f552"}, + {file = "websockets-11.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca9b2dced5cbbc5094678cc1ec62160f7b0fe4defd601cd28a36fde7ee71bbb5"}, + {file = "websockets-11.0.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0eeeea3b01c97fd3b5049a46c908823f68b59bf0e18d79b231d8d6764bc81ee"}, + {file = "websockets-11.0.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:502683c5dedfc94b9f0f6790efb26aa0591526e8403ad443dce922cd6c0ec83b"}, + {file = "websockets-11.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d3cc3e48b6c9f7df8c3798004b9c4b92abca09eeea5e1b0a39698f05b7a33b9d"}, + {file = "websockets-11.0.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:808b8a33c961bbd6d33c55908f7c137569b09ea7dd024bce969969aa04ecf07c"}, + {file = "websockets-11.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:34a6f8996964ccaa40da42ee36aa1572adcb1e213665e24aa2f1037da6080909"}, + {file = "websockets-11.0.2-cp310-cp310-win32.whl", hash = "sha256:8f24cd758cbe1607a91b720537685b64e4d39415649cac9177cd1257317cf30c"}, + {file = "websockets-11.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:3b87cd302f08ea9e74fdc080470eddbed1e165113c1823fb3ee6328bc40ca1d3"}, + {file = "websockets-11.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3565a8f8c7bdde7c29ebe46146bd191290413ee6f8e94cf350609720c075b0a1"}, + {file = "websockets-11.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f97e03d4d5a4f0dca739ea274be9092822f7430b77d25aa02da6775e490f6846"}, + {file = "websockets-11.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8f392587eb2767afa8a34e909f2fec779f90b630622adc95d8b5e26ea8823cb8"}, + {file = "websockets-11.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7742cd4524622cc7aa71734b51294644492a961243c4fe67874971c4d3045982"}, + {file = "websockets-11.0.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:46dda4bc2030c335abe192b94e98686615f9274f6b56f32f2dd661fb303d9d12"}, + {file = "websockets-11.0.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d6b2bfa1d884c254b841b0ff79373b6b80779088df6704f034858e4d705a4802"}, + {file = "websockets-11.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1df2413266bf48430ef2a752c49b93086c6bf192d708e4a9920544c74cd2baa6"}, + {file = "websockets-11.0.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:cf45d273202b0c1cec0f03a7972c655b93611f2e996669667414557230a87b88"}, + {file = "websockets-11.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a09cce3dacb6ad638fdfa3154d9e54a98efe7c8f68f000e55ca9c716496ca67"}, + {file = "websockets-11.0.2-cp311-cp311-win32.whl", hash = "sha256:2174a75d579d811279855df5824676d851a69f52852edb0e7551e0eeac6f59a4"}, + {file = "websockets-11.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:c78ca3037a954a4209b9f900e0eabbc471fb4ebe96914016281df2c974a93e3e"}, + {file = "websockets-11.0.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3a2100b02d1aaf66dc48ff1b2a72f34f6ebc575a02bc0350cc8e9fbb35940166"}, + {file = "websockets-11.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dca9708eea9f9ed300394d4775beb2667288e998eb6f542cdb6c02027430c599"}, + {file = "websockets-11.0.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:320ddceefd2364d4afe6576195201a3632a6f2e6d207b0c01333e965b22dbc84"}, + {file = "websockets-11.0.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2a573c8d71b7af937852b61e7ccb37151d719974146b5dc734aad350ef55a02"}, + {file = "websockets-11.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:13bd5bebcd16a4b5e403061b8b9dcc5c77e7a71e3c57e072d8dff23e33f70fba"}, + {file = "websockets-11.0.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:95c09427c1c57206fe04277bf871b396476d5a8857fa1b99703283ee497c7a5d"}, + {file = "websockets-11.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2eb042734e710d39e9bc58deab23a65bd2750e161436101488f8af92f183c239"}, + {file = "websockets-11.0.2-cp37-cp37m-win32.whl", hash = "sha256:5875f623a10b9ba154cb61967f940ab469039f0b5e61c80dd153a65f024d9fb7"}, + {file = "websockets-11.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:634239bc844131863762865b75211a913c536817c0da27f691400d49d256df1d"}, + {file = "websockets-11.0.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:3178d965ec204773ab67985a09f5696ca6c3869afeed0bb51703ea404a24e975"}, + {file = "websockets-11.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:955fcdb304833df2e172ce2492b7b47b4aab5dcc035a10e093d911a1916f2c87"}, + {file = "websockets-11.0.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cb46d2c7631b2e6f10f7c8bac7854f7c5e5288f024f1c137d4633c79ead1e3c0"}, + {file = "websockets-11.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25aae96c1060e85836552a113495db6d857400288161299d77b7b20f2ac569f2"}, + {file = "websockets-11.0.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2abeeae63154b7f63d9f764685b2d299e9141171b8b896688bd8baec6b3e2303"}, + {file = "websockets-11.0.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:daa1e8ea47507555ed7a34f8b49398d33dff5b8548eae3de1dc0ef0607273a33"}, + {file = "websockets-11.0.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:954eb789c960fa5daaed3cfe336abc066941a5d456ff6be8f0e03dd89886bb4c"}, + {file = "websockets-11.0.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:3ffe251a31f37e65b9b9aca5d2d67fd091c234e530f13d9dce4a67959d5a3fba"}, + {file = "websockets-11.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:adf6385f677ed2e0b021845b36f55c43f171dab3a9ee0ace94da67302f1bc364"}, + {file = "websockets-11.0.2-cp38-cp38-win32.whl", hash = "sha256:aa7b33c1fb2f7b7b9820f93a5d61ffd47f5a91711bc5fa4583bbe0c0601ec0b2"}, + {file = "websockets-11.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:220d5b93764dd70d7617f1663da64256df7e7ea31fc66bc52c0e3750ee134ae3"}, + {file = "websockets-11.0.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:0fb4480556825e4e6bf2eebdbeb130d9474c62705100c90e59f2f56459ddab42"}, + {file = "websockets-11.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ec00401846569aaf018700249996143f567d50050c5b7b650148989f956547af"}, + {file = "websockets-11.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:87c69f50281126dcdaccd64d951fb57fbce272578d24efc59bce72cf264725d0"}, + {file = "websockets-11.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:232b6ba974f5d09b1b747ac232f3a3d8f86de401d7b565e837cc86988edf37ac"}, + {file = "websockets-11.0.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:392d409178db1e46d1055e51cc850136d302434e12d412a555e5291ab810f622"}, + {file = "websockets-11.0.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4fe2442091ff71dee0769a10449420fd5d3b606c590f78dd2b97d94b7455640"}, + {file = "websockets-11.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ede13a6998ba2568b21825809d96e69a38dc43184bdeebbde3699c8baa21d015"}, + {file = "websockets-11.0.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:4c54086b2d2aec3c3cb887ad97e9c02c6be9f1d48381c7419a4aa932d31661e4"}, + {file = "websockets-11.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e37a76ccd483a6457580077d43bc3dfe1fd784ecb2151fcb9d1c73f424deaeba"}, + {file = "websockets-11.0.2-cp39-cp39-win32.whl", hash = "sha256:d1881518b488a920434a271a6e8a5c9481a67c4f6352ebbdd249b789c0467ddc"}, + {file = "websockets-11.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:25e265686ea385f22a00cc2b719b880797cd1bb53b46dbde969e554fb458bfde"}, + {file = "websockets-11.0.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ce69f5c742eefd039dce8622e99d811ef2135b69d10f9aa79fbf2fdcc1e56cd7"}, + {file = "websockets-11.0.2-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b985ba2b9e972cf99ddffc07df1a314b893095f62c75bc7c5354a9c4647c6503"}, + {file = "websockets-11.0.2-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1b52def56d2a26e0e9c464f90cadb7e628e04f67b0ff3a76a4d9a18dfc35e3dd"}, + {file = "websockets-11.0.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d70a438ef2a22a581d65ad7648e949d4ccd20e3c8ed7a90bbc46df4e60320891"}, + {file = "websockets-11.0.2-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:752fbf420c71416fb1472fec1b4cb8631c1aa2be7149e0a5ba7e5771d75d2bb9"}, + {file = "websockets-11.0.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:dd906b0cdc417ea7a5f13bb3c6ca3b5fd563338dc596996cb0fdd7872d691c0a"}, + {file = "websockets-11.0.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e79065ff6549dd3c765e7916067e12a9c91df2affea0ac51bcd302aaf7ad207"}, + {file = "websockets-11.0.2-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:46388a050d9e40316e58a3f0838c63caacb72f94129eb621a659a6e49bad27ce"}, + {file = "websockets-11.0.2-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c7de298371d913824f71b30f7685bb07ad13969c79679cca5b1f7f94fec012f"}, + {file = "websockets-11.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:6d872c972c87c393e6a49c1afbdc596432df8c06d0ff7cd05aa18e885e7cfb7c"}, + {file = "websockets-11.0.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:b444366b605d2885f0034dd889faf91b4b47668dd125591e2c64bfde611ac7e1"}, + {file = "websockets-11.0.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8b967a4849db6b567dec3f7dd5d97b15ce653e3497b8ce0814e470d5e074750"}, + {file = "websockets-11.0.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2acdc82099999e44fa7bd8c886f03c70a22b1d53ae74252f389be30d64fd6004"}, + {file = "websockets-11.0.2-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:518ed6782d9916c5721ebd61bb7651d244178b74399028302c8617d0620af291"}, + {file = "websockets-11.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:58477b041099bb504e1a5ddd8aa86302ed1d5c6995bdd3db2b3084ef0135d277"}, + {file = "websockets-11.0.2-py3-none-any.whl", hash = "sha256:5004c087d17251938a52cce21b3dbdabeecbbe432ce3f5bbbf15d8692c36eac9"}, + {file = "websockets-11.0.2.tar.gz", hash = "sha256:b1a69701eb98ed83dd099de4a686dc892c413d974fa31602bc00aca7cb988ac9"}, ] [[package]] @@ -4801,4 +4814,4 @@ cffi = ["cffi (>=1.11)"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "f0a23552d8cbd3d38722a69698cf823cdd19a90b707538837da64a933f8d13b4" +content-hash = "1320f2d5466c6569ee0563cc81b28d8c8897c8f07b4e0912c231c6e4033a2bf8" diff --git a/pyproject.toml b/pyproject.toml index bc0753c5d..4136785ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ fake-useragent = "^1.1.3" docstring-parser = "^0.15" psycopg2-binary = "^2.9.6" pyarrow = "^11.0.0" +websockets = "^11.0.2" [tool.poetry.group.dev.dependencies] black = "^23.1.0" From 2d6854165024a6bdffa98e05e78b792a6a88db17 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Tue, 25 Apr 2023 17:30:53 -0300 Subject: [PATCH 055/150] refactor(api): remove sender field from ChatMessage and ChatResponse schemas fix(api): fix ChatManager.get_history method to exclude start and stream messages feat(api): add is_bot field to ChatMessage, ChatResponse, and FileResponse schemas --- src/backend/langflow/api/callback.py | 4 +--- src/backend/langflow/api/chat.py | 3 +-- src/backend/langflow/api/chat_manager.py | 30 +++++++++++------------- src/backend/langflow/api/schemas.py | 11 ++++----- 4 files changed, 20 insertions(+), 28 deletions(-) diff --git a/src/backend/langflow/api/callback.py b/src/backend/langflow/api/callback.py index 47a8d945c..cad4b1416 100644 --- a/src/backend/langflow/api/callback.py +++ b/src/backend/langflow/api/callback.py @@ -12,7 +12,5 @@ class StreamingLLMCallbackHandler(AsyncCallbackHandler): self.websocket = websocket async def on_llm_new_token(self, token: str, **kwargs: Any) -> None: - resp = ChatResponse( - sender="bot", message=token, type="stream", intermediate_steps="" - ) + resp = ChatResponse(message=token, type="stream", intermediate_steps="") await self.websocket.send_json(resp.dict()) diff --git a/src/backend/langflow/api/chat.py b/src/backend/langflow/api/chat.py index b2da73d52..d5c2dc879 100644 --- a/src/backend/langflow/api/chat.py +++ b/src/backend/langflow/api/chat.py @@ -8,6 +8,5 @@ chat_manager = ChatManager() @router.websocket("/chat/{client_id}") async def websocket_endpoint(client_id: str, websocket: WebSocket): + """Websocket endpoint for chat.""" await chat_manager.handle_websocket(client_id, websocket) - - diff --git a/src/backend/langflow/api/chat_manager.py b/src/backend/langflow/api/chat_manager.py index bc9b2dc2d..8f407a791 100644 --- a/src/backend/langflow/api/chat_manager.py +++ b/src/backend/langflow/api/chat_manager.py @@ -26,11 +26,17 @@ class ChatHistory(AsyncSubject): self.history: Dict[str, List[ChatMessage]] = defaultdict(list) async def add_message(self, client_id: str, message: ChatMessage): + """Add a message to the chat history.""" + self.history[client_id].append(message) await self.notify() def get_history(self, client_id: str) -> List[ChatMessage]: - return self.history[client_id] + """Get the chat history for a client.""" + if history := self.history.get(client_id, []): + return [msg for msg in history if msg.type not in ["start", "stream"]] + else: + return [] class ChatManager: @@ -46,7 +52,7 @@ class ChatManager: client_id = self.cache_manager.current_client_id if client_id in self.active_connections: chat_response = self.chat_history.get_history(client_id)[-1] - if chat_response.sender == "bot": + if chat_response.is_bot: # Process FileResponse if isinstance(chat_response, FileResponse): # If data_type is pandas, convert to csv @@ -63,7 +69,6 @@ class ChatManager: self.last_cached_object_dict = self.cache_manager.get_last() # Add a new ChatResponse with the data chat_response = FileResponse( - sender="bot", message=None, type="file", data=self.last_cached_object_dict["obj"], @@ -94,13 +99,11 @@ class ChatManager: async def process_message(self, client_id: str, payload: Dict): # Process the graph data and chat message chat_message = payload.pop("message", "") - chat_message = ChatMessage(sender="you", message=chat_message) + chat_message = ChatMessage(message=chat_message) await self.chat_history.add_message(client_id, chat_message) graph_data = payload - start_resp = ChatResponse( - sender="bot", message=None, type="start", intermediate_steps="" - ) + start_resp = ChatResponse(message=None, type="start", intermediate_steps="") await self.chat_history.add_message(client_id, start_resp) is_first_message = len(self.chat_history.get_history(client_id=client_id)) == 0 @@ -117,14 +120,9 @@ class ChatManager: except Exception as e: # Log stack trace logger.exception(e) - error_resp = ChatResponse( - sender="bot", message=str(e), type="error", intermediate_steps="" - ) - await self.send_json(client_id, error_resp) - return + raise e # Send a response back to the frontend, if needed response = ChatResponse( - sender="bot", message=result or "", intermediate_steps=intermediate_steps or "", type="end", @@ -151,6 +149,7 @@ class ChatManager: except Exception as e: # Handle any exceptions that might occur print(f"Error: {e}") + raise e finally: self.disconnect(client_id) @@ -198,11 +197,10 @@ def try_setting_streaming_options(langchain_object, websocket): llm = langchain_object.llm_chain.llm if isinstance(llm, (OpenAI, ChatOpenAI, AzureOpenAI, AzureChatOpenAI)): llm.streaming = bool(hasattr(llm, "streaming")) - - if hasattr(langchain_object, "callback_manager"): stream_handler = StreamingLLMCallbackHandler(websocket) stream_manager = AsyncCallbackManager([stream_handler]) - langchain_object.callback_manager = stream_manager + llm.callback_manager = stream_manager + return langchain_object diff --git a/src/backend/langflow/api/schemas.py b/src/backend/langflow/api/schemas.py index 1aefe5c8e..c9b210210 100644 --- a/src/backend/langflow/api/schemas.py +++ b/src/backend/langflow/api/schemas.py @@ -5,14 +5,9 @@ from pydantic import BaseModel, validator class ChatMessage(BaseModel): """Chat message schema.""" - sender: str + is_bot: bool = False message: Union[str, None] = None - - @validator("sender") - def sender_must_be_bot_or_you(cls, v): - if v not in ["bot", "you"]: - raise ValueError("sender must be bot or you") - return v + type: str = "human" class ChatResponse(ChatMessage): @@ -20,6 +15,7 @@ class ChatResponse(ChatMessage): intermediate_steps: str type: str + is_bot: bool = True @validator("type") def validate_message_type(cls, v): @@ -34,6 +30,7 @@ class FileResponse(ChatMessage): data: Any data_type: str type: str = "file" + is_bot: bool = True @validator("data_type") def validate_data_type(cls, v): From b526c436cd6d4a2f65e0249044de8176d117170e Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 25 Apr 2023 17:34:14 -0300 Subject: [PATCH 056/150] removed chat history from flow save --- .../src/components/chatComponent/index.tsx | 3 +- src/frontend/src/contexts/tabsContext.tsx | 55 ++++++++------- src/frontend/src/modals/chatModal/index.tsx | 69 ++++++++----------- src/frontend/src/types/flow/index.ts | 1 - 4 files changed, 60 insertions(+), 68 deletions(-) diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 8108f3f36..668a970bd 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -4,14 +4,13 @@ import { useState, } from "react"; -import { ChatType } from "../../types/chat"; +import { ChatMessageType, ChatType } from "../../types/chat"; import ChatTrigger from "./chatTrigger"; import ChatModal from "../../modals/chatModal"; const _ = require("lodash"); export default function Chat({ flow }: ChatType) { - const [open, setOpen] = useState(false); useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index 97e62e5e2..b430591b1 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -1,11 +1,18 @@ -import { createContext, useEffect, useState, useRef, ReactNode, useContext } from "react"; +import { + createContext, + useEffect, + useState, + useRef, + ReactNode, + useContext, +} from "react"; import { FlowType } from "../types/flow"; import { TabsContextType } from "../types/tabs"; import { normalCaseToSnakeCase } from "../utils"; import { alertContext } from "./alertContext"; const TabsContextInitialValue: TabsContextType = { - save:()=>{}, + save: () => {}, tabIndex: 0, setTabIndex: (index: number) => {}, flows: [], @@ -13,11 +20,11 @@ const TabsContextInitialValue: TabsContextType = { addFlow: (flowData?: any) => {}, updateFlow: (newFlow: FlowType) => {}, incrementNodeId: () => 0, - downloadFlow: (flow:FlowType) => {}, + downloadFlow: (flow: FlowType) => {}, uploadFlow: () => {}, lockChat: false, - setLockChat:(prevState:boolean)=>{}, - hardReset:()=>{}, + setLockChat: (prevState: boolean) => {}, + hardReset: () => {}, }; export const TabsContext = createContext( @@ -25,7 +32,7 @@ export const TabsContext = createContext( ); export function TabsProvider({ children }: { children: ReactNode }) { - const {setNoticeData} = useContext(alertContext) + const { setNoticeData } = useContext(alertContext); const [tabIndex, setTabIndex] = useState(0); const [flows, setFlows] = useState>([]); const [id, setId] = useState(0); @@ -36,20 +43,18 @@ export function TabsProvider({ children }: { children: ReactNode }) { newNodeId.current = newNodeId.current + 1; return newNodeId.current; } - function save(){ + function save() { if (flows.length !== 0) - window.localStorage.setItem( - "tabsData", - JSON.stringify({ tabIndex, flows, id, nodeId: newNodeId.current }) - ); + window.localStorage.setItem( + "tabsData", + JSON.stringify({ tabIndex, flows, id, nodeId: newNodeId.current }) + ); } useEffect(() => { //save tabs locally - save() + save(); }, [flows, id, tabIndex, newNodeId]); - - useEffect(() => { //get tabs locally saved let cookie = window.localStorage.getItem("tabsData"); @@ -61,15 +66,17 @@ export function TabsProvider({ children }: { children: ReactNode }) { newNodeId.current = cookieObject.nodeId; } }, []); - function hardReset(){ - newNodeId.current=0; - setTabIndex(0);setFlows([]);setId(0); + function hardReset() { + newNodeId.current = 0; + setTabIndex(0); + setFlows([]); + setId(0); } /** * Downloads the current flow as a JSON file */ - function downloadFlow(flow:FlowType) { + function downloadFlow(flow: FlowType) { // create a data URI with the current flow data const jsonString = `data:text/json;chatset=utf-8,${encodeURIComponent( JSON.stringify(flow) @@ -82,7 +89,9 @@ export function TabsProvider({ children }: { children: ReactNode }) { // simulate a click on the link element to trigger the download link.click(); - setNoticeData({title:"Warning: Critical data,JSON file may including API keys."}) + setNoticeData({ + title: "Warning: Critical data,JSON file may including API keys.", + }); } /** @@ -139,15 +148,14 @@ export function TabsProvider({ children }: { children: ReactNode }) { function addFlow(flow?: FlowType) { // Get data from the flow or set it to null if there's no flow provided. const data = flow?.data ? flow.data : null; - const description = flow?.description?flow.description:"" + const description = flow?.description ? flow.description : ""; // Create a new flow with a default name if no flow is provided. let newFlow: FlowType = { description, - name: flow?.name??"New Flow", + name: flow?.name ?? "New Flow", id: id.toString(), data, - chat: flow ? flow.chat : [], }; // Increment the ID counter. @@ -171,10 +179,9 @@ export function TabsProvider({ children }: { children: ReactNode }) { const newFlows = [...prevState]; const index = newFlows.findIndex((flow) => flow.id === newFlow.id); if (index !== -1) { - newFlows[index].description = newFlow.description??"" + newFlows[index].description = newFlow.description ?? ""; newFlows[index].data = newFlow.data; newFlows[index].name = newFlow.name; - newFlows[index].chat = newFlow.chat; } return newFlows; }); diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index f0783a744..dc462e328 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -10,15 +10,23 @@ import { typesContext } from "../../contexts/typesContext"; import ChatMessage from "./chatMessage"; import { FaEraser } from "react-icons/fa"; import { sendAllProps } from "../../types/api"; +import { ChatMessageType } from "../../types/chat"; const _ = require("lodash"); -export default function ChatModal({ flow, open, setOpen }:{open:boolean,setOpen:Function,flow:FlowType}) { - const { updateFlow, lockChat, setLockChat, flows, tabIndex } = +export default function ChatModal({ + flow, + open, + setOpen, +}: { + open: boolean; + setOpen: Function; + flow: FlowType; +}) { + const { updateFlow, lockChat, setLockChat} = useContext(TabsContext); - const [saveChat, setSaveChat] = useState(false); const [chatValue, setChatValue] = useState(""); - const [chatHistory, setChatHistory] = useState(flow.chat); + const [chatHistory, setChatHistory] = useState([]); const { reactFlowInstance } = useContext(typesContext); const { setErrorData, setNoticeData } = useContext(alertContext); const [ws, setWs] = useState(null); @@ -27,13 +35,9 @@ export default function ChatModal({ flow, open, setOpen }:{open:boolean,setOpen: isSend: boolean, thought?: string ) => { - let tabsChange = false; + setChatHistory((old) => { let newChat = _.cloneDeep(old); - if (JSON.stringify(flow.chat) !== JSON.stringify(old)) { - tabsChange = true; - return old; - } if (thought) { newChat.push({ message, isSend, thought }); } else { @@ -41,53 +45,36 @@ export default function ChatModal({ flow, open, setOpen }:{open:boolean,setOpen: } return newChat; }); - if (tabsChange) { - if (thought) { - updateFlow({ - ..._.cloneDeep(flow), - chat: [...flow.chat, { isSend, message, thought }], - }); - } else { - updateFlow({ - ..._.cloneDeep(flow), - chat: [...flow.chat, { isSend, message }], - }); - } - } - setSaveChat((chat) => !chat); }; useEffect(() => { const newWs = new WebSocket(`ws://localhost:7860/chat/${flow.id}`); newWs.onopen = () => { - console.log('WebSocket connection established!'); + console.log("WebSocket connection established!"); }; newWs.onmessage = (event) => { - const data = JSON.parse(event.data); - console.log('Received data:', data); - // Do something with the data received from the WebSocket + const data = JSON.parse(event.data); + console.log("Received data:", data); + if(Array.isArray(data)){ + console.log("entrou") + setChatHistory([{isSend:true,message:"sdsdsad"}]) + } + // Do something with the data received from the WebSocket }; setWs(newWs); - + return () => { - newWs.close(); + newWs.close(); }; - }, []); + }, []); - async function sendAll(data: sendAllProps) { + async function sendAll(data: sendAllProps) { if (ws) { - ws.send(JSON.stringify(data)); + ws.send(JSON.stringify(data)); } - return {data:{result:"sdsdsad",thought:"dsdsad"}} - } + return { data: { result: "sdsdsad", thought: "dsdsad" } }; + } - useEffect(() => { - updateFlow({ ..._.cloneDeep(flow), chat: chatHistory }); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [saveChat]); - useEffect(() => { - setChatHistory(flow.chat); - }, [flow]); useEffect(() => { if (ref.current) ref.current.scrollIntoView({ behavior: "smooth" }); }, [chatHistory]); diff --git a/src/frontend/src/types/flow/index.ts b/src/frontend/src/types/flow/index.ts index 50b0cab7a..26354c55c 100644 --- a/src/frontend/src/types/flow/index.ts +++ b/src/frontend/src/types/flow/index.ts @@ -6,7 +6,6 @@ export type FlowType = { name: string; id: string; data: ReactFlowJsonObject; - chat: Array; description:string; }; export type NodeType = {id:string,type:string,position:XYPosition,data:NodeDataType} From 61a3b9aad4cdcd0adc59cce7bdb2d0a97beb6808 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 25 Apr 2023 17:51:16 -0300 Subject: [PATCH 057/150] chat working as old with websocket, need to improve error handling and file events --- src/frontend/src/modals/chatModal/index.tsx | 38 +++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index dc462e328..9eb6de490 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -10,7 +10,7 @@ import { typesContext } from "../../contexts/typesContext"; import ChatMessage from "./chatMessage"; import { FaEraser } from "react-icons/fa"; import { sendAllProps } from "../../types/api"; -import { ChatMessageType } from "../../types/chat"; +import { ChatMessageType, ChatType } from "../../types/chat"; const _ = require("lodash"); @@ -23,8 +23,7 @@ export default function ChatModal({ setOpen: Function; flow: FlowType; }) { - const { updateFlow, lockChat, setLockChat} = - useContext(TabsContext); + const { updateFlow, lockChat, setLockChat } = useContext(TabsContext); const [chatValue, setChatValue] = useState(""); const [chatHistory, setChatHistory] = useState([]); const { reactFlowInstance } = useContext(typesContext); @@ -35,7 +34,6 @@ export default function ChatModal({ isSend: boolean, thought?: string ) => { - setChatHistory((old) => { let newChat = _.cloneDeep(old); if (thought) { @@ -55,9 +53,31 @@ export default function ChatModal({ newWs.onmessage = (event) => { const data = JSON.parse(event.data); console.log("Received data:", data); - if(Array.isArray(data)){ - console.log("entrou") - setChatHistory([{isSend:true,message:"sdsdsad"}]) + //get chat history + if (Array.isArray(data)) { + console.log("entrou"); + + setChatHistory((_) => { + let newChatHistory: ChatMessageType[] = []; + data.forEach( + (chatItem: { + intermediate_steps?: "string"; + is_bot: boolean; + message: string; + type: string; + }) => { + newChatHistory.push({ + isSend: !chatItem.is_bot, + message: chatItem.message, + thought:chatItem.intermediate_steps + }); + } + ); + return newChatHistory; + }); + } + if(data.type==='end'){ + addChatHistory(data.message, false, data.intermediate_steps); } // Do something with the data received from the WebSocket }; @@ -72,7 +92,6 @@ export default function ChatModal({ if (ws) { ws.send(JSON.stringify(data)); } - return { data: { result: "sdsdsad", thought: "dsdsad" } }; } useEffect(() => { @@ -143,8 +162,7 @@ export default function ChatModal({ name: flow.name, description: flow.description, }) - .then((r) => { - addChatHistory(r.data.result, false, r.data.thought); + .then(() => { setLockChat(false); }) .catch((error) => { From be5b7822d7dc68417b0b9af1e272485f60a285bd Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 25 Apr 2023 18:36:46 -0300 Subject: [PATCH 058/150] custom scrollbar and text input became text area for chat --- .../src/modals/chatModal/chatInput/index.tsx | 57 +++++++++++++++++++ src/frontend/src/modals/chatModal/index.tsx | 44 +++----------- src/frontend/tailwind.config.js | 16 +++++- 3 files changed, 80 insertions(+), 37 deletions(-) create mode 100644 src/frontend/src/modals/chatModal/chatInput/index.tsx diff --git a/src/frontend/src/modals/chatModal/chatInput/index.tsx b/src/frontend/src/modals/chatModal/chatInput/index.tsx new file mode 100644 index 000000000..7b371edb1 --- /dev/null +++ b/src/frontend/src/modals/chatModal/chatInput/index.tsx @@ -0,0 +1,57 @@ +import { LockClosedIcon, PaperAirplaneIcon } from "@heroicons/react/24/outline"; +import { classNames } from "../../../utils"; +import { useRef } from "react"; + +export default function ChatInput({ + lockChat, + chatValue, + sendMessage, + setChatValue, +}: { + lockChat:boolean; + chatValue:string; + sendMessage:Function; + setChatValue:Function; +}) { + const inputRef = useRef(null); + return ( + <> + -
-
- -
-
- -
-
-
- - -
-
- - - ); +
+
+ + +
+ +
+
+
+
+
+
+ + Export as + +
+
+
+
+ + { + if (event.target.value != "") { + let newFlow = flows[tabIndex]; + newFlow.name = event.target.value; + setName(event.target.value); + updateFlow(newFlow); + } else { + setName(event.target.value); + } + }} + type="text" + name="name" + value={name ?? null} + placeholder="File name" + id="name" + className="focus:border focus:border-blue block w-full px-3 py-2 border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-800 dark:border-gray-600 dark:focus:border-blue-500 dark:focus:ring-blue-500 text-gray-900 dark:text-gray-100" + /> +
+
+ + +
+ +
+ +
+
+ +
+
+
+
+
+
+
+ + + ); } diff --git a/src/frontend/src/pages/FlowPage/components/tabsManagerComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/tabsManagerComponent/index.tsx index 6d7a4d844..e6a037d10 100644 --- a/src/frontend/src/pages/FlowPage/components/tabsManagerComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/tabsManagerComponent/index.tsx @@ -5,11 +5,11 @@ import { TabsContext } from "../../../../contexts/tabsContext"; import FlowPage from "../.."; import { darkContext } from "../../../../contexts/darkContext"; import { - ArrowDownTrayIcon, - ArrowUpTrayIcon, - BellIcon, - MoonIcon, - SunIcon, + ArrowDownTrayIcon, + ArrowUpTrayIcon, + BellIcon, + MoonIcon, + SunIcon, } from "@heroicons/react/24/outline"; import { PopUpContext } from "../../../../contexts/popUpContext"; import AlertDropdown from "../../../../alerts/alertDropDown"; @@ -18,103 +18,98 @@ import ImportModal from "../../../../modals/importModal"; import ExportModal from "../../../../modals/exportModal"; export default function TabsManagerComponent() { - const { flows, addFlow, tabIndex, setTabIndex, uploadFlow, downloadFlow } = - useContext(TabsContext); - const { openPopUp } = useContext(PopUpContext); - const AlertWidth = 256; - const { dark, setDark } = useContext(darkContext); - const { notificationCenter, setNotificationCenter } = - useContext(alertContext); - useEffect(() => { - //create the first flow - if (flows.length === 0) { - addFlow(); - } - }, [addFlow, flows.length]); + const { flows, addFlow, tabIndex, setTabIndex, uploadFlow, downloadFlow } = + useContext(TabsContext); + const { openPopUp } = useContext(PopUpContext); + const AlertWidth = 256; + const { dark, setDark } = useContext(darkContext); + const { notificationCenter, setNotificationCenter } = + useContext(alertContext); + useEffect(() => { + //create the first flow + if (flows.length === 0) { + addFlow(); + } + }, [addFlow, flows.length]); - return ( -
-
- {flows.map((flow, index) => { - return ( - setTabIndex(index)} - selected={index === tabIndex} - key={index} - flow={flow} - /> - ); - })} - { - addFlow(); - }} - selected={false} - flow={null} - /> -
- - - - -
-
-
- - {flows[tabIndex] ? ( - - ) : ( - <> - )} - -
-
- ); + return ( +
+
+ {flows.map((flow, index) => { + return ( + setTabIndex(index)} + selected={index === tabIndex} + key={index} + flow={flow} + /> + ); + })} + { + addFlow(); + }} + selected={false} + flow={null} + /> +
+ + + + +
+
+
+ + {flows[tabIndex] ? ( + + ) : ( + <> + )} + +
+
+ ); } diff --git a/src/frontend/src/types/alerts/index.ts b/src/frontend/src/types/alerts/index.ts index a8478ba1a..7033d99eb 100644 --- a/src/frontend/src/types/alerts/index.ts +++ b/src/frontend/src/types/alerts/index.ts @@ -1,12 +1,29 @@ -export type ErrorAlertType = {title:string,list:Array,id:string,removeAlert:(id:string)=>void} -export type NoticeAlertType = {title:string,link:string,id:string,removeAlert:(id:string)=>void} -export type SuccessAlertType = {title:string,id:string, removeAlert:(id:string)=>void} -export type SingleAlertComponentType = {dropItem:AlertItemType,removeAlert:(index:string)=>void} +export type ErrorAlertType = { + title: string; + list: Array; + id: string; + removeAlert: (id: string) => void; +}; +export type NoticeAlertType = { + title: string; + link: string; + id: string; + removeAlert: (id: string) => void; +}; +export type SuccessAlertType = { + title: string; + id: string; + removeAlert: (id: string) => void; +}; +export type SingleAlertComponentType = { + dropItem: AlertItemType; + removeAlert: (index: string) => void; +}; export type AlertDropdownType = {}; export type AlertItemType = { - type: "notice" | "error" | "success"; - title: string; - link?: string; - list?: Array; - id: string; - }; \ No newline at end of file + type: "notice" | "error" | "success"; + title: string; + link?: string; + list?: Array; + id: string; +}; From 7659fbffcddbb7b6bc221688f7dc6f217a3d3f21 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Thu, 27 Apr 2023 17:04:35 -0300 Subject: [PATCH 107/150] chore(pyproject.toml): update langchain dependency from ~0.0.113 to ~0.0.150 --- poetry.lock | 125 +++++++++++++++++++++++++++++++++++++------------ pyproject.toml | 2 +- 2 files changed, 96 insertions(+), 31 deletions(-) diff --git a/poetry.lock b/poetry.lock index a7ffc07b4..c03f0b6fc 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. [[package]] name = "aiohttp" @@ -244,14 +244,14 @@ files = [ [[package]] name = "beautifulsoup4" -version = "4.12.0" +version = "4.12.2" description = "Screen-scraping library" category = "main" optional = false python-versions = ">=3.6.0" files = [ - {file = "beautifulsoup4-4.12.0-py3-none-any.whl", hash = "sha256:2130a5ad7f513200fae61a17abb5e338ca980fa28c439c0571014bc0217e9591"}, - {file = "beautifulsoup4-4.12.0.tar.gz", hash = "sha256:c5fceeaec29d09c84970e47c65f2f0efe57872f7cff494c9691a26ec0ff13234"}, + {file = "beautifulsoup4-4.12.2-py3-none-any.whl", hash = "sha256:bd2520ca0d9d7d12694a53d44ac482d181b4ec1888909b035a3dbf40d0f57d4a"}, + {file = "beautifulsoup4-4.12.2.tar.gz", hash = "sha256:492bbc69dca35d12daac71c4db1bfff0c876c00ef4a2ffacce226d4638eb72da"}, ] [package.dependencies] @@ -1116,14 +1116,14 @@ grpcio-gcp = ["grpcio-gcp (>=0.2.2,<1.0dev)"] [[package]] name = "google-api-python-client" -version = "2.83.0" +version = "2.86.0" description = "Google API Client Library for Python" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "google-api-python-client-2.83.0.tar.gz", hash = "sha256:d07509f1b2d2b2427363b454db996f7a15e1751a48cfcaf28427050560dd51cf"}, - {file = "google_api_python_client-2.83.0-py2.py3-none-any.whl", hash = "sha256:afa7fe2a5d77e8f136cdb8f40a120dd6660c2292f791c1b22734dfe786bd1dac"}, + {file = "google-api-python-client-2.86.0.tar.gz", hash = "sha256:3ca4e93821f4e9ac29b91ab0d9df168b42c8ad0fb8bff65b8c2ccb2d462b0464"}, + {file = "google_api_python_client-2.86.0-py2.py3-none-any.whl", hash = "sha256:0f320190ab9d5bd2fdb0cb894e8e53bb5e17d4888ee8dc4d26ba65ce378409e2"}, ] [package.dependencies] @@ -1135,14 +1135,14 @@ uritemplate = ">=3.0.1,<5" [[package]] name = "google-auth" -version = "2.17.0" +version = "2.17.3" description = "Google Authentication Library" category = "main" optional = false python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*" files = [ - {file = "google-auth-2.17.0.tar.gz", hash = "sha256:f51d26ebb3e5d723b9a7dbd310b6c88654ef1ad1fc35750d1fdba48ca4d82f52"}, - {file = "google_auth-2.17.0-py2.py3-none-any.whl", hash = "sha256:45ba9b4b3e49406de3c5451697820694b2f6ce8a6b75bb187852fdae231dab94"}, + {file = "google-auth-2.17.3.tar.gz", hash = "sha256:ce311e2bc58b130fddf316df57c9b3943c2a7b4f6ec31de9663a9333e4064efc"}, + {file = "google_auth-2.17.3-py2.py3-none-any.whl", hash = "sha256:f586b274d3eb7bd932ea424b1c702a30e0393a2e2bc4ca3eae8263ffd8be229f"}, ] [package.dependencies] @@ -1663,14 +1663,14 @@ files = [ [[package]] name = "jupyter-client" -version = "8.1.0" +version = "8.2.0" description = "Jupyter protocol implementation and client libraries" category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "jupyter_client-8.1.0-py3-none-any.whl", hash = "sha256:d5b8e739d7816944be50f81121a109788a3d92732ecf1ad1e4dadebc948818fe"}, - {file = "jupyter_client-8.1.0.tar.gz", hash = "sha256:3fbab64100a0dcac7701b1e0f1a4412f1ccb45546ff2ad9bc4fcbe4e19804811"}, + {file = "jupyter_client-8.2.0-py3-none-any.whl", hash = "sha256:b18219aa695d39e2ad570533e0d71fb7881d35a873051054a84ee2a17c4b7389"}, + {file = "jupyter_client-8.2.0.tar.gz", hash = "sha256:9fe233834edd0e6c0aa5f05ca2ab4bdea1842bfd2d8a932878212fc5301ddaf0"}, ] [package.dependencies] @@ -1708,14 +1708,14 @@ test = ["ipykernel", "pre-commit", "pytest", "pytest-cov", "pytest-timeout"] [[package]] name = "langchain" -version = "0.0.127" +version = "0.0.151" description = "Building applications with LLMs through composability" category = "main" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langchain-0.0.127-py3-none-any.whl", hash = "sha256:04ba053881e6098e80e0f4afc8922f3fe78923b160fd12d856aebce49c261918"}, - {file = "langchain-0.0.127.tar.gz", hash = "sha256:e8a3b67fd86a6f79c4334f0a7588c9476fcb57b27a8fb0e617f47c01eaab8be8"}, + {file = "langchain-0.0.151-py3-none-any.whl", hash = "sha256:b832732b3ec95d2bf33bb11e36bac84ccda8529c9b470fbc375c787eabd8341c"}, + {file = "langchain-0.0.151.tar.gz", hash = "sha256:e9c3cfb3712bce3f5b56de68bb4e8ad905c04b5e92433d06ce0882f6daf883a2"}, ] [package.dependencies] @@ -1733,8 +1733,13 @@ tenacity = ">=8.1.0,<9.0.0" tqdm = ">=4.48.0" [package.extras] -all = ["aleph-alpha-client (>=2.15.0,<3.0.0)", "anthropic (>=0.2.4,<0.3.0)", "beautifulsoup4 (>=4,<5)", "boto3 (>=1.26.96,<2.0.0)", "cohere (>=3,<4)", "deeplake (>=3.2.9,<4.0.0)", "elasticsearch (>=8,<9)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-search-results (>=2,<3)", "huggingface_hub (>=0,<1)", "jina (>=3.14,<4.0)", "jinja2 (>=3,<4)", "manifest-ml (>=0.0.1,<0.0.2)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (>=0,<1)", "opensearch-py (>=2.0.0,<3.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "qdrant-client (>=1.0.4,<2.0.0)", "redis (>=4,<5)", "sentence-transformers (>=2,<3)", "spacy (>=3,<4)", "tensorflow-text (>=2.11.0,<3.0.0)", "tiktoken (>=0.3.2,<0.4.0)", "torch (>=1,<2)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"] -llms = ["anthropic (>=0.2.4,<0.3.0)", "cohere (>=3,<4)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (>=0,<1)", "torch (>=1,<2)", "transformers (>=4,<5)"] +all = ["aleph-alpha-client (>=2.15.0,<3.0.0)", "anthropic (>=0.2.6,<0.3.0)", "arxiv (>=1.4,<2.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "beautifulsoup4 (>=4,<5)", "clickhouse-connect (>=0.5.14,<0.6.0)", "cohere (>=3,<4)", "deeplake (>=3.3.0,<4.0.0)", "duckduckgo-search (>=2.8.6,<3.0.0)", "elasticsearch (>=8,<9)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-search-results (>=2,<3)", "gptcache (>=0.1.7)", "html2text (>=2020.1.16,<2021.0.0)", "huggingface_hub (>=0,<1)", "jina (>=3.14,<4.0)", "jinja2 (>=3,<4)", "lancedb (>=0.1,<0.2)", "lark (>=1.1.5,<2.0.0)", "manifest-ml (>=0.0.1,<0.0.2)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (>=0,<1)", "opensearch-py (>=2.0.0,<3.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "pinecone-text (>=0.4.2,<0.5.0)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pytesseract (>=0.3.10,<0.4.0)", "qdrant-client (>=1.1.2,<2.0.0)", "redis (>=4,<5)", "sentence-transformers (>=2,<3)", "spacy (>=3,<4)", "tensorflow-text (>=2.11.0,<3.0.0)", "tiktoken (>=0.3.2,<0.4.0)", "torch (>=1,<3)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"] +azure = ["azure-core (>=1.26.4,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "openai (>=0,<1)"] +cohere = ["cohere (>=3,<4)"] +embeddings = ["sentence-transformers (>=2,<3)"] +llms = ["anthropic (>=0.2.6,<0.3.0)", "cohere (>=3,<4)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (>=0,<1)", "torch (>=1,<3)", "transformers (>=4,<5)"] +openai = ["openai (>=0,<1)"] +qdrant = ["qdrant-client (>=1.1.2,<2.0.0)"] [[package]] name = "lit" @@ -2581,14 +2586,14 @@ files = [ [[package]] name = "openai" -version = "0.27.4" +version = "0.27.5" description = "Python client library for the OpenAI API" category = "main" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-0.27.4-py3-none-any.whl", hash = "sha256:3b82c867d531e1fd2003d9de2131e1c4bfd4c70b1a3149e0543a555b30807b70"}, - {file = "openai-0.27.4.tar.gz", hash = "sha256:9f9d27d26e62c6068f516c0729449954b5ef6994be1a6cbfe7dbefbc84423a04"}, + {file = "openai-0.27.5-py3-none-any.whl", hash = "sha256:5b2121d8c0a4350626096fa482306d12e246a83b992530d54fd474f309f2882c"}, + {file = "openai-0.27.5.tar.gz", hash = "sha256:75778ca05759c77dde704985ee16976ba58804212f10e61f44356e68ffb8390e"}, ] [package.dependencies] @@ -2830,14 +2835,46 @@ tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "pa [[package]] name = "platformdirs" -version = "3.2.0" +version = "3.5.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-3.2.0-py3-none-any.whl", hash = "sha256:ebe11c0d7a805086e99506aa331612429a72ca7cd52a1f0d277dc4adc20cb10e"}, - {file = "platformdirs-3.2.0.tar.gz", hash = "sha256:d5b638ca397f25f979350ff789db335903d7ea010ab28903f57b27e1b16c2b08"}, + {file = "platformdirs-3.5.0-py3-none-any.whl", hash = "sha256:47692bc24c1958e8b0f13dd727307cff1db103fca36399f457da8e05f222fdc4"}, + {file = "platformdirs-3.5.0.tar.gz", hash = "sha256:7954a68d0ba23558d753f73437c55f89027cf8f5108c19844d4b82e5af396335"}, +] + +[package.extras] +docs = ["furo (>=2023.3.27)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.3.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] + +[[package]] +name = "pluggy" +version = "1.0.0" +description = "plugin and hook calling mechanisms for python" +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ + {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, + {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "posthog" +version = "3.0.1" +description = "Integrate PostHog into any python application." +category = "main" +optional = false +python-versions = "*" +files = [ + {file = "posthog-3.0.1-py2.py3-none-any.whl", hash = "sha256:9c7f92fecc713257d4b2710d05b456569c9156fbdd3e85655ba7ba5ba6c7b3ae"}, + {file = "posthog-3.0.1.tar.gz", hash = "sha256:57d2791ff5752ce56ba0f9bb8876faf3ca9208f1c2c6ceaeb5a2504c34493767"}, ] [package.dependencies] @@ -2848,8 +2885,9 @@ requests = ">=2.7,<3.0" six = ">=1.5" [package.extras] -docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +dev = ["black", "flake8", "flake8-print", "isort", "pre-commit"] +sentry = ["django", "sentry-sdk"] +test = ["coverage", "flake8", "freezegun (==0.3.15)", "mock (>=2.0.0)", "pylint", "pytest"] [[package]] name = "prompt-toolkit" @@ -3846,14 +3884,14 @@ files = [ [[package]] name = "setuptools" -version = "67.6.1" +version = "67.7.2" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "setuptools-67.6.1-py3-none-any.whl", hash = "sha256:e728ca814a823bf7bf60162daf9db95b93d532948c4c0bea762ce62f60189078"}, - {file = "setuptools-67.6.1.tar.gz", hash = "sha256:257de92a9d50a60b8e22abfcbb771571fde0dbf3ec234463212027a4eeecbe9a"}, + {file = "setuptools-67.7.2-py3-none-any.whl", hash = "sha256:23aaf86b85ca52ceb801d32703f12d77517b2556af839621c641fca11287952b"}, + {file = "setuptools-67.7.2.tar.gz", hash = "sha256:f104fa03692a2602fa0fec6c6a9e63b6c8a968de13e17c026957dd1f53d80990"}, ] [package.extras] @@ -4402,6 +4440,33 @@ files = [ {file = "types_PyYAML-6.0.12.9-py3-none-any.whl", hash = "sha256:5aed5aa66bd2d2e158f75dda22b059570ede988559f030cf294871d3b647e3e8"}, ] +[[package]] +name = "types-requests" +version = "2.28.11.17" +description = "Typing stubs for requests" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "types-requests-2.28.11.17.tar.gz", hash = "sha256:0d580652ce903f643f8c3b494dd01d29367ea57cea0c7ad7f65cf3169092edb0"}, + {file = "types_requests-2.28.11.17-py3-none-any.whl", hash = "sha256:cc1aba862575019306b2ed134eb1ea994cab1c887a22e18d3383e6dd42e9789b"}, +] + +[package.dependencies] +types-urllib3 = "<1.27" + +[[package]] +name = "types-urllib3" +version = "1.26.25.11" +description = "Typing stubs for urllib3" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "types-urllib3-1.26.25.11.tar.gz", hash = "sha256:697102ddf4f781eed6f692353f40cee1098643526f5a8b99f49d2ede90fd3754"}, + {file = "types_urllib3-1.26.25.11-py3-none-any.whl", hash = "sha256:04235e792139cf3624b25d38faab593456738fbdb7439634046172e3b1339400"}, +] + [[package]] name = "typing-extensions" version = "4.5.0" @@ -4890,4 +4955,4 @@ cffi = ["cffi (>=1.11)"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "cd26951fcc1e0161bbb8be3cd9694f6d0d99c57e4c6f431ff00c435960da7593" +content-hash = "49fd166dc3811d79f8344946ee40a62c28215db9fdd41f5f051ab109657d9a62" diff --git a/pyproject.toml b/pyproject.toml index 441bc009d..372ddcc6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ google-search-results = "^2.4.1" google-api-python-client = "^2.79.0" typer = "^0.7.0" gunicorn = "^20.1.0" -langchain = "~0.0.113" +langchain = "~0.0.150" openai = "^0.27.2" types-pyyaml = "^6.0.12.8" dill = "^0.3.6" From 45c04befe71b3d3dde3279c6df313cab8d410a0f Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Thu, 27 Apr 2023 17:24:25 -0300 Subject: [PATCH 108/150] refactor(Makefile): rename run_backend target to backend and add install_backend target feat(Makefile): add frontend target to install and run frontend app using npm --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8712a0aeb..0eef78999 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,14 @@ install_frontend: run_frontend: cd src/frontend && npm start -run_backend: +frontend: + make install_frontend + make run_frontend + +install_backend: + poetry install + +backend: poetry run uvicorn langflow.main:app --port 7860 --reload --log-level debug build_frontend: From d91beb9cda26b3dd7af94e819d97874fa9417127 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 27 Apr 2023 19:24:02 -0300 Subject: [PATCH 109/150] update template working for local flow on browser --- src/frontend/package.json | 2 +- src/frontend/src/contexts/tabsContext.tsx | 81 +++++++++++-------- src/frontend/src/contexts/typesContext.tsx | 38 ++++++++- .../extraSidebarComponent/index.tsx | 39 +-------- .../components/tabsManagerComponent/index.tsx | 6 +- src/frontend/src/pages/FlowPage/index.tsx | 4 +- src/frontend/src/utils.ts | 20 ++++- 7 files changed, 109 insertions(+), 81 deletions(-) diff --git a/src/frontend/package.json b/src/frontend/package.json index b669569e3..84e9ad595 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -59,5 +59,5 @@ "last 1 safari version" ] }, - "proxy": "http://backend:7860" + "proxy": "http://127.0.0.1:5003" } \ No newline at end of file diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index 2823f6044..9903bda30 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -1,12 +1,20 @@ -import { createContext, useEffect, useState, useRef, ReactNode, useContext } from "react"; +import { + createContext, + useEffect, + useState, + useRef, + ReactNode, + useContext, +} from "react"; import { FlowType } from "../types/flow"; import { LangFlowState, TabsContextType } from "../types/tabs"; -import { normalCaseToSnakeCase } from "../utils"; +import { normalCaseToSnakeCase, updateObject } from "../utils"; import { alertContext } from "./alertContext"; import { typesContext } from "./typesContext"; +import { TemplateVariableType } from "../types/api"; const TabsContextInitialValue: TabsContextType = { - save:()=>{}, + save: () => {}, tabIndex: 0, setTabIndex: (index: number) => {}, flows: [], @@ -14,11 +22,11 @@ const TabsContextInitialValue: TabsContextType = { addFlow: (flowData?: any) => {}, updateFlow: (newFlow: FlowType) => {}, incrementNodeId: () => 0, - downloadFlow: (flow:FlowType) => {}, + downloadFlow: (flow: FlowType) => {}, uploadFlow: () => {}, lockChat: false, - setLockChat:(prevState:boolean)=>{}, - hardReset:()=>{}, + setLockChat: (prevState: boolean) => {}, + hardReset: () => {}, }; export const TabsContext = createContext( @@ -26,61 +34,64 @@ export const TabsContext = createContext( ); export function TabsProvider({ children }: { children: ReactNode }) { - const {setNoticeData} = useContext(alertContext) + const { setNoticeData } = useContext(alertContext); const [tabIndex, setTabIndex] = useState(0); const [flows, setFlows] = useState>([]); const [id, setId] = useState(0); const [lockChat, setLockChat] = useState(false); - const {templates} = useContext(typesContext ) + const { templates } = useContext(typesContext); const newNodeId = useRef(0); function incrementNodeId() { newNodeId.current = newNodeId.current + 1; return newNodeId.current; } - function save(){ - console.log("save") + function save() { + console.log("save"); if (flows.length !== 0) - window.localStorage.setItem( - "tabsData", - JSON.stringify({ tabIndex, flows, id, nodeId: newNodeId.current }) - ); + window.localStorage.setItem( + "tabsData", + JSON.stringify({ tabIndex, flows, id, nodeId: newNodeId.current }) + ); } useEffect(() => { //save tabs locally - save() + save(); }, [flows, id, tabIndex, newNodeId]); - - useEffect(() => { //get tabs locally saved let cookie = window.localStorage.getItem("tabsData"); - if (cookie) { - console.log(templates) - console.log(Object.keys(templates).length) - let cookieObject:LangFlowState = JSON.parse(cookie); - cookieObject.flows.forEach(flow=>{ - console.log(flow) - // flow.data.nodes.forEach(node=>{ - // console.log(node.data) - // }) - }) + if (cookie && Object.keys(templates).length > 0) { + let cookieObject: LangFlowState = JSON.parse(cookie); + cookieObject.flows.forEach((flow) => { + flow.data.nodes.forEach((node) => { + node.data.node.template = updateObject( + node.data.node.template as TemplateVariableType, + templates[node.data.type][ + "template" + ] as unknown as TemplateVariableType + ); + console.log(node) + }); + }); setTabIndex(cookieObject.tabIndex); setFlows(cookieObject.flows); setId(cookieObject.id); newNodeId.current = cookieObject.nodeId; } }, [templates]); - function hardReset(){ - newNodeId.current=0; - setTabIndex(0);setFlows([]);setId(0); + function hardReset() { + newNodeId.current = 0; + setTabIndex(0); + setFlows([]); + setId(0); } /** * Downloads the current flow as a JSON file */ - function downloadFlow(flow:FlowType) { + function downloadFlow(flow: FlowType) { // create a data URI with the current flow data const jsonString = `data:text/json;chatset=utf-8,${encodeURIComponent( JSON.stringify(flow) @@ -93,7 +104,9 @@ export function TabsProvider({ children }: { children: ReactNode }) { // simulate a click on the link element to trigger the download link.click(); - setNoticeData({title:"Warning: Critical data,JSON file may including API keys."}) + setNoticeData({ + title: "Warning: Critical data,JSON file may including API keys.", + }); } /** @@ -150,7 +163,7 @@ export function TabsProvider({ children }: { children: ReactNode }) { function addFlow(flow?: FlowType) { // Get data from the flow or set it to null if there's no flow provided. const data = flow?.data ? flow.data : null; - const description = flow?.description?flow.description:"" + const description = flow?.description ? flow.description : ""; // Create a new flow with a default name if no flow is provided. let newFlow: FlowType = { @@ -182,7 +195,7 @@ export function TabsProvider({ children }: { children: ReactNode }) { const newFlows = [...prevState]; const index = newFlows.findIndex((flow) => flow.id === newFlow.id); if (index !== -1) { - newFlows[index].description = newFlow.description??"" + newFlows[index].description = newFlow.description ?? ""; newFlows[index].data = newFlow.data; newFlows[index].name = newFlow.name; newFlows[index].chat = newFlow.chat; diff --git a/src/frontend/src/contexts/typesContext.tsx b/src/frontend/src/contexts/typesContext.tsx index 95f9622c7..ad86d4699 100644 --- a/src/frontend/src/contexts/typesContext.tsx +++ b/src/frontend/src/contexts/typesContext.tsx @@ -1,6 +1,8 @@ -import { createContext, ReactNode, useState } from "react"; +import { createContext, ReactNode, useEffect, useState } from "react"; import { Node} from "reactflow"; import { typesContextType } from "../types/typesContext"; +import { getAll } from "../controllers/API"; +import { APIKindType } from "../types/api"; //context to share types adn functions from nodes to flow @@ -23,6 +25,40 @@ export function TypesProvider({ children }:{children:ReactNode}) { const [reactFlowInstance, setReactFlowInstance] = useState(null); const [templates, setTemplates] = useState({}); const [data, setData] = useState({}); + + useEffect(() => { + async function getTypes(): Promise { + // Make an asynchronous API call to retrieve all data. + let result = await getAll(); + + // Update the state of the component with the retrieved data. + setData(result.data); + setTemplates( + Object.keys(result.data).reduce((acc, curr) => { + Object.keys(result.data[curr]).forEach((c: keyof APIKindType)=>{ + acc[c] = result.data[curr][c] + }) + return acc; + },{}) + ); + // Set the types by reducing over the keys of the result data and updating the accumulator. + setTypes( + Object.keys(result.data).reduce((acc, curr) => { + Object.keys(result.data[curr]).forEach((c: keyof APIKindType) => { + acc[c] = curr; + // Add the base classes to the accumulator as well. + result.data[curr][c].base_classes?.forEach((b) => { + acc[b] = curr; + }); + }); + return acc; + }, {}) + ); + } + // Call the getTypes function. + getTypes(); + }, [setTypes]); + function deleteNode(idx:string) { reactFlowInstance.setNodes( reactFlowInstance.getNodes().filter((n:Node) => n.id !== idx) diff --git a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx index f89c2abd6..9f08674b5 100644 --- a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx @@ -2,51 +2,14 @@ import { Bars2Icon } from "@heroicons/react/24/outline"; import DisclosureComponent from "../DisclosureComponent"; import { nodeColors, nodeIcons, nodeNames } from "../../../../utils"; import { useContext, useEffect, useState } from "react"; -import { getAll } from "../../../../controllers/API"; import { typesContext } from "../../../../contexts/typesContext"; import { APIClassType, - APIKindType, APIObjectType, } from "../../../../types/api"; export default function ExtraSidebar() { - const [data, setData] = useState({}); - const { setTypes } = useContext(typesContext); - const { setTemplates } = useContext(typesContext); - - useEffect(() => { - async function getTypes(): Promise { - // Make an asynchronous API call to retrieve all data. - let result = await getAll(); - - // Update the state of the component with the retrieved data. - setData(result.data); - setTemplates( - Object.keys(result.data).reduce((acc, curr) => { - Object.keys(result.data[curr]).forEach((c: keyof APIKindType)=>{ - acc[c] = result.data[curr][c] - }) - return acc; - },{}) - ); - // Set the types by reducing over the keys of the result data and updating the accumulator. - setTypes( - Object.keys(result.data).reduce((acc, curr) => { - Object.keys(result.data[curr]).forEach((c: keyof APIKindType) => { - acc[c] = curr; - // Add the base classes to the accumulator as well. - result.data[curr][c].base_classes?.forEach((b) => { - acc[b] = curr; - }); - }); - return acc; - }, {}) - ); - } - // Call the getTypes function. - getTypes(); - }, [setTypes]); + const {data} = useContext(typesContext) function onDragStart( event: React.DragEvent, diff --git a/src/frontend/src/pages/FlowPage/components/tabsManagerComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/tabsManagerComponent/index.tsx index 71c964cbe..6ea12a8fa 100644 --- a/src/frontend/src/pages/FlowPage/components/tabsManagerComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/tabsManagerComponent/index.tsx @@ -16,21 +16,23 @@ import AlertDropdown from "../../../../alerts/alertDropDown"; import { alertContext } from "../../../../contexts/alertContext"; import ImportModal from "../../../../modals/importModal"; import ExportModal from "../../../../modals/exportModal"; +import { typesContext } from "../../../../contexts/typesContext"; export default function TabsManagerComponent() { const { flows, addFlow, tabIndex, setTabIndex, uploadFlow, downloadFlow } = useContext(TabsContext); const { openPopUp } = useContext(PopUpContext); + const {templates} = useContext(typesContext) const AlertWidth = 256; const { dark, setDark } = useContext(darkContext); const { notificationCenter, setNotificationCenter } = useContext(alertContext); useEffect(() => { //create the first flow - if (flows.length === 0) { + if (flows.length === 0&& Object.keys(templates).length>0) { addFlow(); } - }, [addFlow, flows.length]); + }, [addFlow, flows.length,templates]); return (
diff --git a/src/frontend/src/pages/FlowPage/index.tsx b/src/frontend/src/pages/FlowPage/index.tsx index 4fc315926..eef70bf5b 100644 --- a/src/frontend/src/pages/FlowPage/index.tsx +++ b/src/frontend/src/pages/FlowPage/index.tsx @@ -32,7 +32,7 @@ var _ = require("lodash"); export default function FlowPage({ flow }:{flow:FlowType}) { let { updateFlow, incrementNodeId} = useContext(TabsContext); - const { types, reactFlowInstance, setReactFlowInstance } = + const { types, reactFlowInstance, setReactFlowInstance, templates } = useContext(typesContext); const reactFlowWrapper = useRef(null); @@ -180,7 +180,7 @@ export default function FlowPage({ flow }:{flow:FlowType}) { return (
- {Object.keys(types).length > 0 ? ( + {Object.keys(templates).length > 0 && Object.keys(types).length > 0 ? ( <> ) { @@ -390,6 +389,21 @@ export function removeApiKeys(flow:FlowType):FlowType{ return cleanFLow } -export function UpdateTemplate(newTemplate:APIClassType,oldTemplate:APIClassType){ - +export function updateObject>(reference: T, objectToUpdate: T): T { + let clonedObject = _.cloneDeep(objectToUpdate) + // Loop through each key in the object to update + for (const key in clonedObject) { + // If the key is not in the reference object, delete it + if (!(key in reference)) { + delete clonedObject[key]; + } + } + // Loop through each key in the reference object + for (const key in reference) { + // If the key is not in the object to update, add it + if (!(key in clonedObject)) { + clonedObject[key] = reference[key]; + } + } + return clonedObject; } \ No newline at end of file From a75f22fe2131f15b24d605968872e450067c5516 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 27 Apr 2023 19:29:50 -0300 Subject: [PATCH 110/150] update template working for import --- src/frontend/src/contexts/tabsContext.tsx | 29 ++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index 9903bda30..776f63077 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -66,13 +66,14 @@ export function TabsProvider({ children }: { children: ReactNode }) { let cookieObject: LangFlowState = JSON.parse(cookie); cookieObject.flows.forEach((flow) => { flow.data.nodes.forEach((node) => { - node.data.node.template = updateObject( - node.data.node.template as TemplateVariableType, - templates[node.data.type][ - "template" - ] as unknown as TemplateVariableType - ); - console.log(node) + if (Object.keys(templates[node.data.type]["template"]).length>0) { + node.data.node.template = updateObject( + node.data.node.template as TemplateVariableType, + templates[node.data.type][ + "template" + ] as unknown as TemplateVariableType + ); + } }); }); setTabIndex(cookieObject.tabIndex); @@ -127,7 +128,19 @@ export function TabsProvider({ children }: { children: ReactNode }) { // read the file as text file.text().then((text) => { // parse the text into a JSON object - addFlow(JSON.parse(text)); + let flow: FlowType = JSON.parse(text); + flow.data.nodes.forEach((node) => { + if (Object.keys(templates[node.data.type]["template"]).length>0) { + node.data.node.template = updateObject( + node.data.node.template as TemplateVariableType, + templates[node.data.type][ + "template" + ] as unknown as TemplateVariableType + ); + } + }); + + addFlow(); }); } }; From be25947f55f87671d3a08ce7e4eaaed61f0fad6a Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 27 Apr 2023 19:36:37 -0300 Subject: [PATCH 111/150] check if show if false to add item on advanced modal --- src/frontend/src/modals/NodeModal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx index 8a7fde84f..f32b485a3 100644 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -89,7 +89,7 @@ export default function NodeModal({ data }: { data: NodeDataType }) {
{ Object.keys(data.node.template) - .filter((t) => t.charAt(0) !== "_"&& data.node.template[t].advanced) + .filter((t) => t.charAt(0) !== "_"&& data.node.template[t].advanced && !data.node.template[t].show) .map((t: string, idx) => { return ( Date: Thu, 27 Apr 2023 20:48:52 -0300 Subject: [PATCH 112/150] fixed wrong bolean logic, now show in modal only if show is true --- src/frontend/src/modals/NodeModal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx index f32b485a3..c052c71a7 100644 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -89,7 +89,7 @@ export default function NodeModal({ data }: { data: NodeDataType }) {
{ Object.keys(data.node.template) - .filter((t) => t.charAt(0) !== "_"&& data.node.template[t].advanced && !data.node.template[t].show) + .filter((t) => t.charAt(0) !== "_"&& data.node.template[t].advanced && data.node.template[t].show) .map((t: string, idx) => { return ( Date: Thu, 27 Apr 2023 20:52:53 -0300 Subject: [PATCH 113/150] style(dropdownComponent): add dark mode support to dropdown component options and background color --- src/frontend/src/components/dropdownComponent/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/components/dropdownComponent/index.tsx b/src/frontend/src/components/dropdownComponent/index.tsx index aad367adb..bb4cd621c 100644 --- a/src/frontend/src/components/dropdownComponent/index.tsx +++ b/src/frontend/src/components/dropdownComponent/index.tsx @@ -41,14 +41,16 @@ export default function Dropdown({ leaveFrom="opacity-100" leaveTo="opacity-0" > - + {options.map((option, id) => ( classNames( - active ? "text-white bg-indigo-600" : "text-gray-900", - "relative cursor-default select-none py-2 pl-3 pr-9" + active + ? "text-white bg-indigo-600 dark:bg-indigo-500" + : "text-gray-900", + "relative cursor-default select-none py-2 pl-3 pr-9 dark:text-gray-300 dark:bg-gray-800" ) } value={option} From e92cf1110a8e29f358a8d5acf2b314e4063b5582 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 27 Apr 2023 23:23:14 -0300 Subject: [PATCH 114/150] change chat shortcut to ctrl+k and handled websocket errors --- .../src/components/chatComponent/index.tsx | 3 +- src/frontend/src/modals/chatModal/index.tsx | 193 +++++++++++------- 2 files changed, 116 insertions(+), 80 deletions(-) diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 668a970bd..a4eae7f21 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -14,7 +14,8 @@ export default function Chat({ flow }: ChatType) { const [open, setOpen] = useState(false); useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { - if (event.key === "K" && event.shiftKey && (event.metaKey||event.ctrlKey)) { + event.preventDefault() + if ((event.key === "K"||event.key==="k") && (event.metaKey||event.ctrlKey)) { setOpen(oldState=>!oldState); } }; diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index 5b3810796..6adb1e51f 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -28,7 +28,6 @@ export default function ChatModal({ setOpen: Function; flow: FlowType; }) { - const { updateFlow } = useContext(TabsContext); const [chatValue, setChatValue] = useState(""); const [chatHistory, setChatHistory] = useState([]); const { reactFlowInstance } = useContext(typesContext); @@ -44,7 +43,7 @@ export default function ChatModal({ setChatHistory((old) => { let newChat = _.cloneDeep(old); if (files) { - newChat.push({ message, isSend, files,thought }); + newChat.push({ message, isSend, files, thought }); } else if (thought) { newChat.push({ message, isSend, thought }); } else { @@ -55,95 +54,128 @@ export default function ChatModal({ }; function connectWS() { - const newWs = new WebSocket(`ws://127.0.0.1:5003/chat/${flow.id}`); - newWs.onopen = () => { - console.log("WebSocket connection established!"); - }; - newWs.onmessage = (event) => { - try { - setLockChat(false); - const data = JSON.parse(event.data); - console.log("Received data:", data); - //get chat history - if (Array.isArray(data)) { - console.log(data); + console.log("conectou"); + try { + const newWs = new WebSocket(`ws://127.0.0.1:5003/chat/${flow.id}`); + newWs.onopen = () => { + console.log("WebSocket connection established!"); + }; + newWs.onmessage = (event) => { + try { + setLockChat(false); + const data = JSON.parse(event.data); + console.log("Received data:", data); + //get chat history + if (Array.isArray(data)) { + console.log(data); - setChatHistory((_) => { - let newChatHistory: ChatMessageType[] = []; - data.forEach( - (chatItem: { - intermediate_steps?: "string"; - is_bot: boolean; - message: string; - type: string; - files?: Array; - }) => { - if (chatItem.message) { - newChatHistory.push( - chatItem.files - ? { - isSend: !chatItem.is_bot, - message: chatItem.message, - thought: chatItem.intermediate_steps, - files: chatItem.files, - } - : { - isSend: !chatItem.is_bot, - message: chatItem.message, - thought: chatItem.intermediate_steps, - } - ); + setChatHistory((_) => { + let newChatHistory: ChatMessageType[] = []; + data.forEach( + (chatItem: { + intermediate_steps?: "string"; + is_bot: boolean; + message: string; + type: string; + files?: Array; + }) => { + if (chatItem.message) { + newChatHistory.push( + chatItem.files + ? { + isSend: !chatItem.is_bot, + message: chatItem.message, + thought: chatItem.intermediate_steps, + files: chatItem.files, + } + : { + isSend: !chatItem.is_bot, + message: chatItem.message, + thought: chatItem.intermediate_steps, + } + ); + } } - } - ); - return newChatHistory; - }); - } - if (data.type === "end") { - if (data.files) { - addChatHistory( - data.message, - false, - data.intermediate_steps, - data.files - ); - } else { - addChatHistory(data.message, false, data.intermediate_steps); + ); + return newChatHistory; + }); + } + if (data.type === "end") { + if (data.files) { + addChatHistory( + data.message, + false, + data.intermediate_steps, + data.files + ); + } else { + addChatHistory(data.message, false, data.intermediate_steps); + } + } + if (data.type == "file") { + console.log(data); + } + } catch (error) { + if (event.data !== "Error: 1005") { + setErrorData({ title: event.data }); + newWs.close() + connectWS() } } - if (data.type == "file") { - console.log(data); - } - } catch (error) { - if(event.data!=="Error: 1005"){ - setErrorData({ title: event.data }); - + }; + newWs.onclose = (_) => { + if (open) { + setLockChat(false); + setTimeout(() => { + connectWS(); + }, 1000); } + }; + newWs.onerror= (ev)=>{ + console.log(ev,"error") } - }; - newWs.onclose = (_) => { - if (open) { - setLockChat(false); - setTimeout(() => { - connectWS(); - }, 100); - } - }; - setWs(newWs); + setWs(newWs); - return newWs; + return newWs; + } catch { + setErrorData({ + title: "There was an error on web connection, please: ", + list: [ + "refresh the page", + "use a new flow tab", + "check if the backend is up", + ], + }); + } } useEffect(() => { - let newWs = connectWS(); - return () => { - newWs.close(); - }; + if (ws && (ws.readyState === ws.CLOSED|| ws.readyState===ws.CLOSING)) { + let newWs = connectWS(); + return () => { + console.log("trigger") + newWs.close(); + }; + } + }, [lockChat]); + + useEffect(() => { + let newWs = connectWS(); + return () => { + console.log("trigger") + newWs.close(); + } }, []); async function sendAll(data: sendAllProps) { - if (ws) { - ws.send(JSON.stringify(data)); + try { + if (ws) { + ws.send(JSON.stringify(data)); + } + } catch (error) { + setErrorData({title:"There was an erro sending the message",list:[error.message]}) + setChatValue(data.message) + connectWS(); } } @@ -294,7 +326,10 @@ export default function ChatModal({ ) : (
- 👋 LangFlow Chat + 👋{" "} + + LangFlow Chat +
From d52e7700c0e27a8782b45e63c6831a09d9669eb9 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 14:42:38 -0300 Subject: [PATCH 115/150] fix(nodes.py): set prompt field as not required and show it if no prompt is provided --- src/backend/langflow/template/nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/langflow/template/nodes.py b/src/backend/langflow/template/nodes.py index f2e8bd94f..f0f2112a6 100644 --- a/src/backend/langflow/template/nodes.py +++ b/src/backend/langflow/template/nodes.py @@ -425,7 +425,7 @@ class ChainFrontendNode(FrontendNode): field.required = True field.show = True # Separated for possible future changes - if field.name == "prompt": + if field.name == "prompt" and field.value is None: # if no prompt is provided, use the default prompt field.required = False field.show = True From e4b4cf19a26d40d57be7311a148bc353b6bf894d Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 14:43:27 -0300 Subject: [PATCH 116/150] refactor(GenericNode): remove commented out code and add comments to code feat(GenericNode): add validation check for node changes by comparing length of nodes and edges array --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 93497c0fc..7ad4bd59f 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -32,7 +32,7 @@ export default function GenericNode({ const debouncedValidateNode = useDebouncedCallback(async () => { // Check if the validationStatus is "success" - if (validationStatus === "success") return; + // if (validationStatus === "success") return; try { const response = await fetch(`/validate/node/${data.id}`, { @@ -62,7 +62,11 @@ export default function GenericNode({ validateNode(); }, [ validateNode, - ...Object.values(data.node.template).flatMap((t) => Object.values(t)), + // Use the result of ...reactFlowInstance.toObject() + // to determine if the node has changed + // turn into an array of nodes and edges + // and compare the length of the array + ...Object.values(reactFlowInstance.toObject()), ]); useEffect(() => { From 2bc1fdd32efe2d9dbbfa5114555186d7d79905e6 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 14:46:05 -0300 Subject: [PATCH 117/150] prettier --- .../src/components/chatComponent/index.tsx | 47 ++- src/frontend/src/controllers/API/index.ts | 61 +-- src/frontend/src/pages/FlowPage/index.tsx | 375 +++++++++--------- src/frontend/src/reportWebVitals.ts | 4 +- src/frontend/src/svg.d.ts | 9 +- src/frontend/src/types/api/index.ts | 54 ++- src/frontend/src/types/components/index.ts | 118 +++--- src/frontend/src/types/entities/index.ts | 7 +- src/frontend/src/types/flow/index.ts | 26 +- src/frontend/src/types/tabs/index.ts | 24 +- src/frontend/src/types/typesContext/index.ts | 14 +- src/frontend/src/utils.ts | 114 +++--- 12 files changed, 454 insertions(+), 399 deletions(-) diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index a4eae7f21..913822bd3 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -1,8 +1,4 @@ -import { - useEffect, - useRef, - useState, -} from "react"; +import { useEffect, useRef, useState } from "react"; import { ChatMessageType, ChatType } from "../../types/chat"; import ChatTrigger from "./chatTrigger"; @@ -11,23 +7,26 @@ import ChatModal from "../../modals/chatModal"; const _ = require("lodash"); export default function Chat({ flow }: ChatType) { - const [open, setOpen] = useState(false); - useEffect(() => { - const handleKeyDown = (event: KeyboardEvent) => { - event.preventDefault() - if ((event.key === "K"||event.key==="k") && (event.metaKey||event.ctrlKey)) { - setOpen(oldState=>!oldState); - } - }; - document.addEventListener("keydown", handleKeyDown); - return () => { - document.removeEventListener("keydown", handleKeyDown); - }; - }, []); - return ( - <> - - - - ); + const [open, setOpen] = useState(false); + useEffect(() => { + const handleKeyDown = (event: KeyboardEvent) => { + // event.preventDefault() + if ( + (event.key === "K" || event.key === "k") && + (event.metaKey || event.ctrlKey) + ) { + setOpen((oldState) => !oldState); + } + }; + document.addEventListener("keydown", handleKeyDown); + return () => { + document.removeEventListener("keydown", handleKeyDown); + }; + }, []); + return ( + <> + + + + ); } diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index 490ec2837..f6f46404b 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -1,40 +1,43 @@ -import { PromptTypeAPI, errorsTypeAPI } from './../../types/api/index'; -import { APIObjectType, sendAllProps } from '../../types/api/index'; +import { PromptTypeAPI, errorsTypeAPI } from "./../../types/api/index"; +import { APIObjectType, sendAllProps } from "../../types/api/index"; import axios, { AxiosResponse } from "axios"; -import { FlowType } from '../../types/flow'; +import { FlowType } from "../../types/flow"; -export async function getAll():Promise> { - return await axios.get(`/all`); +export async function getAll(): Promise> { + return await axios.get(`/all`); } -export async function sendAll(data:sendAllProps) { - return await axios.post(`/predict`, data); +export async function sendAll(data: sendAllProps) { + return await axios.post(`/predict`, data); } -export async function checkCode(code:string):Promise>{ - - return await axios.post('/validate/code',{code}) +export async function checkCode( + code: string +): Promise> { + return await axios.post("/validate/code", { code }); } -export async function checkPrompt(template:string):Promise>{ - - return await axios.post('/validate/prompt',{template}) +export async function checkPrompt( + template: string +): Promise> { + return await axios.post("/validate/prompt", { template }); } export async function getExamples(): Promise { - const url = 'https://api.github.com/repos/logspace-ai/langflow_examples/contents/examples'; - const response = await axios.get(url); - - const jsonFiles = response.data.filter((file: any) => { - return file.name.endsWith('.json'); - }); - - const contentsPromises = jsonFiles.map(async (file: any) => { - const contentResponse = await axios.get(file.download_url); - return contentResponse.data; - }); - - const contents = await Promise.all(contentsPromises); - - return contents; - } \ No newline at end of file + const url = + "https://api.github.com/repos/logspace-ai/langflow_examples/contents/examples"; + const response = await axios.get(url); + + const jsonFiles = response.data.filter((file: any) => { + return file.name.endsWith(".json"); + }); + + const contentsPromises = jsonFiles.map(async (file: any) => { + const contentResponse = await axios.get(file.download_url); + return contentResponse.data; + }); + + const contents = await Promise.all(contentsPromises); + + return contents; +} diff --git a/src/frontend/src/pages/FlowPage/index.tsx b/src/frontend/src/pages/FlowPage/index.tsx index 4fc315926..38fe8ecb8 100644 --- a/src/frontend/src/pages/FlowPage/index.tsx +++ b/src/frontend/src/pages/FlowPage/index.tsx @@ -1,15 +1,15 @@ import { useCallback, useContext, useEffect, useRef } from "react"; import ReactFlow, { - Background, - Controls, - addEdge, - useEdgesState, - useNodesState, - useReactFlow, - updateEdge, - EdgeChange, - Connection, - Edge, + Background, + Controls, + addEdge, + useEdgesState, + useNodesState, + useReactFlow, + updateEdge, + EdgeChange, + Connection, + Edge, } from "reactflow"; import { locationContext } from "../../contexts/locationContext"; import ExtraSidebar from "./components/extraSidebarComponent"; @@ -24,193 +24,198 @@ import { APIClassType } from "../../types/api"; import { isValidConnection } from "../../utils"; const nodeTypes = { - genericNode: GenericNode, + genericNode: GenericNode, }; var _ = require("lodash"); -export default function FlowPage({ flow }:{flow:FlowType}) { - let { updateFlow, incrementNodeId} = - useContext(TabsContext); - const { types, reactFlowInstance, setReactFlowInstance } = - useContext(typesContext); - const reactFlowWrapper = useRef(null); +export default function FlowPage({ flow }: { flow: FlowType }) { + let { updateFlow, incrementNodeId } = useContext(TabsContext); + const { types, reactFlowInstance, setReactFlowInstance } = + useContext(typesContext); + const reactFlowWrapper = useRef(null); - const { setExtraComponent, setExtraNavigation } = useContext(locationContext); - const { setErrorData } = useContext(alertContext); - const [nodes, setNodes, onNodesChange] = useNodesState( - flow.data?.nodes ?? [] - ); - const [edges, setEdges, onEdgesChange] = useEdgesState( - flow.data?.edges ?? [] - ); - const { setViewport } = useReactFlow(); - const edgeUpdateSuccessful = useRef(true) + const { setExtraComponent, setExtraNavigation } = useContext(locationContext); + const { setErrorData } = useContext(alertContext); + const [nodes, setNodes, onNodesChange] = useNodesState( + flow.data?.nodes ?? [] + ); + const [edges, setEdges, onEdgesChange] = useEdgesState( + flow.data?.edges ?? [] + ); + const { setViewport } = useReactFlow(); + const edgeUpdateSuccessful = useRef(true); - useEffect(() => { - if (reactFlowInstance && flow) { - flow.data = reactFlowInstance.toObject(); - updateFlow(flow); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [nodes, edges]); - //update flow when tabs change - useEffect(() => { - setNodes(flow?.data?.nodes ?? []); - setEdges(flow?.data?.edges ?? []); - if (reactFlowInstance) { - setViewport(flow?.data?.viewport ?? { x: 1, y: 0, zoom: 0.5 }); - } - }, [flow, reactFlowInstance, setEdges, setNodes, setViewport]); - //set extra sidebar - useEffect(() => { - setExtraComponent(); - setExtraNavigation({ title: "Components" }); - }, [setExtraComponent, setExtraNavigation]); + useEffect(() => { + if (reactFlowInstance && flow) { + flow.data = reactFlowInstance.toObject(); + updateFlow(flow); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [nodes, edges]); + //update flow when tabs change + useEffect(() => { + setNodes(flow?.data?.nodes ?? []); + setEdges(flow?.data?.edges ?? []); + if (reactFlowInstance) { + setViewport(flow?.data?.viewport ?? { x: 1, y: 0, zoom: 0.5 }); + } + }, [flow, reactFlowInstance, setEdges, setNodes, setViewport]); + //set extra sidebar + useEffect(() => { + setExtraComponent(); + setExtraNavigation({ title: "Components" }); + }, [setExtraComponent, setExtraNavigation]); - const onEdgesChangeMod = useCallback( - (s:EdgeChange[]) => { - onEdgesChange(s); - setNodes((x) => { - let newX = _.cloneDeep(x); - return newX; - }); - }, - [onEdgesChange, setNodes] - ); + const onEdgesChangeMod = useCallback( + (s: EdgeChange[]) => { + onEdgesChange(s); + setNodes((x) => { + let newX = _.cloneDeep(x); + return newX; + }); + }, + [onEdgesChange, setNodes] + ); - const onConnect = useCallback( - (params:Connection) => { - setEdges((eds) => - addEdge({ ...params, className: "animate-pulse" }, eds) - ); - setNodes((x) => { - let newX = _.cloneDeep(x); - return newX; - }); - }, - [setEdges, setNodes] - ); + const onConnect = useCallback( + (params: Connection) => { + setEdges((eds) => + addEdge({ ...params, className: "animate-pulse" }, eds) + ); + setNodes((x) => { + let newX = _.cloneDeep(x); + return newX; + }); + }, + [setEdges, setNodes] + ); - const onDragOver = useCallback((event:React.DragEvent) => { - event.preventDefault(); - event.dataTransfer.dropEffect = "move"; - }, []); + const onDragOver = useCallback((event: React.DragEvent) => { + event.preventDefault(); + event.dataTransfer.dropEffect = "move"; + }, []); - const onDrop = useCallback( - (event:React.DragEvent) => { - event.preventDefault(); - - // Helper function to generate a unique node ID - function getId() { - return `dndnode_` + incrementNodeId(); - } - - // Get the current bounds of the ReactFlow wrapper element - const reactflowBounds = reactFlowWrapper.current.getBoundingClientRect(); - - // Extract the data from the drag event and parse it as a JSON object - let data:{type:string,node?:APIClassType} = JSON.parse(event.dataTransfer.getData("json")); - - // If data type is not "chatInput" or if there are no "chatInputNode" nodes present in the ReactFlow instance, create a new node - if ( - data.type !== "chatInput" || - (data.type === "chatInput" && - !reactFlowInstance.getNodes().some((n) => n.type === "chatInputNode")) - ) { - // Calculate the position where the node should be created - const position = reactFlowInstance.project({ - x: event.clientX - reactflowBounds.left, - y: event.clientY - reactflowBounds.top, - }); - - // Generate a unique node ID - let newId = getId(); - - // Create a new node object - const newNode:NodeType = { - id: newId, - type: "genericNode", - position, - data: { - ...data, - id: newId, - value: null, - }, - }; - - // Add the new node to the list of nodes in state - setNodes((nds) => nds.concat(newNode)); - } else { - // If a chat input node already exists, set an error message - setErrorData({ - title: "Error creating node", - list: ["There can't be more than one chat input."], - }); - } - }, - // Specify dependencies for useCallback - [incrementNodeId, reactFlowInstance, setErrorData, setNodes] - ); + const onDrop = useCallback( + (event: React.DragEvent) => { + event.preventDefault(); - - const onDelete = (mynodes) => { - setEdges(edges.filter((ns) => !nodes.some((n) => ns.source === n.id || ns.target === n.id))); - } + // Helper function to generate a unique node ID + function getId() { + return `dndnode_` + incrementNodeId(); + } - const onEdgeUpdateStart = useCallback(() => { - edgeUpdateSuccessful.current = false; - }, []); + // Get the current bounds of the ReactFlow wrapper element + const reactflowBounds = reactFlowWrapper.current.getBoundingClientRect(); - - const onEdgeUpdate = useCallback((oldEdge:Edge, newConnection:Connection) => { - if(isValidConnection(newConnection,reactFlowInstance)){ - edgeUpdateSuccessful.current = true; - setEdges((els) => updateEdge(oldEdge, newConnection, els)); - } - }, []); + // Extract the data from the drag event and parse it as a JSON object + let data: { type: string; node?: APIClassType } = JSON.parse( + event.dataTransfer.getData("json") + ); - const onEdgeUpdateEnd = useCallback((_, edge) => { - if (!edgeUpdateSuccessful.current) { - setEdges((eds) => eds.filter((e) => e.id !== edge.id)); - } - - edgeUpdateSuccessful.current = true; - }, []); - - return ( -
- {Object.keys(types).length > 0 ? ( - <> - - updateFlow({ ...flow, data: reactFlowInstance.toObject() }) - } - edges={edges} - onNodesChange={onNodesChange} - onEdgesChange={onEdgesChangeMod} - onConnect={onConnect} - onLoad={setReactFlowInstance} - onInit={setReactFlowInstance} - nodeTypes={nodeTypes} - onEdgeUpdate={onEdgeUpdate} - onEdgeUpdateStart={onEdgeUpdateStart} - onEdgeUpdateEnd={onEdgeUpdateEnd} - connectionLineComponent={ConnectionLineComponent} - onDragOver={onDragOver} - onDrop={onDrop} - onNodesDelete={onDelete} - > - - - - - - - ) : ( - <> - )} -
- ); + // If data type is not "chatInput" or if there are no "chatInputNode" nodes present in the ReactFlow instance, create a new node + if ( + data.type !== "chatInput" || + (data.type === "chatInput" && + !reactFlowInstance.getNodes().some((n) => n.type === "chatInputNode")) + ) { + // Calculate the position where the node should be created + const position = reactFlowInstance.project({ + x: event.clientX - reactflowBounds.left, + y: event.clientY - reactflowBounds.top, + }); + + // Generate a unique node ID + let newId = getId(); + + // Create a new node object + const newNode: NodeType = { + id: newId, + type: "genericNode", + position, + data: { + ...data, + id: newId, + value: null, + }, + }; + + // Add the new node to the list of nodes in state + setNodes((nds) => nds.concat(newNode)); + } else { + // If a chat input node already exists, set an error message + setErrorData({ + title: "Error creating node", + list: ["There can't be more than one chat input."], + }); + } + }, + // Specify dependencies for useCallback + [incrementNodeId, reactFlowInstance, setErrorData, setNodes] + ); + + const onDelete = (mynodes) => { + setEdges( + edges.filter( + (ns) => !nodes.some((n) => ns.source === n.id || ns.target === n.id) + ) + ); + }; + + const onEdgeUpdateStart = useCallback(() => { + edgeUpdateSuccessful.current = false; + }, []); + + const onEdgeUpdate = useCallback( + (oldEdge: Edge, newConnection: Connection) => { + if (isValidConnection(newConnection, reactFlowInstance)) { + edgeUpdateSuccessful.current = true; + setEdges((els) => updateEdge(oldEdge, newConnection, els)); + } + }, + [] + ); + + const onEdgeUpdateEnd = useCallback((_, edge) => { + if (!edgeUpdateSuccessful.current) { + setEdges((eds) => eds.filter((e) => e.id !== edge.id)); + } + + edgeUpdateSuccessful.current = true; + }, []); + + return ( +
+ {Object.keys(types).length > 0 ? ( + <> + + updateFlow({ ...flow, data: reactFlowInstance.toObject() }) + } + edges={edges} + onNodesChange={onNodesChange} + onEdgesChange={onEdgesChangeMod} + onConnect={onConnect} + onLoad={setReactFlowInstance} + onInit={setReactFlowInstance} + nodeTypes={nodeTypes} + onEdgeUpdate={onEdgeUpdate} + onEdgeUpdateStart={onEdgeUpdateStart} + onEdgeUpdateEnd={onEdgeUpdateEnd} + connectionLineComponent={ConnectionLineComponent} + onDragOver={onDragOver} + onDrop={onDrop} + onNodesDelete={onDelete} + > + + + + + + ) : ( + <> + )} +
+ ); } diff --git a/src/frontend/src/reportWebVitals.ts b/src/frontend/src/reportWebVitals.ts index 49a2a16e0..5fa3583b7 100644 --- a/src/frontend/src/reportWebVitals.ts +++ b/src/frontend/src/reportWebVitals.ts @@ -1,8 +1,8 @@ -import { ReportHandler } from 'web-vitals'; +import { ReportHandler } from "web-vitals"; const reportWebVitals = (onPerfEntry?: ReportHandler) => { if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { + import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { getCLS(onPerfEntry); getFID(onPerfEntry); getFCP(onPerfEntry); diff --git a/src/frontend/src/svg.d.ts b/src/frontend/src/svg.d.ts index a6e109e02..1a3dd3c2a 100644 --- a/src/frontend/src/svg.d.ts +++ b/src/frontend/src/svg.d.ts @@ -1,5 +1,4 @@ -declare module '*.svg' { - const content: any; - export default content; - } - \ No newline at end of file +declare module "*.svg" { + const content: any; + export default content; +} diff --git a/src/frontend/src/types/api/index.ts b/src/frontend/src/types/api/index.ts index 4a2afcd18..8d26c4e15 100644 --- a/src/frontend/src/types/api/index.ts +++ b/src/frontend/src/types/api/index.ts @@ -1,20 +1,40 @@ -import { Node,Edge,Viewport } from "reactflow" +import { Node, Edge, Viewport } from "reactflow"; //kind and class are just representative names to represent the actual structure of the object received by the API -export type APIObjectType = {kind:APIKindType,[key:string]:APIKindType} -export type APIKindType= {class:APIClassType,[key:string]:APIClassType} -export type APITemplateType = {variable:TemplateVariableType,[key:string]:TemplateVariableType} -export type APIClassType ={base_classes:Array,description:string,template:APITemplateType,[key:string]:Array|string|APITemplateType} -export type TemplateVariableType = {type:string,required:boolean,placeholder?:string,list:boolean,show:boolean,multiline?:boolean,value?:any,[key:string]:any} -export type sendAllProps={ - nodes: Node[]; - edges: Edge[]; - name:string, - description:string; - viewport: Viewport; - message:string; - - chatHistory:{message:string,isSend:boolean}[], +export type APIObjectType = { kind: APIKindType; [key: string]: APIKindType }; +export type APIKindType = { class: APIClassType; [key: string]: APIClassType }; +export type APITemplateType = { + variable: TemplateVariableType; + [key: string]: TemplateVariableType; }; -export type errorsTypeAPI={function:{errors:Array},imports:{errors:Array}} -export type PromptTypeAPI = {input_variables:Array} \ No newline at end of file +export type APIClassType = { + base_classes: Array; + description: string; + template: APITemplateType; + [key: string]: Array | string | APITemplateType; +}; +export type TemplateVariableType = { + type: string; + required: boolean; + placeholder?: string; + list: boolean; + show: boolean; + multiline?: boolean; + value?: any; + [key: string]: any; +}; +export type sendAllProps = { + nodes: Node[]; + edges: Edge[]; + name: string; + description: string; + viewport: Viewport; + message: string; + + chatHistory: { message: string; isSend: boolean }[]; +}; +export type errorsTypeAPI = { + function: { errors: Array }; + imports: { errors: Array }; +}; +export type PromptTypeAPI = { input_variables: Array }; diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index d7448083e..e8c682724 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -1,81 +1,85 @@ import { ForwardRefExoticComponent, ReactElement, ReactNode } from "react"; import { NodeDataType } from "../flow/index"; export type InputComponentType = { - value: string; - disabled?: boolean; - onChange: (value: string) => void; - password: boolean; + value: string; + disabled?: boolean; + onChange: (value: string) => void; + password: boolean; }; export type ToggleComponentType = { - enabled: boolean; - setEnabled: (state: boolean) => void; - disabled: boolean; + enabled: boolean; + setEnabled: (state: boolean) => void; + disabled: boolean; }; export type DropDownComponentType = { - value: string; - options: string[]; - onSelect: (value: string) => void; + value: string; + options: string[]; + onSelect: (value: string) => void; }; export type ParameterComponentType = { - data: NodeDataType; - title: string; - id: string; - color: string; - left: boolean; - type: string; - required?: boolean; - name?: string; - tooltipTitle: string; + data: NodeDataType; + title: string; + id: string; + color: string; + left: boolean; + type: string; + required?: boolean; + name?: string; + tooltipTitle: string; }; export type InputListComponentType = { - value: string[]; - onChange: (value: string[]) => void; - disabled: boolean; + value: string[]; + onChange: (value: string[]) => void; + disabled: boolean; }; export type TextAreaComponentType = { - disabled: boolean; - onChange: (value: string[] | string) => void; - value: string; + disabled: boolean; + onChange: (value: string[] | string) => void; + value: string; }; export type FileComponentType = { - disabled: boolean; - onChange: (value: string[] | string) => void; - value: string; - suffixes:Array; - fileTypes:Array; - onFileChange:(value: string) => void; + disabled: boolean; + onChange: (value: string[] | string) => void; + value: string; + suffixes: Array; + fileTypes: Array; + onFileChange: (value: string) => void; }; export type DisclosureComponentType = { - children: ReactNode; - button: { - title: string; - Icon: ForwardRefExoticComponent>; - buttons?: { - Icon: ReactElement; - title: string; - onClick: (event?: React.MouseEvent) => void; - }[]; - }; + children: ReactNode; + button: { + title: string; + Icon: ForwardRefExoticComponent>; + buttons?: { + Icon: ReactElement; + title: string; + onClick: (event?: React.MouseEvent) => void; + }[]; + }; }; export type FloatComponentType = { - value: string; - disabled?: boolean; - onChange: (value: string) => void; + value: string; + disabled?: boolean; + onChange: (value: string) => void; }; -export type TooltipComponentType={children:ReactElement,title:string,placement?: - | 'bottom-end' - | 'bottom-start' - | 'bottom' - | 'left-end' - | 'left-start' - | 'left' - | 'right-end' - | 'right-start' - | 'right' - | 'top-end' - | 'top-start' - | 'top';} \ No newline at end of file +export type TooltipComponentType = { + children: ReactElement; + title: string; + placement?: + | "bottom-end" + | "bottom-start" + | "bottom" + | "left-end" + | "left-start" + | "left" + | "right-end" + | "right-start" + | "right" + | "top-end" + | "top-start" + | "top"; +}; diff --git a/src/frontend/src/types/entities/index.ts b/src/frontend/src/types/entities/index.ts index c0d591cfc..3c0877579 100644 --- a/src/frontend/src/types/entities/index.ts +++ b/src/frontend/src/types/entities/index.ts @@ -1,3 +1,8 @@ import { HomeIcon } from "@heroicons/react/24/outline"; -export type sidebarNavigationItemType = { name: string, href: string, icon: React.ForwardRefExoticComponent>, current: boolean } +export type sidebarNavigationItemType = { + name: string; + href: string; + icon: React.ForwardRefExoticComponent>; + current: boolean; +}; diff --git a/src/frontend/src/types/flow/index.ts b/src/frontend/src/types/flow/index.ts index 26354c55c..6c118aa49 100644 --- a/src/frontend/src/types/flow/index.ts +++ b/src/frontend/src/types/flow/index.ts @@ -1,12 +1,22 @@ -import { ChatMessageType } from './../chat/index'; -import { APIClassType } from '../api/index'; +import { ChatMessageType } from "./../chat/index"; +import { APIClassType } from "../api/index"; import { ReactFlowJsonObject, XYPosition } from "reactflow"; export type FlowType = { - name: string; - id: string; - data: ReactFlowJsonObject; - description:string; + name: string; + id: string; + data: ReactFlowJsonObject; + description: string; +}; +export type NodeType = { + id: string; + type?: string; + position: XYPosition; + data: NodeDataType; +}; +export type NodeDataType = { + type: string; + node?: APIClassType; + id: string; + value: any; }; -export type NodeType = {id:string,type:string,position:XYPosition,data:NodeDataType} -export type NodeDataType = {type:string,node?:APIClassType,id:string,value:any} \ No newline at end of file diff --git a/src/frontend/src/types/tabs/index.ts b/src/frontend/src/types/tabs/index.ts index 1b675e0c5..3fffbcd8a 100644 --- a/src/frontend/src/types/tabs/index.ts +++ b/src/frontend/src/types/tabs/index.ts @@ -1,15 +1,15 @@ import { FlowType } from "../flow"; export type TabsContextType = { - save:()=>void; - tabIndex: number; - setTabIndex: (index: number) => void; - flows: Array; - removeFlow: (id: string) => void; - addFlow: (flowData?: FlowType) => void; - updateFlow: (newFlow: FlowType) => void; - incrementNodeId: () => number; - downloadFlow: (flow:FlowType) => void; - uploadFlow: () => void; - hardReset:()=>void; -}; \ No newline at end of file + save: () => void; + tabIndex: number; + setTabIndex: (index: number) => void; + flows: Array; + removeFlow: (id: string) => void; + addFlow: (flowData?: FlowType) => void; + updateFlow: (newFlow: FlowType) => void; + incrementNodeId: () => number; + downloadFlow: (flow: FlowType) => void; + uploadFlow: () => void; + hardReset: () => void; +}; diff --git a/src/frontend/src/types/typesContext/index.ts b/src/frontend/src/types/typesContext/index.ts index e943dafe3..f3a8612b5 100644 --- a/src/frontend/src/types/typesContext/index.ts +++ b/src/frontend/src/types/typesContext/index.ts @@ -1,11 +1,11 @@ import { ReactFlowInstance } from "reactflow"; -const types:{[char: string]: string}={} +const types: { [char: string]: string } = {}; export type typesContextType = { - reactFlowInstance: ReactFlowInstance|null; - setReactFlowInstance: any; - deleteNode: (idx: string) => void; - types: typeof types; - setTypes: (newState: {}) => void; -}; \ No newline at end of file + reactFlowInstance: ReactFlowInstance | null; + setReactFlowInstance: any; + deleteNode: (idx: string) => void; + types: typeof types; + setTypes: (newState: {}) => void; +}; diff --git a/src/frontend/src/utils.ts b/src/frontend/src/utils.ts index 608035ff8..c7457a70b 100644 --- a/src/frontend/src/utils.ts +++ b/src/frontend/src/utils.ts @@ -14,13 +14,13 @@ import { FingerPrintIcon, ScissorsIcon, CircleStackIcon, - Squares2X2Icon + Squares2X2Icon, } from "@heroicons/react/24/outline"; import { Connection, Edge, Node, ReactFlowInstance } from "reactflow"; import { FlowType } from "./types/flow"; -var _ = require('lodash') +var _ = require("lodash"); -export function classNames(...classes:Array) { +export function classNames(...classes: Array) { return classes.filter(Boolean).join(" "); } @@ -70,7 +70,7 @@ export const borderLColors = { gray: "border-l-gray-500", }; -export const nodeColors: {[char: string]: string} = { +export const nodeColors: { [char: string]: string } = { prompts: "#4367BF", llms: "#6344BE", chains: "#FE7500", @@ -79,18 +79,18 @@ export const nodeColors: {[char: string]: string} = { memories: "#F5B85A", advanced: "#000000", chat: "#198BF6", - thought:"#272541", - embeddings:"#42BAA7", - documentloaders:"#7AAE42", + thought: "#272541", + embeddings: "#42BAA7", + documentloaders: "#7AAE42", vectorstores: "#AA8742", textsplitters: "#B47CB5", - toolkits:"#DB2C2C", - wrappers:"#E6277A", - utilities:"#31A3CC", - unknown:"#9CA3AF" + toolkits: "#DB2C2C", + wrappers: "#E6277A", + utilities: "#31A3CC", + unknown: "#9CA3AF", }; -export const nodeNames:{[char: string]: string} = { +export const nodeNames: { [char: string]: string } = { prompts: "Prompts", llms: "LLMs", chains: "Chains", @@ -102,14 +102,18 @@ export const nodeNames:{[char: string]: string} = { embeddings: "Embeddings", documentloaders: "Document Loaders", vectorstores: "Vector Stores", - toolkits:"Toolkits", - wrappers:"Wrappers", + toolkits: "Toolkits", + wrappers: "Wrappers", textsplitters: "Text Splitters", - utilities:"Utilities", - unknown:"Unknown" + utilities: "Utilities", + unknown: "Unknown", }; -export const nodeIcons:{[char: string]: React.ForwardRefExoticComponent>} = { +export const nodeIcons: { + [char: string]: React.ForwardRefExoticComponent< + React.SVGProps + >; +} = { agents: RocketLaunchIcon, chains: LinkIcon, memories: CpuChipIcon, @@ -118,14 +122,14 @@ export const nodeIcons:{[char: string]: React.ForwardRefExoticComponent { - if (index === 0) { - return word[0].toUpperCase() + word.slice(1).toLowerCase(); - } - return word.toLowerCase(); - }) - .join("_"); + .split(" ") + .map((word, index) => { + if (index === 0) { + return word[0].toUpperCase() + word.slice(1).toLowerCase(); + } + return word.toLowerCase(); + }) + .join("_"); } -export function roundNumber(x:number, decimals:number) { +export function roundNumber(x: number, decimals: number) { return Math.round(x * Math.pow(10, decimals)) / Math.pow(10, decimals); } @@ -345,12 +353,15 @@ export function getConnectedNodes(edge: Edge, nodes: Array): Array { } export function isValidConnection( - { source, target, sourceHandle, targetHandle }:Connection, - reactFlowInstance:ReactFlowInstance + { source, target, sourceHandle, targetHandle }: Connection, + reactFlowInstance: ReactFlowInstance ) { if ( - sourceHandle.split('|')[0] === targetHandle.split("|")[0] || - sourceHandle.split('|').slice(2).some((t) => t === targetHandle.split("|")[0]) || + sourceHandle.split("|")[0] === targetHandle.split("|")[0] || + sourceHandle + .split("|") + .slice(2) + .some((t) => t === targetHandle.split("|")[0]) || targetHandle.split("|")[0] === "str" ) { let targetNode = reactFlowInstance.getNode(target).data.node; @@ -375,16 +386,15 @@ export function isValidConnection( return false; } -export function removeApiKeys(flow:FlowType):FlowType{ - let cleanFLow = _.cloneDeep(flow) - cleanFLow.data.nodes.forEach(node=>{ - for(const key in node.data.node.template) - { - if(key.includes('api')){ - console.log(node.data.node.template[key]) - node.data.node.template[key].value = '' +export function removeApiKeys(flow: FlowType): FlowType { + let cleanFLow = _.cloneDeep(flow); + cleanFLow.data.nodes.forEach((node) => { + for (const key in node.data.node.template) { + if (key.includes("api")) { + console.log(node.data.node.template[key]); + node.data.node.template[key].value = ""; } } - }) - return cleanFLow -} \ No newline at end of file + }); + return cleanFLow; +} From 07863ea09847b9191568f5b9cb652eb0606ccf4a Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 15:44:18 -0300 Subject: [PATCH 118/150] test(websocket.py): change websocket endpoint from /ws/test_client to /chat/test_client test(websocket.py): update assertions to match new endpoint and response format --- tests/test_websocket.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/test_websocket.py b/tests/test_websocket.py index 9ec128bcf..1137c4813 100644 --- a/tests/test_websocket.py +++ b/tests/test_websocket.py @@ -5,9 +5,9 @@ from fastapi.testclient import TestClient def test_websocket_connection(client: TestClient): - with client.websocket_connect("/ws/test_client") as websocket: + with client.websocket_connect("/chat/test_client") as websocket: assert websocket.scope["client"] == ["testclient", 50000] - assert websocket.scope["path"] == "/ws/test_client" + assert websocket.scope["path"] == "/chat/test_client" def test_chat_history(client: TestClient): @@ -17,21 +17,22 @@ def test_chat_history(client: TestClient): with patch("langflow.api.chat_manager.process_graph") as mock_process_graph: mock_process_graph.return_value = ("Hello, I'm a mock response!", "") - with client.websocket_connect("/ws/test_client") as websocket: + with client.websocket_connect("/chat/test_client") as websocket: # First message should be the history history = websocket.receive_json() - assert json.loads(history) == [] # Empty history + assert history == [] # Empty history # Send a message payload = {"message": "Hello"} websocket.send_json(json.dumps(payload)) # Receive the response from the server response = websocket.receive_json() - assert json.loads(response) == { + assert response == { "is_bot": True, "message": None, - "intermediate_steps": "", "type": "start", + "intermediate_steps": "", + "files": [], } # Send another message payload = {"message": "How are you?"} @@ -39,9 +40,10 @@ def test_chat_history(client: TestClient): # Receive the response from the server response = websocket.receive_json() - assert json.loads(response) == { + assert response == { "is_bot": True, "message": "Hello, I'm a mock response!", - "intermediate_steps": "", "type": "end", + "intermediate_steps": "", + "files": [], } From 357d13b1a90a594796709302231288474a7e17e8 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 15:45:53 -0300 Subject: [PATCH 119/150] refactor(validate.py): change wrapped_function from async to sync fix(test_chains_template.py): set prompt show value to False for mid_journey_prompt_chain and time_travel_guide_chain tests --- src/backend/langflow/utils/validate.py | 2 +- tests/test_chains_template.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/langflow/utils/validate.py b/src/backend/langflow/utils/validate.py index 59d22a143..d1353bd77 100644 --- a/src/backend/langflow/utils/validate.py +++ b/src/backend/langflow/utils/validate.py @@ -155,7 +155,7 @@ def create_function(code, function_name): exec_globals[function_name] = locals()[function_name] # Return a function that imports necessary modules and calls the target function - async def wrapped_function(*args, **kwargs): + def wrapped_function(*args, **kwargs): for module_name, module in exec_globals.items(): if isinstance(module, type(importlib)): globals()[module_name] = module diff --git a/tests/test_chains_template.py b/tests/test_chains_template.py index 510437797..ad57a9a39 100644 --- a/tests/test_chains_template.py +++ b/tests/test_chains_template.py @@ -462,7 +462,7 @@ def test_mid_journey_prompt_chain(client: TestClient): assert template["prompt"] == { "required": False, "placeholder": "", - "show": True, + "show": False, "multiline": False, "value": { "input_variables": ["history", "input"], @@ -590,7 +590,7 @@ def test_time_travel_guide_chain(client: TestClient): assert template["prompt"] == { "required": False, "placeholder": "", - "show": True, + "show": False, "multiline": False, "value": { "input_variables": ["history", "input"], From 5faf0f6dc777e455a28c7c412ab1035c1faa9dfc Mon Sep 17 00:00:00 2001 From: "Aaron (\"AJ\") Steers" Date: Tue, 25 Apr 2023 18:10:14 -0700 Subject: [PATCH 120/150] feat: add demo devcontainer --- .devcontainer/demo/devcontainer.json | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .devcontainer/demo/devcontainer.json diff --git a/.devcontainer/demo/devcontainer.json b/.devcontainer/demo/devcontainer.json new file mode 100644 index 000000000..cc1edef03 --- /dev/null +++ b/.devcontainer/demo/devcontainer.json @@ -0,0 +1,35 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/universal +{ + "name": "LangChain Demo Container", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:3.10", + "features": { + "ghcr.io/devcontainers/features/aws-cli:1": {}, + "ghcr.io/devcontainers/features/docker-in-docker": {}, + "ghcr.io/devcontainers/features/node": {} + }, + "customizations": { + "vscode": {"extensions": [ + "actboy168.tasks", + "GitHub.copilot", + "ms-python.python", + "eamodio.gitlens" + ]} + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pipx install 'langflow>=0.0.33' && langflow --host 0.0.0.0", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} From 88fabf93b074f18e672bcfe5cb84cab853ce3b02 Mon Sep 17 00:00:00 2001 From: "Aaron (\"AJ\") Steers" Date: Tue, 25 Apr 2023 18:11:17 -0700 Subject: [PATCH 121/150] chore: rename base devcontainer, add dind, add postcreate poetry install --- .devcontainer/devcontainer.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5e73fbd62..282ff4ad3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,11 +1,12 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/universal { - "name": "Default Linux Universal", + "name": "LangChain Dev Container", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "image": "mcr.microsoft.com/devcontainers/universal:2-linux", "features": { - "ghcr.io/devcontainers/features/aws-cli:1": {} + "ghcr.io/devcontainers/features/aws-cli:1": {}, + "ghcr.io/devcontainers/features/docker-in-docker": {} }, "customizations": { "vscode": {"extensions": [ @@ -15,7 +16,7 @@ "sourcery.sourcery", "eamodio.gitlens" ]} - } + }, // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, @@ -24,7 +25,7 @@ // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "uname -a", + "postCreateCommand": "poetry install" // Configure tool-specific properties. // "customizations": {}, From 9252d34d04cc68ee67b1206277fbe3e15fd782cb Mon Sep 17 00:00:00 2001 From: "Aaron (\"AJ\") Steers" Date: Wed, 26 Apr 2023 01:41:06 +0000 Subject: [PATCH 122/150] chore: autoformat --- .devcontainer/demo/devcontainer.json | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.devcontainer/demo/devcontainer.json b/.devcontainer/demo/devcontainer.json index cc1edef03..1febd3cf5 100644 --- a/.devcontainer/demo/devcontainer.json +++ b/.devcontainer/demo/devcontainer.json @@ -10,26 +10,23 @@ "ghcr.io/devcontainers/features/node": {} }, "customizations": { - "vscode": {"extensions": [ + "vscode": { + "extensions": [ "actboy168.tasks", "GitHub.copilot", "ms-python.python", "eamodio.gitlens" - ]} + ] + } }, - // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pipx install 'langflow>=0.0.33' && langflow --host 0.0.0.0", - + "postCreateCommand": "pipx install 'langflow>=0.0.33' && langflow --host 0.0.0.0" // Configure tool-specific properties. // "customizations": {}, - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" -} +} \ No newline at end of file From be9497718ffa43f9213fa3bb668c9628bf915057 Mon Sep 17 00:00:00 2001 From: "Aaron (\"AJ\") Steers" Date: Wed, 26 Apr 2023 01:41:16 +0000 Subject: [PATCH 123/150] docs: add readme guide --- .devcontainer/demo/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .devcontainer/demo/README.md diff --git a/.devcontainer/demo/README.md b/.devcontainer/demo/README.md new file mode 100644 index 000000000..d0ad14f9e --- /dev/null +++ b/.devcontainer/demo/README.md @@ -0,0 +1,15 @@ +# LangFlow Demo Codespace Readme + +These instructions will walk you through the process of running a LangFlow demo via GitHub Codespaces. + +## Setup + +### Create a Codespace in GitHub + +To setup the demo, simply navigate to the Langflow repo, click the "+" button, and select "Create new Codespace". This will automatically create a new codespace in your browser, which you can use for the demo. + +### Wait for everything to install + +After the codespace is opened, you should see a new Terminal window in VS Code where langflow is installed. Once the install completes, `langflow` will launch the webserver and your application will be available via devcontainer port. + +Note: VS Code should prompt you with a button to push once the port is available. From 8e2342cf2173cb6c9a5f01beac2dca37c46bf9fb Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 17:22:51 -0300 Subject: [PATCH 124/150] feat(loading.py): add validation for pydantic BaseModel subclasses This commit adds validation for pydantic BaseModel subclasses in the instantiate_class function. The function now checks if the class_object is a subclass of BaseModel and if so, it validates the params passed to it against the fields of the class_object. --- src/backend/langflow/interface/loading.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/langflow/interface/loading.py b/src/backend/langflow/interface/loading.py index e3011d82c..250908ea7 100644 --- a/src/backend/langflow/interface/loading.py +++ b/src/backend/langflow/interface/loading.py @@ -25,6 +25,7 @@ from langflow.interface.toolkits.base import toolkits_creator from langflow.interface.types import get_type_list from langflow.interface.utils import load_file_into_dict from langflow.utils import util, validate +from pydantic import BaseModel def instantiate_class(node_type: str, base_type: str, params: Dict) -> Any: @@ -35,6 +36,11 @@ def instantiate_class(node_type: str, base_type: str, params: Dict) -> Any: class_object = import_by_type(_type=base_type, name=node_type) + if issubclass(class_object, BaseModel): + # validate params + fields = class_object.__fields__ + params = {key: value for key, value in params.items() if key in fields} + if base_type == "agents": # We need to initialize it differently return load_agent_executor(class_object, params) @@ -66,6 +72,7 @@ def instantiate_class(node_type: str, base_type: str, params: Dict) -> Any: return load_toolkits_executor(node_type, loaded_toolkit, params) return loaded_toolkit elif base_type == "embeddings": + # ? Why remove model from params? params.pop("model") return class_object(**params) elif base_type == "vectorstores": From cde48131e3349a5aed5d4276e76a769bd6aebf90 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 28 Apr 2023 17:59:23 -0300 Subject: [PATCH 125/150] fix bug on event prevent default --- src/frontend/src/components/chatComponent/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index a4eae7f21..10d285ba9 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -14,8 +14,8 @@ export default function Chat({ flow }: ChatType) { const [open, setOpen] = useState(false); useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { - event.preventDefault() if ((event.key === "K"||event.key==="k") && (event.metaKey||event.ctrlKey)) { + event.preventDefault() setOpen(oldState=>!oldState); } }; From 0fd8f73c089dfb7eb012e2eec063d6e50ec73f51 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 19:17:38 -0300 Subject: [PATCH 126/150] refactor(langflow): set advanced flag to True for TemplateFieldCreator class refactor(langflow): set advanced flag to False for LLMFrontendNode class' api key field feat(langflow): add show flag to LLMFrontendNode class' model_kwargs field refactor(langflow): set advanced flag to False and show flag to True for LLMFrontendNode class' model_name and temperature fields --- src/backend/langflow/template/base.py | 4 ++-- src/backend/langflow/template/nodes.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/template/base.py b/src/backend/langflow/template/base.py index 887eaa689..860d2ac1e 100644 --- a/src/backend/langflow/template/base.py +++ b/src/backend/langflow/template/base.py @@ -23,7 +23,7 @@ class TemplateFieldCreator(BaseModel, ABC): options: list[str] = [] name: str = "" display_name: Optional[str] = None - advanced: bool = False + advanced: bool = True def to_dict(self): result = self.dict() @@ -241,4 +241,4 @@ class FrontendNode(BaseModel): # If the field.name contains api or api and key, then it might be an api key # other conditions are to make sure that it is not an input or output variable if "api" in key.lower() and "key" in key.lower(): - field.required = False \ No newline at end of file + field.required = False diff --git a/src/backend/langflow/template/nodes.py b/src/backend/langflow/template/nodes.py index 7867b8afc..c96740840 100644 --- a/src/backend/langflow/template/nodes.py +++ b/src/backend/langflow/template/nodes.py @@ -448,6 +448,7 @@ class LLMFrontendNode(FrontendNode): # Required should be False to support # loading the API key from environment variables field.required = False + field.advanced = False if field.name == "task": field.required = True @@ -461,3 +462,7 @@ class LLMFrontendNode(FrontendNode): if field.name == "model_kwargs": field.field_type = "code" field.advanced = True + field.show = True + elif field.name in ["model_name", "temperature"]: + field.advanced = False + field.show = True From f3d385b8e5c64bd65d262c6e185ac329a53ec89b Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 19:18:17 -0300 Subject: [PATCH 127/150] feat(tests): add "advanced" field to all template objects in test files feat(tests): add 'advanced' field to template properties in test files --- tests/test_agents_template.py | 10 ++++++++ tests/test_chains_template.py | 44 ++++++++++++++++++++++++++++++++++ tests/test_llms_template.py | 36 ++++++++++++++++++++++++++++ tests/test_prompts_template.py | 15 ++++++++++++ 4 files changed, 105 insertions(+) diff --git a/tests/test_agents_template.py b/tests/test_agents_template.py index d63365fdc..a546454eb 100644 --- a/tests/test_agents_template.py +++ b/tests/test_agents_template.py @@ -36,6 +36,7 @@ def test_zero_shot_agent(client: TestClient): "name": "llm_chain", "type": "LLMChain", "list": False, + "advanced": True, } assert template["allowed_tools"] == { "required": False, @@ -46,6 +47,7 @@ def test_zero_shot_agent(client: TestClient): "name": "allowed_tools", "type": "Tool", "list": True, + "advanced": True, } @@ -68,6 +70,7 @@ def test_json_agent(client: TestClient): "name": "toolkit", "type": "BaseToolkit", "list": False, + "advanced": True, } assert template["llm"] == { "required": True, @@ -78,6 +81,7 @@ def test_json_agent(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, + "advanced": True, } @@ -104,6 +108,7 @@ def test_csv_agent(client: TestClient): "type": "file", "list": False, "content": None, + "advanced": True, } assert template["llm"] == { "required": True, @@ -114,6 +119,7 @@ def test_csv_agent(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, + "advanced": True, } @@ -143,6 +149,7 @@ def test_initialize_agent(client: TestClient): "name": "agent", "type": "str", "list": True, + "advanced": True, } assert template["memory"] == { "required": False, @@ -153,6 +160,7 @@ def test_initialize_agent(client: TestClient): "name": "memory", "type": "BaseChatMemory", "list": False, + "advanced": True, } assert template["tools"] == { "required": False, @@ -163,6 +171,7 @@ def test_initialize_agent(client: TestClient): "name": "tools", "type": "Tool", "list": True, + "advanced": True, } assert template["llm"] == { "required": True, @@ -173,4 +182,5 @@ def test_initialize_agent(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, + "advanced": True, } diff --git a/tests/test_chains_template.py b/tests/test_chains_template.py index 510437797..76ab2ca13 100644 --- a/tests/test_chains_template.py +++ b/tests/test_chains_template.py @@ -31,6 +31,7 @@ def test_conversation_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, + "advanced": True, } assert template["verbose"] == { "required": False, @@ -41,6 +42,7 @@ def test_conversation_chain(client: TestClient): "name": "verbose", "type": "bool", "list": False, + "advanced": True, } assert template["llm"] == { "required": True, @@ -51,6 +53,7 @@ def test_conversation_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, + "advanced": True, } assert template["input_key"] == { "required": True, @@ -62,6 +65,7 @@ def test_conversation_chain(client: TestClient): "name": "input_key", "type": "str", "list": False, + "advanced": True, } assert template["output_key"] == { "required": True, @@ -73,6 +77,7 @@ def test_conversation_chain(client: TestClient): "name": "output_key", "type": "str", "list": False, + "advanced": True, } assert template["_type"] == "ConversationChain" @@ -102,6 +107,7 @@ def test_llm_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, + "advanced": True, } assert template["verbose"] == { "required": False, @@ -113,6 +119,7 @@ def test_llm_chain(client: TestClient): "name": "verbose", "type": "bool", "list": False, + "advanced": True, } assert template["llm"] == { "required": True, @@ -123,6 +130,7 @@ def test_llm_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, + "advanced": True, } assert template["output_key"] == { "required": True, @@ -134,6 +142,7 @@ def test_llm_chain(client: TestClient): "name": "output_key", "type": "str", "list": False, + "advanced": True, } @@ -156,6 +165,7 @@ def test_llm_checker_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, + "advanced": True, } assert template["verbose"] == { "required": False, @@ -167,6 +177,7 @@ def test_llm_checker_chain(client: TestClient): "name": "verbose", "type": "bool", "list": False, + "advanced": True, } assert template["llm"] == { "required": True, @@ -177,6 +188,7 @@ def test_llm_checker_chain(client: TestClient): "name": "llm", "type": "BaseLLM", "list": False, + "advanced": True, } assert template["input_key"] == { "required": True, @@ -188,6 +200,7 @@ def test_llm_checker_chain(client: TestClient): "name": "input_key", "type": "str", "list": False, + "advanced": True, } assert template["output_key"] == { "required": True, @@ -199,6 +212,7 @@ def test_llm_checker_chain(client: TestClient): "name": "output_key", "type": "str", "list": False, + "advanced": True, } assert template["_type"] == "LLMCheckerChain" @@ -228,6 +242,7 @@ def test_llm_math_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, + "advanced": True, } assert template["verbose"] == { "required": False, @@ -239,6 +254,7 @@ def test_llm_math_chain(client: TestClient): "name": "verbose", "type": "bool", "list": False, + "advanced": True, } assert template["llm"] == { "required": True, @@ -249,6 +265,7 @@ def test_llm_math_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, + "advanced": True, } assert template["input_key"] == { "required": True, @@ -260,6 +277,7 @@ def test_llm_math_chain(client: TestClient): "name": "input_key", "type": "str", "list": False, + "advanced": True, } assert template["output_key"] == { "required": True, @@ -271,6 +289,7 @@ def test_llm_math_chain(client: TestClient): "name": "output_key", "type": "str", "list": False, + "advanced": True, } assert template["_type"] == "LLMMathChain" @@ -316,6 +335,7 @@ def test_series_character_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, + "advanced": True, } assert template["verbose"] == { "required": False, @@ -326,6 +346,7 @@ def test_series_character_chain(client: TestClient): "name": "verbose", "type": "bool", "list": False, + "advanced": True, } assert template["llm"] == { "required": True, @@ -336,6 +357,7 @@ def test_series_character_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, + "advanced": True, } assert template["input_key"] == { "required": True, @@ -347,6 +369,7 @@ def test_series_character_chain(client: TestClient): "name": "input_key", "type": "str", "list": False, + "advanced": True, } assert template["output_key"] == { "required": True, @@ -358,6 +381,7 @@ def test_series_character_chain(client: TestClient): "name": "output_key", "type": "str", "list": False, + "advanced": True, } assert template["template"] == { "required": False, @@ -369,6 +393,7 @@ def test_series_character_chain(client: TestClient): "name": "template", "type": "str", "list": False, + "advanced": True, } assert template["ai_prefix_value"] == { "required": False, @@ -380,6 +405,7 @@ def test_series_character_chain(client: TestClient): "name": "ai_prefix_value", "type": "str", "list": False, + "advanced": True, } assert template["character"] == { "required": True, @@ -390,6 +416,7 @@ def test_series_character_chain(client: TestClient): "name": "character", "type": "str", "list": False, + "advanced": True, } assert template["series"] == { "required": True, @@ -400,6 +427,7 @@ def test_series_character_chain(client: TestClient): "name": "series", "type": "str", "list": False, + "advanced": True, } assert template["_type"] == "SeriesCharacterChain" @@ -447,6 +475,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, + "advanced": True, } assert template["verbose"] == { "required": False, @@ -457,6 +486,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "name": "verbose", "type": "bool", "list": False, + "advanced": True, } # Continue with other template object assertions assert template["prompt"] == { @@ -477,6 +507,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "name": "prompt", "type": "BasePromptTemplate", "list": False, + "advanced": True, } assert template["llm"] == { "required": True, @@ -487,6 +518,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, + "advanced": True, } assert template["output_key"] == { "required": True, @@ -498,6 +530,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "name": "output_key", "type": "str", "list": False, + "advanced": True, } assert template["input_key"] == { "required": True, @@ -509,6 +542,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "name": "input_key", "type": "str", "list": False, + "advanced": True, } assert template["template"] == { "required": False, @@ -520,6 +554,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "name": "template", "type": "str", "list": False, + "advanced": True, } assert template["ai_prefix_value"] == { "required": False, @@ -530,6 +565,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "name": "ai_prefix_value", "type": "str", "list": False, + "advanced": True, } # Test the description object assert ( @@ -575,6 +611,7 @@ def test_time_travel_guide_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, + "advanced": True, } assert template["verbose"] == { "required": False, @@ -585,6 +622,7 @@ def test_time_travel_guide_chain(client: TestClient): "name": "verbose", "type": "bool", "list": False, + "advanced": True, } assert template["prompt"] == { @@ -605,6 +643,7 @@ def test_time_travel_guide_chain(client: TestClient): "name": "prompt", "type": "BasePromptTemplate", "list": False, + "advanced": True, } assert template["llm"] == { "required": True, @@ -615,6 +654,7 @@ def test_time_travel_guide_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, + "advanced": True, } assert template["output_key"] == { "required": True, @@ -626,6 +666,7 @@ def test_time_travel_guide_chain(client: TestClient): "name": "output_key", "type": "str", "list": False, + "advanced": True, } assert template["input_key"] == { @@ -638,6 +679,7 @@ def test_time_travel_guide_chain(client: TestClient): "name": "input_key", "type": "str", "list": False, + "advanced": True, } assert template["template"] == { @@ -650,6 +692,7 @@ def test_time_travel_guide_chain(client: TestClient): "name": "template", "type": "str", "list": False, + "advanced": True, } assert template["ai_prefix_value"] == { "required": False, @@ -660,5 +703,6 @@ def test_time_travel_guide_chain(client: TestClient): "name": "ai_prefix_value", "type": "str", "list": False, + "advanced": True, } assert chain["description"] == "" diff --git a/tests/test_llms_template.py b/tests/test_llms_template.py index 934ec7e05..45b3b032d 100644 --- a/tests/test_llms_template.py +++ b/tests/test_llms_template.py @@ -28,6 +28,7 @@ def test_hugging_face_hub(client: TestClient): "name": "cache", "type": "bool", "list": False, + "advanced": True, } assert template["verbose"] == { "required": False, @@ -39,6 +40,7 @@ def test_hugging_face_hub(client: TestClient): "name": "verbose", "type": "bool", "list": False, + "advanced": True, } assert template["client"] == { "required": False, @@ -49,6 +51,7 @@ def test_hugging_face_hub(client: TestClient): "name": "client", "type": "Any", "list": False, + "advanced": True, } assert template["repo_id"] == { "required": False, @@ -60,6 +63,7 @@ def test_hugging_face_hub(client: TestClient): "name": "repo_id", "type": "str", "list": False, + "advanced": True, } assert template["task"] == { "required": True, @@ -71,6 +75,7 @@ def test_hugging_face_hub(client: TestClient): "name": "task", "type": "str", "list": True, + "advanced": True, } assert template["model_kwargs"] == { "required": False, @@ -81,6 +86,7 @@ def test_hugging_face_hub(client: TestClient): "name": "model_kwargs", "type": "code", "list": False, + "advanced": True, } assert template["huggingfacehub_api_token"] == { "required": False, @@ -92,6 +98,7 @@ def test_hugging_face_hub(client: TestClient): "display_name": "HuggingFace Hub API Token", "type": "str", "list": False, + "advanced": False, } @@ -113,6 +120,7 @@ def test_openai(client: TestClient): "name": "cache", "type": "bool", "list": False, + "advanced": True, } assert template["verbose"] == { "required": False, @@ -123,6 +131,7 @@ def test_openai(client: TestClient): "name": "verbose", "type": "bool", "list": False, + "advanced": True, } assert template["client"] == { "required": False, @@ -133,6 +142,7 @@ def test_openai(client: TestClient): "name": "client", "type": "Any", "list": False, + "advanced": True, } assert template["model_name"] == { "required": False, @@ -151,6 +161,7 @@ def test_openai(client: TestClient): "name": "model_name", "type": "str", "list": True, + "advanced": False, } # Add more assertions for other properties here assert template["temperature"] == { @@ -163,6 +174,7 @@ def test_openai(client: TestClient): "name": "temperature", "type": "float", "list": False, + "advanced": False, } assert template["max_tokens"] == { "required": False, @@ -174,6 +186,7 @@ def test_openai(client: TestClient): "name": "max_tokens", "type": "int", "list": False, + "advanced": True, } assert template["top_p"] == { "required": False, @@ -185,6 +198,7 @@ def test_openai(client: TestClient): "name": "top_p", "type": "float", "list": False, + "advanced": True, } assert template["frequency_penalty"] == { "required": False, @@ -196,6 +210,7 @@ def test_openai(client: TestClient): "name": "frequency_penalty", "type": "float", "list": False, + "advanced": True, } assert template["presence_penalty"] == { "required": False, @@ -207,6 +222,7 @@ def test_openai(client: TestClient): "name": "presence_penalty", "type": "float", "list": False, + "advanced": True, } assert template["n"] == { "required": False, @@ -218,6 +234,7 @@ def test_openai(client: TestClient): "name": "n", "type": "int", "list": False, + "advanced": True, } assert template["best_of"] == { "required": False, @@ -229,6 +246,7 @@ def test_openai(client: TestClient): "name": "best_of", "type": "int", "list": False, + "advanced": True, } assert template["model_kwargs"] == { "required": False, @@ -239,6 +257,7 @@ def test_openai(client: TestClient): "name": "model_kwargs", "type": "code", "list": False, + "advanced": True, } assert template["openai_api_key"] == { "required": False, @@ -251,6 +270,7 @@ def test_openai(client: TestClient): "display_name": "OpenAI API Key", "type": "str", "list": False, + "advanced": False, } assert template["batch_size"] == { "required": False, @@ -262,6 +282,7 @@ def test_openai(client: TestClient): "name": "batch_size", "type": "int", "list": False, + "advanced": True, } assert template["request_timeout"] == { "required": False, @@ -272,6 +293,7 @@ def test_openai(client: TestClient): "name": "request_timeout", "type": "Union[float, Tuple[float, float], NoneType]", "list": False, + "advanced": True, } assert template["logit_bias"] == { "required": False, @@ -282,6 +304,7 @@ def test_openai(client: TestClient): "name": "logit_bias", "type": "code", "list": False, + "advanced": True, } assert template["max_retries"] == { "required": False, @@ -293,6 +316,7 @@ def test_openai(client: TestClient): "name": "max_retries", "type": "int", "list": False, + "advanced": True, } assert template["streaming"] == { "required": False, @@ -304,6 +328,7 @@ def test_openai(client: TestClient): "name": "streaming", "type": "bool", "list": False, + "advanced": True, } @@ -326,6 +351,7 @@ def test_chat_open_ai(client: TestClient): "name": "verbose", "type": "bool", "list": False, + "advanced": True, } assert template["client"] == { "required": False, @@ -336,6 +362,7 @@ def test_chat_open_ai(client: TestClient): "name": "client", "type": "Any", "list": False, + "advanced": True, } assert template["model_name"] == { "required": False, @@ -348,6 +375,7 @@ def test_chat_open_ai(client: TestClient): "name": "model_name", "type": "str", "list": True, + "advanced": False, } assert template["temperature"] == { "required": False, @@ -359,6 +387,7 @@ def test_chat_open_ai(client: TestClient): "name": "temperature", "type": "float", "list": False, + "advanced": False, } assert template["model_kwargs"] == { "required": False, @@ -369,6 +398,7 @@ def test_chat_open_ai(client: TestClient): "name": "model_kwargs", "type": "code", "list": False, + "advanced": True, } assert template["openai_api_key"] == { "required": False, @@ -381,6 +411,7 @@ def test_chat_open_ai(client: TestClient): "display_name": "OpenAI API Key", "type": "str", "list": False, + "advanced": False, } assert template["request_timeout"] == { "required": False, @@ -392,6 +423,7 @@ def test_chat_open_ai(client: TestClient): "name": "request_timeout", "type": "int", "list": False, + "advanced": True, } assert template["max_retries"] == { "required": False, @@ -403,6 +435,7 @@ def test_chat_open_ai(client: TestClient): "name": "max_retries", "type": "int", "list": False, + "advanced": True, } assert template["streaming"] == { "required": False, @@ -414,6 +447,7 @@ def test_chat_open_ai(client: TestClient): "name": "streaming", "type": "bool", "list": False, + "advanced": True, } assert template["n"] == { "required": False, @@ -425,6 +459,7 @@ def test_chat_open_ai(client: TestClient): "name": "n", "type": "int", "list": False, + "advanced": True, } assert template["max_tokens"] == { @@ -436,6 +471,7 @@ def test_chat_open_ai(client: TestClient): "name": "max_tokens", "type": "int", "list": False, + "advanced": True, } assert template["_type"] == "ChatOpenAI" assert ( diff --git a/tests/test_prompts_template.py b/tests/test_prompts_template.py index caa30821c..e5506d4c7 100644 --- a/tests/test_prompts_template.py +++ b/tests/test_prompts_template.py @@ -27,6 +27,7 @@ def test_prompt_template(client: TestClient): "name": "input_variables", "type": "str", "list": True, + "advanced": True, } assert template["output_parser"] == { "required": False, @@ -37,6 +38,7 @@ def test_prompt_template(client: TestClient): "name": "output_parser", "type": "BaseOutputParser", "list": False, + "advanced": True, } assert template["partial_variables"] == { "required": False, @@ -47,6 +49,7 @@ def test_prompt_template(client: TestClient): "name": "partial_variables", "type": "code", "list": False, + "advanced": True, } assert template["template"] == { "required": True, @@ -57,6 +60,7 @@ def test_prompt_template(client: TestClient): "name": "template", "type": "prompt", "list": False, + "advanced": True, } assert template["template_format"] == { "required": False, @@ -68,6 +72,7 @@ def test_prompt_template(client: TestClient): "name": "template_format", "type": "str", "list": False, + "advanced": True, } assert template["validate_template"] == { "required": False, @@ -79,6 +84,7 @@ def test_prompt_template(client: TestClient): "name": "validate_template", "type": "bool", "list": False, + "advanced": True, } @@ -100,6 +106,7 @@ def test_few_shot_prompt_template(client: TestClient): "name": "examples", "type": "prompt", "list": True, + "advanced": True, } assert template["example_selector"] == { "required": False, @@ -110,6 +117,7 @@ def test_few_shot_prompt_template(client: TestClient): "name": "example_selector", "type": "BaseExampleSelector", "list": False, + "advanced": True, } assert template["example_prompt"] == { "required": True, @@ -120,6 +128,7 @@ def test_few_shot_prompt_template(client: TestClient): "name": "example_prompt", "type": "PromptTemplate", "list": False, + "advanced": True, } assert template["suffix"] == { "required": True, @@ -130,6 +139,7 @@ def test_few_shot_prompt_template(client: TestClient): "name": "suffix", "type": "prompt", "list": False, + "advanced": True, } assert template["example_separator"] == { "required": False, @@ -141,6 +151,7 @@ def test_few_shot_prompt_template(client: TestClient): "name": "example_separator", "type": "str", "list": False, + "advanced": True, } assert template["prefix"] == { "required": False, @@ -152,6 +163,7 @@ def test_few_shot_prompt_template(client: TestClient): "name": "prefix", "type": "prompt", "list": False, + "advanced": True, } @@ -172,6 +184,7 @@ def test_zero_shot_prompt(client: TestClient): "name": "prefix", "type": "str", "list": False, + "advanced": True, } assert template["suffix"] == { "required": True, @@ -183,6 +196,7 @@ def test_zero_shot_prompt(client: TestClient): "name": "suffix", "type": "str", "list": False, + "advanced": True, } assert template["format_instructions"] == { "required": False, @@ -194,4 +208,5 @@ def test_zero_shot_prompt(client: TestClient): "name": "format_instructions", "type": "str", "list": False, + "advanced": True, } From 11b82aa5565a168acf746b7546ff4c6396750990 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 28 Apr 2023 19:41:17 -0300 Subject: [PATCH 128/150] hide advanced icon if all the fields aren't advanced --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index fabc68486..880d1e7ac 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -12,7 +12,6 @@ import { NodeDataType } from "../../types/flow"; import { alertContext } from "../../contexts/alertContext"; import { PopUpContext } from "../../contexts/popUpContext"; import NodeModal from "../../modals/NodeModal"; -import { relative } from "path"; export default function GenericNode({ data, @@ -74,7 +73,11 @@ export default function GenericNode({
data.node.template[t].advanced===true + ) + ? "" + : "hidden", "w-6 h-6 dark:text-gray-500 hover:animate-spin" )} > From 733f62defb12cd437f4bde3013d78eed0ad7ddb8 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 28 Apr 2023 19:44:15 -0300 Subject: [PATCH 129/150] remove error on console --- src/frontend/src/modals/NodeModal/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx index c052c71a7..31786553b 100644 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -93,6 +93,7 @@ export default function NodeModal({ data }: { data: NodeDataType }) { .map((t: string, idx) => { return ( Date: Fri, 28 Apr 2023 19:46:53 -0300 Subject: [PATCH 130/150] hide advanced icon if all the fields aren't advancedand show true --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 880d1e7ac..d0f3947b7 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -74,7 +74,7 @@ export default function GenericNode({ data.node.template[t].advanced===true + (t) => data.node.template[t].advanced && data.node.template[t].show ) ? "" : "hidden", From 8943de257569255cf2ea5222319d7355219943f8 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 28 Apr 2023 19:59:52 -0300 Subject: [PATCH 131/150] check advanced on node too --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index f362ca8ff..41d9e0ed8 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -76,7 +76,7 @@ export default function GenericNode({ "px-5 py-2 mt-2 dark:text-white text-center", Object.keys(data.node.template).filter( (key) => - !key.startsWith("_") && data.node.template[key].show + !key.startsWith("_") && data.node.template[key].show && !data.node.template[key].advanced ).length === 0 ? "hidden" : "" From ccd8a3fe093a76307f202bd51f25118f3c466beb Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 28 Apr 2023 20:02:37 -0300 Subject: [PATCH 132/150] check advanced on node too --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index d0f3947b7..bfaa2ba24 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -119,7 +119,7 @@ export default function GenericNode({ ) : ( <> )} */} - {data.node.template[t].show ? ( + {data.node.template[t].show && !data.node.template[t].advanced ? ( Date: Fri, 28 Apr 2023 20:07:59 -0300 Subject: [PATCH 133/150] refactor(nodes.py): set advanced field to False for fields other than prompt in ChainFrontendNode class --- src/backend/langflow/template/nodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/template/nodes.py b/src/backend/langflow/template/nodes.py index c96740840..d68581991 100644 --- a/src/backend/langflow/template/nodes.py +++ b/src/backend/langflow/template/nodes.py @@ -425,10 +425,12 @@ class ChainFrontendNode(FrontendNode): field.required = True field.show = True # Separated for possible future changes - if field.name == "prompt": + elif field.name == "prompt": # if no prompt is provided, use the default prompt field.required = False field.show = True + else: + field.advanced = False class LLMFrontendNode(FrontendNode): From c3dffa3508f517cb11cacf391d48002545b5a323 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 20:31:53 -0300 Subject: [PATCH 134/150] feat(chat_manager.py): add empty_history method to ChatHistory class fix(chat_manager.py): empty chat history for a client when an exception is raised fix(GenericNode): fix useEffect dependencies to avoid unnecessary re-renders --- src/backend/langflow/api/chat_manager.py | 5 +++++ .../src/CustomNodes/GenericNode/index.tsx | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/backend/langflow/api/chat_manager.py b/src/backend/langflow/api/chat_manager.py index dccd0381b..5c490c43c 100644 --- a/src/backend/langflow/api/chat_manager.py +++ b/src/backend/langflow/api/chat_manager.py @@ -36,6 +36,10 @@ class ChatHistory(Subject): else: return [] + def empty_history(self, client_id: str): + """Empty the chat history for a client.""" + self.history[client_id] = [] + class ChatManager: def __init__(self): @@ -119,6 +123,7 @@ class ChatManager: except Exception as e: # Log stack trace logger.exception(e) + self.chat_history.empty_history(client_id) raise e # Send a response back to the frontend, if needed intermediate_steps = intermediate_steps or "" diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index ec864f8d7..b6d9b78ee 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -29,6 +29,13 @@ export default function GenericNode({ const [isGreenOutline, setIsGreenOutline] = useState(false); const [isRedOutline, setIsRedOutline] = useState(false); const { reactFlowInstance } = useContext(typesContext); + const [params, setParams] = useState([]); + + useEffect(() => { + if (reactFlowInstance) { + setParams(Object.values(reactFlowInstance.toObject())); + } + }, [reactFlowInstance]); const debouncedValidateNode = useDebouncedCallback(async () => { // Check if the validationStatus is "success" @@ -60,14 +67,7 @@ export default function GenericNode({ useEffect(() => { validateNode(); - }, [ - validateNode, - // Use the result of ...reactFlowInstance.toObject() - // to determine if the node has changed - // turn into an array of nodes and edges - // and compare the length of the array - ...Object.values(reactFlowInstance.toObject()), - ]); + }, [validateNode, params]); useEffect(() => { if (validationStatus === "success") { From f97586813c7358c4eecf79b363cede34ac879269 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 28 Apr 2023 23:03:13 -0300 Subject: [PATCH 135/150] fixed validation --- src/frontend/package.json | 2 +- .../src/CustomNodes/GenericNode/index.tsx | 351 ++++++++---------- 2 files changed, 166 insertions(+), 187 deletions(-) diff --git a/src/frontend/package.json b/src/frontend/package.json index 69eb7b47f..0a33f0fd8 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -62,5 +62,5 @@ "last 1 safari version" ] }, - "proxy": "http://backend:7860" + "proxy": "http://127.0.0.1:7860" } \ No newline at end of file diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index b6d9b78ee..39dae0ed8 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -1,10 +1,10 @@ import { TrashIcon } from "@heroicons/react/24/outline"; import { useDebouncedCallback } from "use-debounce"; import { - classNames, - nodeColors, - nodeIcons, - snakeToNormalCase, + classNames, + nodeColors, + nodeIcons, + snakeToNormalCase, } from "../../utils"; import ParameterComponent from "./components/parameterComponent"; import { typesContext } from "../../contexts/typesContext"; @@ -12,198 +12,177 @@ import { useContext, useState, useEffect, useRef } from "react"; import { NodeDataType } from "../../types/flow"; import { alertContext } from "../../contexts/alertContext"; import { useCallback } from "react"; - +import { TabsContext } from "../../contexts/tabsContext"; export default function GenericNode({ - data, - selected, + data, + selected, }: { - data: NodeDataType; - selected: boolean; + data: NodeDataType; + selected: boolean; }) { - const { setErrorData } = useContext(alertContext); - const showError = useRef(true); - const { types, deleteNode } = useContext(typesContext); - const Icon = nodeIcons[types[data.type]]; - const [validationStatus, setValidationStatus] = useState("idle"); - // State for outline color - const [isGreenOutline, setIsGreenOutline] = useState(false); - const [isRedOutline, setIsRedOutline] = useState(false); - const { reactFlowInstance } = useContext(typesContext); - const [params, setParams] = useState([]); + const { setErrorData } = useContext(alertContext); + const showError = useRef(true); + const { types, deleteNode } = useContext(typesContext); + const Icon = nodeIcons[types[data.type]]; + const [validationStatus, setValidationStatus] = useState("idle"); + // State for outline color + const [isValid, setIsValid] = useState(false); + const {save} = useContext(TabsContext) + const { reactFlowInstance } = useContext(typesContext); + const [params, setParams] = useState([]); - useEffect(() => { - if (reactFlowInstance) { - setParams(Object.values(reactFlowInstance.toObject())); - } - }, [reactFlowInstance]); + console.log(); - const debouncedValidateNode = useDebouncedCallback(async () => { - // Check if the validationStatus is "success" - // if (validationStatus === "success") return; + useEffect(() => { + if (reactFlowInstance) { + setParams(Object.values(reactFlowInstance.toObject())); + } + }, [save]); - try { - const response = await fetch(`/validate/node/${data.id}`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(reactFlowInstance.toObject()), - }); + useEffect(() => { + try { + fetch(`/validate/node/${data.id}`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(reactFlowInstance.toObject()), + }).then((response) => { + console.log(response.status, response.body); - if (response.status === 200) { - setValidationStatus("success"); - } else if (response.status === 500) { - setValidationStatus("error"); - } - } catch (error) { - console.error("Error validating node:", error); - setValidationStatus("error"); - } - }, 1000); + if (response.status === 200) { + setValidationStatus("success"); + } else if (response.status === 500) { + setValidationStatus("error"); + } + }); + } catch (error) { + console.error("Error validating node:", error); + setValidationStatus("error"); + } + }, [params]); - const validateNode = useCallback(() => { - debouncedValidateNode(); - }, [debouncedValidateNode]); + useEffect(() => { + if (validationStatus === "success") { + setIsValid(true); + } else { + setIsValid(false); + } + }, [validationStatus]); - useEffect(() => { - validateNode(); - }, [validateNode, params]); + if (!Icon) { + if (showError.current) { + setErrorData({ + title: data.type + ? `The ${data.type} node could not be rendered, please review your json file` + : "There was a node that can't be rendered, please review your json file", + }); + showError.current = false; + } + deleteNode(data.id); + return; + } - useEffect(() => { - if (validationStatus === "success") { - setIsGreenOutline(true); - setIsRedOutline(false); - setTimeout(() => { - setIsGreenOutline(false); - }, 1000); - } else if (validationStatus === "error") { - setIsRedOutline(true); - setIsGreenOutline(false); - } else { - setIsGreenOutline(false); - setIsRedOutline(false); - } - }, [validationStatus]); + return ( +
+
+
+ +
{data.type}
+
+ +
- const outlineColor = isGreenOutline - ? "animate-pulse-green" - : isRedOutline - ? "border-red-outline" - : ""; +
+
+ {data.node.description} +
- if (!Icon) { - if (showError.current) { - setErrorData({ - title: data.type - ? `The ${data.type} node could not be rendered, please review your json file` - : "There was a node that can't be rendered, please review your json file", - }); - showError.current = false; - } - deleteNode(data.id); - return; - } - - return ( -
-
-
- -
{data.type}
-
- -
- -
-
- {data.node.description} -
- - <> - {Object.keys(data.node.template) - .filter((t) => t.charAt(0) !== "_") - .map((t: string, idx) => ( -
- {idx === 0 ? ( -
- !key.startsWith("_") && - data.node.template[key].show && - !data.node.template[key].advanced - ).length === 0 - ? "hidden" - : "" - )} - > - Inputs -
- ) : ( - <> - )} - {data.node.template[t].show ? ( - - ) : ( - <> - )} -
- ))} -
- Output -
- - -
-
- ); + <> + {Object.keys(data.node.template) + .filter((t) => t.charAt(0) !== "_") + .map((t: string, idx) => ( +
+ {idx === 0 ? ( +
+ !key.startsWith("_") && + data.node.template[key].show && + !data.node.template[key].advanced + ).length === 0 + ? "hidden" + : "" + )} + > + Inputs +
+ ) : ( + <> + )} + {data.node.template[t].show ? ( + + ) : ( + <> + )} +
+ ))} +
+ Output +
+ + +
+
+ ); } From d4d8418c13e9db9945e3b7ed7d116cc6970c042d Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 28 Apr 2023 23:10:46 -0300 Subject: [PATCH 136/150] dark mode fixed on chat --- src/frontend/src/modals/chatModal/chatMessage/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/modals/chatModal/chatMessage/index.tsx b/src/frontend/src/modals/chatModal/chatMessage/index.tsx index bbab8e686..85f569829 100644 --- a/src/frontend/src/modals/chatModal/chatMessage/index.tsx +++ b/src/frontend/src/modals/chatModal/chatMessage/index.tsx @@ -14,7 +14,7 @@ export default function ChatMessage({ chat }: { chat: ChatMessageType }) {

}
- + {chat.message} {chat.files && (
@@ -72,7 +72,7 @@ export default function ChatMessage({ chat }: { chat: ChatMessageType }) {
) : (
-
+
{chat.message}
From 659491f9a24919dc2d6310a110a1529f55064d97 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 23:30:12 -0300 Subject: [PATCH 137/150] feat(langflow): add function support to build_template_from_class function feat(langflow): add function base class to InitializeAgentNode The `build_template_from_class` function in `ChainCreator` now supports adding a function to the chain. This is done by passing `add_function=True` to the function. In `InitializeAgentNode`, the `base_classes` attribute has been updated to include the `function` base class. This allows the node to be used as a function in the chain. --- src/backend/langflow/interface/chains/base.py | 4 +++- src/backend/langflow/template/nodes.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/interface/chains/base.py b/src/backend/langflow/interface/chains/base.py index 9dc8ded3f..7b8da370b 100644 --- a/src/backend/langflow/interface/chains/base.py +++ b/src/backend/langflow/interface/chains/base.py @@ -37,7 +37,9 @@ class ChainCreator(LangChainTypeCreator): try: if name in get_custom_nodes(self.type_name).keys(): return get_custom_nodes(self.type_name)[name] - return build_template_from_class(name, self.type_to_loader_dict) + return build_template_from_class( + name, self.type_to_loader_dict, add_function=True + ) except ValueError as exc: raise ValueError("Chain not found") from exc except AttributeError as exc: diff --git a/src/backend/langflow/template/nodes.py b/src/backend/langflow/template/nodes.py index f0f2112a6..32dbec48a 100644 --- a/src/backend/langflow/template/nodes.py +++ b/src/backend/langflow/template/nodes.py @@ -216,7 +216,7 @@ class InitializeAgentNode(FrontendNode): ], ) description: str = """Construct a json agent from an LLM and tools.""" - base_classes: list[str] = ["AgentExecutor"] + base_classes: list[str] = ["AgentExecutor", "function"] def to_dict(self): return super().to_dict() From 5aa71e83fba32bafc479517ebe71401d97468232 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 23:33:49 -0300 Subject: [PATCH 138/150] chore(frontend): update backend proxy to use container name instead of IP address --- src/frontend/package-lock.json | 12 ------------ src/frontend/package.json | 3 +-- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index e24e28bd9..9b90b435e 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -40,7 +40,6 @@ "reactflow": "^11.5.5", "tailwindcss": "^3.2.6", "typescript": "^4.9.5", - "use-debounce": "^9.0.4", "web-vitals": "^2.1.4" } }, @@ -17045,17 +17044,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/use-debounce": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/use-debounce/-/use-debounce-9.0.4.tgz", - "integrity": "sha512-6X8H/mikbrt0XE8e+JXRtZ8yYVvKkdYRfmIhWZYsP8rcNs9hk3APV8Ua2mFkKRLcJKVdnX2/Vwrmg2GWKUQEaQ==", - "engines": { - "node": ">= 10.0.0" - }, - "peerDependencies": { - "react": ">=16.8.0" - } - }, "node_modules/use-sync-external-store": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", diff --git a/src/frontend/package.json b/src/frontend/package.json index 0a33f0fd8..55d777687 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -35,7 +35,6 @@ "reactflow": "^11.5.5", "tailwindcss": "^3.2.6", "typescript": "^4.9.5", - "use-debounce": "^9.0.4", "web-vitals": "^2.1.4" }, "scripts": { @@ -62,5 +61,5 @@ "last 1 safari version" ] }, - "proxy": "http://127.0.0.1:7860" + "proxy": "http://backend:7860" } \ No newline at end of file From 1c35179aec49922b05f15761386115a98e08a9b1 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Fri, 28 Apr 2023 23:38:36 -0300 Subject: [PATCH 139/150] refactor(nodes.py): remove unnecessary else statement in ChainFrontendNode class --- src/backend/langflow/template/nodes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/backend/langflow/template/nodes.py b/src/backend/langflow/template/nodes.py index d68581991..c96740840 100644 --- a/src/backend/langflow/template/nodes.py +++ b/src/backend/langflow/template/nodes.py @@ -425,12 +425,10 @@ class ChainFrontendNode(FrontendNode): field.required = True field.show = True # Separated for possible future changes - elif field.name == "prompt": + if field.name == "prompt": # if no prompt is provided, use the default prompt field.required = False field.show = True - else: - field.advanced = False class LLMFrontendNode(FrontendNode): From cccf99278690bca5e46a1121a9133225b7315c16 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 28 Apr 2023 23:41:49 -0300 Subject: [PATCH 140/150] update thought icon for dark mode --- src/frontend/src/modals/chatModal/chatMessage/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/modals/chatModal/chatMessage/index.tsx b/src/frontend/src/modals/chatModal/chatMessage/index.tsx index 85f569829..70f224f88 100644 --- a/src/frontend/src/modals/chatModal/chatMessage/index.tsx +++ b/src/frontend/src/modals/chatModal/chatMessage/index.tsx @@ -34,7 +34,7 @@ export default function ChatMessage({ chat }: { chat: ChatMessageType }) { onClick={() => setHidden((prev) => !prev)} className="absolute -top-1 -left-2 cursor-pointer" > - +
)} {chat.thought && chat.thought !== "" && !hidden && ( From 93b5a8e3275c6848871ea73d831b5cb739e82f17 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 28 Apr 2023 23:53:37 -0300 Subject: [PATCH 141/150] sorted side bar --- .../pages/FlowPage/components/extraSidebarComponent/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx index 0eb3876f1..17feb6723 100644 --- a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx @@ -51,7 +51,7 @@ export default function ExtraSidebar() { return (
- {Object.keys(data).map((d: keyof APIObjectType, i) => ( + {Object.keys(data).sort().map((d: keyof APIObjectType, i) => (
- {Object.keys(data[d]).map((t: string, k) => ( + {Object.keys(data[d]).sort().map((t: string, k) => (
Date: Sat, 29 Apr 2023 00:36:06 -0300 Subject: [PATCH 142/150] fix: tests --- src/backend/langflow/custom/customs.py | 5 + src/backend/langflow/template/nodes.py | 113 +++++++++ tests/test_chains_template.py | 315 ++----------------------- 3 files changed, 138 insertions(+), 295 deletions(-) diff --git a/src/backend/langflow/custom/customs.py b/src/backend/langflow/custom/customs.py index d45221be7..2b2ccc43f 100644 --- a/src/backend/langflow/custom/customs.py +++ b/src/backend/langflow/custom/customs.py @@ -15,6 +15,11 @@ CUSTOM_NODES = { "utilities": { "SQLDatabase": nodes.SQLDatabaseNode(), }, + "chains": { + "SeriesCharacterChain": nodes.SeriesCharacterChainNode(), + "TimeTravelGuideChain": nodes.TimeTravelGuideChainNode(), + "MidJourneyPromptChain": nodes.MidJourneyPromptChainNode(), + }, } diff --git a/src/backend/langflow/template/nodes.py b/src/backend/langflow/template/nodes.py index c96740840..9e33e2a79 100644 --- a/src/backend/langflow/template/nodes.py +++ b/src/backend/langflow/template/nodes.py @@ -101,6 +101,107 @@ class PythonFunctionNode(FrontendNode): return super().to_dict() +class MidJourneyPromptChainNode(FrontendNode): + name: str = "MidJourneyPromptChain" + template: Template = Template( + type_name="MidJourneyPromptChain", + fields=[ + TemplateField( + field_type="BaseLanguageModel", + required=True, + placeholder="", + is_list=False, + show=True, + advanced=False, + multiline=False, + name="llm", + ), + ], + ) + description: str = "MidJourneyPromptChain is a chain you can use to generate new MidJourney prompts." + base_classes: list[str] = [ + "LLMChain", + "BaseCustomChain", + "Chain", + "ConversationChain", + "MidJourneyPromptChain", + ] + + +class TimeTravelGuideChainNode(FrontendNode): + name: str = "TimeTravelGuideChain" + template: Template = Template( + type_name="TimeTravelGuideChain", + fields=[ + TemplateField( + field_type="BaseLanguageModel", + required=True, + placeholder="", + is_list=False, + show=True, + advanced=False, + multiline=False, + name="llm", + ), + ], + ) + description: str = "Time travel guide chain to be used in the flow." + base_classes: list[str] = [ + "LLMChain", + "BaseCustomChain", + "TimeTravelGuideChain", + "Chain", + "ConversationChain", + ] + + +class SeriesCharacterChainNode(FrontendNode): + name: str = "SeriesCharacterChain" + template: Template = Template( + type_name="SeriesCharacterChain", + fields=[ + TemplateField( + field_type="str", + required=True, + placeholder="", + is_list=False, + show=True, + advanced=False, + multiline=False, + name="character", + ), + TemplateField( + field_type="str", + required=True, + placeholder="", + is_list=False, + show=True, + advanced=False, + multiline=False, + name="series", + ), + TemplateField( + field_type="BaseLanguageModel", + required=True, + placeholder="", + is_list=False, + show=True, + advanced=False, + multiline=False, + name="llm", + ), + ], + ) + description: str = "SeriesCharacterChain is a chain you can use to have a conversation with a character from a series." # noqa + base_classes: list[str] = [ + "LLMChain", + "BaseCustomChain", + "Chain", + "ConversationChain", + "SeriesCharacterChain", + ] + + class ToolNode(FrontendNode): name: str = "Tool" template: Template = Template( @@ -418,17 +519,29 @@ class ChainFrontendNode(FrontendNode): def format_field(field: TemplateField, name: Optional[str] = None) -> None: FrontendNode.format_field(field, name) + field.advanced = False if "key" in field.name: field.password = False field.show = False if field.name in ["input_key", "output_key"]: field.required = True field.show = True + field.advanced = True + # Separated for possible future changes if field.name == "prompt": # if no prompt is provided, use the default prompt field.required = False field.show = True + field.advanced = False + if field.name == "memory": + field.required = False + field.show = True + field.advanced = False + if field.name == "verbose": + field.required = False + field.show = True + field.advanced = True class LLMFrontendNode(FrontendNode): diff --git a/tests/test_chains_template.py b/tests/test_chains_template.py index 76ab2ca13..cff844c90 100644 --- a/tests/test_chains_template.py +++ b/tests/test_chains_template.py @@ -31,12 +31,12 @@ def test_conversation_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, - "advanced": True, + "advanced": False, } assert template["verbose"] == { "required": False, "placeholder": "", - "show": False, + "show": True, "multiline": False, "password": False, "name": "verbose", @@ -53,7 +53,7 @@ def test_conversation_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, - "advanced": True, + "advanced": False, } assert template["input_key"] == { "required": True, @@ -107,12 +107,12 @@ def test_llm_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, - "advanced": True, + "advanced": False, } assert template["verbose"] == { "required": False, "placeholder": "", - "show": False, + "show": True, "multiline": False, "value": False, "password": False, @@ -130,7 +130,7 @@ def test_llm_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, - "advanced": True, + "advanced": False, } assert template["output_key"] == { "required": True, @@ -165,12 +165,12 @@ def test_llm_checker_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, - "advanced": True, + "advanced": False, } assert template["verbose"] == { "required": False, "placeholder": "", - "show": False, + "show": True, "multiline": False, "value": False, "password": False, @@ -188,7 +188,7 @@ def test_llm_checker_chain(client: TestClient): "name": "llm", "type": "BaseLLM", "list": False, - "advanced": True, + "advanced": False, } assert template["input_key"] == { "required": True, @@ -242,12 +242,12 @@ def test_llm_math_chain(client: TestClient): "name": "memory", "type": "BaseMemory", "list": False, - "advanced": True, + "advanced": False, } assert template["verbose"] == { "required": False, "placeholder": "", - "show": False, + "show": True, "multiline": False, "value": False, "password": False, @@ -265,7 +265,7 @@ def test_llm_math_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, - "advanced": True, + "advanced": False, } assert template["input_key"] == { "required": True, @@ -317,37 +317,7 @@ def test_series_character_chain(client: TestClient): "SeriesCharacterChain", } template = chain["template"] - assert template["memory"] == { - "required": False, - "placeholder": "", - "show": True, - "multiline": False, - "value": { - "chat_memory": {"messages": []}, - "output_key": None, - "input_key": None, - "return_messages": False, - "human_prefix": "Human", - "ai_prefix": "AI", - "memory_key": "history", - }, - "password": False, - "name": "memory", - "type": "BaseMemory", - "list": False, - "advanced": True, - } - assert template["verbose"] == { - "required": False, - "placeholder": "", - "show": False, - "multiline": False, - "password": False, - "name": "verbose", - "type": "bool", - "list": False, - "advanced": True, - } + assert template["llm"] == { "required": True, "placeholder": "", @@ -357,55 +327,7 @@ def test_series_character_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, - "advanced": True, - } - assert template["input_key"] == { - "required": True, - "placeholder": "", - "show": True, - "multiline": False, - "value": "input", - "password": False, - "name": "input_key", - "type": "str", - "list": False, - "advanced": True, - } - assert template["output_key"] == { - "required": True, - "placeholder": "", - "show": True, - "multiline": False, - "value": "response", - "password": False, - "name": "output_key", - "type": "str", - "list": False, - "advanced": True, - } - assert template["template"] == { - "required": False, - "placeholder": "", - "show": False, - "multiline": True, - "value": "I want you to act like {character} from {series}.\nI want you to respond and answer like {character}. do not write any explanations. only answer like {character}.\nYou must know all of the knowledge of {character}.\nCurrent conversation:\n{history}\nHuman: {input}\n{character}:", # noqa: E501 - "password": False, - "name": "template", - "type": "str", - "list": False, - "advanced": True, - } - assert template["ai_prefix_value"] == { - "required": False, - "placeholder": "", - "show": False, - "multiline": False, - "value": "character", - "password": False, - "name": "ai_prefix_value", - "type": "str", - "list": False, - "advanced": True, + "advanced": False, } assert template["character"] == { "required": True, @@ -416,7 +338,7 @@ def test_series_character_chain(client: TestClient): "name": "character", "type": "str", "list": False, - "advanced": True, + "advanced": False, } assert template["series"] == { "required": True, @@ -427,7 +349,7 @@ def test_series_character_chain(client: TestClient): "name": "series", "type": "str", "list": False, - "advanced": True, + "advanced": False, } assert template["_type"] == "SeriesCharacterChain" @@ -457,58 +379,7 @@ def test_mid_journey_prompt_chain(client: TestClient): # Test the template object template = chain["template"] - assert template["memory"] == { - "required": False, - "placeholder": "", - "show": True, - "multiline": False, - "value": { - "chat_memory": {"messages": []}, - "output_key": None, - "input_key": None, - "return_messages": False, - "human_prefix": "Human", - "ai_prefix": "AI", - "memory_key": "history", - }, - "password": False, - "name": "memory", - "type": "BaseMemory", - "list": False, - "advanced": True, - } - assert template["verbose"] == { - "required": False, - "placeholder": "", - "show": False, - "multiline": False, - "password": False, - "name": "verbose", - "type": "bool", - "list": False, - "advanced": True, - } - # Continue with other template object assertions - assert template["prompt"] == { - "required": False, - "placeholder": "", - "show": True, - "multiline": False, - "value": { - "input_variables": ["history", "input"], - "output_parser": None, - "partial_variables": {}, - "template": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n{history}\nHuman: {input}\nAI:", # noqa: E501 - "template_format": "f-string", - "validate_template": True, - "_type": "prompt", - }, - "password": False, - "name": "prompt", - "type": "BasePromptTemplate", - "list": False, - "advanced": True, - } + assert template["llm"] == { "required": True, "placeholder": "", @@ -518,54 +389,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, - "advanced": True, - } - assert template["output_key"] == { - "required": True, - "placeholder": "", - "show": True, - "multiline": False, - "value": "response", - "password": False, - "name": "output_key", - "type": "str", - "list": False, - "advanced": True, - } - assert template["input_key"] == { - "required": True, - "placeholder": "", - "show": True, - "multiline": False, - "value": "input", - "password": False, - "name": "input_key", - "type": "str", - "list": False, - "advanced": True, - } - assert template["template"] == { - "required": False, - "placeholder": "", - "show": False, - "multiline": True, - "value": 'I want you to act as a prompt generator for Midjourney\'s artificial intelligence program.\n Your job is to provide detailed and creative descriptions that will inspire unique and interesting images from the AI.\n Keep in mind that the AI is capable of understanding a wide range of language and can interpret abstract concepts, so feel free to be as imaginative and descriptive as possible.\n For example, you could describe a scene from a futuristic city, or a surreal landscape filled with strange creatures.\n The more detailed and imaginative your description, the more interesting the resulting image will be. Here is your first prompt:\n "A field of wildflowers stretches out as far as the eye can see, each one a different color and shape. In the distance, a massive tree towers over the landscape, its branches reaching up to the sky like tentacles."\n\n Current conversation:\n {history}\n Human: {input}\n AI:', # noqa: E501 - "password": False, - "name": "template", - "type": "str", - "list": False, - "advanced": True, - } - assert template["ai_prefix_value"] == { - "required": False, - "placeholder": "", - "show": False, - "multiline": False, - "password": False, - "name": "ai_prefix_value", - "type": "str", - "list": False, - "advanced": True, + "advanced": False, } # Test the description object assert ( @@ -593,58 +417,7 @@ def test_time_travel_guide_chain(client: TestClient): # Test the template object template = chain["template"] - assert template["memory"] == { - "required": False, - "placeholder": "", - "show": True, - "multiline": False, - "value": { - "chat_memory": {"messages": []}, - "output_key": None, - "input_key": None, - "return_messages": False, - "human_prefix": "Human", - "ai_prefix": "AI", - "memory_key": "history", - }, - "password": False, - "name": "memory", - "type": "BaseMemory", - "list": False, - "advanced": True, - } - assert template["verbose"] == { - "required": False, - "placeholder": "", - "show": False, - "multiline": False, - "password": False, - "name": "verbose", - "type": "bool", - "list": False, - "advanced": True, - } - assert template["prompt"] == { - "required": False, - "placeholder": "", - "show": True, - "multiline": False, - "value": { - "input_variables": ["history", "input"], - "output_parser": None, - "partial_variables": {}, - "template": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n{history}\nHuman: {input}\nAI:", # noqa: E501 - "template_format": "f-string", - "validate_template": True, - "_type": "prompt", - }, - "password": False, - "name": "prompt", - "type": "BasePromptTemplate", - "list": False, - "advanced": True, - } assert template["llm"] == { "required": True, "placeholder": "", @@ -654,55 +427,7 @@ def test_time_travel_guide_chain(client: TestClient): "name": "llm", "type": "BaseLanguageModel", "list": False, - "advanced": True, - } - assert template["output_key"] == { - "required": True, - "placeholder": "", - "show": True, - "multiline": False, - "value": "response", - "password": False, - "name": "output_key", - "type": "str", - "list": False, - "advanced": True, + "advanced": False, } - assert template["input_key"] == { - "required": True, - "placeholder": "", - "show": True, - "multiline": False, - "value": "input", - "password": False, - "name": "input_key", - "type": "str", - "list": False, - "advanced": True, - } - - assert template["template"] == { - "required": False, - "placeholder": "", - "show": False, - "multiline": True, - "value": "I want you to act as my time travel guide. You are helpful and creative. I will provide you with the historical period or future time I want to visit and you will suggest the best events, sights, or people to experience. Provide the suggestions and any necessary information.\n Current conversation:\n {history}\n Human: {input}\n AI:", # noqa: E501 - "password": False, - "name": "template", - "type": "str", - "list": False, - "advanced": True, - } - assert template["ai_prefix_value"] == { - "required": False, - "placeholder": "", - "show": False, - "multiline": False, - "password": False, - "name": "ai_prefix_value", - "type": "str", - "list": False, - "advanced": True, - } - assert chain["description"] == "" + assert chain["description"] == "Time travel guide chain to be used in the flow." From e87749d966adf65e64bc4f154d3bf54d0c8a4574 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Sat, 29 Apr 2023 01:29:15 -0300 Subject: [PATCH 143/150] updade package.json and removed debounce --- src/frontend/package.json | 2 +- src/frontend/src/CustomNodes/GenericNode/index.tsx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/frontend/package.json b/src/frontend/package.json index 55d777687..388f8c9f7 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -61,5 +61,5 @@ "last 1 safari version" ] }, - "proxy": "http://backend:7860" + "proxy": "http://127.0.0.1:7860" } \ No newline at end of file diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 61be1b9ba..fb9771be8 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -1,5 +1,4 @@ import { Cog6ToothIcon, TrashIcon } from "@heroicons/react/24/outline"; -import { useDebouncedCallback } from "use-debounce"; import { classNames, nodeColors, From 3ed0c35bdbf8352632cde4bcfd90bab649db45ee Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Sat, 29 Apr 2023 07:32:01 -0300 Subject: [PATCH 144/150] fix: added deps for linting --- poetry.lock | 56 ++++++++++++++++++++++++++++++++++++-------------- pyproject.toml | 2 ++ 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/poetry.lock b/poetry.lock index ee989ea7f..2b1ed2cc5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. [[package]] name = "aiohttp" @@ -2698,6 +2698,21 @@ pytz = ">=2020.1" [package.extras] test = ["hypothesis (>=5.5.3)", "pytest (>=6.0)", "pytest-xdist (>=1.31)"] +[[package]] +name = "pandas-stubs" +version = "2.0.0.230412" +description = "Type annotations for pandas" +category = "dev" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pandas_stubs-2.0.0.230412-py3-none-any.whl", hash = "sha256:311ab8b42ee574d9fea5061d1f63aeca297e472de6073ba84bf2a017c6cb1b6b"}, + {file = "pandas_stubs-2.0.0.230412.tar.gz", hash = "sha256:016f567cb9947edd0067ea2665ab00b77fa47e73a65ce1a097de4f499b3485c0"}, +] + +[package.dependencies] +types-pytz = ">=2022.1.1" + [[package]] name = "parso" version = "0.8.3" @@ -4169,10 +4184,6 @@ category = "main" optional = false python-versions = ">=3.8.0" files = [ - {file = "torch-2.0.0-1-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:c9090bda7d2eeeecd74f51b721420dbeb44f838d4536cc1b284e879417e3064a"}, - {file = "torch-2.0.0-1-cp311-cp311-manylinux2014_aarch64.whl", hash = "sha256:bd42db2a48a20574d2c33489e120e9f32789c4dc13c514b0c44272972d14a2d7"}, - {file = "torch-2.0.0-1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:8969aa8375bcbc0c2993e7ede0a7f889df9515f18b9b548433f412affed478d9"}, - {file = "torch-2.0.0-1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:ab2da16567cb55b67ae39e32d520d68ec736191d88ac79526ca5874754c32203"}, {file = "torch-2.0.0-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:7a9319a67294ef02459a19738bbfa8727bb5307b822dadd708bc2ccf6c901aca"}, {file = "torch-2.0.0-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:9f01fe1f6263f31bd04e1757946fd63ad531ae37f28bb2dbf66f5c826ee089f4"}, {file = "torch-2.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:527f4ae68df7b8301ee6b1158ca56350282ea633686537b30dbb5d7b4a52622a"}, @@ -4390,15 +4401,6 @@ category = "main" optional = false python-versions = "*" files = [ - {file = "triton-2.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:38806ee9663f4b0f7cd64790e96c579374089e58f49aac4a6608121aa55e2505"}, - {file = "triton-2.0.0-1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:226941c7b8595219ddef59a1fdb821e8c744289a132415ddd584facedeb475b1"}, - {file = "triton-2.0.0-1-cp36-cp36m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4c9fc8c89874bc48eb7e7b2107a9b8d2c0bf139778637be5bfccb09191685cfd"}, - {file = "triton-2.0.0-1-cp37-cp37m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d2684b6a60b9f174f447f36f933e9a45f31db96cb723723ecd2dcfd1c57b778b"}, - {file = "triton-2.0.0-1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9d4978298b74fcf59a75fe71e535c092b023088933b2f1df933ec32615e4beef"}, - {file = "triton-2.0.0-1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:74f118c12b437fb2ca25e1a04759173b517582fcf4c7be11913316c764213656"}, - {file = "triton-2.0.0-1-pp37-pypy37_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9618815a8da1d9157514f08f855d9e9ff92e329cd81c0305003eb9ec25cc5add"}, - {file = "triton-2.0.0-1-pp38-pypy38_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1aca3303629cd3136375b82cb9921727f804e47ebee27b2677fef23005c3851a"}, - {file = "triton-2.0.0-1-pp39-pypy39_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e3e13aa8b527c9b642e3a9defcc0fbd8ffbe1c80d8ac8c15a01692478dc64d8a"}, {file = "triton-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f05a7e64e4ca0565535e3d5d3405d7e49f9d308505bb7773d21fb26a4c008c2"}, {file = "triton-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb4b99ca3c6844066e516658541d876c28a5f6e3a852286bbc97ad57134827fd"}, {file = "triton-2.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47b4d70dc92fb40af553b4460492c31dc7d3a114a979ffb7a5cdedb7eb546c08"}, @@ -4441,6 +4443,30 @@ dev = ["autoflake (>=1.3.1,<2.0.0)", "flake8 (>=3.8.3,<4.0.0)", "pre-commit (>=2 doc = ["cairosvg (>=2.5.2,<3.0.0)", "mdx-include (>=1.4.1,<2.0.0)", "mkdocs (>=1.1.2,<2.0.0)", "mkdocs-material (>=8.1.4,<9.0.0)", "pillow (>=9.3.0,<10.0.0)"] test = ["black (>=22.3.0,<23.0.0)", "coverage (>=6.2,<7.0)", "isort (>=5.0.6,<6.0.0)", "mypy (==0.910)", "pytest (>=4.4.0,<8.0.0)", "pytest-cov (>=2.10.0,<5.0.0)", "pytest-sugar (>=0.9.4,<0.10.0)", "pytest-xdist (>=1.32.0,<4.0.0)", "rich (>=10.11.0,<13.0.0)", "shellingham (>=1.3.0,<2.0.0)"] +[[package]] +name = "types-pillow" +version = "9.5.0.2" +description = "Typing stubs for Pillow" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "types-Pillow-9.5.0.2.tar.gz", hash = "sha256:b3f9f621f259566c19c1deca21901017c8b1e3e200ed2e49e0a2d83c0a5175db"}, + {file = "types_Pillow-9.5.0.2-py3-none-any.whl", hash = "sha256:58fdebd0ffa2353ecccdd622adde23bce89da5c0c8b96c34f2d1eca7b7e42d0e"}, +] + +[[package]] +name = "types-pytz" +version = "2023.3.0.0" +description = "Typing stubs for pytz" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "types-pytz-2023.3.0.0.tar.gz", hash = "sha256:ecdc70d543aaf3616a7e48631543a884f74205f284cefd6649ddf44c6a820aac"}, + {file = "types_pytz-2023.3.0.0-py3-none-any.whl", hash = "sha256:4fc2a7fbbc315f0b6630e0b899fd6c743705abe1094d007b0e612d10da15e0f3"}, +] + [[package]] name = "types-pyyaml" version = "6.0.12.9" @@ -4968,4 +4994,4 @@ cffi = ["cffi (>=1.11)"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "a362f8d1e135082294c68b20de4aef52e5ac57d41d606d7e9b5ae62582b5e7df" +content-hash = "c8ba5d9e0208fc55dc2f00efffed26d7a2c7d325568dfd697cc6499d210304d9" diff --git a/pyproject.toml b/pyproject.toml index a37d63865..7ea498898 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,8 @@ pytest = "^7.2.2" types-requests = "^2.28.11" requests = "^2.28.0" pytest-cov = "^4.0.0" +pandas-stubs = "^2.0.0.230412" +types-pillow = "^9.5.0.2" [tool.ruff] From f3d50e9fea4c60a1908d539f8cdbc21fc2461f93 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Sat, 29 Apr 2023 07:37:16 -0300 Subject: [PATCH 145/150] formatting --- src/backend/langflow/cache/base.py | 8 +++----- src/backend/langflow/graph/base.py | 3 ++- src/backend/langflow/template/base.py | 4 ---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/backend/langflow/cache/base.py b/src/backend/langflow/cache/base.py index ba250da6b..ede0fb06e 100644 --- a/src/backend/langflow/cache/base.py +++ b/src/backend/langflow/cache/base.py @@ -8,12 +8,10 @@ import os import tempfile from collections import OrderedDict from pathlib import Path -from typing import Any -from PIL import Image -import dill -import pandas as pd # type: ignore +from typing import Any, Dict +import dill # type: ignore -CACHE = {} +CACHE: Dict[str, Any] = {} def create_cache_folder(func): diff --git a/src/backend/langflow/graph/base.py b/src/backend/langflow/graph/base.py index ae82d68d1..e661fec69 100644 --- a/src/backend/langflow/graph/base.py +++ b/src/backend/langflow/graph/base.py @@ -162,7 +162,8 @@ class Node: # If the key is "func", then we need to use the run method if key == "func": if not isinstance(result, types.FunctionType): - # func can be PythonFunction(code='\ndef upper_case(text: str) -> str:\n return text.upper()\n') + # func can be + # PythonFunction(code='\ndef upper_case(text: str) -> str:\n return text.upper()\n') # so we need to check if there is an attribute called run if hasattr(result, "run"): result = result.run # type: ignore diff --git a/src/backend/langflow/template/base.py b/src/backend/langflow/template/base.py index 860d2ac1e..bab3a7b2d 100644 --- a/src/backend/langflow/template/base.py +++ b/src/backend/langflow/template/base.py @@ -229,10 +229,6 @@ class FrontendNode(BaseModel): field.required = False if field.value is None: field.value = "" - # If the field.name contains api or api and key, then it might be an api key - # other conditions are to make sure that it is not an input or output variable - if "api" in key.lower() and "key" in key.lower(): - field.required = False if "kwargs" in field.name.lower(): field.advanced = True From 3a5b708d536f7abcd4eb77578b420f4bbc141cd8 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Sat, 29 Apr 2023 07:37:32 -0300 Subject: [PATCH 146/150] deactivate class params check for now --- src/backend/langflow/interface/loading.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend/langflow/interface/loading.py b/src/backend/langflow/interface/loading.py index 8fd1b127d..cab23c7e4 100644 --- a/src/backend/langflow/interface/loading.py +++ b/src/backend/langflow/interface/loading.py @@ -25,7 +25,6 @@ from langflow.interface.toolkits.base import toolkits_creator from langflow.interface.types import get_type_list from langflow.interface.utils import load_file_into_dict from langflow.utils import util, validate -from pydantic import BaseModel def instantiate_class(node_type: str, base_type: str, params: Dict) -> Any: @@ -35,11 +34,12 @@ def instantiate_class(node_type: str, base_type: str, params: Dict) -> Any: return custom_agent.initialize(**params) # type: ignore class_object = import_by_type(_type=base_type, name=node_type) + # check if it is a class before using issubclass - if issubclass(class_object, BaseModel): - # validate params - fields = class_object.__fields__ - params = {key: value for key, value in params.items() if key in fields} + # if isinstance(class_object, type) and issubclass(class_object, BaseModel): + # # validate params + # fields = class_object.__fields__ + # params = {key: value for key, value in params.items() if key in fields} if base_type == "agents": # We need to initialize it differently From ffb2aad45d55d120db04709b9673c1aa955c077c Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Sat, 29 Apr 2023 07:38:06 -0300 Subject: [PATCH 147/150] fixes to tests --- src/backend/langflow/template/nodes.py | 1 + tests/test_agents_template.py | 2 +- tests/test_chains_template.py | 14 ++++++++++---- tests/test_graph.py | 1 - tests/test_websocket.py | 3 --- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/backend/langflow/template/nodes.py b/src/backend/langflow/template/nodes.py index acf93c948..7b5ac6d3f 100644 --- a/src/backend/langflow/template/nodes.py +++ b/src/backend/langflow/template/nodes.py @@ -199,6 +199,7 @@ class SeriesCharacterChainNode(FrontendNode): "Chain", "ConversationChain", "SeriesCharacterChain", + "function", ] diff --git a/tests/test_agents_template.py b/tests/test_agents_template.py index a546454eb..4ed9d1153 100644 --- a/tests/test_agents_template.py +++ b/tests/test_agents_template.py @@ -130,7 +130,7 @@ def test_initialize_agent(client: TestClient): agents = json_response["agents"] initialize_agent = agents["initialize_agent"] - assert initialize_agent["base_classes"] == ["AgentExecutor"] + assert initialize_agent["base_classes"] == ["AgentExecutor", "function"] template = initialize_agent["template"] assert template["agent"] == { diff --git a/tests/test_chains_template.py b/tests/test_chains_template.py index cff844c90..13bef2e9c 100644 --- a/tests/test_chains_template.py +++ b/tests/test_chains_template.py @@ -20,7 +20,12 @@ def test_conversation_chain(client: TestClient): chain = chains["ConversationChain"] # Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects - assert set(chain["base_classes"]) == {"LLMChain", "ConversationChain", "Chain"} + assert set(chain["base_classes"]) == { + "function", + "LLMChain", + "ConversationChain", + "Chain", + } template = chain["template"] assert template["memory"] == { "required": False, @@ -96,7 +101,7 @@ def test_llm_chain(client: TestClient): chain = chains["LLMChain"] # Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects - assert set(chain["base_classes"]) == {"LLMChain", "Chain"} + assert set(chain["base_classes"]) == {"function", "LLMChain", "Chain"} template = chain["template"] assert template["memory"] == { "required": False, @@ -154,7 +159,7 @@ def test_llm_checker_chain(client: TestClient): chain = chains["LLMCheckerChain"] # Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects - assert set(chain["base_classes"]) == {"LLMCheckerChain", "Chain"} + assert set(chain["base_classes"]) == {"function", "LLMCheckerChain", "Chain"} template = chain["template"] assert template["memory"] == { "required": False, @@ -231,7 +236,7 @@ def test_llm_math_chain(client: TestClient): chain = chains["LLMMathChain"] # Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects - assert set(chain["base_classes"]) == {"LLMMathChain", "Chain"} + assert set(chain["base_classes"]) == {"function", "LLMMathChain", "Chain"} template = chain["template"] assert template["memory"] == { "required": False, @@ -310,6 +315,7 @@ def test_series_character_chain(client: TestClient): # Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects assert set(chain["base_classes"]) == { + "function", "LLMChain", "BaseCustomChain", "Chain", diff --git a/tests/test_graph.py b/tests/test_graph.py index 76451fe6a..e109850e3 100644 --- a/tests/test_graph.py +++ b/tests/test_graph.py @@ -1,4 +1,3 @@ -import json from typing import Type, Union import pytest diff --git a/tests/test_websocket.py b/tests/test_websocket.py index 1137c4813..7ac646cf4 100644 --- a/tests/test_websocket.py +++ b/tests/test_websocket.py @@ -1,6 +1,5 @@ import json from unittest.mock import patch -from langflow.api.schemas import ChatMessage from fastapi.testclient import TestClient @@ -11,8 +10,6 @@ def test_websocket_connection(client: TestClient): def test_chat_history(client: TestClient): - chat_history = [] - # Mock the process_graph function to return a specific value with patch("langflow.api.chat_manager.process_graph") as mock_process_graph: mock_process_graph.return_value = ("Hello, I'm a mock response!", "") From 9a6e7cfc3ff77dd9022582205c0084e9174b8cdf Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Sat, 29 Apr 2023 07:38:17 -0300 Subject: [PATCH 148/150] add test_cache_manager --- tests/test_cache_manager.py | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 tests/test_cache_manager.py diff --git a/tests/test_cache_manager.py b/tests/test_cache_manager.py new file mode 100644 index 000000000..8680a43cb --- /dev/null +++ b/tests/test_cache_manager.py @@ -0,0 +1,81 @@ +import pytest +from PIL import Image +import pandas as pd +from io import StringIO +from langflow.cache.manager import CacheManager + + +@pytest.fixture +def cache_manager(): + return CacheManager() + + +def test_cache_manager_attach_detach_notify(cache_manager): + observer_called = False + + def observer(): + nonlocal observer_called + observer_called = True + + cache_manager.attach(observer) + cache_manager.notify() + + assert observer_called + + observer_called = False + cache_manager.detach(observer) + cache_manager.notify() + + assert not observer_called + + +def test_cache_manager_client_context(cache_manager): + with cache_manager.set_client_id("client1"): + cache_manager.add("foo", "bar", "string") + assert cache_manager.get("foo") == { + "obj": "bar", + "type": "string", + "extension": "str", + } + + with cache_manager.set_client_id("client2"): + cache_manager.add("baz", "qux", "string") + assert cache_manager.get("baz") == { + "obj": "qux", + "type": "string", + "extension": "str", + } + + with pytest.raises(KeyError): + cache_manager.get("foo") + + +def test_cache_manager_add_pandas(cache_manager): + df = pd.DataFrame({"col1": [1, 2], "col2": [3, 4]}) + + with cache_manager.set_client_id("client1"): + cache_manager.add_pandas("test_df", df) + cached_df = cache_manager.get("test_df") + assert cached_df["type"] == "pandas" + assert cached_df["extension"] == "csv" + read_df = pd.read_csv(StringIO(cached_df["obj"]), index_col=0) + pd.testing.assert_frame_equal(df, read_df) + + +def test_cache_manager_add_image(cache_manager): + img = Image.new("RGB", (50, 50), color="red") + + with cache_manager.set_client_id("client1"): + cache_manager.add_image("test_image", img) + cached_img = cache_manager.get("test_image") + assert cached_img["type"] == "image" + assert cached_img["extension"] == "png" + assert isinstance(cached_img["obj"], Image.Image) + + +def test_cache_manager_get_last(cache_manager): + with cache_manager.set_client_id("client1"): + cache_manager.add("foo", "bar", "string") + cache_manager.add("baz", "qux", "string") + last_item = cache_manager.get_last() + assert last_item == {"obj": "qux", "type": "string", "extension": "str"} From ce82b7e61159f083123d401e8d33f5eff5738e05 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Sat, 29 Apr 2023 07:38:27 -0300 Subject: [PATCH 149/150] remove unused imports --- src/backend/langflow/utils/util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/backend/langflow/utils/util.py b/src/backend/langflow/utils/util.py index 080137c26..874debd8d 100644 --- a/src/backend/langflow/utils/util.py +++ b/src/backend/langflow/utils/util.py @@ -1,5 +1,4 @@ -import asyncio -from functools import partial, wraps +from functools import wraps import importlib import inspect import re From 0ab3d6b31cf2d32e89dffbba16a94091a10c30af Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Sat, 29 Apr 2023 08:02:22 -0300 Subject: [PATCH 150/150] bump version to 0.0.61 --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 2b1ed2cc5..33a0abfbd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1573,14 +1573,14 @@ test = ["flaky", "ipyparallel", "pre-commit", "pytest (>=7.0)", "pytest-asyncio" [[package]] name = "ipython" -version = "8.13.0" +version = "8.13.1" description = "IPython: Productive Interactive Computing" category = "dev" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "ipython-8.13.0-py3-none-any.whl", hash = "sha256:a0a8a30376cee8019c6e22bc0ab4320762f5f5e4d7abed0ea3ee4b95e3982ad5"}, - {file = "ipython-8.13.0.tar.gz", hash = "sha256:8d56026b882958db8eab089654f0c045d1237622313a1506da136fb0cce4270f"}, + {file = "ipython-8.13.1-py3-none-any.whl", hash = "sha256:1c80d08f04144a1994cda25569eab07fbdc4989bd8d8793e3a4ff643065ccb51"}, + {file = "ipython-8.13.1.tar.gz", hash = "sha256:9c8487ac18f330c8a683fc50ab6d7bc0fcf9ef1d7a9f6ce7926938261067b81f"}, ] [package.dependencies] diff --git a/pyproject.toml b/pyproject.toml index 7ea498898..4f7673044 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langflow" -version = "0.0.59" +version = "0.0.61" description = "A Python package with a built-in web application" authors = ["Logspace "] maintainers = [