diff --git a/.gitignore b/.gitignore index 9b8ec1cc1..0f9c499a0 100644 --- a/.gitignore +++ b/.gitignore @@ -254,4 +254,6 @@ langflow.db /tmp/* src/backend/langflow/frontend/ -.docker \ No newline at end of file +.docker + +.idea \ No newline at end of file diff --git a/docs/docs/components/llms.mdx b/docs/docs/components/llms.mdx index 088556d2f..412f38681 100644 --- a/docs/docs/components/llms.mdx +++ b/docs/docs/components/llms.mdx @@ -217,4 +217,40 @@ Vertex AI is a cloud computing platform offered by Google Cloud Platform (GCP). - **top_k:** How the model selects tokens for output, the next token is selected from – defaults to `40`. - **top_p:** Tokens are selected from most probable to least until the sum of their – defaults to `0.95`. - **tuned_model_name:** The name of a tuned model. If provided, model_name is ignored. -- **verbose:** This parameter is used to control the level of detail in the output of the chain. When set to True, it will print out some internal states of the chain while it is being run, which can help debug and understand the chain's behavior. If set to False, it will suppress the verbose output – defaults to `False`. \ No newline at end of file +- **verbose:** This parameter is used to control the level of detail in the output of the chain. When set to True, it will print out some internal states of the chain while it is being run, which can help debug and understand the chain's behavior. If set to False, it will suppress the verbose output – defaults to `False`. + +--- + +### QianfanLLMEndpoint + +Wrapper around [Baidu Qianfan](https://cloud.baidu.com/doc/WENXINWORKSHOP/index.html) large language models. + +:::info +The Qianfan Big Model Platform is a one-stop platform for enterprise developers to develop and operate large models and services. It provides data management based on ERNIE Bot's underlying model (Ernie Bot), automatic model customization and fine-tuning, and one-stop large-scale model customization services for cloud deployment of prediction services, and provides ERNIE Bot's enterprise level service API that can be quickly called, helping to implement the demand for generative AI applications in various industries. +::: + +- **Model Name:** Model name. you could get from https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu preset models are mapping to an endpoint. `Model Name` will be ignored if `Endpoint` is set. +- **Qianfan Ak:** which you could get from https://cloud.baidu.com/product/wenxinworkshop. +- **Qianfan Sk:** which you could get from https://cloud.baidu.com/product/wenxinworkshop. +- **Top p:** Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo. The diversity of the output text is affected, and the larger the value, the stronger the diversity of the generated text - defaults to `0.8`. +- **Temperature:** Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo. Higher values make the output more random, while lower values make it more concentrated and deterministic - defaults to `0.95`. +- **Penalty Score:** Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo. By increasing the penalty for generated tokens, the phenomenon of duplicate generation is reduced. A higher value indicates a higher penalty - defaults to `1.0`. +- **Endpoint:** Endpoint of the Qianfan LLM, required if custom model used. + +--- + +### QianfanChatEndpoint + +Wrapper around [Baidu Qianfan](https://cloud.baidu.com/doc/WENXINWORKSHOP/index.html) chat large language models. This component supports some of the LLMs (Large Language Models) available by Baidu qianfan and is used for tasks such as chatbots, Generative Question-Answering (GQA), and summarization. + +:::info +The Qianfan Big Model Platform is a one-stop platform for enterprise developers to develop and operate large models and services. It provides data management based on ERNIE Bot's underlying model (Ernie Bot), automatic model customization and fine-tuning, and one-stop large-scale model customization services for cloud deployment of prediction services, and provides ERNIE Bot's enterprise level service API that can be quickly called, helping to implement the demand for generative AI applications in various industries. +::: + +- **Model Name:** Model name. you could get from https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu preset models are mapping to an endpoint. `Model Name` will be ignored if `Endpoint` is set. +- **Qianfan Ak:** which you could get from https://cloud.baidu.com/product/wenxinworkshop. +- **Qianfan Sk:** which you could get from https://cloud.baidu.com/product/wenxinworkshop. +- **Top p:** Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo. The diversity of the output text is affected, and the larger the value, the stronger the diversity of the generated text - defaults to `0.8`. +- **Temperature:** Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo. Higher values make the output more random, while lower values make it more concentrated and deterministic - defaults to `0.95`. +- **Penalty Score:** Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo. By increasing the penalty for generated tokens, the phenomenon of duplicate generation is reduced. A higher value indicates a higher penalty - defaults to `1.0`. +- **Endpoint:** Endpoint of the Qianfan LLM, required if custom model used. \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index b81012583..3c6ab4363 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. [[package]] name = "aiofiles" @@ -341,6 +341,22 @@ files = [ {file = "backoff-2.2.1.tar.gz", hash = "sha256:03f829f5bb1923180821643f8753b0502c3b682293992485b0eef2807afa5cba"}, ] +[[package]] +name = "bce-python-sdk" +version = "0.8.92" +description = "BCE SDK for python" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4" +files = [ + {file = "bce-python-sdk-0.8.92.tar.gz", hash = "sha256:e44ae102f32b3ac61bf31e774dc953e6723d8d47c4df489c0dafb9522207a4db"}, + {file = "bce_python_sdk-0.8.92-py3-none-any.whl", hash = "sha256:7b540004e858bfa6f39ab033f65b750719482caa354ceb65d2c2606680059817"}, +] + +[package.dependencies] +future = ">=0.6.0" +pycryptodome = ">=3.8.0" +six = ">=1.4.0" + [[package]] name = "bcrypt" version = "4.0.1" @@ -1047,6 +1063,23 @@ humanfriendly = ">=9.1" [package.extras] cron = ["capturer (>=2.4)"] +[[package]] +name = "colorlog" +version = "6.7.0" +description = "Add colours to the output of Python's logging module." +optional = false +python-versions = ">=3.6" +files = [ + {file = "colorlog-6.7.0-py2.py3-none-any.whl", hash = "sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662"}, + {file = "colorlog-6.7.0.tar.gz", hash = "sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} + +[package.extras] +development = ["black", "flake8", "mypy", "pytest", "types-colorama"] + [[package]] name = "comm" version = "0.1.4" @@ -1492,6 +1525,26 @@ files = [ [package.extras] dev = ["coverage", "coveralls", "pytest"] +[[package]] +name = "erniebot" +version = "0.3.1" +description = "Python library for the ERNIE Bot" +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "erniebot-0.3.1-py3-none-any.whl", hash = "sha256:cc4ebc465af101c1a280b76a44d10f7a555155fd3ed5a6d17e5548686ea2c2c8"}, +] + +[package.dependencies] +aiohttp = "*" +bce-python-sdk = "*" +colorlog = "*" +requests = ">=2.20" +typing-extensions = "*" + +[package.extras] +docs = ["Sphinx", "commonmark", "mkdocs", "mkdocs-material", "mkdocs-material-extensions", "pymdown-extensions", "recommonmark", "sphinx-markdown-tables"] + [[package]] name = "exceptiongroup" version = "1.1.3" @@ -1853,6 +1906,16 @@ smb = ["smbprotocol"] ssh = ["paramiko"] tqdm = ["tqdm"] +[[package]] +name = "future" +version = "0.18.3" +description = "Clean single-source support for Python 3 and 2" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "future-0.18.3.tar.gz", hash = "sha256:34a17436ed1e96697a86f9de3d15a3b0be01d8bc8de9c1dffd59fb8234ed5307"}, +] + [[package]] name = "gevent" version = "23.9.1" @@ -2416,7 +2479,7 @@ files = [ {file = "greenlet-3.0.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0b72b802496cccbd9b31acea72b6f87e7771ccfd7f7927437d592e5c92ed703c"}, {file = "greenlet-3.0.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:527cd90ba3d8d7ae7dceb06fda619895768a46a1b4e423bdb24c1969823b8362"}, {file = "greenlet-3.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:37f60b3a42d8b5499be910d1267b24355c495064f271cfe74bf28b17b099133c"}, - {file = "greenlet-3.0.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:1482fba7fbed96ea7842b5a7fc11d61727e8be75a077e603e8ab49d24e234383"}, + {file = "greenlet-3.0.0-cp311-universal2-macosx_10_9_universal2.whl", hash = "sha256:c3692ecf3fe754c8c0f2c95ff19626584459eab110eaab66413b1e7425cd84e9"}, {file = "greenlet-3.0.0-cp312-cp312-macosx_13_0_arm64.whl", hash = "sha256:be557119bf467d37a8099d91fbf11b2de5eb1fd5fc5b91598407574848dc910f"}, {file = "greenlet-3.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:73b2f1922a39d5d59cc0e597987300df3396b148a9bd10b76a058a2f2772fc04"}, {file = "greenlet-3.0.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d1e22c22f7826096ad503e9bb681b05b8c1f5a8138469b255eb91f26a76634f2"}, @@ -2426,6 +2489,7 @@ files = [ {file = "greenlet-3.0.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:952256c2bc5b4ee8df8dfc54fc4de330970bf5d79253c863fb5e6761f00dda35"}, {file = "greenlet-3.0.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:269d06fa0f9624455ce08ae0179430eea61085e3cf6457f05982b37fd2cefe17"}, {file = "greenlet-3.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:9adbd8ecf097e34ada8efde9b6fec4dd2a903b1e98037adf72d12993a1c80b51"}, + {file = "greenlet-3.0.0-cp312-universal2-macosx_10_9_universal2.whl", hash = "sha256:553d6fb2324e7f4f0899e5ad2c427a4579ed4873f42124beba763f16032959af"}, {file = "greenlet-3.0.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c6b5ce7f40f0e2f8b88c28e6691ca6806814157ff05e794cdd161be928550f4c"}, {file = "greenlet-3.0.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ecf94aa539e97a8411b5ea52fc6ccd8371be9550c4041011a091eb8b3ca1d810"}, {file = "greenlet-3.0.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80dcd3c938cbcac986c5c92779db8e8ce51a89a849c135172c88ecbdc8c056b7"}, @@ -3355,13 +3419,13 @@ zookeeper = ["kazoo (>=2.8.0)"] [[package]] name = "langchain" -version = "0.0.308" +version = "0.0.312" description = "Building applications with LLMs through composability" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langchain-0.0.308-py3-none-any.whl", hash = "sha256:807de0a8f4177e42e435682cfd33e600518d04e1688149afda8542b9d31a407f"}, - {file = "langchain-0.0.308.tar.gz", hash = "sha256:496ddef6c0aa8e73b3c28bad8c4cb02cdb7330e8ba80b238f1b3e0d663756b1b"}, + {file = "langchain-0.0.312-py3-none-any.whl", hash = "sha256:2c7ea6e80195b8747c25ca4b905bd4814f26f47719a27edcb369cb6cd2186df3"}, + {file = "langchain-0.0.312.tar.gz", hash = "sha256:4629233c158f23dcfb0cbc249b27d7d8bde1e71ce1d8972d53ae54c7504fc78a"}, ] [package.dependencies] @@ -3370,7 +3434,7 @@ anyio = "<4.0" async-timeout = {version = ">=4.0.0,<5.0.0", markers = "python_version < \"3.11\""} dataclasses-json = ">=0.5.7,<0.7" jsonpatch = ">=1.33,<2.0" -langsmith = ">=0.0.40,<0.1.0" +langsmith = ">=0.0.43,<0.1.0" numpy = ">=1,<2" pydantic = ">=1,<3" PyYAML = ">=5.3" @@ -3379,13 +3443,14 @@ SQLAlchemy = ">=1.4,<3" tenacity = ">=8.1.0,<9.0.0" [package.extras] -all = ["O365 (>=2.0.26,<3.0.0)", "aleph-alpha-client (>=2.15.0,<3.0.0)", "amadeus (>=8.1.0)", "arxiv (>=1.4,<2.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "awadb (>=0.3.9,<0.4.0)", "azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "beautifulsoup4 (>=4,<5)", "clarifai (>=9.1.0)", "clickhouse-connect (>=0.5.14,<0.6.0)", "cohere (>=4,<5)", "deeplake (>=3.6.8,<4.0.0)", "docarray[hnswlib] (>=0.32.0,<0.33.0)", "duckduckgo-search (>=3.8.3,<4.0.0)", "elasticsearch (>=8,<9)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-auth (>=2.18.1,<3.0.0)", "google-search-results (>=2,<3)", "gptcache (>=0.1.7)", "html2text (>=2020.1.16,<2021.0.0)", "huggingface_hub (>=0,<1)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lancedb (>=0.1,<0.2)", "langkit (>=0.0.6,<0.1.0)", "lark (>=1.1.5,<2.0.0)", "libdeeplake (>=0.0.60,<0.0.61)", "librosa (>=0.10.0.post2,<0.11.0)", "lxml (>=4.9.2,<5.0.0)", "manifest-ml (>=0.0.1,<0.0.2)", "marqo (>=1.2.4,<2.0.0)", "momento (>=1.5.0,<2.0.0)", "nebula3-python (>=3.4.0,<4.0.0)", "neo4j (>=5.8.1,<6.0.0)", "networkx (>=2.6.3,<4)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (>=0,<1)", "openlm (>=0.0.5,<0.0.6)", "opensearch-py (>=2.0.0,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pexpect (>=4.8.0,<5.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)", "pymongo (>=4.3.3,<5.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pytesseract (>=0.3.10,<0.4.0)", "python-arango (>=7.5.9,<8.0.0)", "pyvespa (>=0.33.0,<0.34.0)", "qdrant-client (>=1.3.1,<2.0.0)", "rdflib (>=6.3.2,<7.0.0)", "redis (>=4,<5)", "requests-toolbelt (>=1.0.0,<2.0.0)", "sentence-transformers (>=2,<3)", "singlestoredb (>=0.7.1,<0.8.0)", "tensorflow-text (>=2.11.0,<3.0.0)", "tigrisdb (>=1.0.0b6,<2.0.0)", "tiktoken (>=0.3.2,<0.6.0)", "torch (>=1,<3)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"] +all = ["O365 (>=2.0.26,<3.0.0)", "aleph-alpha-client (>=2.15.0,<3.0.0)", "amadeus (>=8.1.0)", "arxiv (>=1.4,<2.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "awadb (>=0.3.9,<0.4.0)", "azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "beautifulsoup4 (>=4,<5)", "clarifai (>=9.1.0)", "clickhouse-connect (>=0.5.14,<0.6.0)", "cohere (>=4,<5)", "deeplake (>=3.6.8,<4.0.0)", "docarray[hnswlib] (>=0.32.0,<0.33.0)", "duckduckgo-search (>=3.8.3,<4.0.0)", "elasticsearch (>=8,<9)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-auth (>=2.18.1,<3.0.0)", "google-search-results (>=2,<3)", "gptcache (>=0.1.7)", "html2text (>=2020.1.16,<2021.0.0)", "huggingface_hub (>=0,<1)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lancedb (>=0.1,<0.2)", "langkit (>=0.0.6,<0.1.0)", "lark (>=1.1.5,<2.0.0)", "libdeeplake (>=0.0.60,<0.0.61)", "librosa (>=0.10.0.post2,<0.11.0)", "lxml (>=4.9.2,<5.0.0)", "manifest-ml (>=0.0.1,<0.0.2)", "marqo (>=1.2.4,<2.0.0)", "momento (>=1.10.1,<2.0.0)", "nebula3-python (>=3.4.0,<4.0.0)", "neo4j (>=5.8.1,<6.0.0)", "networkx (>=2.6.3,<4)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (>=0,<1)", "openlm (>=0.0.5,<0.0.6)", "opensearch-py (>=2.0.0,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pexpect (>=4.8.0,<5.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)", "pymongo (>=4.3.3,<5.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pytesseract (>=0.3.10,<0.4.0)", "python-arango (>=7.5.9,<8.0.0)", "pyvespa (>=0.33.0,<0.34.0)", "qdrant-client (>=1.3.1,<2.0.0)", "rdflib (>=6.3.2,<7.0.0)", "redis (>=4,<5)", "requests-toolbelt (>=1.0.0,<2.0.0)", "sentence-transformers (>=2,<3)", "singlestoredb (>=0.7.1,<0.8.0)", "tensorflow-text (>=2.11.0,<3.0.0)", "tigrisdb (>=1.0.0b6,<2.0.0)", "tiktoken (>=0.3.2,<0.6.0)", "torch (>=1,<3)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"] azure = ["azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-core (>=1.26.4,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "azure-search-documents (==11.4.0b8)", "openai (>=0,<1)"] clarifai = ["clarifai (>=9.1.0)"] +cli = ["typer (>=0.9.0,<0.10.0)"] cohere = ["cohere (>=4,<5)"] docarray = ["docarray[hnswlib] (>=0.32.0,<0.33.0)"] embeddings = ["sentence-transformers (>=2,<3)"] -extended-testing = ["amazon-textract-caller (<2)", "anthropic (>=0.3.11,<0.4.0)", "arxiv (>=1.4,<2.0)", "assemblyai (>=0.17.0,<0.18.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "beautifulsoup4 (>=4,<5)", "bibtexparser (>=1.4.0,<2.0.0)", "cassio (>=0.1.0,<0.2.0)", "chardet (>=5.1.0,<6.0.0)", "dashvector (>=1.0.1,<2.0.0)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "feedparser (>=6.0.10,<7.0.0)", "geopandas (>=0.13.1,<0.14.0)", "gitpython (>=3.1.32,<4.0.0)", "gql (>=3.4.1,<4.0.0)", "html2text (>=2020.1.16,<2021.0.0)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lxml (>=4.9.2,<5.0.0)", "markdownify (>=0.11.6,<0.12.0)", "motor (>=3.3.1,<4.0.0)", "mwparserfromhell (>=0.6.4,<0.7.0)", "mwxml (>=0.3.3,<0.4.0)", "newspaper3k (>=0.2.8,<0.3.0)", "numexpr (>=2.8.6,<3.0.0)", "openai (>=0,<1)", "openapi-schema-pydantic (>=1.2,<2.0)", "pandas (>=2.0.1,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pgvector (>=0.1.6,<0.2.0)", "psychicapi (>=0.8.0,<0.9.0)", "py-trello (>=0.19.0,<0.20.0)", "pymupdf (>=1.22.3,<2.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pypdfium2 (>=4.10.0,<5.0.0)", "pyspark (>=3.4.0,<4.0.0)", "rank-bm25 (>=0.2.2,<0.3.0)", "rapidfuzz (>=3.1.1,<4.0.0)", "requests-toolbelt (>=1.0.0,<2.0.0)", "scikit-learn (>=1.2.2,<2.0.0)", "sqlite-vss (>=0.1.2,<0.2.0)", "streamlit (>=1.18.0,<2.0.0)", "sympy (>=1.12,<2.0)", "telethon (>=1.28.5,<2.0.0)", "timescale-vector (>=0.0.1,<0.0.2)", "tqdm (>=4.48.0)", "xata (>=1.0.0a7,<2.0.0)", "xmltodict (>=0.13.0,<0.14.0)"] +extended-testing = ["aiosqlite (>=0.19.0,<0.20.0)", "amazon-textract-caller (<2)", "anthropic (>=0.3.11,<0.4.0)", "arxiv (>=1.4,<2.0)", "assemblyai (>=0.17.0,<0.18.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "beautifulsoup4 (>=4,<5)", "bibtexparser (>=1.4.0,<2.0.0)", "cassio (>=0.1.0,<0.2.0)", "chardet (>=5.1.0,<6.0.0)", "dashvector (>=1.0.1,<2.0.0)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "feedparser (>=6.0.10,<7.0.0)", "geopandas (>=0.13.1,<0.14.0)", "gitpython (>=3.1.32,<4.0.0)", "gql (>=3.4.1,<4.0.0)", "html2text (>=2020.1.16,<2021.0.0)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lxml (>=4.9.2,<5.0.0)", "markdownify (>=0.11.6,<0.12.0)", "motor (>=3.3.1,<4.0.0)", "mwparserfromhell (>=0.6.4,<0.7.0)", "mwxml (>=0.3.3,<0.4.0)", "newspaper3k (>=0.2.8,<0.3.0)", "numexpr (>=2.8.6,<3.0.0)", "openai (>=0,<1)", "openapi-schema-pydantic (>=1.2,<2.0)", "pandas (>=2.0.1,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pgvector (>=0.1.6,<0.2.0)", "psychicapi (>=0.8.0,<0.9.0)", "py-trello (>=0.19.0,<0.20.0)", "pymupdf (>=1.22.3,<2.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pypdfium2 (>=4.10.0,<5.0.0)", "pyspark (>=3.4.0,<4.0.0)", "rank-bm25 (>=0.2.2,<0.3.0)", "rapidfuzz (>=3.1.1,<4.0.0)", "rapidocr-onnxruntime (>=1.3.2,<2.0.0)", "requests-toolbelt (>=1.0.0,<2.0.0)", "scikit-learn (>=1.2.2,<2.0.0)", "sqlite-vss (>=0.1.2,<0.2.0)", "streamlit (>=1.18.0,<2.0.0)", "sympy (>=1.12,<2.0)", "telethon (>=1.28.5,<2.0.0)", "timescale-vector (>=0.0.1,<0.0.2)", "tqdm (>=4.48.0)", "xata (>=1.0.0a7,<2.0.0)", "xmltodict (>=0.13.0,<0.14.0)"] javascript = ["esprima (>=4.0.1,<5.0.0)"] llms = ["clarifai (>=9.1.0)", "cohere (>=4,<5)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (>=0,<1)", "openlm (>=0.0.5,<0.0.6)", "torch (>=1,<3)", "transformers (>=4,<5)"] openai = ["openai (>=0,<1)", "tiktoken (>=0.3.2,<0.6.0)"] @@ -3422,20 +3487,20 @@ six = "*" [[package]] name = "langfuse" -version = "1.0.33" +version = "1.0.37" description = "A client library for accessing langfuse" optional = false -python-versions = ">=3.8,<4.0" +python-versions = ">=3.8.1,<4.0" files = [ - {file = "langfuse-1.0.33-py3-none-any.whl", hash = "sha256:40a78b10997b657a7a05964b0b49c96d8063ae4b02557d0ed8256edcb7a09951"}, - {file = "langfuse-1.0.33.tar.gz", hash = "sha256:05f06faabf116bb5726aface93440d7d90fde6c9fc59b60d8868728729c1acb3"}, + {file = "langfuse-1.0.37-py3-none-any.whl", hash = "sha256:121225d99dd2d31fe57eb393dc6c216eb2a3205b244e3442ce1a5b80f567eb04"}, + {file = "langfuse-1.0.37.tar.gz", hash = "sha256:d00cfd0983dc75bdc3b2009ed795b1c8c1483db6067b412e4d521c3b65b04f01"}, ] [package.dependencies] attrs = ">=21.3.0" backoff = ">=2.2.1,<3.0.0" httpx = ">=0.15.4,<0.25.0" -langchain = ">=0.0.237,<1.0" +langchain = ">=0.0.309,<0.0.315" pydantic = ">=1.10.7,<2.0" python-dateutil = ">=2.8.0,<3.0" pytz = ">=2023.3,<2024.0" @@ -3534,7 +3599,6 @@ files = [ {file = "lxml-4.9.3-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:cef2502e7e8a96fe5ad686d60b49e1ab03e438bd9123987994528febd569868e"}, {file = "lxml-4.9.3-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:b86164d2cff4d3aaa1f04a14685cbc072efd0b4f99ca5708b2ad1b9b5988a991"}, {file = "lxml-4.9.3-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:42871176e7896d5d45138f6d28751053c711ed4d48d8e30b498da155af39aebd"}, - {file = "lxml-4.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:ae8b9c6deb1e634ba4f1930eb67ef6e6bf6a44b6eb5ad605642b2d6d5ed9ce3c"}, {file = "lxml-4.9.3-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:411007c0d88188d9f621b11d252cce90c4a2d1a49db6c068e3c16422f306eab8"}, {file = "lxml-4.9.3-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:cd47b4a0d41d2afa3e58e5bf1f62069255aa2fd6ff5ee41604418ca925911d76"}, {file = "lxml-4.9.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0e2cb47860da1f7e9a5256254b74ae331687b9672dfa780eed355c4c9c3dbd23"}, @@ -3543,7 +3607,6 @@ files = [ {file = "lxml-4.9.3-cp310-cp310-win_amd64.whl", hash = "sha256:97047f0d25cd4bcae81f9ec9dc290ca3e15927c192df17331b53bebe0e3ff96d"}, {file = "lxml-4.9.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:1f447ea5429b54f9582d4b955f5f1985f278ce5cf169f72eea8afd9502973dd5"}, {file = "lxml-4.9.3-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:57d6ba0ca2b0c462f339640d22882acc711de224d769edf29962b09f77129cbf"}, - {file = "lxml-4.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:9767e79108424fb6c3edf8f81e6730666a50feb01a328f4a016464a5893f835a"}, {file = "lxml-4.9.3-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:71c52db65e4b56b8ddc5bb89fb2e66c558ed9d1a74a45ceb7dcb20c191c3df2f"}, {file = "lxml-4.9.3-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:d73d8ecf8ecf10a3bd007f2192725a34bd62898e8da27eb9d32a58084f93962b"}, {file = "lxml-4.9.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0a3d3487f07c1d7f150894c238299934a2a074ef590b583103a45002035be120"}, @@ -3563,7 +3626,6 @@ files = [ {file = "lxml-4.9.3-cp36-cp36m-macosx_11_0_x86_64.whl", hash = "sha256:64f479d719dc9f4c813ad9bb6b28f8390360660b73b2e4beb4cb0ae7104f1c12"}, {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:dd708cf4ee4408cf46a48b108fb9427bfa00b9b85812a9262b5c668af2533ea5"}, {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c31c7462abdf8f2ac0577d9f05279727e698f97ecbb02f17939ea99ae8daa98"}, - {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:e3cd95e10c2610c360154afdc2f1480aea394f4a4f1ea0a5eacce49640c9b190"}, {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:4930be26af26ac545c3dffb662521d4e6268352866956672231887d18f0eaab2"}, {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4aec80cde9197340bc353d2768e2a75f5f60bacda2bab72ab1dc499589b3878c"}, {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:14e019fd83b831b2e61baed40cab76222139926b1fb5ed0e79225bc0cae14584"}, @@ -3573,7 +3635,6 @@ files = [ {file = "lxml-4.9.3-cp36-cp36m-win_amd64.whl", hash = "sha256:bef4e656f7d98aaa3486d2627e7d2df1157d7e88e7efd43a65aa5dd4714916cf"}, {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:46f409a2d60f634fe550f7133ed30ad5321ae2e6630f13657fb9479506b00601"}, {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:4c28a9144688aef80d6ea666c809b4b0e50010a2aca784c97f5e6bf143d9f129"}, - {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:141f1d1a9b663c679dc524af3ea1773e618907e96075262726c7612c02b149a4"}, {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:53ace1c1fd5a74ef662f844a0413446c0629d151055340e9893da958a374f70d"}, {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:17a753023436a18e27dd7769e798ce302963c236bc4114ceee5b25c18c52c693"}, {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7d298a1bd60c067ea75d9f684f5f3992c9d6766fadbc0bcedd39750bf344c2f4"}, @@ -3583,7 +3644,6 @@ files = [ {file = "lxml-4.9.3-cp37-cp37m-win_amd64.whl", hash = "sha256:120fa9349a24c7043854c53cae8cec227e1f79195a7493e09e0c12e29f918e52"}, {file = "lxml-4.9.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:4d2d1edbca80b510443f51afd8496be95529db04a509bc8faee49c7b0fb6d2cc"}, {file = "lxml-4.9.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:8d7e43bd40f65f7d97ad8ef5c9b1778943d02f04febef12def25f7583d19baac"}, - {file = "lxml-4.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:71d66ee82e7417828af6ecd7db817913cb0cf9d4e61aa0ac1fde0583d84358db"}, {file = "lxml-4.9.3-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:6fc3c450eaa0b56f815c7b62f2b7fba7266c4779adcf1cece9e6deb1de7305ce"}, {file = "lxml-4.9.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:65299ea57d82fb91c7f019300d24050c4ddeb7c5a190e076b5f48a2b43d19c42"}, {file = "lxml-4.9.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:eadfbbbfb41b44034a4c757fd5d70baccd43296fb894dba0295606a7cf3124aa"}, @@ -3593,7 +3653,6 @@ files = [ {file = "lxml-4.9.3-cp38-cp38-win_amd64.whl", hash = "sha256:92af161ecbdb2883c4593d5ed4815ea71b31fafd7fd05789b23100d081ecac96"}, {file = "lxml-4.9.3-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:9bb6ad405121241e99a86efff22d3ef469024ce22875a7ae045896ad23ba2340"}, {file = "lxml-4.9.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:8ed74706b26ad100433da4b9d807eae371efaa266ffc3e9191ea436087a9d6a7"}, - {file = "lxml-4.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:fbf521479bcac1e25a663df882c46a641a9bff6b56dc8b0fafaebd2f66fb231b"}, {file = "lxml-4.9.3-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:303bf1edce6ced16bf67a18a1cf8339d0db79577eec5d9a6d4a80f0fb10aa2da"}, {file = "lxml-4.9.3-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:5515edd2a6d1a5a70bfcdee23b42ec33425e405c5b351478ab7dc9347228f96e"}, {file = "lxml-4.9.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:690dafd0b187ed38583a648076865d8c229661ed20e48f2335d68e2cf7dc829d"}, @@ -3604,16 +3663,13 @@ files = [ {file = "lxml-4.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:4dd9a263e845a72eacb60d12401e37c616438ea2e5442885f65082c276dfb2b2"}, {file = "lxml-4.9.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:6689a3d7fd13dc687e9102a27e98ef33730ac4fe37795d5036d18b4d527abd35"}, {file = "lxml-4.9.3-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:f6bdac493b949141b733c5345b6ba8f87a226029cbabc7e9e121a413e49441e0"}, - {file = "lxml-4.9.3-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:05186a0f1346ae12553d66df1cfce6f251589fea3ad3da4f3ef4e34b2d58c6a3"}, {file = "lxml-4.9.3-pp37-pypy37_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c2006f5c8d28dee289f7020f721354362fa304acbaaf9745751ac4006650254b"}, {file = "lxml-4.9.3-pp38-pypy38_pp73-macosx_11_0_x86_64.whl", hash = "sha256:5c245b783db29c4e4fbbbfc9c5a78be496c9fea25517f90606aa1f6b2b3d5f7b"}, {file = "lxml-4.9.3-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:4fb960a632a49f2f089d522f70496640fdf1218f1243889da3822e0a9f5f3ba7"}, - {file = "lxml-4.9.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:50670615eaf97227d5dc60de2dc99fb134a7130d310d783314e7724bf163f75d"}, {file = "lxml-4.9.3-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:9719fe17307a9e814580af1f5c6e05ca593b12fb7e44fe62450a5384dbf61b4b"}, {file = "lxml-4.9.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:3331bece23c9ee066e0fb3f96c61322b9e0f54d775fccefff4c38ca488de283a"}, {file = "lxml-4.9.3-pp39-pypy39_pp73-macosx_11_0_x86_64.whl", hash = "sha256:ed667f49b11360951e201453fc3967344d0d0263aa415e1619e85ae7fd17b4e0"}, {file = "lxml-4.9.3-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:8b77946fd508cbf0fccd8e400a7f71d4ac0e1595812e66025bac475a8e811694"}, - {file = "lxml-4.9.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:e4da8ca0c0c0aea88fd46be8e44bd49716772358d648cce45fe387f7b92374a7"}, {file = "lxml-4.9.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:fe4bda6bd4340caa6e5cf95e73f8fea5c4bfc55763dd42f1b50a94c1b4a2fbd4"}, {file = "lxml-4.9.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:f3df3db1d336b9356dd3112eae5f5c2b8b377f3bc826848567f10bfddfee77e9"}, {file = "lxml-4.9.3.tar.gz", hash = "sha256:48628bd53a426c9eb9bc066a923acaa0878d1e86129fd5359aee99285f4eed9c"}, @@ -5158,17 +5214,6 @@ files = [ {file = "psycopg_binary-3.1.12-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:000838cb5ab7851116b462e58893a96b0f1e35864135a6283f3242a730ec45d3"}, {file = "psycopg_binary-3.1.12-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7949e1aefe339f04dbecac6aa036c9cd137a58f966c4b96ab933823c340ee12"}, {file = "psycopg_binary-3.1.12-cp311-cp311-win_amd64.whl", hash = "sha256:b32922872460575083487de41e17e8cf308c3550da02c704efe42960bc6c19de"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:70054ada2f890d004dc3d5ff908e34aecb085fd599d40db2975c09a39c50dfc3"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7544d6d74f5b5f9daafe8a4ed7d266787d62a2bf16f5120c45d42d1f4a856bc8"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:43197161099cb4e36a9ca44c10657908b619d7263ffcff30932ad4627430dc3c"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:68398cdf3aedd4042b1126b9aba34615f1ab592831483282f19f0159fce5ca75"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:77ae6cda3ffee2425aca9ea7af57296d0c701e2ac5897b48b95dfee050234592"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:278e8888e90fb6ebd7eae8ccb85199eafd712b734e641e0d40f2a903e946102d"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:047c4ba8d3089465b0a69c4c669128df43403867858d78da6b40b33788bfa89f"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8248b11ac490bb74de80457ab0e9cef31c08164ff7b867031927a17e5c9e19ed"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6979c02acb9783c6134ee516751b8f891a2d4db7f73ebecc9e92750283d6fb99"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:eaf2375b724ad61ee82a5c2a849e57b12b3cb510ec8845084132bbb907cb3335"}, - {file = "psycopg_binary-3.1.12-cp312-cp312-win_amd64.whl", hash = "sha256:6177cfa6f872a9cc84dbfc7dc163af6ef01639c50acc9a441673f29c2305c37a"}, {file = "psycopg_binary-3.1.12-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b81427fd5a97c9b4ac12f3b8d985870b0c3866b5fc2e72e51cacd3630ffd6466"}, {file = "psycopg_binary-3.1.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f17a2c393879aa54f840540009d0e70a30d22ffa0038d81e258ac2c99b15d74"}, {file = "psycopg_binary-3.1.12-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6c6a5d125a61101ef5ab7384206e43952fe2a5fca997b96d28a28a752512f900"}, @@ -5437,6 +5482,47 @@ files = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] +[[package]] +name = "pycryptodome" +version = "3.19.0" +description = "Cryptographic library for Python" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "pycryptodome-3.19.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:3006c44c4946583b6de24fe0632091c2653d6256b99a02a3db71ca06472ea1e4"}, + {file = "pycryptodome-3.19.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:7c760c8a0479a4042111a8dd2f067d3ae4573da286c53f13cf6f5c53a5c1f631"}, + {file = "pycryptodome-3.19.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:08ce3558af5106c632baf6d331d261f02367a6bc3733086ae43c0f988fe042db"}, + {file = "pycryptodome-3.19.0-cp27-cp27m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45430dfaf1f421cf462c0dd824984378bef32b22669f2635cb809357dbaab405"}, + {file = "pycryptodome-3.19.0-cp27-cp27m-musllinux_1_1_aarch64.whl", hash = "sha256:a9bcd5f3794879e91970f2bbd7d899780541d3ff439d8f2112441769c9f2ccea"}, + {file = "pycryptodome-3.19.0-cp27-cp27m-win32.whl", hash = "sha256:190c53f51e988dceb60472baddce3f289fa52b0ec38fbe5fd20dd1d0f795c551"}, + {file = "pycryptodome-3.19.0-cp27-cp27m-win_amd64.whl", hash = "sha256:22e0ae7c3a7f87dcdcf302db06ab76f20e83f09a6993c160b248d58274473bfa"}, + {file = "pycryptodome-3.19.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:7822f36d683f9ad7bc2145b2c2045014afdbbd1d9922a6d4ce1cbd6add79a01e"}, + {file = "pycryptodome-3.19.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:05e33267394aad6db6595c0ce9d427fe21552f5425e116a925455e099fdf759a"}, + {file = "pycryptodome-3.19.0-cp27-cp27mu-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:829b813b8ee00d9c8aba417621b94bc0b5efd18c928923802ad5ba4cf1ec709c"}, + {file = "pycryptodome-3.19.0-cp27-cp27mu-musllinux_1_1_aarch64.whl", hash = "sha256:fc7a79590e2b5d08530175823a242de6790abc73638cc6dc9d2684e7be2f5e49"}, + {file = "pycryptodome-3.19.0-cp35-abi3-macosx_10_9_universal2.whl", hash = "sha256:542f99d5026ac5f0ef391ba0602f3d11beef8e65aae135fa5b762f5ebd9d3bfb"}, + {file = "pycryptodome-3.19.0-cp35-abi3-macosx_10_9_x86_64.whl", hash = "sha256:61bb3ccbf4bf32ad9af32da8badc24e888ae5231c617947e0f5401077f8b091f"}, + {file = "pycryptodome-3.19.0-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d49a6c715d8cceffedabb6adb7e0cbf41ae1a2ff4adaeec9432074a80627dea1"}, + {file = "pycryptodome-3.19.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e249a784cc98a29c77cea9df54284a44b40cafbfae57636dd2f8775b48af2434"}, + {file = "pycryptodome-3.19.0-cp35-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d033947e7fd3e2ba9a031cb2d267251620964705a013c5a461fa5233cc025270"}, + {file = "pycryptodome-3.19.0-cp35-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:84c3e4fffad0c4988aef0d5591be3cad4e10aa7db264c65fadbc633318d20bde"}, + {file = "pycryptodome-3.19.0-cp35-abi3-musllinux_1_1_i686.whl", hash = "sha256:139ae2c6161b9dd5d829c9645d781509a810ef50ea8b657e2257c25ca20efe33"}, + {file = "pycryptodome-3.19.0-cp35-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:5b1986c761258a5b4332a7f94a83f631c1ffca8747d75ab8395bf2e1b93283d9"}, + {file = "pycryptodome-3.19.0-cp35-abi3-win32.whl", hash = "sha256:536f676963662603f1f2e6ab01080c54d8cd20f34ec333dcb195306fa7826997"}, + {file = "pycryptodome-3.19.0-cp35-abi3-win_amd64.whl", hash = "sha256:04dd31d3b33a6b22ac4d432b3274588917dcf850cc0c51c84eca1d8ed6933810"}, + {file = "pycryptodome-3.19.0-pp27-pypy_73-manylinux2010_x86_64.whl", hash = "sha256:8999316e57abcbd8085c91bc0ef75292c8618f41ca6d2b6132250a863a77d1e7"}, + {file = "pycryptodome-3.19.0-pp27-pypy_73-win32.whl", hash = "sha256:a0ab84755f4539db086db9ba9e9f3868d2e3610a3948cbd2a55e332ad83b01b0"}, + {file = "pycryptodome-3.19.0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:0101f647d11a1aae5a8ce4f5fad6644ae1b22bb65d05accc7d322943c69a74a6"}, + {file = "pycryptodome-3.19.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c1601e04d32087591d78e0b81e1e520e57a92796089864b20e5f18c9564b3fa"}, + {file = "pycryptodome-3.19.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:506c686a1eee6c00df70010be3b8e9e78f406af4f21b23162bbb6e9bdf5427bc"}, + {file = "pycryptodome-3.19.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7919ccd096584b911f2a303c593280869ce1af9bf5d36214511f5e5a1bed8c34"}, + {file = "pycryptodome-3.19.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:560591c0777f74a5da86718f70dfc8d781734cf559773b64072bbdda44b3fc3e"}, + {file = "pycryptodome-3.19.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1cc2f2ae451a676def1a73c1ae9120cd31af25db3f381893d45f75e77be2400"}, + {file = "pycryptodome-3.19.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:17940dcf274fcae4a54ec6117a9ecfe52907ed5e2e438fe712fe7ca502672ed5"}, + {file = "pycryptodome-3.19.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:d04f5f623a280fbd0ab1c1d8ecbd753193ab7154f09b6161b0f857a1a676c15f"}, + {file = "pycryptodome-3.19.0.tar.gz", hash = "sha256:bc35d463222cdb4dbebd35e0784155c81e161b9284e567e7e933d722e533331e"}, +] + [[package]] name = "pydantic" version = "1.10.13" @@ -6068,6 +6154,21 @@ urllib3 = ">=1.26.14,<2.0.0" [package.extras] fastembed = ["fastembed (==0.1.1)"] +[[package]] +name = "qianfan" +version = "0.0.5" +description = "文心千帆大模型平台 Python SDK" +optional = false +python-versions = ">=3.7,<4" +files = [ + {file = "qianfan-0.0.5-py3-none-any.whl", hash = "sha256:7593d70ff6ccf3f83139b8303b5704ab543ff98635a56191495b9e6e5544cb74"}, +] + +[package.dependencies] +aiohttp = ">=3.7.0" +erniebot = ">=0.1.0" +requests = ">=2.24" + [[package]] name = "rapidfuzz" version = "3.4.0" @@ -6545,11 +6646,6 @@ files = [ {file = "scikit_learn-1.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f66eddfda9d45dd6cadcd706b65669ce1df84b8549875691b1f403730bdef217"}, {file = "scikit_learn-1.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c6448c37741145b241eeac617028ba6ec2119e1339b1385c9720dae31367f2be"}, {file = "scikit_learn-1.3.1-cp311-cp311-win_amd64.whl", hash = "sha256:c413c2c850241998168bbb3bd1bb59ff03b1195a53864f0b80ab092071af6028"}, - {file = "scikit_learn-1.3.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ef540e09873e31569bc8b02c8a9f745ee04d8e1263255a15c9969f6f5caa627f"}, - {file = "scikit_learn-1.3.1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:9147a3a4df4d401e618713880be023e36109c85d8569b3bf5377e6cd3fecdeac"}, - {file = "scikit_learn-1.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d2cd3634695ad192bf71645702b3df498bd1e246fc2d529effdb45a06ab028b4"}, - {file = "scikit_learn-1.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0c275a06c5190c5ce00af0acbb61c06374087949f643ef32d355ece12c4db043"}, - {file = "scikit_learn-1.3.1-cp312-cp312-win_amd64.whl", hash = "sha256:0e1aa8f206d0de814b81b41d60c1ce31f7f2c7354597af38fae46d9c47c45122"}, {file = "scikit_learn-1.3.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:52b77cc08bd555969ec5150788ed50276f5ef83abb72e6f469c5b91a0009bbca"}, {file = "scikit_learn-1.3.1-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:a683394bc3f80b7c312c27f9b14ebea7766b1f0a34faf1a2e9158d80e860ec26"}, {file = "scikit_learn-1.3.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a15d964d9eb181c79c190d3dbc2fff7338786bf017e9039571418a1d53dab236"}, @@ -6849,7 +6945,7 @@ files = [ ] [package.dependencies] -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\")"} +greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platform_machine == \"win32\" or platform_machine == \"WIN32\" or platform_machine == \"AMD64\" or platform_machine == \"amd64\" or platform_machine == \"x86_64\" or platform_machine == \"ppc64le\" or platform_machine == \"aarch64\")"} [package.extras] aiomysql = ["aiomysql", "greenlet (!=0.4.17)"] @@ -8458,4 +8554,4 @@ local = ["ctransformers", "llama-cpp-python", "sentence-transformers"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.11" -content-hash = "e73e8329de64dc27673bdfcd7645501fd012d8f31b480d34f9169f2053b5c5aa" +content-hash = "307bf0028ee219646de2ae1c839567d0084a59756ccd831484774ed3f24e122e" diff --git a/pyproject.toml b/pyproject.toml index e968f1e79..6d443f937 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ google-search-results = "^2.4.1" google-api-python-client = "^2.79.0" typer = "^0.9.0" gunicorn = "^21.2.0" -langchain = "^0.0.308" +langchain = "^0.0.312" openai = "^0.27.8" pandas = "2.0.3" chromadb = "^0.3.21" @@ -91,6 +91,7 @@ pillow = "^10.0.0" metal-sdk = "^2.2.0" markupsafe = "^2.1.3" numexpr = "^2.8.6" +qianfan = "0.0.5" [tool.poetry.group.dev.dependencies] diff --git a/src/backend/langflow/components/llms/BaiduQianfanChatEndpoints.py b/src/backend/langflow/components/llms/BaiduQianfanChatEndpoints.py new file mode 100644 index 000000000..1ea679b47 --- /dev/null +++ b/src/backend/langflow/components/llms/BaiduQianfanChatEndpoints.py @@ -0,0 +1,92 @@ +from typing import Optional +from langflow import CustomComponent +from langchain.chat_models.baidu_qianfan_endpoint import QianfanChatEndpoint +from langchain.llms.base import BaseLLM + + +class QianfanChatEndpointComponent(CustomComponent): + display_name: str = "QianfanChatEndpoint" + description: str = ( + "Baidu Qianfan chat models. Get more detail from " + "https://python.langchain.com/docs/integrations/chat/baidu_qianfan_endpoint." + ) + + def build_config(self): + return { + "model": { + "display_name": "Model Name", + "options": [ + "ERNIE-Bot", + "ERNIE-Bot-turbo", + "BLOOMZ-7B", + "Llama-2-7b-chat", + "Llama-2-13b-chat", + "Llama-2-70b-chat", + "Qianfan-BLOOMZ-7B-compressed", + "Qianfan-Chinese-Llama-2-7B", + "ChatGLM2-6B-32K", + "AquilaChat-7B", + ], + "info": "https://python.langchain.com/docs/integrations/chat/baidu_qianfan_endpoint", + "required": True, + }, + "qianfan_ak": { + "display_name": "Qianfan Ak", + "required": True, + "password": True, + "info": "which you could get from https://cloud.baidu.com/product/wenxinworkshop", + }, + "qianfan_sk": { + "display_name": "Qianfan Sk", + "required": True, + "password": True, + "info": "which you could get from https://cloud.baidu.com/product/wenxinworkshop", + }, + "top_p": { + "display_name": "Top p", + "field_type": "float", + "info": "Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo", + "value": 0.8, + }, + "temperature": { + "display_name": "Temperature", + "field_type": "float", + "info": "Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo", + "value": 0.95, + }, + "penalty_score": { + "display_name": "Penalty Score", + "field_type": "float", + "info": "Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo", + "value": 1.0, + }, + "endpoint": { + "display_name": "Endpoint", + "info": "Endpoint of the Qianfan LLM, required if custom model used.", + }, + "code": {"show": False}, + } + + def build( + self, + model: str = "ERNIE-Bot-turbo", + qianfan_ak: Optional[str] = None, + qianfan_sk: Optional[str] = None, + top_p: Optional[float] = None, + temperature: Optional[float] = None, + penalty_score: Optional[float] = None, + endpoint: Optional[str] = None, + ) -> BaseLLM: + try: + output = QianfanChatEndpoint( # type: ignore + model=model, + qianfan_ak=qianfan_ak, + qianfan_sk=qianfan_sk, + top_p=top_p, + temperature=temperature, + penalty_score=penalty_score, + endpoint=endpoint, + ) + except Exception as e: + raise ValueError("Could not connect to Baidu Qianfan API.") from e + return output # type: ignore diff --git a/src/backend/langflow/components/llms/BaiduQianfanLLMEndpoints.py b/src/backend/langflow/components/llms/BaiduQianfanLLMEndpoints.py new file mode 100644 index 000000000..786c4516b --- /dev/null +++ b/src/backend/langflow/components/llms/BaiduQianfanLLMEndpoints.py @@ -0,0 +1,92 @@ +from typing import Optional +from langflow import CustomComponent +from langchain.llms.baidu_qianfan_endpoint import QianfanLLMEndpoint +from langchain.llms.base import BaseLLM + + +class QianfanLLMEndpointComponent(CustomComponent): + display_name: str = "QianfanLLMEndpoint" + description: str = ( + "Baidu Qianfan hosted open source or customized models. " + "Get more detail from https://python.langchain.com/docs/integrations/chat/baidu_qianfan_endpoint" + ) + + def build_config(self): + return { + "model": { + "display_name": "Model Name", + "options": [ + "ERNIE-Bot", + "ERNIE-Bot-turbo", + "BLOOMZ-7B", + "Llama-2-7b-chat", + "Llama-2-13b-chat", + "Llama-2-70b-chat", + "Qianfan-BLOOMZ-7B-compressed", + "Qianfan-Chinese-Llama-2-7B", + "ChatGLM2-6B-32K", + "AquilaChat-7B", + ], + "info": "https://python.langchain.com/docs/integrations/chat/baidu_qianfan_endpoint", + "required": True, + }, + "qianfan_ak": { + "display_name": "Qianfan Ak", + "required": True, + "password": True, + "info": "which you could get from https://cloud.baidu.com/product/wenxinworkshop", + }, + "qianfan_sk": { + "display_name": "Qianfan Sk", + "required": True, + "password": True, + "info": "which you could get from https://cloud.baidu.com/product/wenxinworkshop", + }, + "top_p": { + "display_name": "Top p", + "field_type": "float", + "info": "Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo", + "value": 0.8, + }, + "temperature": { + "display_name": "Temperature", + "field_type": "float", + "info": "Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo", + "value": 0.95, + }, + "penalty_score": { + "display_name": "Penalty Score", + "field_type": "float", + "info": "Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo", + "value": 1.0, + }, + "endpoint": { + "display_name": "Endpoint", + "info": "Endpoint of the Qianfan LLM, required if custom model used.", + }, + "code": {"show": False}, + } + + def build( + self, + model: str = "ERNIE-Bot-turbo", + qianfan_ak: Optional[str] = None, + qianfan_sk: Optional[str] = None, + top_p: Optional[float] = None, + temperature: Optional[float] = None, + penalty_score: Optional[float] = None, + endpoint: Optional[str] = None, + ) -> BaseLLM: + try: + output = QianfanLLMEndpoint( # type: ignore + model=model, + qianfan_ak=qianfan_ak, + qianfan_sk=qianfan_sk, + top_p=top_p, + temperature=temperature, + penalty_score=penalty_score, + endpoint=endpoint, + ) + except Exception as e: + raise ValueError("Could not connect to Baidu Qianfan API.") from e + return output # type: ignore diff --git a/src/backend/langflow/template/frontend_node/base.py b/src/backend/langflow/template/frontend_node/base.py index 36d651e78..4f8b6ad7e 100644 --- a/src/backend/langflow/template/frontend_node/base.py +++ b/src/backend/langflow/template/frontend_node/base.py @@ -44,7 +44,7 @@ class FieldFormatters(BaseModel): class FrontendNode(BaseModel): template: Template - description: str + description: Optional[str] = None base_classes: List[str] name: str = "" display_name: str = "" diff --git a/src/frontend/tests/onlyFront/assets/collection.json b/src/frontend/tests/onlyFront/assets/collection.json new file mode 100644 index 000000000..3872089d0 --- /dev/null +++ b/src/frontend/tests/onlyFront/assets/collection.json @@ -0,0 +1,2684 @@ +{ + "flows": [ + { + "name": "Getting Started: Simple python function applied to each output", + "description": "Use this Tool on every query", + "data": { + "nodes": [ + { + "width": 384, + "height": 631, + "id": "ChatOpenAI-Hz56M", + "type": "genericNode", + "position": { "x": 543.1816229116944, "y": 942.891611351432 }, + "data": { + "type": "ChatOpenAI", + "node": { + "template": { + "lc_kwargs": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "lc_kwargs", + "advanced": true, + "type": "code", + "list": false + }, + "verbose": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": false, + "password": false, + "name": "verbose", + "advanced": false, + "type": "bool", + "list": false + }, + "callbacks": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "callbacks", + "advanced": false, + "type": "langchain.callbacks.base.BaseCallbackHandler", + "list": true + }, + "client": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "client", + "advanced": false, + "type": "Any", + "list": false + }, + "model_name": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "gpt-3.5-turbo", + "password": false, + "options": [ + "gpt-3.5-turbo-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-16k-0613", + "gpt-3.5-turbo-16k", + "gpt-4-0613", + "gpt-4-32k-0613", + "gpt-4", + "gpt-4-32k" + ], + "name": "model_name", + "advanced": false, + "type": "str", + "list": true + }, + "temperature": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "0.2", + "password": false, + "name": "temperature", + "advanced": false, + "type": "float", + "list": false + }, + "model_kwargs": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "model_kwargs", + "advanced": true, + "type": "code", + "list": false + }, + "openai_api_key": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "", + "password": true, + "name": "openai_api_key", + "display_name": "OpenAI API Key", + "advanced": false, + "type": "str", + "list": false + }, + "openai_api_base": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "openai_api_base", + "display_name": "OpenAI API Base", + "advanced": false, + "type": "str", + "list": false + }, + "openai_organization": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "openai_organization", + "display_name": "OpenAI Organization", + "advanced": false, + "type": "str", + "list": false + }, + "openai_proxy": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "openai_proxy", + "display_name": "OpenAI Proxy", + "advanced": false, + "type": "str", + "list": false + }, + "request_timeout": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "request_timeout", + "advanced": false, + "type": "float", + "list": false + }, + "max_retries": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": 6, + "password": false, + "name": "max_retries", + "advanced": false, + "type": "int", + "list": false + }, + "streaming": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": false, + "password": false, + "name": "streaming", + "advanced": false, + "type": "bool", + "list": false + }, + "n": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": 1, + "password": false, + "name": "n", + "advanced": false, + "type": "int", + "list": false + }, + "max_tokens": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": true, + "name": "max_tokens", + "advanced": false, + "type": "int", + "list": false + }, + "_type": "ChatOpenAI" + }, + "description": "Wrapper around OpenAI Chat large language models.", + "base_classes": [ + "Serializable", + "BaseChatModel", + "ChatOpenAI", + "BaseLanguageModel" + ], + "display_name": "ChatOpenAI" + }, + "id": "ChatOpenAI-Hz56M", + "value": null + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 543.1816229116944, + "y": 942.891611351432 + } + }, + { + "width": 384, + "height": 387, + "id": "AgentInitializer-QiQ4x", + "type": "genericNode", + "position": { "x": 1036.6064439140812, "y": 645.1919693466587 }, + "data": { + "type": "AgentInitializer", + "node": { + "template": { + "agent": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "zero-shot-react-description", + "password": false, + "options": [ + "zero-shot-react-description", + "react-docstore", + "self-ask-with-search", + "conversational-react-description", + "openai-functions" + ], + "name": "agent", + "advanced": false, + "type": "str", + "list": true + }, + "memory": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "memory", + "advanced": false, + "type": "BaseChatMemory", + "list": false + }, + "tools": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "tools", + "advanced": false, + "type": "Tool", + "list": true + }, + "llm": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "llm", + "display_name": "LLM", + "advanced": false, + "type": "BaseLanguageModel", + "list": false + }, + "_type": "initialize_agent" + }, + "description": "Construct a zero shot agent from an LLM and tools.", + "base_classes": ["AgentExecutor", "function"], + "display_name": "AgentInitializer" + }, + "id": "AgentInitializer-QiQ4x", + "value": null + }, + "selected": false, + "positionAbsolute": { + "x": 1036.6064439140812, + "y": 645.1919693466587 + } + }, + { + "width": 384, + "height": 437, + "id": "PythonFunctionTool-kX99N", + "type": "genericNode", + "position": { "x": 553.050119331742, "y": 412.9533535948685 }, + "data": { + "type": "PythonFunctionTool", + "node": { + "template": { + "name": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "PythonFunction", + "password": false, + "name": "name", + "advanced": false, + "type": "str", + "list": false + }, + "description": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "Returns the Text you send. This is a testing tool.", + "password": false, + "name": "description", + "advanced": false, + "type": "str", + "list": false + }, + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "\ndef python_function(text: str) -> str:\n \"\"\"This is a default python function that returns the input text\"\"\"\n return text\n", + "password": false, + "name": "code", + "advanced": false, + "type": "code", + "list": false + }, + "_type": "PythonFunctionTool" + }, + "description": "Python function to be executed.", + "base_classes": ["Tool"], + "display_name": "PythonFunctionTool" + }, + "id": "PythonFunctionTool-kX99N", + "value": null + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 553.050119331742, + "y": 412.9533535948685 + } + } + ], + "edges": [ + { + "source": "ChatOpenAI-Hz56M", + "sourceHandle": "{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-Hz56Mœ}", + "target": "AgentInitializer-QiQ4x", + "targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-QiQ4xœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}", + "style": { "stroke": "#555" }, + "className": "stroke-gray-900 stroke-connection", + "animated": false, + "id": "reactflow__edge-ChatOpenAI-Hz56M{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-Hz56Mœ}-AgentInitializer-QiQ4x{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-QiQ4xœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}", + "selected": false, + "data": { + "sourceHandle": { + "baseClasses": [ + "Serializable", + "BaseChatModel", + "ChatOpenAI", + "BaseLanguageModel" + ], + "dataType": "ChatOpenAI", + "id": "ChatOpenAI-Hz56M" + }, + "targetHandle": { + "fieldName": "llm", + "id": "AgentInitializer-QiQ4x", + "inputTypes": null, + "type": "BaseLanguageModel" + } + } + }, + { + "source": "PythonFunctionTool-kX99N", + "sourceHandle": "{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-kX99Nœ}", + "target": "AgentInitializer-QiQ4x", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-QiQ4xœ,œinputTypesœ:null,œtypeœ:œToolœ}", + "style": { "stroke": "#555" }, + "className": "stroke-gray-900 stroke-connection", + "animated": false, + "id": "reactflow__edge-PythonFunctionTool-kX99N{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-kX99Nœ}-AgentInitializer-QiQ4x{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-QiQ4xœ,œinputTypesœ:null,œtypeœ:œToolœ}", + "selected": false, + "data": { + "sourceHandle": { + "baseClasses": ["Tool"], + "dataType": "PythonFunctionTool", + "id": "PythonFunctionTool-kX99N" + }, + "targetHandle": { + "fieldName": "tools", + "id": "AgentInitializer-QiQ4x", + "inputTypes": null, + "type": "Tool" + } + } + } + ], + "viewport": { + "x": 4.748095479939138, + "y": -155.65184647754464, + "zoom": 0.6079953565987085 + } + }, + "id": "f14cca63-91ff-4769-bdc3-268639d39d93", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Playful Curie", + "description": "Unleashing Linguistic Creativity.", + "data": { + "nodes": [ + { + "id": "CustomComponent-w4WCp", + "type": "genericNode", + "position": { "x": 536, "y": 337 }, + "data": { + "type": "CustomComponent", + "node": { + "template": { + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n", + "password": false, + "name": "code", + "advanced": false, + "dynamic": true, + "info": "", + "type": "code", + "list": false + }, + "_type": "CustomComponent" + }, + "description": "Create any custom component you want!", + "base_classes": [], + "display_name": "Custom Component", + "custom_fields": {}, + "output_types": [], + "documentation": "", + "beta": true, + "error": null + }, + "id": "CustomComponent-w4WCp" + }, + "positionAbsolute": { "x": 536, "y": 337 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "e43cf2c8-cd64-4936-8170-b207a8b109c4", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Getting Started: Simple python function applied to each output", + "description": "Use this Tool on every query", + "data": { + "nodes": [ + { + "width": 384, + "height": 631, + "id": "ChatOpenAI-7GFF0", + "type": "genericNode", + "position": { "x": 543.1816229116944, "y": 942.891611351432 }, + "data": { + "type": "ChatOpenAI", + "node": { + "template": { + "lc_kwargs": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "lc_kwargs", + "advanced": true, + "type": "code", + "list": false + }, + "verbose": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": false, + "password": false, + "name": "verbose", + "advanced": false, + "type": "bool", + "list": false + }, + "callbacks": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "callbacks", + "advanced": false, + "type": "langchain.callbacks.base.BaseCallbackHandler", + "list": true + }, + "client": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "client", + "advanced": false, + "type": "Any", + "list": false + }, + "model_name": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "gpt-3.5-turbo", + "password": false, + "options": [ + "gpt-3.5-turbo-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-16k-0613", + "gpt-3.5-turbo-16k", + "gpt-4-0613", + "gpt-4-32k-0613", + "gpt-4", + "gpt-4-32k" + ], + "name": "model_name", + "advanced": false, + "type": "str", + "list": true + }, + "temperature": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "0.2", + "password": false, + "name": "temperature", + "advanced": false, + "type": "float", + "list": false + }, + "model_kwargs": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "model_kwargs", + "advanced": true, + "type": "code", + "list": false + }, + "openai_api_key": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "", + "password": true, + "name": "openai_api_key", + "display_name": "OpenAI API Key", + "advanced": false, + "type": "str", + "list": false + }, + "openai_api_base": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "openai_api_base", + "display_name": "OpenAI API Base", + "advanced": false, + "type": "str", + "list": false + }, + "openai_organization": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "openai_organization", + "display_name": "OpenAI Organization", + "advanced": false, + "type": "str", + "list": false + }, + "openai_proxy": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "openai_proxy", + "display_name": "OpenAI Proxy", + "advanced": false, + "type": "str", + "list": false + }, + "request_timeout": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "request_timeout", + "advanced": false, + "type": "float", + "list": false + }, + "max_retries": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": 6, + "password": false, + "name": "max_retries", + "advanced": false, + "type": "int", + "list": false + }, + "streaming": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": false, + "password": false, + "name": "streaming", + "advanced": false, + "type": "bool", + "list": false + }, + "n": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": 1, + "password": false, + "name": "n", + "advanced": false, + "type": "int", + "list": false + }, + "max_tokens": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": true, + "name": "max_tokens", + "advanced": false, + "type": "int", + "list": false + }, + "_type": "ChatOpenAI" + }, + "description": "Wrapper around OpenAI Chat large language models.", + "base_classes": [ + "Serializable", + "BaseChatModel", + "ChatOpenAI", + "BaseLanguageModel" + ], + "display_name": "ChatOpenAI" + }, + "id": "ChatOpenAI-7GFF0", + "value": null + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 543.1816229116944, + "y": 942.891611351432 + } + }, + { + "width": 384, + "height": 387, + "id": "AgentInitializer-YJgqs", + "type": "genericNode", + "position": { "x": 1036.6064439140812, "y": 645.1919693466587 }, + "data": { + "type": "AgentInitializer", + "node": { + "template": { + "agent": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "zero-shot-react-description", + "password": false, + "options": [ + "zero-shot-react-description", + "react-docstore", + "self-ask-with-search", + "conversational-react-description", + "openai-functions" + ], + "name": "agent", + "advanced": false, + "type": "str", + "list": true + }, + "memory": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "memory", + "advanced": false, + "type": "BaseChatMemory", + "list": false + }, + "tools": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "tools", + "advanced": false, + "type": "Tool", + "list": true + }, + "llm": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "llm", + "display_name": "LLM", + "advanced": false, + "type": "BaseLanguageModel", + "list": false + }, + "_type": "initialize_agent" + }, + "description": "Construct a zero shot agent from an LLM and tools.", + "base_classes": ["AgentExecutor", "function"], + "display_name": "AgentInitializer" + }, + "id": "AgentInitializer-YJgqs", + "value": null + }, + "selected": false, + "positionAbsolute": { + "x": 1036.6064439140812, + "y": 645.1919693466587 + } + }, + { + "width": 384, + "height": 437, + "id": "PythonFunctionTool-gqQDg", + "type": "genericNode", + "position": { "x": 553.050119331742, "y": 412.9533535948685 }, + "data": { + "type": "PythonFunctionTool", + "node": { + "template": { + "name": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "PythonFunction", + "password": false, + "name": "name", + "advanced": false, + "type": "str", + "list": false + }, + "description": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "Returns the Text you send. This is a testing tool.", + "password": false, + "name": "description", + "advanced": false, + "type": "str", + "list": false + }, + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "\ndef python_function(text: str) -> str:\n \"\"\"This is a default python function that returns the input text\"\"\"\n return text\n", + "password": false, + "name": "code", + "advanced": false, + "type": "code", + "list": false + }, + "_type": "PythonFunctionTool" + }, + "description": "Python function to be executed.", + "base_classes": ["Tool"], + "display_name": "PythonFunctionTool" + }, + "id": "PythonFunctionTool-gqQDg", + "value": null + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 553.050119331742, + "y": 412.9533535948685 + } + } + ], + "edges": [ + { + "source": "ChatOpenAI-7GFF0", + "sourceHandle": "{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-7GFF0œ}", + "target": "AgentInitializer-YJgqs", + "targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-YJgqsœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}", + "style": { "stroke": "#555" }, + "className": "stroke-gray-900 stroke-connection", + "animated": false, + "id": "reactflow__edge-ChatOpenAI-7GFF0{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-7GFF0œ}-AgentInitializer-YJgqs{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-YJgqsœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}", + "selected": false, + "data": { + "sourceHandle": { + "baseClasses": [ + "Serializable", + "BaseChatModel", + "ChatOpenAI", + "BaseLanguageModel" + ], + "dataType": "ChatOpenAI", + "id": "ChatOpenAI-7GFF0" + }, + "targetHandle": { + "fieldName": "llm", + "id": "AgentInitializer-YJgqs", + "inputTypes": null, + "type": "BaseLanguageModel" + } + } + }, + { + "source": "PythonFunctionTool-gqQDg", + "sourceHandle": "{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-gqQDgœ}", + "target": "AgentInitializer-YJgqs", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-YJgqsœ,œinputTypesœ:null,œtypeœ:œToolœ}", + "style": { "stroke": "#555" }, + "className": "stroke-gray-900 stroke-connection", + "animated": false, + "id": "reactflow__edge-PythonFunctionTool-gqQDg{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-gqQDgœ}-AgentInitializer-YJgqs{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-YJgqsœ,œinputTypesœ:null,œtypeœ:œToolœ}", + "selected": false, + "data": { + "sourceHandle": { + "baseClasses": ["Tool"], + "dataType": "PythonFunctionTool", + "id": "PythonFunctionTool-gqQDg" + }, + "targetHandle": { + "fieldName": "tools", + "id": "AgentInitializer-YJgqs", + "inputTypes": null, + "type": "Tool" + } + } + } + ], + "viewport": { + "x": 4.748095479939138, + "y": -155.65184647754464, + "zoom": 0.6079953565987085 + } + }, + "id": "e8b581f0-f41d-4e5c-8f6b-2893aeeb0398", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Sprightly Babbage", + "description": "Unravel the Art of Articulation.", + "data": { + "nodes": [ + { + "id": "CustomComponent-iF9Zr", + "type": "genericNode", + "position": { "x": 536, "y": 337 }, + "data": { + "type": "CustomComponent", + "node": { + "template": { + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n", + "password": false, + "name": "code", + "advanced": false, + "dynamic": true, + "info": "", + "type": "code", + "list": false + }, + "_type": "CustomComponent" + }, + "description": "Create any custom component you want!", + "base_classes": [], + "display_name": "Custom Component", + "custom_fields": {}, + "output_types": [], + "documentation": "", + "beta": true, + "error": null + }, + "id": "CustomComponent-iF9Zr" + }, + "positionAbsolute": { "x": 536, "y": 337 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "88a0e6a1-8144-4bff-b28c-d312ae5c8a10", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Getting Started: Simple python function applied to each output", + "description": "Use this Tool on every query", + "data": { + "nodes": [ + { + "width": 384, + "height": 631, + "id": "ChatOpenAI-cljAK", + "type": "genericNode", + "position": { "x": 543.1816229116944, "y": 942.891611351432 }, + "data": { + "type": "ChatOpenAI", + "node": { + "template": { + "lc_kwargs": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "lc_kwargs", + "advanced": true, + "type": "code", + "list": false + }, + "verbose": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": false, + "password": false, + "name": "verbose", + "advanced": false, + "type": "bool", + "list": false + }, + "callbacks": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "callbacks", + "advanced": false, + "type": "langchain.callbacks.base.BaseCallbackHandler", + "list": true + }, + "client": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "client", + "advanced": false, + "type": "Any", + "list": false + }, + "model_name": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "gpt-3.5-turbo", + "password": false, + "options": [ + "gpt-3.5-turbo-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-16k-0613", + "gpt-3.5-turbo-16k", + "gpt-4-0613", + "gpt-4-32k-0613", + "gpt-4", + "gpt-4-32k" + ], + "name": "model_name", + "advanced": false, + "type": "str", + "list": true + }, + "temperature": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "0.2", + "password": false, + "name": "temperature", + "advanced": false, + "type": "float", + "list": false + }, + "model_kwargs": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "model_kwargs", + "advanced": true, + "type": "code", + "list": false + }, + "openai_api_key": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "", + "password": true, + "name": "openai_api_key", + "display_name": "OpenAI API Key", + "advanced": false, + "type": "str", + "list": false + }, + "openai_api_base": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "openai_api_base", + "display_name": "OpenAI API Base", + "advanced": false, + "type": "str", + "list": false + }, + "openai_organization": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "openai_organization", + "display_name": "OpenAI Organization", + "advanced": false, + "type": "str", + "list": false + }, + "openai_proxy": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "openai_proxy", + "display_name": "OpenAI Proxy", + "advanced": false, + "type": "str", + "list": false + }, + "request_timeout": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "request_timeout", + "advanced": false, + "type": "float", + "list": false + }, + "max_retries": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": 6, + "password": false, + "name": "max_retries", + "advanced": false, + "type": "int", + "list": false + }, + "streaming": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": false, + "password": false, + "name": "streaming", + "advanced": false, + "type": "bool", + "list": false + }, + "n": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": 1, + "password": false, + "name": "n", + "advanced": false, + "type": "int", + "list": false + }, + "max_tokens": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": true, + "name": "max_tokens", + "advanced": false, + "type": "int", + "list": false + }, + "_type": "ChatOpenAI" + }, + "description": "Wrapper around OpenAI Chat large language models.", + "base_classes": [ + "Serializable", + "BaseChatModel", + "ChatOpenAI", + "BaseLanguageModel" + ], + "display_name": "ChatOpenAI" + }, + "id": "ChatOpenAI-cljAK", + "value": null + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 543.1816229116944, + "y": 942.891611351432 + } + }, + { + "width": 384, + "height": 387, + "id": "AgentInitializer-grV0u", + "type": "genericNode", + "position": { "x": 1036.6064439140812, "y": 645.1919693466587 }, + "data": { + "type": "AgentInitializer", + "node": { + "template": { + "agent": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "zero-shot-react-description", + "password": false, + "options": [ + "zero-shot-react-description", + "react-docstore", + "self-ask-with-search", + "conversational-react-description", + "openai-functions" + ], + "name": "agent", + "advanced": false, + "type": "str", + "list": true + }, + "memory": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "memory", + "advanced": false, + "type": "BaseChatMemory", + "list": false + }, + "tools": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "tools", + "advanced": false, + "type": "Tool", + "list": true + }, + "llm": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "llm", + "display_name": "LLM", + "advanced": false, + "type": "BaseLanguageModel", + "list": false + }, + "_type": "initialize_agent" + }, + "description": "Construct a zero shot agent from an LLM and tools.", + "base_classes": ["AgentExecutor", "function"], + "display_name": "AgentInitializer" + }, + "id": "AgentInitializer-grV0u", + "value": null + }, + "selected": false, + "positionAbsolute": { + "x": 1036.6064439140812, + "y": 645.1919693466587 + } + }, + { + "width": 384, + "height": 437, + "id": "PythonFunctionTool-SctM2", + "type": "genericNode", + "position": { "x": 553.050119331742, "y": 412.9533535948685 }, + "data": { + "type": "PythonFunctionTool", + "node": { + "template": { + "name": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "PythonFunction", + "password": false, + "name": "name", + "advanced": false, + "type": "str", + "list": false + }, + "description": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "Returns the Text you send. This is a testing tool.", + "password": false, + "name": "description", + "advanced": false, + "type": "str", + "list": false + }, + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "\ndef python_function(text: str) -> str:\n \"\"\"This is a default python function that returns the input text\"\"\"\n return text\n", + "password": false, + "name": "code", + "advanced": false, + "type": "code", + "list": false + }, + "_type": "PythonFunctionTool" + }, + "description": "Python function to be executed.", + "base_classes": ["Tool"], + "display_name": "PythonFunctionTool" + }, + "id": "PythonFunctionTool-SctM2", + "value": null + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 553.050119331742, + "y": 412.9533535948685 + } + } + ], + "edges": [ + { + "source": "ChatOpenAI-cljAK", + "sourceHandle": "{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-cljAKœ}", + "target": "AgentInitializer-grV0u", + "targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-grV0uœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}", + "style": { "stroke": "#555" }, + "className": "stroke-gray-900 stroke-connection", + "animated": false, + "id": "reactflow__edge-ChatOpenAI-cljAK{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-cljAKœ}-AgentInitializer-grV0u{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-grV0uœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}", + "selected": false, + "data": { + "sourceHandle": { + "baseClasses": [ + "Serializable", + "BaseChatModel", + "ChatOpenAI", + "BaseLanguageModel" + ], + "dataType": "ChatOpenAI", + "id": "ChatOpenAI-cljAK" + }, + "targetHandle": { + "fieldName": "llm", + "id": "AgentInitializer-grV0u", + "inputTypes": null, + "type": "BaseLanguageModel" + } + } + }, + { + "source": "PythonFunctionTool-SctM2", + "sourceHandle": "{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-SctM2œ}", + "target": "AgentInitializer-grV0u", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-grV0uœ,œinputTypesœ:null,œtypeœ:œToolœ}", + "style": { "stroke": "#555" }, + "className": "stroke-gray-900 stroke-connection", + "animated": false, + "id": "reactflow__edge-PythonFunctionTool-SctM2{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-SctM2œ}-AgentInitializer-grV0u{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-grV0uœ,œinputTypesœ:null,œtypeœ:œToolœ}", + "selected": false, + "data": { + "sourceHandle": { + "baseClasses": ["Tool"], + "dataType": "PythonFunctionTool", + "id": "PythonFunctionTool-SctM2" + }, + "targetHandle": { + "fieldName": "tools", + "id": "AgentInitializer-grV0u", + "inputTypes": null, + "type": "Tool" + } + } + } + ], + "viewport": { + "x": 4.748095479939138, + "y": -155.65184647754464, + "zoom": 0.6079953565987085 + } + }, + "id": "901c781e-f2d7-43c2-9814-acd39e00af88", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Gloomy Coulomb", + "description": "Create Powerful Connections, Boost Business Value.", + "data": { + "nodes": [ + { + "id": "CustomComponent-z5kAP", + "type": "genericNode", + "position": { "x": 536, "y": 337 }, + "data": { + "type": "CustomComponent", + "node": { + "template": { + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n", + "password": false, + "name": "code", + "advanced": false, + "dynamic": true, + "info": "", + "type": "code", + "list": false + }, + "_type": "CustomComponent" + }, + "description": "Create any custom component you want!", + "base_classes": [], + "display_name": "Custom Component", + "custom_fields": {}, + "output_types": [], + "documentation": "", + "beta": true, + "error": null + }, + "id": "CustomComponent-z5kAP" + }, + "positionAbsolute": { "x": 536, "y": 337 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "3128b556-35c7-4ced-a834-70fbeb1a410f", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Pensive Banach", + "description": "Unleashing Business Potential through Language Engineering.", + "data": { + "nodes": [ + { + "id": "CustomComponent-ZieNZ", + "type": "genericNode", + "position": { "x": 536, "y": 337 }, + "data": { + "type": "CustomComponent", + "node": { + "template": { + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n", + "password": false, + "name": "code", + "advanced": false, + "dynamic": true, + "info": "", + "type": "code", + "list": false + }, + "_type": "CustomComponent" + }, + "description": "Create any custom component you want!", + "base_classes": [], + "display_name": "Custom Component", + "custom_fields": {}, + "output_types": [], + "documentation": "", + "beta": true, + "error": null + }, + "id": "CustomComponent-ZieNZ" + }, + "positionAbsolute": { "x": 536, "y": 337 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "d3f2c379-9df5-49a0-b33d-d855c2085949", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Tiny Carroll", + "description": "Building Intelligent Interactions.", + "data": { + "nodes": [ + { + "id": "CustomComponent-CcHG0", + "type": "genericNode", + "position": { "x": 536, "y": 337 }, + "data": { + "type": "CustomComponent", + "node": { + "template": { + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n", + "password": false, + "name": "code", + "advanced": false, + "dynamic": true, + "info": "", + "type": "code", + "list": false + }, + "_type": "CustomComponent" + }, + "description": "Create any custom component you want!", + "base_classes": [], + "display_name": "Custom Component", + "custom_fields": {}, + "output_types": [], + "documentation": "", + "beta": true, + "error": null + }, + "id": "CustomComponent-CcHG0" + }, + "positionAbsolute": { "x": 536, "y": 337 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "74afff1f-b540-43d5-bc66-d18f39d65d57", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Inquisitive Pike", + "description": "Crafting Dialogues that Drive Business Success.", + "data": { + "nodes": [ + { + "id": "CustomComponent-Q8qSr", + "type": "genericNode", + "position": { "x": 536, "y": 337 }, + "data": { + "type": "CustomComponent", + "node": { + "template": { + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n", + "password": false, + "name": "code", + "advanced": false, + "dynamic": true, + "info": "", + "type": "code", + "list": false + }, + "_type": "CustomComponent" + }, + "description": "Create any custom component you want!", + "base_classes": [], + "display_name": "Custom Component", + "custom_fields": {}, + "output_types": [], + "documentation": "", + "beta": true, + "error": null + }, + "id": "CustomComponent-Q8qSr" + }, + "positionAbsolute": { "x": 536, "y": 337 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "b0b1c893-6194-4748-ae10-b5f604b271c2", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Dreamy Bassi", + "description": "Crafting Conversations, One Node at a Time.", + "data": { + "nodes": [ + { + "id": "CustomComponent-Lgoca", + "type": "genericNode", + "position": { "x": 536, "y": 337 }, + "data": { + "type": "CustomComponent", + "node": { + "template": { + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n", + "password": false, + "name": "code", + "advanced": false, + "dynamic": true, + "info": "", + "type": "code", + "list": false + }, + "_type": "CustomComponent" + }, + "description": "Create any custom component you want!", + "base_classes": [], + "display_name": "Custom Component", + "custom_fields": {}, + "output_types": [], + "documentation": "", + "beta": true, + "error": null + }, + "id": "CustomComponent-Lgoca" + }, + "positionAbsolute": { "x": 536, "y": 337 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "edf1051d-509b-46a2-84c6-b94bdcdc3a4f", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Furious Faraday", + "description": "Craft Language Connections Here.", + "data": { + "nodes": [ + { + "id": "CustomComponent-6OJGW", + "type": "genericNode", + "position": { "x": 536, "y": 337 }, + "data": { + "type": "CustomComponent", + "node": { + "template": { + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n", + "password": false, + "name": "code", + "advanced": false, + "dynamic": true, + "info": "", + "type": "code", + "list": false + }, + "_type": "CustomComponent" + }, + "description": "Create any custom component you want!", + "base_classes": [], + "display_name": "Custom Component", + "custom_fields": {}, + "output_types": [], + "documentation": "", + "beta": true, + "error": null + }, + "id": "CustomComponent-6OJGW" + }, + "positionAbsolute": { "x": 536, "y": 337 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "65b2a4e0-4084-418a-aa86-ee914acb0ab5", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Optimistic Coulomb", + "description": "Empowering Language Engineering.", + "data": { + "nodes": [ + { + "id": "CustomComponent-tcE83", + "type": "genericNode", + "position": { "x": 536, "y": 337 }, + "data": { + "type": "CustomComponent", + "node": { + "template": { + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n", + "password": false, + "name": "code", + "advanced": false, + "dynamic": true, + "info": "", + "type": "code", + "list": false + }, + "_type": "CustomComponent" + }, + "description": "Create any custom component you want!", + "base_classes": [], + "display_name": "Custom Component", + "custom_fields": {}, + "output_types": [], + "documentation": "", + "beta": true, + "error": null + }, + "id": "CustomComponent-tcE83" + }, + "positionAbsolute": { "x": 536, "y": 337 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "534e412b-d37b-4133-8029-e5ed139fd55c", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Getting Started: Simple python function applied to each output", + "description": "Use this Tool on every query", + "data": { + "nodes": [ + { + "width": 384, + "height": 631, + "id": "ChatOpenAI-mQEi3", + "type": "genericNode", + "position": { "x": 543.1816229116944, "y": 942.891611351432 }, + "data": { + "type": "ChatOpenAI", + "node": { + "template": { + "lc_kwargs": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "lc_kwargs", + "advanced": true, + "type": "code", + "list": false + }, + "verbose": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": false, + "password": false, + "name": "verbose", + "advanced": false, + "type": "bool", + "list": false + }, + "callbacks": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "callbacks", + "advanced": false, + "type": "langchain.callbacks.base.BaseCallbackHandler", + "list": true + }, + "client": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "client", + "advanced": false, + "type": "Any", + "list": false + }, + "model_name": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "gpt-3.5-turbo", + "password": false, + "options": [ + "gpt-3.5-turbo-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-16k-0613", + "gpt-3.5-turbo-16k", + "gpt-4-0613", + "gpt-4-32k-0613", + "gpt-4", + "gpt-4-32k" + ], + "name": "model_name", + "advanced": false, + "type": "str", + "list": true + }, + "temperature": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "0.2", + "password": false, + "name": "temperature", + "advanced": false, + "type": "float", + "list": false + }, + "model_kwargs": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "model_kwargs", + "advanced": true, + "type": "code", + "list": false + }, + "openai_api_key": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "", + "password": true, + "name": "openai_api_key", + "display_name": "OpenAI API Key", + "advanced": false, + "type": "str", + "list": false + }, + "openai_api_base": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "openai_api_base", + "display_name": "OpenAI API Base", + "advanced": false, + "type": "str", + "list": false + }, + "openai_organization": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "openai_organization", + "display_name": "OpenAI Organization", + "advanced": false, + "type": "str", + "list": false + }, + "openai_proxy": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "openai_proxy", + "display_name": "OpenAI Proxy", + "advanced": false, + "type": "str", + "list": false + }, + "request_timeout": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "request_timeout", + "advanced": false, + "type": "float", + "list": false + }, + "max_retries": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": 6, + "password": false, + "name": "max_retries", + "advanced": false, + "type": "int", + "list": false + }, + "streaming": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": false, + "password": false, + "name": "streaming", + "advanced": false, + "type": "bool", + "list": false + }, + "n": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": 1, + "password": false, + "name": "n", + "advanced": false, + "type": "int", + "list": false + }, + "max_tokens": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": true, + "name": "max_tokens", + "advanced": false, + "type": "int", + "list": false + }, + "_type": "ChatOpenAI" + }, + "description": "Wrapper around OpenAI Chat large language models.", + "base_classes": [ + "Serializable", + "BaseChatModel", + "ChatOpenAI", + "BaseLanguageModel" + ], + "display_name": "ChatOpenAI" + }, + "id": "ChatOpenAI-mQEi3", + "value": null + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 543.1816229116944, + "y": 942.891611351432 + } + }, + { + "width": 384, + "height": 387, + "id": "AgentInitializer-EE8R4", + "type": "genericNode", + "position": { "x": 1036.6064439140812, "y": 645.1919693466587 }, + "data": { + "type": "AgentInitializer", + "node": { + "template": { + "agent": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "zero-shot-react-description", + "password": false, + "options": [ + "zero-shot-react-description", + "react-docstore", + "self-ask-with-search", + "conversational-react-description", + "openai-functions" + ], + "name": "agent", + "advanced": false, + "type": "str", + "list": true + }, + "memory": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "memory", + "advanced": false, + "type": "BaseChatMemory", + "list": false + }, + "tools": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "tools", + "advanced": false, + "type": "Tool", + "list": true + }, + "llm": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "llm", + "display_name": "LLM", + "advanced": false, + "type": "BaseLanguageModel", + "list": false + }, + "_type": "initialize_agent" + }, + "description": "Construct a zero shot agent from an LLM and tools.", + "base_classes": ["AgentExecutor", "function"], + "display_name": "AgentInitializer" + }, + "id": "AgentInitializer-EE8R4", + "value": null + }, + "selected": false, + "positionAbsolute": { + "x": 1036.6064439140812, + "y": 645.1919693466587 + } + }, + { + "width": 384, + "height": 437, + "id": "PythonFunctionTool-YKkDL", + "type": "genericNode", + "position": { "x": 553.050119331742, "y": 412.9533535948685 }, + "data": { + "type": "PythonFunctionTool", + "node": { + "template": { + "name": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "PythonFunction", + "password": false, + "name": "name", + "advanced": false, + "type": "str", + "list": false + }, + "description": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "Returns the Text you send. This is a testing tool.", + "password": false, + "name": "description", + "advanced": false, + "type": "str", + "list": false + }, + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "\ndef python_function(text: str) -> str:\n \"\"\"This is a default python function that returns the input text\"\"\"\n return text\n", + "password": false, + "name": "code", + "advanced": false, + "type": "code", + "list": false + }, + "_type": "PythonFunctionTool" + }, + "description": "Python function to be executed.", + "base_classes": ["Tool"], + "display_name": "PythonFunctionTool" + }, + "id": "PythonFunctionTool-YKkDL", + "value": null + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 553.050119331742, + "y": 412.9533535948685 + } + } + ], + "edges": [ + { + "source": "ChatOpenAI-mQEi3", + "sourceHandle": "{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-mQEi3œ}", + "target": "AgentInitializer-EE8R4", + "targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-EE8R4œ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}", + "style": { "stroke": "#555" }, + "className": "stroke-gray-900 stroke-connection", + "animated": false, + "id": "reactflow__edge-ChatOpenAI-mQEi3{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-mQEi3œ}-AgentInitializer-EE8R4{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-EE8R4œ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}", + "selected": false, + "data": { + "sourceHandle": { + "baseClasses": [ + "Serializable", + "BaseChatModel", + "ChatOpenAI", + "BaseLanguageModel" + ], + "dataType": "ChatOpenAI", + "id": "ChatOpenAI-mQEi3" + }, + "targetHandle": { + "fieldName": "llm", + "id": "AgentInitializer-EE8R4", + "inputTypes": null, + "type": "BaseLanguageModel" + } + } + }, + { + "source": "PythonFunctionTool-YKkDL", + "sourceHandle": "{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-YKkDLœ}", + "target": "AgentInitializer-EE8R4", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-EE8R4œ,œinputTypesœ:null,œtypeœ:œToolœ}", + "style": { "stroke": "#555" }, + "className": "stroke-gray-900 stroke-connection", + "animated": false, + "id": "reactflow__edge-PythonFunctionTool-YKkDL{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-YKkDLœ}-AgentInitializer-EE8R4{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-EE8R4œ,œinputTypesœ:null,œtypeœ:œToolœ}", + "selected": false, + "data": { + "sourceHandle": { + "baseClasses": ["Tool"], + "dataType": "PythonFunctionTool", + "id": "PythonFunctionTool-YKkDL" + }, + "targetHandle": { + "fieldName": "tools", + "id": "AgentInitializer-EE8R4", + "inputTypes": null, + "type": "Tool" + } + } + } + ], + "viewport": { + "x": 4.748095479939138, + "y": -155.65184647754464, + "zoom": 0.6079953565987085 + } + }, + "id": "be3736b0-5e02-4377-bbe2-ca0b75100c24", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Perky Mendeleev", + "description": "Your Hub for Text Generation.", + "data": { + "nodes": [ + { + "id": "CustomComponent-T38LS", + "type": "genericNode", + "position": { "x": 536, "y": 337 }, + "data": { + "type": "CustomComponent", + "node": { + "template": { + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "from langflow import CustomComponent\n\nfrom langchain.llms.base import BaseLLM\nfrom langchain.chains import LLMChain\nfrom langchain.prompts import PromptTemplate\nfrom langchain.schema import Document\n\nimport requests\n\nclass YourComponent(CustomComponent):\n display_name: str = \"Custom Component\"\n description: str = \"Create any custom component you want!\"\n\n def build_config(self):\n return { \"url\": { \"multiline\": True, \"required\": True } }\n\n def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document:\n response = requests.get(url)\n chain = LLMChain(llm=llm, prompt=prompt)\n result = chain.run(response.text[:300])\n return Document(page_content=str(result))\n", + "password": false, + "name": "code", + "advanced": false, + "dynamic": true, + "info": "", + "type": "code", + "list": false + }, + "_type": "CustomComponent" + }, + "description": "Create any custom component you want!", + "base_classes": [], + "display_name": "Custom Component", + "custom_fields": {}, + "output_types": [], + "documentation": "", + "beta": true, + "error": null + }, + "id": "CustomComponent-T38LS" + }, + "positionAbsolute": { "x": 536, "y": 337 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "ec36a3b7-7b5f-4663-983c-833bcec4d851", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + }, + { + "name": "Getting Started: Simple python function applied to each output", + "description": "Use this Tool on every query", + "data": { + "nodes": [ + { + "width": 384, + "height": 631, + "id": "ChatOpenAI-E1XSb", + "type": "genericNode", + "position": { "x": 543.1816229116944, "y": 942.891611351432 }, + "data": { + "type": "ChatOpenAI", + "node": { + "template": { + "lc_kwargs": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "lc_kwargs", + "advanced": true, + "type": "code", + "list": false + }, + "verbose": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": false, + "password": false, + "name": "verbose", + "advanced": false, + "type": "bool", + "list": false + }, + "callbacks": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "callbacks", + "advanced": false, + "type": "langchain.callbacks.base.BaseCallbackHandler", + "list": true + }, + "client": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "client", + "advanced": false, + "type": "Any", + "list": false + }, + "model_name": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "gpt-3.5-turbo", + "password": false, + "options": [ + "gpt-3.5-turbo-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-16k-0613", + "gpt-3.5-turbo-16k", + "gpt-4-0613", + "gpt-4-32k-0613", + "gpt-4", + "gpt-4-32k" + ], + "name": "model_name", + "advanced": false, + "type": "str", + "list": true + }, + "temperature": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "0.2", + "password": false, + "name": "temperature", + "advanced": false, + "type": "float", + "list": false + }, + "model_kwargs": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "model_kwargs", + "advanced": true, + "type": "code", + "list": false + }, + "openai_api_key": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "value": "", + "password": true, + "name": "openai_api_key", + "display_name": "OpenAI API Key", + "advanced": false, + "type": "str", + "list": false + }, + "openai_api_base": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "openai_api_base", + "display_name": "OpenAI API Base", + "advanced": false, + "type": "str", + "list": false + }, + "openai_organization": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "openai_organization", + "display_name": "OpenAI Organization", + "advanced": false, + "type": "str", + "list": false + }, + "openai_proxy": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "openai_proxy", + "display_name": "OpenAI Proxy", + "advanced": false, + "type": "str", + "list": false + }, + "request_timeout": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "password": false, + "name": "request_timeout", + "advanced": false, + "type": "float", + "list": false + }, + "max_retries": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": 6, + "password": false, + "name": "max_retries", + "advanced": false, + "type": "int", + "list": false + }, + "streaming": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": false, + "password": false, + "name": "streaming", + "advanced": false, + "type": "bool", + "list": false + }, + "n": { + "required": false, + "placeholder": "", + "show": false, + "multiline": false, + "value": 1, + "password": false, + "name": "n", + "advanced": false, + "type": "int", + "list": false + }, + "max_tokens": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": true, + "name": "max_tokens", + "advanced": false, + "type": "int", + "list": false + }, + "_type": "ChatOpenAI" + }, + "description": "Wrapper around OpenAI Chat large language models.", + "base_classes": [ + "Serializable", + "BaseChatModel", + "ChatOpenAI", + "BaseLanguageModel" + ], + "display_name": "ChatOpenAI" + }, + "id": "ChatOpenAI-E1XSb", + "value": null + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 543.1816229116944, + "y": 942.891611351432 + } + }, + { + "width": 384, + "height": 387, + "id": "AgentInitializer-goPm2", + "type": "genericNode", + "position": { "x": 1036.6064439140812, "y": 645.1919693466587 }, + "data": { + "type": "AgentInitializer", + "node": { + "template": { + "agent": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "zero-shot-react-description", + "password": false, + "options": [ + "zero-shot-react-description", + "react-docstore", + "self-ask-with-search", + "conversational-react-description", + "openai-functions" + ], + "name": "agent", + "advanced": false, + "type": "str", + "list": true + }, + "memory": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "memory", + "advanced": false, + "type": "BaseChatMemory", + "list": false + }, + "tools": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "tools", + "advanced": false, + "type": "Tool", + "list": true + }, + "llm": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "llm", + "display_name": "LLM", + "advanced": false, + "type": "BaseLanguageModel", + "list": false + }, + "_type": "initialize_agent" + }, + "description": "Construct a zero shot agent from an LLM and tools.", + "base_classes": ["AgentExecutor", "function"], + "display_name": "AgentInitializer" + }, + "id": "AgentInitializer-goPm2", + "value": null + }, + "selected": false, + "positionAbsolute": { + "x": 1036.6064439140812, + "y": 645.1919693466587 + } + }, + { + "width": 384, + "height": 437, + "id": "PythonFunctionTool-SQikY", + "type": "genericNode", + "position": { "x": 553.050119331742, "y": 412.9533535948685 }, + "data": { + "type": "PythonFunctionTool", + "node": { + "template": { + "name": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "PythonFunction", + "password": false, + "name": "name", + "advanced": false, + "type": "str", + "list": false + }, + "description": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "Returns the Text you send. This is a testing tool.", + "password": false, + "name": "description", + "advanced": false, + "type": "str", + "list": false + }, + "code": { + "required": true, + "placeholder": "", + "show": true, + "multiline": true, + "value": "\ndef python_function(text: str) -> str:\n \"\"\"This is a default python function that returns the input text\"\"\"\n return text\n", + "password": false, + "name": "code", + "advanced": false, + "type": "code", + "list": false + }, + "_type": "PythonFunctionTool" + }, + "description": "Python function to be executed.", + "base_classes": ["Tool"], + "display_name": "PythonFunctionTool" + }, + "id": "PythonFunctionTool-SQikY", + "value": null + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 553.050119331742, + "y": 412.9533535948685 + } + } + ], + "edges": [ + { + "source": "ChatOpenAI-E1XSb", + "sourceHandle": "{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-E1XSbœ}", + "target": "AgentInitializer-goPm2", + "targetHandle": "{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-goPm2œ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}", + "style": { "stroke": "#555" }, + "className": "stroke-gray-900 stroke-connection", + "animated": false, + "id": "reactflow__edge-ChatOpenAI-E1XSb{œbaseClassesœ:[œSerializableœ,œBaseChatModelœ,œChatOpenAIœ,œBaseLanguageModelœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-E1XSbœ}-AgentInitializer-goPm2{œfieldNameœ:œllmœ,œidœ:œAgentInitializer-goPm2œ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}", + "selected": false, + "data": { + "sourceHandle": { + "baseClasses": [ + "Serializable", + "BaseChatModel", + "ChatOpenAI", + "BaseLanguageModel" + ], + "dataType": "ChatOpenAI", + "id": "ChatOpenAI-E1XSb" + }, + "targetHandle": { + "fieldName": "llm", + "id": "AgentInitializer-goPm2", + "inputTypes": null, + "type": "BaseLanguageModel" + } + } + }, + { + "source": "PythonFunctionTool-SQikY", + "sourceHandle": "{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-SQikYœ}", + "target": "AgentInitializer-goPm2", + "targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-goPm2œ,œinputTypesœ:null,œtypeœ:œToolœ}", + "style": { "stroke": "#555" }, + "className": "stroke-gray-900 stroke-connection", + "animated": false, + "id": "reactflow__edge-PythonFunctionTool-SQikY{œbaseClassesœ:[œToolœ],œdataTypeœ:œPythonFunctionToolœ,œidœ:œPythonFunctionTool-SQikYœ}-AgentInitializer-goPm2{œfieldNameœ:œtoolsœ,œidœ:œAgentInitializer-goPm2œ,œinputTypesœ:null,œtypeœ:œToolœ}", + "selected": false, + "data": { + "sourceHandle": { + "baseClasses": ["Tool"], + "dataType": "PythonFunctionTool", + "id": "PythonFunctionTool-SQikY" + }, + "targetHandle": { + "fieldName": "tools", + "id": "AgentInitializer-goPm2", + "inputTypes": null, + "type": "Tool" + } + } + } + ], + "viewport": { + "x": 4.748095479939138, + "y": -155.65184647754464, + "zoom": 0.6079953565987085 + } + }, + "id": "b7236833-a3c7-4782-a70b-9358d6b14bbf", + "user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b" + } + ] +} diff --git a/src/frontend/tests/onlyFront/assets/flow.json b/src/frontend/tests/onlyFront/assets/flow.json new file mode 100644 index 000000000..f214a9f74 --- /dev/null +++ b/src/frontend/tests/onlyFront/assets/flow.json @@ -0,0 +1,96 @@ +{ + "description": "Engineered for Excellence, Built for Business.", + "name": "Fluffy Sinoussi", + "data": { + "nodes": [ + { + "id": "AgentInitializer-Zza0A", + "type": "genericNode", + "position": { "x": 595, "y": 224.25 }, + "data": { + "type": "AgentInitializer", + "node": { + "template": { + "llm": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "llm", + "display_name": "LLM", + "advanced": false, + "dynamic": false, + "info": "", + "type": "BaseLanguageModel", + "list": false + }, + "memory": { + "required": false, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "memory", + "advanced": false, + "dynamic": false, + "info": "", + "type": "BaseChatMemory", + "list": false + }, + "tools": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "password": false, + "name": "tools", + "advanced": false, + "dynamic": false, + "info": "", + "type": "Tool", + "list": true + }, + "agent": { + "required": true, + "placeholder": "", + "show": true, + "multiline": false, + "value": "zero-shot-react-description", + "password": false, + "options": [ + "zero-shot-react-description", + "react-docstore", + "self-ask-with-search", + "conversational-react-description", + "openai-functions", + "openai-multi-functions" + ], + "name": "agent", + "advanced": false, + "dynamic": false, + "info": "", + "type": "str", + "list": true + }, + "_type": "initialize_agent" + }, + "description": "Construct a zero shot agent from an LLM and tools.", + "base_classes": ["AgentExecutor", "function"], + "display_name": "AgentInitializer", + "custom_fields": {}, + "output_types": [], + "documentation": "https://python.langchain.com/docs/modules/agents/agent_types/", + "beta": false, + "error": null + }, + "id": "AgentInitializer-Zza0A" + }, + "positionAbsolute": { "x": 595, "y": 224.25 } + } + ], + "edges": [], + "viewport": { "x": 0, "y": 0, "zoom": 1 } + }, + "id": "84c4b46f-063b-4d48-bf7f-6c668013064f" +} diff --git a/src/frontend/tests/onlyFront/dragAndDrop.spec.ts b/src/frontend/tests/onlyFront/dragAndDrop.spec.ts new file mode 100644 index 000000000..a4bf680d4 --- /dev/null +++ b/src/frontend/tests/onlyFront/dragAndDrop.spec.ts @@ -0,0 +1,87 @@ +import { expect, test } from "@playwright/test"; +import { readFileSync } from "fs"; + +test.describe("drag and drop test", () => { + /// + test("drop collection", async ({ page }) => { + await page.routeFromHAR("harFiles/langflow.har", { + url: "**/api/v1/**", + update: false, + }); + await page.route("**/api/v1/flows/", async (route) => { + const json = { + id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + }; + await route.fulfill({ json, status: 201 }); + }); + await page.goto("http:localhost:3000/"); + await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); + // Read your file into a buffer. + const jsonContent = readFileSync( + "tests/onlyFront/assets/collection.json", + "utf-8" + ); + + // Create the DataTransfer and File + const dataTransfer = await page.evaluateHandle((data) => { + const dt = new DataTransfer(); + // Convert the buffer to a hex array + const file = new File([data], "collection.json", { + type: "application/json", + }); + dt.items.add(file); + return dt; + }, jsonContent); + + // Now dispatch + await page.dispatchEvent('//*[@id="root"]/div/div[2]/div[2]', "drop", { + dataTransfer, + }); + expect( + await page + .locator(".main-page-flows-display") + .evaluate((el) => el.children) + ).toBeTruthy(); + }); + + test("drop flow", async ({ page }) => { + await page.routeFromHAR("harFiles/langflow.har", { + url: "**/api/v1/**", + update: false, + }); + await page.route("**/api/v1/flows/", async (route) => { + const json = { + id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + }; + await route.fulfill({ json, status: 201 }); + }); + await page.goto("http:localhost:3000/"); + await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); + // Read your file into a buffer. + const jsonContent = readFileSync( + "tests/onlyFront/assets/flow.json", + "utf-8" + ); + + // Create the DataTransfer and File + const dataTransfer = await page.evaluateHandle((data) => { + const dt = new DataTransfer(); + // Convert the buffer to a hex array + const file = new File([data], "flow.json", { + type: "application/json", + }); + dt.items.add(file); + return dt; + }, jsonContent); + + // Now dispatch + await page.dispatchEvent('//*[@id="root"]/div/div[2]/div[2]', "drop", { + dataTransfer, + }); + expect( + await page + .locator(".main-page-flows-display") + .evaluate((el) => el.children) + ).toBeTruthy(); + }); +});