diff --git a/.env.example b/.env.example index 6c6d2f667..b3e592bdf 100644 --- a/.env.example +++ b/.env.example @@ -45,3 +45,21 @@ LANGFLOW_OPEN_BROWSER= # Values: true, false # Example: LANGFLOW_REMOVE_API_KEYS=false LANGFLOW_REMOVE_API_KEYS= + +# Whether to use RedisCache or InMemoryCache +# Values: memory, redis +# Example: LANGFLOW_CACHE_TYPE=memory +# If you want to use redis then the following environment variables must be set: +# LANGFLOW_REDIS_HOST (default: localhost) +# LANGFLOW_REDIS_PORT (default: 6379) +# LANGFLOW_REDIS_DB (default: 0) +# LANGFLOW_REDIS_CACHE_EXPIRE (default: 3600) +LANGFLOW_CACHE_TYPE= + +# Superuser username +# Example: LANGFLOW_SUPERUSER=admin +LANGFLOW_SUPERUSER= + +# Superuser password +# Example: LANGFLOW_SUPERUSER_PASSWORD=123456 +LANGFLOW_SUPERUSER_PASSWORD= diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..d81146d19 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: "Async API tests" + +on: + push: + branches: + - dev + pull_request: + branches: + - dev + - main + +jobs: + build-and-test: + runs-on: ubuntu-latest + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Set up Docker + run: docker --version && docker-compose --version + + - name: "Create env file" + working-directory: ./deploy + run: | + echo "${{ secrets.ENV_FILE }}" > .env + + - name: Build and start services + + working-directory: ./deploy + run: docker compose up --exit-code-from tests tests result_backend broker celeryworker db --build + continue-on-error: true + + - name: Stop services + run: docker compose down diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 2399b5634..a013f686a 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -38,6 +38,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} draft: false generateReleaseNotes: true + prerelease: true tag: v${{ steps.check-version.outputs.version }} commit: main - name: Publish to PyPI diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a258949e..908c5fc51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,11 +45,3 @@ jobs: POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} run: | poetry publish - - - name: Trigger build and push on langchain-serve - uses: peter-evans/repository-dispatch@v2 - with: - token: ${{ secrets.SERVE_GITHUB_TOKEN }} - repository: jina-ai/langchain-serve - event-type: langflow-push - client-payload: '{"push_token": "${{ secrets.LCSERVE_PUSH_TOKEN }}", "branch": "main"}' diff --git a/.github/workflows/test-lcserve-push.yml b/.github/workflows/test-lcserve-push.yml deleted file mode 100644 index f207c0a91..000000000 --- a/.github/workflows/test-lcserve-push.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Trigger build and push on langchain-serve - -on: - workflow_dispatch: - - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Trigger build and push on langchain-serve - uses: peter-evans/repository-dispatch@v2 - with: - token: ${{ secrets.SERVE_GITHUB_TOKEN }} - repository: jina-ai/langchain-serve - event-type: langflow-push - client-payload: '{"push_token": "${{ secrets.LCSERVE_PUSH_TOKEN }}", "branch": "dev"}' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e009534c2..bc2e193c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ on: branches: [dev] env: - POETRY_VERSION: "1.4.0" + POETRY_VERSION: "1.5.0" jobs: build: @@ -16,6 +16,8 @@ jobs: matrix: python-version: - "3.10" + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} steps: - uses: actions/checkout@v3 - name: Install poetry diff --git a/.gitignore b/.gitignore index 156f44394..9b8ec1cc1 100644 --- a/.gitignore +++ b/.gitignore @@ -254,3 +254,4 @@ langflow.db /tmp/* src/backend/langflow/frontend/ +.docker \ No newline at end of file diff --git a/Makefile b/Makefile index 59f326853..1fbd7403c 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,8 @@ coverage: --cov-report term-missing:skip-covered tests: - poetry run pytest tests -n auto + @make install_backend + poetry run pytest tests format: poetry run black . @@ -41,10 +42,10 @@ run_frontend: cd src/frontend && npm start run_cli: - poetry run langflow --path src/frontend/build + poetry run langflow run --path src/frontend/build run_cli_debug: - poetry run langflow --path src/frontend/build --log-level debug + poetry run langflow run --path src/frontend/build --log-level debug setup_devcontainer: make init @@ -60,7 +61,7 @@ frontendc: make run_frontend install_backend: - poetry install + poetry install --extras deploy backend: make install_backend @@ -69,7 +70,7 @@ backend: build_and_run: echo 'Removing dist folder' rm -rf dist - make build && poetry run pip install dist/*.tar.gz && poetry run langflow + make build && poetry run pip install dist/*.tar.gz && poetry run langflow run build_and_install: echo 'Removing dist folder' @@ -86,17 +87,6 @@ build: poetry build --format sdist rm -rf src/backend/langflow/frontend -lcserve_push: - make build_frontend - @version=$$(poetry version --short); \ - lc-serve push --app langflow.lcserve:app --app-dir . \ - --image-name langflow --image-tag $${version} --verbose --public - -lcserve_deploy: - @:$(if $(uses),,$(error `uses` is not set. Please run `make uses=... lcserve_deploy`)) - lc-serve deploy jcloud --app langflow.lcserve:app --app-dir . \ - --uses $(uses) --config src/backend/langflow/jcloud.yml --verbose - dev: make install_frontend ifeq ($(build),1) diff --git a/README.md b/README.md index 9137ea714..a9effbce6 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,6 @@ - [Environment Variables](#environment-variables) - [Deployment](#deployment) - [Deploy Langflow on Google Cloud Platform](#deploy-langflow-on-google-cloud-platform) - - [Deploy Langflow on Jina AI Cloud](#deploy-langflow-on-jina-ai-cloud) - - [API Usage](#api-usage) - [Deploy on Railway](#deploy-on-railway) - [Deploy on Render](#deploy-on-render) - [๐ŸŽจ Creating Flows](#-creating-flows) @@ -78,7 +76,7 @@ python -m langflow or ```shell -langflow # or langflow --help +langflow run # or langflow --help ``` ### HuggingFace Spaces @@ -94,7 +92,7 @@ Langflow provides a command-line interface (CLI) for easy management and configu You can run the Langflow using the following command: ```shell -langflow [OPTIONS] +langflow run [OPTIONS] ``` Each option is detailed below: @@ -110,7 +108,6 @@ Each option is detailed below: - `--components-path`: Specifies the path to the directory containing custom components. Can be set using the `LANGFLOW_COMPONENTS_PATH` environment variable. The default is `langflow/components`. - `--log-file`: Specifies the path to the log file. Can be set using the `LANGFLOW_LOG_FILE` environment variable. The default is `logs/langflow.log`. - `--cache`: Selects the type of cache to use. Options are `InMemoryCache` and `SQLiteCache`. Can be set using the `LANGFLOW_LANGCHAIN_CACHE` environment variable. The default is `SQLiteCache`. -- `--jcloud/--no-jcloud`: Toggles the option to deploy on Jina AI Cloud. The default is `no-jcloud`. - `--dev/--no-dev`: Toggles the development mode. The default is `no-dev`. - `--path`: Specifies the path to the frontend directory containing build files. This option is for development purposes only. Can be set using the `LANGFLOW_FRONTEND_PATH` environment variable. - `--open-browser/--no-open-browser`: Toggles the option to open the browser after starting the server. Can be set using the `LANGFLOW_OPEN_BROWSER` environment variable. The default is `open-browser`. @@ -134,118 +131,9 @@ Alternatively, click the **"Open in Cloud Shell"** button below to launch Google [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/logspace-ai/langflow&working_dir=scripts&shellonly=true&tutorial=walkthroughtutorial_spot.md) -## Deploy Langflow on [Jina AI Cloud](https://github.com/jina-ai/langchain-serve) - -Langflow integrates with langchain-serve to provide a one-command deployment to Jina AI Cloud. - -Start by installing `langchain-serve` with - -```bash -pip install langflow[deploy] -# or -pip install -U langchain-serve -``` - -Then, run: - -```bash -langflow --jcloud -``` - -```text -๐ŸŽ‰ Langflow server successfully deployed on Jina AI Cloud ๐ŸŽ‰ -๐Ÿ”— Click on the link to open the server (please allow ~1-2 minutes for the server to startup): https://.wolf.jina.ai/ -๐Ÿ“– Read more about managing the server: https://github.com/jina-ai/langchain-serve -``` - -
- Show complete (example) output - -```text - ๐Ÿš€ Deploying Langflow server on Jina AI Cloud - โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ๐ŸŽ‰ Flow is available! โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ - โ”‚ โ”‚ - โ”‚ ID langflow-e3dd8820ec โ”‚ - โ”‚ Gateway (Websocket) wss://langflow-e3dd8820ec.wolf.jina.ai โ”‚ - โ”‚ Dashboard https://dashboard.wolf.jina.ai/flow/e3dd8820ec โ”‚ - โ”‚ โ”‚ - โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ - โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ - โ”‚ App ID โ”‚ langflow-e3dd8820ec โ”‚ - โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค - โ”‚ Phase โ”‚ Serving โ”‚ - โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค - โ”‚ Endpoint โ”‚ wss://langflow-e3dd8820ec.wolf.jina.ai โ”‚ - โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค - โ”‚ App logs โ”‚ dashboards.wolf.jina.ai โ”‚ - โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค - โ”‚ Swagger UI โ”‚ https://langflow-e3dd8820ec.wolf.jina.ai/docs โ”‚ - โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค - โ”‚ OpenAPI JSON โ”‚ https://langflow-e3dd8820ec.wolf.jina.ai/openapi.json โ”‚ - โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ - - ๐ŸŽ‰ Langflow server successfully deployed on Jina AI Cloud ๐ŸŽ‰ - ๐Ÿ”— Click on the link to open the server (please allow ~1-2 minutes for the server to startup): https://langflow-e3dd8820ec.wolf.jina.ai/ - ๐Ÿ“– Read more about managing the server: https://github.com/jina-ai/langchain-serve -``` - -
- -#### API Usage - -You can use Langflow directly on your browser, or use the API endpoints on Jina AI Cloud to interact with the server. - -
- Show API usage (with python) - -```python -import requests - -BASE_API_URL = "https://langflow-e3dd8820ec.wolf.jina.ai/api/v1/predict" -FLOW_ID = "864c4f98-2e59-468b-8e13-79cd8da07468" -# You can tweak the flow by adding a tweaks dictionary -# e.g {"OpenAI-XXXXX": {"model_name": "gpt-4"}} -TWEAKS = { -"ChatOpenAI-g4jEr": {}, -"ConversationChain-UidfJ": {} -} - -def run_flow(message: str, flow_id: str, tweaks: dict = None) -> dict: - """ - Run a flow with a given message and optional tweaks. - - :param message: The message to send to the flow - :param flow_id: The ID of the flow to run - :param tweaks: Optional tweaks to customize the flow - :return: The JSON response from the flow - """ - api_url = f"{BASE_API_URL}/{flow_id}" - - payload = {"message": message} - - if tweaks: - payload["tweaks"] = tweaks - - response = requests.post(api_url, json=payload) - return response.json() - -# Setup any tweaks you want to apply to the flow -print(run_flow("Your message", flow_id=FLOW_ID, tweaks=TWEAKS)) -``` - -```json -{ - "result": "Great choice! Bangalore in the 1920s was a vibrant city with a rich cultural and political scene. Here are some suggestions for things to see and do:\n\n1. Visit the Bangalore Palace - built in 1887, this stunning palace is a perfect example of Tudor-style architecture. It was home to the Maharaja of Mysore and is now open to the public.\n\n2. Attend a performance at the Ravindra Kalakshetra - this cultural center was built in the 1920s and is still a popular venue for music and dance performances.\n\n3. Explore the neighborhoods of Basavanagudi and Malleswaram - both of these areas have retained much of their old-world charm and are great places to walk around and soak up the atmosphere.\n\n4. Check out the Bangalore Club - founded in 1868, this exclusive social club was a favorite haunt of the British expat community in the 1920s.\n\n5. Attend a meeting of the Indian National Congress - founded in 1885, the INC was a major force in the Indian independence movement and held many meetings and rallies in Bangalore in the 1920s.\n\nHope you enjoy your trip to 1920s Bangalore!" -} -``` - -
- -> Read more about resource customization, cost, and management of Langflow apps on Jina AI Cloud in the **[langchain-serve](https://github.com/jina-ai/langchain-serve)** repository. - ## Deploy on Railway -[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/Emy2sU?referralCode=MnPSdg) +[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/JMXEWp?referralCode=MnPSdg) ## Deploy on Render diff --git a/base.Dockerfile b/base.Dockerfile new file mode 100644 index 000000000..c76bbbcda --- /dev/null +++ b/base.Dockerfile @@ -0,0 +1,97 @@ + + +# syntax=docker/dockerfile:1 +# Keep this syntax directive! It's used to enable Docker BuildKit + +# Based on https://github.com/python-poetry/poetry/discussions/1879?sort=top#discussioncomment-216865 +# but I try to keep it updated (see history) + +################################ +# PYTHON-BASE +# Sets up all our shared environment variables +################################ +FROM python:3.10-slim as python-base + +# python +ENV PYTHONUNBUFFERED=1 \ + # prevents python creating .pyc files + PYTHONDONTWRITEBYTECODE=1 \ + \ + # pip + PIP_DISABLE_PIP_VERSION_CHECK=on \ + PIP_DEFAULT_TIMEOUT=100 \ + \ + # poetry + # https://python-poetry.org/docs/configuration/#using-environment-variables + POETRY_VERSION=1.5.1 \ + # make poetry install to this location + POETRY_HOME="/opt/poetry" \ + # make poetry create the virtual environment in the project's root + # it gets named `.venv` + POETRY_VIRTUALENVS_IN_PROJECT=true \ + # do not ask any interactive question + POETRY_NO_INTERACTION=1 \ + \ + # paths + # this is where our requirements + virtual environment will live + PYSETUP_PATH="/opt/pysetup" \ + VENV_PATH="/opt/pysetup/.venv" + + +# prepend poetry and venv to path +ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH" + + +################################ +# BUILDER-BASE +# Used to build deps + create our virtual environment +################################ +FROM python-base as builder-base +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + # deps for installing poetry + curl \ + # deps for building python deps + build-essential + + +# install poetry - respects $POETRY_VERSION & $POETRY_HOME +# The --mount will mount the buildx cache directory to where +# Poetry and Pip store their cache so that they can re-use it +RUN --mount=type=cache,target=/root/.cache \ + curl -sSL https://install.python-poetry.org | python3 - + +# copy project requirement files here to ensure they will be cached. +WORKDIR $PYSETUP_PATH +COPY poetry.lock pyproject.toml ./ +COPY ./src/backend/langflow/main.py ./src/backend/langflow/main.py +# Copy README.md to the build context +COPY README.md . +# install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally +RUN --mount=type=cache,target=/root/.cache \ + poetry install --without dev --extras deploy + + +################################ +# DEVELOPMENT +# Image used during development / testing +################################ +FROM python-base as development +WORKDIR $PYSETUP_PATH + +# copy in our built poetry + venv +COPY --from=builder-base $POETRY_HOME $POETRY_HOME +COPY --from=builder-base $PYSETUP_PATH $PYSETUP_PATH + +# Copy just one file to avoid rebuilding the whole image +COPY ./src/backend/langflow/__init__.py ./src/backend/langflow/__init__.py +# quicker install as runtime deps are already installed +RUN --mount=type=cache,target=/root/.cache \ + poetry install --with=dev --extras deploy + +# copy in our app code +COPY ./src/backend ./src/backend +RUN --mount=type=cache,target=/root/.cache \ + poetry install --with=dev --extras deploy +COPY ./tests ./tests= + diff --git a/deploy/.env.example b/deploy/.env.example new file mode 100644 index 000000000..e67307406 --- /dev/null +++ b/deploy/.env.example @@ -0,0 +1,57 @@ +DOMAIN=localhost +STACK_NAME=langflow-stack +ENVIRONMENT=development + +TRAEFIK_PUBLIC_NETWORK=traefik-public +TRAEFIK_TAG=langflow-traefik +TRAEFIK_PUBLIC_TAG=traefik-public + +# RabbitMQ configuration +RABBITMQ_DEFAULT_USER=langflow +RABBITMQ_DEFAULT_PASS=langflow + +# Database configuration +DB_USER=langflow +DB_PASSWORD=langflow +DB_HOST=db +DB_PORT=5432 +DB_NAME=langflow + +# Logging configuration +LOG_LEVEL=debug + +# DB configuration +POSTGRES_USER=langflow +POSTGRES_PASSWORD=langflow +POSTGRES_DB=langflow +POSTGRES_PORT=5432 + +# Flower configuration +LANGFLOW_CACHE_TYPE=redis +LANGFLOW_REDIS_HOST=result_backend +LANGFLOW_REDIS_PORT=6379 +LANGFLOW_REDIS_DB=0 +LANGFLOW_REDIS_EXPIRE=3600 +LANGFLOW_REDIS_PASSWORD= +FLOWER_UNAUTHENTICATED_API=True +BROKER_URL=amqp://langflow:langflow@broker:5672 +RESULT_BACKEND=redis://result_backend:6379/0 +C_FORCE_ROOT="true" + +# Frontend configuration +VITE_PROXY_TARGET=http://backend:7860/api/ +BACKEND_URL=http://backend:7860 + +# PGAdmin configuration +PGADMIN_DEFAULT_EMAIL=admin@admin.com +PGADMIN_DEFAULT_PASSWORD=admin + +# OpenAI configuration (for testing purposes) +OPENAI_API_KEY=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 + +# Superuser configuration +LANGFLOW_SUPERUSER=superuser +LANGFLOW_SUPERUSER_PASSWORD=superuser + +# New user configuration +LANGFLOW_NEW_USER_IS_ACTIVE=False \ No newline at end of file diff --git a/deploy/.gitignore b/deploy/.gitignore new file mode 100644 index 000000000..fdbcefec6 --- /dev/null +++ b/deploy/.gitignore @@ -0,0 +1 @@ +pgadmin \ No newline at end of file diff --git a/deploy/base.Dockerfile b/deploy/base.Dockerfile new file mode 100644 index 000000000..323663283 --- /dev/null +++ b/deploy/base.Dockerfile @@ -0,0 +1,92 @@ + + +# syntax=docker/dockerfile:1 +# Keep this syntax directive! It's used to enable Docker BuildKit + +# Based on https://github.com/python-poetry/poetry/discussions/1879?sort=top#discussioncomment-216865 +# but I try to keep it updated (see history) + +################################ +# PYTHON-BASE +# Sets up all our shared environment variables +################################ +FROM python:3.10-slim as python-base + +# python +ENV PYTHONUNBUFFERED=1 \ + # prevents python creating .pyc files + PYTHONDONTWRITEBYTECODE=1 \ + \ + # pip + PIP_DISABLE_PIP_VERSION_CHECK=on \ + PIP_DEFAULT_TIMEOUT=100 \ + \ + # poetry + # https://python-poetry.org/docs/configuration/#using-environment-variables + POETRY_VERSION=1.5.1 \ + # make poetry install to this location + POETRY_HOME="/opt/poetry" \ + # make poetry create the virtual environment in the project's root + # it gets named `.venv` + POETRY_VIRTUALENVS_IN_PROJECT=true \ + # do not ask any interactive question + POETRY_NO_INTERACTION=1 \ + \ + # paths + # this is where our requirements + virtual environment will live + PYSETUP_PATH="/opt/pysetup" \ + VENV_PATH="/opt/pysetup/.venv" + + +# prepend poetry and venv to path +ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH" + + +################################ +# BUILDER-BASE +# Used to build deps + create our virtual environment +################################ +FROM python-base as builder-base +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + # deps for installing poetry + curl \ + # deps for building python deps + build-essential + +# install poetry - respects $POETRY_VERSION & $POETRY_HOME +# The --mount will mount the buildx cache directory to where +# Poetry and Pip store their cache so that they can re-use it +RUN --mount=type=cache,target=/root/.cache \ + curl -sSL https://install.python-poetry.org | python3 - + +# copy project requirement files here to ensure they will be cached. +WORKDIR $PYSETUP_PATH +COPY ./poetry.lock ./pyproject.toml ./ +# Copy README.md to the build context +COPY ./README.md ./ +# install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally +RUN --mount=type=cache,target=/root/.cache \ + poetry install --without dev --extras deploy + + +################################ +# DEVELOPMENT +# Image used during development / testing +################################ +FROM python-base as development +WORKDIR $PYSETUP_PATH + +# copy in our built poetry + venv +COPY --from=builder-base $POETRY_HOME $POETRY_HOME +COPY --from=builder-base $PYSETUP_PATH $PYSETUP_PATH + +# Copy just one file to avoid rebuilding the whole image +COPY ./src/backend/langflow/__init__.py ./src/backend/langflow/__init__.py +# quicker install as runtime deps are already installed +RUN --mount=type=cache,target=/root/.cache \ + poetry install --with=dev --extras deploy + +# copy in our app code +COPY ./src/backend ./src/backend +COPY ./tests ./tests diff --git a/deploy/docker-compose.override.yml b/deploy/docker-compose.override.yml new file mode 100644 index 000000000..1992916fb --- /dev/null +++ b/deploy/docker-compose.override.yml @@ -0,0 +1,67 @@ +version: "3.8" + +services: + proxy: + ports: + - "80:80" + - "8090:8080" + command: + # Enable Docker in Traefik, so that it reads labels from Docker services + - --providers.docker + # Add a constraint to only use services with the label for this stack + # from the env var TRAEFIK_TAG + - --providers.docker.constraints=Label(`traefik.constraint-label-stack`, `${TRAEFIK_TAG?Variable not set}`) + # Do not expose all Docker services, only the ones explicitly exposed + - --providers.docker.exposedbydefault=false + # Disable Docker Swarm mode for local development + # - --providers.docker.swarmmode + # Enable the access log, with HTTP requests + - --accesslog + # Enable the Traefik log, for configurations and errors + - --log + # Enable the Dashboard and API + - --api + # Enable the Dashboard and API in insecure mode for local development + - --api.insecure=true + labels: + - traefik.enable=true + - traefik.http.routers.${STACK_NAME?Variable not set}-traefik-public-http.rule=Host(`${DOMAIN?Variable not set}`) + - traefik.http.services.${STACK_NAME?Variable not set}-traefik-public.loadbalancer.server.port=80 + + result_backend: + ports: + - "6379:6379" + + pgadmin: + ports: + - "5050:5050" + + flower: + ports: + - "5555:5555" + + backend: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.rule=PathPrefix(`/api/v1`) || PathPrefix(`/docs`) || PathPrefix(`/health`) + - traefik.http.services.${STACK_NAME?Variable not set}-backend.loadbalancer.server.port=7860 + + frontend: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.rule=PathPrefix(`/`) + - traefik.http.services.${STACK_NAME?Variable not set}-frontend.loadbalancer.server.port=80 + + celeryworker: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-celeryworker-http.rule=PathPrefix(`/api/v1`) || PathPrefix(`/docs`) || PathPrefix(`/health`) + - traefik.http.services.${STACK_NAME?Variable not set}-celeryworker.loadbalancer.server.port=7860 + +networks: + traefik-public: + # For local dev, don't expect an external Traefik network + external: false diff --git a/deploy/docker-compose.with_tests.yml b/deploy/docker-compose.with_tests.yml new file mode 100644 index 000000000..c16c14197 --- /dev/null +++ b/deploy/docker-compose.with_tests.yml @@ -0,0 +1,277 @@ +version: "3.8" + +services: + proxy: + image: traefik:v3.0 + env_file: + - .env + networks: + - ${TRAEFIK_PUBLIC_NETWORK?Variable not set} + - default + volumes: + - /var/run/docker.sock:/var/run/docker.sock + command: + # Enable Docker in Traefik, so that it reads labels from Docker services + - --providers.docker + # Add a constraint to only use services with the label for this stack + # from the env var TRAEFIK_TAG + - --providers.docker.constraints=Label(`traefik.constraint-label-stack`, `${TRAEFIK_TAG?Variable not set}`) + # Do not expose all Docker services, only the ones explicitly exposed + - --providers.docker.exposedbydefault=false + # Enable the access log, with HTTP requests + - --accesslog + # Enable the Traefik log, for configurations and errors + - --log + # Enable the Dashboard and API + - --api + deploy: + placement: + constraints: + - node.role == manager + labels: + # Enable Traefik for this service, to make it available in the public network + - traefik.enable=true + # Use the traefik-public network (declared below) + - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set} + # Use the custom label "traefik.constraint-label=traefik-public" + # This public Traefik will only use services with this label + - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set} + # traefik-http set up only to use the middleware to redirect to https + - traefik.http.middlewares.${STACK_NAME?Variable not set}-https-redirect.redirectscheme.scheme=https + - traefik.http.middlewares.${STACK_NAME?Variable not set}-https-redirect.redirectscheme.permanent=true + # Handle host with and without "www" to redirect to only one of them + # Uses environment variable DOMAIN + # To disable www redirection remove the Host() you want to discard, here and + # below for HTTPS + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-http.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-http.entrypoints=http + # traefik-https the actual router using HTTPS + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-https.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-https.entrypoints=https + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-https.tls=true + # Use the "le" (Let's Encrypt) resolver created below + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-https.tls.certresolver=le + # Define the port inside of the Docker service to use + - traefik.http.services.${STACK_NAME?Variable not set}-proxy.loadbalancer.server.port=80 + # Handle domain with and without "www" to redirect to only one + # To disable www redirection remove the next line + - traefik.http.middlewares.${STACK_NAME?Variable not set}-www-redirect.redirectregex.regex=^https?://(www.)?(${DOMAIN?Variable not set})/(.*) + # Redirect a domain with www to non-www + # To disable it remove the next line + - traefik.http.middlewares.${STACK_NAME?Variable not set}-www-redirect.redirectregex.replacement=https://${DOMAIN?Variable not set}/$${3} + # Redirect a domain without www to www + # To enable it remove the previous line and uncomment the next + # - traefik.http.middlewares.${STACK_NAME}-www-redirect.redirectregex.replacement=https://www.${DOMAIN}/$${3} + # Middleware to redirect www, to disable it remove the next line + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-https.middlewares=${STACK_NAME?Variable not set}-www-redirect + # Middleware to redirect www, and redirect HTTP to HTTPS + # to disable www redirection remove the section: ${STACK_NAME?Variable not set}-www-redirect, + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-http.middlewares=${STACK_NAME?Variable not set}-www-redirect,${STACK_NAME?Variable not set}-https-redirect + + backend: &backend + image: "ogabrielluiz/langflow:latest" + build: + context: ../ + dockerfile: base.Dockerfile + depends_on: + - db + - broker + - result_backend + env_file: + - .env + volumes: + - ../:/app + - ./startup-backend.sh:/startup-backend.sh # Ensure the paths match + command: /startup-backend.sh # Fixed the path + healthcheck: + test: "exit 0" + deploy: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.rule=PathPrefix(`/api/v1`) || PathPrefix(`/docs`) || PathPrefix(`/health`) + - traefik.http.services.${STACK_NAME?Variable not set}-backend.loadbalancer.server.port=7860 + + db: + image: postgres:15.4 + volumes: + - app-db-data:/var/lib/postgresql/data/pgdata + environment: + - PGDATA=/var/lib/postgresql/data/pgdata + deploy: + placement: + constraints: + - node.labels.app-db-data == true + healthcheck: + test: "exit 0" + env_file: + - .env + + pgadmin: + image: dpage/pgadmin4 + networks: + - ${TRAEFIK_PUBLIC_NETWORK?Variable not set} + - default + volumes: + - pgadmin-data:/var/lib/pgadmin + env_file: + - .env + deploy: + labels: + - traefik.enable=true + - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set} + - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.rule=Host(`pgadmin.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.entrypoints=http + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.middlewares=${STACK_NAME?Variable not set}-https-redirect + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.rule=Host(`pgadmin.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.entrypoints=https + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.tls=true + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.tls.certresolver=le + - traefik.http.services.${STACK_NAME?Variable not set}-pgadmin.loadbalancer.server.port=5050 + + result_backend: + image: redis:6.2.5 + env_file: + - .env + # ports: + # - 6379:6379 + healthcheck: + test: "exit 0" + + celeryworker: + <<: *backend + env_file: + - .env + build: + context: ../ + dockerfile: base.Dockerfile + command: celery -A langflow.worker.celery_app worker --loglevel=INFO --concurrency=1 -n lf-worker@%h + healthcheck: + test: "exit 0" + deploy: + replicas: 1 + + flower: + <<: *backend + env_file: + - .env + networks: + - default + build: + context: ../ + dockerfile: base.Dockerfile + environment: + - FLOWER_PORT=5555 + + command: /bin/sh -c "celery -A langflow.worker.celery_app --broker=${BROKER_URL?Variable not set} flower --port=5555" + deploy: + labels: + - traefik.enable=true + - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set} + - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.rule=Host(`flower.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.entrypoints=http + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.middlewares=${STACK_NAME?Variable not set}-https-redirect + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.rule=Host(`flower.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.entrypoints=https + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.tls=true + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.tls.certresolver=le + - traefik.http.services.${STACK_NAME?Variable not set}-flower.loadbalancer.server.port=5555 + + frontend: + image: "ogabrielluiz/langflow_frontend:latest" + env_file: + - .env + # user: your-non-root-user + build: + context: ../src/frontend + dockerfile: Dockerfile + args: + - BACKEND_URL=http://backend:7860 + restart: on-failure + deploy: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.rule=PathPrefix(`/`) + - traefik.http.services.${STACK_NAME?Variable not set}-frontend.loadbalancer.server.port=80 + + broker: + # RabbitMQ management console + image: rabbitmq:3-management + environment: + - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER:-admin} + - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS:-admin} + volumes: + - rabbitmq_data:/etc/rabbitmq/ + - rabbitmq_data:/var/lib/rabbitmq/ + - rabbitmq_log:/var/log/rabbitmq/ + ports: + - 5672:5672 + - 15672:15672 + + prometheus: + image: prom/prometheus:v2.37.9 + env_file: + - .env + volumes: + - ./prometheus.yml:/etc/prometheus/prometheus.yml + command: + - "--config.file=/etc/prometheus/prometheus.yml" + # ports: + # - 9090:9090 + healthcheck: + test: "exit 0" + deploy: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-prometheus-http.rule=PathPrefix(`/metrics`) + - traefik.http.services.${STACK_NAME?Variable not set}-prometheus.loadbalancer.server.port=9090 + + grafana: + image: grafana/grafana:8.2.6 + env_file: + - .env + # ports: + # - 3000:3000 + volumes: + - grafana_data:/var/lib/grafana + deploy: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-grafana-http.rule=PathPrefix(`/grafana`) + - traefik.http.services.${STACK_NAME?Variable not set}-grafana.loadbalancer.server.port=3000 + + tests: + extends: + file: docker-compose.yml + service: backend + env_file: + - .env + build: + context: ../ + dockerfile: base.Dockerfile + command: pytest -vv + healthcheck: + test: "exit 0" + # override deploy labels to avoid conflicts with the backend service + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-tests-http.rule=PathPrefix(`/api/v1`) || PathPrefix(`/docs`) || PathPrefix(`/health`) + - traefik.http.services.${STACK_NAME?Variable not set}-tests.loadbalancer.server.port=7861 + +volumes: + grafana_data: + app-db-data: + rabbitmq_data: + rabbitmq_log: + pgadmin-data: + +networks: + traefik-public: + # Allow setting it to false for testing + external: false # ${TRAEFIK_PUBLIC_NETWORK_IS_EXTERNAL-true} diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml new file mode 100644 index 000000000..4eda0dc37 --- /dev/null +++ b/deploy/docker-compose.yml @@ -0,0 +1,258 @@ +version: "3.8" + +services: + proxy: + image: traefik:v3.0 + env_file: + - .env + networks: + - ${TRAEFIK_PUBLIC_NETWORK?Variable not set} + - default + volumes: + - /var/run/docker.sock:/var/run/docker.sock + command: + # Enable Docker in Traefik, so that it reads labels from Docker services + - --providers.docker + # Add a constraint to only use services with the label for this stack + # from the env var TRAEFIK_TAG + - --providers.docker.constraints=Label(`traefik.constraint-label-stack`, `${TRAEFIK_TAG?Variable not set}`) + # Do not expose all Docker services, only the ones explicitly exposed + - --providers.docker.exposedbydefault=false + # Enable the access log, with HTTP requests + - --accesslog + # Enable the Traefik log, for configurations and errors + - --log + # Enable the Dashboard and API + - --api + deploy: + placement: + constraints: + - node.role == manager + labels: + # Enable Traefik for this service, to make it available in the public network + - traefik.enable=true + # Use the traefik-public network (declared below) + - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set} + # Use the custom label "traefik.constraint-label=traefik-public" + # This public Traefik will only use services with this label + - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set} + # traefik-http set up only to use the middleware to redirect to https + - traefik.http.middlewares.${STACK_NAME?Variable not set}-https-redirect.redirectscheme.scheme=https + - traefik.http.middlewares.${STACK_NAME?Variable not set}-https-redirect.redirectscheme.permanent=true + # Handle host with and without "www" to redirect to only one of them + # Uses environment variable DOMAIN + # To disable www redirection remove the Host() you want to discard, here and + # below for HTTPS + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-http.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-http.entrypoints=http + # traefik-https the actual router using HTTPS + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-https.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-https.entrypoints=https + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-https.tls=true + # Use the "le" (Let's Encrypt) resolver created below + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-https.tls.certresolver=le + # Define the port inside of the Docker service to use + - traefik.http.services.${STACK_NAME?Variable not set}-proxy.loadbalancer.server.port=80 + # Handle domain with and without "www" to redirect to only one + # To disable www redirection remove the next line + - traefik.http.middlewares.${STACK_NAME?Variable not set}-www-redirect.redirectregex.regex=^https?://(www.)?(${DOMAIN?Variable not set})/(.*) + # Redirect a domain with www to non-www + # To disable it remove the next line + - traefik.http.middlewares.${STACK_NAME?Variable not set}-www-redirect.redirectregex.replacement=https://${DOMAIN?Variable not set}/$${3} + # Redirect a domain without www to www + # To enable it remove the previous line and uncomment the next + # - traefik.http.middlewares.${STACK_NAME}-www-redirect.redirectregex.replacement=https://www.${DOMAIN}/$${3} + # Middleware to redirect www, to disable it remove the next line + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-https.middlewares=${STACK_NAME?Variable not set}-www-redirect + # Middleware to redirect www, and redirect HTTP to HTTPS + # to disable www redirection remove the section: ${STACK_NAME?Variable not set}-www-redirect, + - traefik.http.routers.${STACK_NAME?Variable not set}-proxy-http.middlewares=${STACK_NAME?Variable not set}-www-redirect,${STACK_NAME?Variable not set}-https-redirect + + backend: &backend + image: "ogabrielluiz/langflow:latest" + build: + context: ../ + dockerfile: base.Dockerfile + depends_on: + - db + - broker + - result_backend + env_file: + - .env + volumes: + - ../:/app + - ./startup-backend.sh:/startup-backend.sh # Ensure the paths match + command: /startup-backend.sh # Fixed the path + healthcheck: + test: "exit 0" + deploy: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.rule=PathPrefix(`/api/v1`) || PathPrefix(`/docs`) || PathPrefix(`/health`) + - traefik.http.services.${STACK_NAME?Variable not set}-backend.loadbalancer.server.port=7860 + + db: + image: postgres:15.4 + volumes: + - app-db-data:/var/lib/postgresql/data/pgdata + environment: + - PGDATA=/var/lib/postgresql/data/pgdata + deploy: + placement: + constraints: + - node.labels.app-db-data == true + healthcheck: + test: "exit 0" + env_file: + - .env + + pgadmin: + image: dpage/pgadmin4 + networks: + - ${TRAEFIK_PUBLIC_NETWORK?Variable not set} + - default + volumes: + - pgadmin-data:/var/lib/pgadmin + env_file: + - .env + deploy: + labels: + - traefik.enable=true + - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set} + - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.rule=Host(`pgadmin.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.entrypoints=http + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.middlewares=${STACK_NAME?Variable not set}-https-redirect + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.rule=Host(`pgadmin.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.entrypoints=https + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.tls=true + - traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.tls.certresolver=le + - traefik.http.services.${STACK_NAME?Variable not set}-pgadmin.loadbalancer.server.port=5050 + + result_backend: + image: redis:6.2.5 + env_file: + - .env + # ports: + # - 6379:6379 + healthcheck: + test: "exit 0" + + celeryworker: + <<: *backend + env_file: + - .env + build: + context: ../ + dockerfile: base.Dockerfile + command: celery -A langflow.worker.celery_app worker --loglevel=INFO --concurrency=1 -n lf-worker@%h + healthcheck: + test: "exit 0" + deploy: + replicas: 1 + + flower: + <<: *backend + env_file: + - .env + networks: + - default + build: + context: ../ + dockerfile: base.Dockerfile + environment: + - FLOWER_PORT=5555 + + command: /bin/sh -c "celery -A langflow.worker.celery_app --broker=${BROKER_URL?Variable not set} flower --port=5555" + deploy: + labels: + - traefik.enable=true + - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set} + - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.rule=Host(`flower.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.entrypoints=http + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.middlewares=${STACK_NAME?Variable not set}-https-redirect + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.rule=Host(`flower.${DOMAIN?Variable not set}`) + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.entrypoints=https + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.tls=true + - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.tls.certresolver=le + - traefik.http.services.${STACK_NAME?Variable not set}-flower.loadbalancer.server.port=5555 + + frontend: + image: "ogabrielluiz/langflow_frontend:latest" + env_file: + - .env + # user: your-non-root-user + build: + context: ../src/frontend + dockerfile: Dockerfile + args: + - BACKEND_URL=http://backend:7860 + restart: on-failure + deploy: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.rule=PathPrefix(`/`) + - traefik.http.services.${STACK_NAME?Variable not set}-frontend.loadbalancer.server.port=80 + + broker: + # RabbitMQ management console + image: rabbitmq:3-management + environment: + - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER:-admin} + - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS:-admin} + volumes: + - rabbitmq_data:/etc/rabbitmq/ + - rabbitmq_data:/var/lib/rabbitmq/ + - rabbitmq_log:/var/log/rabbitmq/ + ports: + - 5672:5672 + - 15672:15672 + + prometheus: + image: prom/prometheus:v2.37.9 + env_file: + - .env + volumes: + - ./prometheus.yml:/etc/prometheus/prometheus.yml + command: + - "--config.file=/etc/prometheus/prometheus.yml" + # ports: + # - 9090:9090 + healthcheck: + test: "exit 0" + deploy: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-prometheus-http.rule=PathPrefix(`/metrics`) + - traefik.http.services.${STACK_NAME?Variable not set}-prometheus.loadbalancer.server.port=9090 + + grafana: + image: grafana/grafana:8.2.6 + env_file: + - .env + # ports: + # - 3000:3000 + volumes: + - grafana_data:/var/lib/grafana + deploy: + labels: + - traefik.enable=true + - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} + - traefik.http.routers.${STACK_NAME?Variable not set}-grafana-http.rule=PathPrefix(`/grafana`) + - traefik.http.services.${STACK_NAME?Variable not set}-grafana.loadbalancer.server.port=3000 + +volumes: + grafana_data: + app-db-data: + rabbitmq_data: + rabbitmq_log: + pgadmin-data: + +networks: + traefik-public: + # Allow setting it to false for testing + external: false # ${TRAEFIK_PUBLIC_NETWORK_IS_EXTERNAL-true} diff --git a/deploy/prometheus.yml b/deploy/prometheus.yml new file mode 100644 index 000000000..1d53d5b5f --- /dev/null +++ b/deploy/prometheus.yml @@ -0,0 +1,11 @@ +global: + scrape_interval: 15s + evaluation_interval: 15s + +scrape_configs: + - job_name: prometheus + static_configs: + - targets: ["prometheus:9090"] + - job_name: flower + static_configs: + - targets: ["flower:5555"] diff --git a/deploy/startup-backend.sh b/deploy/startup-backend.sh new file mode 100755 index 000000000..75c8002a5 --- /dev/null +++ b/deploy/startup-backend.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +export LANGFLOW_DATABASE_URL="postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}" + + +# Your command to start the backend + +# If the ENVIRONMENT variable is set to "development", then start the backend in development mode +# else start the backend in production mode with guvicorn +if [ "$ENVIRONMENT" = "development" ]; then + echo "Starting backend in development mode" + exec python -m uvicorn --factory langflow.main:create_app --host 0.0.0.0 --port 7860 --log-level ${LOG_LEVEL:-info} --workers 2 --reload +else + echo "Starting backend in production mode" + exec langflow run --host 0.0.0.0 --port 7860 --log-level ${LOG_LEVEL:-info} --workers -1 --backend-only +fi + diff --git a/docs/docs/components/custom.mdx b/docs/docs/components/custom.mdx index ffa747c1b..90282a73e 100644 --- a/docs/docs/components/custom.mdx +++ b/docs/docs/components/custom.mdx @@ -33,6 +33,7 @@ The CustomComponent class serves as the foundation for creating custom component | Supported Types | | --------------------------------------------------------- | | _`str`_, _`int`_, _`float`_, _`bool`_, _`list`_, _`dict`_ | + | _`langflow.field_typing.NestedDict`_ | | _`langchain.chains.base.Chain`_ | | _`langchain.PromptTemplate`_ | | _`langchain.llms.base.BaseLLM`_ | @@ -44,6 +45,8 @@ The CustomComponent class serves as the foundation for creating custom component | _`langchain.embeddings.base.Embeddings`_ | | _`langchain.schema.BaseRetriever`_ | + The difference between _`dict`_ and _`langflow.field_typing.NestedDict`_ is that one adds a simple key-value pair field, while the other opens a more robust dictionary editor. + Unlike Langchain types, base Python types do not add a [handle](../guidelines/components) to the field by default. To add handles, diff --git a/docs/docs/components/text-splitters.mdx b/docs/docs/components/text-splitters.mdx index 6c91cc1a0..c6efe4553 100644 --- a/docs/docs/components/text-splitters.mdx +++ b/docs/docs/components/text-splitters.mdx @@ -1,11 +1,13 @@ -import Admonition from '@theme/Admonition'; +import Admonition from "@theme/Admonition"; # Text Splitters -

- We appreciate your understanding as we polish our documentation โ€“ it may contain some rough edges. Share your feedback or report issues to help us improve! ๐Ÿ› ๏ธ๐Ÿ“ -

+

+ We appreciate your understanding as we polish our documentation โ€“ it may + contain some rough edges. Share your feedback or report issues to help us + improve! ๐Ÿ› ๏ธ๐Ÿ“ +

A text splitter is a tool that divides a document or text into smaller chunks or segments. It is used to break down large texts into more manageable pieces for analysis or processing. @@ -22,13 +24,13 @@ The `CharacterTextSplitter` is used to split a long text into smaller chunks bas - **chunk_overlap:** Determines the number of characters that overlap between consecutive chunks when splitting text. It specifies how much of the previous chunk should be included in the next chunk. - For example, if the `chunk_overlap` is set to 20 and the `chunk_size` is set to 100, the splitter will create chunks of 100 characters each, but the last 20 characters of each chunk will overlap with the first 20 characters of the next chunk. This allows for a smoother transition between chunks and ensures that no information is lost โ€“ defaults to `200`. + For example, if the `chunk_overlap` is set to 20 and the `chunk_size` is set to 100, the splitter will create chunks of 100 characters each, but the last 20 characters of each chunk will overlap with the first 20 characters of the next chunk. This allows for a smoother transition between chunks and ensures that no information is lost โ€“ defaults to `200`. - **chunk_size:** Determines the maximum number of characters in each chunk when splitting a text. It specifies the size or length of each chunk. - For example, if the chunk_size is set to 100, the splitter will create chunks of 100 characters each. If the text is longer than 100 characters, it will be divided into multiple chunks of equal size, except for the last chunk, which may be smaller if there are remaining characters โ€“defaults to `1000`. + For example, if the chunk_size is set to 100, the splitter will create chunks of 100 characters each. If the text is longer than 100 characters, it will be divided into multiple chunks of equal size, except for the last chunk, which may be smaller if there are remaining characters โ€“defaults to `1000`. -- **separator:** Specifies the character that will be used to split the text into chunks โ€“ defaults to `.` +- **separator:** Specifies the character that will be used to split the text into chunks โ€“ defaults to `.` --- @@ -44,6 +46,18 @@ Theย `RecursiveCharacterTextSplitter`ย splits the text by trying to keep paragra - **chunk_size:** Determines the maximum number of characters in each chunk when splitting a text. It specifies the size or length of each chunk. -- **separator_type:** The parameter allows the user to split the code with multiple language support. It supports various languages such as Text, Ruby, Python, Solidity, Java, and more. Defaults to `Text`. +- **separators:** The `separators` in RecursiveCharacterTextSplitter are the characters used to split the text into chunks. The text splitter tries to create chunks based on splitting on the first character in the list of `separators`. If any chunks are too large, it moves on to the next character in the list and continues splitting. Defaults to ["\n\n", "\n", " ", ""]. -- **separators:** The `separators` in RecursiveCharacterTextSplitter are the characters used to split the text into chunks. The text splitter tries to create chunks based on splitting on the first character in the list of `separators`. If any chunks are too large, it moves on to the next character in the list and continues splitting. Defaults to `.` \ No newline at end of file +### LanguageRecursiveTextSplitter + +The `LanguageRecursiveTextSplitter` is a text splitter that splits the text into smaller chunks based on the (programming) language of the text. + +**Params** + +- **Documents:** Input documents to split. + +- **chunk_overlap:** Determines the number of characters that overlap between consecutive chunks when splitting text. It specifies how much of the previous chunk should be included in the next chunk. + +- **chunk_size:** Determines the maximum number of characters in each chunk when splitting a text. It specifies the size or length of each chunk. + +- **separator_type:** The parameter allows the user to split the code with multiple language support. It supports various languages such as Ruby, Python, Solidity, Java, and more. Defaults to `Python`. diff --git a/docs/docs/deployment/jina-deployment.md b/docs/docs/deployment/jina-deployment.md index bf9df051d..e69de29bb 100644 --- a/docs/docs/deployment/jina-deployment.md +++ b/docs/docs/deployment/jina-deployment.md @@ -1,101 +0,0 @@ -# Deploy on Jina AI Cloud - -Langflow integrates with langchain-serve to provide a one-command deployment to [Jina AI Cloud](https://github.com/jina-ai/langchain-serve). - -Start by installing `langchain-serve` with - -```bash -pip install -U langchain-serve -``` - -Then, run: - -```bash -langflow --jcloud -``` - -```text -๐ŸŽ‰ Langflow server successfully deployed on Jina AI Cloud ๐ŸŽ‰ -๐Ÿ”— Click on the link to open the server (please allow ~1-2 minutes for the server to startup): https://.wolf.jina.ai/ -๐Ÿ“– Read more about managing the server: https://github.com/jina-ai/langchain-serve -``` - -**Complete (example) output:** - -```text - ๐Ÿš€ Deploying Langflow server on Jina AI Cloud - โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ๐ŸŽ‰ Flow is available! โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ - โ”‚ โ”‚ - โ”‚ ID langflow-e3dd8820ec โ”‚ - โ”‚ Gateway (Websocket) wss://langflow-e3dd8820ec.wolf.jina.ai โ”‚ - โ”‚ Dashboard https://dashboard.wolf.jina.ai/flow/e3dd8820ec โ”‚ - โ”‚ โ”‚ - โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ - โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ - โ”‚ App ID โ”‚ langflow-e3dd8820ec โ”‚ - โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค - โ”‚ Phase โ”‚ Serving โ”‚ - โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค - โ”‚ Endpoint โ”‚ wss://langflow-e3dd8820ec.wolf.jina.ai โ”‚ - โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค - โ”‚ App logs โ”‚ dashboards.wolf.jina.ai โ”‚ - โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค - โ”‚ Swagger UI โ”‚ https://langflow-e3dd8820ec.wolf.jina.ai/docs โ”‚ - โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค - โ”‚ OpenAPI JSON โ”‚ https://langflow-e3dd8820ec.wolf.jina.ai/openapi.json โ”‚ - โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ - - ๐ŸŽ‰ Langflow server successfully deployed on Jina AI Cloud ๐ŸŽ‰ - ๐Ÿ”— Click on the link to open the server (please allow ~1-2 minutes for the server to startup): https://langflow-e3dd8820ec.wolf.jina.ai/ - ๐Ÿ“– Read more about managing the server: https://github.com/jina-ai/langchain-serve - ``` -## API Usage (with python) - -You can use Langflow directly on your browser or the API endpoints on Jina AI Cloud to interact with the server. - -```python -import requests - -BASE_API_URL = "https://langflow-e3dd8820ec.wolf.jina.ai/api/v1/predict" -FLOW_ID = "864c4f98-2e59-468b-8e13-79cd8da07468" -# You can tweak the flow by adding a tweaks dictionary -# e.g {"OpenAI-XXXXX": {"model_name": "gpt-4"}} -TWEAKS = { -"ChatOpenAI-g4jEr": {}, -"ConversationChain-UidfJ": {} -} - -def run_flow(message: str, flow_id: str, tweaks: dict = None) -> dict: - """ - Run a flow with a given message and optional tweaks. - - :param message: The message to send to the flow - :param flow_id: The ID of the flow to run - :param tweaks: Optional tweaks to customize the flow - :return: The JSON response from the flow - """ - api_url = f"{BASE_API_URL}/{flow_id}" - - payload = {"message": message} - - if tweaks: - payload["tweaks"] = tweaks - - response = requests.post(api_url, json=payload) - return response.json() - -# Setup any tweaks you want to apply to the flow -print(run_flow("Your message", flow_id=FLOW_ID, tweaks=TWEAKS)) - ``` - - ```json -{ - "result": "Great choice! Bangalore in the 1920s was a vibrant city with a rich cultural and political scene. Here are some suggestions for things to see and do:\n\n1. Visit the Bangalore Palace - built in 1887, this stunning palace is a perfect example of Tudor-style architecture. It was home to the Maharaja of Mysore and is now open to the public.\n\n2. Attend a performance at the Ravindra Kalakshetra - this cultural center was built in the 1920s and is still a popular venue for music and dance performances.\n\n3. Explore the neighborhoods of Basavanagudi and Malleswaram - both of these areas have retained much of their old-world charm and are great places to walk around and soak up the atmosphere.\n\n4. Check out the Bangalore Club - founded in 1868, this exclusive social club was a favorite haunt of the British expat community in the 1920s.\n\n5. Attend a meeting of the Indian National Congress - founded in 1885, the INC was a major force in the Indian independence movement and held many meetings and rallies in Bangalore in the 1920s.\n\nHope you enjoy your trip to 1920s Bangalore!" -} - ``` - -:::info - -Read more about resource customization, cost, and management of Langflow apps on Jina AI Cloud in the **[langchain-serve](https://github.com/jina-ai/langchain-serve)** repository. - -::: \ No newline at end of file diff --git a/docs/docs/guidelines/api.mdx b/docs/docs/guidelines/api.mdx new file mode 100644 index 000000000..97d2db76e --- /dev/null +++ b/docs/docs/guidelines/api.mdx @@ -0,0 +1,147 @@ +import useBaseUrl from "@docusaurus/useBaseUrl"; +import ZoomableImage from "/src/theme/ZoomableImage.js"; + +# API Keys + +## Introduction + +Langflow offers an API Key functionality that allows users to access their individual components and flows without going through traditional login authentication. The API Key is a user-specific token that can be included in the request's header or query parameter to authenticate API calls. The following documentation outlines how to generate, use, and manage these API Keys in Langflow. + +## Generating an API Key + +### Through Langflow UI + +{/* add image img/api-key.png */} + + + +1. Click on the "API Key" icon. +2. Click on "Create new secret key". +3. Give it an optional name. +4. Click on "Create secret key". +5. Copy the API key and store it in a secure location. + +## Using the API Key + +### Using the `x-api-key` Header + +Include the `x-api-key` in the HTTP header when making API requests: + +```bash +curl -X POST \ + http://localhost:3000/api/v1/process/ \ + -H 'Content-Type: application/json'\ + -H 'x-api-key: '\ + -d '{"inputs": {"text":""}, "tweaks": {}}' +``` + +With Python using `requests`: + +```python +import requests +from typing import Optional + +BASE_API_URL = "http://localhost:3001/api/v1/process" +FLOW_ID = "4441b773-0724-434e-9cee-19d995d8f2df" +# You can tweak the flow by adding a tweaks dictionary +# e.g {"OpenAI-XXXXX": {"model_name": "gpt-4"}} +TWEAKS = {} + +def run_flow(inputs: dict, + flow_id: str, + tweaks: Optional[dict] = None, + apiKey: Optional[str] = None) -> dict: + """ + Run a flow with a given message and optional tweaks. + + :param message: The message to send to the flow + :param flow_id: The ID of the flow to run + :param tweaks: Optional tweaks to customize the flow + :return: The JSON response from the flow + """ + api_url = f"{BASE_API_URL}/{flow_id}" + + payload = {"inputs": inputs} + headers = {} + + if tweaks: + payload["tweaks"] = tweaks + if apiKey: + headers = {"x-api-key": apiKey} + + response = requests.post(api_url, json=payload, headers=headers) + return response.json() + +# Setup any tweaks you want to apply to the flow +inputs = {"text":""} +api_key = "" +print(run_flow(inputs, flow_id=FLOW_ID, tweaks=TWEAKS, apiKey=api_key)) +``` + +### Using the Query Parameter + +Alternatively, you can include the API key as a query parameter in the URL: + +```bash +curl -X POST \ + http://localhost:3000/api/v1/process/?x-api-key= \ + -H 'Content-Type: application/json'\ + -d '{"inputs": {"text":""}, "tweaks": {}}' +``` + +Or with Python: + +```python +import requests + +BASE_API_URL = "http://localhost:3001/api/v1/process" +FLOW_ID = "4441b773-0724-434e-9cee-19d995d8f2df" +# You can tweak the flow by adding a tweaks dictionary +# e.g {"OpenAI-XXXXX": {"model_name": "gpt-4"}} +TWEAKS = {} + +def run_flow(inputs: dict, + flow_id: str, + tweaks: Optional[dict] = None, + apiKey: Optional[str] = None) -> dict: + """ + Run a flow with a given message and optional tweaks. + + :param message: The message to send to the flow + :param flow_id: The ID of the flow to run + :param tweaks: Optional tweaks to customize the flow + :return: The JSON response from the flow + """ + api_url = f"{BASE_API_URL}/{flow_id}" + + payload = {"inputs": inputs} + headers = {} + + if tweaks: + payload["tweaks"] = tweaks + if apiKey: + api_url += f"?x-api-key={apiKey}" + + response = requests.post(api_url, json=payload, headers=headers) + return response.json() + +# Setup any tweaks you want to apply to the flow +inputs = {"text":""} +api_key = "" +print(run_flow(inputs, flow_id=FLOW_ID, tweaks=TWEAKS, apiKey=api_key)) +``` + +## Security Considerations + +- **Visibility**: The API key won't be retrievable again through the UI for security reasons. +- **Scope**: The key only allows access to the flows and components of the specific user to whom it was issued. + +## Revoking an API Key + +To revoke an API key, simply delete it from the UI. This will immediately invalidate the key and prevent it from being used again. diff --git a/docs/docs/guidelines/async-api.mdx b/docs/docs/guidelines/async-api.mdx new file mode 100644 index 000000000..c5473812e --- /dev/null +++ b/docs/docs/guidelines/async-api.mdx @@ -0,0 +1,73 @@ +import Admonition from "@theme/Admonition"; + +# Asynchronous Processing + +## Introduction + +Starting from version 0.5, Langflow introduces a new feature to its API: the _`sync`_ flag. This flag allows users to opt for asynchronous processing of their flows, freeing up resources and enabling better control over long-running tasks. +This feature supports running tasks in a Celery worker queue and AnyIO task groups for now. + + + This is an experimental feature. The default behavior of the API is still + synchronous processing. The API may change in the future. + + +## The _`sync`_ Flag + +The _`sync`_ flag can be included in the payload of your POST request to the _`/api/v1/process/`_ endpoint. +When set to _`false`_, the API will initiate an asynchronous task instead of processing the flow synchronously. + +### API Request with _`sync`_ flag + +```bash +curl -X POST \ + http://localhost:3000/api/v1/process/ \ + -H 'Content-Type: application/json' \ + -H 'x-api-key: ' \ + -d '{"inputs": {"text": ""}, "tweaks": {}, "sync": false}' +``` + +Response: + +```json +{ + "result": { + "output": "..." + }, + "task": { + "id": "...", + "href": "api/v1/task/" + }, + "session_id": "...", + "backend": "..." // celery or anyio +} +``` + +## Checking Task Status + +You can check the status of an asynchronous task by making a GET request to the `/task/{task_id}` endpoint. + +```bash +curl -X GET \ + http://localhost:3000/api/v1/task/ \ + -H 'x-api-key: ' +``` + +### Response + +The endpoint will return the current status of the task and, if completed, the result of the task. Possible statuses include: + +- _`PENDING`_: The task is waiting for execution. +- _`SUCCESS`_: The task has completed successfully. +- _`FAILURE`_: The task has failed. + +Example response for a completed task: + +```json +{ + "status": "SUCCESS", + "result": { + "output": "..." + } +} +``` diff --git a/docs/docs/guidelines/custom-component.mdx b/docs/docs/guidelines/custom-component.mdx index 816f8356b..4f18d0375 100644 --- a/docs/docs/guidelines/custom-component.mdx +++ b/docs/docs/guidelines/custom-component.mdx @@ -387,7 +387,7 @@ Your structure should look something like this: The recommended way to load custom components is to set the _`LANGFLOW_COMPONENTS_PATH`_ environment variable to the path of your custom components directory. Then, run the Langflow CLI as usual. ```bash -export LANGFLOW_COMPONENTS_PATH=/path/to/components +export LANGFLOW_COMPONENTS_PATH='["/path/to/components"]' langflow ``` diff --git a/docs/docs/guidelines/login.mdx b/docs/docs/guidelines/login.mdx new file mode 100644 index 000000000..85ca1371f --- /dev/null +++ b/docs/docs/guidelines/login.mdx @@ -0,0 +1,128 @@ +import ThemedImage from "@theme/ThemedImage"; +import useBaseUrl from "@docusaurus/useBaseUrl"; +import ZoomableImage from "/src/theme/ZoomableImage.js"; +import ReactPlayer from "react-player"; +import Admonition from "@theme/Admonition"; + +# Sign up and Sign in + +## Introduction + +The login functionality in Langflow serves to authenticate users and protect sensitive routes in the application. Starting from version 0.5, Langflow introduces an enhanced login mechanism that is governed by a few environment variables. This allows new secure features. + +## Environment Variables + +The following environment variables are crucial in configuring the login settings: + +- _`LANGFLOW_AUTO_LOGIN`_: Determines whether Langflow should automatically log users in. Default is `True`. +- _`LANGFLOW_SUPERUSER`_: The username of the superuser. +- _`LANGFLOW_SUPERUSER_PASSWORD`_: The password for the superuser. +- _`LANGFLOW_SECRET_KEY`_: A key used for encrypting the superuser's password. +- _`LANGFLOW_NEW_USER_IS_ACTIVE`_: Determines whether new users are automatically activated. Default is `False`. + +All of these variables can be passed to the CLI command _`langflow run`_ through the _`--env-file`_ option. For example: + +```bash +langflow run --env-file .env +``` + + + It is critical not to expose these environment variables in your code + repository. Always set them securely in your deployment environment, for + example, using Docker secrets, Kubernetes ConfigMaps/Secrets, or dedicated + secure environment configuration systems like AWS Secrets Manager. + + +### _`LANGFLOW_AUTO_LOGIN`_ + +By default, this variable is set to `True`. When enabled (`True`), Langflow operates as it did in versions prior to 0.5โ€”automatic login without requiring explicit user authentication. + +To disable automatic login and enforce user authentication: + +```bash +export LANGFLOW_AUTO_LOGIN=False +``` + +### _`LANGFLOW_SUPERUSER`_ and _`LANGFLOW_SUPERUSER_PASSWORD`_ + +These environment variables are only relevant when `LANGFLOW_AUTO_LOGIN` is set to `False`. They specify the username and password for the superuser, which is essential for administrative tasks. + +To create a superuser manually: + +```bash +export LANGFLOW_SUPERUSER=admin +export LANGFLOW_SUPERUSER_PASSWORD=securepassword +``` + +You can also use the CLI command `langflow superuser` to set up a superuser interactively. + +### _`LANGFLOW_SECRET_KEY`_ + +This environment variable holds a secret key used for encrypting the superuser's password. Make sure to set this to a secure, randomly generated string. + +```bash +export LANGFLOW_SECRET_KEY=randomly_generated_secure_key +``` + +### _`LANGFLOW_NEW_USER_IS_ACTIVE`_ + +By default, this variable is set to `False`. When enabled (`True`), new users are automatically activated and can log in without requiring explicit activation by the superuser. + +## Command-Line Interface + +Langflow provides a command-line utility for managing superusers: + +```bash +langflow superuser +``` + +This command prompts you to enter the username and password for the superuser, unless they are already set using environment variables. + +## Sign-up + +With _`LANGFLOW_AUTO_LOGIN`_ set to _`False`_, Langflow requires users to sign up before they can log in. The sign-up page is the default landing page when a user visits Langflow for the first time. + + + +## Profile settings + +Users can change their profile settings by clicking on the profile icon in the top right corner of the application. This opens a dropdown menu with the following options: + +- **Admin Page**: Opens the admin page, which is only accessible to the superuser. +- **Profile Settings**: Opens the profile settings page. +- **Sign Out**: Logs the user out. + + + +By clicking on **Profile Settings**, the user is taken to the profile settings page, where they can change their password and their profile picture. + + + +By clicking on **Admin Page**, the superuser is taken to the admin page, where they can manage users and groups. + + diff --git a/docs/docs/guides/async-tasks.mdx b/docs/docs/guides/async-tasks.mdx new file mode 100644 index 000000000..e865fe4b6 --- /dev/null +++ b/docs/docs/guides/async-tasks.mdx @@ -0,0 +1,44 @@ +import Admonition from "@theme/Admonition"; + +# Async API + +## Introduction + + + This implementation is still in development. Contributions are welcome! + + +The Async API is an implementation of the Langflow API that uses [Celery](https://docs.celeryproject.org/en/stable/) +to run the tasks asynchronously, using a message broker to send and receive messages, a result backend to store the results and a cache to store the task states and session data. + +### Configuration + +The folder _`./deploy`_ in the [Github repository](https://github.com/logspace-ai/langflow) contains a _`.env.example`_ file that can be used to configure a Langflow deployment. +The file contains the variables required to configure a Celery worker queue, Redis cache and result backend and a RabbitMQ message broker. + +To set it up locally you can copy the file to _`.env`_ and run the following command: + +```bash +docker compose up -d +``` + +This will set up the following containers: + +- Langflow API +- Celery worker +- RabbitMQ message broker +- Redis cache +- PostgreSQL database +- PGAdmin +- Flower +- Traefik +- Grafana +- Prometheus + +### Testing + +To run the tests for the Async API, you can run the following command: + +```bash +docker compose -f docker-compose.with_tests.yml up --exit-code-from tests tests result_backend broker celeryworker db --build +``` diff --git a/docs/docs/guides/langfuse_integration.mdx b/docs/docs/guides/langfuse_integration.mdx new file mode 100644 index 000000000..81f06e787 --- /dev/null +++ b/docs/docs/guides/langfuse_integration.mdx @@ -0,0 +1,49 @@ +# Integrating Langfuse with Langflow + +## Introduction + +Langfuse is an open-source tracing and analytics tool designed for LLM applications. Integrating Langfuse with Langflow provides detailed production traces and granular insights into quality, cost, and latency. This integration allows you to monitor and debug your Langflow's chat or APIs easily. + +## Step-by-Step Instructions + +### Step 1: Create a Langfuse account + +1. Go to [Langfuse](https://langfuse.com) and click on the "Sign In" button in the top right corner. +2. Click on the "Sign Up" button and create an account. +3. Once logged in, click on "Settings" and then on "Create new API keys." +4. Copy the Public key and the Secret Key and save them somewhere safe. + {/* Add these keys to your environment variables in the following step. */} + +### Step 2: Set up Langfuse in Langflow + +1. **Export the Environment Variables**: You'll need to export the environment variables `LANGFLOW_LANGFUSE_SECRET_KEY` and `LANGFLOW_LANGFUSE_PUBLIC_KEY` with the values obtained in Step 1. + + You can do this by executing the following commands in your terminal: + + ```bash + export LANGFLOW_LANGFUSE_SECRET_KEY= + export LANGFLOW_LANGFUSE_PUBLIC_KEY= + ``` + + Alternatively, you can run the Langflow CLI command: + + ```bash + LANGFLOW_LANGFUSE_SECRET_KEY= LANGFLOW_LANGFUSE_PUBLIC_KEY= langflow + ``` + + If you are self-hosting Langfuse, you can also set the environment variable `LANGFLOW_LANGFUSE_HOST` to point to your Langfuse instance. By default, Langfuse points to the cloud instance at `https://cloud.langfuse.com`. + +2. **Verify Integration**: Ensure that the environment variables are set correctly by checking their existence in your environment, for example by running: + + ```bash + echo $LANGFLOW_LANGFUSE_SECRET_KEY + echo $LANGFLOW_LANGFUSE_PUBLIC_KEY + ``` + +3. **Monitor Langflow**: Now, whenever you use Langflow's chat or API, you will be able to see the tracing of your conversations in Langfuse. + +That's it! You have successfully integrated Langfuse with Langflow, enhancing observability and debugging capabilities for your LLM application. + +--- + +Note: For more details or customized configurations, please refer to the official [Langfuse documentation](https://langfuse.com/docs/integrations/langchain). diff --git a/docs/docs/guides/superuser.mdx b/docs/docs/guides/superuser.mdx new file mode 100644 index 000000000..04e0f96af --- /dev/null +++ b/docs/docs/guides/superuser.mdx @@ -0,0 +1,7 @@ +import ThemedImage from "@theme/ThemedImage"; +import useBaseUrl from "@docusaurus/useBaseUrl"; +import ZoomableImage from "/src/theme/ZoomableImage.js"; +import ReactPlayer from "react-player"; + +Now, we need to explain what are the permissions the superuser gets. Once logged in, they can activate new users, +edit them, diff --git a/docs/package-lock.json b/docs/package-lock.json index c0c8a73fd..2cc1ec39b 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -28,7 +28,7 @@ "medium-zoom": "^1.0.8", "node-fetch": "^3.3.1", "path-browserify": "^1.0.1", - "postcss": "^8.4.24", + "postcss": "^8.4.31", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", "react-dom": "^17.0.2", @@ -13956,9 +13956,9 @@ } }, "node_modules/postcss": { - "version": "8.4.25", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", - "integrity": "sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "funding": [ { "type": "opencollective", diff --git a/docs/package.json b/docs/package.json index 277f959a8..93334a383 100644 --- a/docs/package.json +++ b/docs/package.json @@ -34,7 +34,7 @@ "medium-zoom": "^1.0.8", "node-fetch": "^3.3.1", "path-browserify": "^1.0.1", - "postcss": "^8.4.24", + "postcss": "^8.4.31", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/docs/sidebars.js b/docs/sidebars.js index e44b1cf4f..f500d7728 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -16,6 +16,9 @@ module.exports = { label: "Guidelines", collapsed: false, items: [ + "guidelines/login", + "guidelines/api", + "guidelines/async-api", "guidelines/components", "guidelines/features", "guidelines/collection", @@ -51,7 +54,12 @@ module.exports = { type: "category", label: "Step-by-Step Guides", collapsed: false, - items: ["guides/loading_document", "guides/chatprompttemplate_guide"], + items: [ + "guides/async-tasks", + "guides/loading_document", + "guides/chatprompttemplate_guide", + "guides/langfuse_integration", + ], }, // { // type: 'category', @@ -83,7 +91,7 @@ module.exports = { type: "category", label: "Deployment", collapsed: false, - items: ["deployment/gcp-deployment", "deployment/jina-deployment"], + items: ["deployment/gcp-deployment"], }, { type: "category", diff --git a/docs/static/img/admin-page.png b/docs/static/img/admin-page.png new file mode 100644 index 000000000..aa23164de Binary files /dev/null and b/docs/static/img/admin-page.png differ diff --git a/docs/static/img/api-key.png b/docs/static/img/api-key.png new file mode 100644 index 000000000..eb1c8de37 Binary files /dev/null and b/docs/static/img/api-key.png differ diff --git a/docs/static/img/my-account.png b/docs/static/img/my-account.png new file mode 100644 index 000000000..c8b887ca1 Binary files /dev/null and b/docs/static/img/my-account.png differ diff --git a/docs/static/img/profile-settings.png b/docs/static/img/profile-settings.png new file mode 100644 index 000000000..77077d463 Binary files /dev/null and b/docs/static/img/profile-settings.png differ diff --git a/docs/static/img/sign-up.png b/docs/static/img/sign-up.png new file mode 100644 index 000000000..3ffdd1793 Binary files /dev/null and b/docs/static/img/sign-up.png differ diff --git a/poetry.lock b/poetry.lock index 2c72f5ce2..55cea00d2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -166,6 +166,20 @@ typing-extensions = ">=4" [package.extras] tz = ["python-dateutil"] +[[package]] +name = "amqp" +version = "5.1.1" +description = "Low-level AMQP client for Python (fork of amqplib)." +optional = true +python-versions = ">=3.6" +files = [ + {file = "amqp-5.1.1-py3-none-any.whl", hash = "sha256:6f0956d2c23d8fa6e7691934d8c3930eadb44972cbbd1a7ae3a520f735d43359"}, + {file = "amqp-5.1.1.tar.gz", hash = "sha256:2c1b13fecc0893e946c65cbd5f36427861cffa4ea2201d8f6fca22e2a373b5e2"}, +] + +[package.dependencies] +vine = ">=5.0.0" + [[package]] name = "anthropic" version = "0.3.3" @@ -228,17 +242,6 @@ files = [ {file = "appnope-0.1.3.tar.gz", hash = "sha256:02bd91c4de869fbb1e1c50aafc4098827a7a54ab2f39d9dcba6c9547ed920e24"}, ] -[[package]] -name = "argilla" -version = "0.0.1" -description = "" -optional = false -python-versions = "*" -files = [ - {file = "argilla-0.0.1-py3-none-any.whl", hash = "sha256:8bdc3c505bcfb47ba4b91f5658034eae53bf7d4f9317980397605c0c55817396"}, - {file = "argilla-0.0.1.tar.gz", hash = "sha256:5017854754e89f573b31af25b25b803f51cea9ca1fa0bcf00505dee1f45cf7c9"}, -] - [[package]] name = "asgiref" version = "3.7.2" @@ -390,6 +393,17 @@ soupsieve = ">1.2" html5lib = ["html5lib"] lxml = ["lxml"] +[[package]] +name = "billiard" +version = "4.1.0" +description = "Python multiprocessing fork with improvements and bugfixes" +optional = true +python-versions = ">=3.7" +files = [ + {file = "billiard-4.1.0-py3-none-any.whl", hash = "sha256:0f50d6be051c6b2b75bfbc8bfd85af195c5739c281d3f5b86a5640c65563614a"}, + {file = "billiard-4.1.0.tar.gz", hash = "sha256:1ad2eeae8e28053d729ba3373d34d9d6e210f6e4d8bf0a9c64f92bd053f1edf5"}, +] + [[package]] name = "black" version = "23.9.1" @@ -436,6 +450,109 @@ d = ["aiohttp (>=3.7.4)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] +[[package]] +name = "blinker" +version = "1.6.2" +description = "Fast, simple object-to-object and broadcast signaling" +optional = false +python-versions = ">=3.7" +files = [ + {file = "blinker-1.6.2-py3-none-any.whl", hash = "sha256:c3d739772abb7bc2860abf5f2ec284223d9ad5c76da018234f6f50d6f31ab1f0"}, + {file = "blinker-1.6.2.tar.gz", hash = "sha256:4afd3de66ef3a9f8067559fb7a1cbe555c17dcbe15971b05d1b625c3e7abe213"}, +] + +[[package]] +name = "brotli" +version = "1.1.0" +description = "Python bindings for the Brotli compression library" +optional = false +python-versions = "*" +files = [ + {file = "Brotli-1.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e1140c64812cb9b06c922e77f1c26a75ec5e3f0fb2bf92cc8c58720dec276752"}, + {file = "Brotli-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c8fd5270e906eef71d4a8d19b7c6a43760c6abcfcc10c9101d14eb2357418de9"}, + {file = "Brotli-1.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ae56aca0402a0f9a3431cddda62ad71666ca9d4dc3a10a142b9dce2e3c0cda3"}, + {file = "Brotli-1.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:43ce1b9935bfa1ede40028054d7f48b5469cd02733a365eec8a329ffd342915d"}, + {file = "Brotli-1.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:7c4855522edb2e6ae7fdb58e07c3ba9111e7621a8956f481c68d5d979c93032e"}, + {file = "Brotli-1.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:38025d9f30cf4634f8309c6874ef871b841eb3c347e90b0851f63d1ded5212da"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e6a904cb26bfefc2f0a6f240bdf5233be78cd2488900a2f846f3c3ac8489ab80"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a37b8f0391212d29b3a91a799c8e4a2855e0576911cdfb2515487e30e322253d"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:e84799f09591700a4154154cab9787452925578841a94321d5ee8fb9a9a328f0"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f66b5337fa213f1da0d9000bc8dc0cb5b896b726eefd9c6046f699b169c41b9e"}, + {file = "Brotli-1.1.0-cp310-cp310-win32.whl", hash = "sha256:be36e3d172dc816333f33520154d708a2657ea63762ec16b62ece02ab5e4daf2"}, + {file = "Brotli-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:0c6244521dda65ea562d5a69b9a26120769b7a9fb3db2fe9545935ed6735b128"}, + {file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a3daabb76a78f829cafc365531c972016e4aa8d5b4bf60660ad8ecee19df7ccc"}, + {file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c8146669223164fc87a7e3de9f81e9423c67a79d6b3447994dfb9c95da16e2d6"}, + {file = "Brotli-1.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30924eb4c57903d5a7526b08ef4a584acc22ab1ffa085faceb521521d2de32dd"}, + {file = "Brotli-1.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ceb64bbc6eac5a140ca649003756940f8d6a7c444a68af170b3187623b43bebf"}, + {file = "Brotli-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a469274ad18dc0e4d316eefa616d1d0c2ff9da369af19fa6f3daa4f09671fd61"}, + {file = "Brotli-1.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:524f35912131cc2cabb00edfd8d573b07f2d9f21fa824bd3fb19725a9cf06327"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:5b3cc074004d968722f51e550b41a27be656ec48f8afaeeb45ebf65b561481dd"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:19c116e796420b0cee3da1ccec3b764ed2952ccfcc298b55a10e5610ad7885f9"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:510b5b1bfbe20e1a7b3baf5fed9e9451873559a976c1a78eebaa3b86c57b4265"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a1fd8a29719ccce974d523580987b7f8229aeace506952fa9ce1d53a033873c8"}, + {file = "Brotli-1.1.0-cp311-cp311-win32.whl", hash = "sha256:39da8adedf6942d76dc3e46653e52df937a3c4d6d18fdc94a7c29d263b1f5b50"}, + {file = "Brotli-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:aac0411d20e345dc0920bdec5548e438e999ff68d77564d5e9463a7ca9d3e7b1"}, + {file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:316cc9b17edf613ac76b1f1f305d2a748f1b976b033b049a6ecdfd5612c70409"}, + {file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:caf9ee9a5775f3111642d33b86237b05808dafcd6268faa492250e9b78046eb2"}, + {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70051525001750221daa10907c77830bc889cb6d865cc0b813d9db7fefc21451"}, + {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7f4bf76817c14aa98cc6697ac02f3972cb8c3da93e9ef16b9c66573a68014f91"}, + {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0c5516f0aed654134a2fc936325cc2e642f8a0e096d075209672eb321cff408"}, + {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6c3020404e0b5eefd7c9485ccf8393cfb75ec38ce75586e046573c9dc29967a0"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:4ed11165dd45ce798d99a136808a794a748d5dc38511303239d4e2363c0695dc"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4093c631e96fdd49e0377a9c167bfd75b6d0bad2ace734c6eb20b348bc3ea180"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:7e4c4629ddad63006efa0ef968c8e4751c5868ff0b1c5c40f76524e894c50248"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:861bf317735688269936f755fa136a99d1ed526883859f86e41a5d43c61d8966"}, + {file = "Brotli-1.1.0-cp312-cp312-win32.whl", hash = "sha256:5f4d5ea15c9382135076d2fb28dde923352fe02951e66935a9efaac8f10e81b0"}, + {file = "Brotli-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:906bc3a79de8c4ae5b86d3d75a8b77e44404b0f4261714306e3ad248d8ab0951"}, + {file = "Brotli-1.1.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a090ca607cbb6a34b0391776f0cb48062081f5f60ddcce5d11838e67a01928d1"}, + {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2de9d02f5bda03d27ede52e8cfe7b865b066fa49258cbab568720aa5be80a47d"}, + {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2333e30a5e00fe0fe55903c8832e08ee9c3b1382aacf4db26664a16528d51b4b"}, + {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4d4a848d1837973bf0f4b5e54e3bec977d99be36a7895c61abb659301b02c112"}, + {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:fdc3ff3bfccdc6b9cc7c342c03aa2400683f0cb891d46e94b64a197910dc4064"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:5eeb539606f18a0b232d4ba45adccde4125592f3f636a6182b4a8a436548b914"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:fd5f17ff8f14003595ab414e45fce13d073e0762394f957182e69035c9f3d7c2"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:069a121ac97412d1fe506da790b3e69f52254b9df4eb665cd42460c837193354"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e93dfc1a1165e385cc8239fab7c036fb2cd8093728cbd85097b284d7b99249a2"}, + {file = "Brotli-1.1.0-cp36-cp36m-win32.whl", hash = "sha256:a599669fd7c47233438a56936988a2478685e74854088ef5293802123b5b2460"}, + {file = "Brotli-1.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d143fd47fad1db3d7c27a1b1d66162e855b5d50a89666af46e1679c496e8e579"}, + {file = "Brotli-1.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:11d00ed0a83fa22d29bc6b64ef636c4552ebafcef57154b4ddd132f5638fbd1c"}, + {file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f733d788519c7e3e71f0855c96618720f5d3d60c3cb829d8bbb722dddce37985"}, + {file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:929811df5462e182b13920da56c6e0284af407d1de637d8e536c5cd00a7daf60"}, + {file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0b63b949ff929fbc2d6d3ce0e924c9b93c9785d877a21a1b678877ffbbc4423a"}, + {file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:d192f0f30804e55db0d0e0a35d83a9fead0e9a359a9ed0285dbacea60cc10a84"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f296c40e23065d0d6650c4aefe7470d2a25fffda489bcc3eb66083f3ac9f6643"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:919e32f147ae93a09fe064d77d5ebf4e35502a8df75c29fb05788528e330fe74"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:23032ae55523cc7bccb4f6a0bf368cd25ad9bcdcc1990b64a647e7bbcce9cb5b"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:224e57f6eac61cc449f498cc5f0e1725ba2071a3d4f48d5d9dffba42db196438"}, + {file = "Brotli-1.1.0-cp37-cp37m-win32.whl", hash = "sha256:587ca6d3cef6e4e868102672d3bd9dc9698c309ba56d41c2b9c85bbb903cdb95"}, + {file = "Brotli-1.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2954c1c23f81c2eaf0b0717d9380bd348578a94161a65b3a2afc62c86467dd68"}, + {file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:efa8b278894b14d6da122a72fefcebc28445f2d3f880ac59d46c90f4c13be9a3"}, + {file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:03d20af184290887bdea3f0f78c4f737d126c74dc2f3ccadf07e54ceca3bf208"}, + {file = "Brotli-1.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6172447e1b368dcbc458925e5ddaf9113477b0ed542df258d84fa28fc45ceea7"}, + {file = "Brotli-1.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a743e5a28af5f70f9c080380a5f908d4d21d40e8f0e0c8901604d15cfa9ba751"}, + {file = "Brotli-1.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0541e747cce78e24ea12d69176f6a7ddb690e62c425e01d31cc065e69ce55b48"}, + {file = "Brotli-1.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:cdbc1fc1bc0bff1cef838eafe581b55bfbffaed4ed0318b724d0b71d4d377619"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:890b5a14ce214389b2cc36ce82f3093f96f4cc730c1cffdbefff77a7c71f2a97"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ab4fbee0b2d9098c74f3057b2bc055a8bd92ccf02f65944a241b4349229185a"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:141bd4d93984070e097521ed07e2575b46f817d08f9fa42b16b9b5f27b5ac088"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fce1473f3ccc4187f75b4690cfc922628aed4d3dd013d047f95a9b3919a86596"}, + {file = "Brotli-1.1.0-cp38-cp38-win32.whl", hash = "sha256:db85ecf4e609a48f4b29055f1e144231b90edc90af7481aa731ba2d059226b1b"}, + {file = "Brotli-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3d7954194c36e304e1523f55d7042c59dc53ec20dd4e9ea9d151f1b62b4415c0"}, + {file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5fb2ce4b8045c78ebbc7b8f3c15062e435d47e7393cc57c25115cfd49883747a"}, + {file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7905193081db9bfa73b1219140b3d315831cbff0d8941f22da695832f0dd188f"}, + {file = "Brotli-1.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a77def80806c421b4b0af06f45d65a136e7ac0bdca3c09d9e2ea4e515367c7e9"}, + {file = "Brotli-1.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8dadd1314583ec0bf2d1379f7008ad627cd6336625d6679cf2f8e67081b83acf"}, + {file = "Brotli-1.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:901032ff242d479a0efa956d853d16875d42157f98951c0230f69e69f9c09bac"}, + {file = "Brotli-1.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:22fc2a8549ffe699bfba2256ab2ed0421a7b8fadff114a3d201794e45a9ff578"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ae15b066e5ad21366600ebec29a7ccbc86812ed267e4b28e860b8ca16a2bc474"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:949f3b7c29912693cee0afcf09acd6ebc04c57af949d9bf77d6101ebb61e388c"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:89f4988c7203739d48c6f806f1e87a1d96e0806d44f0fba61dba81392c9e474d"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:de6551e370ef19f8de1807d0a9aa2cdfdce2e85ce88b122fe9f6b2b076837e59"}, + {file = "Brotli-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f0d8a7a6b5983c2496e364b969f0e526647a06b075d034f3297dc66f3b360c64"}, + {file = "Brotli-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:cdad5b9014d83ca68c25d2e9444e28e967ef16e80f6b436918c700c117a85467"}, + {file = "Brotli-1.1.0.tar.gz", hash = "sha256:81de08ac11bcb85841e440c13611c00b67d3bf82698314928d0b676362546724"}, +] + [[package]] name = "cachetools" version = "5.3.1" @@ -447,6 +564,62 @@ files = [ {file = "cachetools-5.3.1.tar.gz", hash = "sha256:dce83f2d9b4e1f732a8cd44af8e8fab2dbe46201467fc98b3ef8f269092bf62b"}, ] +[[package]] +name = "celery" +version = "5.3.4" +description = "Distributed Task Queue." +optional = true +python-versions = ">=3.8" +files = [ + {file = "celery-5.3.4-py3-none-any.whl", hash = "sha256:1e6ed40af72695464ce98ca2c201ad0ef8fd192246f6c9eac8bba343b980ad34"}, + {file = "celery-5.3.4.tar.gz", hash = "sha256:9023df6a8962da79eb30c0c84d5f4863d9793a466354cc931d7f72423996de28"}, +] + +[package.dependencies] +billiard = ">=4.1.0,<5.0" +click = ">=8.1.2,<9.0" +click-didyoumean = ">=0.3.0" +click-plugins = ">=1.1.1" +click-repl = ">=0.2.0" +kombu = ">=5.3.2,<6.0" +python-dateutil = ">=2.8.2" +redis = {version = ">=4.5.2,<4.5.5 || >4.5.5,<5.0.0", optional = true, markers = "extra == \"redis\""} +tzdata = ">=2022.7" +vine = ">=5.0.0,<6.0" + +[package.extras] +arangodb = ["pyArango (>=2.0.2)"] +auth = ["cryptography (==41.0.3)"] +azureblockblob = ["azure-storage-blob (>=12.15.0)"] +brotli = ["brotli (>=1.0.0)", "brotlipy (>=0.7.0)"] +cassandra = ["cassandra-driver (>=3.25.0,<4)"] +consul = ["python-consul2 (==0.1.5)"] +cosmosdbsql = ["pydocumentdb (==2.3.5)"] +couchbase = ["couchbase (>=3.0.0)"] +couchdb = ["pycouchdb (==1.14.2)"] +django = ["Django (>=2.2.28)"] +dynamodb = ["boto3 (>=1.26.143)"] +elasticsearch = ["elasticsearch (<8.0)"] +eventlet = ["eventlet (>=0.32.0)"] +gevent = ["gevent (>=1.5.0)"] +librabbitmq = ["librabbitmq (>=2.0.0)"] +memcache = ["pylibmc (==1.6.3)"] +mongodb = ["pymongo[srv] (>=4.0.2)"] +msgpack = ["msgpack (==1.0.5)"] +pymemcache = ["python-memcached (==1.59)"] +pyro = ["pyro4 (==4.82)"] +pytest = ["pytest-celery (==0.0.0)"] +redis = ["redis (>=4.5.2,!=4.5.5,<5.0.0)"] +s3 = ["boto3 (>=1.26.143)"] +slmq = ["softlayer-messaging (>=1.0.3)"] +solar = ["ephem (==4.1.4)"] +sqlalchemy = ["sqlalchemy (>=1.4.48,<2.1)"] +sqs = ["boto3 (>=1.26.143)", "kombu[sqs] (>=5.3.0)", "pycurl (>=7.43.0.5)", "urllib3 (>=1.26.16)"] +tblib = ["tblib (>=1.3.0)", "tblib (>=1.5.0)"] +yaml = ["PyYAML (>=3.10)"] +zookeeper = ["kazoo (>=1.3.1)"] +zstd = ["zstandard (==0.21.0)"] + [[package]] name = "certifi" version = "2023.7.22" @@ -675,6 +848,55 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} +[[package]] +name = "click-didyoumean" +version = "0.3.0" +description = "Enables git-like *did-you-mean* feature in click" +optional = true +python-versions = ">=3.6.2,<4.0.0" +files = [ + {file = "click-didyoumean-0.3.0.tar.gz", hash = "sha256:f184f0d851d96b6d29297354ed981b7dd71df7ff500d82fa6d11f0856bee8035"}, + {file = "click_didyoumean-0.3.0-py3-none-any.whl", hash = "sha256:a0713dc7a1de3f06bc0df5a9567ad19ead2d3d5689b434768a6145bff77c0667"}, +] + +[package.dependencies] +click = ">=7" + +[[package]] +name = "click-plugins" +version = "1.1.1" +description = "An extension module for click to enable registering CLI commands via setuptools entry-points." +optional = true +python-versions = "*" +files = [ + {file = "click-plugins-1.1.1.tar.gz", hash = "sha256:46ab999744a9d831159c3411bb0c79346d94a444df9a3a3742e9ed63645f264b"}, + {file = "click_plugins-1.1.1-py2.py3-none-any.whl", hash = "sha256:5d262006d3222f5057fd81e1623d4443e41dcda5dc815c06b442aa3c02889fc8"}, +] + +[package.dependencies] +click = ">=4.0" + +[package.extras] +dev = ["coveralls", "pytest (>=3.6)", "pytest-cov", "wheel"] + +[[package]] +name = "click-repl" +version = "0.3.0" +description = "REPL plugin for Click" +optional = true +python-versions = ">=3.6" +files = [ + {file = "click-repl-0.3.0.tar.gz", hash = "sha256:17849c23dba3d667247dc4defe1757fff98694e90fe37474f3feebb69ced26a9"}, + {file = "click_repl-0.3.0-py3-none-any.whl", hash = "sha256:fb7e06deb8da8de86180a33a9da97ac316751c094c6899382da7feeeeb51b812"}, +] + +[package.dependencies] +click = ">=7.0" +prompt-toolkit = ">=3.0.36" + +[package.extras] +testing = ["pytest (>=7.2.1)", "pytest-cov (>=4.0.0)", "tox (>=4.4.3)"] + [[package]] name = "clickhouse-connect" version = "0.6.14" @@ -765,13 +987,13 @@ sqlalchemy = ["sqlalchemy (>1.3.21,<2.0)"] [[package]] name = "cohere" -version = "4.17.0" +version = "4.27" description = "" optional = false python-versions = ">=3.7,<4.0" files = [ - {file = "cohere-4.17.0-py3-none-any.whl", hash = "sha256:44e0bdb0a2d9467506d27b285f542177b98f92647f27e17ea921a01006fe2f33"}, - {file = "cohere-4.17.0.tar.gz", hash = "sha256:9f479543b50490b4cb6385468d7571ad891a09cde7bd6b028171596bac6ce6ff"}, + {file = "cohere-4.27-py3-none-any.whl", hash = "sha256:a2b977867a247bf44b2eba1b947acfe44e5881b15cacc40469fbdb117a7f1f55"}, + {file = "cohere-4.27.tar.gz", hash = "sha256:5d61eaca698dcf7f5b0b7cccca269d448e341314fedd921a0cc7c7bbf05f8181"}, ] [package.dependencies] @@ -828,6 +1050,21 @@ lint = ["black (>=22.6.0)", "mdformat (>0.7)", "mdformat-gfm (>=0.3.5)", "ruff ( test = ["pytest"] typing = ["mypy (>=0.990)"] +[[package]] +name = "configargparse" +version = "1.7" +description = "A drop-in replacement for argparse that allows options to also be set via config files and/or environment variables." +optional = false +python-versions = ">=3.5" +files = [ + {file = "ConfigArgParse-1.7-py3-none-any.whl", hash = "sha256:d249da6591465c6c26df64a9f73d2536e743be2f244eb3ebe61114af2f94f86b"}, + {file = "ConfigArgParse-1.7.tar.gz", hash = "sha256:e7067471884de5478c58a511e529f0f9bd1c66bfef1dea90935438d6c23306d1"}, +] + +[package.extras] +test = ["PyYAML", "mock", "pytest"] +yaml = ["PyYAML"] + [[package]] name = "coverage" version = "7.3.2" @@ -962,13 +1199,13 @@ tests = ["pytest"] [[package]] name = "dataclasses-json" -version = "0.5.14" +version = "0.6.1" description = "Easily serialize dataclasses to and from JSON." optional = false -python-versions = ">=3.7,<3.13" +python-versions = ">=3.7,<4.0" files = [ - {file = "dataclasses_json-0.5.14-py3-none-any.whl", hash = "sha256:5ec6fed642adb1dbdb4182badb01e0861badfd8fda82e3b67f44b2d1e9d10d21"}, - {file = "dataclasses_json-0.5.14.tar.gz", hash = "sha256:d82896a94c992ffaf689cd1fafc180164e2abdd415b8f94a7f78586af5886236"}, + {file = "dataclasses_json-0.6.1-py3-none-any.whl", hash = "sha256:1bd8418a61fe3d588bb0079214d7fb71d44937da40742b787256fd53b26b6c80"}, + {file = "dataclasses_json-0.6.1.tar.gz", hash = "sha256:a53c220c35134ce08211a1057fd0e5bf76dc5331627c6b241cacbc570a89faae"}, ] [package.dependencies] @@ -1223,16 +1460,19 @@ gmpy = ["gmpy"] gmpy2 = ["gmpy2"] [[package]] -name = "et-xmlfile" -version = "1.1.0" -description = "An implementation of lxml.xmlfile for the standard library" +name = "emoji" +version = "2.8.0" +description = "Emoji for Python" optional = false -python-versions = ">=3.6" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ - {file = "et_xmlfile-1.1.0-py3-none-any.whl", hash = "sha256:a2ba85d1d6a74ef63837eed693bcb89c3f752169b0e3e7ae5b16ca5e1b3deada"}, - {file = "et_xmlfile-1.1.0.tar.gz", hash = "sha256:8eb9e2bc2f8c97e37a2dc85a09ecdcdec9d8a396530a6d5a33b30b9a92da0c5c"}, + {file = "emoji-2.8.0-py2.py3-none-any.whl", hash = "sha256:a8468fd836b7ecb6d1eac054c9a591701ce0ccd6c6f7779ad71b66f76664df90"}, + {file = "emoji-2.8.0.tar.gz", hash = "sha256:8d8b5dec3c507444b58890e598fc895fcec022b3f5acb49497c6ccc5208b8b00"}, ] +[package.extras] +dev = ["coverage", "coveralls", "pytest"] + [[package]] name = "exceptiongroup" version = "1.1.3" @@ -1325,17 +1565,18 @@ importlib-resources = {version = ">=5.0", markers = "python_version < \"3.10\""} [[package]] name = "fastapi" -version = "0.100.1" +version = "0.103.2" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.7" files = [ - {file = "fastapi-0.100.1-py3-none-any.whl", hash = "sha256:ec6dd52bfc4eff3063cfcd0713b43c87640fefb2687bbbe3d8a08d94049cdf32"}, - {file = "fastapi-0.100.1.tar.gz", hash = "sha256:522700d7a469e4a973d92321ab93312448fbe20fca9c8da97effc7e7bc56df23"}, + {file = "fastapi-0.103.2-py3-none-any.whl", hash = "sha256:3270de872f0fe9ec809d4bd3d4d890c6d5cc7b9611d721d6438f9dacc8c4ef2e"}, + {file = "fastapi-0.103.2.tar.gz", hash = "sha256:75a11f6bfb8fc4d2bec0bd710c2d5f2829659c0e8c0afd5560fdda6ce25ec653"}, ] [package.dependencies] -pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<3.0.0" +anyio = ">=3.7.1,<4.0.0" +pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0" starlette = ">=0.27.0,<0.28.0" typing-extensions = ">=4.5.0" @@ -1410,6 +1651,56 @@ files = [ {file = "filetype-1.2.0.tar.gz", hash = "sha256:66b56cd6474bf41d8c54660347d37afcc3f7d1970648de365c102ef77548aadb"}, ] +[[package]] +name = "flask" +version = "3.0.0" +description = "A simple framework for building complex web applications." +optional = false +python-versions = ">=3.8" +files = [ + {file = "flask-3.0.0-py3-none-any.whl", hash = "sha256:21128f47e4e3b9d597a3e8521a329bf56909b690fcc3fa3e477725aa81367638"}, + {file = "flask-3.0.0.tar.gz", hash = "sha256:cfadcdb638b609361d29ec22360d6070a77d7463dcb3ab08d2c2f2f168845f58"}, +] + +[package.dependencies] +blinker = ">=1.6.2" +click = ">=8.1.3" +importlib-metadata = {version = ">=3.6.0", markers = "python_version < \"3.10\""} +itsdangerous = ">=2.1.2" +Jinja2 = ">=3.1.2" +Werkzeug = ">=3.0.0" + +[package.extras] +async = ["asgiref (>=3.2)"] +dotenv = ["python-dotenv"] + +[[package]] +name = "flask-basicauth" +version = "0.2.0" +description = "HTTP basic access authentication for Flask." +optional = false +python-versions = "*" +files = [ + {file = "Flask-BasicAuth-0.2.0.tar.gz", hash = "sha256:df5ebd489dc0914c224419da059d991eb72988a01cdd4b956d52932ce7d501ff"}, +] + +[package.dependencies] +Flask = "*" + +[[package]] +name = "flask-cors" +version = "4.0.0" +description = "A Flask extension adding a decorator for CORS support" +optional = false +python-versions = "*" +files = [ + {file = "Flask-Cors-4.0.0.tar.gz", hash = "sha256:f268522fcb2f73e2ecdde1ef45e2fd5c71cc48fe03cffb4b441c6d1b40684eb0"}, + {file = "Flask_Cors-4.0.0-py2.py3-none-any.whl", hash = "sha256:bc3492bfd6368d27cfe79c7821df5a8a319e1a6d5eab277a3794be19bdc51783"}, +] + +[package.dependencies] +Flask = ">=0.9" + [[package]] name = "flatbuffers" version = "23.5.26" @@ -1421,6 +1712,24 @@ files = [ {file = "flatbuffers-23.5.26.tar.gz", hash = "sha256:9ea1144cac05ce5d86e2859f431c6cd5e66cd9c78c558317c7955fb8d4c78d89"}, ] +[[package]] +name = "flower" +version = "2.0.1" +description = "Celery Flower" +optional = true +python-versions = ">=3.7" +files = [ + {file = "flower-2.0.1-py2.py3-none-any.whl", hash = "sha256:9db2c621eeefbc844c8dd88be64aef61e84e2deb29b271e02ab2b5b9f01068e2"}, + {file = "flower-2.0.1.tar.gz", hash = "sha256:5ab717b979530770c16afb48b50d2a98d23c3e9fe39851dcf6bc4d01845a02a0"}, +] + +[package.dependencies] +celery = ">=5.0.5" +humanize = "*" +prometheus-client = ">=0.8.0" +pytz = "*" +tornado = ">=5.0.0,<7.0.0" + [[package]] name = "frozenlist" version = "1.4.0" @@ -1526,6 +1835,191 @@ smb = ["smbprotocol"] ssh = ["paramiko"] tqdm = ["tqdm"] +[[package]] +name = "gevent" +version = "23.9.1" +description = "Coroutine-based network library" +optional = false +python-versions = ">=3.8" +files = [ + {file = "gevent-23.9.1-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:a3c5e9b1f766a7a64833334a18539a362fb563f6c4682f9634dea72cbe24f771"}, + {file = "gevent-23.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b101086f109168b23fa3586fccd1133494bdb97f86920a24dc0b23984dc30b69"}, + {file = "gevent-23.9.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:36a549d632c14684bcbbd3014a6ce2666c5f2a500f34d58d32df6c9ea38b6535"}, + {file = "gevent-23.9.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:272cffdf535978d59c38ed837916dfd2b5d193be1e9e5dcc60a5f4d5025dd98a"}, + {file = "gevent-23.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcb8612787a7f4626aa881ff15ff25439561a429f5b303048f0fca8a1c781c39"}, + {file = "gevent-23.9.1-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:d57737860bfc332b9b5aa438963986afe90f49645f6e053140cfa0fa1bdae1ae"}, + {file = "gevent-23.9.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:5f3c781c84794926d853d6fb58554dc0dcc800ba25c41d42f6959c344b4db5a6"}, + {file = "gevent-23.9.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:dbb22a9bbd6a13e925815ce70b940d1578dbe5d4013f20d23e8a11eddf8d14a7"}, + {file = "gevent-23.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:707904027d7130ff3e59ea387dddceedb133cc742b00b3ffe696d567147a9c9e"}, + {file = "gevent-23.9.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:45792c45d60f6ce3d19651d7fde0bc13e01b56bb4db60d3f32ab7d9ec467374c"}, + {file = "gevent-23.9.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e24c2af9638d6c989caffc691a039d7c7022a31c0363da367c0d32ceb4a0648"}, + {file = "gevent-23.9.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e1ead6863e596a8cc2a03e26a7a0981f84b6b3e956101135ff6d02df4d9a6b07"}, + {file = "gevent-23.9.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65883ac026731ac112184680d1f0f1e39fa6f4389fd1fc0bf46cc1388e2599f9"}, + {file = "gevent-23.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf7af500da05363e66f122896012acb6e101a552682f2352b618e541c941a011"}, + {file = "gevent-23.9.1-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:c3e5d2fa532e4d3450595244de8ccf51f5721a05088813c1abd93ad274fe15e7"}, + {file = "gevent-23.9.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c84d34256c243b0a53d4335ef0bc76c735873986d478c53073861a92566a8d71"}, + {file = "gevent-23.9.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ada07076b380918829250201df1d016bdafb3acf352f35e5693b59dceee8dd2e"}, + {file = "gevent-23.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:921dda1c0b84e3d3b1778efa362d61ed29e2b215b90f81d498eb4d8eafcd0b7a"}, + {file = "gevent-23.9.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:ed7a048d3e526a5c1d55c44cb3bc06cfdc1947d06d45006cc4cf60dedc628904"}, + {file = "gevent-23.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7c1abc6f25f475adc33e5fc2dbcc26a732608ac5375d0d306228738a9ae14d3b"}, + {file = "gevent-23.9.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4368f341a5f51611411ec3fc62426f52ac3d6d42eaee9ed0f9eebe715c80184e"}, + {file = "gevent-23.9.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:52b4abf28e837f1865a9bdeef58ff6afd07d1d888b70b6804557e7908032e599"}, + {file = "gevent-23.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:52e9f12cd1cda96603ce6b113d934f1aafb873e2c13182cf8e86d2c5c41982ea"}, + {file = "gevent-23.9.1-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:de350fde10efa87ea60d742901e1053eb2127ebd8b59a7d3b90597eb4e586599"}, + {file = "gevent-23.9.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:fde6402c5432b835fbb7698f1c7f2809c8d6b2bd9d047ac1f5a7c1d5aa569303"}, + {file = "gevent-23.9.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:dd6c32ab977ecf7c7b8c2611ed95fa4aaebd69b74bf08f4b4960ad516861517d"}, + {file = "gevent-23.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:455e5ee8103f722b503fa45dedb04f3ffdec978c1524647f8ba72b4f08490af1"}, + {file = "gevent-23.9.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:7ccf0fd378257cb77d91c116e15c99e533374a8153632c48a3ecae7f7f4f09fe"}, + {file = "gevent-23.9.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d163d59f1be5a4c4efcdd13c2177baaf24aadf721fdf2e1af9ee54a998d160f5"}, + {file = "gevent-23.9.1-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:7532c17bc6c1cbac265e751b95000961715adef35a25d2b0b1813aa7263fb397"}, + {file = "gevent-23.9.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:78eebaf5e73ff91d34df48f4e35581ab4c84e22dd5338ef32714264063c57507"}, + {file = "gevent-23.9.1-cp38-cp38-win32.whl", hash = "sha256:f632487c87866094546a74eefbca2c74c1d03638b715b6feb12e80120960185a"}, + {file = "gevent-23.9.1-cp38-cp38-win_amd64.whl", hash = "sha256:62d121344f7465e3739989ad6b91f53a6ca9110518231553fe5846dbe1b4518f"}, + {file = "gevent-23.9.1-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:bf456bd6b992eb0e1e869e2fd0caf817f0253e55ca7977fd0e72d0336a8c1c6a"}, + {file = "gevent-23.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:43daf68496c03a35287b8b617f9f91e0e7c0d042aebcc060cadc3f049aadd653"}, + {file = "gevent-23.9.1-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:7c28e38dcde327c217fdafb9d5d17d3e772f636f35df15ffae2d933a5587addd"}, + {file = "gevent-23.9.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:fae8d5b5b8fa2a8f63b39f5447168b02db10c888a3e387ed7af2bd1b8612e543"}, + {file = "gevent-23.9.1-cp39-cp39-win32.whl", hash = "sha256:2c7b5c9912378e5f5ccf180d1fdb1e83f42b71823483066eddbe10ef1a2fcaa2"}, + {file = "gevent-23.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:a2898b7048771917d85a1d548fd378e8a7b2ca963db8e17c6d90c76b495e0e2b"}, + {file = "gevent-23.9.1.tar.gz", hash = "sha256:72c002235390d46f94938a96920d8856d4ffd9ddf62a303a0d7c118894097e34"}, +] + +[package.dependencies] +cffi = {version = ">=1.12.2", markers = "platform_python_implementation == \"CPython\" and sys_platform == \"win32\""} +greenlet = {version = ">=2.0.0", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.11\""} +"zope.event" = "*" +"zope.interface" = "*" + +[package.extras] +dnspython = ["dnspython (>=1.16.0,<2.0)", "idna"] +docs = ["furo", "repoze.sphinx.autointerface", "sphinx", "sphinxcontrib-programoutput", "zope.schema"] +monitor = ["psutil (>=5.7.0)"] +recommended = ["cffi (>=1.12.2)", "dnspython (>=1.16.0,<2.0)", "idna", "psutil (>=5.7.0)"] +test = ["cffi (>=1.12.2)", "coverage (>=5.0)", "dnspython (>=1.16.0,<2.0)", "idna", "objgraph", "psutil (>=5.7.0)", "requests", "setuptools"] + +[[package]] +name = "geventhttpclient" +version = "2.0.11" +description = "http client library for gevent" +optional = false +python-versions = "*" +files = [ + {file = "geventhttpclient-2.0.11-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f509176bc7754b1181375a25ec6909425a5997e58c98ea29a36fe8b6a376852f"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:cda51b46d8ab3993763a394ed6601137c32f70cff78dfe703edecb3dfa143009"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:072f24198c0f179fcd8567e9270d5cb78ceea1d562a55b052cd083cf4c67feef"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b97c84e9be76bdd726757437327be5446710eafb64f7097d8d86db9c0f7d280"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:abb32554c1ad103ed1114cee3d75fa6a3c5d8a0898e4e64db68f3fc0f11fb0de"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78a7e493e09d0aa4ba9651147d02fc555159371fecab0e4e96196c72f191322e"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e521089a3a95c98e1742f1a1ea41568b029bc2528cc6fc7ab91bb5d416f1f2c"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:8329c60d94e688d75ec1c6f67a77ab96f726f8ea562a8d48afa1ed6470334a6f"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:572364fc4acd7ff2e77641e6bd1e64cf315d899a7fc48953eac1dd3b6865fd99"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:81e73ee32f4217072935825a0bad7264dc803b0d24cc4e2f4bfcac3fff49a899"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d79ee0d7ab5d775b056400155cab1e3547a7fa6511f6098e25613ed8705ae8b8"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-win32.whl", hash = "sha256:2911d3657e2426b6a2d59af0b52285c1a7c4a78d0e4d03ee4ec1d5195a25a09f"}, + {file = "geventhttpclient-2.0.11-cp310-cp310-win_amd64.whl", hash = "sha256:a489573a0a0559f8960b38795dc53d1e222bc0978b211763d1303b2f94e4c3e0"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:1e27a9521e0ad0d97d0ff81578fd4dd6ae9eee8095d46edb820dfda33c0bd233"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d54b886ce042186a4f731dcbcb4ffa8d674b0542907fc72de20d0b5088adc252"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f2337e10e2ad20970436f216d7b3b8d1503f8e4645d439173a98b4b418fe5768"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f41bcdcec859264a1b6cc7c57bdb9411da8047f17b982cb62756bcc74a1b045b"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f5d73be013a7a2a357eb27d18e5990c773365f63f50a43eaf357d6efb1fd46a6"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c4d86f042501a783e94188ef8b099f32bc4680f2423bbbb56f40158d4556a56b"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aaa2bc31a38dbb387c7539cfa03d3bafaa32151972d34b42f2f648b66778e128"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3e24ff4c398f9e49c5c0740585f12fcf7033dc27a20ec884f3b2c729e2f47f14"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:b70f80528ae74518a16214261abba2a276739e6e35ce518fdbd8be2a3f42f93a"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:efa467997f87d39f774ed1916a9e184c9a936f8fa90ab1a8ebf97aba2ee7ed63"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:4597ea18ddc9838dc0e6cb9d5efb812191f2ca65ab38c115a56894045c73ea40"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-win32.whl", hash = "sha256:a4361c5a522d2a79d8a9047926b8f8926e0f797777da9f450d359bed9f33ac33"}, + {file = "geventhttpclient-2.0.11-cp311-cp311-win_amd64.whl", hash = "sha256:f430257a7b0a75e7f4c0d6f4f3f8960d45b5aae56b8eca7988963487501a52a0"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:a84f48f2eff42171cc446690baffa914122e88cea5b1de44cf6dd1c82b07623b"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:0a21dba9cf5e7511e76845f62dcf5072f4df7415bb8f20e47e0dfde675943a39"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:99feb5581111c7ec44e1ce507b4420947b4c49b363b2fbc3edd543e2ac67a1e0"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1bc799d50db685e093b5819459889f356dd7478a82af66f880832a95fcfa37c3"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:94a8be54ac74ff6cf4703d049766e6ed07787fa9b6a2dd538c46f81de72ffdde"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:71a9e152bb3cb86552f61659f3c7bdc272d9baf21726b3caceb5ab5d0e703fe6"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05a7699b49c9bc478b7ae165809ff97b21811a624791abe3927da5066128a10c"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:598951751b2162b0697cd5b6a9edcc65ec30f34388b6e09caaa0c453fb08fb6e"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4f0c773ceeeedfab56b24b97a0c8f04c58a716dfc7403e51ea898ad01599f1a6"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:ee03ea884e6aa318078c0c7132d246fe92b51d587410532e63b864e6e61ea192"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:98a25e30ddccd49f80e037d48f136050b8f3c24ed9c6a69df7a643989f29c4e8"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-win32.whl", hash = "sha256:968587b59372e825411935e188b9a05dcdec6db6769be3eb3bba949cb414ae98"}, + {file = "geventhttpclient-2.0.11-cp312-cp312-win_amd64.whl", hash = "sha256:465e62fb055e2ca5907606d32d421970f93506309b11a33b367eef33d95a6b7a"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:ba597da51b59df28cf484326d7d59e33a57d3b32d7a4e1646c580f175354d6ce"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c125a225188bcacd51f05878d6e62554116a5be6b3a203cd0ba2460857bc8cd3"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f016093e8d26b724efdeda776968368fb591a57afbded2d86c408db8723e38ce"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a25a7fc768791cf9fe590f1b4f231727441e8f7e9279e8ae2bee83e0f3b010f8"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ae71a7740526be78c6e899b03b63ab47a1a434332f7ca725dcdc916d938d46c6"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:06914f401541681d8cb834652f53e65a8179ea17dd0e496fd52712fd3f548fbb"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:6ccdebfd20ab07ace7aa4dcd020f094d1cae237b4eacfca08ac523cac64e02d3"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:b2bea1386dbfd262571157da319e2285e20844fdbaabb22f95e784ca8b47d90c"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:f468f88df7649bfcc6f74878182d0b7bcb3c23445a76be2b8b59e46224e2c244"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-win32.whl", hash = "sha256:d75c706f2a2401f703585cddf51cb0e43c28b7f12b1998c4a41fd6d14feec89b"}, + {file = "geventhttpclient-2.0.11-cp36-cp36m-win_amd64.whl", hash = "sha256:27f9e22a31451087854204f7f341bd4adc32050180580f74b5de75b61a3b405f"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:105af48455d4eecb4e0f2b2b7f766131811aa1a9a1e768fb020b9ae0ba840ee4"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb9e9c6f3fb902dd622964097df77e0ed9b249b8904b44fc3461734cc791b0aa"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d1b73c37fbecb26475fa6e2d018dab4b5a03c7ba08c8907598605c874a70ee79"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09167de901f5b5273ddc14fd53512cc696495be07f02e3cb8a0335e1ecbff57e"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:52ac561df8d363fe2e00ba4cccea470745129a48bb86f665a1447d0d68abec54"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ceb038cbf92105d124433066685c73e6a4a762c15885f00be2e25663468e4f29"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:0b70eedf64c162067765ddfb30c8f52daeb875c717a3d25f81d5e411e5ac4367"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:e87fb8bd748bf32e9902e9cbea3f20ff5456705d3f53f0a8ea0c4983594457a8"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:0ae01d50529ac739573bc9cbc192b71bf9a13c3fcdbf2054952947a25e9f75a3"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-win32.whl", hash = "sha256:beb3a99e7a0a5130fbed2453348d81a78f2ef7d6aa326b5799c7f3dde88cabea"}, + {file = "geventhttpclient-2.0.11-cp37-cp37m-win_amd64.whl", hash = "sha256:63fc49d73e70cab8316a4d0106c037a2a5d0f6650683af05d0d05d354b694d49"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:106e2ba0ce34a3501651995dd46ed38b87e7b5ada0fb977142d952661853f36a"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0edacd51cd9a6f0b88e25cb6c8744488ba6c7c22044b09de585b2a1224f2a7b9"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2214352e01fef4218bbbc61bd84af6f101bb5a33244088f6db28ff6d1141797f"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38384af2da776563a19951958df65e31ecc7b8d20788d43aff35ec909e4a115f"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:33c4af3aa0312c27668171ea061d461f678848a09a32953b4d895f72a1bde0c9"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d461cdac133d4a4d173e2c1cc213f3a9924e6e092aeebd49bf8924719a073e0b"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ad49019e2828508526d35e7026b95a1fd9ef49ed0cdd2526a5cb3eb39583640"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:a59b164a68bbb1a6f7bee859d7e75ef148b1e9bd72c4810c712cd49603dc37cd"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:6cc44c57c02db1ded6f5a6bd4ccc385c4d13c7ae3528b831e70b5cc87e5b0ad1"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:2d7318b3493c2e21df79429be3dbfefbc254c41a5b5c02c148a4521d59169ad6"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:40df90cd9b5f5f7355526cc538e626466cb60c2e737e9cb8958569377d568e9f"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-win32.whl", hash = "sha256:6f89edc316a8ff967a50c6f98277619786ed6abf2dd36ea905baf840a02b1b1b"}, + {file = "geventhttpclient-2.0.11-cp38-cp38-win_amd64.whl", hash = "sha256:b179a13c113a90c5501f1b1121bdc4c1f816d942280a9c3d2d46aff2bc97269a"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:63826170b520894578bd269b54139bb2f0cc2d96ae1f4a49b3928fe01ffa22ff"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1a6fcc3968ea1adf764bc11b0e7d01b94ffe27bdd21c5b1d9e55be56de6a53c3"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4c61c02c2d32e1b5b1f73d2b201c1e088e956b73e431ed6b5589010faed88380"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aec646409fa6eee277e33a1f4f1860d4c25e0448eedea149df92918d4502f38c"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0b91290138518b201fba98bc82b062ef32e5e3da28843998902852298c354dcf"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b523860ee558f752847b29ad6678d1b8a40154d06bc7a8973132991aff727fdd"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5594bc889a686511039d1efd17473eecc4a91fa01d66a59bfa0a8cf04fb34551"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e573b86999cfeae38c4dd881f05818b9a60245a6763bc77efb48fa136cefdfcc"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:a30bd715480ddbab0217764b516a65e36ecee2e81c9a04d074769eec6e0c1681"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:49ff1c00e64e0820a02fadc6a72b49ae8cc69028caa40170873a3012de98d475"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ea232981e29869524e85b5e6c79ad64abf40dd7b6dc01be6765b5e6bd191fd73"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-win32.whl", hash = "sha256:a0b30fef1eb118927b5d8cab106198883f1bde021e9036277ea2f9e0020e0ad2"}, + {file = "geventhttpclient-2.0.11-cp39-cp39-win_amd64.whl", hash = "sha256:844b30e3694a4d9518fe6f0b167fa3ffc3ea3444563d9fdd7a18a961f6a77d9c"}, + {file = "geventhttpclient-2.0.11-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:94579ec289d46fca939b78cfe91732e82491f3dab03604f974a2e711654e7210"}, + {file = "geventhttpclient-2.0.11-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:955b04deac7ea09a3d5183ba92a3d2a81121ad71d10f1489cb56fd31d0cb4ac4"}, + {file = "geventhttpclient-2.0.11-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7947aae2d7123a970669ebd763a09ef0c85104cda414689dd77b5e5a5c1f2a40"}, + {file = "geventhttpclient-2.0.11-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c483daa1deda0c52a77ed7af2906a38657c15120cb3240bf589dfb139255921"}, + {file = "geventhttpclient-2.0.11-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:bc9634e025f17dc25987ebd5b0461659178ca57052ec70ad65052d0495111a74"}, + {file = "geventhttpclient-2.0.11-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9dca243f58f245872458647b0b6da4be9ce8d707639d76a50d2e8d3f4abb1659"}, + {file = "geventhttpclient-2.0.11-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64d36604974bc2b2ed0166bc666cead87f3c0f2d9487ef73d4e11df9ba6ebcc8"}, + {file = "geventhttpclient-2.0.11-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:46677a56fa9f2f650be74024601b3a1968cfc58a434f5819fc2fc227bb292836"}, + {file = "geventhttpclient-2.0.11-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:989a1ed8dbdaf683dd5701087b736b93e6bacb3c29f4090014e64033cc8620e2"}, + {file = "geventhttpclient-2.0.11-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:9b406ef64382a9c42b88331cdd6639a2b998e8034dbb1b702264d27c01f3ad5d"}, + {file = "geventhttpclient-2.0.11-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:713530c8f67a08ce0d5a4af80045112213c63eacefa1c08b76beebf780c755b0"}, + {file = "geventhttpclient-2.0.11-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd894ec63974fe4e916a1bf6efd35307b86ef53bd88e8fbe61020a289fee2f7c"}, + {file = "geventhttpclient-2.0.11-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e18e622171d09f068b26304b7d3c484d55952813e09eec5b3db1012dc53795de"}, + {file = "geventhttpclient-2.0.11-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ce8421aa0a2307edf04a7086236e7e9f9188ab349154c409d723744032746eb"}, + {file = "geventhttpclient-2.0.11-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:237eba77682553253040588f136a2980dfcd71307202422a17b716e9d8be5614"}, + {file = "geventhttpclient-2.0.11-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:60641b8ff7077a57bb68f1189c8ae8ffc6f14ae238ba6a81748659c30894d580"}, + {file = "geventhttpclient-2.0.11-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5939bca6ab38a482352be8a7141570464d4d18281d8a3a2e2f7a82a0d8c38c4"}, + {file = "geventhttpclient-2.0.11-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:025026620e5a369844b576981ddab25d60e7e3bb0e0657c1fe9360a52769eb9d"}, + {file = "geventhttpclient-2.0.11-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b48b10e2a812b9297ad5c43e7a1a088220940060bbfb84fb721b17ab3012e0d"}, + {file = "geventhttpclient-2.0.11-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:e572e63e51fde06c30beabf8021e7d3f93e198a9c241ef2f3ed16d7828966768"}, + {file = "geventhttpclient-2.0.11.tar.gz", hash = "sha256:549d0f3af08420b9ad2beeda211153c7605b5ba409b228db7f1b81c8bfbec6b4"}, +] + +[package.dependencies] +brotli = "*" +certifi = "*" +gevent = ">=0.13" +six = "*" + [[package]] name = "google-api-core" version = "2.12.0" @@ -1864,13 +2358,13 @@ grpc = ["grpcio (>=1.44.0,<2.0.0.dev0)"] [[package]] name = "gotrue" -version = "1.2.0" +version = "1.1.1" description = "Python Client Library for GoTrue" optional = false python-versions = ">=3.8,<4.0" files = [ - {file = "gotrue-1.2.0-py3-none-any.whl", hash = "sha256:b44fb3807b1ee96751cb7a64a75aa5f21d610a0de2431e4c6e81045d8cda3c79"}, - {file = "gotrue-1.2.0.tar.gz", hash = "sha256:f80befe60d713d5b524e70591fc22df4c5be5821d370585693cd76ac8c45eeeb"}, + {file = "gotrue-1.1.1-py3-none-any.whl", hash = "sha256:d07311a097fc8f9e6ff062b26169d0b820bd6fb4de385f6cee080135d8b5a698"}, + {file = "gotrue-1.1.1.tar.gz", hash = "sha256:03c1593cff85027913bd1af063bcb38a5e79950fb5061768ff02ba7e67172708"}, ] [package.dependencies] @@ -2360,6 +2854,20 @@ files = [ [package.dependencies] pyreadline3 = {version = "*", markers = "sys_platform == \"win32\" and python_version >= \"3.8\""} +[[package]] +name = "humanize" +version = "4.8.0" +description = "Python humanize utilities" +optional = true +python-versions = ">=3.8" +files = [ + {file = "humanize-4.8.0-py3-none-any.whl", hash = "sha256:8bc9e2bb9315e61ec06bf690151ae35aeb65651ab091266941edf97c90836404"}, + {file = "humanize-4.8.0.tar.gz", hash = "sha256:9783373bf1eec713a770ecaa7c2d7a7902c98398009dfa3d8a2df91eec9311e8"}, +] + +[package.extras] +tests = ["freezegun", "pytest", "pytest-cov"] + [[package]] name = "hyperframe" version = "6.0.1" @@ -2503,6 +3011,17 @@ qtconsole = ["qtconsole"] test = ["pytest (<7.1)", "pytest-asyncio", "testpath"] test-extra = ["curio", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.21)", "pandas", "pytest (<7.1)", "pytest-asyncio", "testpath", "trio"] +[[package]] +name = "itsdangerous" +version = "2.1.2" +description = "Safely pass data to untrusted environments and back." +optional = false +python-versions = ">=3.7" +files = [ + {file = "itsdangerous-2.1.2-py3-none-any.whl", hash = "sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44"}, + {file = "itsdangerous-2.1.2.tar.gz", hash = "sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a"}, +] + [[package]] name = "jcloud" version = "0.2.16" @@ -2690,7 +3209,7 @@ full = ["aiohttp", "black (==22.3.0)", "docker", "filelock", "flake8 (==4.0.1)", name = "jinja2" version = "3.1.2" description = "A very fast and expressive template engine." -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"}, @@ -2714,6 +3233,31 @@ files = [ {file = "joblib-1.3.2.tar.gz", hash = "sha256:92f865e621e17784e7955080b6d042489e3b8e294949cc44c6eac304f59772b1"}, ] +[[package]] +name = "jsonpatch" +version = "1.33" +description = "Apply JSON-Patches (RFC 6902)" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*" +files = [ + {file = "jsonpatch-1.33-py2.py3-none-any.whl", hash = "sha256:0ae28c0cd062bbd8b8ecc26d7d164fbbea9652a1a3693f3b956c1eae5145dade"}, + {file = "jsonpatch-1.33.tar.gz", hash = "sha256:9fcd4009c41e6d12348b4a0ff2563ba56a2923a7dfee731d004e212e1ee5030c"}, +] + +[package.dependencies] +jsonpointer = ">=1.9" + +[[package]] +name = "jsonpointer" +version = "2.4" +description = "Identify specific nodes in a JSON document (RFC 6901)" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*" +files = [ + {file = "jsonpointer-2.4-py2.py3-none-any.whl", hash = "sha256:15d51bba20eea3165644553647711d150376234112651b4f1811022aecad7d7a"}, + {file = "jsonpointer-2.4.tar.gz", hash = "sha256:585cee82b70211fa9e6043b7bb89db6e1aa49524340dde8ad6b63206ea689d88"}, +] + [[package]] name = "jupyter-client" version = "8.3.1" @@ -2757,23 +3301,57 @@ traitlets = ">=5.3" docs = ["myst-parser", "sphinx-autodoc-typehints", "sphinxcontrib-github-alt", "sphinxcontrib-spelling", "traitlets"] test = ["ipykernel", "pre-commit", "pytest", "pytest-cov", "pytest-timeout"] +[[package]] +name = "kombu" +version = "5.3.2" +description = "Messaging library for Python." +optional = true +python-versions = ">=3.8" +files = [ + {file = "kombu-5.3.2-py3-none-any.whl", hash = "sha256:b753c9cfc9b1e976e637a7cbc1a65d446a22e45546cd996ea28f932082b7dc9e"}, + {file = "kombu-5.3.2.tar.gz", hash = "sha256:0ba213f630a2cb2772728aef56ac6883dc3a2f13435e10048f6e97d48506dbbd"}, +] + +[package.dependencies] +amqp = ">=5.1.1,<6.0.0" +typing-extensions = {version = "*", markers = "python_version < \"3.10\""} +vine = "*" + +[package.extras] +azureservicebus = ["azure-servicebus (>=7.10.0)"] +azurestoragequeues = ["azure-identity (>=1.12.0)", "azure-storage-queue (>=12.6.0)"] +confluentkafka = ["confluent-kafka (==2.1.1)"] +consul = ["python-consul2"] +librabbitmq = ["librabbitmq (>=2.0.0)"] +mongodb = ["pymongo (>=4.1.1)"] +msgpack = ["msgpack"] +pyro = ["pyro4"] +qpid = ["qpid-python (>=0.26)", "qpid-tools (>=0.26)"] +redis = ["redis (>=4.5.2)"] +slmq = ["softlayer-messaging (>=1.0.3)"] +sqlalchemy = ["sqlalchemy (>=1.4.48,<2.1)"] +sqs = ["boto3 (>=1.26.143)", "pycurl (>=7.43.0.5)", "urllib3 (>=1.26.16)"] +yaml = ["PyYAML (>=3.10)"] +zookeeper = ["kazoo (>=2.8.0)"] + [[package]] name = "langchain" -version = "0.0.274" +version = "0.0.308" description = "Building applications with LLMs through composability" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langchain-0.0.274-py3-none-any.whl", hash = "sha256:402e0518a2e3183498158c159cd50f7d13e948908430f682eebe2741a51ebc2a"}, - {file = "langchain-0.0.274.tar.gz", hash = "sha256:adc2cf9993765c9d241aae6079497b0f62090bebff05aa985dd92e1b10b8cacb"}, + {file = "langchain-0.0.308-py3-none-any.whl", hash = "sha256:807de0a8f4177e42e435682cfd33e600518d04e1688149afda8542b9d31a407f"}, + {file = "langchain-0.0.308.tar.gz", hash = "sha256:496ddef6c0aa8e73b3c28bad8c4cb02cdb7330e8ba80b238f1b3e0d663756b1b"}, ] [package.dependencies] aiohttp = ">=3.8.3,<4.0.0" +anyio = "<4.0" async-timeout = {version = ">=4.0.0,<5.0.0", markers = "python_version < \"3.11\""} -dataclasses-json = ">=0.5.7,<0.6.0" -langsmith = ">=0.0.21,<0.1.0" -numexpr = ">=2.8.4,<3.0.0" +dataclasses-json = ">=0.5.7,<0.7" +jsonpatch = ">=1.33,<2.0" +langsmith = ">=0.0.40,<0.1.0" numpy = ">=1,<2" pydantic = ">=1,<3" PyYAML = ">=5.3" @@ -2782,16 +3360,16 @@ 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,<3.0.0)", "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.4.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.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)"] 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)"] cohere = ["cohere (>=4,<5)"] docarray = ["docarray[hnswlib] (>=0.32.0,<0.33.0)"] embeddings = ["sentence-transformers (>=2,<3)"] -extended-testing = ["amazon-textract-caller (<2)", "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.0.7,<0.0.8)", "chardet (>=5.1.0,<6.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)", "mwparserfromhell (>=0.6.4,<0.7.0)", "mwxml (>=0.3.3,<0.4.0)", "newspaper3k (>=0.2.8,<0.3.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)", "streamlit (>=1.18.0,<2.0.0)", "sympy (>=1.12,<2.0)", "telethon (>=1.28.5,<2.0.0)", "tqdm (>=4.48.0)", "xata (>=1.0.0a7,<2.0.0)", "xmltodict (>=0.13.0,<0.14.0)"] +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)"] 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.4.0)"] +openai = ["openai (>=0,<1)", "tiktoken (>=0.3.2,<0.6.0)"] qdrant = ["qdrant-client (>=1.3.1,<2.0.0)"] text-helpers = ["chardet (>=5.1.0,<6.0.0)"] @@ -2810,65 +3388,54 @@ files = [ langchain = ">=0.0.239" [[package]] -name = "langchain-serve" -version = "0.0.61" -description = "Langchain Serve - serve your langchain apps on Jina AI Cloud." -optional = true +name = "langdetect" +version = "1.0.9" +description = "Language detection library ported from Google's language-detection." +optional = false python-versions = "*" files = [ - {file = "langchain-serve-0.0.61.tar.gz", hash = "sha256:f13d8b84f46b3789e7813deba798c04fa1d0a155bf5e1bf8b9addb7d6c01614c"}, + {file = "langdetect-1.0.9-py2-none-any.whl", hash = "sha256:7cbc0746252f19e76f77c0b1690aadf01963be835ef0cd4b56dddf2a8f1dfc2a"}, + {file = "langdetect-1.0.9.tar.gz", hash = "sha256:cbc1fef89f8d062739774bd51eda3da3274006b3661d199c2655f6b3f6d605a0"}, ] [package.dependencies] -click = "*" -jcloud = ">=0.2.16" -jina = "3.15.2" -jina-hubble-sdk = "*" -langchain = "*" -nest-asyncio = "*" -requests = "*" -slack_bolt = "*" -textual = "*" -toml = "*" +six = "*" -[package.extras] -test = ["psutil", "pytest", "pytest-asyncio"] +[[package]] +name = "langfuse" +version = "1.0.30" +description = "A client library for accessing langfuse" +optional = false +python-versions = ">=3.8,<4.0" +files = [ + {file = "langfuse-1.0.30-py3-none-any.whl", hash = "sha256:b07afe7c19086c3c9879481025174e3c6ff34431ab6385bda75d6e3bbe62ab59"}, + {file = "langfuse-1.0.30.tar.gz", hash = "sha256:24c59c29363ea325542a5ab8422eca1854afe9aded3aed1e1935d03f7e1b1b85"}, +] + +[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" +pydantic = ">=1.10.7,<2.0" +python-dateutil = ">=2.8.0,<3.0" +pytz = ">=2023.3,<2024.0" [[package]] name = "langsmith" -version = "0.0.42" +version = "0.0.41" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langsmith-0.0.42-py3-none-any.whl", hash = "sha256:e10a5084bdd71735a00e91850d4a293b6206825834027676d76fec8d0d044d0a"}, - {file = "langsmith-0.0.42.tar.gz", hash = "sha256:66fec6bce07cd18c8d9a7b9d7be216de5f7a93790c2f4cf37efb6956f9fffbf6"}, + {file = "langsmith-0.0.41-py3-none-any.whl", hash = "sha256:a555bef3d51e37bce284090b155e2148ec4098efa96ee918b3092c43c4bfaa77"}, + {file = "langsmith-0.0.41.tar.gz", hash = "sha256:ea05649bb140d6e58614e171df6539410b77ce393c23545453278677e916e351"}, ] [package.dependencies] pydantic = ">=1,<3" requests = ">=2,<3" -[[package]] -name = "linkify-it-py" -version = "2.0.2" -description = "Links recognition library with FULL unicode support." -optional = true -python-versions = ">=3.7" -files = [ - {file = "linkify-it-py-2.0.2.tar.gz", hash = "sha256:19f3060727842c254c808e99d465c80c49d2c7306788140987a1a7a29b0d6ad2"}, - {file = "linkify_it_py-2.0.2-py3-none-any.whl", hash = "sha256:a3a24428f6c96f27370d7fe61d2ac0be09017be5190d68d8658233171f1b6541"}, -] - -[package.dependencies] -uc-micro-py = "*" - -[package.extras] -benchmark = ["pytest", "pytest-benchmark"] -dev = ["black", "flake8", "isort", "pre-commit", "pyproject-flake8"] -doc = ["myst-parser", "sphinx", "sphinx-book-theme"] -test = ["coverage", "pytest", "pytest-cov"] - [[package]] name = "llama-cpp-python" version = "0.1.85" @@ -2887,6 +3454,33 @@ typing-extensions = ">=4.5.0" [package.extras] server = ["fastapi (>=0.100.0)", "pydantic-settings (>=2.0.1)", "sse-starlette (>=1.6.1)", "uvicorn (>=0.22.0)"] +[[package]] +name = "locust" +version = "2.16.1" +description = "Developer friendly load testing framework" +optional = false +python-versions = ">=3.7" +files = [ + {file = "locust-2.16.1-py3-none-any.whl", hash = "sha256:d0f01f9fca6a7d9be987b32185799d9e219fce3b9a3b8250ea03e88003335804"}, + {file = "locust-2.16.1.tar.gz", hash = "sha256:cd54f179b679ae927e9b3ffd2b6a7c89c1078103cfbe96b4dd53c7872774b619"}, +] + +[package.dependencies] +ConfigArgParse = ">=1.0" +flask = ">=2.0.0" +Flask-BasicAuth = ">=0.2.0" +Flask-Cors = ">=3.0.10" +gevent = ">=20.12.1" +geventhttpclient = ">=2.0.2" +msgpack = ">=0.6.2" +psutil = ">=5.6.7" +pywin32 = {version = "*", markers = "platform_system == \"Windows\""} +pyzmq = ">=22.2.1,<23.0.0 || >23.0.0" +requests = ">=2.23.0" +roundrobin = ">=0.0.2" +typing-extensions = ">=3.7.4.3" +Werkzeug = ">=2.0.0" + [[package]] name = "loguru" version = "0.7.2" @@ -3069,24 +3663,6 @@ babel = ["Babel"] lingua = ["lingua"] testing = ["pytest"] -[[package]] -name = "markdown" -version = "3.4.4" -description = "Python implementation of John Gruber's Markdown." -optional = false -python-versions = ">=3.7" -files = [ - {file = "Markdown-3.4.4-py3-none-any.whl", hash = "sha256:a4c1b65c0957b4bd9e7d86ddc7b3c9868fb9670660f6f99f6d1bca8954d5a941"}, - {file = "Markdown-3.4.4.tar.gz", hash = "sha256:225c6123522495d4119a90b3a3ba31a1e87a70369e03f14799ea9c0d7183a3d6"}, -] - -[package.dependencies] -importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""} - -[package.extras] -docs = ["mdx-gh-links (>=0.2)", "mkdocs (>=1.0)", "mkdocs-nature (>=0.4)"] -testing = ["coverage", "pyyaml"] - [[package]] name = "markdown-it-py" version = "3.0.0" @@ -3099,8 +3675,6 @@ files = [ ] [package.dependencies] -linkify-it-py = {version = ">=1,<3", optional = true, markers = "extra == \"linkify\""} -mdit-py-plugins = {version = "*", optional = true, markers = "extra == \"plugins\""} mdurl = ">=0.1,<1.0" [package.extras] @@ -3206,25 +3780,6 @@ files = [ [package.dependencies] traitlets = "*" -[[package]] -name = "mdit-py-plugins" -version = "0.4.0" -description = "Collection of plugins for markdown-it-py" -optional = true -python-versions = ">=3.8" -files = [ - {file = "mdit_py_plugins-0.4.0-py3-none-any.whl", hash = "sha256:b51b3bb70691f57f974e257e367107857a93b36f322a9e6d44ca5bf28ec2def9"}, - {file = "mdit_py_plugins-0.4.0.tar.gz", hash = "sha256:d8ab27e9aed6c38aa716819fedfde15ca275715955f8a185a8e1cf90fb1d2c1b"}, -] - -[package.dependencies] -markdown-it-py = ">=1.0.0,<4.0.0" - -[package.extras] -code-style = ["pre-commit"] -rtd = ["myst-parser", "sphinx-book-theme"] -testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] - [[package]] name = "mdurl" version = "0.1.2" @@ -3236,6 +3791,21 @@ files = [ {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, ] +[[package]] +name = "metal-sdk" +version = "2.2.0" +description = "SDK for getmetal.io" +optional = false +python-versions = ">=3.7" +files = [ + {file = "metal_sdk-2.2.0-py3-none-any.whl", hash = "sha256:60ed77606b6c192a491b5eeff2e6db5535051cd119a17b1d7d277f4f9937a488"}, + {file = "metal_sdk-2.2.0.tar.gz", hash = "sha256:b0e25584f2ed8f0a1270be3081e228cbbfca92762f31af034eb2453217bc5bf4"}, +] + +[package.dependencies] +httpx = "*" +typing-extensions = "*" + [[package]] name = "metaphor-python" version = "0.1.16" @@ -3279,22 +3849,70 @@ gmpy = ["gmpy2 (>=2.1.0a4)"] tests = ["pytest (>=4.6)"] [[package]] -name = "msg-parser" -version = "1.2.0" -description = "This module enables reading, parsing and converting Microsoft Outlook MSG E-Mail files." +name = "msgpack" +version = "1.0.7" +description = "MessagePack serializer" optional = false -python-versions = ">=3.4" +python-versions = ">=3.8" files = [ - {file = "msg_parser-1.2.0-py2.py3-none-any.whl", hash = "sha256:d47a2f0b2a359cb189fad83cc991b63ea781ecc70d91410324273fbf93e95375"}, - {file = "msg_parser-1.2.0.tar.gz", hash = "sha256:0de858d4fcebb6c8f6f028da83a17a20fe01cdce67c490779cf43b3b0162aa66"}, + {file = "msgpack-1.0.7-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:04ad6069c86e531682f9e1e71b71c1c3937d6014a7c3e9edd2aa81ad58842862"}, + {file = "msgpack-1.0.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:cca1b62fe70d761a282496b96a5e51c44c213e410a964bdffe0928e611368329"}, + {file = "msgpack-1.0.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e50ebce52f41370707f1e21a59514e3375e3edd6e1832f5e5235237db933c98b"}, + {file = "msgpack-1.0.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a7b4f35de6a304b5533c238bee86b670b75b03d31b7797929caa7a624b5dda6"}, + {file = "msgpack-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28efb066cde83c479dfe5a48141a53bc7e5f13f785b92ddde336c716663039ee"}, + {file = "msgpack-1.0.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4cb14ce54d9b857be9591ac364cb08dc2d6a5c4318c1182cb1d02274029d590d"}, + {file = "msgpack-1.0.7-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b573a43ef7c368ba4ea06050a957c2a7550f729c31f11dd616d2ac4aba99888d"}, + {file = "msgpack-1.0.7-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ccf9a39706b604d884d2cb1e27fe973bc55f2890c52f38df742bc1d79ab9f5e1"}, + {file = "msgpack-1.0.7-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:cb70766519500281815dfd7a87d3a178acf7ce95390544b8c90587d76b227681"}, + {file = "msgpack-1.0.7-cp310-cp310-win32.whl", hash = "sha256:b610ff0f24e9f11c9ae653c67ff8cc03c075131401b3e5ef4b82570d1728f8a9"}, + {file = "msgpack-1.0.7-cp310-cp310-win_amd64.whl", hash = "sha256:a40821a89dc373d6427e2b44b572efc36a2778d3f543299e2f24eb1a5de65415"}, + {file = "msgpack-1.0.7-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:576eb384292b139821c41995523654ad82d1916da6a60cff129c715a6223ea84"}, + {file = "msgpack-1.0.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:730076207cb816138cf1af7f7237b208340a2c5e749707457d70705715c93b93"}, + {file = "msgpack-1.0.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:85765fdf4b27eb5086f05ac0491090fc76f4f2b28e09d9350c31aac25a5aaff8"}, + {file = "msgpack-1.0.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3476fae43db72bd11f29a5147ae2f3cb22e2f1a91d575ef130d2bf49afd21c46"}, + {file = "msgpack-1.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d4c80667de2e36970ebf74f42d1088cc9ee7ef5f4e8c35eee1b40eafd33ca5b"}, + {file = "msgpack-1.0.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5b0bf0effb196ed76b7ad883848143427a73c355ae8e569fa538365064188b8e"}, + {file = "msgpack-1.0.7-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:f9a7c509542db4eceed3dcf21ee5267ab565a83555c9b88a8109dcecc4709002"}, + {file = "msgpack-1.0.7-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:84b0daf226913133f899ea9b30618722d45feffa67e4fe867b0b5ae83a34060c"}, + {file = "msgpack-1.0.7-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ec79ff6159dffcc30853b2ad612ed572af86c92b5168aa3fc01a67b0fa40665e"}, + {file = "msgpack-1.0.7-cp311-cp311-win32.whl", hash = "sha256:3e7bf4442b310ff154b7bb9d81eb2c016b7d597e364f97d72b1acc3817a0fdc1"}, + {file = "msgpack-1.0.7-cp311-cp311-win_amd64.whl", hash = "sha256:3f0c8c6dfa6605ab8ff0611995ee30d4f9fcff89966cf562733b4008a3d60d82"}, + {file = "msgpack-1.0.7-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f0936e08e0003f66bfd97e74ee530427707297b0d0361247e9b4f59ab78ddc8b"}, + {file = "msgpack-1.0.7-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:98bbd754a422a0b123c66a4c341de0474cad4a5c10c164ceed6ea090f3563db4"}, + {file = "msgpack-1.0.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b291f0ee7961a597cbbcc77709374087fa2a9afe7bdb6a40dbbd9b127e79afee"}, + {file = "msgpack-1.0.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebbbba226f0a108a7366bf4b59bf0f30a12fd5e75100c630267d94d7f0ad20e5"}, + {file = "msgpack-1.0.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e2d69948e4132813b8d1131f29f9101bc2c915f26089a6d632001a5c1349672"}, + {file = "msgpack-1.0.7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bdf38ba2d393c7911ae989c3bbba510ebbcdf4ecbdbfec36272abe350c454075"}, + {file = "msgpack-1.0.7-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:993584fc821c58d5993521bfdcd31a4adf025c7d745bbd4d12ccfecf695af5ba"}, + {file = "msgpack-1.0.7-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:52700dc63a4676669b341ba33520f4d6e43d3ca58d422e22ba66d1736b0a6e4c"}, + {file = "msgpack-1.0.7-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:e45ae4927759289c30ccba8d9fdce62bb414977ba158286b5ddaf8df2cddb5c5"}, + {file = "msgpack-1.0.7-cp312-cp312-win32.whl", hash = "sha256:27dcd6f46a21c18fa5e5deed92a43d4554e3df8d8ca5a47bf0615d6a5f39dbc9"}, + {file = "msgpack-1.0.7-cp312-cp312-win_amd64.whl", hash = "sha256:7687e22a31e976a0e7fc99c2f4d11ca45eff652a81eb8c8085e9609298916dcf"}, + {file = "msgpack-1.0.7-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5b6ccc0c85916998d788b295765ea0e9cb9aac7e4a8ed71d12e7d8ac31c23c95"}, + {file = "msgpack-1.0.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:235a31ec7db685f5c82233bddf9858748b89b8119bf4538d514536c485c15fe0"}, + {file = "msgpack-1.0.7-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cab3db8bab4b7e635c1c97270d7a4b2a90c070b33cbc00c99ef3f9be03d3e1f7"}, + {file = "msgpack-1.0.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0bfdd914e55e0d2c9e1526de210f6fe8ffe9705f2b1dfcc4aecc92a4cb4b533d"}, + {file = "msgpack-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:36e17c4592231a7dbd2ed09027823ab295d2791b3b1efb2aee874b10548b7524"}, + {file = "msgpack-1.0.7-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:38949d30b11ae5f95c3c91917ee7a6b239f5ec276f271f28638dec9156f82cfc"}, + {file = "msgpack-1.0.7-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ff1d0899f104f3921d94579a5638847f783c9b04f2d5f229392ca77fba5b82fc"}, + {file = "msgpack-1.0.7-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:dc43f1ec66eb8440567186ae2f8c447d91e0372d793dfe8c222aec857b81a8cf"}, + {file = "msgpack-1.0.7-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:dd632777ff3beaaf629f1ab4396caf7ba0bdd075d948a69460d13d44357aca4c"}, + {file = "msgpack-1.0.7-cp38-cp38-win32.whl", hash = "sha256:4e71bc4416de195d6e9b4ee93ad3f2f6b2ce11d042b4d7a7ee00bbe0358bd0c2"}, + {file = "msgpack-1.0.7-cp38-cp38-win_amd64.whl", hash = "sha256:8f5b234f567cf76ee489502ceb7165c2a5cecec081db2b37e35332b537f8157c"}, + {file = "msgpack-1.0.7-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:bfef2bb6ef068827bbd021017a107194956918ab43ce4d6dc945ffa13efbc25f"}, + {file = "msgpack-1.0.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:484ae3240666ad34cfa31eea7b8c6cd2f1fdaae21d73ce2974211df099a95d81"}, + {file = "msgpack-1.0.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3967e4ad1aa9da62fd53e346ed17d7b2e922cba5ab93bdd46febcac39be636fc"}, + {file = "msgpack-1.0.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8dd178c4c80706546702c59529ffc005681bd6dc2ea234c450661b205445a34d"}, + {file = "msgpack-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f6ffbc252eb0d229aeb2f9ad051200668fc3a9aaa8994e49f0cb2ffe2b7867e7"}, + {file = "msgpack-1.0.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:822ea70dc4018c7e6223f13affd1c5c30c0f5c12ac1f96cd8e9949acddb48a61"}, + {file = "msgpack-1.0.7-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:384d779f0d6f1b110eae74cb0659d9aa6ff35aaf547b3955abf2ab4c901c4819"}, + {file = "msgpack-1.0.7-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f64e376cd20d3f030190e8c32e1c64582eba56ac6dc7d5b0b49a9d44021b52fd"}, + {file = "msgpack-1.0.7-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5ed82f5a7af3697b1c4786053736f24a0efd0a1b8a130d4c7bfee4b9ded0f08f"}, + {file = "msgpack-1.0.7-cp39-cp39-win32.whl", hash = "sha256:f26a07a6e877c76a88e3cecac8531908d980d3d5067ff69213653649ec0f60ad"}, + {file = "msgpack-1.0.7-cp39-cp39-win_amd64.whl", hash = "sha256:1dc93e8e4653bdb5910aed79f11e165c85732067614f180f70534f056da97db3"}, + {file = "msgpack-1.0.7.tar.gz", hash = "sha256:572efc93db7a4d27e404501975ca6d2d9775705c2d922390d878fcf768d92c87"}, ] -[package.dependencies] -olefile = ">=0.46" - -[package.extras] -rtf = ["compressed-rtf (>=1.0.5)"] - [[package]] name = "multidict" version = "6.0.4" @@ -3517,47 +4135,6 @@ plot = ["matplotlib"] tgrep = ["pyparsing"] twitter = ["twython"] -[[package]] -name = "numexpr" -version = "2.8.7" -description = "Fast numerical expression evaluator for NumPy" -optional = false -python-versions = ">=3.9" -files = [ - {file = "numexpr-2.8.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d88531ffea3ea9287e8a1665c6a2d0206d3f4660d5244423e2a134a7f0ce5fba"}, - {file = "numexpr-2.8.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:db1065ba663a854115cf1f493afd7206e2efcef6643129e8061e97a51ad66ebb"}, - {file = "numexpr-2.8.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a4546416004ff2e7eb9cf52c2d7ab82732b1b505593193ee9f93fa770edc5230"}, - {file = "numexpr-2.8.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cb2f473fdfd09d17db3038e34818d05b6bc561a36785aa927d6c0e06bccc9911"}, - {file = "numexpr-2.8.7-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:5496fc9e3ae214637cbca1ab556b0e602bd3afe9ff4c943a29c482430972cda8"}, - {file = "numexpr-2.8.7-cp310-cp310-win32.whl", hash = "sha256:d43f1f0253a6f2db2f76214e6f7ae9611b422cba3f7d4c86415d7a78bbbd606f"}, - {file = "numexpr-2.8.7-cp310-cp310-win_amd64.whl", hash = "sha256:cf5f112bce5c5966c47cc33700bc14ce745c8351d437ed57a9574fff581f341a"}, - {file = "numexpr-2.8.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:32934d51b5bc8a6636436326da79ed380e2f151989968789cf65b1210572cb46"}, - {file = "numexpr-2.8.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f021ac93cb3dd5d8ba2882627b615b1f58cb089dcc85764c6fbe7a549ed21b0c"}, - {file = "numexpr-2.8.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dccf572763517db6562fb7b17db46aacbbf62a9ca0a66672872f4f71aee7b186"}, - {file = "numexpr-2.8.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:11121b14ee3179bade92e823f25f1b94e18716d33845db5081973331188c3338"}, - {file = "numexpr-2.8.7-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:81451962d4145a46dba189df65df101d4d1caddb6efe6ebfe05982cd9f62b2cf"}, - {file = "numexpr-2.8.7-cp311-cp311-win32.whl", hash = "sha256:da55ba845b847cc33c4bf81cee4b1bddfb0831118cabff8db62888ab8697ec34"}, - {file = "numexpr-2.8.7-cp311-cp311-win_amd64.whl", hash = "sha256:fd93b88d5332069916fa00829ea1b972b7e73abcb1081eee5c905a514b8b59e3"}, - {file = "numexpr-2.8.7-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5340d2c86d83f52e1a3e7fd97c37d358ae99af9de316bdeeab2565b9b1e622ca"}, - {file = "numexpr-2.8.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f3bdf8cbc00c77a46230c765d242f92d35905c239b20c256c48dbac91e49f253"}, - {file = "numexpr-2.8.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d46c47e361fa60966a3339cb4f463ae6151ce7d78ed38075f06e8585d2c8929f"}, - {file = "numexpr-2.8.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a371cfc1670a18eea2d5c70abaa95a0e8824b70d28da884bad11931266e3a0ca"}, - {file = "numexpr-2.8.7-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:47a249cecd1382d482a5bf1fac0d11392fb2ed0f7d415ebc4cd901959deb1ec9"}, - {file = "numexpr-2.8.7-cp312-cp312-win32.whl", hash = "sha256:b8a5b2c21c26b62875bf819d375d798b96a32644e3c28bd4ce7789ed1fb489da"}, - {file = "numexpr-2.8.7-cp312-cp312-win_amd64.whl", hash = "sha256:f29f4d08d9b0ed6fa5d32082971294b2f9131b8577c2b7c36432ed670924313f"}, - {file = "numexpr-2.8.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4ecaa5be24cf8fa0f00108e9dfa1021b7510e9dd9d159b8d8bc7c7ddbb995b31"}, - {file = "numexpr-2.8.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3a84284e0a407ca52980fd20962e89aff671c84cd6e73458f2e29ea2aa206356"}, - {file = "numexpr-2.8.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e838289e3b7bbe100b99e35496e6cc4cc0541c2207078941ee5a1d46e6b925ae"}, - {file = "numexpr-2.8.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0983052f308ea75dd232eb7f4729eed839db8fe8d82289940342b32cc55b15d0"}, - {file = "numexpr-2.8.7-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8bf005acd7f1985c71b1b247aaac8950d6ea05a0fe0bbbbf3f96cd398b136daa"}, - {file = "numexpr-2.8.7-cp39-cp39-win32.whl", hash = "sha256:56ec95f8d1db0819e64987dcf1789acd500fa4ea396eeabe4af6efdcb8902d07"}, - {file = "numexpr-2.8.7-cp39-cp39-win_amd64.whl", hash = "sha256:c7bf60fc1a9c90a9cb21c4c235723e579bff70c8d5362228cb2cf34426104ba2"}, - {file = "numexpr-2.8.7.tar.gz", hash = "sha256:596eeb3bbfebc912f4b6eaaf842b61ba722cebdb8bc42dfefa657d3a74953849"}, -] - -[package.dependencies] -numpy = ">=1.13.3" - [[package]] name = "numpy" version = "1.26.0" @@ -3599,16 +4176,6 @@ files = [ {file = "numpy-1.26.0.tar.gz", hash = "sha256:f93fc78fe8bf15afe2b8d6b6499f1c73953169fad1e9a8dd086cdff3190e7fdf"}, ] -[[package]] -name = "olefile" -version = "0.46" -description = "Python package to parse, read and write Microsoft OLE2 files (Structured Storage or Compound Document, Microsoft Office)" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "olefile-0.46.zip", hash = "sha256:133b031eaf8fd2c9399b78b8bc5b8fcbe4c31e85295749bb17a87cba8f3c3964"}, -] - [[package]] name = "onnxruntime" version = "1.16.0" @@ -3672,20 +4239,6 @@ dev = ["black (>=21.6b0,<22.0)", "pytest (==6.*)", "pytest-asyncio", "pytest-moc embeddings = ["matplotlib", "numpy", "openpyxl (>=3.0.7)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)", "plotly", "scikit-learn (>=1.0.2)", "scipy", "tenacity (>=8.0.1)"] wandb = ["numpy", "openpyxl (>=3.0.7)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)", "wandb"] -[[package]] -name = "openpyxl" -version = "3.1.2" -description = "A Python library to read/write Excel 2010 xlsx/xlsm files" -optional = false -python-versions = ">=3.6" -files = [ - {file = "openpyxl-3.1.2-py2.py3-none-any.whl", hash = "sha256:f91456ead12ab3c6c2e9491cf33ba6d08357d802192379bb482f1033ade496f5"}, - {file = "openpyxl-3.1.2.tar.gz", hash = "sha256:a6f5977418eff3b2d5500d54d9db50c8277a368436f4e4f8ddb1be3422870184"}, -] - -[package.dependencies] -et-xmlfile = "*" - [[package]] name = "opentelemetry-api" version = "1.20.0" @@ -4162,40 +4715,6 @@ files = [ {file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"}, ] -[[package]] -name = "pdf2image" -version = "1.16.3" -description = "A wrapper around the pdftoppm and pdftocairo command line tools to convert PDF to a PIL Image list." -optional = false -python-versions = "*" -files = [ - {file = "pdf2image-1.16.3-py3-none-any.whl", hash = "sha256:b6154164af3677211c22cbb38b2bd778b43aca02758e962fe1e231f6d3b0e380"}, - {file = "pdf2image-1.16.3.tar.gz", hash = "sha256:74208810c2cef4d9e347769b8e62a52303982ddb4f2dfd744c7ab4b940ae287e"}, -] - -[package.dependencies] -pillow = "*" - -[[package]] -name = "pdfminer-six" -version = "20221105" -description = "PDF parser and analyzer" -optional = false -python-versions = ">=3.6" -files = [ - {file = "pdfminer.six-20221105-py3-none-any.whl", hash = "sha256:1eaddd712d5b2732f8ac8486824533514f8ba12a0787b3d5fe1e686cd826532d"}, - {file = "pdfminer.six-20221105.tar.gz", hash = "sha256:8448ab7b939d18b64820478ecac5394f482d7a79f5f7eaa7703c6c959c175e1d"}, -] - -[package.dependencies] -charset-normalizer = ">=2.0.0" -cryptography = ">=36.0.0" - -[package.extras] -dev = ["black", "mypy (==0.931)", "nox", "pytest"] -docs = ["sphinx", "sphinx-argparse"] -image = ["Pillow"] - [[package]] name = "pexpect" version = "4.8.0" @@ -4991,17 +5510,6 @@ ocsp = ["certifi", "cryptography (>=2.5)", "pyopenssl (>=17.2.0)", "requests (<3 snappy = ["python-snappy"] zstd = ["zstandard"] -[[package]] -name = "pypandoc" -version = "1.11" -description = "Thin wrapper for pandoc." -optional = false -python-versions = ">=3.6" -files = [ - {file = "pypandoc-1.11-py3-none-any.whl", hash = "sha256:b260596934e9cfc6513056110a7c8600171d414f90558bf4407e68b209be8007"}, - {file = "pypandoc-1.11.tar.gz", hash = "sha256:7f6d68db0e57e0f6961bec2190897118c4d305fc2d31c22cd16037f22ee084a5"}, -] - [[package]] name = "pyparsing" version = "3.1.1" @@ -5118,6 +5626,25 @@ pytest = ">=5.0" [package.extras] dev = ["pre-commit", "pytest-asyncio", "tox"] +[[package]] +name = "pytest-sugar" +version = "0.9.7" +description = "pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly)." +optional = false +python-versions = "*" +files = [ + {file = "pytest-sugar-0.9.7.tar.gz", hash = "sha256:f1e74c1abfa55f7241cf7088032b6e378566f16b938f3f08905e2cf4494edd46"}, + {file = "pytest_sugar-0.9.7-py2.py3-none-any.whl", hash = "sha256:8cb5a4e5f8bbcd834622b0235db9e50432f4cbd71fef55b467fe44e43701e062"}, +] + +[package.dependencies] +packaging = ">=21.3" +pytest = ">=6.2.0" +termcolor = ">=2.1.0" + +[package.extras] +dev = ["black", "flake8", "pre-commit"] + [[package]] name = "pytest-xdist" version = "3.3.1" @@ -5152,19 +5679,6 @@ files = [ [package.dependencies] six = ">=1.5" -[[package]] -name = "python-docx" -version = "0.8.11" -description = "Create and update Microsoft Word .docx files." -optional = false -python-versions = "*" -files = [ - {file = "python-docx-0.8.11.tar.gz", hash = "sha256:1105d233a0956dd8dd1e710d20b159e2d72ac3c301041b95f4d4ceb3e0ebebc4"}, -] - -[package.dependencies] -lxml = ">=2.3.2" - [[package]] name = "python-dotenv" version = "1.0.0" @@ -5179,6 +5693,20 @@ files = [ [package.extras] cli = ["click (>=5.0)"] +[[package]] +name = "python-iso639" +version = "2023.6.15" +description = "Look-up utilities for ISO 639 language codes and names" +optional = false +python-versions = ">=3.8" +files = [ + {file = "python-iso639-2023.6.15.tar.gz", hash = "sha256:d456740d046d769a4263472ace1a9b790264210e0c199d61a520087c1fab7078"}, + {file = "python_iso639-2023.6.15-py3-none-any.whl", hash = "sha256:6a4e197cb4a5f39338b9cc2c6356bdfd4cd4bdf6d2a69eb8f707bc8a76f6cf9e"}, +] + +[package.extras] +dev = ["black (==23.1.0)", "build (==0.10.0)", "flake8 (==6.0.0)", "pytest (==7.2.1)", "twine (==4.0.2)"] + [[package]] name = "python-jose" version = "3.3.0" @@ -5225,21 +5753,6 @@ files = [ [package.extras] dev = ["atomicwrites (==1.2.1)", "attrs (==19.2.0)", "coverage (==6.5.0)", "hatch", "invoke (==1.7.3)", "more-itertools (==4.3.0)", "pbr (==4.3.0)", "pluggy (==1.0.0)", "py (==1.11.0)", "pytest (==7.2.0)", "pytest-cov (==4.0.0)", "pytest-timeout (==2.1.0)", "pyyaml (==5.1)"] -[[package]] -name = "python-pptx" -version = "0.6.21" -description = "Generate and manipulate Open XML PowerPoint (.pptx) files" -optional = false -python-versions = "*" -files = [ - {file = "python-pptx-0.6.21.tar.gz", hash = "sha256:7798a2aaf89563565b3c7120c0acfe9aff775db0db3580544e3bf4840c2e378f"}, -] - -[package.dependencies] -lxml = ">=3.1.0" -Pillow = ">=3.3.2" -XlsxWriter = ">=0.5.7" - [[package]] name = "pytz" version = "2023.3.post1" @@ -5467,6 +5980,24 @@ python-dateutil = ">=2.8.1,<3.0.0" typing-extensions = ">=4.2.0,<5.0.0" websockets = ">=10.3,<11.0" +[[package]] +name = "redis" +version = "4.6.0" +description = "Python client for Redis database and key-value store" +optional = true +python-versions = ">=3.7" +files = [ + {file = "redis-4.6.0-py3-none-any.whl", hash = "sha256:e2b03db868160ee4591de3cb90d40ebb50a90dd302138775937f6a42b7ed183c"}, + {file = "redis-4.6.0.tar.gz", hash = "sha256:585dc516b9eb042a619ef0a39c3d7d55fe81bdb4df09a52c9cdde0d07bf1aa7d"}, +] + +[package.dependencies] +async-timeout = {version = ">=4.0.2", markers = "python_full_version <= \"3.11.2\""} + +[package.extras] +hiredis = ["hiredis (>=1.0.0)"] +ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)"] + [[package]] name = "regex" version = "2023.10.3" @@ -5603,6 +6134,16 @@ pygments = ">=2.13.0,<3.0.0" [package.extras] jupyter = ["ipywidgets (>=7.5.1,<9)"] +[[package]] +name = "roundrobin" +version = "0.0.4" +description = "Collection of roundrobin utilities" +optional = false +python-versions = "*" +files = [ + {file = "roundrobin-0.0.4.tar.gz", hash = "sha256:7e9d19a5bd6123d99993fb935fa86d25c88bb2096e493885f61737ed0f5e9abd"}, +] + [[package]] name = "rsa" version = "4.9" @@ -5945,42 +6486,6 @@ files = [ {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] -[[package]] -name = "slack-bolt" -version = "1.18.0" -description = "The Bolt Framework for Python" -optional = true -python-versions = ">=3.6" -files = [ - {file = "slack_bolt-1.18.0-py2.py3-none-any.whl", hash = "sha256:63089a401ae3900c37698890249acd008a4651d06e86194edc7b72a00819bbac"}, - {file = "slack_bolt-1.18.0.tar.gz", hash = "sha256:43b121acf78440303ce5129e53be36bdfe5d926a193daef7daf2860688e65dd3"}, -] - -[package.dependencies] -slack-sdk = ">=3.21.2,<4" - -[package.extras] -adapter = ["CherryPy (>=18,<19)", "Django (>=3,<5)", "Flask (>=1,<3)", "Werkzeug (>=2,<3)", "boto3 (<=2)", "bottle (>=0.12,<1)", "chalice (>=1.28,<2)", "falcon (>=2,<4)", "fastapi (>=0.70.0,<1)", "gunicorn (>=20,<21)", "pyramid (>=1,<3)", "sanic (>=22,<23)", "starlette (>=0.14,<1)", "tornado (>=6,<7)", "uvicorn (<1)", "websocket-client (>=1.2.3,<2)"] -adapter-testing = ["Flask (>=1,<2)", "Werkzeug (>=1,<2)", "boddle (>=0.2,<0.3)", "docker (>=5,<6)", "moto (>=3,<4)", "requests (>=2,<3)", "sanic-testing (>=0.7)"] -async = ["aiohttp (>=3,<4)", "websockets (>=10,<11)"] -testing = ["Flask-Sockets (>=0.2,<1)", "Jinja2 (==3.0.3)", "Werkzeug (>=1,<2)", "aiohttp (>=3,<4)", "black (==22.8.0)", "click (<=8.0.4)", "itsdangerous (==2.0.1)", "pytest (>=6.2.5,<7)", "pytest-asyncio (>=0.18.2,<1)", "pytest-cov (>=3,<4)"] -testing-without-asyncio = ["Flask-Sockets (>=0.2,<1)", "Jinja2 (==3.0.3)", "Werkzeug (>=1,<2)", "black (==22.8.0)", "click (<=8.0.4)", "itsdangerous (==2.0.1)", "pytest (>=6.2.5,<7)", "pytest-cov (>=3,<4)"] - -[[package]] -name = "slack-sdk" -version = "3.23.0" -description = "The Slack API Platform SDK for Python" -optional = true -python-versions = ">=3.6.0" -files = [ - {file = "slack_sdk-3.23.0-py2.py3-none-any.whl", hash = "sha256:2a8513505cced20ceee22b5b49c11d9545caa6234b56bf0ad47133ea5b357d10"}, - {file = "slack_sdk-3.23.0.tar.gz", hash = "sha256:9d6ebc4ff74e7983e1b27dbdb0f2bb6fc3c2a2451694686eaa2be23bbb085a73"}, -] - -[package.extras] -optional = ["SQLAlchemy (>=1.4,<3)", "aiodns (>1.0)", "aiohttp (>=3.7.3,<4)", "boto3 (<=2)", "websocket-client (>=1,<2)", "websockets (>=10,<11)"] -testing = ["Flask (>=1,<2)", "Flask-Sockets (>=0.2,<1)", "Jinja2 (==3.0.3)", "Werkzeug (<2)", "black (==22.8.0)", "boto3 (<=2)", "click (==8.0.4)", "flake8 (>=5,<6)", "itsdangerous (==1.1.0)", "moto (>=3,<4)", "psutil (>=5,<6)", "pytest (>=6.2.5,<7)", "pytest-asyncio (<1)", "pytest-cov (>=2,<3)"] - [[package]] name = "sniffio" version = "1.3.0" @@ -6252,23 +6757,18 @@ files = [ doc = ["reno", "sphinx", "tornado (>=4.5)"] [[package]] -name = "textual" -version = "0.38.1" -description = "Modern Text User Interface framework" -optional = true -python-versions = ">=3.7,<4.0" +name = "termcolor" +version = "2.3.0" +description = "ANSI color formatting for output in terminal" +optional = false +python-versions = ">=3.7" files = [ - {file = "textual-0.38.1-py3-none-any.whl", hash = "sha256:8d38cbad6ac0b1320e52c7516e96b817e448d7c58d991269d3cf300108bbd191"}, - {file = "textual-0.38.1.tar.gz", hash = "sha256:504c934c3281217a29e7a95d498aacb7fbc629f6430895f7ac51ea7ba66e5d99"}, + {file = "termcolor-2.3.0-py3-none-any.whl", hash = "sha256:3afb05607b89aed0ffe25202399ee0867ad4d3cb4180d98aaf8eefa6a5f7d475"}, + {file = "termcolor-2.3.0.tar.gz", hash = "sha256:b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a"}, ] -[package.dependencies] -importlib-metadata = ">=4.11.3" -markdown-it-py = {version = ">=2.1.0", extras = ["linkify", "plugins"]} -rich = ">=13.3.3" -tree-sitter = ">=0.20.1,<0.21.0" -tree_sitter_languages = {version = ">=1.7.0", markers = "python_version >= \"3.8\" and python_version < \"4.0\""} -typing-extensions = ">=4.4.0,<5.0.0" +[package.extras] +tests = ["pytest", "pytest-cov"] [[package]] name = "threadpoolctl" @@ -6283,40 +6783,40 @@ files = [ [[package]] name = "tiktoken" -version = "0.4.0" +version = "0.5.1" description = "tiktoken is a fast BPE tokeniser for use with OpenAI's models" optional = false python-versions = ">=3.8" files = [ - {file = "tiktoken-0.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:176cad7f053d2cc82ce7e2a7c883ccc6971840a4b5276740d0b732a2b2011f8a"}, - {file = "tiktoken-0.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:450d504892b3ac80207700266ee87c932df8efea54e05cefe8613edc963c1285"}, - {file = "tiktoken-0.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:00d662de1e7986d129139faf15e6a6ee7665ee103440769b8dedf3e7ba6ac37f"}, - {file = "tiktoken-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5727d852ead18b7927b8adf558a6f913a15c7766725b23dbe21d22e243041b28"}, - {file = "tiktoken-0.4.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:c06cd92b09eb0404cedce3702fa866bf0d00e399439dad3f10288ddc31045422"}, - {file = "tiktoken-0.4.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:9ec161e40ed44e4210d3b31e2ff426b4a55e8254f1023e5d2595cb60044f8ea6"}, - {file = "tiktoken-0.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:1e8fa13cf9889d2c928b9e258e9dbbbf88ab02016e4236aae76e3b4f82dd8288"}, - {file = "tiktoken-0.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bb2341836b725c60d0ab3c84970b9b5f68d4b733a7bcb80fb25967e5addb9920"}, - {file = "tiktoken-0.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ca30367ad750ee7d42fe80079d3092bd35bb266be7882b79c3bd159b39a17b0"}, - {file = "tiktoken-0.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3dc3df19ddec79435bb2a94ee46f4b9560d0299c23520803d851008445671197"}, - {file = "tiktoken-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4d980fa066e962ef0f4dad0222e63a484c0c993c7a47c7dafda844ca5aded1f3"}, - {file = "tiktoken-0.4.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:329f548a821a2f339adc9fbcfd9fc12602e4b3f8598df5593cfc09839e9ae5e4"}, - {file = "tiktoken-0.4.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:b1a038cee487931a5caaef0a2e8520e645508cde21717eacc9af3fbda097d8bb"}, - {file = "tiktoken-0.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:08efa59468dbe23ed038c28893e2a7158d8c211c3dd07f2bbc9a30e012512f1d"}, - {file = "tiktoken-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f3020350685e009053829c1168703c346fb32c70c57d828ca3742558e94827a9"}, - {file = "tiktoken-0.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ba16698c42aad8190e746cd82f6a06769ac7edd415d62ba027ea1d99d958ed93"}, - {file = "tiktoken-0.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c15d9955cc18d0d7ffcc9c03dc51167aedae98542238b54a2e659bd25fe77ed"}, - {file = "tiktoken-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64e1091c7103100d5e2c6ea706f0ec9cd6dc313e6fe7775ef777f40d8c20811e"}, - {file = "tiktoken-0.4.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e87751b54eb7bca580126353a9cf17a8a8eaadd44edaac0e01123e1513a33281"}, - {file = "tiktoken-0.4.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e063b988b8ba8b66d6cc2026d937557437e79258095f52eaecfafb18a0a10c03"}, - {file = "tiktoken-0.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:9c6dd439e878172dc163fced3bc7b19b9ab549c271b257599f55afc3a6a5edef"}, - {file = "tiktoken-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8d1d97f83697ff44466c6bef5d35b6bcdb51e0125829a9c0ed1e6e39fb9a08fb"}, - {file = "tiktoken-0.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1b6bce7c68aa765f666474c7c11a7aebda3816b58ecafb209afa59c799b0dd2d"}, - {file = "tiktoken-0.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5a73286c35899ca51d8d764bc0b4d60838627ce193acb60cc88aea60bddec4fd"}, - {file = "tiktoken-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0394967d2236a60fd0aacef26646b53636423cc9c70c32f7c5124ebe86f3093"}, - {file = "tiktoken-0.4.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:dae2af6f03ecba5f679449fa66ed96585b2fa6accb7fd57d9649e9e398a94f44"}, - {file = "tiktoken-0.4.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:55e251b1da3c293432179cf7c452cfa35562da286786be5a8b1ee3405c2b0dd2"}, - {file = "tiktoken-0.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:c835d0ee1f84a5aa04921717754eadbc0f0a56cf613f78dfc1cf9ad35f6c3fea"}, - {file = "tiktoken-0.4.0.tar.gz", hash = "sha256:59b20a819969735b48161ced9b92f05dc4519c17be4015cfb73b65270a243620"}, + {file = "tiktoken-0.5.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2b0bae3fd56de1c0a5874fb6577667a3c75bf231a6cef599338820210c16e40a"}, + {file = "tiktoken-0.5.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e529578d017045e2f0ed12d2e00e7e99f780f477234da4aae799ec4afca89f37"}, + {file = "tiktoken-0.5.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edd2ffbb789712d83fee19ab009949f998a35c51ad9f9beb39109357416344ff"}, + {file = "tiktoken-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4c73d47bdc1a3f1f66ffa019af0386c48effdc6e8797e5e76875f6388ff72e9"}, + {file = "tiktoken-0.5.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:46b8554b9f351561b1989157c6bb54462056f3d44e43aa4e671367c5d62535fc"}, + {file = "tiktoken-0.5.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:92ed3bbf71a175a6a4e5fbfcdb2c422bdd72d9b20407e00f435cf22a68b4ea9b"}, + {file = "tiktoken-0.5.1-cp310-cp310-win_amd64.whl", hash = "sha256:714efb2f4a082635d9f5afe0bf7e62989b72b65ac52f004eb7ac939f506c03a4"}, + {file = "tiktoken-0.5.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a10488d1d1a5f9c9d2b2052fdb4cf807bba545818cb1ef724a7f5d44d9f7c3d4"}, + {file = "tiktoken-0.5.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8079ac065572fe0e7c696dbd63e1fdc12ce4cdca9933935d038689d4732451df"}, + {file = "tiktoken-0.5.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ef730db4097f5b13df8d960f7fdda2744fe21d203ea2bb80c120bb58661b155"}, + {file = "tiktoken-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:426e7def5f3f23645dada816be119fa61e587dfb4755de250e136b47a045c365"}, + {file = "tiktoken-0.5.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:323cec0031358bc09aa965c2c5c1f9f59baf76e5b17e62dcc06d1bb9bc3a3c7c"}, + {file = "tiktoken-0.5.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5abd9436f02e2c8eda5cce2ff8015ce91f33e782a7423de2a1859f772928f714"}, + {file = "tiktoken-0.5.1-cp311-cp311-win_amd64.whl", hash = "sha256:1fe99953b63aabc0c9536fbc91c3c9000d78e4755edc28cc2e10825372046a2d"}, + {file = "tiktoken-0.5.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dcdc630461927718b317e6f8be7707bd0fc768cee1fdc78ddaa1e93f4dc6b2b1"}, + {file = "tiktoken-0.5.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:1f2b3b253e22322b7f53a111e1f6d7ecfa199b4f08f3efdeb0480f4033b5cdc6"}, + {file = "tiktoken-0.5.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:43ce0199f315776dec3ea7bf86f35df86d24b6fcde1babd3e53c38f17352442f"}, + {file = "tiktoken-0.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a84657c083d458593c0235926b5c993eec0b586a2508d6a2020556e5347c2f0d"}, + {file = "tiktoken-0.5.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c008375c0f3d97c36e81725308699116cd5804fdac0f9b7afc732056329d2790"}, + {file = "tiktoken-0.5.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:779c4dea5edd1d3178734d144d32231e0b814976bec1ec09636d1003ffe4725f"}, + {file = "tiktoken-0.5.1-cp38-cp38-win_amd64.whl", hash = "sha256:b5dcfcf9bfb798e86fbce76d40a1d5d9e3f92131aecfa3d1e5c9ea1a20f1ef1a"}, + {file = "tiktoken-0.5.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9b180a22db0bbcc447f691ffc3cf7a580e9e0587d87379e35e58b826ebf5bc7b"}, + {file = "tiktoken-0.5.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2b756a65d98b7cf760617a6b68762a23ab8b6ef79922be5afdb00f5e8a9f4e76"}, + {file = "tiktoken-0.5.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba9873c253ca1f670e662192a0afcb72b41e0ba3e730f16c665099e12f4dac2d"}, + {file = "tiktoken-0.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:74c90d2be0b4c1a2b3f7dde95cd976757817d4df080d6af0ee8d461568c2e2ad"}, + {file = "tiktoken-0.5.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:709a5220891f2b56caad8327fab86281787704931ed484d9548f65598dea9ce4"}, + {file = "tiktoken-0.5.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5d5a187ff9c786fae6aadd49f47f019ff19e99071dc5b0fe91bfecc94d37c686"}, + {file = "tiktoken-0.5.1-cp39-cp39-win_amd64.whl", hash = "sha256:e21840043dbe2e280e99ad41951c00eff8ee3b63daf57cd4c1508a3fd8583ea2"}, + {file = "tiktoken-0.5.1.tar.gz", hash = "sha256:27e773564232004f4f810fd1f85236673ec3a56ed7f1206fc9ed8670ebedb97a"}, ] [package.dependencies] @@ -6441,17 +6941,6 @@ dev = ["tokenizers[testing]"] docs = ["setuptools_rust", "sphinx", "sphinx_rtd_theme"] testing = ["black (==22.3)", "datasets", "numpy", "pytest", "requests"] -[[package]] -name = "toml" -version = "0.10.2" -description = "Python Library for Tom's Obvious, Minimal Language" -optional = true -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -files = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] - [[package]] name = "tomli" version = "2.0.1" @@ -6665,132 +7154,6 @@ torchhub = ["filelock", "huggingface-hub (>=0.16.4,<1.0)", "importlib-metadata", video = ["av (==9.2.0)", "decord (==0.6.0)"] vision = ["Pillow (<10.0.0)"] -[[package]] -name = "tree-sitter" -version = "0.20.2" -description = "Python bindings for the Tree-Sitter parsing library" -optional = true -python-versions = ">=3.3" -files = [ - {file = "tree_sitter-0.20.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1a151ccf9233b0b84850422654247f68a4d78f548425c76520402ea6fb6cdb24"}, - {file = "tree_sitter-0.20.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:52ca2738c3c4c660c83054ac3e44a49cbecb9f89dc26bb8e154d6ca288aa06b0"}, - {file = "tree_sitter-0.20.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a8d51478ea078da7cc6f626e9e36f131bbc5fac036cf38ea4b5b81632cbac37d"}, - {file = "tree_sitter-0.20.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0b2b59e1633efbf19cd2ed1ceb8d51b2c44a278153b1113998c70bc1570b750"}, - {file = "tree_sitter-0.20.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7f691c57d2a65d6e53e2f3574153c9cd0c157ff938b8d6f252edd5e619811403"}, - {file = "tree_sitter-0.20.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ba72a363387eebaff9a0b788f864fe47da425136cbd4cac6cd125051f043c296"}, - {file = "tree_sitter-0.20.2-cp310-cp310-win32.whl", hash = "sha256:55e33eb206446d5046d3b5fe36ab300840f5a8a844246adb0ccc68c55c30b722"}, - {file = "tree_sitter-0.20.2-cp310-cp310-win_amd64.whl", hash = "sha256:24ce9d14daba0a71a778417d9d61dd4038ca96981ddec19e1e8990881469321c"}, - {file = "tree_sitter-0.20.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:942dbfb8bc380f09b0e323d3884de07d19022930516f33b7503a6eb5f6e18979"}, - {file = "tree_sitter-0.20.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ee5651c11924d426f8d6858a40fd5090ae31574f81ef180bef2055282f43bf62"}, - {file = "tree_sitter-0.20.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8fb6982b480031628dad7f229c4c8d90b17d4c281ba97848d3b100666d7fa45f"}, - {file = "tree_sitter-0.20.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:067609c6c7cb6e5a6c4be50076a380fe52b6e8f0641ee9d0da33b24a5b972e82"}, - {file = "tree_sitter-0.20.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:849d7e6b66fe7ded08a633943b30e0ed807eee76104288e6c6841433f4a9651b"}, - {file = "tree_sitter-0.20.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e85689573797e49f86e2d7cf48b9dd23bc044c477df074a78546e666d6990a29"}, - {file = "tree_sitter-0.20.2-cp311-cp311-win32.whl", hash = "sha256:098906148e44ea391a91b019d584dd8d0ea1437af62a9744e280e93163fd35ca"}, - {file = "tree_sitter-0.20.2-cp311-cp311-win_amd64.whl", hash = "sha256:2753a87094b72fe7f02276b3948155618f53aa14e1ca20588f0eeed510f68512"}, - {file = "tree_sitter-0.20.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:5de192cb9e7b1c882d45418decb7899f1547f7056df756bcae186bbf4966d96e"}, - {file = "tree_sitter-0.20.2-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3a77e663293a73a97edbf2a2e05001de08933eb5d311a16bdc25b9b2fac54f3"}, - {file = "tree_sitter-0.20.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:415da4a70c56a003758537517fe9e60b8b0c5f70becde54cc8b8f3ba810adc70"}, - {file = "tree_sitter-0.20.2-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:707fb4d7a6123b8f9f2b005d61194077c3168c0372556e7418802280eddd4892"}, - {file = "tree_sitter-0.20.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:75fcbfb0a61ad64e7f787eb3f8fbf29b8e2b858dc011897ad039d838a06cee02"}, - {file = "tree_sitter-0.20.2-cp36-cp36m-win32.whl", hash = "sha256:622926530895d939fa6e1e2487e71a311c71d3b09f4c4f19301695ea866304a4"}, - {file = "tree_sitter-0.20.2-cp36-cp36m-win_amd64.whl", hash = "sha256:5c0712f031271d9bc462f1db7623d23703ed9fbcbaa6dc19ba535f58d6110774"}, - {file = "tree_sitter-0.20.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2dfdf680ecf5619447243c4c20e4040a7b5e7afca4e1569f03c814e86bfda248"}, - {file = "tree_sitter-0.20.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:79650ee23a15559b69542c71ed9eb3297dce21932a7c5c148be384dd0f2cd49d"}, - {file = "tree_sitter-0.20.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d63059746b4b2f2f87dd19c208141c69452694aae32459b7a4ebca8539d13bf4"}, - {file = "tree_sitter-0.20.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:9398d1e214d4915032cf68a678de7eb803f64d25ef04724d70b88db7bb7746e9"}, - {file = "tree_sitter-0.20.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:b506fb2e2bd7a5a1603c644bbb90401fe488f86bbca39706addaa8d2bfc80815"}, - {file = "tree_sitter-0.20.2-cp37-cp37m-win32.whl", hash = "sha256:405e83804ba60ca1c3dbd258adbe0d7b0f1bdce948e5eec5587a2ebedcf930ba"}, - {file = "tree_sitter-0.20.2-cp37-cp37m-win_amd64.whl", hash = "sha256:a1e66d211c04144484e223922ac094a2367476e6f57000f986c5560dc5a83c6e"}, - {file = "tree_sitter-0.20.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f8adc325c74c042204ed47d095e0ec86f83de3c7ec4979645f86b58514f60297"}, - {file = "tree_sitter-0.20.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:beb49c861e1d111e0df119ecbfaa409e6413b8d91e8f56bcdb15f07fbc35594e"}, - {file = "tree_sitter-0.20.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e17ee83409b01fdd09021997b0c747be2f773bb2bb140ba6fb48b7e12fdd039a"}, - {file = "tree_sitter-0.20.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:475ab841647a0d1bc1266c8978279f8e4f7b9520b9a7336d532e5dfc8910214d"}, - {file = "tree_sitter-0.20.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:222350189675d9814966a5c88c6c1378a2ee2f3041c439a6f1d1ff2006f403aa"}, - {file = "tree_sitter-0.20.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:31ea52f0deee70f2cb00aff01e40aae325a34ebe1661de274c9107322fb95f54"}, - {file = "tree_sitter-0.20.2-cp38-cp38-win32.whl", hash = "sha256:cceaf7287137cbca707006624a4a8d4b5ccbfec025793fde84d90524c2bb0946"}, - {file = "tree_sitter-0.20.2-cp38-cp38-win_amd64.whl", hash = "sha256:25b9669911f21ec2b3727bb2f4dfeff6ddb6f81898c3e968d378a660e0d7f90e"}, - {file = "tree_sitter-0.20.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ce30a17f46a6b39a04a599dea88c127a19e3e1f43a2ad0ced71b5c032d585077"}, - {file = "tree_sitter-0.20.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e9576e8b2e663639527e01ab251b87f0bd370bfdd40515588689ebc424aec786"}, - {file = "tree_sitter-0.20.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d03731a498f624ce3536c821ef23b03d1ad569b3845b326a5b7149ef189d732c"}, - {file = "tree_sitter-0.20.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef0116ecb163573ebaa0fc04cc99c90bd94c0be5cc4d0a1ebeb102de9cc9a054"}, - {file = "tree_sitter-0.20.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:0943b00d3700f253c3ee6a53a71b9a6ca46defd9c0a33edb07a9388e70dc3a9e"}, - {file = "tree_sitter-0.20.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8cb566b6f0b5457148cb8310a1ca3d764edf28e47fcccfe0b167861ecaa50c12"}, - {file = "tree_sitter-0.20.2-cp39-cp39-win32.whl", hash = "sha256:4544204a24c2b4d25d1731b0df83f7c819ce87c4f2538a19724b8753815ef388"}, - {file = "tree_sitter-0.20.2-cp39-cp39-win_amd64.whl", hash = "sha256:9517b204e471d6aa59ee2232f6220f315ed5336079034d5c861a24660d6511d6"}, - {file = "tree_sitter-0.20.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:84343678f58cb354d22ed14b627056ffb33c540cf16c35a83db4eeee8827b935"}, - {file = "tree_sitter-0.20.2-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:611a80171d8fa6833dd0c8b022714d2ea789de15a955ec42ec4fd5fcc1032edb"}, - {file = "tree_sitter-0.20.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bacecfb61694c95ccee462742b3fcea50ba1baf115c42e60adf52b549ef642ce"}, - {file = "tree_sitter-0.20.2-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:f344ae94a268479456f19712736cc7398de5822dc74cca7d39538c28085721d0"}, - {file = "tree_sitter-0.20.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:221784d7f326fe81ce7174ac5972800f58b9a7c5c48a03719cad9830c22e5a76"}, - {file = "tree_sitter-0.20.2-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:64210ed8d2a1b7e2951f6576aa0cb7be31ad06d87da26c52961318fc54c7fe77"}, - {file = "tree_sitter-0.20.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2634ac73b39ceacfa431d6d95692eae7465977fa0b9e9f7ae6cb445991e829a5"}, - {file = "tree_sitter-0.20.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:71663a0e8230dae99d9c55e6895bd2c9e42534ec861b255775f704ae2db70c1d"}, - {file = "tree_sitter-0.20.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:32c3e0f30b45a58d36bf6a0ec982ca3eaa23c7f924628da499b7ad22a8abad71"}, - {file = "tree_sitter-0.20.2-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9b02e4ab2158c25f6f520c93318d562da58fa4ba53e1dbd434be008f48104980"}, - {file = "tree_sitter-0.20.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10e567eb6961a1e86aebbe26a9ca07d324f8529bca90937a924f8aa0ea4dc127"}, - {file = "tree_sitter-0.20.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:63f8e8e69f5f25c2b565449e1b8a2aa7b6338b4f37c8658c5fbdec04858c30be"}, - {file = "tree_sitter-0.20.2.tar.gz", hash = "sha256:0a6c06abaa55de174241a476b536173bba28241d2ea85d198d33aa8bf009f028"}, -] - -[[package]] -name = "tree-sitter-languages" -version = "1.7.0" -description = "Binary Python wheels for all tree sitter languages." -optional = true -python-versions = "*" -files = [ - {file = "tree_sitter_languages-1.7.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:fd8b856c224a74c395ed9495761c3ef8ba86014dbf6037d73634436ae683c808"}, - {file = "tree_sitter_languages-1.7.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:277d1bec6e101a26a4445cd7cb1eb8f8cf5a9bbad1ca80692bfae1af63568272"}, - {file = "tree_sitter_languages-1.7.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0473bd896799ccc87f428766813ddedd3506cad8430dbe863b663c81d7387680"}, - {file = "tree_sitter_languages-1.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cb6799419bc7e3029112f2a3f8b77b6c299f94f03bb70e5c31a437b3180486be"}, - {file = "tree_sitter_languages-1.7.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e5b705c8ce6ef47fc461484878956ecd42a67cbeb0a17e323b86a4439a8fdc3d"}, - {file = "tree_sitter_languages-1.7.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:28a732be6fced2f70184c1b34f64961e3b6259fe6d5f7540c91028c2a43a7109"}, - {file = "tree_sitter_languages-1.7.0-cp310-cp310-win32.whl", hash = "sha256:f5cdb1ec88f0b8c617330c953555a20cc7e96ca6b1f5c68ab6db347e869cfeeb"}, - {file = "tree_sitter_languages-1.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:26cb344a75798fce1a73b690504d8e7789f6ba25a178efcd203444d7868caf38"}, - {file = "tree_sitter_languages-1.7.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:433b56cb3dca02b30f21c596f431a2cff90905326be1f8913c3515acb984b21e"}, - {file = "tree_sitter_languages-1.7.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:96686390e1a01af44aedef7b33d6be82de3cf674a98a5c7b417e540e6afa62cc"}, - {file = "tree_sitter_languages-1.7.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:25a4b6d559fbd76c6ec1b73cf03d09f53aaa5a1b61078a3f518b162866d9d97e"}, - {file = "tree_sitter_languages-1.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e504f199c7a4c8b1b1efb05a063450aa23234feea6fa6c06f4077f7248ea9c98"}, - {file = "tree_sitter_languages-1.7.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6b29856e9314b5f68f05dfa45e6674f47535229dda32294ba6d129077a97759c"}, - {file = "tree_sitter_languages-1.7.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:786fdaf3d2120eef9384b0f22d7e2e42a561073ba753c7b438e90a1e7b351650"}, - {file = "tree_sitter_languages-1.7.0-cp311-cp311-win32.whl", hash = "sha256:a55a7007056d0927b78481b437d79ea0487cc991c7f9c19d67adcceac3d47f53"}, - {file = "tree_sitter_languages-1.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:4b01d3bdf7ce2aeee4d0df62071a0ca91e618a29845686a5bd714d93c5ef3b36"}, - {file = "tree_sitter_languages-1.7.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:9b603f1ad01bfb9d178f965125e2528cb7da9666d180f4a9a1acfaedbf5862ea"}, - {file = "tree_sitter_languages-1.7.0-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:70610aa26dd985d2fb9eb07ea8eacc3ceb0cc9c2e91416f51305120cfd919e28"}, - {file = "tree_sitter_languages-1.7.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0444ebc8bdb7dc0d66a816050cfd52376c4e62a94a9c54fde90b29acf3e4bab1"}, - {file = "tree_sitter_languages-1.7.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:7eeb5a3307ff1c0994ffff5ea37ec656a716a728b8c9359374104da521a76ded"}, - {file = "tree_sitter_languages-1.7.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:6c319cef16f2df667f1c165fe4eee160f2b51a0c4b61db1e70de2ab86420ca9a"}, - {file = "tree_sitter_languages-1.7.0-cp36-cp36m-win32.whl", hash = "sha256:b216650126d95d494f927393903e836a7ef5f0c4db0834f3a0b576f97c13abaf"}, - {file = "tree_sitter_languages-1.7.0-cp36-cp36m-win_amd64.whl", hash = "sha256:f6c96e5785d164a205962a10256808b3d12dccee9827ec88a46899063a2a2d28"}, - {file = "tree_sitter_languages-1.7.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:adafeabbd8d47b80122fad18bb61c25ed3da04f5347b7d774b53826accb27b7a"}, - {file = "tree_sitter_languages-1.7.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:50e2bc5d2da770ecd5af94f9d716faa4764f890fd61bc0a488e9269653d9fb71"}, - {file = "tree_sitter_languages-1.7.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac773097cff7de6cf265c5be9990b4c6690161452da1d9fc41021d4bf7e8c73a"}, - {file = "tree_sitter_languages-1.7.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b233bfc48cf0f16436200afc7d7643cd87101c321de25b919b61f21f1693aa52"}, - {file = "tree_sitter_languages-1.7.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:eab3caedf50467045ed5cab776a57b494332616376d387c6600fd7ea4f5483cf"}, - {file = "tree_sitter_languages-1.7.0-cp37-cp37m-win32.whl", hash = "sha256:d533f743a22f5696494d3a5a60adb4cfbef63d58b8b5622993d93d6d0a602444"}, - {file = "tree_sitter_languages-1.7.0-cp37-cp37m-win_amd64.whl", hash = "sha256:aab96f64be30c9f73d6dc958ec22bb1a9fe70e90b2d2a3d233d537b347cea729"}, - {file = "tree_sitter_languages-1.7.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1bf89d771621e28847036b377f865f947e555a6654356d21beab738bb2531a69"}, - {file = "tree_sitter_languages-1.7.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b2f171089ec3c4f1de275edc8f0722e1e3dc7a54e83107098315ea2f0952cfcd"}, - {file = "tree_sitter_languages-1.7.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a091577d3a8454c40f813ee2834314c73cc504522f70f9e33d7c2268d33973f9"}, - {file = "tree_sitter_languages-1.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8287efa87d080b340b583a6e81266cc3d8266deb61b8f3312649a9d1562e665a"}, - {file = "tree_sitter_languages-1.7.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:9c5080c06a2df7a59c69d2422a6ae83a5e37e92d57c4bd5e572d0eb5226ab3b0"}, - {file = "tree_sitter_languages-1.7.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ca8f629cfb406a2f9b9f8a3a5c804d4d1ba4cdca41cccba63f51fc1bab13e5de"}, - {file = "tree_sitter_languages-1.7.0-cp38-cp38-win32.whl", hash = "sha256:fd3561b37a99c9d501719819a8736529ae3a6d597128c15be432d1855f3cb0d9"}, - {file = "tree_sitter_languages-1.7.0-cp38-cp38-win_amd64.whl", hash = "sha256:377ad60f7a7bf27315676c4fa84cc766aa0019c1e556083763136ed951e934c0"}, - {file = "tree_sitter_languages-1.7.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a1dc71b68e48f58cd5b6a9ab7a541714201815629a6554a969cfc579a6ee6e53"}, - {file = "tree_sitter_languages-1.7.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fb1521367b14c275bef70997ea90526e7049f840ba1bbd3ef56c72f5b15596e9"}, - {file = "tree_sitter_languages-1.7.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0f73651f7e78371dc3d455e8aba510cc6fb9e1ac1d648c3334157950781eb295"}, - {file = "tree_sitter_languages-1.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:049b0dd63be721fe3f9642a2b5a044bea2852de2b35818467996242ae4b7f01f"}, - {file = "tree_sitter_languages-1.7.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:c428a8e1f5ecc4eb5c79abff3eb2881123446cde16fd1d8866d527470a6fdd2f"}, - {file = "tree_sitter_languages-1.7.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:40fb3fc11ff90caf65b4713feeb6c4852e5d2a04ef8ae6a2ac734a702a6a6c7e"}, - {file = "tree_sitter_languages-1.7.0-cp39-cp39-win32.whl", hash = "sha256:f28e9904833b7a909f8227c4560401049bd3310cebe3e0a884d9461f783b9af2"}, - {file = "tree_sitter_languages-1.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:ea47ee390ec2e1c9bf96d7b418775263766021a834910c9f2d578f95a3e27d0f"}, -] - -[package.dependencies] -tree-sitter = "*" - [[package]] name = "typer" version = "0.9.0" @@ -6834,6 +7197,17 @@ files = [ {file = "types_cachetools-5.3.0.6-py3-none-any.whl", hash = "sha256:f7f8a25bfe306f2e6bc2ad0a2f949d9e72f2d91036d509c36d3810bf728bc6e1"}, ] +[[package]] +name = "types-google-cloud-ndb" +version = "2.2.0.1" +description = "Typing stubs for google-cloud-ndb" +optional = false +python-versions = "*" +files = [ + {file = "types-google-cloud-ndb-2.2.0.1.tar.gz", hash = "sha256:3dd5f7437d3f4192a32b69e9b21da582d897303680f2eaac5d070749fd866586"}, + {file = "types_google_cloud_ndb-2.2.0.1-py3-none-any.whl", hash = "sha256:88b4800f4c6421a34894bd9f61aee562605d5cc151d454d4d97241fd680b1cb1"}, +] + [[package]] name = "types-passlib" version = "1.7.7.13" @@ -6867,6 +7241,20 @@ files = [ {file = "types_pyasn1-0.5.0.0-py3-none-any.whl", hash = "sha256:62f1ba64c9f8975de301014722e154ef1d6097463844de1ed733e719dfc87780"}, ] +[[package]] +name = "types-pyopenssl" +version = "23.2.0.2" +description = "Typing stubs for pyOpenSSL" +optional = false +python-versions = "*" +files = [ + {file = "types-pyOpenSSL-23.2.0.2.tar.gz", hash = "sha256:6a010dac9ecd42b582d7dd2cc3e9e40486b79b3b64bb2fffba1474ff96af906d"}, + {file = "types_pyOpenSSL-23.2.0.2-py3-none-any.whl", hash = "sha256:19536aa3debfbe25a918cf0d898e9f5fbbe6f3594a429da7914bf331deb1b342"}, +] + +[package.dependencies] +cryptography = ">=35.0.0" + [[package]] name = "types-python-jose" version = "3.3.4.8" @@ -6914,6 +7302,21 @@ files = [ {file = "types_PyYAML-6.0.12.12-py3-none-any.whl", hash = "sha256:c05bc6c158facb0676674b7f11fe3960db4f389718e19e62bd2b84d6205cfd24"}, ] +[[package]] +name = "types-redis" +version = "4.6.0.7" +description = "Typing stubs for redis" +optional = false +python-versions = ">=3.7" +files = [ + {file = "types-redis-4.6.0.7.tar.gz", hash = "sha256:28c4153ddb5c9d4f10def44a2454673c361d2d5fc3cd867cf3bb1520f3f59a38"}, + {file = "types_redis-4.6.0.7-py3-none-any.whl", hash = "sha256:05b1bf92879b25df20433fa1af07784a0d7928c616dc2ebf9087618db77ccbd0"}, +] + +[package.dependencies] +cryptography = ">=35.0.0" +types-pyOpenSSL = "*" + [[package]] name = "types-requests" version = "2.31.0.6" @@ -6976,66 +7379,78 @@ files = [ {file = "tzdata-2023.3.tar.gz", hash = "sha256:11ef1e08e54acb0d4f95bdb1be05da659673de4acbd21bf9c69e94cc5e907a3a"}, ] -[[package]] -name = "uc-micro-py" -version = "1.0.2" -description = "Micro subset of unicode data files for linkify-it-py projects." -optional = true -python-versions = ">=3.7" -files = [ - {file = "uc-micro-py-1.0.2.tar.gz", hash = "sha256:30ae2ac9c49f39ac6dce743bd187fcd2b574b16ca095fa74cd9396795c954c54"}, - {file = "uc_micro_py-1.0.2-py3-none-any.whl", hash = "sha256:8c9110c309db9d9e87302e2f4ad2c3152770930d88ab385cd544e7a7e75f3de0"}, -] - -[package.extras] -test = ["coverage", "pytest", "pytest-cov"] - [[package]] name = "unstructured" -version = "0.7.12" +version = "0.10.18" description = "A library that prepares raw documents for downstream ML tasks." optional = false python-versions = ">=3.7.0" files = [ - {file = "unstructured-0.7.12-py3-none-any.whl", hash = "sha256:6dec4f23574e213f30bccb680a4fb84c95617092ce4abf5d8955cc71af402fef"}, - {file = "unstructured-0.7.12.tar.gz", hash = "sha256:3dcddea34f52e1070f38fd10063b3b0f64bc4cbe5b778d6b86b5d33262d625cd"}, + {file = "unstructured-0.10.18-py3-none-any.whl", hash = "sha256:eaec0f0ecc470bb646a750cb32c125275d34d258ced46cfc3364098939d9ca77"}, + {file = "unstructured-0.10.18.tar.gz", hash = "sha256:7f330573d4297182f4b1500e05c9fc4779a08811bce23c527a96898b2ff374f6"}, ] [package.dependencies] -argilla = "*" +beautifulsoup4 = "*" chardet = "*" +dataclasses-json = "*" +emoji = "*" filetype = "*" +langdetect = "*" lxml = "*" -markdown = "*" -msg-parser = "*" nltk = "*" -openpyxl = "*" -pandas = "*" -pdf2image = "*" -"pdfminer.six" = "*" -pillow = "*" -pypandoc = "*" -python-docx = "*" +numpy = "*" +python-iso639 = "*" python-magic = "*" -python-pptx = "*" requests = "*" tabulate = "*" -xlrd = "*" [package.extras] -azure = ["adlfs", "fsspec"] +airtable = ["pyairtable"] +all-docs = ["ebooklib", "markdown", "msg-parser", "openpyxl", "pandas", "pdf2image", "pdfminer.six", "pypandoc", "python-docx", "python-pptx (<=0.6.21)", "unstructured-inference (==0.5.31)", "unstructured.pytesseract (>=0.3.12)", "xlrd"] +azure = ["adlfs", "fsspec (==2023.9.1)"] +azure-cognitive-search = ["azure-search-documents"] +biomed = ["bs4"] +box = ["boxfs", "fsspec (==2023.9.1)"] +confluence = ["atlassian-python-api"] +csv = ["pandas"] +delta-table = ["deltalake", "fsspec (==2023.9.1)"] discord = ["discord-py"] -dropbox = ["dropboxdrivefs", "fsspec"] -gcs = ["fsspec", "gcsfs"] -github = ["pygithub (==1.58.2)"] +doc = ["python-docx"] +docx = ["python-docx"] +dropbox = ["dropboxdrivefs", "fsspec (==2023.9.1)"] +elasticsearch = ["elasticsearch", "jq"] +epub = ["ebooklib"] +gcs = ["bs4", "fsspec (==2023.9.1)", "gcsfs"] +github = ["pygithub (>1.58.0)"] gitlab = ["python-gitlab"] google-drive = ["google-api-python-client"] huggingface = ["langdetect", "sacremoses", "sentencepiece", "torch", "transformers"] -local-inference = ["unstructured-inference (==0.5.4)"] +image = ["pdf2image", "pdfminer.six", "unstructured-inference (==0.5.31)", "unstructured.pytesseract (>=0.3.12)"] +jira = ["atlassian-python-api"] +local-inference = ["ebooklib", "markdown", "msg-parser", "openpyxl", "pandas", "pdf2image", "pdfminer.six", "pypandoc", "python-docx", "python-pptx (<=0.6.21)", "unstructured-inference (==0.5.31)", "unstructured.pytesseract (>=0.3.12)", "xlrd"] +md = ["markdown"] +msg = ["msg-parser"] +notion = ["htmlBuilder", "notion-client"] +odt = ["pypandoc", "python-docx"] +onedrive = ["Office365-REST-Python-Client (<2.4.3)", "bs4", "msal"] +openai = ["langchain", "openai", "tiktoken"] +org = ["pypandoc"] +outlook = ["Office365-REST-Python-Client (<2.4.3)", "msal"] +paddleocr = ["unstructured.paddleocr (==2.6.1.3)"] +pdf = ["pdf2image", "pdfminer.six", "unstructured-inference (==0.5.31)", "unstructured.pytesseract (>=0.3.12)"] +ppt = ["python-pptx (<=0.6.21)"] +pptx = ["python-pptx (<=0.6.21)"] reddit = ["praw"] -s3 = ["fsspec", "s3fs"] +rst = ["pypandoc"] +rtf = ["pypandoc"] +s3 = ["fsspec (==2023.9.1)", "s3fs"] +salesforce = ["simple-salesforce"] +sharepoint = ["Office365-REST-Python-Client (<2.4.3)", "msal"] slack = ["slack-sdk"] +tsv = ["pandas"] wikipedia = ["wikipedia"] +xlsx = ["openpyxl", "pandas", "xlrd"] [[package]] name = "uritemplate" @@ -7066,13 +7481,13 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "uvicorn" -version = "0.22.0" +version = "0.23.2" description = "The lightning-fast ASGI server." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "uvicorn-0.22.0-py3-none-any.whl", hash = "sha256:e9434d3bbf05f310e762147f769c9f21235ee118ba2d2bf1155a7196448bd996"}, - {file = "uvicorn-0.22.0.tar.gz", hash = "sha256:79277ae03db57ce7d9aa0567830bbb51d7a612f54d6e1e3e92da3ef24c2c8ed8"}, + {file = "uvicorn-0.23.2-py3-none-any.whl", hash = "sha256:1f9be6558f01239d4fdf22ef8126c39cb1ad0addf76c40e760549d2c2f43ab53"}, + {file = "uvicorn-0.23.2.tar.gz", hash = "sha256:4d3cc12d7727ba72b64d12d3cc7743124074c0a69f7b201512fc50c3e3f1569a"}, ] [package.dependencies] @@ -7082,6 +7497,7 @@ h11 = ">=0.8" httptools = {version = ">=0.5.0", optional = true, markers = "extra == \"standard\""} python-dotenv = {version = ">=0.13", optional = true, markers = "extra == \"standard\""} pyyaml = {version = ">=5.1", optional = true, markers = "extra == \"standard\""} +typing-extensions = {version = ">=4.0", markers = "python_version < \"3.11\""} uvloop = {version = ">=0.14.0,<0.15.0 || >0.15.0,<0.15.1 || >0.15.1", optional = true, markers = "(sys_platform != \"win32\" and sys_platform != \"cygwin\") and platform_python_implementation != \"PyPy\" and extra == \"standard\""} watchfiles = {version = ">=0.13", optional = true, markers = "extra == \"standard\""} websockets = {version = ">=10.4", optional = true, markers = "extra == \"standard\""} @@ -7155,6 +7571,28 @@ testing = ["pytest (>=7.4.0)"] tooling = ["black (>=23.7.0)", "pyright (>=1.1.325)", "ruff (>=0.0.287)"] tooling-extras = ["pyaml (>=23.7.0)", "pypandoc-binary (>=1.11)", "pytest (>=7.4.0)"] +[[package]] +name = "vine" +version = "5.0.0" +description = "Promises, promises, promises." +optional = true +python-versions = ">=3.6" +files = [ + {file = "vine-5.0.0-py2.py3-none-any.whl", hash = "sha256:4c9dceab6f76ed92105027c49c823800dd33cacce13bdedc5b914e3514b7fb30"}, + {file = "vine-5.0.0.tar.gz", hash = "sha256:7d3b1624a953da82ef63462013bbd271d3eb75751489f9807598e8f340bd637e"}, +] + +[package.extras] +docs-offline = ["myst-parser (>=2.0.0)", "pypandoc-binary (>=1.11)", "sphinx (>=7.1.1)"] +docs-online = ["mkdocs (>=1.5.2)", "mkdocs-git-revision-date-localized-plugin (>=1.2.0)", "mkdocs-material (>=9.2.6)", "mkdocstrings[python] (>=0.22.0)", "pyaml (>=23.7.0)"] +hooks = ["pre-commit (>=3.3.3)"] +package = ["build (>=1.0.0)", "twine (>=4.0.2)"] +runner = ["tox (>=4.11.1)"] +sast = ["bandit[toml] (>=1.7.5)"] +testing = ["pytest (>=7.4.0)"] +tooling = ["black (>=23.7.0)", "pyright (>=1.1.325)", "ruff (>=0.0.287)"] +tooling-extras = ["pyaml (>=23.7.0)", "pypandoc-binary (>=1.11)", "pytest (>=7.4.0)"] + [[package]] name = "watchfiles" version = "0.20.0" @@ -7313,6 +7751,23 @@ files = [ {file = "websockets-10.4.tar.gz", hash = "sha256:eef610b23933c54d5d921c92578ae5f89813438fded840c2e9809d378dc765d3"}, ] +[[package]] +name = "werkzeug" +version = "3.0.0" +description = "The comprehensive WSGI web application library." +optional = false +python-versions = ">=3.8" +files = [ + {file = "werkzeug-3.0.0-py3-none-any.whl", hash = "sha256:cbb2600f7eabe51dbc0502f58be0b3e1b96b893b05695ea2b35b43d4de2d9962"}, + {file = "werkzeug-3.0.0.tar.gz", hash = "sha256:3ffff4dcc32db52ef3cc94dff3000a3c2846890f3a5a51800a27b909c5e770f0"}, +] + +[package.dependencies] +MarkupSafe = ">=2.1.1" + +[package.extras] +watchdog = ["watchdog (>=2.3)"] + [[package]] name = "wikipedia" version = "1.4.0" @@ -7425,33 +7880,6 @@ files = [ {file = "wrapt-1.15.0.tar.gz", hash = "sha256:d06730c6aed78cee4126234cf2d071e01b44b915e725a6cb439a879ec9754a3a"}, ] -[[package]] -name = "xlrd" -version = "2.0.1" -description = "Library for developers to extract data from Microsoft Excel (tm) .xls spreadsheet files" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" -files = [ - {file = "xlrd-2.0.1-py2.py3-none-any.whl", hash = "sha256:6a33ee89877bd9abc1158129f6e94be74e2679636b8a205b43b85206c3f0bbdd"}, - {file = "xlrd-2.0.1.tar.gz", hash = "sha256:f72f148f54442c6b056bf931dbc34f986fd0c3b0b6b5a58d013c9aef274d0c88"}, -] - -[package.extras] -build = ["twine", "wheel"] -docs = ["sphinx"] -test = ["pytest", "pytest-cov"] - -[[package]] -name = "xlsxwriter" -version = "3.1.6" -description = "A Python module for creating Excel XLSX files." -optional = false -python-versions = ">=3.6" -files = [ - {file = "XlsxWriter-3.1.6-py3-none-any.whl", hash = "sha256:fc3838232f9f50763c1e81a3b381c6ad559dcdcd0983ee239bf54556392b4f3f"}, - {file = "XlsxWriter-3.1.6.tar.gz", hash = "sha256:2087abdaa4a5e981a3ae50b5c21ff1adae59c8fecb6157808585fc169a6bfcd9"}, -] - [[package]] name = "yarl" version = "1.9.2" @@ -7554,6 +7982,71 @@ files = [ docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] +[[package]] +name = "zope-event" +version = "5.0" +description = "Very basic event publishing system" +optional = false +python-versions = ">=3.7" +files = [ + {file = "zope.event-5.0-py3-none-any.whl", hash = "sha256:2832e95014f4db26c47a13fdaef84cef2f4df37e66b59d8f1f4a8f319a632c26"}, + {file = "zope.event-5.0.tar.gz", hash = "sha256:bac440d8d9891b4068e2b5a2c5e2c9765a9df762944bda6955f96bb9b91e67cd"}, +] + +[package.dependencies] +setuptools = "*" + +[package.extras] +docs = ["Sphinx"] +test = ["zope.testrunner"] + +[[package]] +name = "zope-interface" +version = "6.0" +description = "Interfaces for Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "zope.interface-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f299c020c6679cb389814a3b81200fe55d428012c5e76da7e722491f5d205990"}, + {file = "zope.interface-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ee4b43f35f5dc15e1fec55ccb53c130adb1d11e8ad8263d68b1284b66a04190d"}, + {file = "zope.interface-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5a158846d0fca0a908c1afb281ddba88744d403f2550dc34405c3691769cdd85"}, + {file = "zope.interface-6.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f72f23bab1848edb7472309e9898603141644faec9fd57a823ea6b4d1c4c8995"}, + {file = "zope.interface-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:48f4d38cf4b462e75fac78b6f11ad47b06b1c568eb59896db5b6ec1094eb467f"}, + {file = "zope.interface-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:87b690bbee9876163210fd3f500ee59f5803e4a6607d1b1238833b8885ebd410"}, + {file = "zope.interface-6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f2363e5fd81afb650085c6686f2ee3706975c54f331b426800b53531191fdf28"}, + {file = "zope.interface-6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:af169ba897692e9cd984a81cb0f02e46dacdc07d6cf9fd5c91e81f8efaf93d52"}, + {file = "zope.interface-6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fa90bac61c9dc3e1a563e5babb3fd2c0c1c80567e815442ddbe561eadc803b30"}, + {file = "zope.interface-6.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:89086c9d3490a0f265a3c4b794037a84541ff5ffa28bb9c24cc9f66566968464"}, + {file = "zope.interface-6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:809fe3bf1a91393abc7e92d607976bbb8586512913a79f2bf7d7ec15bd8ea518"}, + {file = "zope.interface-6.0-cp311-cp311-win_amd64.whl", hash = "sha256:0ec9653825f837fbddc4e4b603d90269b501486c11800d7c761eee7ce46d1bbb"}, + {file = "zope.interface-6.0-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:790c1d9d8f9c92819c31ea660cd43c3d5451df1df61e2e814a6f99cebb292788"}, + {file = "zope.interface-6.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b39b8711578dcfd45fc0140993403b8a81e879ec25d53189f3faa1f006087dca"}, + {file = "zope.interface-6.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eba51599370c87088d8882ab74f637de0c4f04a6d08a312dce49368ba9ed5c2a"}, + {file = "zope.interface-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ee934f023f875ec2cfd2b05a937bd817efcc6c4c3f55c5778cbf78e58362ddc"}, + {file = "zope.interface-6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:042f2381118b093714081fd82c98e3b189b68db38ee7d35b63c327c470ef8373"}, + {file = "zope.interface-6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dfbbbf0809a3606046a41f8561c3eada9db811be94138f42d9135a5c47e75f6f"}, + {file = "zope.interface-6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:424d23b97fa1542d7be882eae0c0fc3d6827784105264a8169a26ce16db260d8"}, + {file = "zope.interface-6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e538f2d4a6ffb6edfb303ce70ae7e88629ac6e5581870e66c306d9ad7b564a58"}, + {file = "zope.interface-6.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:12175ca6b4db7621aedd7c30aa7cfa0a2d65ea3a0105393e05482d7a2d367446"}, + {file = "zope.interface-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c3d7dfd897a588ec27e391edbe3dd320a03684457470415870254e714126b1f"}, + {file = "zope.interface-6.0-cp38-cp38-win_amd64.whl", hash = "sha256:b3f543ae9d3408549a9900720f18c0194ac0fe810cecda2a584fd4dca2eb3bb8"}, + {file = "zope.interface-6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d0583b75f2e70ec93f100931660328965bb9ff65ae54695fb3fa0a1255daa6f2"}, + {file = "zope.interface-6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:23ac41d52fd15dd8be77e3257bc51bbb82469cf7f5e9a30b75e903e21439d16c"}, + {file = "zope.interface-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99856d6c98a326abbcc2363827e16bd6044f70f2ef42f453c0bd5440c4ce24e5"}, + {file = "zope.interface-6.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1592f68ae11e557b9ff2bc96ac8fc30b187e77c45a3c9cd876e3368c53dc5ba8"}, + {file = "zope.interface-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4407b1435572e3e1610797c9203ad2753666c62883b921318c5403fb7139dec2"}, + {file = "zope.interface-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:5171eb073474a5038321409a630904fd61f12dd1856dd7e9d19cd6fe092cbbc5"}, + {file = "zope.interface-6.0.tar.gz", hash = "sha256:aab584725afd10c710b8f1e6e208dbee2d0ad009f57d674cb9d1b3964037275d"}, +] + +[package.dependencies] +setuptools = "*" + +[package.extras] +docs = ["Sphinx", "repoze.sphinx.autointerface"] +test = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] +testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] + [[package]] name = "zstandard" version = "0.21.0" @@ -7614,10 +8107,10 @@ cffi = ["cffi (>=1.11)"] [extras] all = [] -deploy = ["langchain-serve"] +deploy = ["celery", "flower", "redis"] local = ["ctransformers", "llama-cpp-python", "sentence-transformers"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.11" -content-hash = "2c6563139aa4d014e3f1af21f7848b8a2d4283aa67cfb603be1f5c1f7b0d4e9e" +content-hash = "5ce25b7cded1c79e3fac7d259a4b1120a97fae77b1e7cdb17498fbc4ea29efb4" diff --git a/pyproject.toml b/pyproject.toml index baaaf6a0a..70c291bdc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langflow" -version = "0.5.0a0" +version = "0.5.1" description = "A Python package with a built-in web application" authors = ["Logspace "] maintainers = [ @@ -26,39 +26,38 @@ langflow = "langflow.__main__:main" [tool.poetry.dependencies] python = ">=3.9,<3.11" -fastapi = "^0.100.0" -uvicorn = "^0.22.0" +fastapi = "^0.103.0" +uvicorn = "^0.23.0" beautifulsoup4 = "^4.12.2" google-search-results = "^2.4.1" google-api-python-client = "^2.79.0" typer = "^0.9.0" -gunicorn = "^21.1.0" -langchain = "^0.0.274" +gunicorn = "^21.2.0" +langchain = "^0.0.308" openai = "^0.27.8" pandas = "2.0.3" chromadb = "^0.3.21" huggingface-hub = { version = "^0.16.0", extras = ["inference"] } -rich = "^13.4.2" +rich = "^13.5.0" llama-cpp-python = { version = "~0.1.0", optional = true } networkx = "^3.1" -unstructured = "^0.7.0" -pypdf = "^3.11.0" +unstructured = "^0.10.0" +pypdf = "^3.15.0" lxml = "^4.9.2" pysrt = "^1.1.2" fake-useragent = "^1.2.1" docstring-parser = "^0.15" psycopg2-binary = "^2.9.6" pyarrow = "^12.0.0" -tiktoken = "~0.4.0" +tiktoken = "~0.5.0" wikipedia = "^1.4.0" -langchain-serve = { version = ">0.0.51", optional = true } -qdrant-client = "^1.3.0" +qdrant-client = "^1.4.0" websockets = "^10.3" -weaviate-client = "^3.21.0" +weaviate-client = "^3.23.0" jina = "3.15.2" sentence-transformers = { version = "^2.2.2", optional = true } ctransformers = { version = "^0.2.10", optional = true } -cohere = "^4.11.0" +cohere = "^4.27.0" python-multipart = "^0.0.6" sqlmodel = "^0.0.8" faiss-cpu = "^1.7.4" @@ -77,16 +76,24 @@ psycopg = "^3.1.9" psycopg-binary = "^3.1.9" fastavro = "^1.8.0" langchain-experimental = "^0.0.8" -alembic = "^1.11.2" +celery = { extras = ["redis"], version = "^5.3.1", optional = true } +redis = { version = "^4.6.0", optional = true } +flower = { version = "^2.0.0", optional = true } +alembic = "^1.12.0" passlib = "^1.7.4" bcrypt = "^4.0.1" python-jose = "^3.3.0" metaphor-python = "^0.1.11" -markupsafe = "^2.1.3" pywin32 = { version = "^306", markers = "sys_platform == 'win32'" } loguru = "^0.7.1" +langfuse = "^1.0.13" +pillow = "^10.0.0" +metal-sdk = "^2.2.0" +markupsafe = "^2.1.3" + [tool.poetry.group.dev.dependencies] +types-redis = "^4.6.0.5" black = "^23.1.0" ipykernel = "^6.21.2" mypy = "^1.1.1" @@ -102,13 +109,16 @@ types-appdirs = "^1.4.3.5" types-pyyaml = "^6.0.12.8" types-python-jose = "^3.3.4.8" types-passlib = "^1.7.7.13" +locust = "^2.16.1" pytest-mock = "^3.11.1" pytest-xdist = "^3.3.1" types-pywin32 = "^306.0.0.4" +types-google-cloud-ndb = "^2.2.0.0" +pytest-sugar = "^0.9.7" [tool.poetry.extras] -deploy = ["langchain-serve"] +deploy = ["langchain-serve", "celery", "redis", "flower"] local = ["llama-cpp-python", "sentence-transformers", "ctransformers"] all = ["deploy", "local"] @@ -120,6 +130,7 @@ testpaths = ["tests", "integration"] console_output_style = "progress" filterwarnings = ["ignore::DeprecationWarning"] log_cli = true +markers = ["async_test"] [tool.ruff] diff --git a/render.yaml b/render.yaml index e67da9334..4c17923c6 100644 --- a/render.yaml +++ b/render.yaml @@ -3,9 +3,14 @@ services: - type: web name: langflow runtime: docker - plan: free dockerfilePath: ./Dockerfile repo: https://github.com/logspace-ai/langflow branch: main healthCheckPath: /health autoDeploy: false + envVars: + - key: LANGFLOW_DATABASE_URL + value: sqlite:////home/user/.cache/langflow/langflow.db + disk: + name: langflow-data + mountPath: /home/user/.cache/langflow diff --git a/scripts/deploy_langflow_gcp.sh b/scripts/gcp/deploy_langflow_gcp.sh similarity index 100% rename from scripts/deploy_langflow_gcp.sh rename to scripts/gcp/deploy_langflow_gcp.sh diff --git a/scripts/deploy_langflow_gcp_spot.sh b/scripts/gcp/deploy_langflow_gcp_spot.sh similarity index 100% rename from scripts/deploy_langflow_gcp_spot.sh rename to scripts/gcp/deploy_langflow_gcp_spot.sh diff --git a/scripts/walkthroughtutorial.md b/scripts/gcp/walkthroughtutorial.md similarity index 100% rename from scripts/walkthroughtutorial.md rename to scripts/gcp/walkthroughtutorial.md diff --git a/scripts/walkthroughtutorial_spot.md b/scripts/gcp/walkthroughtutorial_spot.md similarity index 100% rename from scripts/walkthroughtutorial_spot.md rename to scripts/gcp/walkthroughtutorial_spot.md diff --git a/src/backend/langflow/__init__.py b/src/backend/langflow/__init__.py index f6eb836cc..d3afbb4af 100644 --- a/src/backend/langflow/__init__.py +++ b/src/backend/langflow/__init__.py @@ -1,7 +1,7 @@ from importlib import metadata # Deactivate cache manager for now -# from langflow.services.cache import cache_manager +# from langflow.services.cache import cache_service from langflow.processing.process import load_flow_from_json from langflow.interface.custom.custom_component import CustomComponent @@ -12,4 +12,4 @@ except metadata.PackageNotFoundError: __version__ = "" del metadata # optional, avoids polluting the results of dir(__package__) -__all__ = ["load_flow_from_json", "cache_manager", "CustomComponent"] +__all__ = ["load_flow_from_json", "cache_service", "CustomComponent"] diff --git a/src/backend/langflow/__main__.py b/src/backend/langflow/__main__.py index a08ae9fb0..dfc2e27a5 100644 --- a/src/backend/langflow/__main__.py +++ b/src/backend/langflow/__main__.py @@ -1,30 +1,29 @@ +import platform +import socket import sys import time -import httpx -from langflow.services.database.utils import session_getter -from langflow.services.manager import initialize_services, initialize_settings_manager -from langflow.services.utils import get_db_manager, get_settings_manager - -from multiprocess import Process, cpu_count # type: ignore -import platform +import webbrowser from pathlib import Path from typing import Optional -import socket -from rich.panel import Panel + +import httpx +import typer +from dotenv import load_dotenv +from langflow.main import setup_app +from langflow.services.database.utils import session_getter +from langflow.services.getters import get_db_service, get_settings_service +from langflow.services.utils import initialize_services, initialize_settings_service +from langflow.utils.logger import configure, logger +from multiprocess import Process, cpu_count # type: ignore from rich import box from rich import print as rprint -from rich.table import Table -import typer -from langflow.main import setup_app -from langflow.utils.logger import configure, logger -import webbrowser -from dotenv import load_dotenv - from rich.console import Console +from rich.panel import Panel +from rich.table import Table console = Console() -app = typer.Typer() +app = typer.Typer(no_args_is_help=True) def get_number_of_workers(workers=None): @@ -53,9 +52,21 @@ def display_results(results): console.print() # Print a new line +def set_var_for_macos_issue(): + # OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES + # we need to set this var is we are running on MacOS + # otherwise we get an error when running gunicorn + + if platform.system() in ["Darwin"]: + import os + + os.environ["OBJC_DISABLE_INITIALIZE_FORK_SAFETY"] = "YES" + logger.debug("Set OBJC_DISABLE_INITIALIZE_FORK_SAFETY to YES to avoid error") + + def update_settings( config: str, - cache: str, + cache: Optional[str] = None, dev: bool = False, remove_api_keys: bool = False, components_path: Optional[Path] = None, @@ -63,66 +74,20 @@ def update_settings( """Update the settings from a config file.""" # Check for database_url in the environment variables - initialize_settings_manager() - settings_manager = get_settings_manager() + initialize_settings_service() + settings_service = get_settings_service() if config: logger.debug(f"Loading settings from {config}") - settings_manager.settings.update_from_yaml(config, dev=dev) + settings_service.settings.update_from_yaml(config, dev=dev) if remove_api_keys: logger.debug(f"Setting remove_api_keys to {remove_api_keys}") - settings_manager.settings.update_settings(REMOVE_API_KEYS=remove_api_keys) + settings_service.settings.update_settings(REMOVE_API_KEYS=remove_api_keys) if cache: logger.debug(f"Setting cache to {cache}") - settings_manager.settings.update_settings(CACHE=cache) + settings_service.settings.update_settings(CACHE=cache) if components_path: logger.debug(f"Adding component path {components_path}") - settings_manager.settings.update_settings(COMPONENTS_PATH=components_path) - - -def serve_on_jcloud(): - """ - Deploy Langflow server on Jina AI Cloud - """ - import asyncio - from importlib.metadata import version as mod_version - - import click - - try: - from lcserve.__main__ import serve_on_jcloud # type: ignore - except ImportError: - click.secho( - "๐Ÿšจ Please install langchain-serve to deploy Langflow server on Jina AI Cloud " - "using `pip install langchain-serve`", - fg="red", - ) - return - - app_name = "langflow.lcserve:app" - app_dir = str(Path(__file__).parent) - version = mod_version("langflow") - base_image = "jinaai+docker://deepankarm/langflow" - - click.echo("๐Ÿš€ Deploying Langflow server on Jina AI Cloud") - app_id = asyncio.run( - serve_on_jcloud( - fastapi_app_str=app_name, - app_dir=app_dir, - uses=f"{base_image}:{version}", - name="langflow", - ) - ) - click.secho( - "๐ŸŽ‰ Langflow server successfully deployed on Jina AI Cloud ๐ŸŽ‰", fg="green" - ) - click.secho( - "๐Ÿ”— Click on the link to open the server (please allow ~1-2 minutes for the server to startup): ", - nl=False, - fg="green", - ) - click.secho(f"https://{app_id}.wolf.jina.ai/", fg="blue") - click.secho("๐Ÿ“– Read more about managing the server: ", nl=False, fg="green") - click.secho("https://github.com/jina-ai/langchain-serve", fg="blue") + settings_service.settings.update_settings(COMPONENTS_PATH=components_path) @app.command() @@ -131,7 +96,7 @@ def run( "127.0.0.1", help="Host to bind the server to.", envvar="LANGFLOW_HOST" ), workers: int = typer.Option( - 2, help="Number of worker processes.", envvar="LANGFLOW_WORKERS" + 1, help="Number of worker processes.", envvar="LANGFLOW_WORKERS" ), timeout: int = typer.Option(300, help="Worker timeout in seconds."), port: int = typer.Option(7860, help="Port to listen on.", envvar="LANGFLOW_PORT"), @@ -153,12 +118,11 @@ def run( log_file: Path = typer.Option( "logs/langflow.log", help="Path to the log file.", envvar="LANGFLOW_LOG_FILE" ), - cache: str = typer.Option( + cache: Optional[str] = typer.Option( envvar="LANGFLOW_LANGCHAIN_CACHE", help="Type of cache to use. (InMemoryCache, SQLiteCache)", - default="SQLiteCache", + default=None, ), - jcloud: bool = typer.Option(False, help="Deploy on Jina AI Cloud"), dev: bool = typer.Option(False, help="Run in development mode (may contain bugs)"), # This variable does not work but is set by the .env file # and works with Pydantic @@ -189,15 +153,15 @@ def run( ), ): """ - Run the Langflow server. + Run the Langflow. """ + + set_var_for_macos_issue() # override env variables with .env file + if env_file: load_dotenv(env_file, override=True) - if jcloud: - return serve_on_jcloud() - configure(log_level=log_level, log_file=log_file) update_settings( config, @@ -216,7 +180,6 @@ def run( options = { "bind": f"{host}:{port}", "workers": get_number_of_workers(workers), - "worker_class": "uvicorn.workers.UvicornWorker", "timeout": timeout, } @@ -350,18 +313,25 @@ def superuser( password: str = typer.Option( ..., prompt=True, hide_input=True, help="Password for the superuser." ), + log_level: str = typer.Option( + "critical", help="Logging level.", envvar="LANGFLOW_LOG_LEVEL" + ), ): + """ + Create a superuser. + """ + configure(log_level=log_level) initialize_services() - db_manager = get_db_manager() - with session_getter(db_manager) as session: + db_service = get_db_service() + with session_getter(db_service) as session: from langflow.services.auth.utils import create_super_user if create_super_user(db=session, username=username, password=password): # Verify that the superuser was created from langflow.services.database.models.user.user import User - user = session.query(User).filter(User.username == username).first() - if user is None: + user: User = session.query(User).filter(User.username == username).first() + if user is None or not user.is_superuser: typer.echo("Superuser creation failed.") return @@ -372,12 +342,15 @@ def superuser( @app.command() -def migration(test: bool = typer.Option(False, help="Run migrations in test mode.")): +def migration(test: bool = typer.Option(True, help="Run migrations in test mode.")): + """ + Run or test migrations. + """ initialize_services() - db_manager = get_db_manager() + db_service = get_db_service() if not test: - db_manager.run_migrations() - results = db_manager.run_migrations_test() + db_service.run_migrations() + results = db_service.run_migrations_test() display_results(results) diff --git a/src/backend/langflow/alembic/versions/67cc006d50bf_add_profile_image_column.py b/src/backend/langflow/alembic/versions/67cc006d50bf_add_profile_image_column.py new file mode 100644 index 000000000..ca0aa0542 --- /dev/null +++ b/src/backend/langflow/alembic/versions/67cc006d50bf_add_profile_image_column.py @@ -0,0 +1,49 @@ +"""Add profile-image column + +Revision ID: 67cc006d50bf +Revises: 260dbcc8b680 +Create Date: 2023-09-08 07:36:13.387318 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import sqlmodel +from sqlalchemy.engine.reflection import Inspector + +# revision identifiers, used by Alembic. +revision: str = "67cc006d50bf" +down_revision: Union[str, None] = "260dbcc8b680" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + conn = op.get_bind() + inspector = Inspector.from_engine(conn) + if "user" in inspector.get_table_names() and "profile_image" not in [ + column["name"] for column in inspector.get_columns("user") + ]: + with op.batch_alter_table("user", schema=None) as batch_op: + batch_op.add_column( + sa.Column( + "profile_image", sqlmodel.sql.sqltypes.AutoString(), nullable=True + ) + ) + + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + conn = op.get_bind() + inspector = Inspector.from_engine(conn) + if "user" in inspector.get_table_names() and "profile_image" in [ + column["name"] for column in inspector.get_columns("user") + ]: + with op.batch_alter_table("user", schema=None) as batch_op: + batch_op.drop_column("profile_image") + + # ### end Alembic commands ### diff --git a/src/backend/langflow/alembic/versions/eb5866d51fd2_change_columns_to_be_nullable.py b/src/backend/langflow/alembic/versions/eb5866d51fd2_change_columns_to_be_nullable.py new file mode 100644 index 000000000..10d503e60 --- /dev/null +++ b/src/backend/langflow/alembic/versions/eb5866d51fd2_change_columns_to_be_nullable.py @@ -0,0 +1,79 @@ +"""Change columns to be nullable + +Revision ID: eb5866d51fd2 +Revises: 67cc006d50bf +Create Date: 2023-10-04 10:18:25.640458 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import sqlmodel # noqa: F401 + +# revision identifiers, used by Alembic. +revision: str = "eb5866d51fd2" +down_revision: Union[str, None] = "67cc006d50bf" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + try: + op.drop_table("flowstyle") + with op.batch_alter_table("component", schema=None) as batch_op: + batch_op.drop_index("ix_component_frontend_node_id") + batch_op.drop_index("ix_component_name") + except Exception: + pass + + try: + op.drop_table("component") + except Exception: + pass + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + try: + op.create_table( + "component", + sa.Column("id", sa.CHAR(length=32), nullable=False), + sa.Column("frontend_node_id", sa.CHAR(length=32), nullable=False), + sa.Column("name", sa.VARCHAR(), nullable=False), + sa.Column("description", sa.VARCHAR(), nullable=True), + sa.Column("python_code", sa.VARCHAR(), nullable=True), + sa.Column("return_type", sa.VARCHAR(), nullable=True), + sa.Column("is_disabled", sa.BOOLEAN(), nullable=False), + sa.Column("is_read_only", sa.BOOLEAN(), nullable=False), + sa.Column("create_at", sa.DATETIME(), nullable=False), + sa.Column("update_at", sa.DATETIME(), nullable=False), + sa.PrimaryKeyConstraint("id"), + ) + with op.batch_alter_table("component", schema=None) as batch_op: + batch_op.create_index("ix_component_name", ["name"], unique=False) + batch_op.create_index( + "ix_component_frontend_node_id", ["frontend_node_id"], unique=False + ) + except Exception: + pass + + try: + op.create_table( + "flowstyle", + sa.Column("color", sa.VARCHAR(), nullable=False), + sa.Column("emoji", sa.VARCHAR(), nullable=False), + sa.Column("flow_id", sa.CHAR(length=32), nullable=True), + sa.Column("id", sa.CHAR(length=32), nullable=False), + sa.ForeignKeyConstraint( + ["flow_id"], + ["flow.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("id"), + ) + except Exception: + pass + # ### end Alembic commands ### diff --git a/src/backend/langflow/api/utils.py b/src/backend/langflow/api/utils.py index 0fb53e541..c519fffed 100644 --- a/src/backend/langflow/api/utils.py +++ b/src/backend/langflow/api/utils.py @@ -59,33 +59,6 @@ def build_input_keys_response(langchain_object, artifacts): return input_keys_response -def merge_nested_dicts(dict1, dict2): - for key, value in dict2.items(): - if isinstance(value, dict) and isinstance(dict1.get(key), dict): - dict1[key] = merge_nested_dicts(dict1[key], value) - else: - dict1[key] = value - return dict1 - - -def merge_nested_dicts_with_renaming(dict1, dict2): - for key, value in dict2.items(): - if ( - key in dict1 - and isinstance(value, dict) - and isinstance(dict1.get(key), dict) - ): - for sub_key, sub_value in value.items(): - if sub_key in dict1[key]: - new_key = get_new_key(dict1[key], sub_key) - dict1[key][new_key] = sub_value - else: - dict1[key][sub_key] = sub_value - else: - dict1[key] = value - return dict1 - - def get_new_key(dictionary, original_key): counter = 1 new_key = original_key + " (" + str(counter) + ")" diff --git a/src/backend/langflow/api/v1/api_key.py b/src/backend/langflow/api/v1/api_key.py index 280f240e8..7f5916d06 100644 --- a/src/backend/langflow/api/v1/api_key.py +++ b/src/backend/langflow/api/v1/api_key.py @@ -14,7 +14,7 @@ from langflow.services.database.models.api_key.crud import ( delete_api_key, ) from langflow.services.database.models.user.user import User -from langflow.services.utils import get_session +from langflow.services.getters import get_session from sqlmodel import Session diff --git a/src/backend/langflow/api/v1/callback.py b/src/backend/langflow/api/v1/callback.py index 2a16a0bd2..787ca9680 100644 --- a/src/backend/langflow/api/v1/callback.py +++ b/src/backend/langflow/api/v1/callback.py @@ -1,15 +1,17 @@ import asyncio +from uuid import UUID from langchain.callbacks.base import AsyncCallbackHandler, BaseCallbackHandler -from langflow.api.v1.schemas import ChatResponse +from langflow.api.v1.schemas import ChatResponse, PromptResponse -from typing import Any, Dict, List, Union -from fastapi import WebSocket +from typing import Any, Dict, List, Optional +from langflow.services.getters import get_chat_service -from langchain.schema import AgentAction, LLMResult, AgentFinish +from langflow.utils.util import remove_ansi_escape_codes +from langchain.schema import AgentAction, AgentFinish from loguru import logger @@ -17,39 +19,15 @@ from loguru import logger class AsyncStreamingLLMCallbackHandler(AsyncCallbackHandler): """Callback handler for streaming LLM responses.""" - def __init__(self, websocket: WebSocket): - self.websocket = websocket + def __init__(self, client_id: str): + self.chat_service = get_chat_service() + self.client_id = client_id + self.websocket = self.chat_service.active_connections[self.client_id] async def on_llm_new_token(self, token: str, **kwargs: Any) -> None: resp = ChatResponse(message=token, type="stream", intermediate_steps="") await self.websocket.send_json(resp.dict()) - async def on_llm_start( - self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any - ) -> Any: - """Run when LLM starts running.""" - - async def on_llm_end(self, response: LLMResult, **kwargs: Any) -> Any: - """Run when LLM ends running.""" - - async def on_llm_error( - self, error: Union[Exception, KeyboardInterrupt], **kwargs: Any - ) -> Any: - """Run when LLM errors.""" - - async def on_chain_start( - self, serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any - ) -> Any: - """Run when chain starts running.""" - - async def on_chain_end(self, outputs: Dict[str, Any], **kwargs: Any) -> Any: - """Run when chain ends running.""" - - async def on_chain_error( - self, error: Union[Exception, KeyboardInterrupt], **kwargs: Any - ) -> Any: - """Run when chain errors.""" - async def on_tool_start( self, serialized: Dict[str, Any], input_str: str, **kwargs: Any ) -> Any: @@ -95,8 +73,14 @@ class AsyncStreamingLLMCallbackHandler(AsyncCallbackHandler): logger.error(f"Error sending response: {exc}") async def on_tool_error( - self, error: Union[Exception, KeyboardInterrupt], **kwargs: Any - ) -> Any: + self, + error: BaseException, + *, + run_id: UUID, + parent_run_id: Optional[UUID] = None, + tags: Optional[List[str]] = None, + **kwargs: Any, + ) -> None: """Run when tool errors.""" async def on_text(self, text: str, **kwargs: Any) -> Any: @@ -104,6 +88,14 @@ class AsyncStreamingLLMCallbackHandler(AsyncCallbackHandler): # This runs when first sending the prompt # to the LLM, adding it will send the final prompt # to the frontend + if "Prompt after formatting" in text: + text = text.replace("Prompt after formatting:\n", "") + text = remove_ansi_escape_codes(text) + resp = PromptResponse( + prompt=text, + ) + await self.websocket.send_json(resp.dict()) + self.chat_service.chat_history.add_message(self.client_id, resp) async def on_agent_action(self, action: AgentAction, **kwargs: Any): log = f"Thought: {action.log}" @@ -131,8 +123,10 @@ class AsyncStreamingLLMCallbackHandler(AsyncCallbackHandler): class StreamingLLMCallbackHandler(BaseCallbackHandler): """Callback handler for streaming LLM responses.""" - def __init__(self, websocket): - self.websocket = websocket + def __init__(self, client_id: str): + self.chat_service = get_chat_service() + self.client_id = client_id + self.websocket = self.chat_service.active_connections[self.client_id] def on_llm_new_token(self, token: str, **kwargs: Any) -> None: resp = ChatResponse(message=token, type="stream", intermediate_steps="") diff --git a/src/backend/langflow/api/v1/chat.py b/src/backend/langflow/api/v1/chat.py index e61f77fa2..0f277fbb7 100644 --- a/src/backend/langflow/api/v1/chat.py +++ b/src/backend/langflow/api/v1/chat.py @@ -13,17 +13,16 @@ from langflow.api.v1.schemas import BuildStatus, BuiltResponse, InitResponse, St from langflow.graph.graph.base import Graph from langflow.services.auth.utils import get_current_active_user, get_current_user +from langflow.services.cache.utils import update_build_status from loguru import logger -from langflow.services.utils import get_chat_manager, get_session -from cachetools import LRUCache +from langflow.services.getters import get_chat_service, get_session, get_cache_service from sqlmodel import Session -from langflow.services.chat.manager import ChatManager +from langflow.services.chat.manager import ChatService +from langflow.services.cache.manager import BaseCacheService router = APIRouter(tags=["Chat"]) -flow_data_store: LRUCache = LRUCache(maxsize=10) - @router.websocket("/chat/{client_id}") async def chat( @@ -31,7 +30,7 @@ async def chat( websocket: WebSocket, token: str = Query(...), db: Session = Depends(get_session), - chat_manager: "ChatManager" = Depends(get_chat_manager), + chat_service: "ChatService" = Depends(get_chat_service), ): """Websocket endpoint for chat.""" try: @@ -46,15 +45,15 @@ async def chat( code=status.WS_1008_POLICY_VIOLATION, reason="Unauthorized" ) - if client_id in chat_manager.in_memory_cache: - await chat_manager.handle_websocket(client_id, websocket) + if client_id in chat_service.cache_service: + await chat_service.handle_websocket(client_id, websocket) else: # We accept the connection but close it immediately # if the flow is not built yet message = "Please, build the flow before sending messages" await websocket.close(code=status.WS_1011_INTERNAL_ERROR, reason=message) except WebSocketException as exc: - logger.error(f"Websocket error: {exc}") + logger.error(f"Websocket exrror: {exc}") await websocket.close(code=status.WS_1011_INTERNAL_ERROR, reason=str(exc)) except Exception as exc: logger.error(f"Error in chat websocket: {exc}") @@ -72,26 +71,26 @@ async def init_build( graph_data: dict, flow_id: str, current_user=Depends(get_current_active_user), - chat_manager: "ChatManager" = Depends(get_chat_manager), + chat_service: "ChatService" = Depends(get_chat_service), + cache_service: "BaseCacheService" = Depends(get_cache_service), ): """Initialize the build by storing graph data and returning a unique session ID.""" - try: if flow_id is None: raise ValueError("No ID provided") # Check if already building if ( - flow_id in flow_data_store - and flow_data_store[flow_id]["status"] == BuildStatus.IN_PROGRESS + flow_id in cache_service + and isinstance(cache_service[flow_id], dict) + and cache_service[flow_id].get("status") == BuildStatus.IN_PROGRESS ): return InitResponse(flowId=flow_id) # Delete from cache if already exists - if flow_id in chat_manager.in_memory_cache: - with chat_manager.in_memory_cache._lock: - chat_manager.in_memory_cache.delete(flow_id) - logger.debug(f"Deleted flow {flow_id} from cache") - flow_data_store[flow_id] = { + if flow_id in chat_service.cache_service: + chat_service.cache_service.delete(flow_id) + logger.debug(f"Deleted flow {flow_id} from cache") + cache_service[flow_id] = { "graph_data": graph_data, "status": BuildStatus.STARTED, "user_id": current_user.id, @@ -104,12 +103,14 @@ async def init_build( @router.get("/build/{flow_id}/status", response_model=BuiltResponse) -async def build_status(flow_id: str): - """Check the flow_id is in the flow_data_store.""" +async def build_status( + flow_id: str, cache_service: "BaseCacheService" = Depends(get_cache_service) +): + """Check the flow_id is in the cache_service.""" try: built = ( - flow_id in flow_data_store - and flow_data_store[flow_id]["status"] == BuildStatus.SUCCESS + flow_id in cache_service + and cache_service[flow_id]["status"] == BuildStatus.SUCCESS ) return BuiltResponse( @@ -123,7 +124,9 @@ async def build_status(flow_id: str): @router.get("/build/stream/{flow_id}", response_class=StreamingResponse) async def stream_build( - flow_id: str, chat_manager: "ChatManager" = Depends(get_chat_manager) + flow_id: str, + chat_service: "ChatService" = Depends(get_chat_service), + cache_service: "BaseCacheService" = Depends(get_cache_service), ): """Stream the build process based on stored flow data.""" @@ -131,18 +134,18 @@ async def stream_build( final_response = {"end_of_stream": True} artifacts = {} try: - if flow_id not in flow_data_store: + if flow_id not in cache_service: error_message = "Invalid session ID" yield str(StreamData(event="error", data={"error": error_message})) return - if flow_data_store[flow_id].get("status") == BuildStatus.IN_PROGRESS: + if cache_service[flow_id].get("status") == BuildStatus.IN_PROGRESS: error_message = "Already building" yield str(StreamData(event="error", data={"error": error_message})) return - graph_data = flow_data_store[flow_id].get("graph_data") - user_id = flow_data_store[flow_id]["user_id"] + graph_data = cache_service[flow_id].get("graph_data") + cache_service[flow_id]["user_id"] if not graph_data: error_message = "No data provided" @@ -155,7 +158,7 @@ async def stream_build( graph = Graph.from_payload(graph_data) number_of_nodes = len(graph.nodes) - flow_data_store[flow_id]["status"] = BuildStatus.IN_PROGRESS + update_build_status(cache_service, flow_id, BuildStatus.IN_PROGRESS) for i, vertex in enumerate(graph.generator_build(), 1): try: @@ -163,8 +166,10 @@ async def stream_build( "log": f"Building node {vertex.vertex_type}", } yield str(StreamData(event="log", data=log_dict)) - vertex.build(user_id) - + if vertex.is_task: + vertex = try_running_celery_task(vertex) + else: + vertex.build() params = vertex._built_object_repr() valid = True logger.debug(f"Building node {str(vertex.vertex_type)}") @@ -180,7 +185,7 @@ async def stream_build( logger.exception(exc) params = str(exc) valid = False - flow_data_store[flow_id]["status"] = BuildStatus.FAILURE + update_build_status(cache_service, flow_id, BuildStatus.FAILURE) vertex_id = ( vertex.parent_node_id if vertex.parent_is_top_level else vertex.id @@ -208,14 +213,15 @@ async def stream_build( "handle_keys": [], } yield str(StreamData(event="message", data=input_keys_response)) - chat_manager.set_cache(flow_id, langchain_object) + chat_service.set_cache(flow_id, langchain_object) # We need to reset the chat history - chat_manager.chat_history.empty_history(flow_id) - flow_data_store[flow_id]["status"] = BuildStatus.SUCCESS + chat_service.chat_history.empty_history(flow_id) + update_build_status(cache_service, flow_id, BuildStatus.SUCCESS) except Exception as exc: logger.exception(exc) logger.error("Error while building the flow: %s", exc) - flow_data_store[flow_id]["status"] = BuildStatus.FAILURE + + update_build_status(cache_service, flow_id, BuildStatus.FAILURE) yield str(StreamData(event="error", data={"error": str(exc)})) finally: yield str(StreamData(event="message", data=final_response)) @@ -225,3 +231,19 @@ async def stream_build( except Exception as exc: logger.error(f"Error streaming build: {exc}") raise HTTPException(status_code=500, detail=str(exc)) + + +def try_running_celery_task(vertex): + # Try running the task in celery + # and set the task_id to the local vertex + # if it fails, run the task locally + try: + from langflow.worker import build_vertex + + task = build_vertex.delay(vertex) + vertex.task_id = task.id + except Exception as exc: + logger.debug(f"Error running task in celery: {exc}") + vertex.task_id = None + vertex.build() + return vertex diff --git a/src/backend/langflow/api/v1/components.py b/src/backend/langflow/api/v1/components.py index 4071461fb..d2b39dfd2 100644 --- a/src/backend/langflow/api/v1/components.py +++ b/src/backend/langflow/api/v1/components.py @@ -2,7 +2,7 @@ from datetime import timezone from typing import List from uuid import UUID from langflow.services.database.models.component import Component, ComponentModel -from langflow.services.utils import get_session +from langflow.services.getters import get_session from sqlmodel import Session, select from fastapi import APIRouter, Depends, HTTPException from sqlalchemy.exc import IntegrityError diff --git a/src/backend/langflow/api/v1/endpoints.py b/src/backend/langflow/api/v1/endpoints.py index df02c828c..9b1213c2c 100644 --- a/src/backend/langflow/api/v1/endpoints.py +++ b/src/backend/langflow/api/v1/endpoints.py @@ -1,12 +1,17 @@ from http import HTTPStatus -from typing import Annotated, Any, Optional, Union +from typing import Annotated, Optional, Union from langflow.services.auth.utils import api_key_security, get_current_active_user + from langflow.services.cache.utils import save_uploaded_file from langflow.services.database.models.flow import Flow from langflow.processing.process import process_graph_cached, process_tweaks from langflow.services.database.models.user.user import User -from langflow.services.utils import get_settings_manager +from langflow.services.getters import ( + get_session_service, + get_settings_service, + get_task_service, +) from loguru import logger from fastapi import APIRouter, Depends, HTTPException, UploadFile, Body, status import sqlalchemy as sa @@ -15,66 +20,43 @@ from langflow.interface.custom.custom_component import CustomComponent from langflow.api.v1.schemas import ( ProcessResponse, + TaskResponse, + TaskStatusResponse, UploadFileResponse, CustomComponentCode, ) -from langflow.api.utils import merge_nested_dicts_with_renaming -from langflow.interface.types import ( - build_langchain_types_dict, - build_langchain_template_custom_component, - build_langchain_custom_component_list_from_path, -) +from langflow.services.getters import get_session + +try: + from langflow.worker import process_graph_cached_task +except ImportError: + + def process_graph_cached_task(*args, **kwargs): + raise NotImplementedError("Celery is not installed") + -from langflow.services.utils import get_session from sqlmodel import Session + +from langflow.services.task.manager import TaskService + # build router router = APIRouter(tags=["Base"]) @router.get("/all", dependencies=[Depends(get_current_active_user)]) def get_all( - settings_manager=Depends(get_settings_manager), + settings_service=Depends(get_settings_service), ): + from langflow.interface.types import get_all_types_dict + logger.debug("Building langchain types dict") - native_components = build_langchain_types_dict() - # custom_components is a list of dicts - # need to merge all the keys into one dict - custom_components_from_file: dict[str, Any] = {} - if settings_manager.settings.COMPONENTS_PATH: - logger.info( - f"Building custom components from {settings_manager.settings.COMPONENTS_PATH}" - ) - - custom_component_dicts = [] - processed_paths = [] - for path in settings_manager.settings.COMPONENTS_PATH: - if str(path) in processed_paths: - continue - custom_component_dict = build_langchain_custom_component_list_from_path( - str(path) - ) - custom_component_dicts.append(custom_component_dict) - processed_paths.append(str(path)) - - logger.info(f"Loading {len(custom_component_dicts)} category(ies)") - for custom_component_dict in custom_component_dicts: - # custom_component_dict is a dict of dicts - if not custom_component_dict: - continue - category = list(custom_component_dict.keys())[0] - logger.info( - f"Loading {len(custom_component_dict[category])} component(s) from category {category}" - ) - custom_components_from_file = merge_nested_dicts_with_renaming( - custom_components_from_file, custom_component_dict - ) - - return merge_nested_dicts_with_renaming( - native_components, custom_components_from_file - ) + try: + return get_all_types_dict(settings_service) + except Exception as exc: + raise HTTPException(status_code=500, detail=str(exc)) from exc # For backwards compatibility we will keep the old endpoint @@ -94,7 +76,9 @@ async def process( tweaks: Optional[dict] = None, clear_cache: Annotated[bool, Body(embed=True)] = False, # noqa: F821 session_id: Annotated[Union[None, str], Body(embed=True)] = None, # noqa: F821 + task_service: "TaskService" = Depends(get_task_service), api_key_user: User = Depends(api_key_security), + sync: Annotated[bool, Body(embed=True)] = True, # noqa: F821 ): """ Endpoint to process an input with a given flow_id. @@ -125,10 +109,55 @@ async def process( graph_data = process_tweaks(graph_data, tweaks) except Exception as exc: logger.error(f"Error processing tweaks: {exc}") - response, session_id = process_graph_cached( - graph_data, inputs, clear_cache, session_id + if sync: + task_id, result = await task_service.launch_and_await_task( + process_graph_cached_task + if task_service.use_celery + else process_graph_cached, + graph_data, + inputs, + clear_cache, + session_id, + ) + if isinstance(result, dict) and "result" in result: + task_result = result["result"] + session_id = result["session_id"] + elif hasattr(result, "result") and hasattr(result, "session_id"): + task_result = result.result + + session_id = result.session_id + else: + logger.warning( + "This is an experimental feature and may not work as expected." + "Please report any issues to our GitHub repository." + ) + if session_id is None: + # Generate a session ID + session_id = get_session_service().generate_key( + session_id=session_id, data_graph=graph_data + ) + task_id, task = await task_service.launch_task( + process_graph_cached_task + if task_service.use_celery + else process_graph_cached, + graph_data, + inputs, + clear_cache, + session_id, + ) + task_result = task.status + + if task_id: + task_response = TaskResponse(id=task_id, href=f"api/v1/task/{task_id}") + else: + task_response = None + + return ProcessResponse( + result=task_result, + task=task_response, + session_id=session_id, + backend=task_service.backend_name, ) - return ProcessResponse(result=response, session_id=session_id) except sa.exc.StatementError as exc: # StatementError('(builtins.ValueError) badly formed hexadecimal UUID string') if "badly formed hexadecimal UUID string" in str(exc): @@ -151,6 +180,23 @@ async def process( raise HTTPException(status_code=500, detail=str(e)) from e +@router.get("/task/{task_id}", response_model=TaskStatusResponse) +async def get_task_status(task_id: str): + task_service = get_task_service() + task = task_service.get_task(task_id) + result = None + if task.ready(): + result = task.result + if isinstance(result, dict) and "result" in result: + result = result["result"] + elif hasattr(result, "result"): + result = result.result + + if task is None: + raise HTTPException(status_code=404, detail="Task not found") + return TaskStatusResponse(status=task.status, result=result) + + @router.post( "/upload/{flow_id}", response_model=UploadFileResponse, @@ -159,7 +205,7 @@ async def process( async def create_upload_file(file: UploadFile, flow_id: str): # Cache file try: - file_path = save_uploaded_file(file.file, folder_name=flow_id) + file_path = save_uploaded_file(file, folder_name=flow_id) return UploadFileResponse( flowId=flow_id, @@ -182,6 +228,10 @@ def get_version(): async def custom_component( raw_code: CustomComponentCode, ): + from langflow.interface.types import ( + build_langchain_template_custom_component, + ) + extractor = CustomComponent(code=raw_code.code) extractor.is_check_valid() diff --git a/src/backend/langflow/api/v1/flows.py b/src/backend/langflow/api/v1/flows.py index be65048d4..9953db0db 100644 --- a/src/backend/langflow/api/v1/flows.py +++ b/src/backend/langflow/api/v1/flows.py @@ -12,8 +12,8 @@ from langflow.services.database.models.flow import ( FlowUpdate, ) from langflow.services.database.models.user.user import User -from langflow.services.utils import get_session -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_session +from langflow.services.getters import get_settings_service import orjson from sqlmodel import Session from fastapi import APIRouter, Depends, HTTPException @@ -83,7 +83,7 @@ def update_flow( flow_id: UUID, flow: FlowUpdate, current_user: User = Depends(get_current_active_user), - settings_manager=Depends(get_settings_manager), + settings_service=Depends(get_settings_service), ): """Update a flow.""" @@ -91,7 +91,7 @@ def update_flow( if not db_flow: raise HTTPException(status_code=404, detail="Flow not found") flow_data = flow.dict(exclude_unset=True) - if settings_manager.settings.REMOVE_API_KEYS: + if settings_service.settings.REMOVE_API_KEYS: flow_data = remove_api_keys(flow_data) for key, value in flow_data.items(): if value is not None: diff --git a/src/backend/langflow/api/v1/login.py b/src/backend/langflow/api/v1/login.py index 4241b8d47..4dfc723b5 100644 --- a/src/backend/langflow/api/v1/login.py +++ b/src/backend/langflow/api/v1/login.py @@ -2,7 +2,7 @@ from sqlmodel import Session from fastapi import APIRouter, Depends, HTTPException, status from fastapi.security import OAuth2PasswordRequestForm -from langflow.services.utils import get_session +from langflow.services.getters import get_session from langflow.api.v1.schemas import Token from langflow.services.auth.utils import ( authenticate_user, @@ -12,7 +12,7 @@ from langflow.services.auth.utils import ( get_current_active_user, ) -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service router = APIRouter(tags=["Login"]) @@ -23,7 +23,17 @@ async def login_to_get_access_token( db: Session = Depends(get_session), # _: Session = Depends(get_current_active_user) ): - if user := authenticate_user(form_data.username, form_data.password, db): + try: + user = authenticate_user(form_data.username, form_data.password, db) + except Exception as exc: + if isinstance(exc, HTTPException): + raise exc + raise HTTPException( + status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, + detail=str(exc), + ) from exc + + if user: return create_user_tokens(user_id=user.id, db=db, update_last_login=True) else: raise HTTPException( @@ -35,9 +45,9 @@ async def login_to_get_access_token( @router.get("/auto_login") async def auto_login( - db: Session = Depends(get_session), settings_manager=Depends(get_settings_manager) + db: Session = Depends(get_session), settings_service=Depends(get_settings_service) ): - if settings_manager.auth_settings.AUTO_LOGIN: + if settings_service.auth_settings.AUTO_LOGIN: return create_user_longterm_token(db) raise HTTPException( diff --git a/src/backend/langflow/api/v1/schemas.py b/src/backend/langflow/api/v1/schemas.py index c0867feb5..37e7d712d 100644 --- a/src/backend/langflow/api/v1/schemas.py +++ b/src/backend/langflow/api/v1/schemas.py @@ -47,11 +47,30 @@ class UpdateTemplateRequest(BaseModel): template: dict +class TaskResponse(BaseModel): + """Task response schema.""" + + id: Optional[str] = Field(None) + href: Optional[str] = Field(None) + + class ProcessResponse(BaseModel): """Process response schema.""" - result: dict + result: Any + task: Optional[TaskResponse] = None session_id: Optional[str] = None + backend: Optional[str] = None + + +# TaskStatusResponse( +# status=task.status, result=task.result if task.ready() else None +# ) +class TaskStatusResponse(BaseModel): + """Task status response schema.""" + + status: str + result: Optional[Any] = None class ChatMessage(BaseModel): @@ -59,6 +78,7 @@ class ChatMessage(BaseModel): is_bot: bool = False message: Union[str, None, dict] = None + chatKey: Optional[str] = None type: str = "human" @@ -66,6 +86,7 @@ class ChatResponse(ChatMessage): """Chat response schema.""" intermediate_steps: str + type: str is_bot: bool = True files: list = [] @@ -77,6 +98,14 @@ class ChatResponse(ChatMessage): return v +class PromptResponse(ChatMessage): + """Prompt response schema.""" + + prompt: str + type: str = "prompt" + is_bot: bool = True + + class FileResponse(ChatMessage): """File response schema.""" diff --git a/src/backend/langflow/api/v1/users.py b/src/backend/langflow/api/v1/users.py index 517dd7f69..73c7346d9 100644 --- a/src/backend/langflow/api/v1/users.py +++ b/src/backend/langflow/api/v1/users.py @@ -13,23 +13,26 @@ from sqlalchemy.exc import IntegrityError from sqlmodel import Session, select from fastapi import APIRouter, Depends, HTTPException -from langflow.services.utils import get_session +from langflow.services.getters import get_session, get_settings_service from langflow.services.auth.utils import ( get_current_active_superuser, get_current_active_user, get_password_hash, + verify_password, ) from langflow.services.database.models.user.crud import ( + get_user_by_id, update_user, ) -router = APIRouter(tags=["Users"]) +router = APIRouter(tags=["Users"], prefix="/users") -@router.post("/user", response_model=UserRead, status_code=201) +@router.post("/", response_model=UserRead, status_code=201) def add_user( user: UserCreate, session: Session = Depends(get_session), + settings_service=Depends(get_settings_service), ) -> User: """ Add a new user to the database. @@ -37,7 +40,7 @@ def add_user( new_user = User.from_orm(user) try: new_user.password = get_password_hash(user.password) - + new_user.is_active = settings_service.auth_settings.NEW_USER_IS_ACTIVE session.add(new_user) session.commit() session.refresh(new_user) @@ -50,7 +53,7 @@ def add_user( return new_user -@router.get("/user", response_model=UserRead) +@router.get("/whoami", response_model=UserRead) def read_current_user( current_user: User = Depends(get_current_active_user), ) -> User: @@ -60,11 +63,11 @@ def read_current_user( return current_user -@router.get("/users", response_model=UsersResponse) +@router.get("/", response_model=UsersResponse) def read_all_users( skip: int = 0, limit: int = 10, - current_user: Session = Depends(get_current_active_superuser), + _: Session = Depends(get_current_active_superuser), session: Session = Depends(get_session), ) -> UsersResponse: """ @@ -82,20 +85,63 @@ def read_all_users( ) -@router.patch("/user/{user_id}", response_model=UserRead) +@router.patch("/{user_id}", response_model=UserRead) def patch_user( user_id: UUID, - user: UserUpdate, - _: Session = Depends(get_current_active_user), + user_update: UserUpdate, + user: User = Depends(get_current_active_user), session: Session = Depends(get_session), ) -> User: """ Update an existing user's data. """ - return update_user(user_id, user, session) + if not user.is_superuser and user.id != user_id: + raise HTTPException( + status_code=403, detail="You don't have the permission to update this user" + ) + if user_update.password: + if not user.is_superuser: + raise HTTPException( + status_code=400, detail="You can't change your password here" + ) + user_update.password = get_password_hash(user_update.password) + + if user_db := get_user_by_id(session, user_id): + return update_user(user_db, user_update, session) + else: + raise HTTPException(status_code=404, detail="User not found") -@router.delete("/user/{user_id}") +@router.patch("/{user_id}/reset-password", response_model=UserRead) +def reset_password( + user_id: UUID, + user_update: UserUpdate, + user: User = Depends(get_current_active_user), + session: Session = Depends(get_session), +) -> User: + """ + Reset a user's password. + """ + if user_id != user.id: + raise HTTPException( + status_code=400, detail="You can't change another user's password" + ) + + if not user: + raise HTTPException(status_code=404, detail="User not found") + if verify_password(user_update.password, user.password): + raise HTTPException( + status_code=400, detail="You can't use your current password" + ) + new_password = get_password_hash(user_update.password) + user.password = new_password + session.commit() + session.refresh(user) + + return user + + +@router.delete("/{user_id}", response_model=dict) def delete_user( user_id: UUID, current_user: User = Depends(get_current_active_superuser), @@ -121,31 +167,3 @@ def delete_user( session.commit() return {"detail": "User deleted"} - - -# TODO: REMOVE - Just for testing purposes -@router.post("/super_user", response_model=User) -def add_super_user_for_testing_purposes_delete_me_before_merge_into_dev( - session: Session = Depends(get_session), -) -> User: - """ - Add a superuser for testing purposes. - (This should be removed in production) - """ - new_user = User( - username="superuser", - password=get_password_hash("12345"), - is_active=True, - is_superuser=True, - last_login_at=None, - ) - - try: - session.add(new_user) - session.commit() - session.refresh(new_user) - except IntegrityError as e: - session.rollback() - raise HTTPException(status_code=400, detail="User exists") from e - - return new_user diff --git a/src/backend/langflow/api/v1/validate.py b/src/backend/langflow/api/v1/validate.py index 457db5bd3..65fb66bd2 100644 --- a/src/backend/langflow/api/v1/validate.py +++ b/src/backend/langflow/api/v1/validate.py @@ -58,6 +58,16 @@ def post_validate_prompt(prompt_request: ValidatePromptRequest): def get_old_custom_fields(prompt_request): try: + if ( + len(prompt_request.frontend_node.custom_fields) == 1 + and prompt_request.name == "" + ): + # If there is only one custom field and the name is empty string + # then we are dealing with the first prompt request after the node was created + prompt_request.name = list( + prompt_request.frontend_node.custom_fields.keys() + )[0] + old_custom_fields = prompt_request.frontend_node.custom_fields[ prompt_request.name ].copy() diff --git a/src/backend/langflow/components/agents/OpenAIConversationalAgent.py b/src/backend/langflow/components/agents/OpenAIConversationalAgent.py index e2b876978..ff1a993b1 100644 --- a/src/backend/langflow/components/agents/OpenAIConversationalAgent.py +++ b/src/backend/langflow/components/agents/OpenAIConversationalAgent.py @@ -42,8 +42,8 @@ class ConversationalAgent(CustomComponent): self, model_name: str, openai_api_key: str, - openai_api_base: str, tools: Tool, + openai_api_base: Optional[str] = None, memory: Optional[BaseMemory] = None, system_message: Optional[SystemMessagePromptTemplate] = None, max_token_limit: int = 2000, diff --git a/src/backend/langflow/components/chains/PromptRunner.py b/src/backend/langflow/components/chains/PromptRunner.py index 141941c38..96a64f6fc 100644 --- a/src/backend/langflow/components/chains/PromptRunner.py +++ b/src/backend/langflow/components/chains/PromptRunner.py @@ -1,7 +1,7 @@ from langflow import CustomComponent from langchain.llms.base import BaseLLM -from langchain import PromptTemplate +from langchain.prompts import PromptTemplate from langchain.schema import Document @@ -16,17 +16,14 @@ class PromptRunner(CustomComponent): "info": "Make sure the prompt has all variables filled.", }, "code": {"show": False}, - "inputs": {"field_type": "code"}, } def build( - self, - llm: BaseLLM, - prompt: PromptTemplate, + self, llm: BaseLLM, prompt: PromptTemplate, inputs: dict = {} ) -> Document: chain = prompt | llm # The input is an empty dict because the prompt is already filled - result = chain.invoke({}) + result = chain.invoke(input=inputs) if hasattr(result, "content"): result = result.content self.repr_value = result diff --git a/src/backend/langflow/components/llms/HuggingFaceEndpoints.py b/src/backend/langflow/components/llms/HuggingFaceEndpoints.py new file mode 100644 index 000000000..ea2b4f20b --- /dev/null +++ b/src/backend/langflow/components/llms/HuggingFaceEndpoints.py @@ -0,0 +1,42 @@ +from typing import Optional +from langflow import CustomComponent +from langchain.llms import HuggingFaceEndpoint +from langchain.llms.base import BaseLLM + + +class HuggingFaceEndpointsComponent(CustomComponent): + display_name: str = "Hugging Face Inference API" + description: str = "LLM model from Hugging Face Inference API." + + def build_config(self): + return { + "endpoint_url": {"display_name": "Endpoint URL", "password": True}, + "task": { + "display_name": "Task", + "type": "select", + "options": ["text2text-generation", "text-generation", "summarization"], + }, + "huggingfacehub_api_token": {"display_name": "API token", "password": True}, + "model_kwargs": { + "display_name": "Model Keyword Arguments", + "field_type": "code", + }, + "code": {"show": False}, + } + + def build( + self, + endpoint_url: str, + task="text2text-generation", + huggingfacehub_api_token: Optional[str] = None, + model_kwargs: Optional[dict] = None, + ) -> BaseLLM: + try: + output = HuggingFaceEndpoint( + endpoint_url=endpoint_url, + task=task, + huggingfacehub_api_token=huggingfacehub_api_token, + ) + except Exception as e: + raise ValueError("Could not connect to HuggingFace Endpoints API.") from e + return output diff --git a/src/backend/langflow/components/llms/__init__.py b/src/backend/langflow/components/llms/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/backend/langflow/components/retrievers/MetalRetriever.py b/src/backend/langflow/components/retrievers/MetalRetriever.py new file mode 100644 index 000000000..b105cd24f --- /dev/null +++ b/src/backend/langflow/components/retrievers/MetalRetriever.py @@ -0,0 +1,28 @@ +from typing import Optional +from langflow import CustomComponent +from langchain.retrievers import MetalRetriever +from langchain.schema import BaseRetriever +from metal_sdk.metal import Metal # type: ignore + + +class MetalRetrieverComponent(CustomComponent): + display_name: str = "Metal Retriever" + description: str = "Retriever that uses the Metal API." + + def build_config(self): + return { + "api_key": {"display_name": "API Key", "password": True}, + "client_id": {"display_name": "Client ID", "password": True}, + "index_id": {"display_name": "Index ID"}, + "params": {"display_name": "Parameters"}, + "code": {"show": False}, + } + + def build( + self, api_key: str, client_id: str, index_id: str, params: Optional[dict] = None + ) -> BaseRetriever: + try: + metal = Metal(api_key=api_key, client_id=client_id, index_id=index_id) + except Exception as e: + raise ValueError("Could not connect to Metal API.") from e + return MetalRetriever(client=metal, params=params or {}) diff --git a/src/backend/langflow/components/retrievers/__init__.py b/src/backend/langflow/components/retrievers/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/backend/langflow/components/textsplitters/LanguageRecursiveTextSplitter.py b/src/backend/langflow/components/textsplitters/LanguageRecursiveTextSplitter.py new file mode 100644 index 000000000..636eb427e --- /dev/null +++ b/src/backend/langflow/components/textsplitters/LanguageRecursiveTextSplitter.py @@ -0,0 +1,80 @@ +from typing import Optional +from langflow import CustomComponent +from langchain.text_splitter import Language +from langchain.schema import Document + + +class LanguageRecursiveTextSplitterComponent(CustomComponent): + display_name: str = "Language Recursive Text Splitter" + description: str = "Split text into chunks of a specified length based on language." + documentation: str = "https://docs.langflow.org/components/text-splitters#languagerecursivetextsplitter" + + def build_config(self): + options = [x.value for x in Language] + return { + "documents": { + "display_name": "Documents", + "info": "The documents to split.", + }, + "separator_type": { + "display_name": "Separator Type", + "info": "The type of separator to use.", + "field_type": "str", + "options": options, + "value": "Python", + }, + "separators": { + "display_name": "Separators", + "info": "The characters to split on.", + "is_list": True, + }, + "chunk_size": { + "display_name": "Chunk Size", + "info": "The maximum length of each chunk.", + "field_type": "int", + "value": 1000, + }, + "chunk_overlap": { + "display_name": "Chunk Overlap", + "info": "The amount of overlap between chunks.", + "field_type": "int", + "value": 200, + }, + "code": {"show": False}, + } + + def build( + self, + documents: list[Document], + chunk_size: Optional[int] = 1000, + chunk_overlap: Optional[int] = 200, + separator_type: Optional[str] = "Python", + ) -> list[Document]: + """ + Split text into chunks of a specified length. + + Args: + separators (list[str]): The characters to split on. + chunk_size (int): The maximum length of each chunk. + chunk_overlap (int): The amount of overlap between chunks. + length_function (function): The function to use to calculate the length of the text. + + Returns: + list[str]: The chunks of text. + """ + from langchain.text_splitter import RecursiveCharacterTextSplitter + + # Make sure chunk_size and chunk_overlap are ints + if isinstance(chunk_size, str): + chunk_size = int(chunk_size) + if isinstance(chunk_overlap, str): + chunk_overlap = int(chunk_overlap) + + splitter = RecursiveCharacterTextSplitter.from_language( + language=Language(separator_type), + chunk_size=chunk_size, + chunk_overlap=chunk_overlap, + ) + + docs = splitter.split_documents(documents) + return docs diff --git a/src/backend/langflow/components/textsplitters/RecursiveCharacterTextSplitter.py b/src/backend/langflow/components/textsplitters/RecursiveCharacterTextSplitter.py new file mode 100644 index 000000000..751d2518c --- /dev/null +++ b/src/backend/langflow/components/textsplitters/RecursiveCharacterTextSplitter.py @@ -0,0 +1,79 @@ +from typing import Optional +from langflow import CustomComponent +from langchain.schema import Document +from langflow.utils.util import build_loader_repr_from_documents + + +class RecursiveCharacterTextSplitterComponent(CustomComponent): + display_name: str = "Recursive Character Text Splitter" + description: str = "Split text into chunks of a specified length." + documentation: str = "https://docs.langflow.org/components/text-splitters#recursivecharactertextsplitter" + + def build_config(self): + return { + "documents": { + "display_name": "Documents", + "info": "The documents to split.", + }, + "separators": { + "display_name": "Separators", + "info": 'The characters to split on.\nIf left empty defaults to ["\\n\\n", "\\n", " ", ""].', + "is_list": True, + }, + "chunk_size": { + "display_name": "Chunk Size", + "info": "The maximum length of each chunk.", + "field_type": "int", + "value": 1000, + }, + "chunk_overlap": { + "display_name": "Chunk Overlap", + "info": "The amount of overlap between chunks.", + "field_type": "int", + "value": 200, + }, + "code": {"show": False}, + } + + def build( + self, + documents: list[Document], + separators: Optional[list[str]] = None, + chunk_size: Optional[int] = 1000, + chunk_overlap: Optional[int] = 200, + ) -> list[Document]: + """ + Split text into chunks of a specified length. + + Args: + separators (list[str]): The characters to split on. + chunk_size (int): The maximum length of each chunk. + chunk_overlap (int): The amount of overlap between chunks. + length_function (function): The function to use to calculate the length of the text. + + Returns: + list[str]: The chunks of text. + """ + from langchain.text_splitter import RecursiveCharacterTextSplitter + + if separators == "": + separators = None + elif separators: + # check if the separators list has escaped characters + # if there are escaped characters, unescape them + separators = [x.encode().decode("unicode-escape") for x in separators] + + # Make sure chunk_size and chunk_overlap are ints + if isinstance(chunk_size, str): + chunk_size = int(chunk_size) + if isinstance(chunk_overlap, str): + chunk_overlap = int(chunk_overlap) + splitter = RecursiveCharacterTextSplitter( + separators=separators, + chunk_size=chunk_size, + chunk_overlap=chunk_overlap, + ) + + docs = splitter.split_documents(documents) + self.repr_value = build_loader_repr_from_documents(docs) + return docs diff --git a/src/backend/langflow/components/textsplitters/__init__.py b/src/backend/langflow/components/textsplitters/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/backend/langflow/components/utilities/GetRequest.py b/src/backend/langflow/components/utilities/GetRequest.py index 13ff0dc23..d5df32cca 100644 --- a/src/backend/langflow/components/utilities/GetRequest.py +++ b/src/backend/langflow/components/utilities/GetRequest.py @@ -19,7 +19,6 @@ class GetRequest(CustomComponent): }, "headers": { "display_name": "Headers", - "field_type": "code", "info": "The headers to send with the request.", }, "code": {"show": False}, diff --git a/src/backend/langflow/components/utilities/PostRequest.py b/src/backend/langflow/components/utilities/PostRequest.py index 4f7100d43..6857f4866 100644 --- a/src/backend/langflow/components/utilities/PostRequest.py +++ b/src/backend/langflow/components/utilities/PostRequest.py @@ -15,7 +15,6 @@ class PostRequest(CustomComponent): "url": {"display_name": "URL", "info": "The URL to make the request to."}, "headers": { "display_name": "Headers", - "field_type": "code", "info": "The headers to send with the request.", }, "code": {"show": False}, diff --git a/src/backend/langflow/components/utilities/UpdateRequest.py b/src/backend/langflow/components/utilities/UpdateRequest.py index 6e8991794..d18c94a56 100644 --- a/src/backend/langflow/components/utilities/UpdateRequest.py +++ b/src/backend/langflow/components/utilities/UpdateRequest.py @@ -15,7 +15,7 @@ class UpdateRequest(CustomComponent): "url": {"display_name": "URL", "info": "The URL to make the request to."}, "headers": { "display_name": "Headers", - "field_type": "code", + "field_type": "NestedDict", "info": "The headers to send with the request.", }, "code": {"show": False}, diff --git a/src/backend/langflow/config.yaml b/src/backend/langflow/config.yaml index d25893c25..48f7b1da1 100644 --- a/src/backend/langflow/config.yaml +++ b/src/backend/langflow/config.yaml @@ -171,8 +171,6 @@ prompts: textsplitters: CharacterTextSplitter: documentation: "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/character_text_splitter" - RecursiveCharacterTextSplitter: - documentation: "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/recursive_text_splitter" toolkits: OpenAPIToolkit: documentation: "" diff --git a/src/backend/langflow/core/__init__.py b/src/backend/langflow/core/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/backend/langflow/core/celery_app.py b/src/backend/langflow/core/celery_app.py new file mode 100644 index 000000000..ef3fc6545 --- /dev/null +++ b/src/backend/langflow/core/celery_app.py @@ -0,0 +1,11 @@ +from celery import Celery # type: ignore + + +def make_celery(app_name: str, config: str) -> Celery: + celery_app = Celery(app_name) + celery_app.config_from_object(config) + celery_app.conf.task_routes = {"langflow.worker.tasks.*": {"queue": "langflow"}} + return celery_app + + +celery_app = make_celery("langflow", "langflow.core.celeryconfig") diff --git a/src/backend/langflow/core/celeryconfig.py b/src/backend/langflow/core/celeryconfig.py new file mode 100644 index 000000000..35d51bba0 --- /dev/null +++ b/src/backend/langflow/core/celeryconfig.py @@ -0,0 +1,14 @@ +# celeryconfig.py +import os + +langflow_redis_host = os.environ.get("LANGFLOW_REDIS_HOST") +langflow_redis_port = os.environ.get("LANGFLOW_REDIS_PORT") +if "BROKER_URL" in os.environ and "RESULT_BACKEND" in os.environ: + # RabbitMQ + broker_url = os.environ.get("BROKER_URL", "amqp://localhost") + result_backend = os.environ.get("RESULT_BACKEND", "redis://localhost:6379/0") +elif langflow_redis_host and langflow_redis_port: + broker_url = f"redis://{langflow_redis_host}:{langflow_redis_port}/0" + result_backend = f"redis://{langflow_redis_host}:{langflow_redis_port}/0" +# tasks should be json or pickle +accept_content = ["json", "pickle"] diff --git a/src/backend/langflow/field_typing/__init__.py b/src/backend/langflow/field_typing/__init__.py new file mode 100644 index 000000000..927716b11 --- /dev/null +++ b/src/backend/langflow/field_typing/__init__.py @@ -0,0 +1,3 @@ +from .base import NestedDict + +__all__ = ["NestedDict"] diff --git a/src/backend/langflow/field_typing/base.py b/src/backend/langflow/field_typing/base.py new file mode 100644 index 000000000..ed3219888 --- /dev/null +++ b/src/backend/langflow/field_typing/base.py @@ -0,0 +1,4 @@ +from typing import Union, Dict + +# Type alias for more complex dicts +NestedDict = Dict[str, Union[str, Dict]] diff --git a/src/backend/langflow/graph/edge/base.py b/src/backend/langflow/graph/edge/base.py index b199efc0c..bd585c168 100644 --- a/src/backend/langflow/graph/edge/base.py +++ b/src/backend/langflow/graph/edge/base.py @@ -68,6 +68,17 @@ class Edge: f"has invalid handles" ) + def __setstate__(self, state): + self.source = state["source"] + self.target = state["target"] + self.target_param = state["target_param"] + self.source_handle = state["source_handle"] + self.target_handle = state["target_handle"] + + def reset(self) -> None: + self.source._build_params() + self.target._build_params() + def validate_edge(self) -> None: # Validate that the outputs of the source node are valid inputs # for the target node diff --git a/src/backend/langflow/graph/graph/base.py b/src/backend/langflow/graph/graph/base.py index a36c095de..c60741116 100644 --- a/src/backend/langflow/graph/graph/base.py +++ b/src/backend/langflow/graph/graph/base.py @@ -32,6 +32,12 @@ class Graph: self._edges = self._graph_data["edges"] self._build_graph() + def __setstate__(self, state): + self.__dict__.update(state) + for edge in self.edges: + edge.reset() + edge.validate_edge() + @classmethod def from_payload(cls, payload: Dict) -> "Graph": """ @@ -55,6 +61,11 @@ class Graph: f"Invalid payload. Expected keys 'nodes' and 'edges'. Found {list(payload.keys())}" ) from exc + def __eq__(self, other: object) -> bool: + if not isinstance(other, Graph): + return False + return self.__repr__() == other.__repr__() + def _build_graph(self) -> None: """Builds the graph from the nodes and edges.""" self.nodes = self._build_vertices() @@ -154,7 +165,7 @@ class Graph: def generator_build(self) -> Generator[Vertex, None, None]: """Builds each vertex in the graph and yields it.""" sorted_vertices = self.topological_sort() - logger.debug("Sorted vertices: %s", sorted_vertices) + logger.debug("There are %s vertices in the graph", len(sorted_vertices)) yield from sorted_vertices def get_node_neighbors(self, node: Vertex) -> Dict[Vertex, int]: diff --git a/src/backend/langflow/graph/vertex/base.py b/src/backend/langflow/graph/vertex/base.py index b10788693..c31cca3ec 100644 --- a/src/backend/langflow/graph/vertex/base.py +++ b/src/backend/langflow/graph/vertex/base.py @@ -1,5 +1,7 @@ import ast +import pickle from langflow.graph.utils import UnbuiltObject +from langflow.graph.vertex.utils import is_basic_type from langflow.interface.initialize import loading from langflow.interface.listing import lazy_load_dict from langflow.utils.constants import DIRECT_TYPES @@ -12,12 +14,19 @@ import types from typing import Any, Dict, List, Optional from typing import TYPE_CHECKING + if TYPE_CHECKING: from langflow.graph.edge.base import Edge class Vertex: - def __init__(self, data: Dict, base_type: Optional[str] = None) -> None: + def __init__( + self, + data: Dict, + base_type: Optional[str] = None, + is_task: bool = False, + params: Optional[Dict] = None, + ) -> None: self.id: str = data["id"] self._data = data self.edges: List["Edge"] = [] @@ -26,6 +35,59 @@ class Vertex: self._built_object = UnbuiltObject() self._built = False self.artifacts: Dict[str, Any] = {} + self.task_id: Optional[str] = None + self.is_task = is_task + self.params = params or {} + + def reset_params(self): + for edge in self.edges: + if edge.source != self: + target_param = edge.target_param + if target_param in ["document", "texts"]: + # this means they got data and have already ingested it + # so we continue after removing the param + self.params.pop(target_param, None) + continue + + if target_param in self.params and not is_basic_type( + self.params[target_param] + ): + # edge.source.params = {} + edge.source._build_params() + edge.source._built_object = UnbuiltObject() + edge.source._built = False + + self.params[target_param] = edge.source + + def __getstate__(self): + state_dict = self.__dict__.copy() + try: + # try pickling the built object + # if it fails, then we need to delete it + # and build it again + pickle.dumps(state_dict["_built_object"]) + except Exception: + self.reset_params() + del state_dict["_built_object"] + del state_dict["_built"] + return state_dict + + def __setstate__(self, state): + self._data = state["_data"] + self.params = state["params"] + self.base_type = state["base_type"] + self.is_task = state["is_task"] + self.edges = state["edges"] + self.id = state["id"] + self._parse_data() + if "_built_object" in state: + self._built_object = state["_built_object"] + self._built = state["_built"] + else: + self._built_object = UnbuiltObject() + self._built = False + self.artifacts: Dict[str, Any] = {} + self.task_id: Optional[str] = None self.parent_node_id: Optional[str] = self._data.get("parent_node_id") self.parent_is_top_level = False @@ -73,6 +135,13 @@ class Vertex: self.base_type = base_type break + def get_task(self): + # using the task_id, get the task from celery + # and return it + from celery.result import AsyncResult # type: ignore + + return AsyncResult(self.task_id) + def _build_params(self): # sourcery skip: merge-list-append, remove-redundant-if # Some params are required, some are optional @@ -94,9 +163,11 @@ class Vertex: for key, value in self.data["node"]["template"].items() if isinstance(value, dict) } - params = {} + params = self.params.copy() if self.params else {} for edge in self.edges: + if not hasattr(edge, "target_param"): + continue param_key = edge.target_param if param_key in template_dict: if template_dict[param_key]["list"]: @@ -107,6 +178,8 @@ class Vertex: params[param_key] = edge.source for key, value in template_dict.items(): + if key in params: + continue # Skip _type and any value that has show == False and is not code # If we don't want to show code but we want to use it if key == "_type" or (not value.get("show") and key != "code"): @@ -117,9 +190,10 @@ class Vertex: # Load the type in value.get('suffixes') using # what is inside value.get('content') # value.get('value') is the file name - file_path = value.get("file_path") - - params[key] = file_path + if file_path := value.get("file_path"): + params[key] = file_path + else: + raise ValueError(f"File path not found for {self.vertex_type}") elif value.get("type") in DIRECT_TYPES and params.get(key) is None: if value.get("type") == "code": try: @@ -127,6 +201,19 @@ class Vertex: except Exception as exc: logger.debug(f"Error parsing code: {exc}") params[key] = value.get("value") + elif value.get("type") in ["dict", "NestedDict"]: + # When dict comes from the frontend it comes as a + # list of dicts, so we need to convert it to a dict + # before passing it to the build method + _value = value.get("value") + if isinstance(_value, list): + params[key] = { + k: v + for item in value.get("value", []) + for k, v in item.items() + } + elif isinstance(_value, dict): + params[key] = _value else: params[key] = value.get("value") @@ -136,6 +223,7 @@ class Vertex: else: params.pop(key, None) # Add _type to params + self._raw_params = params self.params = params def _build(self, user_id=None): @@ -143,13 +231,13 @@ class Vertex: Initiate the build process. """ logger.debug(f"Building {self.vertex_type}") - self._build_each_node_in_params_dict() + self._build_each_node_in_params_dict(user_id) self._get_and_instantiate_class(user_id) self._validate_built_object() self._built = True - def _build_each_node_in_params_dict(self): + def _build_each_node_in_params_dict(self, user_id=None): """ Iterates over each node in the params dictionary and builds it. """ @@ -158,9 +246,9 @@ class Vertex: if value == self: del self.params[key] continue - self._build_node_and_update_params(key, value) + self._build_node_and_update_params(key, value, user_id) elif isinstance(value, list) and self._is_list_of_nodes(value): - self._build_list_of_nodes_and_update_params(key, value) + self._build_list_of_nodes_and_update_params(key, value, user_id) def _is_node(self, value): """ @@ -174,11 +262,31 @@ class Vertex: """ return all(self._is_node(node) for node in value) + def get_result(self, user_id=None, timeout=None) -> Any: + # Check if the Vertex was built already + if self._built: + return self._built_object + + if self.is_task and self.task_id is not None: + task = self.get_task() + result = task.get(timeout=timeout) + if result is not None: # If result is ready + self._update_built_object_and_artifacts(result) + return self._built_object + else: + # Handle the case when the result is not ready (retry, throw exception, etc.) + pass + + # If there's no task_id, build the vertex locally + self.build(user_id) + return self._built_object + def _build_node_and_update_params(self, key, node, user_id=None): """ Builds a given node and updates the params dictionary accordingly. """ - result = node.build(user_id) + + result = node.get_result(user_id) self._handle_func(key, result) if isinstance(result, list): self._extend_params_list_with_result(key, result) @@ -192,7 +300,7 @@ class Vertex: """ self.params[key] = [] for node in nodes: - built = node.build(user_id) + built = node.get_result(user_id) if isinstance(built, list): if key not in self.params: self.params[key] = [] @@ -237,6 +345,7 @@ class Vertex: ) self._update_built_object_and_artifacts(result) except Exception as exc: + logger.exception(exc) raise ValueError( f"Error building node {self.vertex_type}: {str(exc)}" ) from exc @@ -277,7 +386,10 @@ class Vertex: return f"Vertex(id={self.id}, data={self.data})" def __eq__(self, __o: object) -> bool: - return self.id == __o.id if isinstance(__o, Vertex) else False + try: + return self.id == __o.id if isinstance(__o, Vertex) else False + except AttributeError: + return False def __hash__(self) -> int: return id(self) diff --git a/src/backend/langflow/graph/vertex/types.py b/src/backend/langflow/graph/vertex/types.py index d5b7d2d58..7609982a5 100644 --- a/src/backend/langflow/graph/vertex/types.py +++ b/src/backend/langflow/graph/vertex/types.py @@ -7,14 +7,27 @@ from langflow.interface.utils import extract_input_variables_from_prompt class AgentVertex(Vertex): - def __init__(self, data: Dict): - super().__init__(data, base_type="agents") + def __init__(self, data: Dict, params: Optional[Dict] = None): + super().__init__(data, base_type="agents", params=params) self.tools: List[Union[ToolkitVertex, ToolVertex]] = [] self.chains: List[ChainVertex] = [] + def __getstate__(self): + state = super().__getstate__() + state["tools"] = self.tools + state["chains"] = self.chains + return state + + def __setstate__(self, state): + self.tools = state["tools"] + self.chains = state["chains"] + super().__setstate__(state) + def _set_tools_and_chains(self) -> None: for edge in self.edges: + if not hasattr(edge, "source"): + continue source_node = edge.source if isinstance(source_node, (ToolVertex, ToolkitVertex)): self.tools.append(source_node) @@ -38,16 +51,16 @@ class AgentVertex(Vertex): class ToolVertex(Vertex): - def __init__(self, data: Dict): - super().__init__(data, base_type="tools") + def __init__(self, data: Dict, params: Optional[Dict] = None): + super().__init__(data, base_type="tools", params=params) class LLMVertex(Vertex): built_node_type = None class_built_object = None - def __init__(self, data: Dict): - super().__init__(data, base_type="llms") + def __init__(self, data: Dict, params: Optional[Dict] = None): + super().__init__(data, base_type="llms", params=params) def build(self, force: bool = False, user_id=None, *args, **kwargs) -> Any: # LLM is different because some models might take up too much memory @@ -64,13 +77,13 @@ class LLMVertex(Vertex): class ToolkitVertex(Vertex): - def __init__(self, data: Dict): - super().__init__(data, base_type="toolkits") + def __init__(self, data: Dict, params=None): + super().__init__(data, base_type="toolkits", params=params) class FileToolVertex(ToolVertex): - def __init__(self, data: Dict): - super().__init__(data) + def __init__(self, data: Dict, params=None): + super().__init__(data, params=params) class WrapperVertex(Vertex): @@ -86,17 +99,19 @@ class WrapperVertex(Vertex): class DocumentLoaderVertex(Vertex): - def __init__(self, data: Dict): - super().__init__(data, base_type="documentloaders") + def __init__(self, data: Dict, params: Optional[Dict] = None): + super().__init__(data, base_type="documentloaders", params=params) def _built_object_repr(self): # This built_object is a list of documents. Maybe we should # show how many documents are in the list? if self._built_object: - avg_length = sum(len(doc.page_content) for doc in self._built_object) / len( - self._built_object - ) + avg_length = sum( + len(doc.page_content) + for doc in self._built_object + if hasattr(doc, "page_content") + ) / len(self._built_object) return f"""{self.vertex_type}({len(self._built_object)} documents) \nAvg. Document Length (characters): {int(avg_length)} Documents: {self._built_object[:3]}...""" @@ -104,14 +119,51 @@ class DocumentLoaderVertex(Vertex): class EmbeddingVertex(Vertex): - def __init__(self, data: Dict): - super().__init__(data, base_type="embeddings") + def __init__(self, data: Dict, params: Optional[Dict] = None): + super().__init__(data, base_type="embeddings", params=params) class VectorStoreVertex(Vertex): - def __init__(self, data: Dict): + def __init__(self, data: Dict, params=None): super().__init__(data, base_type="vectorstores") + self.params = params or {} + + # VectorStores may contain databse connections + # so we need to define the __reduce__ method and the __setstate__ method + # to avoid pickling errors + def clean_edges_for_pickling(self): + # for each edge that has self as source + # we need to clear the _built_object of the target + # so that we don't try to pickle a database connection + for edge in self.edges: + if edge.source == self: + edge.target._built_object = None + edge.target._built = False + edge.target.params[edge.target_param] = self + + def remove_docs_and_texts_from_params(self): + # remove documents and texts from params + # so that we don't try to pickle a database connection + self.params.pop("documents", None) + self.params.pop("texts", None) + + def __getstate__(self): + # We want to save the params attribute + # and if "documents" or "texts" are in the params + # we want to remove them because they have already + # been processed. + params = self.params.copy() + params.pop("documents", None) + params.pop("texts", None) + self.clean_edges_for_pickling() + + return super().__getstate__() + + def __setstate__(self, state): + super().__setstate__(state) + self.remove_docs_and_texts_from_params() + class MemoryVertex(Vertex): def __init__(self, data: Dict): @@ -124,8 +176,8 @@ class RetrieverVertex(Vertex): class TextSplitterVertex(Vertex): - def __init__(self, data: Dict): - super().__init__(data, base_type="textsplitters") + def __init__(self, data: Dict, params: Optional[Dict] = None): + super().__init__(data, base_type="textsplitters", params=params) def _built_object_repr(self): # This built_object is a list of documents. Maybe we should @@ -211,7 +263,7 @@ class PromptVertex(Vertex): self.params["input_variables"] = list( set(self.params["input_variables"]) ) - else: + elif isinstance(self.params, dict): self.params.pop("input_variables", None) self._build(user_id=user_id) @@ -258,8 +310,13 @@ class OutputParserVertex(Vertex): class CustomComponentVertex(Vertex): def __init__(self, data: Dict): - super().__init__(data, base_type="custom_components") + super().__init__(data, base_type="custom_components", is_task=True) def _built_object_repr(self): + if self.task_id and self.is_task: + if task := self.get_task(): + return str(task.info) + else: + return f"Task {self.task_id} is not running" if self.artifacts and "repr" in self.artifacts: return self.artifacts["repr"] or super()._built_object_repr() diff --git a/src/backend/langflow/graph/vertex/utils.py b/src/backend/langflow/graph/vertex/utils.py new file mode 100644 index 000000000..e1d439f4b --- /dev/null +++ b/src/backend/langflow/graph/vertex/utils.py @@ -0,0 +1,5 @@ +from langflow.utils.constants import PYTHON_BASIC_TYPES + + +def is_basic_type(obj): + return type(obj) in PYTHON_BASIC_TYPES diff --git a/src/backend/langflow/interface/agents/base.py b/src/backend/langflow/interface/agents/base.py index 574264e47..696f5afd0 100644 --- a/src/backend/langflow/interface/agents/base.py +++ b/src/backend/langflow/interface/agents/base.py @@ -5,7 +5,7 @@ from langchain.agents import types from langflow.custom.customs import get_custom_nodes from langflow.interface.agents.custom import CUSTOM_AGENTS from langflow.interface.base import LangChainTypeCreator -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.agents import AgentFrontendNode from loguru import logger @@ -54,7 +54,7 @@ class AgentCreator(LangChainTypeCreator): # Now this is a generator def to_list(self) -> List[str]: names = [] - settings_manager = get_settings_manager() + settings_service = get_settings_service() for _, agent in self.type_to_loader_dict.items(): agent_name = ( agent.function_name() @@ -62,8 +62,8 @@ class AgentCreator(LangChainTypeCreator): else agent.__name__ ) if ( - agent_name in settings_manager.settings.AGENTS - or settings_manager.settings.DEV + agent_name in settings_service.settings.AGENTS + or settings_service.settings.DEV ): names.append(agent_name) return names diff --git a/src/backend/langflow/interface/agents/custom.py b/src/backend/langflow/interface/agents/custom.py index b4e2b9bac..735b27917 100644 --- a/src/backend/langflow/interface/agents/custom.py +++ b/src/backend/langflow/interface/agents/custom.py @@ -1,6 +1,6 @@ from typing import Any, List, Optional -from langchain import LLMChain +from langchain.chains.llm import LLMChain from langchain.agents import ( AgentExecutor, Tool, diff --git a/src/backend/langflow/interface/agents/prebuilt.py b/src/backend/langflow/interface/agents/prebuilt.py index 5b81b7713..ec4799a81 100644 --- a/src/backend/langflow/interface/agents/prebuilt.py +++ b/src/backend/langflow/interface/agents/prebuilt.py @@ -1,4 +1,4 @@ -from langchain import LLMChain +from langchain.chains.llm import LLMChain from langchain.agents import AgentExecutor, ZeroShotAgent from langchain.agents.agent_toolkits.json.prompt import JSON_PREFIX, JSON_SUFFIX from langchain.agents.agent_toolkits.json.toolkit import JsonToolkit diff --git a/src/backend/langflow/interface/base.py b/src/backend/langflow/interface/base.py index b006a3174..13dd05619 100644 --- a/src/backend/langflow/interface/base.py +++ b/src/backend/langflow/interface/base.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from typing import Any, Dict, List, Optional, Type, Union from langchain.chains.base import Chain from langchain.agents import AgentExecutor -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from pydantic import BaseModel from langflow.template.field.base import TemplateField @@ -27,11 +27,11 @@ class LangChainTypeCreator(BaseModel, ABC): @property def docs_map(self) -> Dict[str, str]: """A dict with the name of the component as key and the documentation link as value.""" - settings_manager = get_settings_manager() + settings_service = get_settings_service() if self.name_docs_dict is None: try: type_settings = getattr( - settings_manager.settings, self.type_name.upper() + settings_service.settings, self.type_name.upper() ) self.name_docs_dict = { name: value_dict["documentation"] diff --git a/src/backend/langflow/interface/chains/base.py b/src/backend/langflow/interface/chains/base.py index 755ac82dd..b2d07b7e4 100644 --- a/src/backend/langflow/interface/chains/base.py +++ b/src/backend/langflow/interface/chains/base.py @@ -3,7 +3,7 @@ from typing import Any, Dict, List, Optional, Type from langflow.custom.customs import get_custom_nodes from langflow.interface.base import LangChainTypeCreator from langflow.interface.importing.utils import import_class -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.chains import ChainFrontendNode from loguru import logger @@ -31,7 +31,7 @@ class ChainCreator(LangChainTypeCreator): @property def type_to_loader_dict(self) -> Dict: if self.type_dict is None: - settings_manager = get_settings_manager() + settings_service = get_settings_service() self.type_dict: dict[str, Any] = { chain_name: import_class(f"langchain.chains.{chain_name}") for chain_name in chains.__all__ @@ -45,8 +45,8 @@ class ChainCreator(LangChainTypeCreator): self.type_dict = { name: chain for name, chain in self.type_dict.items() - if name in settings_manager.settings.CHAINS - or settings_manager.settings.DEV + if name in settings_service.settings.CHAINS + or settings_service.settings.DEV } return self.type_dict diff --git a/src/backend/langflow/interface/custom/constants.py b/src/backend/langflow/interface/custom/constants.py index 39a1e9f3b..58ecef637 100644 --- a/src/backend/langflow/interface/custom/constants.py +++ b/src/backend/langflow/interface/custom/constants.py @@ -1,7 +1,7 @@ -from langchain import PromptTemplate +from langchain.prompts import PromptTemplate from langchain.chains.base import Chain from langchain.document_loaders.base import BaseLoader -from langchain.embeddings.base import Embeddings +from langchain.schema.embeddings import Embeddings from langchain.llms.base import BaseLLM from langchain.schema import BaseRetriever, Document from langchain.text_splitter import TextSplitter @@ -45,7 +45,7 @@ DEFAULT_CUSTOM_COMPONENT_CODE = """from langflow import CustomComponent from langchain.llms.base import BaseLLM from langchain.chains import LLMChain -from langchain import PromptTemplate +from langchain.prompts import PromptTemplate from langchain.schema import Document import requests diff --git a/src/backend/langflow/interface/custom/custom_component.py b/src/backend/langflow/interface/custom/custom_component.py index 1357daf68..ccc0b08b2 100644 --- a/src/backend/langflow/interface/custom/custom_component.py +++ b/src/backend/langflow/interface/custom/custom_component.py @@ -4,7 +4,7 @@ from fastapi import HTTPException from langflow.interface.custom.constants import CUSTOM_COMPONENT_SUPPORTED_TYPES from langflow.interface.custom.component import Component from langflow.interface.custom.directory_reader import DirectoryReader -from langflow.services.utils import get_db_manager +from langflow.services.getters import get_db_service from langflow.interface.custom.utils import extract_inner_type from langflow.utils import validate @@ -95,7 +95,20 @@ class CustomComponent(Component, extra=Extra.allow): build_method = build_methods[0] - return build_method["args"] + args = build_method["args"] + for arg in args: + if arg.get("type") == "prompt": + raise HTTPException( + status_code=400, + detail={ + "error": "Type hint Error", + "traceback": ( + "Prompt type is not supported in the build method." + " Try using PromptTemplate instead." + ), + }, + ) + return args @property def get_function_entrypoint_return_type(self) -> List[str]: @@ -176,25 +189,25 @@ class CustomComponent(Component, extra=Extra.allow): return validate.create_function(self.code, self.function_entrypoint_name) def load_flow(self, flow_id: str, tweaks: Optional[dict] = None) -> Any: - from langflow.processing.process import build_sorted_vertices_with_caching + from langflow.processing.process import build_sorted_vertices from langflow.processing.process import process_tweaks - db_manager = get_db_manager() - with session_getter(db_manager) as session: + db_service = get_db_service() + with session_getter(db_service) as session: graph_data = flow.data if (flow := session.get(Flow, flow_id)) else None if not graph_data: raise ValueError(f"Flow {flow_id} not found") if tweaks: graph_data = process_tweaks(graph_data=graph_data, tweaks=tweaks) - return build_sorted_vertices_with_caching(graph_data) + return build_sorted_vertices(graph_data) def list_flows(self, *, get_session: Optional[Callable] = None) -> List[Flow]: if not self.user_id: raise ValueError("Session is invalid") try: get_session = get_session or session_getter - db_manager = get_db_manager() - with get_session(db_manager) as session: + db_service = get_db_service() + with get_session(db_service) as session: flows = session.query(Flow).filter(Flow.user_id == self.user_id).all() return flows except Exception as e: @@ -209,8 +222,8 @@ class CustomComponent(Component, extra=Extra.allow): get_session: Optional[Callable] = None, ) -> Flow: get_session = get_session or session_getter - db_manager = get_db_manager() - with get_session(db_manager) as session: + db_service = get_db_service() + with get_session(db_service) as session: if flow_id: flow = session.query(Flow).get(flow_id) elif flow_name: diff --git a/src/backend/langflow/interface/document_loaders/base.py b/src/backend/langflow/interface/document_loaders/base.py index a2c147e16..e2c379b67 100644 --- a/src/backend/langflow/interface/document_loaders/base.py +++ b/src/backend/langflow/interface/document_loaders/base.py @@ -1,7 +1,7 @@ from typing import Dict, List, Optional, Type from langflow.interface.base import LangChainTypeCreator -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.documentloaders import DocumentLoaderFrontNode from langflow.interface.custom_lists import documentloaders_type_to_cls_dict @@ -31,12 +31,12 @@ class DocumentLoaderCreator(LangChainTypeCreator): return None def to_list(self) -> List[str]: - settings_manager = get_settings_manager() + settings_service = get_settings_service() return [ documentloader.__name__ for documentloader in self.type_to_loader_dict.values() - if documentloader.__name__ in settings_manager.settings.DOCUMENTLOADERS - or settings_manager.settings.DEV + if documentloader.__name__ in settings_service.settings.DOCUMENTLOADERS + or settings_service.settings.DEV ] diff --git a/src/backend/langflow/interface/embeddings/base.py b/src/backend/langflow/interface/embeddings/base.py index 1063d10d1..d280cf1c1 100644 --- a/src/backend/langflow/interface/embeddings/base.py +++ b/src/backend/langflow/interface/embeddings/base.py @@ -2,7 +2,7 @@ from typing import Dict, List, Optional, Type from langflow.interface.base import LangChainTypeCreator from langflow.interface.custom_lists import embedding_type_to_cls_dict -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.base import FrontendNode from langflow.template.frontend_node.embeddings import EmbeddingFrontendNode @@ -33,12 +33,12 @@ class EmbeddingCreator(LangChainTypeCreator): return None def to_list(self) -> List[str]: - settings_manager = get_settings_manager() + settings_service = get_settings_service() return [ embedding.__name__ for embedding in self.type_to_loader_dict.values() - if embedding.__name__ in settings_manager.settings.EMBEDDINGS - or settings_manager.settings.DEV + if embedding.__name__ in settings_service.settings.EMBEDDINGS + or settings_service.settings.DEV ] diff --git a/src/backend/langflow/interface/importing/utils.py b/src/backend/langflow/interface/importing/utils.py index d07222dd1..44d72df42 100644 --- a/src/backend/langflow/interface/importing/utils.py +++ b/src/backend/langflow/interface/importing/utils.py @@ -3,7 +3,7 @@ import importlib from typing import Any, Type -from langchain import PromptTemplate +from langchain.prompts import PromptTemplate from langchain.agents import Agent from langchain.base_language import BaseLanguageModel from langchain.chains.base import Chain @@ -144,6 +144,8 @@ def import_chain(chain: str) -> Type[Chain]: if chain in CUSTOM_CHAINS: return CUSTOM_CHAINS[chain] + if chain == "SQLDatabaseChain": + return import_class("langchain_experimental.sql.SQLDatabaseChain") return import_class(f"langchain.chains.{chain}") diff --git a/src/backend/langflow/interface/initialize/loading.py b/src/backend/langflow/interface/initialize/loading.py index b600fb5b2..7b3ad4f6f 100644 --- a/src/backend/langflow/interface/initialize/loading.py +++ b/src/backend/langflow/interface/initialize/loading.py @@ -1,7 +1,7 @@ import json import orjson from typing import Any, Callable, Dict, Sequence, Type, TYPE_CHECKING - +from langchain.schema import Document from langchain.agents import agent as agent_module from langchain.agents.agent import AgentExecutor from langchain.agents.agent_toolkits.base import BaseToolkit @@ -40,12 +40,23 @@ if TYPE_CHECKING: from langflow import CustomComponent +def build_vertex_in_params(params: Dict) -> Dict: + from langflow.graph.vertex.base import Vertex + + # If any of the values in params is a Vertex, we will build it + return { + key: value.build() if isinstance(value, Vertex) else value + for key, value in params.items() + } + + def instantiate_class( node_type: str, base_type: str, params: Dict, user_id=None ) -> Any: """Instantiate class from module type and key, and params""" params = convert_params_to_sets(params) params = convert_kwargs(params) + if node_type in CUSTOM_NODES: if custom_node := CUSTOM_NODES.get(node_type): if hasattr(custom_node, "initialize"): @@ -100,7 +111,7 @@ def instantiate_based_on_type(class_object, base_type, node_type, params, user_i elif base_type == "vectorstores": return instantiate_vectorstore(class_object, params) elif base_type == "documentloaders": - return instantiate_documentloader(class_object, params) + return instantiate_documentloader(node_type, class_object, params) elif base_type == "textsplitters": return instantiate_textsplitter(class_object, params) elif base_type == "utilities": @@ -289,6 +300,13 @@ def instantiate_embedding(node_type, class_object, params: Dict): def instantiate_vectorstore(class_object: Type[VectorStore], params: Dict): search_kwargs = params.pop("search_kwargs", {}) + # clean up docs or texts to have only documents + if "texts" in params: + params["documents"] = params.pop("texts") + if "documents" in params: + params["documents"] = [ + doc for doc in params["documents"] if isinstance(doc, Document) + ] if initializer := vecstore_initializer.get(class_object.__name__): vecstore = initializer(class_object, params) else: @@ -303,7 +321,9 @@ def instantiate_vectorstore(class_object: Type[VectorStore], params: Dict): return vecstore -def instantiate_documentloader(class_object: Type[BaseLoader], params: Dict): +def instantiate_documentloader( + node_type: str, class_object: Type[BaseLoader], params: Dict +): if "file_filter" in params: # file_filter will be a string but we need a function # that will be used to filter the files using file_filter @@ -323,6 +343,11 @@ def instantiate_documentloader(class_object: Type[BaseLoader], params: Dict): raise ValueError( "The metadata you provided is not a valid JSON string." ) from exc + + if node_type == "WebBaseLoader": + if web_path := params.pop("web_path", None): + params["web_paths"] = [web_path] + docs = class_object(**params).load() # Now if metadata is an empty dict, we will not add it to the documents if metadata: diff --git a/src/backend/langflow/interface/initialize/vector_store.py b/src/backend/langflow/interface/initialize/vector_store.py index 233292626..59e7c0d3b 100644 --- a/src/backend/langflow/interface/initialize/vector_store.py +++ b/src/backend/langflow/interface/initialize/vector_store.py @@ -8,7 +8,7 @@ from langchain.vectorstores import ( SupabaseVectorStore, MongoDBAtlasVectorSearch, ) - +from langchain.schema import Document import os import orjson @@ -201,11 +201,16 @@ def initialize_chroma(class_object: Type[Chroma], params: dict): if "texts" in params: params["documents"] = params.pop("texts") for doc in params["documents"]: + if not isinstance(doc, Document): + # remove any non-Document objects from the list + params["documents"].remove(doc) + continue if doc.metadata is None: doc.metadata = {} for key, value in doc.metadata.items(): if value is None: doc.metadata[key] = "" + chromadb = class_object.from_documents(**params) if persist: chromadb.persist() diff --git a/src/backend/langflow/interface/listing.py b/src/backend/langflow/interface/listing.py index 1cab1efbc..aa72e568e 100644 --- a/src/backend/langflow/interface/listing.py +++ b/src/backend/langflow/interface/listing.py @@ -1,19 +1,4 @@ -from langflow.interface.agents.base import agent_creator -from langflow.interface.chains.base import chain_creator -from langflow.interface.document_loaders.base import documentloader_creator -from langflow.interface.embeddings.base import embedding_creator -from langflow.interface.llms.base import llm_creator -from langflow.interface.memories.base import memory_creator -from langflow.interface.prompts.base import prompt_creator -from langflow.interface.text_splitters.base import textsplitter_creator -from langflow.interface.toolkits.base import toolkits_creator -from langflow.interface.tools.base import tool_creator -from langflow.interface.utilities.base import utility_creator -from langflow.interface.vector_store.base import vectorstore_creator -from langflow.interface.wrappers.base import wrapper_creator -from langflow.interface.output_parsers.base import output_parser_creator -from langflow.interface.retrievers.base import retriever_creator -from langflow.interface.custom.base import custom_component_creator +from langflow.services.getters import get_settings_service from langflow.utils.lazy_load import LazyLoadDictBase @@ -33,24 +18,10 @@ class AllTypesDict(LazyLoadDictBase): } def get_type_dict(self): - return { - "agents": agent_creator.to_list(), - "prompts": prompt_creator.to_list(), - "llms": llm_creator.to_list(), - "tools": tool_creator.to_list(), - "chains": chain_creator.to_list(), - "memory": memory_creator.to_list(), - "toolkits": toolkits_creator.to_list(), - "wrappers": wrapper_creator.to_list(), - "documentLoaders": documentloader_creator.to_list(), - "vectorStore": vectorstore_creator.to_list(), - "embeddings": embedding_creator.to_list(), - "textSplitters": textsplitter_creator.to_list(), - "utilities": utility_creator.to_list(), - "outputParsers": output_parser_creator.to_list(), - "retrievers": retriever_creator.to_list(), - "custom_components": custom_component_creator.to_list(), - } + from langflow.interface.types import get_all_types_dict + + settings_service = get_settings_service() + return get_all_types_dict(settings_service=settings_service) lazy_load_dict = AllTypesDict() diff --git a/src/backend/langflow/interface/llms/base.py b/src/backend/langflow/interface/llms/base.py index 87e4937cf..ffb7fa2f2 100644 --- a/src/backend/langflow/interface/llms/base.py +++ b/src/backend/langflow/interface/llms/base.py @@ -2,7 +2,7 @@ from typing import Dict, List, Optional, Type from langflow.interface.base import LangChainTypeCreator from langflow.interface.custom_lists import llm_type_to_cls_dict -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.llms import LLMFrontendNode from loguru import logger @@ -34,12 +34,12 @@ class LLMCreator(LangChainTypeCreator): return None def to_list(self) -> List[str]: - settings_manager = get_settings_manager() + settings_service = get_settings_service() return [ llm.__name__ for llm in self.type_to_loader_dict.values() - if llm.__name__ in settings_manager.settings.LLMS - or settings_manager.settings.DEV + if llm.__name__ in settings_service.settings.LLMS + or settings_service.settings.DEV ] diff --git a/src/backend/langflow/interface/memories/base.py b/src/backend/langflow/interface/memories/base.py index 61c6cc430..3f3658304 100644 --- a/src/backend/langflow/interface/memories/base.py +++ b/src/backend/langflow/interface/memories/base.py @@ -2,7 +2,7 @@ from typing import Dict, List, Optional, Type from langflow.interface.base import LangChainTypeCreator from langflow.interface.custom_lists import memory_type_to_cls_dict -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.base import FrontendNode from langflow.template.frontend_node.memories import MemoryFrontendNode @@ -49,12 +49,12 @@ class MemoryCreator(LangChainTypeCreator): return None def to_list(self) -> List[str]: - settings_manager = get_settings_manager() + settings_service = get_settings_service() return [ memory.__name__ for memory in self.type_to_loader_dict.values() - if memory.__name__ in settings_manager.settings.MEMORIES - or settings_manager.settings.DEV + if memory.__name__ in settings_service.settings.MEMORIES + or settings_service.settings.DEV ] diff --git a/src/backend/langflow/interface/output_parsers/base.py b/src/backend/langflow/interface/output_parsers/base.py index b6eb36a0e..06dfdf4eb 100644 --- a/src/backend/langflow/interface/output_parsers/base.py +++ b/src/backend/langflow/interface/output_parsers/base.py @@ -4,7 +4,7 @@ from langchain import output_parsers from langflow.interface.base import LangChainTypeCreator from langflow.interface.importing.utils import import_class -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.output_parsers import OutputParserFrontendNode from loguru import logger @@ -24,7 +24,7 @@ class OutputParserCreator(LangChainTypeCreator): @property def type_to_loader_dict(self) -> Dict: if self.type_dict is None: - settings_manager = get_settings_manager() + settings_service = get_settings_service() self.type_dict = { output_parser_name: import_class( f"langchain.output_parsers.{output_parser_name}" @@ -35,8 +35,8 @@ class OutputParserCreator(LangChainTypeCreator): self.type_dict = { name: output_parser for name, output_parser in self.type_dict.items() - if name in settings_manager.settings.OUTPUT_PARSERS - or settings_manager.settings.DEV + if name in settings_service.settings.OUTPUT_PARSERS + or settings_service.settings.DEV } return self.type_dict diff --git a/src/backend/langflow/interface/prompts/base.py b/src/backend/langflow/interface/prompts/base.py index 70818429e..29d3e8ba8 100644 --- a/src/backend/langflow/interface/prompts/base.py +++ b/src/backend/langflow/interface/prompts/base.py @@ -5,7 +5,7 @@ from langchain import prompts from langflow.custom.customs import get_custom_nodes from langflow.interface.base import LangChainTypeCreator from langflow.interface.importing.utils import import_class -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.prompts import PromptFrontendNode from loguru import logger @@ -21,7 +21,7 @@ class PromptCreator(LangChainTypeCreator): @property def type_to_loader_dict(self) -> Dict: - settings_manager = get_settings_manager() + settings_service = get_settings_service() if self.type_dict is None: self.type_dict = { prompt_name: import_class(f"langchain.prompts.{prompt_name}") @@ -36,8 +36,8 @@ class PromptCreator(LangChainTypeCreator): self.type_dict = { name: prompt for name, prompt in self.type_dict.items() - if name in settings_manager.settings.PROMPTS - or settings_manager.settings.DEV + if name in settings_service.settings.PROMPTS + or settings_service.settings.DEV } return self.type_dict diff --git a/src/backend/langflow/interface/retrievers/base.py b/src/backend/langflow/interface/retrievers/base.py index 92e3f2f61..4ee40e659 100644 --- a/src/backend/langflow/interface/retrievers/base.py +++ b/src/backend/langflow/interface/retrievers/base.py @@ -4,7 +4,7 @@ from langchain import retrievers from langflow.interface.base import LangChainTypeCreator from langflow.interface.importing.utils import import_class -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.retrievers import RetrieverFrontendNode from loguru import logger @@ -49,12 +49,12 @@ class RetrieverCreator(LangChainTypeCreator): return None def to_list(self) -> List[str]: - settings_manager = get_settings_manager() + settings_service = get_settings_service() return [ retriever for retriever in self.type_to_loader_dict.keys() - if retriever in settings_manager.settings.RETRIEVERS - or settings_manager.settings.DEV + if retriever in settings_service.settings.RETRIEVERS + or settings_service.settings.DEV ] diff --git a/src/backend/langflow/interface/run.py b/src/backend/langflow/interface/run.py index 9d3d95cda..63391204a 100644 --- a/src/backend/langflow/interface/run.py +++ b/src/backend/langflow/interface/run.py @@ -1,22 +1,9 @@ -from typing import Any, Dict, Tuple -from langflow.services.cache.utils import memoize_dict +from typing import Dict, Tuple from langflow.graph import Graph from loguru import logger -@memoize_dict(maxsize=10) -def build_langchain_object_with_caching(data_graph): - """ - Build langchain object from data_graph. - """ - - logger.debug("Building langchain object") - graph = Graph.from_payload(data_graph) - return graph.build() - - -@memoize_dict(maxsize=10) -def build_sorted_vertices_with_caching(data_graph) -> Tuple[Any, Dict]: +def build_sorted_vertices(data_graph) -> Tuple[Graph, Dict]: """ Build langchain object from data_graph. """ @@ -29,7 +16,7 @@ def build_sorted_vertices_with_caching(data_graph) -> Tuple[Any, Dict]: vertex.build() if vertex.artifacts: artifacts.update(vertex.artifacts) - return graph.build(), artifacts + return graph, artifacts def build_langchain_object(data_graph): @@ -58,8 +45,12 @@ def get_memory_key(langchain_object): "chat_history": "history", "history": "chat_history", } - memory_key = langchain_object.memory.memory_key - return mem_key_dict.get(memory_key) + # Check if memory_key attribute exists + if hasattr(langchain_object.memory, "memory_key"): + memory_key = langchain_object.memory.memory_key + return mem_key_dict.get(memory_key) + else: + return None # or some other default value or action def update_memory_keys(langchain_object, possible_new_mem_key): diff --git a/src/backend/langflow/interface/text_splitters/base.py b/src/backend/langflow/interface/text_splitters/base.py index 8b21303ce..4f337817f 100644 --- a/src/backend/langflow/interface/text_splitters/base.py +++ b/src/backend/langflow/interface/text_splitters/base.py @@ -1,7 +1,7 @@ from typing import Dict, List, Optional, Type from langflow.interface.base import LangChainTypeCreator -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.textsplitters import TextSplittersFrontendNode from langflow.interface.custom_lists import textsplitter_type_to_cls_dict @@ -31,12 +31,12 @@ class TextSplitterCreator(LangChainTypeCreator): return None def to_list(self) -> List[str]: - settings_manager = get_settings_manager() + settings_service = get_settings_service() return [ textsplitter.__name__ for textsplitter in self.type_to_loader_dict.values() - if textsplitter.__name__ in settings_manager.settings.TEXTSPLITTERS - or settings_manager.settings.DEV + if textsplitter.__name__ in settings_service.settings.TEXTSPLITTERS + or settings_service.settings.DEV ] diff --git a/src/backend/langflow/interface/toolkits/base.py b/src/backend/langflow/interface/toolkits/base.py index fe0003b15..73ca4852f 100644 --- a/src/backend/langflow/interface/toolkits/base.py +++ b/src/backend/langflow/interface/toolkits/base.py @@ -4,7 +4,7 @@ from langchain.agents import agent_toolkits from langflow.interface.base import LangChainTypeCreator from langflow.interface.importing.utils import import_class, import_module -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from loguru import logger from langflow.utils.util import build_template_from_class @@ -30,7 +30,7 @@ class ToolkitCreator(LangChainTypeCreator): @property def type_to_loader_dict(self) -> Dict: if self.type_dict is None: - settings_manager = get_settings_manager() + settings_service = get_settings_service() self.type_dict = { toolkit_name: import_class( f"langchain.agents.agent_toolkits.{toolkit_name}" @@ -38,7 +38,7 @@ class ToolkitCreator(LangChainTypeCreator): # if toolkit_name is not lower case it is a class for toolkit_name in agent_toolkits.__all__ if not toolkit_name.islower() - and toolkit_name in settings_manager.settings.TOOLKITS + and toolkit_name in settings_service.settings.TOOLKITS } return self.type_dict diff --git a/src/backend/langflow/interface/tools/base.py b/src/backend/langflow/interface/tools/base.py index 1dbc9a6ed..a99025ff7 100644 --- a/src/backend/langflow/interface/tools/base.py +++ b/src/backend/langflow/interface/tools/base.py @@ -15,7 +15,7 @@ from langflow.interface.tools.constants import ( OTHER_TOOLS, ) from langflow.interface.tools.util import get_tool_params -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.field.base import TemplateField from langflow.template.template.base import Template @@ -67,7 +67,7 @@ class ToolCreator(LangChainTypeCreator): @property def type_to_loader_dict(self) -> Dict: - settings_manager = get_settings_manager() + settings_service = get_settings_service() if self.tools_dict is None: all_tools = {} @@ -77,8 +77,8 @@ class ToolCreator(LangChainTypeCreator): tool_name = tool_params.get("name") or tool if ( - tool_name in settings_manager.settings.TOOLS - or settings_manager.settings.DEV + tool_name in settings_service.settings.TOOLS + or settings_service.settings.DEV ): if tool_name == "JsonSpec": tool_params["path"] = tool_params.pop("dict_") # type: ignore diff --git a/src/backend/langflow/interface/tools/util.py b/src/backend/langflow/interface/tools/util.py index f92386f18..8e4f582c1 100644 --- a/src/backend/langflow/interface/tools/util.py +++ b/src/backend/langflow/interface/tools/util.py @@ -1,13 +1,13 @@ import ast import inspect +import textwrap from typing import Dict, Union from langchain.agents.tools import Tool -from loguru import logger def get_func_tool_params(func, **kwargs) -> Union[Dict, None]: - tree = ast.parse(inspect.getsource(func)) + tree = ast.parse(textwrap.dedent(inspect.getsource(func))) # Iterate over the statements in the abstract syntax tree for node in ast.walk(tree): @@ -58,13 +58,7 @@ def get_func_tool_params(func, **kwargs) -> Union[Dict, None]: def get_class_tool_params(cls, **kwargs) -> Union[Dict, None]: - try: - tree = ast.parse(inspect.getsource(cls)) - except IndentationError: - logger.error( - f"Error parsing class {cls.__name__}. Make sure there are no tabs in the code." - ) - return None + tree = ast.parse(textwrap.dedent(inspect.getsource(cls))) tool_params = {} diff --git a/src/backend/langflow/interface/types.py b/src/backend/langflow/interface/types.py index 47743560e..6708c11c9 100644 --- a/src/backend/langflow/interface/types.py +++ b/src/backend/langflow/interface/types.py @@ -1,10 +1,11 @@ import ast import contextlib from typing import Any, List -from langflow.api.utils import merge_nested_dicts_with_renaming +from langflow.api.utils import get_new_key from langflow.interface.agents.base import agent_creator from langflow.interface.chains.base import chain_creator from langflow.interface.custom.constants import CUSTOM_COMPONENT_SUPPORTED_TYPES +from langflow.interface.custom.utils import extract_inner_type from langflow.interface.document_loaders.base import documentloader_creator from langflow.interface.embeddings.base import embedding_creator from langflow.interface.importing.utils import get_function_custom @@ -84,6 +85,8 @@ def build_langchain_types_dict(): # sourcery skip: dict-assign-update-to-union def process_type(field_type: str): + if field_type.startswith("list") or field_type.startswith("List"): + return extract_inner_type(field_type) return "prompt" if field_type == "Prompt" else field_type @@ -100,6 +103,7 @@ def add_new_custom_field( # if it is, update the value display_name = field_config.pop("display_name", field_name) field_type = field_config.pop("field_type", field_type) + field_contains_list = "list" in field_type.lower() field_type = process_type(field_type) field_value = field_config.pop("value", field_value) field_advanced = field_config.pop("advanced", False) @@ -110,7 +114,9 @@ def add_new_custom_field( # If options is a list, then it's a dropdown # If options is None, then it's a list of strings is_list = isinstance(field_config.get("options"), list) - field_config["is_list"] = is_list or field_config.get("is_list", False) + field_config["is_list"] = ( + is_list or field_config.get("is_list", False) or field_contains_list + ) if "name" in field_config: warnings.warn( @@ -172,7 +178,7 @@ def extract_type_from_optional(field_type): Returns: str: The extracted type, or an empty string if no type was found. """ - match = re.search(r"\[(.*?)\]", field_type) + match = re.search(r"\[(.*?)\]$", field_type) return match[1] if match else None @@ -284,31 +290,44 @@ def add_base_classes(frontend_node, return_types: List[str]): def build_langchain_template_custom_component(custom_component: CustomComponent): """Build a custom component template for the langchain""" - logger.debug("Building custom component template") - frontend_node = build_frontend_node(custom_component) + try: + logger.debug("Building custom component template") + frontend_node = build_frontend_node(custom_component) - if frontend_node is None: - return None - logger.debug("Built base frontend node") - template_config = custom_component.build_template_config + if frontend_node is None: + return None + logger.debug("Built base frontend node") + template_config = custom_component.build_template_config - update_attributes(frontend_node, template_config) - logger.debug("Updated attributes") - field_config = build_field_config(custom_component) - logger.debug("Built field config") - add_extra_fields( - frontend_node, field_config, custom_component.get_function_entrypoint_args - ) - logger.debug("Added extra fields") - frontend_node = add_code_field( - frontend_node, custom_component.code, field_config.get("code", {}) - ) - logger.debug("Added code field") - add_base_classes( - frontend_node, custom_component.get_function_entrypoint_return_type - ) - logger.debug("Added base classes") - return frontend_node + update_attributes(frontend_node, template_config) + logger.debug("Updated attributes") + field_config = build_field_config(custom_component) + logger.debug("Built field config") + entrypoint_args = custom_component.get_function_entrypoint_args + + add_extra_fields(frontend_node, field_config, entrypoint_args) + logger.debug("Added extra fields") + frontend_node = add_code_field( + frontend_node, custom_component.code, field_config.get("code", {}) + ) + logger.debug("Added code field") + add_base_classes( + frontend_node, custom_component.get_function_entrypoint_return_type + ) + logger.debug("Added base classes") + return frontend_node + except Exception as exc: + if isinstance(exc, HTTPException): + raise exc + raise HTTPException( + status_code=400, + detail={ + "error": ( + "Invalid type convertion. Please check your code and try again." + ), + "traceback": traceback.format_exc(), + }, + ) from exc def load_files_from_path(path: str): @@ -416,6 +435,24 @@ def build_invalid_menu(invalid_components): return invalid_menu +def merge_nested_dicts_with_renaming(dict1, dict2): + for key, value in dict2.items(): + if ( + key in dict1 + and isinstance(value, dict) + and isinstance(dict1.get(key), dict) + ): + for sub_key, sub_value in value.items(): + if sub_key in dict1[key]: + new_key = get_new_key(dict1[key], sub_key) + dict1[key][new_key] = sub_value + else: + dict1[key][sub_key] = sub_value + else: + dict1[key] = value + return dict1 + + def build_langchain_custom_component_list_from_path(path: str): """Build a list of custom components for the langchain from a given path""" file_list = load_files_from_path(path) @@ -429,3 +466,51 @@ def build_langchain_custom_component_list_from_path(path: str): invalid_menu = build_invalid_menu(invalid_components) return merge_nested_dicts_with_renaming(valid_menu, invalid_menu) + + +def get_all_types_dict(settings_service): + native_components = build_langchain_types_dict() + # custom_components is a list of dicts + # need to merge all the keys into one dict + custom_components_from_file: dict[str, Any] = {} + if settings_service.settings.COMPONENTS_PATH: + logger.info( + f"Building custom components from {settings_service.settings.COMPONENTS_PATH}" + ) + + custom_component_dicts = [] + processed_paths = [] + for path in settings_service.settings.COMPONENTS_PATH: + if str(path) in processed_paths: + continue + custom_component_dict = build_langchain_custom_component_list_from_path( + str(path) + ) + custom_component_dicts.append(custom_component_dict) + processed_paths.append(str(path)) + + logger.info(f"Loading {len(custom_component_dicts)} category(ies)") + for custom_component_dict in custom_component_dicts: + # custom_component_dict is a dict of dicts + if not custom_component_dict: + continue + category = list(custom_component_dict.keys())[0] + logger.info( + f"Loading {len(custom_component_dict[category])} component(s) from category {category}" + ) + custom_components_from_file = merge_nested_dicts_with_renaming( + custom_components_from_file, custom_component_dict + ) + + return merge_nested_dicts_with_renaming( + native_components, custom_components_from_file + ) + + +def merge_nested_dicts(dict1, dict2): + for key, value in dict2.items(): + if isinstance(value, dict) and isinstance(dict1.get(key), dict): + dict1[key] = merge_nested_dicts(dict1[key], value) + else: + dict1[key] = value + return dict1 diff --git a/src/backend/langflow/interface/utilities/base.py b/src/backend/langflow/interface/utilities/base.py index 9009983b0..bfc7cb11e 100644 --- a/src/backend/langflow/interface/utilities/base.py +++ b/src/backend/langflow/interface/utilities/base.py @@ -1,11 +1,11 @@ from typing import Dict, List, Optional, Type -from langchain import SQLDatabase, utilities +from langchain import utilities from langflow.custom.customs import get_custom_nodes from langflow.interface.base import LangChainTypeCreator from langflow.interface.importing.utils import import_class -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.utilities import UtilitiesFrontendNode from loguru import logger @@ -27,18 +27,18 @@ class UtilityCreator(LangChainTypeCreator): from the langchain.chains module and filtering them according to the settings.utilities list. """ if self.type_dict is None: - settings_manager = get_settings_manager() + settings_service = get_settings_service() self.type_dict = { utility_name: import_class(f"langchain.utilities.{utility_name}") for utility_name in utilities.__all__ } - self.type_dict["SQLDatabase"] = SQLDatabase + self.type_dict["SQLDatabase"] = utilities.SQLDatabase # Filter according to settings.utilities self.type_dict = { name: utility for name, utility in self.type_dict.items() - if name in settings_manager.settings.UTILITIES - or settings_manager.settings.DEV + if name in settings_service.settings.UTILITIES + or settings_service.settings.DEV } return self.type_dict diff --git a/src/backend/langflow/interface/utils.py b/src/backend/langflow/interface/utils.py index 75e854e16..b28a660bf 100644 --- a/src/backend/langflow/interface/utils.py +++ b/src/backend/langflow/interface/utils.py @@ -10,7 +10,7 @@ from langchain.base_language import BaseLanguageModel from PIL.Image import Image from loguru import logger from langflow.services.chat.config import ChatConfig -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service def load_file_into_dict(file_path: str) -> dict: @@ -36,7 +36,7 @@ def pil_to_base64(image: Image) -> str: return img_str.decode("utf-8") -def try_setting_streaming_options(langchain_object, websocket): +def try_setting_streaming_options(langchain_object): # If the LLM type is OpenAI or ChatOpenAI, # set streaming to True # First we need to find the LLM @@ -64,11 +64,11 @@ def extract_input_variables_from_prompt(prompt: str) -> list[str]: def setup_llm_caching(): """Setup LLM caching.""" - settings_manager = get_settings_manager() + settings_service = get_settings_service() try: - set_langchain_cache(settings_manager.settings) + set_langchain_cache(settings_service.settings) except ImportError: - logger.warning(f"Could not import {settings_manager.settings.CACHE}. ") + logger.warning(f"Could not import {settings_service.settings.CACHE_TYPE}. ") except Exception as exc: logger.warning(f"Could not setup LLM caching. Error: {exc}") @@ -77,9 +77,16 @@ def set_langchain_cache(settings): import langchain from langflow.interface.importing.utils import import_class - cache_type = os.getenv("LANGFLOW_LANGCHAIN_CACHE") - cache_class = import_class(f"langchain.cache.{cache_type or settings.CACHE}") + if cache_type := os.getenv("LANGFLOW_LANGCHAIN_CACHE"): + try: + cache_class = import_class( + f"langchain.cache.{cache_type or settings.LANGCHAIN_CACHE}" + ) - logger.debug(f"Setting up LLM caching with {cache_class.__name__}") - langchain.llm_cache = cache_class() - logger.info(f"LLM caching setup with {cache_class.__name__}") + logger.debug(f"Setting up LLM caching with {cache_class.__name__}") + langchain.llm_cache = cache_class() + logger.info(f"LLM caching setup with {cache_class.__name__}") + except ImportError: + logger.warning(f"Could not import {cache_type}. ") + else: + logger.info("No LLM cache set.") diff --git a/src/backend/langflow/interface/vector_store/base.py b/src/backend/langflow/interface/vector_store/base.py index f7aca8c9c..786031a6b 100644 --- a/src/backend/langflow/interface/vector_store/base.py +++ b/src/backend/langflow/interface/vector_store/base.py @@ -4,7 +4,7 @@ from langchain import vectorstores from langflow.interface.base import LangChainTypeCreator from langflow.interface.importing.utils import import_class -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from langflow.template.frontend_node.vectorstores import VectorStoreFrontendNode from loguru import logger @@ -44,12 +44,12 @@ class VectorstoreCreator(LangChainTypeCreator): return None def to_list(self) -> List[str]: - settings_manager = get_settings_manager() + settings_service = get_settings_service() return [ vectorstore for vectorstore in self.type_to_loader_dict.keys() - if vectorstore in settings_manager.settings.VECTORSTORES - or settings_manager.settings.DEV + if vectorstore in settings_service.settings.VECTORSTORES + or settings_service.settings.DEV ] diff --git a/src/backend/langflow/interface/wrappers/base.py b/src/backend/langflow/interface/wrappers/base.py index c4399fb3e..de631101a 100644 --- a/src/backend/langflow/interface/wrappers/base.py +++ b/src/backend/langflow/interface/wrappers/base.py @@ -1,6 +1,6 @@ from typing import Dict, List, Optional -from langchain import requests, sql_database +from langchain.utilities import requests, sql_database from langflow.interface.base import LangChainTypeCreator from loguru import logger diff --git a/src/backend/langflow/jcloud.yml b/src/backend/langflow/jcloud.yml deleted file mode 100644 index ffc1c9b8a..000000000 --- a/src/backend/langflow/jcloud.yml +++ /dev/null @@ -1,2 +0,0 @@ -instance: C4 -autoscale_min: 1 \ No newline at end of file diff --git a/src/backend/langflow/lcserve.py b/src/backend/langflow/lcserve.py deleted file mode 100644 index 87f69e014..000000000 --- a/src/backend/langflow/lcserve.py +++ /dev/null @@ -1,15 +0,0 @@ -# This file is used by lc-serve to load the mounted app and serve it. - -import os - -# Use the JCLOUD_WORKSPACE for db URL if it's provided by JCloud. -if "JCLOUD_WORKSPACE" in os.environ: - os.environ[ - "LANGFLOW_DATABASE_URL" - ] = f"sqlite:///{os.environ['JCLOUD_WORKSPACE']}/langflow.db" - -from langflow.main import setup_app -from langflow.utils.logger import configure - -configure(log_level="DEBUG") -app = setup_app() diff --git a/src/backend/langflow/main.py b/src/backend/langflow/main.py index f567e65bb..9caa157d0 100644 --- a/src/backend/langflow/main.py +++ b/src/backend/langflow/main.py @@ -9,8 +9,11 @@ from langflow.api import router from langflow.interface.utils import setup_llm_caching -from langflow.services.database.utils import initialize_database -from langflow.services.manager import initialize_services, teardown_services +from langflow.services.utils import initialize_services +from langflow.services.plugins.langfuse import LangfuseInstance +from langflow.services.utils import ( + teardown_services, +) from langflow.utils.logger import configure @@ -38,9 +41,12 @@ def create_app(): app.include_router(router) app.on_event("startup")(initialize_services) - app.on_event("startup")(initialize_database) app.on_event("startup")(setup_llm_caching) + app.on_event("startup")(LangfuseInstance.update) + app.on_event("shutdown")(teardown_services) + app.on_event("shutdown")(LangfuseInstance.teardown) + return app diff --git a/src/backend/langflow/processing/base.py b/src/backend/langflow/processing/base.py index c3d766f15..e5816306c 100644 --- a/src/backend/langflow/processing/base.py +++ b/src/backend/langflow/processing/base.py @@ -1,4 +1,4 @@ -from typing import Union +from typing import List, Union, TYPE_CHECKING from langflow.api.v1.callback import ( AsyncStreamingLLMCallbackHandler, StreamingLLMCallbackHandler, @@ -6,6 +6,52 @@ from langflow.api.v1.callback import ( from langflow.processing.process import fix_memory_inputs, format_actions from loguru import logger from langchain.agents.agent import AgentExecutor +from langchain.callbacks.base import BaseCallbackHandler + +if TYPE_CHECKING: + from langfuse.callback import CallbackHandler # type: ignore + + +def setup_callbacks(sync, trace_id, **kwargs): + """Setup callbacks for langchain object""" + callbacks = [] + if sync: + callbacks.append(StreamingLLMCallbackHandler(**kwargs)) + else: + callbacks.append(AsyncStreamingLLMCallbackHandler(**kwargs)) + + if langfuse_callback := get_langfuse_callback(trace_id=trace_id): + logger.debug("Langfuse callback loaded") + callbacks.append(langfuse_callback) + return callbacks + + +def get_langfuse_callback(trace_id): + from langflow.services.plugins.langfuse import LangfuseInstance + from langfuse.callback import CreateTrace + + logger.debug("Initializing langfuse callback") + if langfuse := LangfuseInstance.get(): + logger.debug("Langfuse credentials found") + try: + trace = langfuse.trace(CreateTrace(id=trace_id)) + return trace.getNewHandler() + except Exception as exc: + logger.error(f"Error initializing langfuse callback: {exc}") + + return None + + +def flush_langfuse_callback_if_present( + callbacks: List[Union[BaseCallbackHandler, "CallbackHandler"]] +): + """ + If langfuse callback is present, run callback.langfuse.flush() + """ + for callback in callbacks: + if hasattr(callback, "langfuse"): + callback.langfuse.flush() + break async def get_result_and_steps(langchain_object, inputs: Union[dict, str], **kwargs): @@ -27,13 +73,18 @@ async def get_result_and_steps(langchain_object, inputs: Union[dict, str], **kwa logger.error(f"Error fixing memory inputs: {exc}") try: - async_callbacks = [AsyncStreamingLLMCallbackHandler(**kwargs)] - output = await langchain_object.acall(inputs, callbacks=async_callbacks) + trace_id = kwargs.pop("session_id", None) + callbacks = setup_callbacks(sync=False, trace_id=trace_id, **kwargs) + output = await langchain_object.acall(inputs, callbacks=callbacks) except Exception as exc: # make the error message more informative logger.debug(f"Error: {str(exc)}") - sync_callbacks = [StreamingLLMCallbackHandler(**kwargs)] - output = langchain_object(inputs, callbacks=sync_callbacks) + trace_id = kwargs.pop("session_id", None) + callbacks = setup_callbacks(sync=True, trace_id=trace_id, **kwargs) + output = langchain_object(inputs, callbacks=callbacks) + + # if langfuse callback is present, run callback.langfuse.flush() + flush_langfuse_callback_if_present(callbacks) intermediate_steps = ( output.get("intermediate_steps", []) if isinstance(output, dict) else [] diff --git a/src/backend/langflow/processing/process.py b/src/backend/langflow/processing/process.py index c60a53de5..4c96e2fde 100644 --- a/src/backend/langflow/processing/process.py +++ b/src/backend/langflow/processing/process.py @@ -2,15 +2,19 @@ import json from pathlib import Path from langchain.schema import AgentAction from langflow.interface.run import ( - build_sorted_vertices_with_caching, + build_sorted_vertices, get_memory_key, update_memory_keys, ) +from langflow.services.getters import get_session_service from loguru import logger from langflow.graph import Graph from langchain.chains.base import Chain from langchain.vectorstores.base import VectorStore from typing import Any, Dict, List, Optional, Tuple, Union +from langchain.schema import Document + +from pydantic import BaseModel def fix_memory_inputs(langchain_object): @@ -64,7 +68,7 @@ def get_result_and_thought(langchain_object: Any, inputs: dict): langchain_object.verbose = True if hasattr(langchain_object, "return_intermediate_steps"): - langchain_object.return_intermediate_steps = True + langchain_object.return_intermediate_steps = False fix_memory_inputs(langchain_object) @@ -92,26 +96,19 @@ def get_build_result(data_graph, session_id): # otherwise, build the graph and return the result if session_id: logger.debug(f"Loading LangChain object from session {session_id}") - result = build_sorted_vertices_with_caching.get_result_by_session_id(session_id) + result = build_sorted_vertices(data_graph=data_graph) if result is not None: logger.debug("Loaded LangChain object") return result logger.debug("Building langchain object") - return build_sorted_vertices_with_caching(data_graph) - - -def clear_caches_if_needed(clear_cache: bool): - if clear_cache: - build_sorted_vertices_with_caching.clear_cache() - logger.debug("Cleared cache") + return build_sorted_vertices(data_graph) def load_langchain_object( data_graph: Dict[str, Any], session_id: str ) -> Tuple[Union[Chain, VectorStore], Dict[str, Any], str]: langchain_object, artifacts = get_build_result(data_graph, session_id) - session_id = build_sorted_vertices_with_caching.hash logger.debug("Loaded LangChain object") if langchain_object is None: @@ -139,33 +136,47 @@ def generate_result(langchain_object: Union[Chain, VectorStore], inputs: dict): raise ValueError("Inputs must be provided for a Chain") logger.debug("Generating result and thought") result = get_result_and_thought(langchain_object, inputs) + logger.debug("Generated result and thought") elif isinstance(langchain_object, VectorStore): result = langchain_object.search(**inputs) + elif isinstance(langchain_object, Document): + result = langchain_object.dict() else: - raise ValueError( - f"Unknown langchain_object type: {type(langchain_object).__name__}" - ) + logger.warning(f"Unknown langchain_object type: {type(langchain_object)}") + result = langchain_object return result -def process_graph_cached( +class Result(BaseModel): + result: Any + session_id: str + + +async def process_graph_cached( data_graph: Dict[str, Any], inputs: Optional[dict] = None, clear_cache=False, session_id=None, -) -> Tuple[Any, str]: - clear_caches_if_needed(clear_cache) - # If session_id is provided, load the langchain_object from the session - # else build the graph and return the result and the new session_id - langchain_object, artifacts, session_id = load_langchain_object( - data_graph, session_id - ) +) -> Result: + session_service = get_session_service() + if clear_cache: + session_service.clear_session(session_id) + if session_id is None: + session_id = session_service.generate_key( + session_id=session_id, data_graph=data_graph + ) + # Load the graph using SessionService + graph, artifacts = session_service.load_session(session_id, data_graph) + built_object = graph.build() processed_inputs = process_inputs(inputs, artifacts) - result = generate_result(langchain_object, processed_inputs) + result = generate_result(built_object, processed_inputs) + # langchain_object is now updated with the new memory + # we need to update the cache with the updated langchain_object + session_service.update_session(session_id, (graph, artifacts)) - return result, session_id + return Result(result=result, session_id=session_id) def load_flow_from_json( diff --git a/src/backend/langflow/server.py b/src/backend/langflow/server.py index a96f8b7e0..3a2943444 100644 --- a/src/backend/langflow/server.py +++ b/src/backend/langflow/server.py @@ -4,6 +4,8 @@ from gunicorn.app.base import BaseApplication # type: ignore class LangflowApplication(BaseApplication): def __init__(self, app, options=None): self.options = options or {} + + self.options["worker_class"] = "uvicorn.workers.UvicornWorker" self.application = app super().__init__() diff --git a/src/backend/langflow/services/auth/factory.py b/src/backend/langflow/services/auth/factory.py index 4914ce645..b44019289 100644 --- a/src/backend/langflow/services/auth/factory.py +++ b/src/backend/langflow/services/auth/factory.py @@ -1,12 +1,12 @@ from langflow.services.factory import ServiceFactory -from langflow.services.auth.service import AuthManager +from langflow.services.auth.service import AuthService -class AuthManagerFactory(ServiceFactory): - name = "auth_manager" +class AuthServiceFactory(ServiceFactory): + name = "auth_service" def __init__(self): - super().__init__(AuthManager) + super().__init__(AuthService) - def create(self, settings_manager): - return AuthManager(settings_manager) + def create(self, settings_service): + return AuthService(settings_service) diff --git a/src/backend/langflow/services/auth/service.py b/src/backend/langflow/services/auth/service.py index 29984a75c..5b0acf8c6 100644 --- a/src/backend/langflow/services/auth/service.py +++ b/src/backend/langflow/services/auth/service.py @@ -2,11 +2,11 @@ from langflow.services.base import Service from typing import TYPE_CHECKING if TYPE_CHECKING: - from langflow.services.settings.manager import SettingsManager + from langflow.services.settings.manager import SettingsService -class AuthManager(Service): - name = "auth_manager" +class AuthService(Service): + name = "auth_service" - def __init__(self, settings_manager: "SettingsManager"): - self.settings_manager = settings_manager + def __init__(self, settings_service: "SettingsService"): + self.settings_service = settings_service diff --git a/src/backend/langflow/services/auth/utils.py b/src/backend/langflow/services/auth/utils.py index 485968a38..f88a1cd12 100644 --- a/src/backend/langflow/services/auth/utils.py +++ b/src/backend/langflow/services/auth/utils.py @@ -12,12 +12,12 @@ from langflow.services.database.models.user.crud import ( get_user_by_username, update_user_last_login_at, ) -from langflow.services.utils import get_session, get_settings_manager +from langflow.services.getters import get_session, get_settings_service from sqlmodel import Session oauth2_login = OAuth2PasswordBearer(tokenUrl="api/v1/login") -API_KEY_NAME = "api-key" +API_KEY_NAME = "x-api-key" api_key_query = APIKeyQuery( name=API_KEY_NAME, scheme_name="API key query", auto_error=False @@ -33,19 +33,17 @@ async def api_key_security( header_param: str = Security(api_key_header), db: Session = Depends(get_session), ) -> Optional[User]: - settings_manager = get_settings_manager() + settings_service = get_settings_service() result: Optional[Union[ApiKey, User]] = None - if settings_manager.auth_settings.AUTO_LOGIN: + if settings_service.auth_settings.AUTO_LOGIN: # Get the first user - if not settings_manager.auth_settings.FIRST_SUPERUSER: + if not settings_service.auth_settings.SUPERUSER: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, detail="Missing first superuser credentials", ) - result = get_user_by_username( - db, settings_manager.auth_settings.FIRST_SUPERUSER - ) + result = get_user_by_username(db, settings_service.auth_settings.SUPERUSER) elif not query_param and not header_param: raise HTTPException( @@ -74,7 +72,7 @@ async def get_current_user( token: Annotated[str, Depends(oauth2_login)], db: Session = Depends(get_session), ) -> User: - settings_manager = get_settings_manager() + settings_service = get_settings_service() credentials_exception = HTTPException( status_code=status.HTTP_401_UNAUTHORIZED, @@ -85,14 +83,14 @@ async def get_current_user( if isinstance(token, Coroutine): token = await token - if settings_manager.auth_settings.SECRET_KEY is None: + if settings_service.auth_settings.SECRET_KEY is None: raise credentials_exception try: payload = jwt.decode( token, - settings_manager.auth_settings.SECRET_KEY, - algorithms=[settings_manager.auth_settings.ALGORITHM], + settings_service.auth_settings.SECRET_KEY, + algorithms=[settings_service.auth_settings.ALGORITHM], ) user_id: UUID = payload.get("sub") # type: ignore token_type: str = payload.get("type") # type: ignore @@ -132,19 +130,19 @@ def get_current_active_superuser( def verify_password(plain_password, hashed_password): - settings_manager = get_settings_manager() - return settings_manager.auth_settings.pwd_context.verify( + settings_service = get_settings_service() + return settings_service.auth_settings.pwd_context.verify( plain_password, hashed_password ) def get_password_hash(password): - settings_manager = get_settings_manager() - return settings_manager.auth_settings.pwd_context.hash(password) + settings_service = get_settings_service() + return settings_service.auth_settings.pwd_context.hash(password) def create_token(data: dict, expires_delta: timedelta): - settings_manager = get_settings_manager() + settings_service = get_settings_service() to_encode = data.copy() expire = datetime.now(timezone.utc) + expires_delta @@ -152,8 +150,8 @@ def create_token(data: dict, expires_delta: timedelta): return jwt.encode( to_encode, - settings_manager.auth_settings.SECRET_KEY, - algorithm=settings_manager.auth_settings.ALGORITHM, + settings_service.auth_settings.SECRET_KEY, + algorithm=settings_service.auth_settings.ALGORITHM, ) @@ -181,9 +179,9 @@ def create_super_user( def create_user_longterm_token(db: Session = Depends(get_session)) -> dict: - settings_manager = get_settings_manager() - username = settings_manager.auth_settings.FIRST_SUPERUSER - password = settings_manager.auth_settings.FIRST_SUPERUSER_PASSWORD + settings_service = get_settings_service() + username = settings_service.auth_settings.SUPERUSER + password = settings_service.auth_settings.SUPERUSER_PASSWORD if not username or not password: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, @@ -227,10 +225,10 @@ def get_user_id_from_token(token: str) -> UUID: def create_user_tokens( user_id: UUID, db: Session = Depends(get_session), update_last_login: bool = False ) -> dict: - settings_manager = get_settings_manager() + settings_service = get_settings_service() access_token_expires = timedelta( - minutes=settings_manager.auth_settings.ACCESS_TOKEN_EXPIRE_MINUTES + minutes=settings_service.auth_settings.ACCESS_TOKEN_EXPIRE_MINUTES ) access_token = create_token( data={"sub": str(user_id)}, @@ -238,7 +236,7 @@ def create_user_tokens( ) refresh_token_expires = timedelta( - minutes=settings_manager.auth_settings.REFRESH_TOKEN_EXPIRE_MINUTES + minutes=settings_service.auth_settings.REFRESH_TOKEN_EXPIRE_MINUTES ) refresh_token = create_token( data={"sub": str(user_id), "type": "rf"}, @@ -257,13 +255,13 @@ def create_user_tokens( def create_refresh_token(refresh_token: str, db: Session = Depends(get_session)): - settings_manager = get_settings_manager() + settings_service = get_settings_service() try: payload = jwt.decode( refresh_token, - settings_manager.auth_settings.SECRET_KEY, - algorithms=[settings_manager.auth_settings.ALGORITHM], + settings_service.auth_settings.SECRET_KEY, + algorithms=[settings_service.auth_settings.ALGORITHM], ) user_id: UUID = payload.get("sub") # type: ignore token_type: str = payload.get("type") # type: ignore diff --git a/src/backend/langflow/services/base.py b/src/backend/langflow/services/base.py index aaa966047..301771944 100644 --- a/src/backend/langflow/services/base.py +++ b/src/backend/langflow/services/base.py @@ -3,6 +3,10 @@ from abc import ABC class Service(ABC): name: str + ready: bool = False def teardown(self): pass + + def set_ready(self): + self.ready = True diff --git a/src/backend/langflow/services/cache/__init__.py b/src/backend/langflow/services/cache/__init__.py index 79e143807..3b122aa9e 100644 --- a/src/backend/langflow/services/cache/__init__.py +++ b/src/backend/langflow/services/cache/__init__.py @@ -1,10 +1,8 @@ from . import factory, manager -from langflow.services.cache.manager import cache_manager -from langflow.services.cache.flow import InMemoryCache +from langflow.services.cache.manager import InMemoryCache __all__ = [ - "cache_manager", "factory", "manager", "InMemoryCache", diff --git a/src/backend/langflow/services/cache/base.py b/src/backend/langflow/services/cache/base.py index 88cb3a1da..4eee6639e 100644 --- a/src/backend/langflow/services/cache/base.py +++ b/src/backend/langflow/services/cache/base.py @@ -1,11 +1,13 @@ import abc -class BaseCache(abc.ABC): +class BaseCacheService(abc.ABC): """ Abstract base class for a cache. """ + name = "cache_service" + @abc.abstractmethod def get(self, key): """ @@ -28,6 +30,16 @@ class BaseCache(abc.ABC): value: The value to cache. """ + @abc.abstractmethod + def upsert(self, key, value): + """ + Add an item to the cache if it doesn't exist, or update it if it does. + + Args: + key: The key of the item. + value: The value to cache. + """ + @abc.abstractmethod def delete(self, key): """ diff --git a/src/backend/langflow/services/cache/factory.py b/src/backend/langflow/services/cache/factory.py index f180f67c0..f00ab239f 100644 --- a/src/backend/langflow/services/cache/factory.py +++ b/src/backend/langflow/services/cache/factory.py @@ -1,11 +1,35 @@ -from langflow.services.cache.manager import CacheManager +from langflow.services.cache.manager import InMemoryCache, RedisCache, BaseCacheService from langflow.services.factory import ServiceFactory +from langflow.utils.logger import logger +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from langflow.services.settings.manager import SettingsService -class CacheManagerFactory(ServiceFactory): +class CacheServiceFactory(ServiceFactory): def __init__(self): - super().__init__(CacheManager) + super().__init__(BaseCacheService) - def create(self): - # Here you would have logic to create and configure a CacheManager - return CacheManager() + def create(self, settings_service: "SettingsService"): + # Here you would have logic to create and configure a CacheService + # based on the settings_service + + if settings_service.settings.CACHE_TYPE == "redis": + logger.debug("Creating Redis cache") + redis_cache = RedisCache( + host=settings_service.settings.REDIS_HOST, + port=settings_service.settings.REDIS_PORT, + db=settings_service.settings.REDIS_DB, + expiration_time=settings_service.settings.REDIS_CACHE_EXPIRE, + ) + if redis_cache.is_connected(): + logger.debug("Redis cache is connected") + return redis_cache + logger.warning( + "Redis cache is not connected, falling back to in-memory cache" + ) + return InMemoryCache() + + elif settings_service.settings.CACHE_TYPE == "memory": + return InMemoryCache() diff --git a/src/backend/langflow/services/cache/flow.py b/src/backend/langflow/services/cache/flow.py deleted file mode 100644 index 0c10c51e1..000000000 --- a/src/backend/langflow/services/cache/flow.py +++ /dev/null @@ -1,146 +0,0 @@ -import threading -import time -from collections import OrderedDict - -from langflow.services.cache.base import BaseCache - - -class InMemoryCache(BaseCache): - """ - A simple in-memory cache using an OrderedDict. - - This cache supports setting a maximum size and expiration time for cached items. - When the cache is full, it uses a Least Recently Used (LRU) eviction policy. - Thread-safe using a threading Lock. - - Attributes: - max_size (int, optional): Maximum number of items to store in the cache. - expiration_time (int, optional): Time in seconds after which a cached item expires. Default is 1 hour. - - Example: - - cache = InMemoryCache(max_size=3, expiration_time=5) - - # setting cache values - cache.set("a", 1) - cache.set("b", 2) - cache["c"] = 3 - - # getting cache values - a = cache.get("a") - b = cache["b"] - """ - - def __init__(self, max_size=None, expiration_time=60 * 60): - """ - Initialize a new InMemoryCache instance. - - Args: - max_size (int, optional): Maximum number of items to store in the cache. - expiration_time (int, optional): Time in seconds after which a cached item expires. Default is 1 hour. - """ - self._cache = OrderedDict() - self._lock = threading.Lock() - self.max_size = max_size - self.expiration_time = expiration_time - - def get(self, key): - """ - Retrieve an item from the cache. - - Args: - key: The key of the item to retrieve. - - Returns: - The value associated with the key, or None if the key is not found or the item has expired. - """ - with self._lock: - if key in self._cache: - item = self._cache.pop(key) - if ( - self.expiration_time is None - or time.time() - item["time"] < self.expiration_time - ): - # Move the key to the end to make it recently used - self._cache[key] = item - return item["value"] - else: - self.delete(key) - return None - - def set(self, key, value): - """ - Add an item to the cache. - - If the cache is full, the least recently used item is evicted. - - Args: - key: The key of the item. - value: The value to cache. - """ - with self._lock: - if key in self._cache: - # Remove existing key before re-inserting to update order - self.delete(key) - elif self.max_size and len(self._cache) >= self.max_size: - # Remove least recently used item - self._cache.popitem(last=False) - self._cache[key] = {"value": value, "time": time.time()} - - def get_or_set(self, key, value): - """ - Retrieve an item from the cache. If the item does not exist, set it with the provided value. - - Args: - key: The key of the item. - value: The value to cache if the item doesn't exist. - - Returns: - The cached value associated with the key. - """ - with self._lock: - if key in self._cache: - return self.get(key) - self.set(key, value) - return value - - def delete(self, key): - """ - Remove an item from the cache. - - Args: - key: The key of the item to remove. - """ - # with self._lock: - self._cache.pop(key, None) - - def clear(self): - """ - Clear all items from the cache. - """ - with self._lock: - self._cache.clear() - - def __contains__(self, key): - """Check if the key is in the cache.""" - return key in self._cache - - def __getitem__(self, key): - """Retrieve an item from the cache using the square bracket notation.""" - return self.get(key) - - def __setitem__(self, key, value): - """Add an item to the cache using the square bracket notation.""" - self.set(key, value) - - def __delitem__(self, key): - """Remove an item from the cache using the square bracket notation.""" - self.delete(key) - - def __len__(self): - """Return the number of items in the cache.""" - return len(self._cache) - - def __repr__(self): - """Return a string representation of the InMemoryCache instance.""" - return f"InMemoryCache(max_size={self.max_size}, expiration_time={self.expiration_time})" diff --git a/src/backend/langflow/services/cache/manager.py b/src/backend/langflow/services/cache/manager.py index ce9a338ef..da76a2b5c 100644 --- a/src/backend/langflow/services/cache/manager.py +++ b/src/backend/langflow/services/cache/manager.py @@ -1,153 +1,336 @@ -from contextlib import contextmanager -from typing import Any, Awaitable, Callable, List, Optional +import threading +import time +from collections import OrderedDict from langflow.services.base import Service -import pandas as pd -from PIL import Image +from langflow.services.cache.base import BaseCacheService + +import pickle + +from loguru import logger -class Subject: - """Base class for implementing the observer pattern.""" +class InMemoryCache(BaseCacheService, Service): - def __init__(self): - self.observers: List[Callable[[], None]] = [] + """ + A simple in-memory cache using an OrderedDict. - def attach(self, observer: Callable[[], None]): - """Attach an observer to the subject.""" - self.observers.append(observer) + This cache supports setting a maximum size and expiration time for cached items. + When the cache is full, it uses a Least Recently Used (LRU) eviction policy. + Thread-safe using a threading Lock. - def detach(self, observer: Callable[[], None]): - """Detach an observer from the subject.""" - self.observers.remove(observer) + Attributes: + max_size (int, optional): Maximum number of items to store in the cache. + expiration_time (int, optional): Time in seconds after which a cached item expires. Default is 1 hour. - def notify(self): - """Notify all observers about an event.""" - for observer in self.observers: - if observer is None: - continue - observer() + Example: + cache = InMemoryCache(max_size=3, expiration_time=5) -class AsyncSubject: - """Base class for implementing the async observer pattern.""" + # setting cache values + cache.set("a", 1) + cache.set("b", 2) + cache["c"] = 3 - def __init__(self): - self.observers: List[Callable[[], Awaitable]] = [] + # getting cache values + a = cache.get("a") + b = cache["b"] + """ - def attach(self, observer: Callable[[], Awaitable]): - """Attach an observer to the subject.""" - self.observers.append(observer) - - def detach(self, observer: Callable[[], Awaitable]): - """Detach an observer from the subject.""" - self.observers.remove(observer) - - async def notify(self): - """Notify all observers about an event.""" - for observer in self.observers: - if observer is None: - continue - await observer() - - -class CacheManager(Subject, Service): - """Manages cache for different clients and notifies observers on changes.""" - - name = "cache_manager" - - def __init__(self): - super().__init__() - self._cache = {} - self.current_client_id = None - self.current_cache = {} - - @contextmanager - def set_client_id(self, client_id: str): + def __init__(self, max_size=None, expiration_time=60 * 60): """ - Context manager to set the current client_id and associated cache. + Initialize a new InMemoryCache instance. Args: - client_id (str): The client identifier. + max_size (int, optional): Maximum number of items to store in the cache. + expiration_time (int, optional): Time in seconds after which a cached item expires. Default is 1 hour. + """ + self._cache = OrderedDict() + self._lock = threading.RLock() + self.max_size = max_size + self.expiration_time = expiration_time + + def get(self, key): + """ + Retrieve an item from the cache. + + Args: + key: The key of the item to retrieve. + + Returns: + The value associated with the key, or None if the key is not found or the item has expired. + """ + with self._lock: + return self._get_without_lock(key) + + def _get_without_lock(self, key): + """ + Retrieve an item from the cache without acquiring the lock. + """ + if item := self._cache.get(key): + if ( + self.expiration_time is None + or time.time() - item["time"] < self.expiration_time + ): + # Move the key to the end to make it recently used + self._cache.move_to_end(key) + # Check if the value is pickled + if isinstance(item["value"], bytes): + value = pickle.loads(item["value"]) + else: + value = item["value"] + return value + else: + self.delete(key) + return None + + def set(self, key, value, pickle=False): + """ + Add an item to the cache. + + If the cache is full, the least recently used item is evicted. + + Args: + key: The key of the item. + value: The value to cache. + """ + with self._lock: + if key in self._cache: + # Remove existing key before re-inserting to update order + self.delete(key) + elif self.max_size and len(self._cache) >= self.max_size: + # Remove least recently used item + self._cache.popitem(last=False) + # pickle locally to mimic Redis + if pickle: + value = pickle.dumps(value) + + self._cache[key] = {"value": value, "time": time.time()} + + def upsert(self, key, value): + """ + Inserts or updates a value in the cache. + If the existing value and the new value are both dictionaries, they are merged. + + Args: + key: The key of the item. + value: The value to insert or update. + """ + with self._lock: + existing_value = self._get_without_lock(key) + if ( + existing_value is not None + and isinstance(existing_value, dict) + and isinstance(value, dict) + ): + existing_value.update(value) + value = existing_value + + self.set(key, value) + + def get_or_set(self, key, value): + """ + Retrieve an item from the cache. If the item does not exist, + set it with the provided value. + + Args: + key: The key of the item. + value: The value to cache if the item doesn't exist. + + Returns: + The cached value associated with the key. + """ + with self._lock: + if key in self._cache: + return self.get(key) + self.set(key, value) + return value + + def delete(self, key): + """ + Remove an item from the cache. + + Args: + key: The key of the item to remove. + """ + with self._lock: + self._cache.pop(key, None) + + def clear(self): + """ + Clear all items from the cache. + """ + with self._lock: + self._cache.clear() + + def __contains__(self, key): + """Check if the key is in the cache.""" + return key in self._cache + + def __getitem__(self, key): + """Retrieve an item from the cache using the square bracket notation.""" + return self.get(key) + + def __setitem__(self, key, value): + """Add an item to the cache using the square bracket notation.""" + self.set(key, value) + + def __delitem__(self, key): + """Remove an item from the cache using the square bracket notation.""" + self.delete(key) + + def __len__(self): + """Return the number of items in the cache.""" + return len(self._cache) + + def __repr__(self): + """Return a string representation of the InMemoryCache instance.""" + return f"InMemoryCache(max_size={self.max_size}, expiration_time={self.expiration_time})" + + +class RedisCache(BaseCacheService, Service): + """ + A Redis-based cache implementation. + + This cache supports setting an expiration time for cached items. + + Attributes: + expiration_time (int, optional): Time in seconds after which a cached item expires. Default is 1 hour. + + Example: + + cache = RedisCache(expiration_time=5) + + # setting cache values + cache.set("a", 1) + cache.set("b", 2) + cache["c"] = 3 + + # getting cache values + a = cache.get("a") + b = cache["b"] + """ + + def __init__(self, host="localhost", port=6379, db=0, expiration_time=60 * 60): + """ + Initialize a new RedisCache instance. + + Args: + host (str, optional): Redis host. + port (int, optional): Redis port. + db (int, optional): Redis DB. + expiration_time (int, optional): Time in seconds after which a + ached item expires. Default is 1 hour. """ - previous_client_id = self.current_client_id - self.current_client_id = client_id - self.current_cache = self._cache.setdefault(client_id, {}) try: - yield - finally: - self.current_client_id = previous_client_id - self.current_cache = self._cache.get(self.current_client_id, {}) + import redis + except ImportError as exc: + raise ImportError( + "RedisCache requires the redis-py package." + " Please install Langflow with the deploy extra: pip install langflow[deploy]" + ) from exc + logger.warning( + "RedisCache is an experimental feature and may not work as expected." + " Please report any issues to our GitHub repository." + ) + self._client = redis.StrictRedis(host=host, port=port, db=db) + self.expiration_time = expiration_time - def add(self, name: str, obj: Any, obj_type: str, extension: Optional[str] = None): + # check connection + def is_connected(self): """ - Add an object to the current client's cache. + Check if the Redis client is connected. + """ + import redis + + try: + self._client.ping() + return True + except redis.exceptions.ConnectionError: + return False + + def get(self, key): + """ + Retrieve an item from the cache. Args: - name (str): The cache key. - obj (Any): The object to cache. - obj_type (str): The type of the object. - """ - object_extensions = { - "image": "png", - "pandas": "csv", - } - if obj_type in object_extensions: - _extension = object_extensions[obj_type] - else: - _extension = type(obj).__name__.lower() - self.current_cache[name] = { - "obj": obj, - "type": obj_type, - "extension": extension or _extension, - } - self.notify() - - def add_pandas(self, name: str, obj: Any): - """ - Add a pandas DataFrame or Series to the current client's cache. - - Args: - name (str): The cache key. - obj (Any): The pandas DataFrame or Series object. - """ - if isinstance(obj, (pd.DataFrame, pd.Series)): - self.add(name, obj.to_csv(), "pandas", extension="csv") - else: - raise ValueError("Object is not a pandas DataFrame or Series") - - def add_image(self, name: str, obj: Any, extension: str = "png"): - """ - Add a PIL Image to the current client's cache. - - Args: - name (str): The cache key. - obj (Any): The PIL Image object. - """ - if isinstance(obj, Image.Image): - self.add(name, obj, "image", extension=extension) - else: - raise ValueError("Object is not a PIL Image") - - def get(self, name: str): - """ - Get an object from the current client's cache. - - Args: - name (str): The cache key. + key: The key of the item to retrieve. Returns: - The cached object associated with the given cache key. + The value associated with the key, or None if the key is not found. """ - return self.current_cache[name] + value = self._client.get(key) + return pickle.loads(value) if value else None - def get_last(self): + def set(self, key, value): """ - Get the last added item in the current client's cache. + Add an item to the cache. - Returns: - The last added item in the cache. + Args: + key: The key of the item. + value: The value to cache. """ - return list(self.current_cache.values())[-1] + try: + if pickled := pickle.dumps(value): + result = self._client.setex(key, self.expiration_time, pickled) + if not result: + raise ValueError("RedisCache could not set the value.") + except TypeError as exc: + raise TypeError( + "RedisCache only accepts values that can be pickled. " + ) from exc + def upsert(self, key, value): + """ + Inserts or updates a value in the cache. + If the existing value and the new value are both dictionaries, they are merged. -cache_manager = CacheManager() + Args: + key: The key of the item. + value: The value to insert or update. + """ + existing_value = self.get(key) + if ( + existing_value is not None + and isinstance(existing_value, dict) + and isinstance(value, dict) + ): + existing_value.update(value) + value = existing_value + + self.set(key, value) + + def delete(self, key): + """ + Remove an item from the cache. + + Args: + key: The key of the item to remove. + """ + self._client.delete(key) + + def clear(self): + """ + Clear all items from the cache. + """ + self._client.flushdb() + + def __contains__(self, key): + """Check if the key is in the cache.""" + return False if key is None else self._client.exists(key) + + def __getitem__(self, key): + """Retrieve an item from the cache using the square bracket notation.""" + return self.get(key) + + def __setitem__(self, key, value): + """Add an item to the cache using the square bracket notation.""" + self.set(key, value) + + def __delitem__(self, key): + """Remove an item from the cache using the square bracket notation.""" + self.delete(key) + + def __repr__(self): + """Return a string representation of the RedisCache instance.""" + return f"RedisCache(expiration_time={self.expiration_time})" diff --git a/src/backend/langflow/services/cache/utils.py b/src/backend/langflow/services/cache/utils.py index a36243b75..bd6b4fb0a 100644 --- a/src/backend/langflow/services/cache/utils.py +++ b/src/backend/langflow/services/cache/utils.py @@ -6,10 +6,15 @@ import os import tempfile from collections import OrderedDict from pathlib import Path -from typing import Any, Dict +from typing import TYPE_CHECKING, Any, Dict from appdirs import user_cache_dir +from fastapi import UploadFile +from langflow.api.v1.schemas import BuildStatus from langflow.services.database.models.base import orjson_dumps +if TYPE_CHECKING: + pass + CACHE: Dict[str, Any] = {} CACHE_DIR = user_cache_dir("langflow", "langflow") @@ -152,7 +157,7 @@ def save_binary_file(content: str, file_name: str, accepted_types: list[str]) -> @create_cache_folder -def save_uploaded_file(file, folder_name): +def save_uploaded_file(file: UploadFile, folder_name): """ Save an uploaded file to the specified folder with a hash of its content as the file name. @@ -165,6 +170,12 @@ def save_uploaded_file(file, folder_name): """ cache_path = Path(CACHE_DIR) folder_path = cache_path / folder_name + filename = file.filename + if isinstance(filename, str) or isinstance(filename, Path): + file_extension = Path(filename).suffix + else: + file_extension = "" + file_object = file.file # Create the folder if it doesn't exist if not folder_path.exists(): @@ -173,22 +184,30 @@ def save_uploaded_file(file, folder_name): # Create a hash of the file content sha256_hash = hashlib.sha256() # Reset the file cursor to the beginning of the file - file.seek(0) + file_object.seek(0) # Iterate over the uploaded file in small chunks to conserve memory - while chunk := file.read(8192): # Read 8KB at a time (adjust as needed) + while chunk := file_object.read(8192): # Read 8KB at a time (adjust as needed) sha256_hash.update(chunk) # Use the hex digest of the hash as the file name hex_dig = sha256_hash.hexdigest() - file_name = hex_dig + file_name = f"{hex_dig}{file_extension}" # Reset the file cursor to the beginning of the file - file.seek(0) + file_object.seek(0) # Save the file with the hash as its name file_path = folder_path / file_name with open(file_path, "wb") as new_file: - while chunk := file.read(8192): + while chunk := file_object.read(8192): new_file.write(chunk) return file_path + + +def update_build_status(cache_service, flow_id: str, status: BuildStatus): + cached_flow = cache_service[flow_id] + if cached_flow is None: + raise ValueError(f"Flow {flow_id} not found in cache") + cached_flow["status"] = status + cache_service[flow_id] = cached_flow diff --git a/src/backend/langflow/services/chat/cache.py b/src/backend/langflow/services/chat/cache.py new file mode 100644 index 000000000..f6247b540 --- /dev/null +++ b/src/backend/langflow/services/chat/cache.py @@ -0,0 +1,153 @@ +from contextlib import contextmanager +from typing import Any, Awaitable, Callable, List, Optional +from langflow.services.base import Service + +import pandas as pd +from PIL import Image + + +class Subject: + """Base class for implementing the observer pattern.""" + + def __init__(self): + self.observers: List[Callable[[], None]] = [] + + def attach(self, observer: Callable[[], None]): + """Attach an observer to the subject.""" + self.observers.append(observer) + + def detach(self, observer: Callable[[], None]): + """Detach an observer from the subject.""" + self.observers.remove(observer) + + def notify(self): + """Notify all observers about an event.""" + for observer in self.observers: + if observer is None: + continue + observer() + + +class AsyncSubject: + """Base class for implementing the async observer pattern.""" + + def __init__(self): + self.observers: List[Callable[[], Awaitable]] = [] + + def attach(self, observer: Callable[[], Awaitable]): + """Attach an observer to the subject.""" + self.observers.append(observer) + + def detach(self, observer: Callable[[], Awaitable]): + """Detach an observer from the subject.""" + self.observers.remove(observer) + + async def notify(self): + """Notify all observers about an event.""" + for observer in self.observers: + if observer is None: + continue + await observer() + + +class CacheService(Subject, Service): + """Manages cache for different clients and notifies observers on changes.""" + + name = "cache_service" + + def __init__(self): + super().__init__() + self._cache = {} + self.current_client_id = None + self.current_cache = {} + + @contextmanager + def set_client_id(self, client_id: str): + """ + Context manager to set the current client_id and associated cache. + + Args: + client_id (str): The client identifier. + """ + previous_client_id = self.current_client_id + self.current_client_id = client_id + self.current_cache = self._cache.setdefault(client_id, {}) + try: + yield + finally: + self.current_client_id = previous_client_id + self.current_cache = self._cache.get(self.current_client_id, {}) + + def add(self, name: str, obj: Any, obj_type: str, extension: Optional[str] = None): + """ + Add an object to the current client's cache. + + Args: + name (str): The cache key. + obj (Any): The object to cache. + obj_type (str): The type of the object. + """ + object_extensions = { + "image": "png", + "pandas": "csv", + } + if obj_type in object_extensions: + _extension = object_extensions[obj_type] + else: + _extension = type(obj).__name__.lower() + self.current_cache[name] = { + "obj": obj, + "type": obj_type, + "extension": extension or _extension, + } + self.notify() + + def add_pandas(self, name: str, obj: Any): + """ + Add a pandas DataFrame or Series to the current client's cache. + + Args: + name (str): The cache key. + obj (Any): The pandas DataFrame or Series object. + """ + if isinstance(obj, (pd.DataFrame, pd.Series)): + self.add(name, obj.to_csv(), "pandas", extension="csv") + else: + raise ValueError("Object is not a pandas DataFrame or Series") + + def add_image(self, name: str, obj: Any, extension: str = "png"): + """ + Add a PIL Image to the current client's cache. + + Args: + name (str): The cache key. + obj (Any): The PIL Image object. + """ + if isinstance(obj, Image.Image): + self.add(name, obj, "image", extension=extension) + else: + raise ValueError("Object is not a PIL Image") + + def get(self, name: str): + """ + Get an object from the current client's cache. + + Args: + name (str): The cache key. + + Returns: + The cached object associated with the given cache key. + """ + return self.current_cache[name] + + def get_last(self): + """ + Get the last added item in the current client's cache. + + Returns: + The last added item in the cache. + """ + return list(self.current_cache.values())[-1] + + +cache_service = CacheService() diff --git a/src/backend/langflow/services/chat/factory.py b/src/backend/langflow/services/chat/factory.py index ca844893a..54af7fcca 100644 --- a/src/backend/langflow/services/chat/factory.py +++ b/src/backend/langflow/services/chat/factory.py @@ -1,11 +1,11 @@ -from langflow.services.chat.manager import ChatManager +from langflow.services.chat.manager import ChatService from langflow.services.factory import ServiceFactory -class ChatManagerFactory(ServiceFactory): +class ChatServiceFactory(ServiceFactory): def __init__(self): - super().__init__(ChatManager) + super().__init__(ChatService) def create(self): - # Here you would have logic to create and configure a ChatManager - return ChatManager() + # Here you would have logic to create and configure a ChatService + return ChatService() diff --git a/src/backend/langflow/services/chat/manager.py b/src/backend/langflow/services/chat/manager.py index d8492e961..59488d431 100644 --- a/src/backend/langflow/services/chat/manager.py +++ b/src/backend/langflow/services/chat/manager.py @@ -1,19 +1,19 @@ from collections import defaultdict +import uuid from fastapi import WebSocket, status +from starlette.websockets import WebSocketState from langflow.api.v1.schemas import ChatMessage, ChatResponse, FileResponse -from langflow.services.base import Service -from langflow.services import service_manager -from langflow.services.cache.manager import Subject -from langflow.services.chat.utils import process_graph from langflow.interface.utils import pil_to_base64 -from langflow.services.schema import ServiceType +from langflow.services.base import Service +from langflow.services.chat.cache import Subject +from langflow.services.chat.utils import process_graph from loguru import logger - +from .cache import cache_service import asyncio from typing import Any, Dict, List -from langflow.services.cache.flow import InMemoryCache +from langflow.services import service_manager, ServiceType import orjson @@ -44,19 +44,20 @@ class ChatHistory(Subject): self.history[client_id] = [] -class ChatManager(Service): - name = "chat_manager" +class ChatService(Service): + name = "chat_service" def __init__(self): self.active_connections: Dict[str, WebSocket] = {} + self.connection_ids: Dict[str, str] = {} self.chat_history = ChatHistory() - self.cache_manager = service_manager.get(ServiceType.CACHE_MANAGER) - self.cache_manager.attach(self.update) - self.in_memory_cache = InMemoryCache() + self.chat_cache = cache_service + self.chat_cache.attach(self.update) + self.cache_service = service_manager.get(ServiceType.CACHE_SERVICE) def on_chat_history_update(self): """Send the last chat message to the client.""" - client_id = self.cache_manager.current_client_id + client_id = self.chat_cache.current_client_id if client_id in self.active_connections: chat_response = self.chat_history.get_history( client_id, filter_messages=False @@ -77,8 +78,8 @@ class ChatManager(Service): asyncio.run_coroutine_threadsafe(coroutine, loop) def update(self): - if self.cache_manager.current_client_id in self.active_connections: - self.last_cached_object_dict = self.cache_manager.get_last() + if self.chat_cache.current_client_id in self.active_connections: + self.last_cached_object_dict = self.chat_cache.get_last() # Add a new ChatResponse with the data chat_response = FileResponse( message=None, @@ -88,14 +89,18 @@ class ChatManager(Service): ) self.chat_history.add_message( - self.cache_manager.current_client_id, chat_response + self.chat_cache.current_client_id, chat_response ) async def connect(self, client_id: str, websocket: WebSocket): self.active_connections[client_id] = websocket + # This is to avoid having multiple clients with the same id + #! Temporary solution + self.connection_ids[client_id] = f"{client_id}-{uuid.uuid4()}" def disconnect(self, client_id: str): self.active_connections.pop(client_id, None) + self.connection_ids.pop(client_id, None) async def send_message(self, client_id: str, message: str): websocket = self.active_connections[client_id] @@ -121,7 +126,8 @@ class ChatManager(Service): ): # Process the graph data and chat message chat_inputs = payload.pop("inputs", {}) - chat_inputs = ChatMessage(message=chat_inputs) + chatkey = payload.pop("chatKey", None) + chat_inputs = ChatMessage(message=chat_inputs, chatKey=chatkey) self.chat_history.add_message(client_id, chat_inputs) # graph_data = payload @@ -136,8 +142,10 @@ class ChatManager(Service): result, intermediate_steps = await process_graph( langchain_object=langchain_object, chat_inputs=chat_inputs, - websocket=self.active_connections[client_id], + client_id=client_id, + session_id=self.connection_ids[client_id], ) + self.set_cache(client_id, langchain_object) except Exception as e: # Log stack trace logger.exception(e) @@ -173,9 +181,15 @@ class ChatManager(Service): """ Set the cache for a client. """ + # client_id is the flow id but that already exists in the cache + # so we need to change it to something else - self.in_memory_cache.set(client_id, langchain_object) - return client_id in self.in_memory_cache + result_dict = { + "result": langchain_object, + "type": type(langchain_object), + } + self.cache_service.upsert(client_id, result_dict) + return client_id in self.cache_service async def handle_websocket(self, client_id: str, websocket: WebSocket): await self.connect(client_id, websocket) @@ -188,33 +202,45 @@ class ChatManager(Service): while True: json_payload = await websocket.receive_json() - try: + if isinstance(json_payload, str): payload = orjson.loads(json_payload) - except Exception: + elif isinstance(json_payload, dict): payload = json_payload - if "clear_history" in payload: + if "clear_history" in payload and payload["clear_history"]: self.chat_history.history[client_id] = [] continue - with self.cache_manager.set_client_id(client_id): - langchain_object = self.in_memory_cache.get(client_id) - await self.process_message(client_id, payload, langchain_object) + with self.chat_cache.set_client_id(client_id): + if langchain_object := self.cache_service.get(client_id).get( + "result" + ): + await self.process_message(client_id, payload, langchain_object) + else: + raise RuntimeError( + f"Could not find a build result for client_id {client_id}" + ) except Exception as exc: # Handle any exceptions that might occur - logger.error(f"Error handling websocket: {exc}") - await self.close_connection( - client_id=client_id, - code=status.WS_1011_INTERNAL_ERROR, - reason=str(exc)[:120], - ) - finally: - try: + logger.exception(f"Error handling websocket: {exc}") + if websocket.client_state == WebSocketState.CONNECTED: await self.close_connection( client_id=client_id, - code=status.WS_1000_NORMAL_CLOSURE, - reason="Client disconnected", + code=status.WS_1011_INTERNAL_ERROR, + reason=str(exc)[:120], ) + elif websocket.client_state == WebSocketState.DISCONNECTED: + self.disconnect(client_id) + + finally: + try: + # first check if the connection is still open + if websocket.client_state == WebSocketState.CONNECTED: + await self.close_connection( + client_id=client_id, + code=status.WS_1000_NORMAL_CLOSURE, + reason="Client disconnected", + ) except Exception as exc: logger.error(f"Error closing connection: {exc}") self.disconnect(client_id) diff --git a/src/backend/langflow/services/chat/utils.py b/src/backend/langflow/services/chat/utils.py index d9c291757..85b86a801 100644 --- a/src/backend/langflow/services/chat/utils.py +++ b/src/backend/langflow/services/chat/utils.py @@ -1,4 +1,3 @@ -from fastapi import WebSocket from langflow.api.v1.schemas import ChatMessage from langflow.processing.base import get_result_and_steps from langflow.interface.utils import try_setting_streaming_options @@ -8,9 +7,10 @@ from loguru import logger async def process_graph( langchain_object, chat_inputs: ChatMessage, - websocket: WebSocket, + client_id: str, + session_id: str, ): - langchain_object = try_setting_streaming_options(langchain_object, websocket) + langchain_object = try_setting_streaming_options(langchain_object) logger.debug("Loaded langchain object") if langchain_object is None: @@ -27,7 +27,10 @@ async def process_graph( logger.debug("Generating result and thought") result, intermediate_steps = await get_result_and_steps( - langchain_object, chat_inputs.message, websocket=websocket + langchain_object, + chat_inputs.message, + client_id=client_id, + session_id=session_id, ) logger.debug("Generated result and intermediate_steps") return result, intermediate_steps diff --git a/src/backend/langflow/services/database/factory.py b/src/backend/langflow/services/database/factory.py index 25427b7b9..3726f520b 100644 --- a/src/backend/langflow/services/database/factory.py +++ b/src/backend/langflow/services/database/factory.py @@ -1,17 +1,17 @@ from typing import TYPE_CHECKING -from langflow.services.database.manager import DatabaseManager +from langflow.services.database.manager import DatabaseService from langflow.services.factory import ServiceFactory if TYPE_CHECKING: - from langflow.services.settings.manager import SettingsManager + from langflow.services.settings.manager import SettingsService -class DatabaseManagerFactory(ServiceFactory): +class DatabaseServiceFactory(ServiceFactory): def __init__(self): - super().__init__(DatabaseManager) + super().__init__(DatabaseService) - def create(self, settings_manager: "SettingsManager"): - # Here you would have logic to create and configure a DatabaseManager - if not settings_manager.settings.DATABASE_URL: + def create(self, settings_service: "SettingsService"): + # Here you would have logic to create and configure a DatabaseService + if not settings_service.settings.DATABASE_URL: raise ValueError("No database URL provided") - return DatabaseManager(settings_manager.settings.DATABASE_URL) + return DatabaseService(settings_service.settings.DATABASE_URL) diff --git a/src/backend/langflow/services/database/manager.py b/src/backend/langflow/services/database/manager.py index 7f8afab6f..c743387eb 100644 --- a/src/backend/langflow/services/database/manager.py +++ b/src/backend/langflow/services/database/manager.py @@ -3,9 +3,10 @@ from typing import TYPE_CHECKING from langflow.services.base import Service from langflow.services.database.models.user.crud import get_user_by_username from langflow.services.database.utils import Result, TableResults -from langflow.services.utils import get_settings_manager +from langflow.services.getters import get_settings_service from sqlalchemy import inspect import sqlalchemy as sa +from sqlalchemy.exc import OperationalError from sqlmodel import SQLModel, Session, create_engine from loguru import logger from alembic.config import Config @@ -16,8 +17,8 @@ if TYPE_CHECKING: from sqlalchemy.engine import Engine -class DatabaseManager(Service): - name = "database_manager" +class DatabaseService(Service): + name = "database_service" def __init__(self, database_url: str): self.database_url = database_url @@ -30,10 +31,10 @@ class DatabaseManager(Service): def _create_engine(self) -> "Engine": """Create the engine for the database.""" - settings_manager = get_settings_manager() + settings_service = get_settings_service() if ( - settings_manager.settings.DATABASE_URL - and settings_manager.settings.DATABASE_URL.startswith("sqlite") + settings_service.settings.DATABASE_URL + and settings_service.settings.DATABASE_URL.startswith("sqlite") ): connect_args = {"check_same_thread": False} else: @@ -58,6 +59,27 @@ class DatabaseManager(Service): with Session(self.engine) as session: yield session + def migrate_flows_if_auto_login(self): + # if auto_login is enabled, we need to migrate the flows + # to the default superuser if they don't have a user id + # associated with them + settings_service = get_settings_service() + if settings_service.auth_settings.AUTO_LOGIN: + with Session(self.engine) as session: + flows = ( + session.query(models.Flow) + .filter(models.Flow.user_id == None) # noqa + .all() + ) + if flows: + logger.debug("Migrating flows to default superuser") + username = settings_service.auth_settings.SUPERUSER + user = get_user_by_username(session, username) + for flow in flows: + flow.user_id = user.id + session.commit() + logger.debug("Flows migrated successfully") + def check_schema_health(self) -> bool: inspector = inspect(self.engine) @@ -94,9 +116,7 @@ class DatabaseManager(Service): return True def run_migrations(self): - logger.info( - f"Running DB migrations in {self.script_location} on {self.database_url}" - ) + logger.info(f"Running DB migrations in {self.script_location}") alembic_cfg = Config() alembic_cfg.set_main_option("script_location", str(self.script_location)) alembic_cfg.set_main_option("sqlalchemy.url", self.database_url) @@ -107,12 +127,10 @@ class DatabaseManager(Service): # We will check that all models are in the database # and that the database is up to date with all columns sql_models = [models.Flow, models.User, models.ApiKey] - results = [] - for sql_model in sql_models: - results.append( - TableResults(sql_model.__tablename__, self.check_table(sql_model)) - ) - return results + return [ + TableResults(sql_model.__tablename__, self.check_table(sql_model)) + for sql_model in sql_models + ] def check_table(self, model): results = [] @@ -137,19 +155,31 @@ class DatabaseManager(Service): return results def create_db_and_tables(self): - logger.debug("Creating database and tables") - try: - SQLModel.metadata.create_all(self.engine) - except Exception as exc: - logger.error(f"Error creating database and tables: {exc}") - raise RuntimeError("Error creating database and tables") from exc - - # Now check if the table "flow" exists, if not, something went wrong - # and we need to create the tables again. from sqlalchemy import inspect inspector = inspect(self.engine) + table_names = inspector.get_table_names() current_tables = ["flow", "user", "apikey"] + + if table_names and all(table in table_names for table in current_tables): + logger.debug("Database and tables already exist") + return + + logger.debug("Creating database and tables") + + for table in SQLModel.metadata.sorted_tables: + try: + table.create(self.engine, checkfirst=True) + except OperationalError as oe: + logger.warning( + f"Table {table} already exists, skipping. Exception: {oe}" + ) + except Exception as exc: + logger.error(f"Error creating table {table}: {exc}") + raise RuntimeError(f"Error creating table {table}") from exc + + # Now check if the required tables exist, if not, something went wrong. + inspector = inspect(self.engine) table_names = inspector.get_table_names() for table in current_tables: if table not in table_names: @@ -164,12 +194,12 @@ class DatabaseManager(Service): def teardown(self): logger.debug("Tearing down database") try: - settings_manager = get_settings_manager() + settings_service = get_settings_service() # remove the default superuser if auto_login is enabled - # using the FIRST_SUPERUSER to get the user - if settings_manager.auth_settings.AUTO_LOGIN: + # using the SUPERUSER to get the user + if settings_service.auth_settings.AUTO_LOGIN: logger.debug("Removing default superuser") - username = settings_manager.auth_settings.FIRST_SUPERUSER + username = settings_service.auth_settings.SUPERUSER with Session(self.engine) as session: user = get_user_by_username(session, username) session.delete(user) diff --git a/src/backend/langflow/services/database/models/api_key/api_key.py b/src/backend/langflow/services/database/models/api_key/api_key.py index 5d5bab0f4..684027ee2 100644 --- a/src/backend/langflow/services/database/models/api_key/api_key.py +++ b/src/backend/langflow/services/database/models/api_key/api_key.py @@ -12,7 +12,7 @@ if TYPE_CHECKING: class ApiKeyBase(SQLModelSerializable): name: Optional[str] = Field(index=True) created_at: datetime = Field(default_factory=datetime.utcnow) - last_used_at: Optional[datetime] = Field(default=None) + last_used_at: Optional[datetime] = Field(default=None, nullable=True) total_uses: int = Field(default=0) is_active: bool = Field(default=True) @@ -22,8 +22,11 @@ class ApiKey(ApiKeyBase, table=True): api_key: str = Field(index=True, unique=True) # User relationship + # Delete API keys when user is deleted user_id: UUID = Field(index=True, foreign_key="user.id") - user: "User" = Relationship(back_populates="api_keys") + user: "User" = Relationship( + back_populates="api_keys", + ) class ApiKeyCreate(ApiKeyBase): diff --git a/src/backend/langflow/services/database/models/api_key/crud.py b/src/backend/langflow/services/database/models/api_key/crud.py index abc84f108..0e0ae6137 100644 --- a/src/backend/langflow/services/database/models/api_key/crud.py +++ b/src/backend/langflow/services/database/models/api_key/crud.py @@ -22,7 +22,7 @@ def create_api_key( session: Session, api_key_create: ApiKeyCreate, user_id: UUID ) -> UnmaskedApiKeyRead: # Generate a random API key with 32 bytes of randomness - generated_api_key = f"lf-{secrets.token_urlsafe(32)}" + generated_api_key = f"sk-{secrets.token_urlsafe(32)}" api_key = ApiKey( api_key=generated_api_key, @@ -63,9 +63,15 @@ def check_key(session: Session, api_key: str) -> Optional[ApiKey]: def update_total_uses(session, api_key: ApiKey): """Update the total uses and last used at.""" - api_key.total_uses += 1 - api_key.last_used_at = datetime.datetime.now(datetime.timezone.utc) - session.add(api_key) - session.commit() - session.refresh(api_key) - return api_key + # This is running in a separate thread to avoid slowing down the request + # but session is not thread safe so we need to create a new session + + with Session(session.get_bind()) as new_session: + new_api_key = new_session.get(ApiKey, api_key.id) + if new_api_key is None: + raise ValueError("API Key not found") + new_api_key.total_uses += 1 + new_api_key.last_used_at = datetime.datetime.now(datetime.timezone.utc) + new_session.add(new_api_key) + new_session.commit() + return new_api_key diff --git a/src/backend/langflow/services/database/models/flow/flow.py b/src/backend/langflow/services/database/models/flow/flow.py index e6ad4af4a..e578f37c4 100644 --- a/src/backend/langflow/services/database/models/flow/flow.py +++ b/src/backend/langflow/services/database/models/flow/flow.py @@ -2,6 +2,7 @@ from langflow.services.database.models.base import SQLModelSerializable from pydantic import validator + from sqlmodel import Field, JSON, Column, Relationship from uuid import UUID, uuid4 from typing import Dict, Optional, TYPE_CHECKING @@ -13,7 +14,7 @@ if TYPE_CHECKING: class FlowBase(SQLModelSerializable): name: str = Field(index=True) description: Optional[str] = Field(index=True) - data: Optional[Dict] = Field(default=None) + data: Optional[Dict] = Field(default=None, nullable=True) @validator("data") def validate_json(v): diff --git a/src/backend/langflow/services/database/models/user/crud.py b/src/backend/langflow/services/database/models/user/crud.py index 3dc02a499..36f03e684 100644 --- a/src/backend/langflow/services/database/models/user/crud.py +++ b/src/backend/langflow/services/database/models/user/crud.py @@ -1,12 +1,12 @@ from datetime import datetime, timezone from typing import Union from uuid import UUID -from fastapi import Depends, HTTPException +from fastapi import Depends, HTTPException, status from langflow.services.database.models.user.user import User, UserUpdate -from langflow.services.utils import get_session +from langflow.services.getters import get_session from sqlalchemy.exc import IntegrityError from sqlmodel import Session - +from typing import Optional from sqlalchemy.orm.attributes import flag_modified @@ -20,20 +20,26 @@ def get_user_by_id(db: Session, id: UUID) -> Union[User, None]: def update_user( - user_id: UUID, user: UserUpdate, db: Session = Depends(get_session) + user_db: Optional[User], user: UserUpdate, db: Session = Depends(get_session) ) -> User: - user_db = get_user_by_id(db, user_id) if not user_db: raise HTTPException(status_code=404, detail="User not found") - user_db_by_username = get_user_by_username(db, user.username) # type: ignore - if user_db_by_username and user_db_by_username.id != user_id: - raise HTTPException(status_code=409, detail="Username already exists") + # user_db_by_username = get_user_by_username(db, user.username) # type: ignore + # if user_db_by_username and user_db_by_username.id != user_id: + # raise HTTPException(status_code=409, detail="Username already exists") user_data = user.dict(exclude_unset=True) + changed = False for attr, value in user_data.items(): if hasattr(user_db, attr) and value is not None: setattr(user_db, attr, value) + changed = True + + if not changed: + raise HTTPException( + status_code=status.HTTP_304_NOT_MODIFIED, detail="Nothing to update" + ) user_db.updated_at = datetime.now(timezone.utc) flag_modified(user_db, "updated_at") @@ -49,5 +55,5 @@ def update_user( def update_user_last_login_at(user_id: UUID, db: Session = Depends(get_session)): user_data = UserUpdate(last_login_at=datetime.now(timezone.utc)) # type: ignore - - return update_user(user_id, user_data, db) + user = get_user_by_id(db, user_id) + return update_user(user, user_data, db) diff --git a/src/backend/langflow/services/database/models/user/user.py b/src/backend/langflow/services/database/models/user/user.py index 5f83b4d88..b1f514531 100644 --- a/src/backend/langflow/services/database/models/user/user.py +++ b/src/backend/langflow/services/database/models/user/user.py @@ -15,12 +15,16 @@ class User(SQLModelSerializable, table=True): id: UUID = Field(default_factory=uuid4, primary_key=True, unique=True) username: str = Field(index=True, unique=True) password: str = Field() + profile_image: Optional[str] = Field(default=None, nullable=True) is_active: bool = Field(default=False) is_superuser: bool = Field(default=False) create_at: datetime = Field(default_factory=datetime.utcnow) updated_at: datetime = Field(default_factory=datetime.utcnow) last_login_at: Optional[datetime] = Field() - api_keys: list["ApiKey"] = Relationship(back_populates="user") + api_keys: list["ApiKey"] = Relationship( + back_populates="user", + sa_relationship_kwargs={"cascade": "delete"}, + ) flows: list["Flow"] = Relationship(back_populates="user") @@ -32,6 +36,7 @@ class UserCreate(SQLModel): class UserRead(SQLModel): id: UUID = Field(default_factory=uuid4) username: str = Field() + profile_image: Optional[str] = Field() is_active: bool = Field() is_superuser: bool = Field() create_at: datetime = Field() @@ -41,6 +46,8 @@ class UserRead(SQLModel): class UserUpdate(SQLModel): username: Optional[str] = Field() + profile_image: Optional[str] = Field() + password: Optional[str] = Field() is_active: Optional[bool] = Field() is_superuser: Optional[bool] = Field() last_login_at: Optional[datetime] = Field() diff --git a/src/backend/langflow/services/database/utils.py b/src/backend/langflow/services/database/utils.py index fd0a8856a..968cfef59 100644 --- a/src/backend/langflow/services/database/utils.py +++ b/src/backend/langflow/services/database/utils.py @@ -6,21 +6,31 @@ from alembic.util.exc import CommandError from sqlmodel import Session if TYPE_CHECKING: - from langflow.services.database.manager import DatabaseManager + from langflow.services.database.manager import DatabaseService def initialize_database(): logger.debug("Initializing database") from langflow.services import service_manager, ServiceType - database_manager = service_manager.get(ServiceType.DATABASE_MANAGER) + database_service: "DatabaseService" = service_manager.get( + ServiceType.DATABASE_SERVICE + ) try: - database_manager.check_schema_health() + database_service.create_db_and_tables() + except Exception as exc: + # if the exception involves tables already existing + # we can ignore it + if "already exists" not in str(exc): + logger.error(f"Error creating DB and tables: {exc}") + raise RuntimeError("Error creating DB and tables") from exc + try: + database_service.check_schema_health() except Exception as exc: logger.error(f"Error checking schema health: {exc}") raise RuntimeError("Error checking schema health") from exc try: - database_manager.run_migrations() + database_service.run_migrations() except CommandError as exc: if "Can't locate revision identified by" not in str(exc): raise exc @@ -30,23 +40,22 @@ def initialize_database(): logger.warning( "Wrong revision in DB, deleting alembic_version table and running migrations again" ) - with session_getter(database_manager) as session: + with session_getter(database_service) as session: session.execute("DROP TABLE alembic_version") - database_manager.run_migrations() + database_service.run_migrations() except Exception as exc: # if the exception involves tables already existing # we can ignore it if "already exists" not in str(exc): logger.error(f"Error running migrations: {exc}") raise RuntimeError("Error running migrations") from exc - database_manager.create_db_and_tables() logger.debug("Database initialized") @contextmanager -def session_getter(db_manager: "DatabaseManager"): +def session_getter(db_service: "DatabaseService"): try: - session = Session(db_manager.engine) + session = Session(db_service.engine) yield session except Exception as e: print("Session rollback because of exception:", e) diff --git a/src/backend/langflow/services/getters.py b/src/backend/langflow/services/getters.py new file mode 100644 index 000000000..e88b998b5 --- /dev/null +++ b/src/backend/langflow/services/getters.py @@ -0,0 +1,48 @@ +from langflow.services import ServiceType, service_manager +from typing import TYPE_CHECKING, Generator + + +if TYPE_CHECKING: + from langflow.services.database.manager import DatabaseService + from langflow.services.settings.manager import SettingsService + from langflow.services.cache.manager import BaseCacheService + from langflow.services.session.manager import SessionService + from langflow.services.task.manager import TaskService + from langflow.services.chat.manager import ChatService + from sqlmodel import Session + + +def get_settings_service() -> "SettingsService": + try: + return service_manager.get(ServiceType.SETTINGS_SERVICE) + except ValueError: + # initialize settings service + from langflow.services.manager import initialize_settings_service + + initialize_settings_service() + return service_manager.get(ServiceType.SETTINGS_SERVICE) + + +def get_db_service() -> "DatabaseService": + return service_manager.get(ServiceType.DATABASE_SERVICE) + + +def get_session() -> Generator["Session", None, None]: + db_service = service_manager.get(ServiceType.DATABASE_SERVICE) + yield from db_service.get_session() + + +def get_cache_service() -> "BaseCacheService": + return service_manager.get(ServiceType.CACHE_SERVICE) + + +def get_session_service() -> "SessionService": + return service_manager.get(ServiceType.SESSION_SERVICE) + + +def get_task_service() -> "TaskService": + return service_manager.get(ServiceType.TASK_SERVICE) + + +def get_chat_service() -> "ChatService": + return service_manager.get(ServiceType.CHAT_SERVICE) diff --git a/src/backend/langflow/services/manager.py b/src/backend/langflow/services/manager.py index 60a93fe16..10fd6b699 100644 --- a/src/backend/langflow/services/manager.py +++ b/src/backend/langflow/services/manager.py @@ -1,9 +1,10 @@ from langflow.services.schema import ServiceType -from typing import TYPE_CHECKING, List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional from loguru import logger if TYPE_CHECKING: from langflow.services.factory import ServiceFactory + from langflow.services.base import Service class ServiceManager: @@ -12,7 +13,7 @@ class ServiceManager: """ def __init__(self): - self.services = {} + self.services: Dict[str, "Service"] = {} self.factories = {} self.dependencies = {} @@ -61,6 +62,7 @@ class ServiceManager: self.services[service_name] = self.factories[service_name].create( **dependent_services ) + self.services[service_name].set_ready() def _validate_service_creation(self, service_name: ServiceType): """ @@ -85,8 +87,13 @@ class ServiceManager: Teardown all the services. """ for service in self.services.values(): + if service is None: + continue logger.debug(f"Teardown service {service.name}") - service.teardown() + try: + service.teardown() + except Exception as exc: + logger.exception(exc) self.services = {} self.factories = {} self.dependencies = {} @@ -95,63 +102,53 @@ class ServiceManager: service_manager = ServiceManager() -def initialize_services(): +def reinitialize_services(): """ - Initialize all the services needed. + Reinitialize all the services needed. """ - from langflow.services.database import factory as database_factory - from langflow.services.cache import factory as cache_factory - from langflow.services.chat import factory as chat_factory - from langflow.services.settings import factory as settings_factory - from langflow.services.auth import factory as auth_factory - service_manager.register_factory(settings_factory.SettingsManagerFactory()) - service_manager.register_factory( - auth_factory.AuthManagerFactory(), dependencies=[ServiceType.SETTINGS_MANAGER] - ) - service_manager.register_factory( - database_factory.DatabaseManagerFactory(), - dependencies=[ServiceType.SETTINGS_MANAGER], - ) - service_manager.register_factory(cache_factory.CacheManagerFactory()) - service_manager.register_factory(chat_factory.ChatManagerFactory()) + service_manager.update(ServiceType.SETTINGS_SERVICE) + service_manager.update(ServiceType.DATABASE_SERVICE) + service_manager.update(ServiceType.CACHE_SERVICE) + service_manager.update(ServiceType.CHAT_SERVICE) + service_manager.update(ServiceType.SESSION_SERVICE) + service_manager.update(ServiceType.AUTH_SERVICE) + service_manager.update(ServiceType.TASK_SERVICE) # Test cache connection - service_manager.get(ServiceType.CACHE_MANAGER) + service_manager.get(ServiceType.CACHE_SERVICE) # Test database connection - service_manager.get(ServiceType.DATABASE_MANAGER) + service_manager.get(ServiceType.DATABASE_SERVICE) + + # Test cache connection + service_manager.get(ServiceType.CACHE_SERVICE) + # Test database connection + service_manager.get(ServiceType.DATABASE_SERVICE) -def initialize_settings_manager(): +def initialize_settings_service(): """ Initialize the settings manager. """ from langflow.services.settings import factory as settings_factory - service_manager.register_factory(settings_factory.SettingsManagerFactory()) + service_manager.register_factory(settings_factory.SettingsServiceFactory()) -def initialize_session_manager(): +def initialize_session_service(): """ Initialize the session manager. """ - from langflow.services.session import factory as session_manager_factory # type: ignore + from langflow.services.session import factory as session_service_factory # type: ignore from langflow.services.cache import factory as cache_factory - initialize_settings_manager() + initialize_settings_service() service_manager.register_factory( - cache_factory.CacheManagerFactory(), dependencies=[ServiceType.SETTINGS_MANAGER] + cache_factory.CacheServiceFactory(), dependencies=[ServiceType.SETTINGS_SERVICE] ) service_manager.register_factory( - session_manager_factory.SessionManagerFactory(), - dependencies=[ServiceType.CACHE_MANAGER], + session_service_factory.SessionServiceFactory(), + dependencies=[ServiceType.CACHE_SERVICE], ) - - -def teardown_services(): - """ - Teardown all the services. - """ - service_manager.teardown() diff --git a/src/backend/langflow/services/plugins/__init__.py b/src/backend/langflow/services/plugins/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/backend/langflow/services/plugins/langfuse.py b/src/backend/langflow/services/plugins/langfuse.py new file mode 100644 index 000000000..7a1f60a48 --- /dev/null +++ b/src/backend/langflow/services/plugins/langfuse.py @@ -0,0 +1,54 @@ +from langflow.services.getters import get_settings_service +from langflow.utils.logger import logger + +### Temporary implementation +# This will be replaced by a plugin system once merged into 0.5.0 + + +class LangfuseInstance: + _instance = None + + @classmethod + def get(cls): + logger.debug("Getting Langfuse instance") + if cls._instance is None: + cls.create() + return cls._instance + + @classmethod + def create(cls): + try: + logger.debug("Creating Langfuse instance") + from langfuse import Langfuse # type: ignore + + settings_manager = get_settings_service() + + if ( + settings_manager.settings.LANGFUSE_PUBLIC_KEY + and settings_manager.settings.LANGFUSE_SECRET_KEY + ): + logger.debug("Langfuse credentials found") + cls._instance = Langfuse( + public_key=settings_manager.settings.LANGFUSE_PUBLIC_KEY, + secret_key=settings_manager.settings.LANGFUSE_SECRET_KEY, + host=settings_manager.settings.LANGFUSE_HOST, + ) + else: + logger.debug("No Langfuse credentials found") + cls._instance = None + except ImportError: + logger.debug("Langfuse not installed") + cls._instance = None + + @classmethod + def update(cls): + logger.debug("Updating Langfuse instance") + cls._instance = None + cls.create() + + @classmethod + def teardown(cls): + logger.debug("Tearing down Langfuse instance") + if cls._instance is not None: + cls._instance.flush() + cls._instance = None diff --git a/src/backend/langflow/services/schema.py b/src/backend/langflow/services/schema.py index 6291a0d0b..8b3b41fcb 100644 --- a/src/backend/langflow/services/schema.py +++ b/src/backend/langflow/services/schema.py @@ -7,8 +7,10 @@ class ServiceType(str, Enum): registered with the service manager. """ - AUTH_MANAGER = "auth_manager" - CACHE_MANAGER = "cache_manager" - SETTINGS_MANAGER = "settings_manager" - DATABASE_MANAGER = "database_manager" - CHAT_MANAGER = "chat_manager" + AUTH_SERVICE = "auth_service" + CACHE_SERVICE = "cache_service" + SETTINGS_SERVICE = "settings_service" + DATABASE_SERVICE = "database_service" + CHAT_SERVICE = "chat_service" + SESSION_SERVICE = "session_service" + TASK_SERVICE = "task_service" diff --git a/src/backend/langflow/services/session/__init__.py b/src/backend/langflow/services/session/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/backend/langflow/services/session/factory.py b/src/backend/langflow/services/session/factory.py new file mode 100644 index 000000000..9abe025a8 --- /dev/null +++ b/src/backend/langflow/services/session/factory.py @@ -0,0 +1,14 @@ +from typing import TYPE_CHECKING +from langflow.services.session.manager import SessionService +from langflow.services.factory import ServiceFactory + +if TYPE_CHECKING: + from langflow.services.cache.manager import BaseCacheService + + +class SessionServiceFactory(ServiceFactory): + def __init__(self): + super().__init__(SessionService) + + def create(self, cache_service: "BaseCacheService"): + return SessionService(cache_service) diff --git a/src/backend/langflow/services/session/manager.py b/src/backend/langflow/services/session/manager.py new file mode 100644 index 000000000..6bdebf6b3 --- /dev/null +++ b/src/backend/langflow/services/session/manager.py @@ -0,0 +1,47 @@ +from typing import TYPE_CHECKING +from langflow.interface.run import build_sorted_vertices +from langflow.services.base import Service +from langflow.services.cache.utils import compute_dict_hash +from langflow.services.session.utils import session_id_generator + +if TYPE_CHECKING: + from langflow.services.cache.base import BaseCacheService + + +class SessionService(Service): + name = "session_service" + + def __init__(self, cache_service): + self.cache_service: "BaseCacheService" = cache_service + + def load_session(self, key, data_graph): + # Check if the data is cached + if key in self.cache_service: + return self.cache_service.get(key) + + if key is None: + key = self.generate_key(session_id=None, data_graph=data_graph) + + # If not cached, build the graph and cache it + graph, artifacts = build_sorted_vertices(data_graph) + + self.cache_service.set(key, (graph, artifacts)) + + return graph, artifacts + + def build_key(self, session_id, data_graph): + json_hash = compute_dict_hash(data_graph) + return f"{session_id}{':' if session_id else ''}{json_hash}" + + def generate_key(self, session_id, data_graph): + # Hash the JSON and combine it with the session_id to create a unique key + if session_id is None: + # generate a 5 char session_id to concatenate with the json_hash + session_id = session_id_generator() + return self.build_key(session_id, data_graph=data_graph) + + def update_session(self, session_id, value): + self.cache_service.set(session_id, value) + + def clear_session(self, session_id): + self.cache_service.delete(session_id) diff --git a/src/backend/langflow/services/session/utils.py b/src/backend/langflow/services/session/utils.py new file mode 100644 index 000000000..374d85540 --- /dev/null +++ b/src/backend/langflow/services/session/utils.py @@ -0,0 +1,8 @@ +import random +import string + + +def session_id_generator(size=6): + return "".join( + random.SystemRandom().choices(string.ascii_uppercase + string.digits, k=size) + ) diff --git a/src/backend/langflow/services/settings/auth.py b/src/backend/langflow/services/settings/auth.py index d1f8197f0..7ac7461a0 100644 --- a/src/backend/langflow/services/settings/auth.py +++ b/src/backend/langflow/services/settings/auth.py @@ -1,6 +1,10 @@ from pathlib import Path from typing import Optional import secrets +from langflow.services.settings.constants import ( + DEFAULT_SUPERUSER, + DEFAULT_SUPERUSER_PASSWORD, +) from langflow.services.settings.utils import read_secret_from_file, write_secret_to_file from pydantic import BaseSettings, Field, validator @@ -19,7 +23,7 @@ class AuthSettings(BaseSettings): ) ALGORITHM: str = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 - REFRESH_TOKEN_EXPIRE_MINUTES: int = 70 + REFRESH_TOKEN_EXPIRE_MINUTES: int = 60 * 12 # API Key to execute /process endpoint API_KEY_SECRET_KEY: Optional[ @@ -30,9 +34,10 @@ class AuthSettings(BaseSettings): # If AUTO_LOGIN = True # > The application does not request login and logs in automatically as a super user. - AUTO_LOGIN: bool = False - FIRST_SUPERUSER: str = "langflow" - FIRST_SUPERUSER_PASSWORD: str = "langflow" + AUTO_LOGIN: bool = True + NEW_USER_IS_ACTIVE: bool = False + SUPERUSER: str = DEFAULT_SUPERUSER + SUPERUSER_PASSWORD: str = DEFAULT_SUPERUSER_PASSWORD pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") @@ -41,6 +46,28 @@ class AuthSettings(BaseSettings): extra = "ignore" env_prefix = "LANGFLOW_" + def reset_credentials(self): + self.SUPERUSER = DEFAULT_SUPERUSER + self.SUPERUSER_PASSWORD = DEFAULT_SUPERUSER_PASSWORD + + # If autologin is true, then we need to set the credentials to + # the default values + # so we need to validate the superuser and superuser_password + # fields + @validator("SUPERUSER", "SUPERUSER_PASSWORD", pre=True) + def validate_superuser(cls, value, values): + if values.get("AUTO_LOGIN"): + if value != DEFAULT_SUPERUSER: + value = DEFAULT_SUPERUSER + logger.debug("Resetting superuser to default value") + if values.get("SUPERUSER_PASSWORD") != DEFAULT_SUPERUSER_PASSWORD: + values["SUPERUSER_PASSWORD"] = DEFAULT_SUPERUSER_PASSWORD + logger.debug("Resetting superuser password to default value") + + return value + + return value + @validator("SECRET_KEY", pre=True) def get_secret_key(cls, value, values): config_dir = values.get("CONFIG_DIR") diff --git a/src/backend/langflow/services/settings/base.py b/src/backend/langflow/services/settings/base.py index 366ff474d..14e3f9928 100644 --- a/src/backend/langflow/services/settings/base.py +++ b/src/backend/langflow/services/settings/base.py @@ -37,9 +37,20 @@ class Settings(BaseSettings): DEV: bool = False DATABASE_URL: Optional[str] = None - CACHE: str = "InMemoryCache" + CACHE_TYPE: str = "memory" REMOVE_API_KEYS: bool = False COMPONENTS_PATH: List[str] = [] + LANGCHAIN_CACHE: str = "InMemoryCache" + + # Redis + REDIS_HOST: str = "localhost" + REDIS_PORT: int = 6379 + REDIS_DB: int = 0 + REDIS_CACHE_EXPIRE: int = 3600 + + LANGFUSE_SECRET_KEY: Optional[str] = None + LANGFUSE_PUBLIC_KEY: Optional[str] = None + LANGFUSE_HOST: Optional[str] = None @validator("CONFIG_DIR", pre=True, allow_reuse=True) def set_langflow_dir(cls, value): diff --git a/src/backend/langflow/services/settings/constants.py b/src/backend/langflow/services/settings/constants.py new file mode 100644 index 000000000..6cf7d4823 --- /dev/null +++ b/src/backend/langflow/services/settings/constants.py @@ -0,0 +1,2 @@ +DEFAULT_SUPERUSER = "langflow" +DEFAULT_SUPERUSER_PASSWORD = "langflow" diff --git a/src/backend/langflow/services/settings/factory.py b/src/backend/langflow/services/settings/factory.py index ab22e22b8..9202ae8c3 100644 --- a/src/backend/langflow/services/settings/factory.py +++ b/src/backend/langflow/services/settings/factory.py @@ -1,15 +1,15 @@ from pathlib import Path -from langflow.services.settings.manager import SettingsManager +from langflow.services.settings.manager import SettingsService from langflow.services.factory import ServiceFactory -class SettingsManagerFactory(ServiceFactory): +class SettingsServiceFactory(ServiceFactory): def __init__(self): - super().__init__(SettingsManager) + super().__init__(SettingsService) def create(self): - # Here you would have logic to create and configure a SettingsManager + # Here you would have logic to create and configure a SettingsService langflow_dir = Path(__file__).parent.parent.parent - return SettingsManager.load_settings_from_yaml( + return SettingsService.load_settings_from_yaml( str(langflow_dir / "config.yaml") ) diff --git a/src/backend/langflow/services/settings/manager.py b/src/backend/langflow/services/settings/manager.py index 2d687d784..cdededcea 100644 --- a/src/backend/langflow/services/settings/manager.py +++ b/src/backend/langflow/services/settings/manager.py @@ -6,8 +6,8 @@ import os import yaml -class SettingsManager(Service): - name = "settings_manager" +class SettingsService(Service): + name = "settings_service" def __init__(self, settings: Settings, auth_settings: AuthSettings): super().__init__() @@ -15,7 +15,7 @@ class SettingsManager(Service): self.auth_settings = auth_settings @classmethod - def load_settings_from_yaml(cls, file_path: str) -> "SettingsManager": + def load_settings_from_yaml(cls, file_path: str) -> "SettingsService": # Check if a string is a valid path or a file name if "/" not in file_path: # Get current path diff --git a/src/backend/langflow/services/task/__init__.py b/src/backend/langflow/services/task/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/backend/langflow/services/task/backends/__init__.py b/src/backend/langflow/services/task/backends/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/backend/langflow/services/task/backends/anyio.py b/src/backend/langflow/services/task/backends/anyio.py new file mode 100644 index 000000000..49c9c0e4f --- /dev/null +++ b/src/backend/langflow/services/task/backends/anyio.py @@ -0,0 +1,69 @@ +from typing import Any, Callable, Optional, Tuple +import anyio +from langflow.services.task.backends.base import TaskBackend +from loguru import logger + + +class AnyIOTaskResult: + def __init__(self, scope): + self._scope = scope + self._status = "PENDING" + self._result = None + self._exception = None + + @property + def status(self) -> str: + if self._status == "DONE": + return "FAILURE" if self._exception is not None else "SUCCESS" + return self._status + + @property + def result(self) -> Any: + return self._result + + def ready(self) -> bool: + return self._status == "DONE" + + async def run(self, func, *args, **kwargs): + try: + self._result = await func(*args, **kwargs) + except Exception as e: + self._exception = e + finally: + self._status = "DONE" + + +class AnyIOBackend(TaskBackend): + name = "anyio" + + def __init__(self): + self.tasks = {} + + async def launch_task( + self, task_func: Callable[..., Any], *args: Any, **kwargs: Any + ) -> Tuple[Optional[str], Optional[AnyIOTaskResult]]: + """ + Launch a new task in an asynchronous manner. + + Parameters: + task_func: The asynchronous function to run. + *args: Positional arguments to pass to task_func. + **kwargs: Keyword arguments to pass to task_func. + + Returns: + A tuple containing a unique task ID and the task result object. + """ + async with anyio.create_task_group() as tg: + try: + task_result = AnyIOTaskResult(tg) + tg.start_soon(task_result.run, task_func, *args, **kwargs) + task_id = str(id(task_result)) + self.tasks[task_id] = task_result + logger.info(f"Task {task_id} started.") + return task_id, task_result + except Exception as e: + logger.error(f"An error occurred while launching the task: {e}") + return None, None + + def get_task(self, task_id: str) -> Any: + return self.tasks.get(task_id) diff --git a/src/backend/langflow/services/task/backends/base.py b/src/backend/langflow/services/task/backends/base.py new file mode 100644 index 000000000..ccbd9273b --- /dev/null +++ b/src/backend/langflow/services/task/backends/base.py @@ -0,0 +1,12 @@ +from abc import ABC, abstractmethod +from typing import Any, Callable + + +class TaskBackend(ABC): + @abstractmethod + def launch_task(self, task_func: Callable[..., Any], *args: Any, **kwargs: Any): + pass + + @abstractmethod + def get_task(self, task_id: str) -> Any: + pass diff --git a/src/backend/langflow/services/task/backends/celery.py b/src/backend/langflow/services/task/backends/celery.py new file mode 100644 index 000000000..eae985f3a --- /dev/null +++ b/src/backend/langflow/services/task/backends/celery.py @@ -0,0 +1,25 @@ +from typing import Any, Callable +from celery.result import AsyncResult # type: ignore +from langflow.services.task.backends.base import TaskBackend +from langflow.worker import celery_app + + +class CeleryBackend(TaskBackend): + name = "celery" + + def __init__(self): + self.celery_app = celery_app + + def launch_task( + self, task_func: Callable[..., Any], *args: Any, **kwargs: Any + ) -> tuple[str, AsyncResult]: + # I need to type the delay method to make it easier + from celery import Task # type: ignore + + if not hasattr(task_func, "delay"): + raise ValueError(f"Task function {task_func} does not have a delay method") + task: Task = task_func.delay(*args, **kwargs) + return task.id, AsyncResult(task.id, app=self.celery_app) + + def get_task(self, task_id: str) -> Any: + return AsyncResult(task_id, app=self.celery_app) diff --git a/src/backend/langflow/services/task/factory.py b/src/backend/langflow/services/task/factory.py new file mode 100644 index 000000000..efb6ac24d --- /dev/null +++ b/src/backend/langflow/services/task/factory.py @@ -0,0 +1,11 @@ +from langflow.services.task.manager import TaskService +from langflow.services.factory import ServiceFactory + + +class TaskServiceFactory(ServiceFactory): + def __init__(self): + super().__init__(TaskService) + + def create(self): + # Here you would have logic to create and configure a TaskService + return TaskService() diff --git a/src/backend/langflow/services/task/manager.py b/src/backend/langflow/services/task/manager.py new file mode 100644 index 000000000..807505c3a --- /dev/null +++ b/src/backend/langflow/services/task/manager.py @@ -0,0 +1,75 @@ +from typing import Any, Callable, Coroutine, Union +from langflow.utils.logger import configure +from loguru import logger +from langflow.services.base import Service +from langflow.services.task.backends.anyio import AnyIOBackend +from langflow.services.task.backends.base import TaskBackend +from langflow.services.task.utils import get_celery_worker_status + + +def check_celery_availability(): + try: + from langflow.worker import celery_app + + status = get_celery_worker_status(celery_app) + logger.debug(f"Celery status: {status}") + except Exception as exc: + logger.debug(f"Celery not available: {exc}") + status = {"availability": None} + return status + + +try: + configure() + status = check_celery_availability() + + USE_CELERY = status.get("availability") is not None +except ImportError: + USE_CELERY = False + + +class TaskService(Service): + name = "task_service" + + def __init__(self): + self.backend = self.get_backend() + self.use_celery = USE_CELERY + + @property + def backend_name(self) -> str: + return self.backend.name + + def get_backend(self) -> TaskBackend: + if USE_CELERY: + from langflow.services.task.backends.celery import CeleryBackend + + logger.debug("Using Celery backend") + return CeleryBackend() + logger.debug("Using AnyIO backend") + return AnyIOBackend() + + # In your TaskService class + async def launch_and_await_task( + self, + task_func: Callable[..., Any], + *args: Any, + **kwargs: Any, + ) -> Any: + if not self.use_celery: + return None, await task_func(*args, **kwargs) + if not hasattr(task_func, "apply"): + raise ValueError(f"Task function {task_func} does not have an apply method") + task = task_func.apply(args=args, kwargs=kwargs) + result = task.get() + return task.id, result + + async def launch_task( + self, task_func: Callable[..., Any], *args: Any, **kwargs: Any + ) -> Any: + logger.debug(f"Launching task {task_func} with args {args} and kwargs {kwargs}") + logger.debug(f"Using backend {self.backend}") + task = self.backend.launch_task(task_func, *args, **kwargs) + return await task if isinstance(task, Coroutine) else task + + def get_task(self, task_id: Union[int, str]) -> Any: + return self.backend.get_task(task_id) diff --git a/src/backend/langflow/services/task/utils.py b/src/backend/langflow/services/task/utils.py new file mode 100644 index 000000000..5dfb03b83 --- /dev/null +++ b/src/backend/langflow/services/task/utils.py @@ -0,0 +1,22 @@ +import contextlib +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + with contextlib.suppress(ImportError): + from celery import Celery # type: ignore + + +def get_celery_worker_status(app: "Celery"): + i = app.control.inspect() + availability = app.control.ping() + stats = i.stats() + registered_tasks = i.registered() + active_tasks = i.active() + scheduled_tasks = i.scheduled() + return { + "availability": availability, + "stats": stats, + "registered_tasks": registered_tasks, + "active_tasks": active_tasks, + "scheduled_tasks": scheduled_tasks, + } diff --git a/src/backend/langflow/services/utils.py b/src/backend/langflow/services/utils.py index 8b32aef02..adbf072fe 100644 --- a/src/backend/langflow/services/utils.py +++ b/src/backend/langflow/services/utils.py @@ -1,26 +1,217 @@ -from langflow.services import ServiceType, service_manager -from typing import TYPE_CHECKING, Generator +from langflow.services.auth.utils import create_super_user, verify_password +from langflow.services.database.utils import initialize_database +from langflow.services.manager import service_manager +from langflow.services.schema import ServiceType +from langflow.services.settings.constants import ( + DEFAULT_SUPERUSER, + DEFAULT_SUPERUSER_PASSWORD, +) +from sqlmodel import Session +from .getters import get_db_service, get_session, get_settings_service +from loguru import logger -if TYPE_CHECKING: - from langflow.services.database.manager import DatabaseManager - from langflow.services.settings.manager import SettingsManager - from langflow.services.chat.manager import ChatManager - from sqlmodel import Session +def get_factories_and_deps(): + from langflow.services.database import factory as database_factory + from langflow.services.cache import factory as cache_factory + from langflow.services.chat import factory as chat_factory + from langflow.services.settings import factory as settings_factory + from langflow.services.auth import factory as auth_factory + from langflow.services.task import factory as task_factory + from langflow.services.session import factory as session_service_factory # type: ignore + + return [ + (settings_factory.SettingsServiceFactory(), []), + ( + auth_factory.AuthServiceFactory(), + [ServiceType.SETTINGS_SERVICE], + ), + ( + database_factory.DatabaseServiceFactory(), + [ServiceType.SETTINGS_SERVICE], + ), + ( + cache_factory.CacheServiceFactory(), + [ServiceType.SETTINGS_SERVICE], + ), + (chat_factory.ChatServiceFactory(), []), + (task_factory.TaskServiceFactory(), []), + ( + session_service_factory.SessionServiceFactory(), + [ServiceType.CACHE_SERVICE], + ), + ] -def get_settings_manager() -> "SettingsManager": - return service_manager.get(ServiceType.SETTINGS_MANAGER) +def get_or_create_super_user(session: Session, username, password, is_default): + from langflow.services.database.models.user.user import User + + user = session.query(User).filter(User.username == username).first() + + if user and user.is_superuser: + return None # Superuser already exists + + if user and is_default: + if user.is_superuser: + if verify_password(password, user.password): + return None + else: + # Superuser exists but password is incorrect + # which means that the user has changed the + # base superuser credentials. + # This means that the user has already created + # a superuser and changed the password in the UI + # so we don't need to do anything. + logger.debug( + "Superuser exists but password is incorrect. " + "This means that the user has changed the " + "base superuser credentials." + ) + return None + else: + logger.debug( + "User with superuser credentials exists but is not a superuser." + ) + return None + + if user: + if verify_password(password, user.password): + raise ValueError( + "User with superuser credentials exists but is not a superuser." + ) + else: + raise ValueError("Incorrect superuser credentials") + + if is_default: + logger.debug("Creating default superuser.") + else: + logger.debug("Creating superuser.") + try: + return create_super_user(username, password, db=session) + except Exception as exc: + if "UNIQUE constraint failed: user.username" in str(exc): + # This is to deal with workers running this + # at startup and trying to create the superuser + # at the same time. + logger.debug("Superuser already exists.") + return None -def get_db_manager() -> "DatabaseManager": - return service_manager.get(ServiceType.DATABASE_MANAGER) +def setup_superuser(settings_service, session: Session): + if settings_service.auth_settings.AUTO_LOGIN: + logger.debug("AUTO_LOGIN is set to True. Creating default superuser.") + + username = settings_service.auth_settings.SUPERUSER + password = settings_service.auth_settings.SUPERUSER_PASSWORD + + is_default = (username == DEFAULT_SUPERUSER) and ( + password == DEFAULT_SUPERUSER_PASSWORD + ) + + try: + user = get_or_create_super_user( + session=session, username=username, password=password, is_default=is_default + ) + if user is not None: + logger.debug("Superuser created successfully.") + except Exception as exc: + logger.exception(exc) + raise RuntimeError( + "Could not create superuser. Please create a superuser manually." + ) from exc + finally: + settings_service.auth_settings.reset_credentials() -def get_session() -> Generator["Session", None, None]: - db_manager = service_manager.get(ServiceType.DATABASE_MANAGER) - yield from db_manager.get_session() +def teardown_superuser(settings_service, session): + """ + Teardown the superuser. + """ + # If AUTO_LOGIN is True, we will remove the default superuser + # from the database. + + if settings_service.auth_settings.AUTO_LOGIN: + try: + logger.debug("AUTO_LOGIN is set to True. Removing default superuser.") + username = settings_service.auth_settings.SUPERUSER + from langflow.services.database.models.user.user import User + + user = session.query(User).filter(User.username == username).first() + if user and user.is_superuser: + session.delete(user) + session.commit() + logger.debug("Default superuser removed successfully.") + else: + logger.debug("Default superuser not found.") + except Exception as exc: + logger.exception(exc) + raise RuntimeError("Could not remove default superuser.") from exc -def get_chat_manager() -> "ChatManager": - return service_manager.get(ServiceType.CHAT_MANAGER) +def teardown_services(): + """ + Teardown all the services. + """ + try: + teardown_superuser(get_settings_service(), next(get_session())) + except Exception as exc: + logger.exception(exc) + try: + service_manager.teardown() + except Exception as exc: + logger.exception(exc) + + +def initialize_settings_service(): + """ + Initialize the settings manager. + """ + from langflow.services.settings import factory as settings_factory + + service_manager.register_factory(settings_factory.SettingsServiceFactory()) + + +def initialize_session_service(): + """ + Initialize the session manager. + """ + from langflow.services.session import factory as session_service_factory # type: ignore + from langflow.services.cache import factory as cache_factory + + initialize_settings_service() + + service_manager.register_factory( + cache_factory.CacheServiceFactory(), dependencies=[ServiceType.SETTINGS_SERVICE] + ) + + service_manager.register_factory( + session_service_factory.SessionServiceFactory(), + dependencies=[ServiceType.CACHE_SERVICE], + ) + + +def initialize_services(): + """ + Initialize all the services needed. + """ + for factory, dependencies in get_factories_and_deps(): + try: + service_manager.register_factory(factory, dependencies=dependencies) + except Exception as exc: + logger.exception(exc) + raise RuntimeError( + "Could not initialize services. Please check your settings." + ) from exc + + # Test cache connection + service_manager.get(ServiceType.CACHE_SERVICE) + # Setup the superuser + initialize_database() + setup_superuser( + service_manager.get(ServiceType.SETTINGS_SERVICE), next(get_session()) + ) + try: + get_db_service().migrate_flows_if_auto_login() + except Exception as exc: + logger.error(f"Error migrating flows: {exc}") + raise RuntimeError("Error migrating flows") from exc diff --git a/src/backend/langflow/template/frontend_node/agents.py b/src/backend/langflow/template/frontend_node/agents.py index 63c8a4d5e..b3f9b4545 100644 --- a/src/backend/langflow/template/frontend_node/agents.py +++ b/src/backend/langflow/template/frontend_node/agents.py @@ -189,7 +189,7 @@ class InitializeAgentNode(FrontendNode): ), TemplateField( field_type="Tool", - required=False, + required=True, show=True, name="tools", is_list=True, diff --git a/src/backend/langflow/template/frontend_node/base.py b/src/backend/langflow/template/frontend_node/base.py index fe19b5652..442e2ffd7 100644 --- a/src/backend/langflow/template/frontend_node/base.py +++ b/src/backend/langflow/template/frontend_node/base.py @@ -140,13 +140,16 @@ class FrontendNode(BaseModel): @staticmethod def handle_dict_type(field: TemplateField, _type: str) -> str: """Handles 'dict' type by replacing it with 'code' or 'file' based on the field name.""" - if "dict" in _type.lower(): - if field.name == "dict_": - field.field_type = "file" - field.suffixes = [".json", ".yaml", ".yml"] - field.file_types = ["json", "yaml", "yml"] - else: - field.field_type = "code" + if "dict" in _type.lower() and field.name == "dict_": + field.field_type = "file" + field.suffixes = [".json", ".yaml", ".yml"] + field.file_types = ["json", "yaml", "yml"] + elif ( + _type.startswith("Dict") + or _type.startswith("Mapping") + or _type.startswith("dict") + ): + field.field_type = "dict" return _type @staticmethod @@ -240,20 +243,6 @@ class FrontendNode(BaseModel): "description", } - @staticmethod - def replace_dict_with_code_or_file( - field: TemplateField, _type: str, key: str - ) -> str: - """Replaces 'dict' type with 'code' or 'file'.""" - if "dict" in _type.lower(): - if key == "dict_": - field.field_type = "file" - field.suffixes = [".json", ".yaml", ".yml"] - field.file_types = ["json", "yaml", "yml"] - else: - field.field_type = "code" - return field.field_type - @staticmethod def set_field_default_value(field: TemplateField, value: dict, key: str) -> None: """Sets the field value with the default value if present.""" diff --git a/src/backend/langflow/template/frontend_node/constants.py b/src/backend/langflow/template/frontend_node/constants.py index 8800a3755..a213a2744 100644 --- a/src/backend/langflow/template/frontend_node/constants.py +++ b/src/backend/langflow/template/frontend_node/constants.py @@ -65,4 +65,11 @@ INPUT_KEY_INFO = """The variable to be used as Chat Input when more than one var OUTPUT_KEY_INFO = """The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)""" -CLASSES_TO_REMOVE = ["Serializable", "BaseModel", "object", "Runnable", "Generic"] +CLASSES_TO_REMOVE = [ + "RunnableSerializable", + "Serializable", + "BaseModel", + "object", + "Runnable", + "Generic", +] diff --git a/src/backend/langflow/template/frontend_node/documentloaders.py b/src/backend/langflow/template/frontend_node/documentloaders.py index cdf67e54a..0be2ebe98 100644 --- a/src/backend/langflow/template/frontend_node/documentloaders.py +++ b/src/backend/langflow/template/frontend_node/documentloaders.py @@ -170,11 +170,11 @@ class DocumentLoaderFrontNode(FrontendNode): # add a metadata field of type dict self.template.add_field( TemplateField( - field_type="code", - required=True, + field_type="dict", + required=False, show=True, name="metadata", - value="{}", + value={}, display_name="Metadata", multiline=False, ) diff --git a/src/backend/langflow/template/frontend_node/embeddings.py b/src/backend/langflow/template/frontend_node/embeddings.py index 4e7e25112..665328e78 100644 --- a/src/backend/langflow/template/frontend_node/embeddings.py +++ b/src/backend/langflow/template/frontend_node/embeddings.py @@ -89,7 +89,7 @@ class EmbeddingFrontendNode(FrontendNode): if field.name == "headers": field.show = False if field.name == "model_kwargs": - field.field_type = "code" + field.field_type = "dict" field.advanced = True field.show = True elif field.name in [ diff --git a/src/backend/langflow/template/frontend_node/formatter/field_formatters.py b/src/backend/langflow/template/frontend_node/formatter/field_formatters.py index 7987b134a..247f3b421 100644 --- a/src/backend/langflow/template/frontend_node/formatter/field_formatters.py +++ b/src/backend/langflow/template/frontend_node/formatter/field_formatters.py @@ -153,10 +153,13 @@ class DictCodeFileFormatter(FieldFormatter): key = field.name value = field.to_dict() _type = value["type"] - if "dict" in _type.lower(): - if key == "dict_": - field.field_type = "file" - field.suffixes = [".json", ".yaml", ".yml"] - field.file_types = ["json", "yaml", "yml"] - else: - field.field_type = "code" + if "dict" in _type.lower() and key == "dict_": + field.field_type = "file" + field.suffixes = [".json", ".yaml", ".yml"] + field.file_types = ["json", "yaml", "yml"] + elif ( + _type.startswith("Dict") + or _type.startswith("Mapping") + or _type.startswith("dict") + ): + field.field_type = "dict" diff --git a/src/backend/langflow/template/frontend_node/llms.py b/src/backend/langflow/template/frontend_node/llms.py index 01098724e..b8e007a27 100644 --- a/src/backend/langflow/template/frontend_node/llms.py +++ b/src/backend/langflow/template/frontend_node/llms.py @@ -131,7 +131,7 @@ class LLMFrontendNode(FrontendNode): if display_name := display_names_dict.get(field.name): field.display_name = display_name if field.name == "model_kwargs": - field.field_type = "code" + field.field_type = "dict" field.advanced = True field.show = True elif field.name in [ diff --git a/src/backend/langflow/template/frontend_node/prompts.py b/src/backend/langflow/template/frontend_node/prompts.py index c48628a8f..f0ebc35aa 100644 --- a/src/backend/langflow/template/frontend_node/prompts.py +++ b/src/backend/langflow/template/frontend_node/prompts.py @@ -15,6 +15,7 @@ from langflow.template.template.base import Template class PromptFrontendNode(FrontendNode): @staticmethod def format_field(field: TemplateField, name: Optional[str] = None) -> None: + FrontendNode.format_field(field, name) # if field.field_type == "StringPromptTemplate" # change it to str PROMPT_FIELDS = [ diff --git a/src/backend/langflow/template/frontend_node/utilities.py b/src/backend/langflow/template/frontend_node/utilities.py index 9dedacd0f..a5adb219d 100644 --- a/src/backend/langflow/template/frontend_node/utilities.py +++ b/src/backend/langflow/template/frontend_node/utilities.py @@ -21,5 +21,4 @@ class UtilitiesFrontendNode(FrontendNode): field.field_type = "str" if isinstance(field.value, dict): - field.field_type = "code" field.value = orjson_dumps(field.value) diff --git a/src/backend/langflow/template/frontend_node/vectorstores.py b/src/backend/langflow/template/frontend_node/vectorstores.py index 23c293437..73e9aaaca 100644 --- a/src/backend/langflow/template/frontend_node/vectorstores.py +++ b/src/backend/langflow/template/frontend_node/vectorstores.py @@ -56,7 +56,7 @@ class VectorStoreFrontendNode(FrontendNode): # Add search_kwargs field extra_field = TemplateField( name="search_kwargs", - field_type="code", + field_type="NestedDict", required=False, placeholder="", show=True, diff --git a/src/backend/langflow/utils/constants.py b/src/backend/langflow/utils/constants.py index e473d855b..0c97b56a2 100644 --- a/src/backend/langflow/utils/constants.py +++ b/src/backend/langflow/utils/constants.py @@ -48,4 +48,16 @@ def python_function(text: str) -> str: return text """ -DIRECT_TYPES = ["str", "bool", "code", "int", "float", "Any", "prompt"] + +PYTHON_BASIC_TYPES = [str, bool, int, float, tuple, list, dict, set] +DIRECT_TYPES = [ + "str", + "bool", + "dict", + "int", + "float", + "Any", + "prompt", + "code", + "NestedDict", +] diff --git a/src/backend/langflow/utils/logger.py b/src/backend/langflow/utils/logger.py index 1f616486b..b08621410 100644 --- a/src/backend/langflow/utils/logger.py +++ b/src/backend/langflow/utils/logger.py @@ -2,12 +2,42 @@ from typing import Optional from loguru import logger from pathlib import Path from rich.logging import RichHandler +import os +import orjson +import appdirs -def configure(log_level: str = "DEBUG", log_file: Optional[Path] = None): - log_format = "{time:HH:mm:ss} - {level: <8} - {message}" +VALID_LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] + + +def serialize(record): + subset = { + "timestamp": record["time"].timestamp(), + "message": record["message"], + "level": record["level"].name, + "module": record["module"], + } + return orjson.dumps(subset) + + +def patching(record): + record["extra"]["serialized"] = serialize(record) + + +def configure(log_level: Optional[str] = None, log_file: Optional[Path] = None): + if os.getenv("LANGFLOW_LOG_LEVEL") in VALID_LOG_LEVELS and log_level is None: + log_level = os.getenv("LANGFLOW_LOG_LEVEL") + if log_level is None: + log_level = "INFO" + # Human-readable + log_format = ( + "{time:YYYY-MM-DD HH:mm:ss} - " + "{level: <8} - {module} - {message}" + ) + + # log_format = log_format_dev if log_level.upper() == "DEBUG" else log_format_prod logger.remove() # Remove default handlers - + logger.patch(patching) # Configure loguru to use RichHandler logger.configure( handlers=[ @@ -19,17 +49,21 @@ def configure(log_level: str = "DEBUG", log_file: Optional[Path] = None): ] ) - if log_file: - log_file = Path(log_file) - log_file.parent.mkdir(parents=True, exist_ok=True) + if not log_file: + cache_dir = Path(appdirs.user_cache_dir("langflow")) + log_file = cache_dir / "langflow.log" - logger.add( - sink=str(log_file), - level=log_level.upper(), - format=log_format, - rotation="10 MB", # Log rotation based on file size - ) + log_file = Path(log_file) + log_file.parent.mkdir(parents=True, exist_ok=True) - logger.info(f"Logger set up with log level: {log_level}") + logger.add( + sink=str(log_file), + level=log_level.upper(), + format=log_format, + rotation="10 MB", # Log rotation based on file size + serialize=True, + ) + + logger.debug(f"Logger set up with log level: {log_level}") if log_file: logger.info(f"Log file: {log_file}") diff --git a/src/backend/langflow/utils/util.py b/src/backend/langflow/utils/util.py index 2c8f92ee1..bad123480 100644 --- a/src/backend/langflow/utils/util.py +++ b/src/backend/langflow/utils/util.py @@ -2,12 +2,17 @@ import re import inspect import importlib from functools import wraps -from typing import Optional, Dict, Any, Union +from typing import List, Optional, Dict, Any, Union from docstring_parser import parse from langflow.template.frontend_node.constants import FORCE_SHOW_FIELDS from langflow.utils import constants +from langchain.schema import Document + + +def remove_ansi_escape_codes(text): + return re.sub(r"\x1b\[[0-9;]*[a-zA-Z]", "", text) def build_template_from_function( @@ -275,8 +280,6 @@ def format_dict( value["password"] = is_password_field(key) value["multiline"] = is_multiline_field(key) - replace_dict_type_with_code(value) - if key == "dict_": set_dict_file_attributes(value) @@ -406,14 +409,6 @@ def is_multiline_field(key: str) -> bool: } -def replace_dict_type_with_code(value: Dict[str, Any]) -> None: - """ - Replaces the type value with 'code' if the type is a dict. - """ - if "dict" in value["type"].lower(): - value["type"] = "code" - - def set_dict_file_attributes(value: Dict[str, Any]) -> None: """ Sets the file attributes for the 'dict_' key. @@ -456,3 +451,12 @@ def add_options_to_field( value["options"] = options_map[class_name] value["list"] = True value["value"] = options_map[class_name][0] + + +def build_loader_repr_from_documents(documents: List[Document]) -> str: + if documents: + avg_length = sum(len(doc.page_content) for doc in documents) / len(documents) + return f"""{len(documents)} documents + \nAvg. Document Length (characters): {int(avg_length)} + Documents: {documents[:3]}...""" + return "0 documents" diff --git a/src/backend/langflow/worker.py b/src/backend/langflow/worker.py new file mode 100644 index 000000000..2eeba14a5 --- /dev/null +++ b/src/backend/langflow/worker.py @@ -0,0 +1,62 @@ +from langflow.core.celery_app import celery_app +from typing import Any, Dict, Optional +from typing import TYPE_CHECKING + +from celery.exceptions import SoftTimeLimitExceeded # type: ignore +from langflow.processing.process import ( + Result, + generate_result, + process_inputs, +) +from langflow.services.manager import initialize_session_service +from langflow.services.getters import get_session_service + +if TYPE_CHECKING: + from langflow.graph.vertex.base import Vertex + + +@celery_app.task(acks_late=True) +def test_celery(word: str) -> str: + return f"test task return {word}" + + +@celery_app.task(bind=True, soft_time_limit=30, max_retries=3) +def build_vertex(self, vertex: "Vertex") -> "Vertex": + """ + Build a vertex + """ + try: + vertex.task_id = self.request.id + vertex.build() + return vertex + except SoftTimeLimitExceeded as e: + raise self.retry( + exc=SoftTimeLimitExceeded("Task took too long"), countdown=2 + ) from e + + +@celery_app.task(acks_late=True) +def process_graph_cached_task( + data_graph: Dict[str, Any], + inputs: Optional[dict] = None, + clear_cache=False, + session_id=None, +) -> Dict[str, Any]: + initialize_session_service() + session_service = get_session_service() + if clear_cache: + session_service.clear_session(session_id) + if session_id is None: + session_id = session_service.generate_key( + session_id=session_id, data_graph=data_graph + ) + # Load the graph using SessionService + graph, artifacts = session_service.load_session(session_id, data_graph) + built_object = graph.build() + processed_inputs = process_inputs(inputs, artifacts) + result = generate_result(built_object, processed_inputs) + # langchain_object is now updated with the new memory + # we need to update the cache with the updated langchain_object + session_service.update_session(session_id, (graph, artifacts)) + + return Result(result=result, session_id=session_id).dict() diff --git a/src/frontend/.github/workflows/playwright.yml b/src/frontend/.github/workflows/playwright.yml new file mode 100644 index 000000000..90b6b700d --- /dev/null +++ b/src/frontend/.github/workflows/playwright.yml @@ -0,0 +1,27 @@ +name: Playwright Tests +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install dependencies + run: npm ci + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Run Playwright tests + run: npx playwright test + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 diff --git a/src/frontend/.gitignore b/src/frontend/.gitignore index 4d29575de..9ad9e7fb4 100644 --- a/src/frontend/.gitignore +++ b/src/frontend/.gitignore @@ -21,3 +21,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +/test-results/ +/playwright-report/ +/playwright/.cache/ diff --git a/src/frontend/Dockerfile b/src/frontend/Dockerfile index 010811e7b..024eab562 100644 --- a/src/frontend/Dockerfile +++ b/src/frontend/Dockerfile @@ -1,10 +1,16 @@ -FROM node:14-alpine as frontend_build -ARG BACKEND +FROM node:20-alpine as frontend_build +ARG BACKEND_URL WORKDIR /app -COPY . /app + +COPY ./package.json ./package-lock.json ./tsconfig.json ./vite.config.ts ./index.html ./tailwind.config.js ./postcss.config.js ./prettier.config.js /app/ RUN npm install +COPY ./src /app/src RUN npm run build FROM nginx COPY --from=frontend_build /app/build/ /usr/share/nginx/html -COPY /nginx.conf /etc/nginx/conf.d/default.conf \ No newline at end of file +COPY /nginx.conf /etc/nginx/conf.d/default.conf +COPY start-nginx.sh /start-nginx.sh +RUN chmod +x /start-nginx.sh +ENV BACKEND_URL=$BACKEND_URL +CMD ["/start-nginx.sh"] \ No newline at end of file diff --git a/src/frontend/harFiles/langflow.har b/src/frontend/harFiles/langflow.har new file mode 100644 index 000000000..2f73c3515 --- /dev/null +++ b/src/frontend/harFiles/langflow.har @@ -0,0 +1,229 @@ +{ + "log": { + "version": "1.2", + "creator": { + "name": "Playwright", + "version": "1.37.1" + }, + "browser": { + "name": "chromium", + "version": "116.0.5845.82" + }, + "entries": [ + { + "startedDateTime": "2023-08-31T14:55:35.502Z", + "time": 0.727, + "request": { + "method": "GET", + "url": "http://localhost:3000/api/v1/auto_login", + "httpVersion": "HTTP/1.1", + "cookies": [], + "headers": [ + { "name": "Accept", "value": "application/json, text/plain, */*" }, + { "name": "Accept-Encoding", "value": "gzip, deflate, br" }, + { "name": "Accept-Language", "value": "en-US,en;q=0.9" }, + { "name": "Connection", "value": "keep-alive" }, + { "name": "Host", "value": "localhost:3000" }, + { "name": "Referer", "value": "http://localhost:3000/" }, + { "name": "Sec-Fetch-Dest", "value": "empty" }, + { "name": "Sec-Fetch-Mode", "value": "cors" }, + { "name": "Sec-Fetch-Site", "value": "same-origin" }, + { "name": "User-Agent", "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" }, + { "name": "sec-ch-ua", "value": "\"Not)A;Brand\";v=\"24\", \"Chromium\";v=\"116\"" }, + { "name": "sec-ch-ua-mobile", "value": "?0" }, + { "name": "sec-ch-ua-platform", "value": "\"Linux\"" } + ], + "queryString": [], + "headersSize": -1, + "bodySize": -1 + }, + "response": { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "cookies": [], + "headers": [ + { "name": "Access-Control-Allow-Origin", "value": "*" }, + { "name": "connection", "value": "close" }, + { "name": "content-length", "value": "227" }, + { "name": "content-type", "value": "application/json" }, + { "name": "date", "value": "Thu, 31 Aug 2023 14:55:34 GMT" }, + { "name": "server", "value": "uvicorn" } + ], + "content": { + "size": -1, + "mimeType": "application/json", + "text": "{\"access_token\":\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiNWIxYjFhZC05M2VjLTRjMjgtYWMxNy01OGMxNDQ0MWI1ZGQiLCJleHAiOjE3MjUwMjk3MzV9.8qhEtryWqA9RbwEP2s20umKdVE7J7jHGoogXZqxLNWk\",\"refresh_token\":null,\"token_type\":\"bearer\"}" + }, + "headersSize": -1, + "bodySize": -1, + "redirectURL": "" + }, + "cache": {}, + "timings": { "send": -1, "wait": -1, "receive": 0.727 } + }, + { + "startedDateTime": "2023-08-31T14:55:35.586Z", + "time": 0.719, + "request": { + "method": "GET", + "url": "http://localhost:3000/api/v1/flows/", + "httpVersion": "HTTP/1.1", + "cookies": [], + "headers": [ + { "name": "Accept", "value": "application/json, text/plain, */*" }, + { "name": "Accept-Encoding", "value": "gzip, deflate, br" }, + { "name": "Accept-Language", "value": "en-US,en;q=0.9" }, + { "name": "Authorization", "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiNWIxYjFhZC05M2VjLTRjMjgtYWMxNy01OGMxNDQ0MWI1ZGQiLCJleHAiOjE3MjUwMjk3MzV9.8qhEtryWqA9RbwEP2s20umKdVE7J7jHGoogXZqxLNWk" }, + { "name": "Connection", "value": "keep-alive" }, + { "name": "Cookie", "value": "access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiNWIxYjFhZC05M2VjLTRjMjgtYWMxNy01OGMxNDQ0MWI1ZGQiLCJleHAiOjE3MjUwMjk3MzV9.8qhEtryWqA9RbwEP2s20umKdVE7J7jHGoogXZqxLNWk; refresh_token=auto" }, + { "name": "Host", "value": "localhost:3000" }, + { "name": "Referer", "value": "http://localhost:3000/" }, + { "name": "Sec-Fetch-Dest", "value": "empty" }, + { "name": "Sec-Fetch-Mode", "value": "cors" }, + { "name": "Sec-Fetch-Site", "value": "same-origin" }, + { "name": "User-Agent", "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" }, + { "name": "sec-ch-ua", "value": "\"Not)A;Brand\";v=\"24\", \"Chromium\";v=\"116\"" }, + { "name": "sec-ch-ua-mobile", "value": "?0" }, + { "name": "sec-ch-ua-platform", "value": "\"Linux\"" } + ], + "queryString": [], + "headersSize": -1, + "bodySize": -1 + }, + "response": { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "cookies": [], + "headers": [ + { "name": "Access-Control-Allow-Origin", "value": "*" }, + { "name": "connection", "value": "close" }, + { "name": "content-length", "value": "2" }, + { "name": "content-type", "value": "application/json" }, + { "name": "date", "value": "Thu, 31 Aug 2023 14:55:34 GMT" }, + { "name": "server", "value": "uvicorn" } + ], + "content": { + "size": -1, + "mimeType": "application/json", + "text": "[]" + }, + "headersSize": -1, + "bodySize": -1, + "redirectURL": "" + }, + "cache": {}, + "timings": { "send": -1, "wait": -1, "receive": 0.719 } + }, + { + "startedDateTime": "2023-08-31T14:55:35.586Z", + "time": 1.031, + "request": { + "method": "GET", + "url": "http://localhost:3000/api/v1/all", + "httpVersion": "HTTP/1.1", + "cookies": [], + "headers": [ + { "name": "Accept", "value": "application/json, text/plain, */*" }, + { "name": "Accept-Encoding", "value": "gzip, deflate, br" }, + { "name": "Accept-Language", "value": "en-US,en;q=0.9" }, + { "name": "Authorization", "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiNWIxYjFhZC05M2VjLTRjMjgtYWMxNy01OGMxNDQ0MWI1ZGQiLCJleHAiOjE3MjUwMjk3MzV9.8qhEtryWqA9RbwEP2s20umKdVE7J7jHGoogXZqxLNWk" }, + { "name": "Connection", "value": "keep-alive" }, + { "name": "Cookie", "value": "access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiNWIxYjFhZC05M2VjLTRjMjgtYWMxNy01OGMxNDQ0MWI1ZGQiLCJleHAiOjE3MjUwMjk3MzV9.8qhEtryWqA9RbwEP2s20umKdVE7J7jHGoogXZqxLNWk; refresh_token=auto" }, + { "name": "Host", "value": "localhost:3000" }, + { "name": "Referer", "value": "http://localhost:3000/" }, + { "name": "Sec-Fetch-Dest", "value": "empty" }, + { "name": "Sec-Fetch-Mode", "value": "cors" }, + { "name": "Sec-Fetch-Site", "value": "same-origin" }, + { "name": "User-Agent", "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" }, + { "name": "sec-ch-ua", "value": "\"Not)A;Brand\";v=\"24\", \"Chromium\";v=\"116\"" }, + { "name": "sec-ch-ua-mobile", "value": "?0" }, + { "name": "sec-ch-ua-platform", "value": "\"Linux\"" } + ], + "queryString": [], + "headersSize": -1, + "bodySize": -1 + }, + "response": { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "cookies": [], + "headers": [ + { "name": "Access-Control-Allow-Origin", "value": "*" }, + { "name": "connection", "value": "close" }, + { "name": "content-length", "value": "251307" }, + { "name": "content-type", "value": "application/json" }, + { "name": "date", "value": "Thu, 31 Aug 2023 14:55:34 GMT" }, + { "name": "server", "value": "uvicorn" } + ], + "content": { + "size": -1, + "mimeType": "application/json", + "text": "{\"chains\":{\"ConversationChain\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"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\":\"BaseMemory\",\"list\":false},\"output_parser\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":{\"_type\":\"default\"},\"password\":false,\"name\":\"output_parser\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLLMOutputParser\",\"list\":false},\"prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":{\"input_variables\":[\"history\",\"input\"],\"output_parser\":null,\"partial_variables\":{},\"template\":\"The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\\n\\nCurrent conversation:\\n{history}\\nHuman: {input}\\nAI:\",\"template_format\":\"f-string\",\"validate_template\":true,\"_type\":\"prompt\"},\"password\":false,\"name\":\"prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BasePromptTemplate\",\"list\":false},\"input_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"input\",\"password\":false,\"name\":\"input_key\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"llm_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"llm_kwargs\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"output_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"response\",\"password\":false,\"name\":\"output_key\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"return_final_only\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"return_final_only\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"ConversationChain\"},\"description\":\"Chain to have a conversation and load context from memory.\",\"base_classes\":[\"Chain\",\"LLMChain\",\"ConversationChain\",\"function\"],\"display_name\":\"ConversationChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"ConversationalRetrievalChain\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Callbacks\",\"list\":false},\"condense_question_llm\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"condense_question_llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"condense_question_prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":{\"input_variables\":[\"chat_history\",\"question\"],\"output_parser\":null,\"partial_variables\":{},\"template\":\"Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question, in its original language.\\n\\nChat History:\\n{chat_history}\\nFollow Up Input: {question}\\nStandalone question:\",\"template_format\":\"f-string\",\"validate_template\":true,\"_type\":\"prompt\"},\"password\":false,\"name\":\"condense_question_prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BasePromptTemplate\",\"list\":false},\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"memory\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseChatMemory\",\"list\":false},\"retriever\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"retriever\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseRetriever\",\"list\":false},\"chain_type\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"stuff\",\"password\":false,\"options\":[\"stuff\",\"map_reduce\",\"map_rerank\",\"refine\"],\"name\":\"chain_type\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"combine_docs_chain_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"combine_docs_chain_kwargs\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"return_source_documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"return_source_documents\",\"display_name\":\"Return source documents\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"ConversationalRetrievalChain\"},\"description\":\"Convenience method to load chain from LLM and retriever.\",\"base_classes\":[\"Chain\",\"BaseConversationalRetrievalChain\",\"ConversationalRetrievalChain\",\"function\"],\"display_name\":\"ConversationalRetrievalChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/chains/popular/chat_vector_db\",\"beta\":false,\"error\":null},\"LLMChain\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"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\":\"BaseMemory\",\"list\":false},\"output_parser\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"output_parser\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLLMOutputParser\",\"list\":false},\"prompt\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BasePromptTemplate\",\"list\":false},\"llm_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"llm_kwargs\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"output_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"text\",\"password\":false,\"name\":\"output_key\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"return_final_only\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"return_final_only\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"LLMChain\"},\"description\":\"Chain to run queries against LLMs.\",\"base_classes\":[\"Chain\",\"LLMChain\",\"function\"],\"display_name\":\"LLMChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/chains/foundational/llm_chain\",\"beta\":false,\"error\":null},\"LLMCheckerChain\":{\"template\":{\"check_assertions_prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":{\"input_variables\":[\"assertions\"],\"output_parser\":null,\"partial_variables\":{},\"template\":\"Here is a bullet point list of assertions:\\n{assertions}\\nFor each assertion, determine whether it is true or false. If it is false, explain why.\\n\\n\",\"template_format\":\"f-string\",\"validate_template\":true,\"_type\":\"prompt\"},\"password\":false,\"name\":\"check_assertions_prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"PromptTemplate\",\"list\":false},\"create_draft_answer_prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":{\"input_variables\":[\"question\"],\"output_parser\":null,\"partial_variables\":{},\"template\":\"{question}\\n\\n\",\"template_format\":\"f-string\",\"validate_template\":true,\"_type\":\"prompt\"},\"password\":false,\"name\":\"create_draft_answer_prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"PromptTemplate\",\"list\":false},\"list_assertions_prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":{\"input_variables\":[\"statement\"],\"output_parser\":null,\"partial_variables\":{},\"template\":\"Here is a statement:\\n{statement}\\nMake a bullet point list of the assumptions you made when producing the above statement.\\n\\n\",\"template_format\":\"f-string\",\"validate_template\":true,\"_type\":\"prompt\"},\"password\":false,\"name\":\"list_assertions_prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"PromptTemplate\",\"list\":false},\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"revised_answer_prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":{\"input_variables\":[\"checked_assertions\",\"question\"],\"output_parser\":null,\"partial_variables\":{},\"template\":\"{checked_assertions}\\n\\nQuestion: In light of the above assertions and checks, how would you answer the question '{question}'?\\n\\nAnswer:\",\"template_format\":\"f-string\",\"validate_template\":true,\"_type\":\"prompt\"},\"password\":false,\"name\":\"revised_answer_prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"PromptTemplate\",\"list\":false},\"_type\":\"LLMCheckerChain\"},\"description\":\"\",\"base_classes\":[\"Chain\",\"LLMCheckerChain\",\"function\"],\"display_name\":\"LLMCheckerChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/chains/additional/llm_checker\",\"beta\":false,\"error\":null},\"LLMMathChain\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"llm_chain\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm_chain\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"LLMChain\",\"list\":false},\"memory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseMemory\",\"list\":false},\"prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":{\"input_variables\":[\"question\"],\"output_parser\":null,\"partial_variables\":{},\"template\":\"Translate a math problem into a expression that can be executed using Python's numexpr library. Use the output of running this code to answer the question.\\n\\nQuestion: ${{Question with math problem.}}\\n```text\\n${{single line mathematical expression that solves the problem}}\\n```\\n...numexpr.evaluate(text)...\\n```output\\n${{Output of running the code}}\\n```\\nAnswer: ${{Answer}}\\n\\nBegin.\\n\\nQuestion: What is 37593 * 67?\\n```text\\n37593 * 67\\n```\\n...numexpr.evaluate(\\\"37593 * 67\\\")...\\n```output\\n2518731\\n```\\nAnswer: 2518731\\n\\nQuestion: 37593^(1/5)\\n```text\\n37593**(1/5)\\n```\\n...numexpr.evaluate(\\\"37593**(1/5)\\\")...\\n```output\\n8.222831614237718\\n```\\nAnswer: 8.222831614237718\\n\\nQuestion: {question}\\n\",\"template_format\":\"f-string\",\"validate_template\":true,\"_type\":\"prompt\"},\"password\":false,\"name\":\"prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BasePromptTemplate\",\"list\":false},\"input_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"question\",\"password\":false,\"name\":\"input_key\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"output_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"answer\",\"password\":false,\"name\":\"output_key\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"LLMMathChain\"},\"description\":\"Chain that interprets a prompt and executes python code to do math.\",\"base_classes\":[\"Chain\",\"LLMMathChain\",\"function\"],\"display_name\":\"LLMMathChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/chains/additional/llm_math\",\"beta\":false,\"error\":null},\"RetrievalQA\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"combine_documents_chain\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"combine_documents_chain\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseCombineDocumentsChain\",\"list\":false},\"memory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseMemory\",\"list\":false},\"retriever\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"retriever\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseRetriever\",\"list\":false},\"input_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"query\",\"password\":false,\"name\":\"input_key\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"output_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"result\",\"password\":false,\"name\":\"output_key\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"return_source_documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"return_source_documents\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"RetrievalQA\"},\"description\":\"Chain for question-answering against an index.\",\"base_classes\":[\"Chain\",\"BaseRetrievalQA\",\"RetrievalQA\",\"function\"],\"display_name\":\"RetrievalQA\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/chains/popular/vector_db_qa\",\"beta\":false,\"error\":null},\"RetrievalQAWithSourcesChain\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"combine_documents_chain\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"combine_documents_chain\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseCombineDocumentsChain\",\"list\":false},\"memory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseMemory\",\"list\":false},\"retriever\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"retriever\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseRetriever\",\"list\":false},\"answer_key\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"answer\",\"password\":false,\"name\":\"answer_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"input_docs_key\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"docs\",\"password\":false,\"name\":\"input_docs_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"max_tokens_limit\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":3375,\"password\":false,\"name\":\"max_tokens_limit\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"question_key\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"question\",\"password\":false,\"name\":\"question_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"reduce_k_below_max_tokens\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"reduce_k_below_max_tokens\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"return_source_documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"return_source_documents\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"sources_answer_key\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"sources\",\"password\":false,\"name\":\"sources_answer_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"RetrievalQAWithSourcesChain\"},\"description\":\"Question-answering with sources over an index.\",\"base_classes\":[\"Chain\",\"RetrievalQAWithSourcesChain\",\"BaseQAWithSourcesChain\",\"function\"],\"display_name\":\"RetrievalQAWithSourcesChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"SQLDatabaseChain\":{\"template\":{\"db\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"db\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"SQLDatabase\",\"list\":false},\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"prompt\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BasePromptTemplate\",\"list\":false},\"_type\":\"SQLDatabaseChain\"},\"description\":\"\",\"base_classes\":[\"Chain\",\"SQLDatabaseChain\",\"function\"],\"display_name\":\"SQLDatabaseChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"CombineDocsChain\":{\"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},\"chain_type\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"stuff\",\"password\":false,\"options\":[\"stuff\",\"map_reduce\",\"map_rerank\",\"refine\"],\"name\":\"chain_type\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"_type\":\"load_qa_chain\"},\"description\":\"Load question answering chain.\",\"base_classes\":[\"BaseCombineDocumentsChain\",\"function\"],\"display_name\":\"CombineDocsChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"SeriesCharacterChain\":{\"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},\"character\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"character\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"series\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"series\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"SeriesCharacterChain\"},\"description\":\"SeriesCharacterChain is a chain you can use to have a conversation with a character from a series.\",\"base_classes\":[\"LLMChain\",\"BaseCustomChain\",\"Chain\",\"ConversationChain\",\"SeriesCharacterChain\",\"function\"],\"display_name\":\"SeriesCharacterChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"MidJourneyPromptChain\":{\"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},\"_type\":\"MidJourneyPromptChain\"},\"description\":\"MidJourneyPromptChain is a chain you can use to generate new MidJourney prompts.\",\"base_classes\":[\"LLMChain\",\"BaseCustomChain\",\"Chain\",\"ConversationChain\",\"MidJourneyPromptChain\"],\"display_name\":\"MidJourneyPromptChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"TimeTravelGuideChain\":{\"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},\"_type\":\"TimeTravelGuideChain\"},\"description\":\"Time travel guide chain.\",\"base_classes\":[\"LLMChain\",\"BaseCustomChain\",\"TimeTravelGuideChain\",\"Chain\",\"ConversationChain\"],\"display_name\":\"TimeTravelGuideChain\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"PromptRunner\":{\"template\":{\"code\":{\"dynamic\":true,\"required\":true,\"placeholder\":\"\",\"show\":false,\"multiline\":true,\"value\":\"from langflow import CustomComponent\\n\\nfrom langchain.llms.base import BaseLLM\\nfrom langchain import PromptTemplate\\nfrom langchain.schema import Document\\n\\n\\nclass PromptRunner(CustomComponent):\\n display_name: str = \\\"Prompt Runner\\\"\\n description: str = \\\"Run a Chain with the given PromptTemplate\\\"\\n beta = True\\n field_config = {\\n \\\"llm\\\": {\\\"display_name\\\": \\\"LLM\\\"},\\n \\\"prompt\\\": {\\n \\\"display_name\\\": \\\"Prompt Template\\\",\\n \\\"info\\\": \\\"Make sure the prompt has all variables filled.\\\",\\n },\\n \\\"code\\\": {\\\"show\\\": False},\\n \\\"inputs\\\": {\\\"field_type\\\": \\\"code\\\"},\\n }\\n\\n def build(\\n self,\\n llm: BaseLLM,\\n prompt: PromptTemplate,\\n ) -> Document:\\n chain = prompt | llm\\n # The input is an empty dict because the prompt is already filled\\n result = chain.invoke({})\\n if hasattr(result, \\\"content\\\"):\\n result = result.content\\n self.repr_value = result\\n return Document(page_content=str(result))\\n\",\"password\":false,\"name\":\"code\",\"advanced\":false,\"type\":\"code\",\"list\":false},\"_type\":\"CustomComponent\",\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"display_name\":\"LLM\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLLM\",\"list\":false},\"prompt\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"prompt\",\"display_name\":\"Prompt Template\",\"advanced\":false,\"dynamic\":false,\"info\":\"Make sure the prompt has all variables filled.\",\"type\":\"PromptTemplate\",\"list\":false}},\"description\":\"Run a Chain with the given PromptTemplate\",\"base_classes\":[\"Document\"],\"display_name\":\"Prompt Runner\",\"custom_fields\":{\"llm\":null,\"prompt\":null},\"output_types\":[\"PromptRunner\"],\"documentation\":\"\",\"beta\":true,\"error\":null}},\"agents\":{\"ZeroShotAgent\":{\"template\":{\"callback_manager\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callback_manager\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseCallbackManager\",\"list\":false},\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"output_parser\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"output_parser\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"AgentOutputParser\",\"list\":false},\"tools\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"tools\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseTool\",\"list\":true},\"format_instructions\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":true,\"value\":\"Use the following format:\\n\\nQuestion: the input question you must answer\\nThought: you should always think about what to do\\nAction: the action to take, should be one of [{tool_names}]\\nAction Input: the input to the action\\nObservation: the result of the action\\n... (this Thought/Action/Action Input/Observation can repeat N times)\\nThought: I now know the final answer\\nFinal Answer: the final answer to the original input question\",\"password\":false,\"name\":\"format_instructions\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"input_variables\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"input_variables\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"Answer the following questions as best you can. You have access to the following tools:\",\"password\":false,\"name\":\"prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"suffix\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"Begin!\\n\\nQuestion: {input}\\nThought:{agent_scratchpad}\",\"password\":false,\"name\":\"suffix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"ZeroShotAgent\"},\"description\":\"Construct an agent from an LLM and tools.\",\"base_classes\":[\"ZeroShotAgent\",\"BaseSingleActionAgent\",\"Agent\",\"function\"],\"display_name\":\"ZeroShotAgent\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/agents/how_to/custom_mrkl_agent\",\"beta\":false,\"error\":null},\"JsonAgent\":{\"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},\"toolkit\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"toolkit\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseToolkit\",\"list\":false},\"_type\":\"json_agent\"},\"description\":\"Construct a json agent from an LLM and tools.\",\"base_classes\":[\"AgentExecutor\"],\"display_name\":\"JsonAgent\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/agents/toolkits/openapi\",\"beta\":false,\"error\":null},\"CSVAgent\":{\"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},\"path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".csv\"],\"password\":false,\"name\":\"path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"csv\"],\"file_path\":null},\"_type\":\"csv_agent\"},\"description\":\"Construct a CSV agent from a CSV and tools.\",\"base_classes\":[\"AgentExecutor\"],\"display_name\":\"CSVAgent\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/agents/toolkits/csv\",\"beta\":false,\"error\":null},\"AgentInitializer\":{\"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\":false,\"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},\"VectorStoreAgent\":{\"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},\"vectorstoreinfo\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"vectorstoreinfo\",\"display_name\":\"Vector Store Info\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"VectorStoreInfo\",\"list\":false},\"_type\":\"vectorstore_agent\"},\"description\":\"Construct an agent from a Vector Store.\",\"base_classes\":[\"AgentExecutor\"],\"display_name\":\"VectorStoreAgent\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"VectorStoreRouterAgent\":{\"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},\"vectorstoreroutertoolkit\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"vectorstoreroutertoolkit\",\"display_name\":\"Vector Store Router Toolkit\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"VectorStoreRouterToolkit\",\"list\":false},\"_type\":\"vectorstorerouter_agent\"},\"description\":\"Construct an agent from a Vector Store Router.\",\"base_classes\":[\"AgentExecutor\"],\"display_name\":\"VectorStoreRouterAgent\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"SQLAgent\":{\"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},\"database_uri\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"database_uri\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"sql_agent\"},\"description\":\"Construct an SQL agent from an LLM and tools.\",\"base_classes\":[\"AgentExecutor\"],\"display_name\":\"SQLAgent\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"OpenAIConversationalAgent\":{\"template\":{\"code\":{\"dynamic\":true,\"required\":true,\"placeholder\":\"\",\"show\":false,\"multiline\":true,\"value\":\"from langflow import CustomComponent\\nfrom typing import Optional\\nfrom langchain.prompts import SystemMessagePromptTemplate\\nfrom langchain.tools import Tool\\nfrom langchain.schema.memory import BaseMemory\\nfrom langchain.chat_models import ChatOpenAI\\n\\nfrom langchain.agents.agent import AgentExecutor\\nfrom langchain.agents.openai_functions_agent.base import OpenAIFunctionsAgent\\nfrom langchain.memory.token_buffer import ConversationTokenBufferMemory\\nfrom langchain.prompts.chat import MessagesPlaceholder\\nfrom langchain.agents.agent_toolkits.conversational_retrieval.openai_functions import (\\n _get_default_system_message,\\n)\\n\\n\\nclass ConversationalAgent(CustomComponent):\\n display_name: str = \\\"OpenAI Conversational Agent\\\"\\n description: str = \\\"Conversational Agent that can use OpenAI's function calling API\\\"\\n\\n def build_config(self):\\n openai_function_models = [\\n \\\"gpt-3.5-turbo-0613\\\",\\n \\\"gpt-3.5-turbo-16k-0613\\\",\\n \\\"gpt-4-0613\\\",\\n \\\"gpt-4-32k-0613\\\",\\n ]\\n return {\\n \\\"tools\\\": {\\\"is_list\\\": True, \\\"display_name\\\": \\\"Tools\\\"},\\n \\\"memory\\\": {\\\"display_name\\\": \\\"Memory\\\"},\\n \\\"system_message\\\": {\\\"display_name\\\": \\\"System Message\\\"},\\n \\\"max_token_limit\\\": {\\\"display_name\\\": \\\"Max Token Limit\\\"},\\n \\\"model_name\\\": {\\n \\\"display_name\\\": \\\"Model Name\\\",\\n \\\"options\\\": openai_function_models,\\n \\\"value\\\": openai_function_models[0],\\n },\\n \\\"code\\\": {\\\"show\\\": False},\\n }\\n\\n def build(\\n self,\\n model_name: str,\\n openai_api_key: str,\\n openai_api_base: str,\\n tools: Tool,\\n memory: Optional[BaseMemory] = None,\\n system_message: Optional[SystemMessagePromptTemplate] = None,\\n max_token_limit: int = 2000,\\n ) -> AgentExecutor:\\n llm = ChatOpenAI(\\n model=model_name,\\n openai_api_key=openai_api_key,\\n openai_api_base=openai_api_base,\\n )\\n if not memory:\\n memory_key = \\\"chat_history\\\"\\n memory = ConversationTokenBufferMemory(\\n memory_key=memory_key,\\n return_messages=True,\\n output_key=\\\"output\\\",\\n llm=llm,\\n max_token_limit=max_token_limit,\\n )\\n else:\\n memory_key = memory.memory_key # type: ignore\\n\\n _system_message = system_message or _get_default_system_message()\\n prompt = OpenAIFunctionsAgent.create_prompt(\\n system_message=_system_message, # type: ignore\\n extra_prompt_messages=[MessagesPlaceholder(variable_name=memory_key)],\\n )\\n agent = OpenAIFunctionsAgent(\\n llm=llm, tools=tools, prompt=prompt # type: ignore\\n )\\n return AgentExecutor(\\n agent=agent,\\n tools=tools, # type: ignore\\n memory=memory,\\n verbose=True,\\n return_intermediate_steps=True,\\n )\\n\",\"password\":false,\"name\":\"code\",\"advanced\":false,\"type\":\"code\",\"list\":false},\"_type\":\"CustomComponent\",\"max_token_limit\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":2000,\"password\":false,\"name\":\"max_token_limit\",\"display_name\":\"Max Token Limit\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"memory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"memory\",\"display_name\":\"Memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseMemory\",\"list\":false},\"model_name\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"gpt-3.5-turbo-0613\",\"password\":false,\"options\":[\"gpt-3.5-turbo-0613\",\"gpt-3.5-turbo-16k-0613\",\"gpt-4-0613\",\"gpt-4-32k-0613\"],\"name\":\"model_name\",\"display_name\":\"Model Name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"openai_api_base\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"openai_api_base\",\"display_name\":\"openai_api_base\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"openai_api_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"openai_api_key\",\"display_name\":\"openai_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"system_message\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"system_message\",\"display_name\":\"System Message\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"SystemMessagePromptTemplate\",\"list\":false},\"tools\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"tools\",\"display_name\":\"Tools\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Tool\",\"list\":true}},\"description\":\"Conversational Agent that can use OpenAI's function calling API\",\"base_classes\":[\"AgentExecutor\",\"Chain\"],\"display_name\":\"OpenAI Conversational Agent\",\"custom_fields\":{\"max_token_limit\":null,\"memory\":null,\"model_name\":null,\"openai_api_base\":null,\"openai_api_key\":null,\"system_message\":null,\"tools\":null},\"output_types\":[\"OpenAIConversationalAgent\"],\"documentation\":\"\",\"beta\":true,\"error\":null}},\"prompts\":{\"ChatMessagePromptTemplate\":{\"template\":{\"additional_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"additional_kwargs\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"prompt\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"\\nYou are a helpful assistant that talks casually about life in general.\\nYou are a good listener and you can talk about anything.\\n\",\"password\":false,\"name\":\"prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"prompt\",\"list\":false},\"role\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"role\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"ChatMessagePromptTemplate\"},\"description\":\"Chat message prompt template.\",\"base_classes\":[\"ChatMessagePromptTemplate\",\"BaseStringMessagePromptTemplate\",\"BaseMessagePromptTemplate\"],\"display_name\":\"ChatMessagePromptTemplate\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/msg_prompt_templates\",\"beta\":false,\"error\":null},\"ChatPromptTemplate\":{\"template\":{\"messages\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"messages\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseMessagePromptTemplate\",\"list\":true},\"output_parser\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"output_parser\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseOutputParser\",\"list\":false},\"input_variables\":{\"required\":true,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"input_variables\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"partial_variables\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"partial_variables\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"ChatPromptTemplate\"},\"description\":\"A prompt template for chat models.\",\"base_classes\":[\"BasePromptTemplate\",\"ChatPromptTemplate\",\"BaseChatPromptTemplate\"],\"display_name\":\"ChatPromptTemplate\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/chat/how_to/prompts\",\"beta\":false,\"error\":null},\"HumanMessagePromptTemplate\":{\"template\":{\"additional_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"additional_kwargs\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"prompt\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"\\nYou are a helpful assistant that talks casually about life in general.\\nYou are a good listener and you can talk about anything.\\n\",\"password\":false,\"name\":\"prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"prompt\",\"list\":false},\"_type\":\"HumanMessagePromptTemplate\"},\"description\":\"Human message prompt template. This is a message that is sent to the user.\",\"base_classes\":[\"HumanMessagePromptTemplate\",\"BaseStringMessagePromptTemplate\",\"BaseMessagePromptTemplate\"],\"display_name\":\"HumanMessagePromptTemplate\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/chat/how_to/prompts\",\"beta\":false,\"error\":null},\"PromptTemplate\":{\"template\":{\"output_parser\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"output_parser\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseOutputParser\",\"list\":false},\"input_variables\":{\"required\":true,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"input_variables\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"partial_variables\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"partial_variables\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"template\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"password\":false,\"name\":\"template\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"prompt\",\"list\":false},\"template_format\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"f-string\",\"password\":false,\"name\":\"template_format\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"validate_template\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"validate_template\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"PromptTemplate\"},\"description\":\"A prompt template for a language model.\",\"base_classes\":[\"BasePromptTemplate\",\"StringPromptTemplate\",\"PromptTemplate\"],\"display_name\":\"PromptTemplate\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/\",\"beta\":false,\"error\":null},\"SystemMessagePromptTemplate\":{\"template\":{\"additional_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"additional_kwargs\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"prompt\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"\\nYou are a helpful assistant that talks casually about life in general.\\nYou are a good listener and you can talk about anything.\\n\",\"password\":false,\"name\":\"prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"prompt\",\"list\":false},\"_type\":\"SystemMessagePromptTemplate\"},\"description\":\"System message prompt template.\",\"base_classes\":[\"SystemMessagePromptTemplate\",\"BaseStringMessagePromptTemplate\",\"BaseMessagePromptTemplate\"],\"display_name\":\"SystemMessagePromptTemplate\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/chat/how_to/prompts\",\"beta\":false,\"error\":null}},\"llms\":{\"Anthropic\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"count_tokens\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"count_tokens\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Callable[[str], int]\",\"list\":false},\"AI_PROMPT\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"AI_PROMPT\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"HUMAN_PROMPT\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"HUMAN_PROMPT\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"anthropic_api_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"anthropic_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"anthropic_api_url\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"anthropic_api_url\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"async_client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"async_client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"cache\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"cache\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"default_request_timeout\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"default_request_timeout\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"max_tokens_to_sample\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":256,\"password\":false,\"name\":\"max_tokens_to_sample\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"claude-2\",\"password\":false,\"name\":\"model\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"model_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"streaming\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"streaming\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"temperature\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"temperature\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"top_k\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"top_k\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"top_p\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"top_p\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"Anthropic\"},\"description\":\"Anthropic large language models.\",\"base_classes\":[\"_AnthropicCommon\",\"Anthropic\",\"BaseLanguageModel\",\"BaseLLM\",\"LLM\"],\"display_name\":\"Anthropic\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"Cohere\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"async_client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"async_client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"cache\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"cache\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"cohere_api_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"cohere_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"frequency_penalty\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":0.0,\"password\":false,\"name\":\"frequency_penalty\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"k\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":0,\"password\":false,\"name\":\"k\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"max_retries\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":10,\"password\":false,\"name\":\"max_retries\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"max_tokens\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":256,\"password\":true,\"name\":\"max_tokens\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"model\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"p\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":1,\"password\":false,\"name\":\"p\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"presence_penalty\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":0.0,\"password\":false,\"name\":\"presence_penalty\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"stop\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"stop\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"temperature\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.75,\"password\":false,\"name\":\"temperature\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"truncate\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"truncate\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"Cohere\"},\"description\":\"Cohere large language models.\",\"base_classes\":[\"Cohere\",\"BaseLanguageModel\",\"BaseLLM\",\"LLM\"],\"display_name\":\"Cohere\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/llms/integrations/cohere\",\"beta\":false,\"error\":null},\"CTransformers\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"cache\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"cache\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"config\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{\\n \\\"top_k\\\": 40,\\n \\\"top_p\\\": 0.95,\\n \\\"temperature\\\": 0.8,\\n \\\"repetition_penalty\\\": 1.1,\\n \\\"last_n_tokens\\\": 64,\\n \\\"seed\\\": -1,\\n \\\"max_new_tokens\\\": 256,\\n \\\"stop\\\": null,\\n \\\"stream\\\": false,\\n \\\"reset\\\": true,\\n \\\"batch_size\\\": 8,\\n \\\"threads\\\": -1,\\n \\\"context_length\\\": -1,\\n \\\"gpu_layers\\\": 0\\n}\",\"password\":false,\"name\":\"config\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"lib\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"lib\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"model_file\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_file\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"model_type\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_type\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"CTransformers\"},\"description\":\"C Transformers LLM models.\",\"base_classes\":[\"BaseLanguageModel\",\"BaseLLM\",\"CTransformers\",\"LLM\"],\"display_name\":\"CTransformers\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/llms/integrations/ctransformers\",\"beta\":false,\"error\":null},\"HuggingFaceHub\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"cache\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"cache\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"huggingfacehub_api_token\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"huggingfacehub_api_token\",\"display_name\":\"HuggingFace Hub API Token\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"repo_id\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"gpt2\",\"password\":false,\"name\":\"repo_id\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"task\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"text-generation\",\"password\":false,\"options\":[\"text-generation\",\"text2text-generation\",\"summarization\"],\"name\":\"task\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"HuggingFaceHub\"},\"description\":\"HuggingFaceHub models.\",\"base_classes\":[\"HuggingFaceHub\",\"BaseLanguageModel\",\"BaseLLM\",\"LLM\"],\"display_name\":\"HuggingFaceHub\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/llms/integrations/huggingface_hub\",\"beta\":false,\"error\":null},\"LlamaCpp\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"cache\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"cache\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"echo\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"echo\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"f16_kv\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"f16_kv\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"last_n_tokens_size\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":64,\"password\":false,\"name\":\"last_n_tokens_size\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"logits_all\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"logits_all\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"logprobs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"logprobs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"lora_base\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"lora_base\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"lora_path\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"lora_path\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"max_tokens\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":256,\"password\":true,\"name\":\"max_tokens\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"n_batch\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":8,\"password\":false,\"name\":\"n_batch\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"n_ctx\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":512,\"password\":false,\"name\":\"n_ctx\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"n_gpu_layers\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"n_gpu_layers\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"n_parts\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":-1,\"password\":false,\"name\":\"n_parts\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"n_threads\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"n_threads\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"repeat_penalty\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":1.1,\"password\":false,\"name\":\"repeat_penalty\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"rope_freq_base\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":10000.0,\"password\":false,\"name\":\"rope_freq_base\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"rope_freq_scale\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":1.0,\"password\":false,\"name\":\"rope_freq_scale\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"seed\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":-1,\"password\":false,\"name\":\"seed\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"stop\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"stop\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"streaming\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"streaming\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"suffix\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"password\":false,\"name\":\"suffix\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"temperature\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.8,\"password\":false,\"name\":\"temperature\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"top_k\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":40,\"password\":false,\"name\":\"top_k\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"top_p\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.95,\"password\":false,\"name\":\"top_p\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"use_mlock\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"use_mlock\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"use_mmap\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"use_mmap\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"verbose\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"vocab_only\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"vocab_only\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"LlamaCpp\"},\"description\":\"llama.cpp model.\",\"base_classes\":[\"BaseLanguageModel\",\"BaseLLM\",\"LlamaCpp\",\"LLM\"],\"display_name\":\"LlamaCpp\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/llms/integrations/llamacpp\",\"beta\":false,\"error\":null},\"OpenAI\":{\"template\":{\"allowed_special\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":[],\"password\":false,\"name\":\"allowed_special\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Literal'all'\",\"list\":true},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"disallowed_special\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"all\",\"password\":false,\"name\":\"disallowed_special\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Literal'all'\",\"list\":false},\"batch_size\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":20,\"password\":false,\"name\":\"batch_size\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"best_of\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":1,\"password\":false,\"name\":\"best_of\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"cache\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"cache\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"frequency_penalty\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":0,\"password\":false,\"name\":\"frequency_penalty\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"logit_bias\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"logit_bias\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"max_retries\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":6,\"password\":false,\"name\":\"max_retries\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"max_tokens\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":256,\"password\":true,\"name\":\"max_tokens\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"text-davinci-003\",\"password\":false,\"options\":[\"text-davinci-003\",\"text-davinci-002\",\"text-curie-001\",\"text-babbage-001\",\"text-ada-001\"],\"name\":\"model_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"n\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":1,\"password\":false,\"name\":\"n\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"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,\"dynamic\":false,\"info\":\"\\nThe base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\\n\\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.\\n\",\"type\":\"str\",\"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,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"openai_organization\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"openai_organization\",\"display_name\":\"OpenAI Organization\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"openai_proxy\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"openai_proxy\",\"display_name\":\"OpenAI Proxy\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"presence_penalty\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":0,\"password\":false,\"name\":\"presence_penalty\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"request_timeout\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"request_timeout\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"streaming\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"streaming\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"temperature\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.7,\"password\":false,\"name\":\"temperature\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"tiktoken_model_name\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tiktoken_model_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"top_p\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":1,\"password\":false,\"name\":\"top_p\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"OpenAI\"},\"description\":\"OpenAI large language models.\",\"base_classes\":[\"OpenAI\",\"BaseLanguageModel\",\"BaseLLM\",\"BaseOpenAI\"],\"display_name\":\"OpenAI\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/llms/integrations/openai\",\"beta\":false,\"error\":null},\"VertexAI\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"ForwardRef(\\\"'_LanguageModel'\\\")\",\"list\":false},\"credentials\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".json\"],\"password\":false,\"name\":\"credentials\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"json\"],\"file_path\":null},\"cache\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"cache\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"location\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"us-central1\",\"password\":false,\"name\":\"location\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"max_output_tokens\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":128,\"password\":false,\"name\":\"max_output_tokens\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"max_retries\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":6,\"password\":false,\"name\":\"max_retries\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"text-bison\",\"password\":false,\"name\":\"model_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"project\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"project\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"request_parallelism\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":5,\"password\":false,\"name\":\"request_parallelism\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"stop\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"stop\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"temperature\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.0,\"password\":false,\"name\":\"temperature\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"top_k\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":40,\"password\":false,\"name\":\"top_k\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"top_p\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.95,\"password\":false,\"name\":\"top_p\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"tuned_model_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"tuned_model_name\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"VertexAI\"},\"description\":\"Google Vertex AI large language models.\",\"base_classes\":[\"BaseLanguageModel\",\"BaseLLM\",\"VertexAI\",\"_VertexAICommon\",\"LLM\"],\"display_name\":\"VertexAI\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/llms/integrations/google_vertex_ai_palm\",\"beta\":false,\"error\":null},\"ChatAnthropic\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"count_tokens\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"count_tokens\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Callable[[str], int]\",\"list\":false},\"AI_PROMPT\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"AI_PROMPT\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"HUMAN_PROMPT\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"HUMAN_PROMPT\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"anthropic_api_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"anthropic_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"anthropic_api_url\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"anthropic_api_url\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"async_client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"async_client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"cache\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"cache\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"default_request_timeout\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"default_request_timeout\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"max_tokens_to_sample\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":256,\"password\":false,\"name\":\"max_tokens_to_sample\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"claude-2\",\"password\":false,\"name\":\"model\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"model_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"streaming\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"streaming\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"temperature\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"temperature\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"top_k\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"top_k\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"top_p\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"top_p\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"ChatAnthropic\"},\"description\":\"`Anthropic` chat large language models.\",\"base_classes\":[\"_AnthropicCommon\",\"BaseChatModel\",\"BaseLanguageModel\",\"ChatAnthropic\",\"BaseLLM\"],\"display_name\":\"ChatAnthropic\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/chat/integrations/anthropic\",\"beta\":false,\"error\":null},\"ChatOpenAI\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"cache\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"cache\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"max_retries\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":6,\"password\":false,\"name\":\"max_retries\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"max_tokens\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"max_tokens\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"gpt-3.5-turbo-0613\",\"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,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"n\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":1,\"password\":false,\"name\":\"n\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"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,\"dynamic\":false,\"info\":\"\\nThe base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\\n\\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.\\n\",\"type\":\"str\",\"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,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"openai_organization\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"openai_organization\",\"display_name\":\"OpenAI Organization\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"openai_proxy\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"openai_proxy\",\"display_name\":\"OpenAI Proxy\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"request_timeout\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"request_timeout\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"streaming\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"streaming\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"temperature\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.7,\"password\":false,\"name\":\"temperature\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"tiktoken_model_name\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tiktoken_model_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"ChatOpenAI\"},\"description\":\"`OpenAI` Chat large language models API.\",\"base_classes\":[\"ChatOpenAI\",\"BaseChatModel\",\"BaseLanguageModel\",\"BaseLLM\"],\"display_name\":\"ChatOpenAI\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/chat/integrations/openai\",\"beta\":false,\"error\":null},\"ChatVertexAI\":{\"template\":{\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":true},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"ForwardRef(\\\"'_LanguageModel'\\\")\",\"list\":false},\"credentials\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".json\"],\"password\":false,\"name\":\"credentials\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"json\"],\"file_path\":null},\"cache\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"cache\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"location\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"us-central1\",\"password\":false,\"name\":\"location\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"max_output_tokens\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":128,\"password\":false,\"name\":\"max_output_tokens\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"max_retries\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":6,\"password\":false,\"name\":\"max_retries\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"chat-bison\",\"password\":false,\"name\":\"model_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"project\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"project\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"request_parallelism\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":5,\"password\":false,\"name\":\"request_parallelism\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"stop\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"stop\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"temperature\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.0,\"password\":false,\"name\":\"temperature\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"top_k\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":40,\"password\":false,\"name\":\"top_k\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"top_p\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.95,\"password\":false,\"name\":\"top_p\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"verbose\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"verbose\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"ChatVertexAI\"},\"description\":\"`Vertex AI` Chat large language models API.\",\"base_classes\":[\"BaseChatModel\",\"BaseLanguageModel\",\"_VertexAICommon\",\"ChatVertexAI\",\"BaseLLM\"],\"display_name\":\"ChatVertexAI\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/models/chat/integrations/google_vertex_ai_palm\",\"beta\":false,\"error\":null}},\"memories\":{\"ConversationBufferMemory\":{\"template\":{\"chat_memory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chat_memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseChatMessageHistory\",\"list\":false},\"ai_prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"AI\",\"password\":false,\"name\":\"ai_prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"human_prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"Human\",\"password\":false,\"name\":\"human_prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"input_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"input_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Input when more than one variable is available.\",\"type\":\"str\",\"list\":false},\"memory_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"chat_history\",\"password\":false,\"name\":\"memory_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"output_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"output_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)\",\"type\":\"str\",\"list\":false},\"return_messages\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"return_messages\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"ConversationBufferMemory\"},\"description\":\"Buffer for storing conversation memory.\",\"base_classes\":[\"BaseChatMemory\",\"ConversationBufferMemory\",\"BaseMemory\"],\"display_name\":\"ConversationBufferMemory\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/memory/how_to/buffer\",\"beta\":false,\"error\":null},\"ConversationBufferWindowMemory\":{\"template\":{\"chat_memory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chat_memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseChatMessageHistory\",\"list\":false},\"ai_prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"AI\",\"password\":false,\"name\":\"ai_prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"human_prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"Human\",\"password\":false,\"name\":\"human_prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"input_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"input_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Input when more than one variable is available.\",\"type\":\"str\",\"list\":false},\"k\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":10,\"password\":false,\"name\":\"k\",\"display_name\":\"Memory Size\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"memory_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"chat_history\",\"password\":false,\"name\":\"memory_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"output_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"output_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)\",\"type\":\"str\",\"list\":false},\"return_messages\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"return_messages\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"ConversationBufferWindowMemory\"},\"description\":\"Buffer for storing conversation memory inside a limited size window.\",\"base_classes\":[\"BaseChatMemory\",\"ConversationBufferWindowMemory\",\"BaseMemory\"],\"display_name\":\"ConversationBufferWindowMemory\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/memory/how_to/buffer_window\",\"beta\":false,\"error\":null},\"ConversationEntityMemory\":{\"template\":{\"chat_memory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chat_memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseChatMessageHistory\",\"list\":false},\"entity_extraction_prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"entity_extraction_prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BasePromptTemplate\",\"list\":false},\"entity_store\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"entity_store\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseEntityStore\",\"list\":false},\"entity_summarization_prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"entity_summarization_prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BasePromptTemplate\",\"list\":false},\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"ai_prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"AI\",\"password\":false,\"name\":\"ai_prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"chat_history_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"history\",\"password\":false,\"name\":\"chat_history_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"entity_cache\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"entity_cache\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"human_prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"Human\",\"password\":false,\"name\":\"human_prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"input_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"input_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Input when more than one variable is available.\",\"type\":\"str\",\"list\":false},\"k\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":10,\"password\":false,\"name\":\"k\",\"display_name\":\"Memory Size\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"output_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"output_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)\",\"type\":\"str\",\"list\":false},\"return_messages\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"return_messages\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"ConversationEntityMemory\"},\"description\":\"Entity extractor & summarizer memory.\",\"base_classes\":[\"BaseChatMemory\",\"BaseMemory\",\"ConversationEntityMemory\"],\"display_name\":\"ConversationEntityMemory\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/memory/integrations/entity_memory_with_sqlite\",\"beta\":false,\"error\":null},\"ConversationKGMemory\":{\"template\":{\"chat_memory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chat_memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseChatMessageHistory\",\"list\":false},\"entity_extraction_prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"entity_extraction_prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BasePromptTemplate\",\"list\":false},\"kg\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"kg\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"NetworkxEntityGraph\",\"list\":false},\"knowledge_extraction_prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"knowledge_extraction_prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BasePromptTemplate\",\"list\":false},\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"summary_message_cls\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"summary_message_cls\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[langchain.schema.messages.BaseMessage]\",\"list\":false},\"ai_prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"AI\",\"password\":false,\"name\":\"ai_prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"human_prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"Human\",\"password\":false,\"name\":\"human_prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"input_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"input_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Input when more than one variable is available.\",\"type\":\"str\",\"list\":false},\"k\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":10,\"password\":false,\"name\":\"k\",\"display_name\":\"Memory Size\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"memory_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"chat_history\",\"password\":false,\"name\":\"memory_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"output_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"output_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)\",\"type\":\"str\",\"list\":false},\"return_messages\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"return_messages\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"ConversationKGMemory\"},\"description\":\"Knowledge graph conversation memory.\",\"base_classes\":[\"BaseChatMemory\",\"BaseMemory\",\"ConversationKGMemory\"],\"display_name\":\"ConversationKGMemory\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/memory/how_to/kg\",\"beta\":false,\"error\":null},\"ConversationSummaryMemory\":{\"template\":{\"chat_memory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chat_memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseChatMessageHistory\",\"list\":false},\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BasePromptTemplate\",\"list\":false},\"summary_message_cls\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"summary_message_cls\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[langchain.schema.messages.BaseMessage]\",\"list\":false},\"ai_prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"AI\",\"password\":false,\"name\":\"ai_prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"buffer\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"buffer\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"human_prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"Human\",\"password\":false,\"name\":\"human_prefix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"input_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"input_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Input when more than one variable is available.\",\"type\":\"str\",\"list\":false},\"memory_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"chat_history\",\"password\":false,\"name\":\"memory_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"output_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"output_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)\",\"type\":\"str\",\"list\":false},\"return_messages\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"return_messages\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"ConversationSummaryMemory\"},\"description\":\"Conversation summarizer to chat memory.\",\"base_classes\":[\"ConversationSummaryMemory\",\"BaseChatMemory\",\"BaseMemory\",\"SummarizerMixin\"],\"display_name\":\"ConversationSummaryMemory\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/memory/how_to/summary\",\"beta\":false,\"error\":null},\"MongoDBChatMessageHistory\":{\"template\":{\"collection_name\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"message_store\",\"password\":false,\"name\":\"collection_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"connection_string\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"connection_string\",\"advanced\":false,\"dynamic\":false,\"info\":\"MongoDB connection string (e.g mongodb://mongo_user:password123@mongo:27017)\",\"type\":\"str\",\"list\":false},\"database_name\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"chat_history\",\"password\":false,\"name\":\"database_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"session_id\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"session_id\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"MongoDBChatMessageHistory\"},\"description\":\"Memory store with MongoDB\",\"base_classes\":[\"MongoDBChatMessageHistory\",\"BaseChatMessageHistory\"],\"display_name\":\"MongoDBChatMessageHistory\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/memory/integrations/mongodb_chat_message_history\",\"beta\":false,\"error\":null},\"MotorheadMemory\":{\"template\":{\"chat_memory\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"chat_memory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseChatMessageHistory\",\"list\":false},\"api_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"client_id\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"client_id\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"context\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"context\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"input_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"input_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Input when more than one variable is available.\",\"type\":\"str\",\"list\":false},\"memory_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"chat_history\",\"password\":false,\"name\":\"memory_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"output_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"output_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)\",\"type\":\"str\",\"list\":false},\"return_messages\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"return_messages\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"session_id\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"session_id\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"timeout\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"timeout\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"url\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"https://api.getmetal.io/v1/motorhead\",\"password\":false,\"name\":\"url\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"MotorheadMemory\"},\"description\":\"Chat message memory backed by Motorhead service.\",\"base_classes\":[\"BaseChatMemory\",\"MotorheadMemory\",\"BaseMemory\"],\"display_name\":\"MotorheadMemory\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/integrations/memory/motorhead_memory\",\"beta\":false,\"error\":null},\"PostgresChatMessageHistory\":{\"template\":{\"connection_string\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"postgresql://postgres:mypassword@localhost/chat_history\",\"password\":false,\"name\":\"connection_string\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"session_id\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"session_id\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"table_name\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"message_store\",\"password\":false,\"name\":\"table_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"PostgresChatMessageHistory\"},\"description\":\"Memory store with Postgres\",\"base_classes\":[\"PostgresChatMessageHistory\",\"BaseChatMessageHistory\"],\"display_name\":\"PostgresChatMessageHistory\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/memory/integrations/postgres_chat_message_history\",\"beta\":false,\"error\":null},\"VectorStoreRetrieverMemory\":{\"template\":{\"retriever\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"retriever\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"VectorStoreRetriever\",\"list\":false},\"exclude_input_keys\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"exclude_input_keys\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"input_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"input_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"The variable to be used as Chat Input when more than one variable is available.\",\"type\":\"str\",\"list\":false},\"memory_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"chat_history\",\"password\":false,\"name\":\"memory_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"return_docs\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"return_docs\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"return_messages\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"return_messages\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"VectorStoreRetrieverMemory\"},\"description\":\"VectorStoreRetriever-backed memory.\",\"base_classes\":[\"BaseMemory\",\"VectorStoreRetrieverMemory\"],\"display_name\":\"VectorStoreRetrieverMemory\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/memory/how_to/vectorstore_retriever_memory\",\"beta\":false,\"error\":null}},\"tools\":{\"Calculator\":{\"template\":{\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"_type\":\"Calculator\"},\"description\":\"Useful for when you need to answer questions about math.\",\"base_classes\":[\"Tool\",\"BaseTool\"],\"display_name\":\"Calculator\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"News API\":{\"template\":{\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"news_api_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":true,\"name\":\"news_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"News API\"},\"description\":\"Use this when you want to get information about the top headlines of current news stories. The input should be a question in natural language that this API can answer.\",\"base_classes\":[\"Tool\",\"BaseTool\"],\"display_name\":\"News API\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"TMDB API\":{\"template\":{\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"tmdb_bearer_token\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":true,\"name\":\"tmdb_bearer_token\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"TMDB API\"},\"description\":\"Useful for when you want to get information from The Movie Database. The input should be a question in natural language that this API can answer.\",\"base_classes\":[\"Tool\",\"BaseTool\"],\"display_name\":\"TMDB API\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"Podcast API\":{\"template\":{\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"listen_api_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":true,\"name\":\"listen_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"Podcast API\"},\"description\":\"Use the Listen Notes Podcast API to search all podcasts or episodes. The input should be a question in natural language that this API can answer.\",\"base_classes\":[\"Tool\",\"BaseTool\"],\"display_name\":\"Podcast API\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"Search\":{\"template\":{\"aiosession\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"aiosession\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"serpapi_api_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":true,\"name\":\"serpapi_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"Search\"},\"description\":\"A search engine. Useful for when you need to answer questions about current events. Input should be a search query.\",\"base_classes\":[\"Tool\",\"BaseTool\"],\"display_name\":\"Search\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"Tool\":{\"template\":{\"func\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"password\":false,\"name\":\"func\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"function\",\"list\":false},\"description\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"\",\"password\":false,\"name\":\"description\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"name\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"\",\"password\":false,\"name\":\"name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"return_direct\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"return_direct\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"Tool\"},\"description\":\"Converts a chain, agent or function into a tool.\",\"base_classes\":[\"Tool\",\"BaseTool\"],\"display_name\":\"Tool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"PythonFunctionTool\":{\"template\":{\"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,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"description\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"\",\"password\":false,\"name\":\"description\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"name\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"return_direct\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"return_direct\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"PythonFunctionTool\"},\"description\":\"Python function to be executed.\",\"base_classes\":[\"BaseTool\",\"Tool\"],\"display_name\":\"PythonFunctionTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"PythonFunction\":{\"template\":{\"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,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"PythonFunction\"},\"description\":\"Python function to be executed.\",\"base_classes\":[\"function\"],\"display_name\":\"PythonFunction\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"JsonSpec\":{\"template\":{\"path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".json\",\".yaml\",\".yml\"],\"password\":false,\"name\":\"path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"json\",\"yaml\",\"yml\"],\"file_path\":null},\"max_value_length\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"max_value_length\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"_type\":\"JsonSpec\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"JsonSpec\"],\"display_name\":\"JsonSpec\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"BingSearchRun\":{\"template\":{\"api_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"api_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BingSearchAPIWrapper\",\"list\":false},\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"BingSearchRun\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BingSearchRun\",\"BaseTool\"],\"display_name\":\"BingSearchRun\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"GoogleSearchResults\":{\"template\":{\"api_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"api_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"GoogleSearchAPIWrapper\",\"list\":false},\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"num_results\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":4,\"password\":false,\"name\":\"num_results\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"GoogleSearchResults\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BaseTool\",\"GoogleSearchResults\"],\"display_name\":\"GoogleSearchResults\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"GoogleSearchRun\":{\"template\":{\"api_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"api_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"GoogleSearchAPIWrapper\",\"list\":false},\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"GoogleSearchRun\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BaseTool\",\"GoogleSearchRun\"],\"display_name\":\"GoogleSearchRun\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"GoogleSerperRun\":{\"template\":{\"api_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"api_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"GoogleSerperAPIWrapper\",\"list\":false},\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"GoogleSerperRun\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"GoogleSerperRun\",\"BaseTool\"],\"display_name\":\"GoogleSerperRun\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"InfoSQLDatabaseTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"db\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"db\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"SQLDatabase\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"InfoSQLDatabaseTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BaseSQLDatabaseTool\",\"BaseTool\",\"InfoSQLDatabaseTool\"],\"display_name\":\"InfoSQLDatabaseTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"JsonGetValueTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"spec\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"spec\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"JsonSpec\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"JsonGetValueTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"JsonGetValueTool\",\"BaseTool\"],\"display_name\":\"JsonGetValueTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"JsonListKeysTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"spec\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"spec\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"JsonSpec\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"JsonListKeysTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BaseTool\",\"JsonListKeysTool\"],\"display_name\":\"JsonListKeysTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"ListSQLDatabaseTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"db\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"db\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"SQLDatabase\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"ListSQLDatabaseTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BaseSQLDatabaseTool\",\"BaseTool\",\"ListSQLDatabaseTool\"],\"display_name\":\"ListSQLDatabaseTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"PythonAstREPLTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"globals\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"globals\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"locals\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"locals\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"sanitize_input\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"sanitize_input\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"PythonAstREPLTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BaseTool\",\"PythonAstREPLTool\"],\"display_name\":\"PythonAstREPLTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"PythonREPLTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"python_repl\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"python_repl\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"PythonREPL\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"sanitize_input\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"sanitize_input\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"PythonREPLTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"PythonREPLTool\",\"BaseTool\"],\"display_name\":\"PythonREPLTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"QuerySQLDataBaseTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"db\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"db\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"SQLDatabase\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"QuerySQLDataBaseTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"QuerySQLDataBaseTool\",\"BaseSQLDatabaseTool\",\"BaseTool\"],\"display_name\":\"QuerySQLDataBaseTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"RequestsDeleteTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"requests_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"requests_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"TextRequestsWrapper\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"RequestsDeleteTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"RequestsDeleteTool\",\"BaseRequestsTool\",\"BaseTool\"],\"display_name\":\"RequestsDeleteTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"RequestsGetTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"requests_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"requests_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"TextRequestsWrapper\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"RequestsGetTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BaseRequestsTool\",\"BaseTool\",\"RequestsGetTool\"],\"display_name\":\"RequestsGetTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"RequestsPatchTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"requests_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"requests_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"TextRequestsWrapper\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"RequestsPatchTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BaseRequestsTool\",\"BaseTool\",\"RequestsPatchTool\"],\"display_name\":\"RequestsPatchTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"RequestsPostTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"requests_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"requests_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"TextRequestsWrapper\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"RequestsPostTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BaseRequestsTool\",\"BaseTool\",\"RequestsPostTool\"],\"display_name\":\"RequestsPostTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"RequestsPutTool\":{\"template\":{\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"requests_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"requests_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"TextRequestsWrapper\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"RequestsPutTool\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"RequestsPutTool\",\"BaseRequestsTool\",\"BaseTool\"],\"display_name\":\"RequestsPutTool\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"WikipediaQueryRun\":{\"template\":{\"api_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"api_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"WikipediaAPIWrapper\",\"list\":false},\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"WikipediaQueryRun\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"WikipediaQueryRun\",\"BaseTool\"],\"display_name\":\"WikipediaQueryRun\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"WolframAlphaQueryRun\":{\"template\":{\"api_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"api_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"WolframAlphaAPIWrapper\",\"list\":false},\"args_schema\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"args_schema\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Type[pydantic.main.BaseModel]\",\"list\":false},\"callbacks\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"callbacks\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"langchain.callbacks.base.BaseCallbackHandler\",\"list\":false},\"handle_tool_error\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"handle_tool_error\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"tags\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tags\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"WolframAlphaQueryRun\"},\"description\":\"\",\"base_classes\":[\"Tool\",\"BaseTool\",\"BaseTool\",\"WolframAlphaQueryRun\"],\"display_name\":\"WolframAlphaQueryRun\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null}},\"toolkits\":{\"JsonToolkit\":{\"template\":{\"spec\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"spec\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"JsonSpec\",\"list\":false},\"_type\":\"JsonToolkit\"},\"description\":\"Toolkit for interacting with a JSON spec.\",\"base_classes\":[\"BaseToolkit\",\"JsonToolkit\",\"Tool\"],\"display_name\":\"JsonToolkit\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"OpenAPIToolkit\":{\"template\":{\"json_agent\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"json_agent\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"AgentExecutor\",\"list\":false},\"requests_wrapper\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"requests_wrapper\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"TextRequestsWrapper\",\"list\":false},\"_type\":\"OpenAPIToolkit\"},\"description\":\"Toolkit for interacting with an OpenAPI API.\",\"base_classes\":[\"OpenAPIToolkit\",\"BaseToolkit\",\"Tool\"],\"display_name\":\"OpenAPIToolkit\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"VectorStoreInfo\":{\"template\":{\"vectorstore\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"vectorstore\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"VectorStore\",\"list\":false},\"description\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"password\":false,\"name\":\"description\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"name\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"VectorStoreInfo\"},\"description\":\"Information about a VectorStore.\",\"base_classes\":[\"VectorStoreInfo\"],\"display_name\":\"VectorStoreInfo\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"VectorStoreRouterToolkit\":{\"template\":{\"llm\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"vectorstores\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"vectorstores\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"VectorStoreInfo\",\"list\":true},\"_type\":\"VectorStoreRouterToolkit\"},\"description\":\"Toolkit for routing between Vector Stores.\",\"base_classes\":[\"VectorStoreRouterToolkit\",\"BaseToolkit\",\"Tool\"],\"display_name\":\"VectorStoreRouterToolkit\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"VectorStoreToolkit\":{\"template\":{\"llm\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLanguageModel\",\"list\":false},\"vectorstore_info\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"vectorstore_info\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"VectorStoreInfo\",\"list\":false},\"_type\":\"VectorStoreToolkit\"},\"description\":\"Toolkit for interacting with a Vector Store.\",\"base_classes\":[\"VectorStoreToolkit\",\"BaseToolkit\",\"Tool\"],\"display_name\":\"VectorStoreToolkit\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"Metaphor\":{\"template\":{\"code\":{\"dynamic\":true,\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"from typing import List, Union\\nfrom langflow import CustomComponent\\n\\nfrom metaphor_python import Metaphor # type: ignore\\nfrom langchain.tools import Tool\\nfrom langchain.agents import tool\\nfrom langchain.agents.agent_toolkits.base import BaseToolkit\\n\\n\\nclass MetaphorToolkit(CustomComponent):\\n display_name: str = \\\"Metaphor\\\"\\n description: str = \\\"Metaphor Toolkit\\\"\\n documentation = (\\n \\\"https://python.langchain.com/docs/integrations/tools/metaphor_search\\\"\\n )\\n beta = True\\n # api key should be password = True\\n field_config = {\\n \\\"metaphor_api_key\\\": {\\\"display_name\\\": \\\"Metaphor API Key\\\", \\\"password\\\": True},\\n \\\"code\\\": {\\\"advanced\\\": True},\\n }\\n\\n def build(\\n self,\\n metaphor_api_key: str,\\n use_autoprompt: bool = True,\\n search_num_results: int = 5,\\n similar_num_results: int = 5,\\n ) -> Union[Tool, BaseToolkit]:\\n # If documents, then we need to create a Vectara instance using .from_documents\\n client = Metaphor(api_key=metaphor_api_key)\\n\\n @tool\\n def search(query: str):\\n \\\"\\\"\\\"Call search engine with a query.\\\"\\\"\\\"\\n return client.search(\\n query, use_autoprompt=use_autoprompt, num_results=search_num_results\\n )\\n\\n @tool\\n def get_contents(ids: List[str]):\\n \\\"\\\"\\\"Get contents of a webpage.\\n\\n The ids passed in should be a list of ids as fetched from `search`.\\n \\\"\\\"\\\"\\n return client.get_contents(ids)\\n\\n @tool\\n def find_similar(url: str):\\n \\\"\\\"\\\"Get search results similar to a given URL.\\n\\n The url passed in should be a URL returned from `search`\\n \\\"\\\"\\\"\\n return client.find_similar(url, num_results=similar_num_results)\\n\\n return [search, get_contents, find_similar] # type: ignore\\n\",\"password\":false,\"name\":\"code\",\"advanced\":true,\"type\":\"code\",\"list\":false},\"_type\":\"CustomComponent\",\"metaphor_api_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"metaphor_api_key\",\"display_name\":\"Metaphor API Key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"search_num_results\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":5,\"password\":false,\"name\":\"search_num_results\",\"display_name\":\"search_num_results\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"similar_num_results\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":5,\"password\":false,\"name\":\"similar_num_results\",\"display_name\":\"similar_num_results\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"use_autoprompt\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":true,\"password\":false,\"name\":\"use_autoprompt\",\"display_name\":\"use_autoprompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false}},\"description\":\"Metaphor Toolkit\",\"base_classes\":[\"BaseTool\",\"Tool\"],\"display_name\":\"Metaphor\",\"custom_fields\":{\"metaphor_api_key\":null,\"search_num_results\":null,\"similar_num_results\":null,\"use_autoprompt\":null},\"output_types\":[\"Metaphor\"],\"documentation\":\"https://python.langchain.com/docs/integrations/tools/metaphor_search\",\"beta\":true,\"error\":null}},\"wrappers\":{\"TextRequestsWrapper\":{\"template\":{\"aiosession\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"aiosession\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"ClientSession\",\"list\":false},\"auth\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"auth\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"headers\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"{'Authorization': 'Bearer '}\",\"password\":false,\"name\":\"headers\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"TextRequestsWrapper\"},\"description\":\"Lightweight wrapper around requests library.\",\"base_classes\":[\"TextRequestsWrapper\"],\"display_name\":\"TextRequestsWrapper\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"SQLDatabase\":{\"template\":{\"database_uri\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"database_uri\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"engine_args\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"engine_args\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"SQLDatabase\"},\"description\":\"Construct a SQLAlchemy engine from URI.\",\"base_classes\":[\"SQLDatabase\",\"function\"],\"display_name\":\"SQLDatabase\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null}},\"embeddings\":{\"OpenAIEmbeddings\":{\"template\":{\"allowed_special\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":[],\"password\":false,\"name\":\"allowed_special\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"Literal'all'\",\"list\":true},\"disallowed_special\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"all\",\"password\":false,\"name\":\"disallowed_special\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"Literal'all'\",\"list\":true},\"chunk_size\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":1000,\"password\":false,\"name\":\"chunk_size\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"deployment\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"text-embedding-ada-002\",\"password\":false,\"name\":\"deployment\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"embedding_ctx_length\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":8191,\"password\":false,\"name\":\"embedding_ctx_length\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"headers\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":true,\"value\":\"{'Authorization': 'Bearer '}\",\"password\":false,\"name\":\"headers\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"max_retries\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":6,\"password\":false,\"name\":\"max_retries\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"model\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"text-embedding-ada-002\",\"password\":false,\"name\":\"model\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"model_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"openai_api_base\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"openai_api_base\",\"display_name\":\"OpenAI API Base\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"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,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"openai_api_type\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"openai_api_type\",\"display_name\":\"OpenAI API Type\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"openai_api_version\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"openai_api_version\",\"display_name\":\"OpenAI API Version\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"openai_organization\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"openai_organization\",\"display_name\":\"OpenAI Organization\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"openai_proxy\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"openai_proxy\",\"display_name\":\"OpenAI Proxy\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"request_timeout\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"request_timeout\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"show_progress_bar\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"show_progress_bar\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"tiktoken_model_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"tiktoken_model_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"OpenAIEmbeddings\"},\"description\":\"OpenAI embedding models.\",\"base_classes\":[\"OpenAIEmbeddings\",\"Embeddings\"],\"display_name\":\"OpenAIEmbeddings\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/text_embedding/integrations/openai\",\"beta\":false,\"error\":null},\"CohereEmbeddings\":{\"template\":{\"async_client\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"async_client\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"cohere_api_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"cohere_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"model\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"embed-english-v2.0\",\"password\":false,\"name\":\"model\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"truncate\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"truncate\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"CohereEmbeddings\"},\"description\":\"Cohere embedding models.\",\"base_classes\":[\"CohereEmbeddings\",\"Embeddings\"],\"display_name\":\"CohereEmbeddings\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/text_embedding/integrations/cohere\",\"beta\":false,\"error\":null},\"HuggingFaceEmbeddings\":{\"template\":{\"cache_folder\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"cache_folder\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"encode_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"encode_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"model_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"model_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"sentence-transformers/all-mpnet-base-v2\",\"password\":false,\"name\":\"model_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"multi_process\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"multi_process\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"HuggingFaceEmbeddings\"},\"description\":\"HuggingFace sentence_transformers embedding models.\",\"base_classes\":[\"HuggingFaceEmbeddings\",\"Embeddings\"],\"display_name\":\"HuggingFaceEmbeddings\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/text_embedding/integrations/sentence_transformers\",\"beta\":false,\"error\":null},\"VertexAIEmbeddings\":{\"template\":{\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"ForwardRef(\\\"'_LanguageModel'\\\")\",\"list\":false},\"credentials\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".json\"],\"password\":false,\"name\":\"credentials\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"json\"],\"file_path\":null},\"location\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"us-central1\",\"password\":false,\"name\":\"location\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"max_output_tokens\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":128,\"password\":true,\"name\":\"max_output_tokens\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"max_retries\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":6,\"password\":false,\"name\":\"max_retries\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"model_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"textembedding-gecko\",\"password\":false,\"name\":\"model_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"project\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"project\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"request_parallelism\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":5,\"password\":false,\"name\":\"request_parallelism\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"stop\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"stop\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"temperature\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.0,\"password\":false,\"name\":\"temperature\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"top_k\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":40,\"password\":false,\"name\":\"top_k\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"top_p\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":0.95,\"password\":false,\"name\":\"top_p\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"_type\":\"VertexAIEmbeddings\"},\"description\":\"Google Cloud VertexAI embedding models.\",\"base_classes\":[\"VertexAIEmbeddings\",\"_VertexAICommon\",\"Embeddings\"],\"display_name\":\"VertexAIEmbeddings\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/text_embedding/integrations/google_vertex_ai_palm\",\"beta\":false,\"error\":null}},\"vectorstores\":{\"Chroma\":{\"template\":{\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"chromadb.Client\",\"list\":false},\"client_settings\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client_settings\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"chromadb.config.Setting\",\"list\":true},\"documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"display_name\":\"Documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":true},\"embedding\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"embedding\",\"display_name\":\"Embedding\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Embeddings\",\"list\":false},\"chroma_server_cors_allow_origins\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chroma_server_cors_allow_origins\",\"display_name\":\"Chroma Server CORS Allow Origins\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"chroma_server_grpc_port\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chroma_server_grpc_port\",\"display_name\":\"Chroma Server GRPC Port\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"chroma_server_host\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chroma_server_host\",\"display_name\":\"Chroma Server Host\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"chroma_server_http_port\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chroma_server_http_port\",\"display_name\":\"Chroma Server HTTP Port\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"chroma_server_ssl_enabled\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"chroma_server_ssl_enabled\",\"display_name\":\"Chroma Server SSL Enabled\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"collection_metadata\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"collection_metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"collection_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"langchain\",\"password\":false,\"name\":\"collection_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"ids\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"ids\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"metadatas\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadatas\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":true},\"persist\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"persist\",\"display_name\":\"Persist\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"persist_directory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"persist_directory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"search_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"search_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"Chroma\"},\"description\":\"Create a Chroma vectorstore from a raw documents.\",\"base_classes\":[\"VectorStore\",\"Chroma\",\"BaseRetriever\",\"VectorStoreRetriever\"],\"display_name\":\"Chroma\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/chroma\",\"beta\":false,\"error\":null},\"FAISS\":{\"template\":{\"documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"display_name\":\"Documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":true},\"embedding\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"embedding\",\"display_name\":\"Embedding\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Embeddings\",\"list\":false},\"folder_path\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"folder_path\",\"display_name\":\"Local Path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"ids\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"ids\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"index_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"index_name\",\"display_name\":\"Index Name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"metadatas\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadatas\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":true},\"search_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"search_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"FAISS\"},\"description\":\"Construct FAISS wrapper from raw documents.\",\"base_classes\":[\"FAISS\",\"VectorStore\",\"BaseRetriever\",\"VectorStoreRetriever\"],\"display_name\":\"FAISS\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/faiss\",\"beta\":false,\"error\":null},\"MongoDBAtlasVectorSearch\":{\"template\":{\"collection\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"collection\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Collection[MongoDBDocumentType]\",\"list\":false},\"documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"display_name\":\"Documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":true},\"embedding\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"embedding\",\"display_name\":\"Embedding\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Embeddings\",\"list\":false},\"collection_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"collection_name\",\"display_name\":\"Collection Name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"db_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"db_name\",\"display_name\":\"Database Name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"index_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"index_name\",\"display_name\":\"Index Name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"metadatas\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadatas\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":true},\"mongodb_atlas_cluster_uri\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"mongodb_atlas_cluster_uri\",\"display_name\":\"MongoDB Atlas Cluster URI\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"search_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"search_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"MongoDBAtlasVectorSearch\"},\"description\":\"Construct MongoDBAtlasVectorSearch wrapper from raw documents.\",\"base_classes\":[\"MongoDBAtlasVectorSearch\",\"VectorStore\",\"BaseRetriever\",\"VectorStoreRetriever\"],\"display_name\":\"MongoDB Atlas\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/mongodb_atlas\",\"beta\":false,\"error\":null},\"Pinecone\":{\"template\":{\"documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"display_name\":\"Documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":true},\"embedding\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"embedding\",\"display_name\":\"Embedding\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Embeddings\",\"list\":false},\"batch_size\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":32,\"password\":false,\"name\":\"batch_size\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"ids\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"ids\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"index_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"index_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"metadatas\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadatas\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":true},\"namespace\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"namespace\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"pinecone_api_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"pinecone_api_key\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"pinecone_env\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"pinecone_env\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"search_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"search_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"text_key\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"text\",\"password\":true,\"name\":\"text_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"upsert_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"upsert_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"Pinecone\"},\"description\":\"Construct Pinecone wrapper from raw documents.\",\"base_classes\":[\"Pinecone\",\"VectorStore\",\"BaseRetriever\",\"VectorStoreRetriever\"],\"display_name\":\"Pinecone\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/pinecone\",\"beta\":false,\"error\":null},\"Qdrant\":{\"template\":{\"documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"display_name\":\"Documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":true},\"embedding\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"embedding\",\"display_name\":\"Embedding\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Embeddings\",\"list\":false},\"hnsw_config\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"hnsw_config\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"common_types.HnswConfigDiff\",\"list\":false},\"init_from\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"init_from\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"common_types.InitFrom\",\"list\":false},\"optimizers_config\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"optimizers_config\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"common_types.OptimizersConfigDiff\",\"list\":false},\"quantization_config\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"quantization_config\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"common_types.QuantizationConfig\",\"list\":false},\"wal_config\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"wal_config\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"common_types.WalConfigDiff\",\"list\":false},\"api_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"api_key\",\"display_name\":\"API Key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"batch_size\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":64,\"password\":false,\"name\":\"batch_size\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"collection_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"collection_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"content_payload_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"page_content\",\"password\":false,\"name\":\"content_payload_key\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"distance_func\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"Cosine\",\"password\":false,\"name\":\"distance_func\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"force_recreate\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"force_recreate\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"grpc_port\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":6334,\"password\":false,\"name\":\"grpc_port\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"host\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"host\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"https\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"https\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"ids\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"ids\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"location\":{\"required\":false,\"placeholder\":\":memory:\",\"show\":true,\"multiline\":false,\"value\":\":memory:\",\"password\":false,\"name\":\"location\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"metadata_payload_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"metadata\",\"password\":false,\"name\":\"metadata_payload_key\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"metadatas\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadatas\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":true},\"on_disk\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"on_disk\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"on_disk_payload\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"on_disk_payload\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"path\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"path\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"port\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":6333,\"password\":false,\"name\":\"port\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"prefer_grpc\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"prefer_grpc\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"prefix\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"password\":false,\"name\":\"prefix\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"replication_factor\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"replication_factor\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"search_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"search_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"shard_number\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"shard_number\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"timeout\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"timeout\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"float\",\"list\":false},\"url\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"url\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"vector_name\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"vector_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"write_consistency_factor\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"write_consistency_factor\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"_type\":\"Qdrant\"},\"description\":\"Construct Qdrant wrapper from a list of texts.\",\"base_classes\":[\"VectorStore\",\"Qdrant\",\"BaseRetriever\",\"VectorStoreRetriever\"],\"display_name\":\"Qdrant\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/qdrant\",\"beta\":false,\"error\":null},\"SupabaseVectorStore\":{\"template\":{\"client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"supabase.client.Client\",\"list\":false},\"documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"display_name\":\"Documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":true},\"embedding\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"embedding\",\"display_name\":\"Embedding\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Embeddings\",\"list\":false},\"ids\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"ids\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"metadatas\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadatas\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":true},\"query_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"query_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"search_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"search_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"supabase_service_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":true,\"name\":\"supabase_service_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"supabase_url\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"supabase_url\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"table_name\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"table_name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"SupabaseVectorStore\"},\"description\":\"Return VectorStore initialized from texts and embeddings.\",\"base_classes\":[\"VectorStore\",\"SupabaseVectorStore\",\"BaseRetriever\",\"VectorStoreRetriever\"],\"display_name\":\"Supabase\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/supabase\",\"beta\":false,\"error\":null},\"Weaviate\":{\"template\":{\"documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"display_name\":\"Documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":true},\"embedding\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"embedding\",\"display_name\":\"Embedding\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Embeddings\",\"list\":false},\"client_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"client_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"metadatas\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"metadatas\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":true},\"search_kwargs\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"search_kwargs\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"weaviate_url\":{\"required\":true,\"placeholder\":\"http://localhost:8080\",\"show\":true,\"multiline\":false,\"value\":\"http://localhost:8080\",\"password\":false,\"name\":\"weaviate_url\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"Weaviate\"},\"description\":\"Construct Weaviate wrapper from raw documents.\",\"base_classes\":[\"VectorStore\",\"Weaviate\",\"BaseRetriever\",\"VectorStoreRetriever\"],\"display_name\":\"Weaviate\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/weaviate\",\"beta\":false,\"error\":null},\"Vectara\":{\"template\":{\"code\":{\"dynamic\":true,\"required\":true,\"placeholder\":\"\",\"show\":false,\"multiline\":true,\"value\":\"from typing import Optional, Union\\nfrom langflow import CustomComponent\\n\\nfrom langchain.vectorstores import Vectara\\nfrom langchain.schema import Document\\nfrom langchain.vectorstores.base import VectorStore\\nfrom langchain.schema import BaseRetriever\\nfrom langchain.embeddings.base import Embeddings\\n\\n\\nclass VectaraComponent(CustomComponent):\\n display_name: str = \\\"Vectara\\\"\\n description: str = \\\"Implementation of Vector Store using Vectara\\\"\\n documentation = (\\n \\\"https://python.langchain.com/docs/integrations/vectorstores/vectara\\\"\\n )\\n beta = True\\n # api key should be password = True\\n field_config = {\\n \\\"vectara_customer_id\\\": {\\\"display_name\\\": \\\"Vectara Customer ID\\\"},\\n \\\"vectara_corpus_id\\\": {\\\"display_name\\\": \\\"Vectara Corpus ID\\\"},\\n \\\"vectara_api_key\\\": {\\\"display_name\\\": \\\"Vectara API Key\\\", \\\"password\\\": True},\\n \\\"code\\\": {\\\"show\\\": False},\\n \\\"documents\\\": {\\\"display_name\\\": \\\"Documents\\\"},\\n \\\"embedding\\\": {\\\"display_name\\\": \\\"Embedding\\\"},\\n }\\n\\n def build(\\n self,\\n vectara_customer_id: str,\\n vectara_corpus_id: str,\\n vectara_api_key: str,\\n embedding: Optional[Embeddings] = None,\\n documents: Optional[Document] = None,\\n ) -> Union[VectorStore, BaseRetriever]:\\n # If documents, then we need to create a Vectara instance using .from_documents\\n if documents is not None and embedding is not None:\\n return Vectara.from_documents(\\n documents=documents, # type: ignore\\n vectara_customer_id=vectara_customer_id,\\n vectara_corpus_id=vectara_corpus_id,\\n vectara_api_key=vectara_api_key,\\n embedding=embedding,\\n )\\n\\n return Vectara(\\n vectara_customer_id=vectara_customer_id,\\n vectara_corpus_id=vectara_corpus_id,\\n vectara_api_key=vectara_api_key,\\n )\\n\",\"password\":false,\"name\":\"code\",\"advanced\":false,\"type\":\"code\",\"list\":false},\"_type\":\"CustomComponent\",\"documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"display_name\":\"Documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":false},\"embedding\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"embedding\",\"display_name\":\"Embedding\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Embeddings\",\"list\":false},\"vectara_api_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"vectara_api_key\",\"display_name\":\"Vectara API Key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"vectara_corpus_id\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"vectara_corpus_id\",\"display_name\":\"Vectara Corpus ID\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"vectara_customer_id\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"vectara_customer_id\",\"display_name\":\"Vectara Customer ID\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false}},\"description\":\"Implementation of Vector Store using Vectara\",\"base_classes\":[\"VectorStore\",\"BaseRetriever\"],\"display_name\":\"Vectara\",\"custom_fields\":{\"documents\":null,\"embedding\":null,\"vectara_api_key\":null,\"vectara_corpus_id\":null,\"vectara_customer_id\":null},\"output_types\":[\"Vectara\"],\"documentation\":\"https://python.langchain.com/docs/integrations/vectorstores/vectara\",\"beta\":true,\"error\":null},\"Chroma (1)\":{\"template\":{\"code\":{\"dynamic\":true,\"required\":true,\"placeholder\":\"\",\"show\":false,\"multiline\":true,\"value\":\"from typing import Optional, Union\\nfrom langflow import CustomComponent\\n\\nfrom langchain.vectorstores import Chroma\\nfrom langchain.schema import Document\\nfrom langchain.vectorstores.base import VectorStore\\nfrom langchain.schema import BaseRetriever\\nfrom langchain.embeddings.base import Embeddings\\nimport chromadb # type: ignore\\n\\n\\nclass ChromaComponent(CustomComponent):\\n \\\"\\\"\\\"\\n A custom component for implementing a Vector Store using Chroma.\\n \\\"\\\"\\\"\\n\\n display_name: str = \\\"Chroma (Custom Component)\\\"\\n description: str = \\\"Implementation of Vector Store using Chroma\\\"\\n documentation = \\\"https://python.langchain.com/docs/integrations/vectorstores/chroma\\\"\\n beta = True\\n\\n def build_config(self):\\n \\\"\\\"\\\"\\n Builds the configuration for the component.\\n\\n Returns:\\n - dict: A dictionary containing the configuration options for the component.\\n \\\"\\\"\\\"\\n return {\\n \\\"collection_name\\\": {\\\"display_name\\\": \\\"Collection Name\\\", \\\"value\\\": \\\"langflow\\\"},\\n \\\"persist\\\": {\\\"display_name\\\": \\\"Persist\\\"},\\n \\\"persist_directory\\\": {\\\"display_name\\\": \\\"Persist Directory\\\"},\\n \\\"code\\\": {\\\"show\\\": False, \\\"display_name\\\": \\\"Code\\\"},\\n \\\"documents\\\": {\\\"display_name\\\": \\\"Documents\\\", \\\"is_list\\\": True},\\n \\\"embedding\\\": {\\\"display_name\\\": \\\"Embedding\\\"},\\n \\\"chroma_server_cors_allow_origins\\\": {\\n \\\"display_name\\\": \\\"Server CORS Allow Origins\\\",\\n \\\"advanced\\\": True,\\n },\\n \\\"chroma_server_host\\\": {\\\"display_name\\\": \\\"Server Host\\\", \\\"advanced\\\": True},\\n \\\"chroma_server_port\\\": {\\\"display_name\\\": \\\"Server Port\\\", \\\"advanced\\\": True},\\n \\\"chroma_server_grpc_port\\\": {\\n \\\"display_name\\\": \\\"Server gRPC Port\\\",\\n \\\"advanced\\\": True,\\n },\\n \\\"chroma_server_ssl_enabled\\\": {\\n \\\"display_name\\\": \\\"Server SSL Enabled\\\",\\n \\\"advanced\\\": True,\\n },\\n }\\n\\n def build(\\n self,\\n collection_name: str,\\n persist: bool,\\n chroma_server_ssl_enabled: bool,\\n persist_directory: Optional[str] = None,\\n embedding: Optional[Embeddings] = None,\\n documents: Optional[Document] = None,\\n chroma_server_cors_allow_origins: Optional[str] = None,\\n chroma_server_host: Optional[str] = None,\\n chroma_server_port: Optional[int] = None,\\n chroma_server_grpc_port: Optional[int] = None,\\n ) -> Union[VectorStore, BaseRetriever]:\\n \\\"\\\"\\\"\\n Builds the Vector Store or BaseRetriever object.\\n\\n Args:\\n - collection_name (str): The name of the collection.\\n - persist_directory (Optional[str]): The directory to persist the Vector Store to.\\n - chroma_server_ssl_enabled (bool): Whether to enable SSL for the Chroma server.\\n - persist (bool): Whether to persist the Vector Store or not.\\n - embedding (Optional[Embeddings]): The embeddings to use for the Vector Store.\\n - documents (Optional[Document]): The documents to use for the Vector Store.\\n - chroma_server_cors_allow_origins (Optional[str]): The CORS allow origins for the Chroma server.\\n - chroma_server_host (Optional[str]): The host for the Chroma server.\\n - chroma_server_port (Optional[int]): The port for the Chroma server.\\n - chroma_server_grpc_port (Optional[int]): The gRPC port for the Chroma server.\\n\\n Returns:\\n - Union[VectorStore, BaseRetriever]: The Vector Store or BaseRetriever object.\\n \\\"\\\"\\\"\\n\\n # Chroma settings\\n chroma_settings = None\\n\\n if chroma_server_host is not None:\\n chroma_settings = chromadb.config.Settings(\\n chroma_server_cors_allow_origins=chroma_server_cors_allow_origins\\n or None,\\n chroma_server_host=chroma_server_host,\\n chroma_server_port=chroma_server_port or None,\\n chroma_server_grpc_port=chroma_server_grpc_port or None,\\n chroma_server_ssl_enabled=chroma_server_ssl_enabled,\\n )\\n\\n # If documents, then we need to create a Chroma instance using .from_documents\\n if documents is not None and embedding is not None:\\n return Chroma.from_documents(\\n documents=documents, # type: ignore\\n persist_directory=persist_directory if persist else None,\\n collection_name=collection_name,\\n embedding=embedding,\\n client_settings=chroma_settings,\\n )\\n\\n return Chroma(\\n persist_directory=persist_directory, client_settings=chroma_settings\\n )\\n\",\"password\":false,\"name\":\"code\",\"advanced\":false,\"type\":\"code\",\"list\":false},\"_type\":\"CustomComponent\",\"chroma_server_cors_allow_origins\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chroma_server_cors_allow_origins\",\"display_name\":\"Server CORS Allow Origins\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"chroma_server_grpc_port\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chroma_server_grpc_port\",\"display_name\":\"Server gRPC Port\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"chroma_server_host\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chroma_server_host\",\"display_name\":\"Server Host\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"chroma_server_port\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"chroma_server_port\",\"display_name\":\"Server Port\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"chroma_server_ssl_enabled\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"chroma_server_ssl_enabled\",\"display_name\":\"Server SSL Enabled\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"collection_name\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"langflow\",\"password\":false,\"name\":\"collection_name\",\"display_name\":\"Collection Name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"documents\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"display_name\":\"Documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":true},\"embedding\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"embedding\",\"display_name\":\"Embedding\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Embeddings\",\"list\":false},\"persist\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"persist\",\"display_name\":\"Persist\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"persist_directory\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"persist_directory\",\"display_name\":\"Persist Directory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false}},\"description\":\"Implementation of Vector Store using Chroma\",\"base_classes\":[\"VectorStore\",\"BaseRetriever\"],\"display_name\":\"Chroma (Custom Component)\",\"custom_fields\":{\"chroma_server_cors_allow_origins\":null,\"chroma_server_grpc_port\":null,\"chroma_server_host\":null,\"chroma_server_port\":null,\"chroma_server_ssl_enabled\":null,\"collection_name\":null,\"documents\":null,\"embedding\":null,\"persist\":null,\"persist_directory\":null},\"output_types\":[\"Chroma\"],\"documentation\":\"https://python.langchain.com/docs/integrations/vectorstores/chroma\",\"beta\":true,\"error\":null}},\"documentloaders\":{\"AZLyricsLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"web_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"web_path\",\"display_name\":\"Web Page\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"AZLyricsLoader\"},\"description\":\"Load `AZLyrics` webpages.\",\"base_classes\":[\"Document\"],\"display_name\":\"AZLyricsLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/azlyrics\",\"beta\":false,\"error\":null},\"AirbyteJSONLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".json\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"json\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"AirbyteJSONLoader\"},\"description\":\"Load local `Airbyte` json files.\",\"base_classes\":[\"Document\"],\"display_name\":\"AirbyteJSONLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/airbyte_json\",\"beta\":false,\"error\":null},\"BSHTMLLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".html\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"html\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"BSHTMLLoader\"},\"description\":\"Load `HTML` files and parse them with `beautiful soup`.\",\"base_classes\":[\"Document\"],\"display_name\":\"BSHTMLLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/how_to/html\",\"beta\":false,\"error\":null},\"CSVLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".csv\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"csv\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"CSVLoader\"},\"description\":\"Load a `CSV` file into a list of Documents.\",\"base_classes\":[\"Document\"],\"display_name\":\"CSVLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/csv\",\"beta\":false,\"error\":null},\"CoNLLULoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".csv\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"csv\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"CoNLLULoader\"},\"description\":\"Load `CoNLL-U` files.\",\"base_classes\":[\"Document\"],\"display_name\":\"CoNLLULoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/conll-u\",\"beta\":false,\"error\":null},\"CollegeConfidentialLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"web_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"web_path\",\"display_name\":\"Web Page\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"CollegeConfidentialLoader\"},\"description\":\"Load `College Confidential` webpages.\",\"base_classes\":[\"Document\"],\"display_name\":\"CollegeConfidentialLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/college_confidential\",\"beta\":false,\"error\":null},\"DirectoryLoader\":{\"template\":{\"glob\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"**/*.txt\",\"password\":false,\"name\":\"glob\",\"display_name\":\"glob\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"load_hidden\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"False\",\"password\":false,\"name\":\"load_hidden\",\"display_name\":\"Load hidden files\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"max_concurrency\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":10,\"password\":false,\"name\":\"max_concurrency\",\"display_name\":\"Max concurrency\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"path\",\"display_name\":\"Local directory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"recursive\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"True\",\"password\":false,\"name\":\"recursive\",\"display_name\":\"Recursive\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"silent_errors\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"False\",\"password\":false,\"name\":\"silent_errors\",\"display_name\":\"Silent errors\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"use_multithreading\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"True\",\"password\":false,\"name\":\"use_multithreading\",\"display_name\":\"Use multithreading\",\"advanced\":true,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"DirectoryLoader\"},\"description\":\"Load from a directory.\",\"base_classes\":[\"Document\"],\"display_name\":\"DirectoryLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/how_to/file_directory\",\"beta\":false,\"error\":null},\"EverNoteLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".xml\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"xml\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"EverNoteLoader\"},\"description\":\"Load from `EverNote`.\",\"base_classes\":[\"Document\"],\"display_name\":\"EverNoteLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/evernote\",\"beta\":false,\"error\":null},\"FacebookChatLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".json\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"json\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"FacebookChatLoader\"},\"description\":\"Load `Facebook Chat` messages directory dump.\",\"base_classes\":[\"Document\"],\"display_name\":\"FacebookChatLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/facebook_chat\",\"beta\":false,\"error\":null},\"GitLoader\":{\"template\":{\"branch\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"branch\",\"display_name\":\"Branch\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"clone_url\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"clone_url\",\"display_name\":\"Clone URL\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"file_filter\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"file_filter\",\"display_name\":\"File extensions (comma-separated)\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"repo_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"repo_path\",\"display_name\":\"Path to repository\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"GitLoader\"},\"description\":\"Load `Git` repository files.\",\"base_classes\":[\"Document\"],\"display_name\":\"GitLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/git\",\"beta\":false,\"error\":null},\"GitbookLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"web_page\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"web_page\",\"display_name\":\"Web Page\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"GitbookLoader\"},\"description\":\"Load `GitBook` data.\",\"base_classes\":[\"Document\"],\"display_name\":\"GitbookLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/gitbook\",\"beta\":false,\"error\":null},\"GutenbergLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"web_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"web_path\",\"display_name\":\"Web Page\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"GutenbergLoader\"},\"description\":\"Load from `Gutenberg.org`.\",\"base_classes\":[\"Document\"],\"display_name\":\"GutenbergLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/gutenberg\",\"beta\":false,\"error\":null},\"HNLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"web_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"web_path\",\"display_name\":\"Web Page\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"HNLoader\"},\"description\":\"Load `Hacker News` data.\",\"base_classes\":[\"Document\"],\"display_name\":\"HNLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/hacker_news\",\"beta\":false,\"error\":null},\"IFixitLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"web_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"web_path\",\"display_name\":\"Web Page\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"IFixitLoader\"},\"description\":\"Load `iFixit` repair guides, device wikis and answers.\",\"base_classes\":[\"Document\"],\"display_name\":\"IFixitLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/ifixit\",\"beta\":false,\"error\":null},\"IMSDbLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"web_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"web_path\",\"display_name\":\"Web Page\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"IMSDbLoader\"},\"description\":\"Load `IMSDb` webpages.\",\"base_classes\":[\"Document\"],\"display_name\":\"IMSDbLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/imsdb\",\"beta\":false,\"error\":null},\"NotionDirectoryLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"path\",\"display_name\":\"Local directory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"NotionDirectoryLoader\"},\"description\":\"Load `Notion directory` dump.\",\"base_classes\":[\"Document\"],\"display_name\":\"NotionDirectoryLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/notion\",\"beta\":false,\"error\":null},\"PyPDFLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".pdf\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"pdf\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"PyPDFLoader\"},\"description\":\"Load `PDF using `pypdf` and chunks at character level.\",\"base_classes\":[\"Document\"],\"display_name\":\"PyPDFLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/how_to/pdf\",\"beta\":false,\"error\":null},\"PyPDFDirectoryLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"path\",\"display_name\":\"Local directory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"PyPDFDirectoryLoader\"},\"description\":\"Load a directory with `PDF` files using `pypdf` and chunks at character level.\",\"base_classes\":[\"Document\"],\"display_name\":\"PyPDFDirectoryLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/how_to/pdf\",\"beta\":false,\"error\":null},\"ReadTheDocsLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"path\",\"display_name\":\"Local directory\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"ReadTheDocsLoader\"},\"description\":\"Load `ReadTheDocs` documentation directory.\",\"base_classes\":[\"Document\"],\"display_name\":\"ReadTheDocsLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/readthedocs_documentation\",\"beta\":false,\"error\":null},\"SRTLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".srt\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"srt\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"SRTLoader\"},\"description\":\"Load `.srt` (subtitle) files.\",\"base_classes\":[\"Document\"],\"display_name\":\"SRTLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/subtitle\",\"beta\":false,\"error\":null},\"SlackDirectoryLoader\":{\"template\":{\"zip_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".zip\"],\"password\":false,\"name\":\"zip_path\",\"display_name\":\"Path to zip file\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"zip\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"workspace_url\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"workspace_url\",\"display_name\":\"Workspace URL\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"SlackDirectoryLoader\"},\"description\":\"Load from a `Slack` directory dump.\",\"base_classes\":[\"Document\"],\"display_name\":\"SlackDirectoryLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/slack\",\"beta\":false,\"error\":null},\"TextLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".txt\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"txt\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"TextLoader\"},\"description\":\"Load text file.\",\"base_classes\":[\"Document\"],\"display_name\":\"TextLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/\",\"beta\":false,\"error\":null},\"UnstructuredEmailLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".eml\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"eml\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"UnstructuredEmailLoader\"},\"description\":\"Load email files using `Unstructured`.\",\"base_classes\":[\"Document\"],\"display_name\":\"UnstructuredEmailLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/email\",\"beta\":false,\"error\":null},\"UnstructuredHTMLLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".html\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"html\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"UnstructuredHTMLLoader\"},\"description\":\"Load `HTML` files using `Unstructured`.\",\"base_classes\":[\"Document\"],\"display_name\":\"UnstructuredHTMLLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/how_to/html\",\"beta\":false,\"error\":null},\"UnstructuredMarkdownLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".md\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"md\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"UnstructuredMarkdownLoader\"},\"description\":\"Load `Markdown` files using `Unstructured`.\",\"base_classes\":[\"Document\"],\"display_name\":\"UnstructuredMarkdownLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/how_to/markdown\",\"beta\":false,\"error\":null},\"UnstructuredPowerPointLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".pptx\",\".ppt\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"pptx\",\"ppt\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"UnstructuredPowerPointLoader\"},\"description\":\"Load `Microsoft PowerPoint` files using `Unstructured`.\",\"base_classes\":[\"Document\"],\"display_name\":\"UnstructuredPowerPointLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/microsoft_powerpoint\",\"beta\":false,\"error\":null},\"UnstructuredWordDocumentLoader\":{\"template\":{\"file_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"suffixes\":[\".docx\",\".doc\"],\"password\":false,\"name\":\"file_path\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"file\",\"list\":false,\"fileTypes\":[\"docx\",\"doc\"],\"file_path\":null},\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"_type\":\"UnstructuredWordDocumentLoader\"},\"description\":\"Load `Microsof Word` file using `Unstructured`.\",\"base_classes\":[\"Document\"],\"display_name\":\"UnstructuredWordDocumentLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/microsoft_word\",\"beta\":false,\"error\":null},\"WebBaseLoader\":{\"template\":{\"metadata\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{}\",\"password\":false,\"name\":\"metadata\",\"display_name\":\"Metadata\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"web_path\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"web_path\",\"display_name\":\"Web Page\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"WebBaseLoader\"},\"description\":\"Load HTML pages using `urllib` and parse them with `BeautifulSoup'.\",\"base_classes\":[\"Document\"],\"display_name\":\"WebBaseLoader\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/web_base\",\"beta\":false,\"error\":null}},\"textsplitters\":{\"CharacterTextSplitter\":{\"template\":{\"documents\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":true},\"chunk_overlap\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":200,\"password\":false,\"name\":\"chunk_overlap\",\"display_name\":\"Chunk Overlap\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"chunk_size\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":1000,\"password\":false,\"name\":\"chunk_size\",\"display_name\":\"Chunk Size\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"separator\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\\\\n\",\"password\":false,\"name\":\"separator\",\"display_name\":\"Separator\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"CharacterTextSplitter\"},\"description\":\"Splitting text that looks at characters.\",\"base_classes\":[\"Document\"],\"display_name\":\"CharacterTextSplitter\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/character_text_splitter\",\"beta\":false,\"error\":null},\"RecursiveCharacterTextSplitter\":{\"template\":{\"documents\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"documents\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":true},\"chunk_overlap\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":200,\"password\":false,\"name\":\"chunk_overlap\",\"display_name\":\"Chunk Overlap\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"chunk_size\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":1000,\"password\":false,\"name\":\"chunk_size\",\"display_name\":\"Chunk Size\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"separator_type\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"Text\",\"password\":false,\"options\":[\"Text\",\"cpp\",\"go\",\"html\",\"java\",\"js\",\"latex\",\"markdown\",\"php\",\"proto\",\"python\",\"rst\",\"ruby\",\"rust\",\"scala\",\"sol\",\"swift\"],\"name\":\"separator_type\",\"display_name\":\"Separator Type\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"separators\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"\\\\n\",\"password\":false,\"name\":\"separators\",\"display_name\":\"Separator\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"RecursiveCharacterTextSplitter\"},\"description\":\"Splitting text by recursively look at characters.\",\"base_classes\":[\"Document\"],\"display_name\":\"RecursiveCharacterTextSplitter\",\"custom_fields\":{},\"output_types\":[\"Document\"],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/recursive_text_splitter\",\"beta\":false,\"error\":null}},\"utilities\":{\"BingSearchAPIWrapper\":{\"template\":{\"bing_search_url\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"bing_search_url\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"bing_subscription_key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"bing_subscription_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"k\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":10,\"password\":false,\"name\":\"k\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"_type\":\"BingSearchAPIWrapper\"},\"description\":\"Wrapper for Bing Search API.\",\"base_classes\":[\"BingSearchAPIWrapper\"],\"display_name\":\"BingSearchAPIWrapper\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"GoogleSearchAPIWrapper\":{\"template\":{\"google_api_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"google_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"google_cse_id\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"google_cse_id\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"k\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":10,\"password\":false,\"name\":\"k\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"search_engine\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"search_engine\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"siterestrict\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"siterestrict\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"GoogleSearchAPIWrapper\"},\"description\":\"Wrapper for Google Search API.\",\"base_classes\":[\"GoogleSearchAPIWrapper\"],\"display_name\":\"GoogleSearchAPIWrapper\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"GoogleSerperAPIWrapper\":{\"template\":{\"aiosession\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"aiosession\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"ClientSession\",\"list\":false},\"gl\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"us\",\"password\":false,\"name\":\"gl\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"hl\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"en\",\"password\":false,\"name\":\"hl\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"k\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":10,\"password\":false,\"name\":\"k\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"result_key_for_type\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"{\\n \\\"news\\\": \\\"news\\\",\\n \\\"places\\\": \\\"places\\\",\\n \\\"images\\\": \\\"images\\\",\\n \\\"search\\\": \\\"organic\\\"\\n}\",\"password\":true,\"name\":\"result_key_for_type\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"serper_api_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"serper_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"tbs\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"tbs\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"type\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"search\",\"password\":false,\"options\":[\"news\",\"search\",\"places\",\"images\"],\"name\":\"type\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"_type\":\"GoogleSerperAPIWrapper\"},\"description\":\"Wrapper around the Serper.dev Google Search API.\",\"base_classes\":[\"GoogleSerperAPIWrapper\"],\"display_name\":\"GoogleSerperAPIWrapper\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"SearxSearchWrapper\":{\"template\":{\"aiosession\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"aiosession\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"categories\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"categories\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"engines\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"engines\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":true},\"headers\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"{'Authorization': 'Bearer '}\",\"password\":false,\"name\":\"headers\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"k\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":10,\"password\":false,\"name\":\"k\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"params\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"params\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"query_suffix\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"query_suffix\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"searx_host\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"\",\"password\":false,\"name\":\"searx_host\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"unsecure\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"unsecure\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"_type\":\"SearxSearchWrapper\"},\"description\":\"Wrapper for Searx API.\",\"base_classes\":[\"SearxSearchWrapper\"],\"display_name\":\"SearxSearchWrapper\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"SerpAPIWrapper\":{\"template\":{\"aiosession\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"aiosession\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"ClientSession\",\"list\":false},\"params\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"{\\n \\\"engine\\\": \\\"google\\\",\\n \\\"google_domain\\\": \\\"google.com\\\",\\n \\\"gl\\\": \\\"us\\\",\\n \\\"hl\\\": \\\"en\\\"\\n}\",\"password\":false,\"name\":\"params\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"code\",\"list\":false},\"search_engine\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"search_engine\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"serpapi_api_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":true,\"name\":\"serpapi_api_key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"SerpAPIWrapper\"},\"description\":\"Wrapper around SerpAPI.\",\"base_classes\":[\"SerpAPIWrapper\"],\"display_name\":\"SerpAPIWrapper\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"WikipediaAPIWrapper\":{\"template\":{\"doc_content_chars_max\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":4000,\"password\":false,\"name\":\"doc_content_chars_max\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"lang\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":\"en\",\"password\":false,\"name\":\"lang\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"load_all_available_meta\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":false,\"password\":false,\"name\":\"load_all_available_meta\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"bool\",\"list\":false},\"top_k_results\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"value\":3,\"password\":false,\"name\":\"top_k_results\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"int\",\"list\":false},\"wiki_client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"wiki_client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"_type\":\"WikipediaAPIWrapper\"},\"description\":\"Wrapper around WikipediaAPI.\",\"base_classes\":[\"WikipediaAPIWrapper\"],\"display_name\":\"WikipediaAPIWrapper\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"WolframAlphaAPIWrapper\":{\"template\":{\"wolfram_alpha_appid\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"wolfram_alpha_appid\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"wolfram_client\":{\"required\":false,\"placeholder\":\"\",\"show\":false,\"multiline\":false,\"password\":false,\"name\":\"wolfram_client\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Any\",\"list\":false},\"_type\":\"WolframAlphaAPIWrapper\"},\"description\":\"Wrapper for Wolfram Alpha.\",\"base_classes\":[\"WolframAlphaAPIWrapper\"],\"display_name\":\"WolframAlphaAPIWrapper\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"\",\"beta\":false,\"error\":null},\"GetRequest\":{\"template\":{\"code\":{\"dynamic\":true,\"required\":true,\"placeholder\":\"\",\"show\":false,\"multiline\":true,\"value\":\"from langflow import CustomComponent\\nfrom langchain.schema import Document\\nfrom langflow.services.database.models.base import orjson_dumps\\nimport requests\\nfrom typing import Optional\\n\\n\\nclass GetRequest(CustomComponent):\\n display_name: str = \\\"GET Request\\\"\\n description: str = \\\"Make a GET request to the given URL.\\\"\\n output_types: list[str] = [\\\"Document\\\"]\\n documentation: str = \\\"https://docs.langflow.org/components/utilities#get-request\\\"\\n beta = True\\n field_config = {\\n \\\"url\\\": {\\n \\\"display_name\\\": \\\"URL\\\",\\n \\\"info\\\": \\\"The URL to make the request to\\\",\\n \\\"is_list\\\": True,\\n },\\n \\\"headers\\\": {\\n \\\"display_name\\\": \\\"Headers\\\",\\n \\\"field_type\\\": \\\"code\\\",\\n \\\"info\\\": \\\"The headers to send with the request.\\\",\\n },\\n \\\"code\\\": {\\\"show\\\": False},\\n \\\"timeout\\\": {\\n \\\"display_name\\\": \\\"Timeout\\\",\\n \\\"field_type\\\": \\\"int\\\",\\n \\\"info\\\": \\\"The timeout to use for the request.\\\",\\n \\\"value\\\": 5,\\n },\\n }\\n\\n def get_document(\\n self, session: requests.Session, url: str, headers: Optional[dict], timeout: int\\n ) -> Document:\\n try:\\n response = session.get(url, headers=headers, timeout=int(timeout))\\n try:\\n response_json = response.json()\\n result = orjson_dumps(response_json, indent_2=False)\\n except Exception:\\n result = response.text\\n self.repr_value = result\\n return Document(\\n page_content=result,\\n metadata={\\n \\\"source\\\": url,\\n \\\"headers\\\": headers,\\n \\\"status_code\\\": response.status_code,\\n },\\n )\\n except requests.Timeout:\\n return Document(\\n page_content=\\\"Request Timed Out\\\",\\n metadata={\\\"source\\\": url, \\\"headers\\\": headers, \\\"status_code\\\": 408},\\n )\\n except Exception as exc:\\n return Document(\\n page_content=str(exc),\\n metadata={\\\"source\\\": url, \\\"headers\\\": headers, \\\"status_code\\\": 500},\\n )\\n\\n def build(\\n self,\\n url: str,\\n headers: Optional[dict] = None,\\n timeout: int = 5,\\n ) -> list[Document]:\\n if headers is None:\\n headers = {}\\n urls = url if isinstance(url, list) else [url]\\n with requests.Session() as session:\\n documents = [self.get_document(session, u, headers, timeout) for u in urls]\\n self.repr_value = documents\\n return documents\\n\",\"password\":false,\"name\":\"code\",\"advanced\":false,\"type\":\"code\",\"list\":false},\"_type\":\"CustomComponent\",\"headers\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"headers\",\"display_name\":\"Headers\",\"advanced\":false,\"dynamic\":false,\"info\":\"The headers to send with the request.\",\"type\":\"code\",\"list\":false},\"timeout\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":5,\"password\":false,\"name\":\"timeout\",\"display_name\":\"Timeout\",\"advanced\":false,\"dynamic\":false,\"info\":\"The timeout to use for the request.\",\"type\":\"int\",\"list\":false},\"url\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"url\",\"display_name\":\"URL\",\"advanced\":false,\"dynamic\":false,\"info\":\"The URL to make the request to\",\"type\":\"str\",\"list\":true}},\"description\":\"Make a GET request to the given URL.\",\"base_classes\":[\"Document\"],\"display_name\":\"GET Request\",\"custom_fields\":{\"headers\":null,\"timeout\":null,\"url\":null},\"output_types\":[\"GetRequest\"],\"documentation\":\"https://docs.langflow.org/components/utilities#get-request\",\"beta\":true,\"error\":null},\"PostRequest\":{\"template\":{\"code\":{\"dynamic\":true,\"required\":true,\"placeholder\":\"\",\"show\":false,\"multiline\":true,\"value\":\"from langflow import CustomComponent\\nfrom langchain.schema import Document\\nfrom langflow.services.database.models.base import orjson_dumps\\nimport requests\\nfrom typing import Optional\\n\\n\\nclass PostRequest(CustomComponent):\\n display_name: str = \\\"POST Request\\\"\\n description: str = \\\"Make a POST request to the given URL.\\\"\\n output_types: list[str] = [\\\"Document\\\"]\\n documentation: str = \\\"https://docs.langflow.org/components/utilities#post-request\\\"\\n beta = True\\n field_config = {\\n \\\"url\\\": {\\\"display_name\\\": \\\"URL\\\", \\\"info\\\": \\\"The URL to make the request to.\\\"},\\n \\\"headers\\\": {\\n \\\"display_name\\\": \\\"Headers\\\",\\n \\\"field_type\\\": \\\"code\\\",\\n \\\"info\\\": \\\"The headers to send with the request.\\\",\\n },\\n \\\"code\\\": {\\\"show\\\": False},\\n \\\"document\\\": {\\\"display_name\\\": \\\"Document\\\"},\\n }\\n\\n def post_document(\\n self,\\n session: requests.Session,\\n document: Document,\\n url: str,\\n headers: Optional[dict] = None,\\n ) -> Document:\\n try:\\n response = session.post(url, headers=headers, data=document.page_content)\\n try:\\n response_json = response.json()\\n result = orjson_dumps(response_json, indent_2=False)\\n except Exception:\\n result = response.text\\n self.repr_value = result\\n return Document(\\n page_content=result,\\n metadata={\\n \\\"source\\\": url,\\n \\\"headers\\\": headers,\\n \\\"status_code\\\": response,\\n },\\n )\\n except Exception as exc:\\n return Document(\\n page_content=str(exc),\\n metadata={\\n \\\"source\\\": url,\\n \\\"headers\\\": headers,\\n \\\"status_code\\\": 500,\\n },\\n )\\n\\n def build(\\n self,\\n document: Document,\\n url: str,\\n headers: Optional[dict] = None,\\n ) -> list[Document]:\\n if headers is None:\\n headers = {}\\n\\n if not isinstance(document, list) and isinstance(document, Document):\\n documents: list[Document] = [document]\\n elif isinstance(document, list) and all(\\n isinstance(doc, Document) for doc in document\\n ):\\n documents = document\\n else:\\n raise ValueError(\\\"document must be a Document or a list of Documents\\\")\\n\\n with requests.Session() as session:\\n documents = [\\n self.post_document(session, doc, url, headers) for doc in documents\\n ]\\n self.repr_value = documents\\n return documents\\n\",\"password\":false,\"name\":\"code\",\"advanced\":false,\"type\":\"code\",\"list\":false},\"_type\":\"CustomComponent\",\"document\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"document\",\"display_name\":\"Document\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":false},\"headers\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"headers\",\"display_name\":\"Headers\",\"advanced\":false,\"dynamic\":false,\"info\":\"The headers to send with the request.\",\"type\":\"code\",\"list\":false},\"url\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"url\",\"display_name\":\"URL\",\"advanced\":false,\"dynamic\":false,\"info\":\"The URL to make the request to.\",\"type\":\"str\",\"list\":false}},\"description\":\"Make a POST request to the given URL.\",\"base_classes\":[\"Document\"],\"display_name\":\"POST Request\",\"custom_fields\":{\"document\":null,\"headers\":null,\"url\":null},\"output_types\":[\"PostRequest\"],\"documentation\":\"https://docs.langflow.org/components/utilities#post-request\",\"beta\":true,\"error\":null},\"UpdateRequest\":{\"template\":{\"code\":{\"dynamic\":true,\"required\":true,\"placeholder\":\"\",\"show\":false,\"multiline\":true,\"value\":\"from typing import List, Optional\\nimport requests\\nfrom langflow import CustomComponent\\nfrom langchain.schema import Document\\nfrom langflow.services.database.models.base import orjson_dumps\\n\\n\\nclass UpdateRequest(CustomComponent):\\n display_name: str = \\\"Update Request\\\"\\n description: str = \\\"Make a PATCH request to the given URL.\\\"\\n output_types: list[str] = [\\\"Document\\\"]\\n documentation: str = \\\"https://docs.langflow.org/components/utilities#update-request\\\"\\n beta = True\\n field_config = {\\n \\\"url\\\": {\\\"display_name\\\": \\\"URL\\\", \\\"info\\\": \\\"The URL to make the request to.\\\"},\\n \\\"headers\\\": {\\n \\\"display_name\\\": \\\"Headers\\\",\\n \\\"field_type\\\": \\\"code\\\",\\n \\\"info\\\": \\\"The headers to send with the request.\\\",\\n },\\n \\\"code\\\": {\\\"show\\\": False},\\n \\\"document\\\": {\\\"display_name\\\": \\\"Document\\\"},\\n \\\"method\\\": {\\n \\\"display_name\\\": \\\"Method\\\",\\n \\\"field_type\\\": \\\"str\\\",\\n \\\"info\\\": \\\"The HTTP method to use.\\\",\\n \\\"options\\\": [\\\"PATCH\\\", \\\"PUT\\\"],\\n \\\"value\\\": \\\"PATCH\\\",\\n },\\n }\\n\\n def update_document(\\n self,\\n session: requests.Session,\\n document: Document,\\n url: str,\\n headers: Optional[dict] = None,\\n method: str = \\\"PATCH\\\",\\n ) -> Document:\\n try:\\n if method == \\\"PATCH\\\":\\n response = session.patch(\\n url, headers=headers, data=document.page_content\\n )\\n elif method == \\\"PUT\\\":\\n response = session.put(url, headers=headers, data=document.page_content)\\n else:\\n raise ValueError(f\\\"Unsupported method: {method}\\\")\\n try:\\n response_json = response.json()\\n result = orjson_dumps(response_json, indent_2=False)\\n except Exception:\\n result = response.text\\n self.repr_value = result\\n return Document(\\n page_content=result,\\n metadata={\\n \\\"source\\\": url,\\n \\\"headers\\\": headers,\\n \\\"status_code\\\": response.status_code,\\n },\\n )\\n except Exception as exc:\\n return Document(\\n page_content=str(exc),\\n metadata={\\\"source\\\": url, \\\"headers\\\": headers, \\\"status_code\\\": 500},\\n )\\n\\n def build(\\n self,\\n method: str,\\n document: Document,\\n url: str,\\n headers: Optional[dict] = None,\\n ) -> List[Document]:\\n if headers is None:\\n headers = {}\\n\\n if not isinstance(document, list) and isinstance(document, Document):\\n documents: list[Document] = [document]\\n elif isinstance(document, list) and all(\\n isinstance(doc, Document) for doc in document\\n ):\\n documents = document\\n else:\\n raise ValueError(\\\"document must be a Document or a list of Documents\\\")\\n\\n with requests.Session() as session:\\n documents = [\\n self.update_document(session, doc, url, headers, method)\\n for doc in documents\\n ]\\n self.repr_value = documents\\n return documents\\n\",\"password\":false,\"name\":\"code\",\"advanced\":false,\"type\":\"code\",\"list\":false},\"_type\":\"CustomComponent\",\"document\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"document\",\"display_name\":\"Document\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":false},\"headers\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"headers\",\"display_name\":\"Headers\",\"advanced\":false,\"dynamic\":false,\"info\":\"The headers to send with the request.\",\"type\":\"code\",\"list\":false},\"method\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"PATCH\",\"password\":false,\"options\":[\"PATCH\",\"PUT\"],\"name\":\"method\",\"display_name\":\"Method\",\"advanced\":false,\"dynamic\":false,\"info\":\"The HTTP method to use.\",\"type\":\"str\",\"list\":true},\"url\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"url\",\"display_name\":\"URL\",\"advanced\":false,\"dynamic\":false,\"info\":\"The URL to make the request to.\",\"type\":\"str\",\"list\":false}},\"description\":\"Make a PATCH request to the given URL.\",\"base_classes\":[\"Document\"],\"display_name\":\"Update Request\",\"custom_fields\":{\"document\":null,\"headers\":null,\"method\":null,\"url\":null},\"output_types\":[\"UpdateRequest\"],\"documentation\":\"https://docs.langflow.org/components/utilities#update-request\",\"beta\":true,\"error\":null},\"JSONDocumentBuilder\":{\"template\":{\"code\":{\"dynamic\":true,\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"value\":\"### JSON Document Builder\\n\\n# Build a Document containing a JSON object using a key and another Document page content.\\n\\n# **Params**\\n\\n# - **Key:** The key to use for the JSON object.\\n# - **Document:** The Document page to use for the JSON object.\\n\\n# **Output**\\n\\n# - **Document:** The Document containing the JSON object.\\n\\nfrom langflow import CustomComponent\\nfrom langchain.schema import Document\\nfrom langflow.services.database.models.base import orjson_dumps\\n\\n\\nclass JSONDocumentBuilder(CustomComponent):\\n display_name: str = \\\"JSON Document Builder\\\"\\n description: str = \\\"Build a Document containing a JSON object using a key and another Document page content.\\\"\\n output_types: list[str] = [\\\"Document\\\"]\\n beta = True\\n documentation: str = (\\n \\\"https://docs.langflow.org/components/utilities#json-document-builder\\\"\\n )\\n\\n field_config = {\\n \\\"key\\\": {\\\"display_name\\\": \\\"Key\\\"},\\n \\\"document\\\": {\\\"display_name\\\": \\\"Document\\\"},\\n }\\n\\n def build(\\n self,\\n key: str,\\n document: Document,\\n ) -> Document:\\n documents = None\\n if isinstance(document, list):\\n documents = [\\n Document(\\n page_content=orjson_dumps({key: doc.page_content}, indent_2=False)\\n )\\n for doc in document\\n ]\\n elif isinstance(document, Document):\\n documents = Document(\\n page_content=orjson_dumps({key: document.page_content}, indent_2=False)\\n )\\n else:\\n raise TypeError(\\n f\\\"Expected Document or list of Documents, got {type(document)}\\\"\\n )\\n self.repr_value = documents\\n return documents\\n\",\"password\":false,\"name\":\"code\",\"advanced\":false,\"type\":\"code\",\"list\":false},\"_type\":\"CustomComponent\",\"document\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"document\",\"display_name\":\"Document\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"Document\",\"list\":false},\"key\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"key\",\"display_name\":\"Key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false}},\"description\":\"Build a Document containing a JSON object using a key and another Document page content.\",\"base_classes\":[\"Document\"],\"display_name\":\"JSON Document Builder\",\"custom_fields\":{\"document\":null,\"key\":null},\"output_types\":[\"JSONDocumentBuilder\"],\"documentation\":\"https://docs.langflow.org/components/utilities#json-document-builder\",\"beta\":true,\"error\":null}},\"output_parsers\":{\"ResponseSchema\":{\"template\":{\"description\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":true,\"password\":false,\"name\":\"description\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"name\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"name\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"type\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"string\",\"password\":false,\"name\":\"type\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"ResponseSchema\"},\"description\":\"A schema for a response from a structured output parser.\",\"base_classes\":[\"ResponseSchema\"],\"display_name\":\"ResponseSchema\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/output_parsers/structured\",\"beta\":false,\"error\":null},\"StructuredOutputParser\":{\"template\":{\"response_schemas\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"response_schemas\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"ResponseSchema\",\"list\":true},\"_type\":\"StructuredOutputParser\"},\"description\":\"\",\"base_classes\":[\"StructuredOutputParser\",\"BaseOutputParser\",\"BaseLLMOutputParser\"],\"display_name\":\"StructuredOutputParser\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/model_io/output_parsers/structured\",\"beta\":false,\"error\":null}},\"retrievers\":{\"MultiQueryRetriever\":{\"template\":{\"llm\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"llm\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseLLM\",\"list\":false},\"prompt\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":{\"input_variables\":[\"question\"],\"output_parser\":null,\"partial_variables\":{},\"template\":\"You are an AI language model assistant. Your task is \\n to generate 3 different versions of the given user \\n question to retrieve relevant documents from a vector database. \\n By generating multiple perspectives on the user question, \\n your goal is to help the user overcome some of the limitations \\n of distance-based similarity search. Provide these alternative \\n questions separated by newlines. Original question: {question}\",\"template_format\":\"f-string\",\"validate_template\":true,\"_type\":\"prompt\"},\"password\":false,\"name\":\"prompt\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"PromptTemplate\",\"list\":false},\"retriever\":{\"required\":true,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"password\":false,\"name\":\"retriever\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"BaseRetriever\",\"list\":false},\"parser_key\":{\"required\":false,\"placeholder\":\"\",\"show\":true,\"multiline\":false,\"value\":\"lines\",\"password\":false,\"name\":\"parser_key\",\"display_name\":\"Parser Key\",\"advanced\":false,\"dynamic\":false,\"info\":\"\",\"type\":\"str\",\"list\":false},\"_type\":\"MultiQueryRetriever\"},\"description\":\"Initialize from llm using default template.\",\"base_classes\":[\"BaseRetriever\",\"MultiQueryRetriever\"],\"display_name\":\"MultiQueryRetriever\",\"custom_fields\":{},\"output_types\":[],\"documentation\":\"https://python.langchain.com/docs/modules/data_connection/retrievers/how_to/MultiQueryRetriever\",\"beta\":false,\"error\":null}},\"custom_components\":{\"CustomComponent\":{\"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 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}}}" + }, + "headersSize": -1, + "bodySize": -1, + "redirectURL": "" + }, + "cache": {}, + "timings": { "send": -1, "wait": -1, "receive": 1.031 } + }, + { + "startedDateTime": "2023-08-31T14:55:36.131Z", + "time": 0.743, + "request": { + "method": "GET", + "url": "http://localhost:3000/api/v1/flows/", + "httpVersion": "HTTP/1.1", + "cookies": [], + "headers": [ + { "name": "Accept", "value": "application/json, text/plain, */*" }, + { "name": "Accept-Encoding", "value": "gzip, deflate, br" }, + { "name": "Accept-Language", "value": "en-US,en;q=0.9" }, + { "name": "Authorization", "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiNWIxYjFhZC05M2VjLTRjMjgtYWMxNy01OGMxNDQ0MWI1ZGQiLCJleHAiOjE3MjUwMjk3MzV9.8qhEtryWqA9RbwEP2s20umKdVE7J7jHGoogXZqxLNWk" }, + { "name": "Connection", "value": "keep-alive" }, + { "name": "Cookie", "value": "access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiNWIxYjFhZC05M2VjLTRjMjgtYWMxNy01OGMxNDQ0MWI1ZGQiLCJleHAiOjE3MjUwMjk3MzV9.8qhEtryWqA9RbwEP2s20umKdVE7J7jHGoogXZqxLNWk; refresh_token=auto" }, + { "name": "Host", "value": "localhost:3000" }, + { "name": "Referer", "value": "http://localhost:3000/" }, + { "name": "Sec-Fetch-Dest", "value": "empty" }, + { "name": "Sec-Fetch-Mode", "value": "cors" }, + { "name": "Sec-Fetch-Site", "value": "same-origin" }, + { "name": "User-Agent", "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" }, + { "name": "sec-ch-ua", "value": "\"Not)A;Brand\";v=\"24\", \"Chromium\";v=\"116\"" }, + { "name": "sec-ch-ua-mobile", "value": "?0" }, + { "name": "sec-ch-ua-platform", "value": "\"Linux\"" } + ], + "queryString": [], + "headersSize": -1, + "bodySize": -1 + }, + "response": { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "cookies": [], + "headers": [ + { "name": "Access-Control-Allow-Origin", "value": "*" }, + { "name": "connection", "value": "close" }, + { "name": "content-length", "value": "2" }, + { "name": "content-type", "value": "application/json" }, + { "name": "date", "value": "Thu, 31 Aug 2023 14:55:35 GMT" }, + { "name": "server", "value": "uvicorn" } + ], + "content": { + "size": -1, + "mimeType": "application/json", + "text": "[]" + }, + "headersSize": -1, + "bodySize": -1, + "redirectURL": "" + }, + "cache": {}, + "timings": { "send": -1, "wait": -1, "receive": 0.743 } + } + ] + } + } \ No newline at end of file diff --git a/src/frontend/nginx.conf b/src/frontend/nginx.conf index df665f5b6..cabf31c7a 100644 --- a/src/frontend/nginx.conf +++ b/src/frontend/nginx.conf @@ -1,18 +1,20 @@ server { - gzip on; - gzip_comp_level 2; - gzip_min_length 1000; - gzip_types text/xml text/css; - gzip_http_version 1.1; - gzip_vary on; - gzip_disable "MSIE [4-6] \."; + gzip on; + gzip_comp_level 2; + gzip_min_length 1000; + gzip_types text/xml text/css; + gzip_http_version 1.1; + gzip_vary on; + gzip_disable "MSIE [4-6] \."; - listen 80; + listen 80; - location / { - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html =404; - } - + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html =404; + } + + + include /etc/nginx/extra-conf.d/*.conf; } diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index 8aaf272a8..9c365904a 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -58,7 +58,8 @@ "react-syntax-highlighter": "^15.5.0", "react-tabs": "^6.0.2", "react-tooltip": "^5.21.1", - "reactflow": "^11.8.3", + "react18-json-view": "^0.2.3", + "reactflow": "^11.9.2", "rehype-mathjax": "^4.0.3", "remark-gfm": "^3.0.1", "remark-math": "^5.1.1", @@ -73,6 +74,7 @@ "web-vitals": "^2.1.4" }, "devDependencies": { + "@playwright/test": "^1.38.0", "@swc/cli": "^0.1.62", "@swc/core": "^1.3.80", "@tailwindcss/typography": "^0.5.9", @@ -1163,14 +1165,14 @@ } }, "node_modules/@mui/base": { - "version": "5.0.0-beta.18", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.18.tgz", - "integrity": "sha512-e9ZCy/ndhyt5MTshAS3qAUy/40UiO0jX+kAo6a+XirrPJE+rrQW+mKPSI0uyp+5z4Vh+z0pvNoJ2S2gSrNz3BQ==", + "version": "5.0.0-beta.17", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.17.tgz", + "integrity": "sha512-xNbk7iOXrglNdIxFBN0k3ySsPIFLWCnFxqsAYl7CIcDkD9low4kJ7IUuy6ctwx/HAy2fenrT3KXHr1sGjAMgpQ==", "dependencies": { - "@babel/runtime": "^7.23.1", + "@babel/runtime": "^7.22.15", "@floating-ui/react-dom": "^2.0.2", - "@mui/types": "^7.2.5", - "@mui/utils": "^5.14.12", + "@mui/types": "^7.2.4", + "@mui/utils": "^5.14.11", "@popperjs/core": "^2.11.8", "clsx": "^2.0.0", "prop-types": "^15.8.1" @@ -1202,25 +1204,25 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.12.tgz", - "integrity": "sha512-WZhCkKqhrXaSVBzoC6LNcVkIawS000OOt7gmnp4g9HhyvN0PSclRXc/JrkC7EwfzUAZJh+hiK2LaVsbtOpNuOg==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.11.tgz", + "integrity": "sha512-uY8FLQURhXe3f3O4dS5OSGML9KDm9+IE226cBu78jarVIzdQGPlXwGIlSI9VJR8MvZDA6C0+6XfWDhWCHruC5Q==", "funding": { "type": "opencollective", "url": "https://opencollective.com/mui" } }, "node_modules/@mui/material": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.12.tgz", - "integrity": "sha512-EelF2L46VcVqhg3KjzIGBBpOtcBgRh0MMy9Efuk6Do81QdcZsFC9RebCVAflo5jIdbHiBmxBs5/l5Q9NjONozg==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.11.tgz", + "integrity": "sha512-DnSdJzcR7lwG12JA5L2t8JF+RDzMygu5rCNW+logWb/KW2/TRzwLyVWO+CorHTBjBRd38DBxnwOCDiYkDd+N3A==", "dependencies": { - "@babel/runtime": "^7.23.1", - "@mui/base": "5.0.0-beta.18", - "@mui/core-downloads-tracker": "^5.14.12", - "@mui/system": "^5.14.12", - "@mui/types": "^7.2.5", - "@mui/utils": "^5.14.12", + "@babel/runtime": "^7.22.15", + "@mui/base": "5.0.0-beta.17", + "@mui/core-downloads-tracker": "^5.14.11", + "@mui/system": "^5.14.11", + "@mui/types": "^7.2.4", + "@mui/utils": "^5.14.11", "@types/react-transition-group": "^4.4.6", "clsx": "^2.0.0", "csstype": "^3.1.2", @@ -1263,12 +1265,12 @@ } }, "node_modules/@mui/private-theming": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.12.tgz", - "integrity": "sha512-TWwm+9+BgHFpoR3w04FG+IqID4ALa74A27RuKq2CEaWgxliBZB24EVeI6djfjFt5t4FYmIb8BMw2ZJEir7YjLQ==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.11.tgz", + "integrity": "sha512-MSnNNzTu9pfKLCKs1ZAKwOTgE4bz+fQA0fNr8Jm7NDmuWmw0CaN9Vq2/MHsatE7+S0A25IAKby46Uv1u53rKVQ==", "dependencies": { - "@babel/runtime": "^7.23.1", - "@mui/utils": "^5.14.12", + "@babel/runtime": "^7.22.15", + "@mui/utils": "^5.14.11", "prop-types": "^15.8.1" }, "engines": { @@ -1289,11 +1291,11 @@ } }, "node_modules/@mui/styled-engine": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.12.tgz", - "integrity": "sha512-bocxt1nDmXfB3gpLfCCmFCyJ7sVmscFs+PuheO210QagZwHVp47UIRT1AiswLDYSQo1ZqmVGn7KLEJEYK0d4Xw==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.11.tgz", + "integrity": "sha512-jdUlqRgTYQ8RMtPX4MbRZqar6W2OiIb6J5KEFbIu4FqvPrk44Each4ppg/LAqp1qNlBYq5i+7Q10MYLMpDxX9A==", "dependencies": { - "@babel/runtime": "^7.23.1", + "@babel/runtime": "^7.22.15", "@emotion/cache": "^11.11.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -1320,15 +1322,15 @@ } }, "node_modules/@mui/system": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.12.tgz", - "integrity": "sha512-6DXfjjLhW0/ia5qU3Crke7j+MnfDbMBOHlLIrqbrEqNs0AuSBv8pXniEGb+kqO0H804NJreRTEJRjCngwOX5CA==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.11.tgz", + "integrity": "sha512-yl8xV+y0k7j6dzBsHabKwoShmjqLa8kTxrhUI3JpqLG358VRVMJRW/ES0HhvfcCi4IVXde+Tc2P3K1akGL8zoA==", "dependencies": { - "@babel/runtime": "^7.23.1", - "@mui/private-theming": "^5.14.12", - "@mui/styled-engine": "^5.14.12", - "@mui/types": "^7.2.5", - "@mui/utils": "^5.14.12", + "@babel/runtime": "^7.22.15", + "@mui/private-theming": "^5.14.11", + "@mui/styled-engine": "^5.14.11", + "@mui/types": "^7.2.4", + "@mui/utils": "^5.14.11", "clsx": "^2.0.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -1380,12 +1382,12 @@ } }, "node_modules/@mui/utils": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.12.tgz", - "integrity": "sha512-RFNXnhKQlzIkIUig6mmv0r5VbtjPdWoaBPYicq25LETdZux59HAqoRdWw15T7lp3c7gXOoE8y67+hTB8C64m2g==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.11.tgz", + "integrity": "sha512-fmkIiCPKyDssYrJ5qk+dime1nlO3dmWfCtaPY/uVBqCRMBZ11JhddB9m8sjI2mgqQQwRJG5bq3biaosNdU/s4Q==", "dependencies": { - "@babel/runtime": "^7.23.1", - "@types/prop-types": "^15.7.7", + "@babel/runtime": "^7.22.15", + "@types/prop-types": "^15.7.5", "prop-types": "^15.8.1", "react-is": "^18.2.0" }, @@ -1438,6 +1440,21 @@ "node": ">= 8" } }, + "node_modules/@playwright/test": { + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz", + "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==", + "dev": true, + "dependencies": { + "playwright": "1.38.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@popperjs/core": { "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", @@ -2984,9 +3001,9 @@ } }, "node_modules/@swc/core": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.92.tgz", - "integrity": "sha512-vx0vUrf4YTEw59njOJ46Ha5i0cZTMYdRHQ7KXU29efN1MxcmJH2RajWLPlvQarOP1ab9iv9cApD7SMchDyx2vA==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.91.tgz", + "integrity": "sha512-r950d0fdlZ8qbSDyvApn3HyCojiZE8xpgJzQvypeMi32dalYwugdJKWyLB55JIGMRGJ8+lmVvY4MPGkSR3kXgA==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -3001,16 +3018,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.3.92", - "@swc/core-darwin-x64": "1.3.92", - "@swc/core-linux-arm-gnueabihf": "1.3.92", - "@swc/core-linux-arm64-gnu": "1.3.92", - "@swc/core-linux-arm64-musl": "1.3.92", - "@swc/core-linux-x64-gnu": "1.3.92", - "@swc/core-linux-x64-musl": "1.3.92", - "@swc/core-win32-arm64-msvc": "1.3.92", - "@swc/core-win32-ia32-msvc": "1.3.92", - "@swc/core-win32-x64-msvc": "1.3.92" + "@swc/core-darwin-arm64": "1.3.91", + "@swc/core-darwin-x64": "1.3.91", + "@swc/core-linux-arm-gnueabihf": "1.3.91", + "@swc/core-linux-arm64-gnu": "1.3.91", + "@swc/core-linux-arm64-musl": "1.3.91", + "@swc/core-linux-x64-gnu": "1.3.91", + "@swc/core-linux-x64-musl": "1.3.91", + "@swc/core-win32-arm64-msvc": "1.3.91", + "@swc/core-win32-ia32-msvc": "1.3.91", + "@swc/core-win32-x64-msvc": "1.3.91" }, "peerDependencies": { "@swc/helpers": "^0.5.0" @@ -3022,9 +3039,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.92.tgz", - "integrity": "sha512-v7PqZUBtIF6Q5Cp48gqUiG8zQQnEICpnfNdoiY3xjQAglCGIQCjJIDjreZBoeZQZspB27lQN4eZ43CX18+2SnA==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.91.tgz", + "integrity": "sha512-7kHGiQ1he5khcEeJuHDmLZPM3rRL/ith5OTmV6bOPsoHi46kLeixORW+ts1opC3tC9vu6xbk16xgX0QAJchc1w==", "cpu": [ "arm64" ], @@ -3038,9 +3055,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.92.tgz", - "integrity": "sha512-Q3XIgQfXyxxxms3bPN+xGgvwk0TtG9l89IomApu+yTKzaIIlf051mS+lGngjnh9L0aUiCp6ICyjDLtutWP54fw==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.91.tgz", + "integrity": "sha512-8SpU18FbFpZDVzsHsAwdI1thF/picQGxq9UFxa8W+T9SDnbsqwFJv/6RqKJeJoDV6qFdl2OLjuO0OL7xrp0qnQ==", "cpu": [ "x64" ], @@ -3054,9 +3071,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.92.tgz", - "integrity": "sha512-tnOCoCpNVXC+0FCfG84PBZJyLlz0Vfj9MQhyhCvlJz9hQmvpf8nTdKH7RHrOn8VfxtUBLdVi80dXgIFgbvl7qA==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.91.tgz", + "integrity": "sha512-fOq4Cy8UbwX1yf0WB0d8hWZaIKCnPtPGguRqdXGLfwvhjZ9SIErT6PnmGTGRbQCNCIkOZWHKyTU0r8t2dN3haQ==", "cpu": [ "arm" ], @@ -3070,9 +3087,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.92.tgz", - "integrity": "sha512-lFfGhX32w8h1j74Iyz0Wv7JByXIwX11OE9UxG+oT7lG0RyXkF4zKyxP8EoxfLrDXse4Oop434p95e3UNC3IfCw==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.91.tgz", + "integrity": "sha512-fki4ioRP/Esy4vdp8T34RCV+V9dqkRmOt763pf74pdiyFV2dPLXa5lnw/XvR1RTfPGknrYgjEQLCfZlReTryRw==", "cpu": [ "arm64" ], @@ -3086,9 +3103,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.92.tgz", - "integrity": "sha512-rOZtRcLj57MSAbiecMsqjzBcZDuaCZ8F6l6JDwGkQ7u1NYR57cqF0QDyU7RKS1Jq27Z/Vg21z5cwqoH5fLN+Sg==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.91.tgz", + "integrity": "sha512-XrG+DUUqNtfVLcJ20imby7fpBwQNG5VsEQBzQndSonPyUOa2YkTbBb60YDondfQGDABopuHH8gHN8o2H2/VCnQ==", "cpu": [ "arm64" ], @@ -3102,9 +3119,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.92.tgz", - "integrity": "sha512-qptoMGnBL6v89x/Qpn+l1TH1Y0ed+v0qhNfAEVzZvCvzEMTFXphhlhYbDdpxbzRmCjH6GOGq7Y+xrWt9T1/ARg==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.91.tgz", + "integrity": "sha512-d11bYhX+YPBr/Frcjc6eVn3C0LuS/9U1Li9EmQ+6s9EpYtYRl2ygSlC8eueLbaiazBnCVYFnc8bU4o0kc5B9sw==", "cpu": [ "x64" ], @@ -3118,9 +3135,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.92.tgz", - "integrity": "sha512-g2KrJ43bZkCZHH4zsIV5ErojuV1OIpUHaEyW1gf7JWKaFBpWYVyubzFPvPkjcxHGLbMsEzO7w/NVfxtGMlFH/Q==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.91.tgz", + "integrity": "sha512-2SRp5Dke2P4jCQePkDx9trkkTstnRpZJVw5r3jvYdk0zeO6iC4+ZPvvoWXJLigqQv/fZnIiSUfJ6ssOoaEqTzQ==", "cpu": [ "x64" ], @@ -3134,9 +3151,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.92.tgz", - "integrity": "sha512-3MCRGPAYDoQ8Yyd3WsCMc8eFSyKXY5kQLyg/R5zEqA0uthomo0m0F5/fxAJMZGaSdYkU1DgF73ctOWOf+Z/EzQ==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.91.tgz", + "integrity": "sha512-l9qKXikOxj42UIjbeZpz9xtBmr736jOMqInNP8mVF2/U+ws5sI8zJjcOFFtfis4ru7vWCXhB1wtltdlJYO2vGA==", "cpu": [ "arm64" ], @@ -3150,9 +3167,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.92.tgz", - "integrity": "sha512-zqTBKQhgfWm73SVGS8FKhFYDovyRl1f5dTX1IwSKynO0qHkRCqJwauFJv/yevkpJWsI2pFh03xsRs9HncTQKSA==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.91.tgz", + "integrity": "sha512-+s+52O0QVPmzOgjEe/rcb0AK6q/J7EHKwAyJCu/FaYO9df5ovE0HJjSKP6HAF0dGPO5hkENrXuNGujofUH9vtQ==", "cpu": [ "ia32" ], @@ -3166,9 +3183,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.92.tgz", - "integrity": "sha512-41bE66ddr9o/Fi1FBh0sHdaKdENPTuDpv1IFHxSg0dJyM/jX8LbkjnpdInYXHBxhcLVAPraVRrNsC4SaoPw2Pg==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.91.tgz", + "integrity": "sha512-7u9HDQhjUC3Gv43EFW84dZtduWCSa4MgltK+Sp9zEGti6WXqDPu/ESjvDsQEVYTBEMEvZs/xVAXPgLVHorV5nQ==", "cpu": [ "x64" ], @@ -3779,9 +3796,9 @@ "integrity": "sha512-kMpQpfZKSCBqltAJwskgePRaYRFukDkm1oItcAbC3gNELR20XIBcN9VRgg4+m8DKsTfkWeA4m4Imp4DDuWy7FQ==" }, "node_modules/@types/react": { - "version": "18.2.25", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.25.tgz", - "integrity": "sha512-24xqse6+VByVLIr+xWaQ9muX1B4bXJKXBbjszbld/UEDslGLY53+ZucF44HCmLbMPejTzGG9XgR+3m2/Wqu1kw==", + "version": "18.2.24", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.24.tgz", + "integrity": "sha512-Ee0Jt4sbJxMu1iDcetZEIKQr99J1Zfb6D4F3qfUWoR1JpInkY1Wdg4WwCyBjL257D0+jGqSl1twBjV8iCaC0Aw==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -3789,9 +3806,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.2.10", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.10.tgz", - "integrity": "sha512-5VEC5RgXIk1HHdyN1pHlg0cOqnxHzvPGpMMyGAP5qSaDRmyZNDaQ0kkVAkK6NYlDhP6YBID3llaXlmAS/mdgCA==", + "version": "18.2.8", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.8.tgz", + "integrity": "sha512-bAIvO5lN/U8sPGvs1Xm61rlRHHaq5rp5N3kp9C+NJ/Q41P8iqjkXSu0+/qu8POsjH9pNWb0OYabFez7taP7omw==", "devOptional": true, "dependencies": { "@types/react": "*" @@ -4499,9 +4516,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001546", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz", - "integrity": "sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==", + "version": "1.0.30001543", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001543.tgz", + "integrity": "sha512-qxdO8KPWPQ+Zk6bvNpPeQIOH47qZSYdFZd6dXQzb2KzhnSXju4Kd7H1PkSJx6NICSMgo/IhRZRhhfPTHYpJUCA==", "funding": [ { "type": "opencollective", @@ -4936,9 +4953,9 @@ } }, "node_modules/daisyui": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-3.9.2.tgz", - "integrity": "sha512-yJZ1QjHUaL+r9BkquTdzNHb7KIgAJVFh0zbOXql2Wu0r7zx5qZNLxclhjN0WLoIpY+o2h/8lqXg7ijj8oTigOw==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-3.8.3.tgz", + "integrity": "sha512-64QuR6niTv58E5YyAVBkoXQGngp04jt6XOcKGxnq1C/7r5ZE3bDuOSc4ktT7CPacTRjl5cCeNYY13VxLpZP+7A==", "dev": true, "dependencies": { "colord": "^2.9", @@ -5219,9 +5236,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.543", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.543.tgz", - "integrity": "sha512-t2ZP4AcGE0iKCCQCBx/K2426crYdxD3YU6l0uK2EO3FZH0pbC4pFz/sZm2ruZsND6hQBTcDWWlo/MLpiOdif5g==" + "version": "1.4.540", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.540.tgz", + "integrity": "sha512-aoCqgU6r9+o9/S7wkcSbmPRFi7OWZWiXS9rtjEd+Ouyu/Xyw5RSq2XN8s5Qp8IaFOLiRrhQCphCIjAxgG3eCAg==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -5695,9 +5712,9 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "hasInstallScript": true, "optional": true, "os": [ @@ -8340,6 +8357,36 @@ "node": ">= 6" } }, + "node_modules/playwright": { + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz", + "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==", + "dev": true, + "dependencies": { + "playwright-core": "1.38.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz", + "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/postcss": { "version": "8.4.31", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", @@ -9018,6 +9065,14 @@ "react-dom": ">=16.6.0" } }, + "node_modules/react18-json-view": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/react18-json-view/-/react18-json-view-0.2.5.tgz", + "integrity": "sha512-BiCWyRUCVbnaK4kfNay8crOXZnWsZ6XsnY3fwOf5C+ZaY9w9FSTawo2p+h2UG/KcDP8meZuGlkP95klfFG9GfQ==", + "peerDependencies": { + "react": ">=16.8.0" + } + }, "node_modules/reactflow": { "version": "11.9.2", "resolved": "https://registry.npmjs.org/reactflow/-/reactflow-11.9.2.tgz", @@ -10687,9 +10742,9 @@ } }, "node_modules/vite": { - "version": "4.4.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.11.tgz", - "integrity": "sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==", + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.10.tgz", + "integrity": "sha512-TzIjiqx9BEXF8yzYdF2NTf1kFFbjMjUSV0LFZ3HyHoI3SGSPLnnFUKiIQtL3gl2AjHvMrprOvQ3amzaHgQlAxw==", "dependencies": { "esbuild": "^0.18.10", "postcss": "^8.4.27", @@ -11335,17 +11390,17 @@ } }, "node_modules/zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "version": "3.22.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.3.tgz", + "integrity": "sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug==", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, "node_modules/zustand": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.3.tgz", - "integrity": "sha512-oRy+X3ZazZvLfmv6viIaQmtLOMeij1noakIsK/Y47PWYhT8glfXzQ4j0YcP5i0P0qI1A4rIB//SGROGyZhx91A==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.2.tgz", + "integrity": "sha512-qF3/vZHCrjPUX5DvPE3DPDZlh+FiAWRKlP9PI7SlW1MCk8q4vUCDqyWsbF8K41ne0Yx8eeeb0m1cypn1LqUMYQ==", "dependencies": { "use-sync-external-store": "1.2.0" }, @@ -12082,14 +12137,14 @@ } }, "@mui/base": { - "version": "5.0.0-beta.18", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.18.tgz", - "integrity": "sha512-e9ZCy/ndhyt5MTshAS3qAUy/40UiO0jX+kAo6a+XirrPJE+rrQW+mKPSI0uyp+5z4Vh+z0pvNoJ2S2gSrNz3BQ==", + "version": "5.0.0-beta.17", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.17.tgz", + "integrity": "sha512-xNbk7iOXrglNdIxFBN0k3ySsPIFLWCnFxqsAYl7CIcDkD9low4kJ7IUuy6ctwx/HAy2fenrT3KXHr1sGjAMgpQ==", "requires": { - "@babel/runtime": "^7.23.1", + "@babel/runtime": "^7.22.15", "@floating-ui/react-dom": "^2.0.2", - "@mui/types": "^7.2.5", - "@mui/utils": "^5.14.12", + "@mui/types": "^7.2.4", + "@mui/utils": "^5.14.11", "@popperjs/core": "^2.11.8", "clsx": "^2.0.0", "prop-types": "^15.8.1" @@ -12103,21 +12158,21 @@ } }, "@mui/core-downloads-tracker": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.12.tgz", - "integrity": "sha512-WZhCkKqhrXaSVBzoC6LNcVkIawS000OOt7gmnp4g9HhyvN0PSclRXc/JrkC7EwfzUAZJh+hiK2LaVsbtOpNuOg==" + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.11.tgz", + "integrity": "sha512-uY8FLQURhXe3f3O4dS5OSGML9KDm9+IE226cBu78jarVIzdQGPlXwGIlSI9VJR8MvZDA6C0+6XfWDhWCHruC5Q==" }, "@mui/material": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.12.tgz", - "integrity": "sha512-EelF2L46VcVqhg3KjzIGBBpOtcBgRh0MMy9Efuk6Do81QdcZsFC9RebCVAflo5jIdbHiBmxBs5/l5Q9NjONozg==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.11.tgz", + "integrity": "sha512-DnSdJzcR7lwG12JA5L2t8JF+RDzMygu5rCNW+logWb/KW2/TRzwLyVWO+CorHTBjBRd38DBxnwOCDiYkDd+N3A==", "requires": { - "@babel/runtime": "^7.23.1", - "@mui/base": "5.0.0-beta.18", - "@mui/core-downloads-tracker": "^5.14.12", - "@mui/system": "^5.14.12", - "@mui/types": "^7.2.5", - "@mui/utils": "^5.14.12", + "@babel/runtime": "^7.22.15", + "@mui/base": "5.0.0-beta.17", + "@mui/core-downloads-tracker": "^5.14.11", + "@mui/system": "^5.14.11", + "@mui/types": "^7.2.4", + "@mui/utils": "^5.14.11", "@types/react-transition-group": "^4.4.6", "clsx": "^2.0.0", "csstype": "^3.1.2", @@ -12134,36 +12189,36 @@ } }, "@mui/private-theming": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.12.tgz", - "integrity": "sha512-TWwm+9+BgHFpoR3w04FG+IqID4ALa74A27RuKq2CEaWgxliBZB24EVeI6djfjFt5t4FYmIb8BMw2ZJEir7YjLQ==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.11.tgz", + "integrity": "sha512-MSnNNzTu9pfKLCKs1ZAKwOTgE4bz+fQA0fNr8Jm7NDmuWmw0CaN9Vq2/MHsatE7+S0A25IAKby46Uv1u53rKVQ==", "requires": { - "@babel/runtime": "^7.23.1", - "@mui/utils": "^5.14.12", + "@babel/runtime": "^7.22.15", + "@mui/utils": "^5.14.11", "prop-types": "^15.8.1" } }, "@mui/styled-engine": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.12.tgz", - "integrity": "sha512-bocxt1nDmXfB3gpLfCCmFCyJ7sVmscFs+PuheO210QagZwHVp47UIRT1AiswLDYSQo1ZqmVGn7KLEJEYK0d4Xw==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.11.tgz", + "integrity": "sha512-jdUlqRgTYQ8RMtPX4MbRZqar6W2OiIb6J5KEFbIu4FqvPrk44Each4ppg/LAqp1qNlBYq5i+7Q10MYLMpDxX9A==", "requires": { - "@babel/runtime": "^7.23.1", + "@babel/runtime": "^7.22.15", "@emotion/cache": "^11.11.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" } }, "@mui/system": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.12.tgz", - "integrity": "sha512-6DXfjjLhW0/ia5qU3Crke7j+MnfDbMBOHlLIrqbrEqNs0AuSBv8pXniEGb+kqO0H804NJreRTEJRjCngwOX5CA==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.11.tgz", + "integrity": "sha512-yl8xV+y0k7j6dzBsHabKwoShmjqLa8kTxrhUI3JpqLG358VRVMJRW/ES0HhvfcCi4IVXde+Tc2P3K1akGL8zoA==", "requires": { - "@babel/runtime": "^7.23.1", - "@mui/private-theming": "^5.14.12", - "@mui/styled-engine": "^5.14.12", - "@mui/types": "^7.2.5", - "@mui/utils": "^5.14.12", + "@babel/runtime": "^7.22.15", + "@mui/private-theming": "^5.14.11", + "@mui/styled-engine": "^5.14.11", + "@mui/types": "^7.2.4", + "@mui/utils": "^5.14.11", "clsx": "^2.0.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -12183,12 +12238,12 @@ "requires": {} }, "@mui/utils": { - "version": "5.14.12", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.12.tgz", - "integrity": "sha512-RFNXnhKQlzIkIUig6mmv0r5VbtjPdWoaBPYicq25LETdZux59HAqoRdWw15T7lp3c7gXOoE8y67+hTB8C64m2g==", + "version": "5.14.11", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.11.tgz", + "integrity": "sha512-fmkIiCPKyDssYrJ5qk+dime1nlO3dmWfCtaPY/uVBqCRMBZ11JhddB9m8sjI2mgqQQwRJG5bq3biaosNdU/s4Q==", "requires": { - "@babel/runtime": "^7.23.1", - "@types/prop-types": "^15.7.7", + "@babel/runtime": "^7.22.15", + "@types/prop-types": "^15.7.5", "prop-types": "^15.8.1", "react-is": "^18.2.0" } @@ -12216,6 +12271,15 @@ "fastq": "^1.6.0" } }, + "@playwright/test": { + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz", + "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==", + "dev": true, + "requires": { + "playwright": "1.38.1" + } + }, "@popperjs/core": { "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", @@ -13037,92 +13101,92 @@ } }, "@swc/core": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.92.tgz", - "integrity": "sha512-vx0vUrf4YTEw59njOJ46Ha5i0cZTMYdRHQ7KXU29efN1MxcmJH2RajWLPlvQarOP1ab9iv9cApD7SMchDyx2vA==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.91.tgz", + "integrity": "sha512-r950d0fdlZ8qbSDyvApn3HyCojiZE8xpgJzQvypeMi32dalYwugdJKWyLB55JIGMRGJ8+lmVvY4MPGkSR3kXgA==", "dev": true, "requires": { - "@swc/core-darwin-arm64": "1.3.92", - "@swc/core-darwin-x64": "1.3.92", - "@swc/core-linux-arm-gnueabihf": "1.3.92", - "@swc/core-linux-arm64-gnu": "1.3.92", - "@swc/core-linux-arm64-musl": "1.3.92", - "@swc/core-linux-x64-gnu": "1.3.92", - "@swc/core-linux-x64-musl": "1.3.92", - "@swc/core-win32-arm64-msvc": "1.3.92", - "@swc/core-win32-ia32-msvc": "1.3.92", - "@swc/core-win32-x64-msvc": "1.3.92", + "@swc/core-darwin-arm64": "1.3.91", + "@swc/core-darwin-x64": "1.3.91", + "@swc/core-linux-arm-gnueabihf": "1.3.91", + "@swc/core-linux-arm64-gnu": "1.3.91", + "@swc/core-linux-arm64-musl": "1.3.91", + "@swc/core-linux-x64-gnu": "1.3.91", + "@swc/core-linux-x64-musl": "1.3.91", + "@swc/core-win32-arm64-msvc": "1.3.91", + "@swc/core-win32-ia32-msvc": "1.3.91", + "@swc/core-win32-x64-msvc": "1.3.91", "@swc/counter": "^0.1.1", "@swc/types": "^0.1.5" } }, "@swc/core-darwin-arm64": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.92.tgz", - "integrity": "sha512-v7PqZUBtIF6Q5Cp48gqUiG8zQQnEICpnfNdoiY3xjQAglCGIQCjJIDjreZBoeZQZspB27lQN4eZ43CX18+2SnA==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.91.tgz", + "integrity": "sha512-7kHGiQ1he5khcEeJuHDmLZPM3rRL/ith5OTmV6bOPsoHi46kLeixORW+ts1opC3tC9vu6xbk16xgX0QAJchc1w==", "dev": true, "optional": true }, "@swc/core-darwin-x64": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.92.tgz", - "integrity": "sha512-Q3XIgQfXyxxxms3bPN+xGgvwk0TtG9l89IomApu+yTKzaIIlf051mS+lGngjnh9L0aUiCp6ICyjDLtutWP54fw==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.91.tgz", + "integrity": "sha512-8SpU18FbFpZDVzsHsAwdI1thF/picQGxq9UFxa8W+T9SDnbsqwFJv/6RqKJeJoDV6qFdl2OLjuO0OL7xrp0qnQ==", "dev": true, "optional": true }, "@swc/core-linux-arm-gnueabihf": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.92.tgz", - "integrity": "sha512-tnOCoCpNVXC+0FCfG84PBZJyLlz0Vfj9MQhyhCvlJz9hQmvpf8nTdKH7RHrOn8VfxtUBLdVi80dXgIFgbvl7qA==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.91.tgz", + "integrity": "sha512-fOq4Cy8UbwX1yf0WB0d8hWZaIKCnPtPGguRqdXGLfwvhjZ9SIErT6PnmGTGRbQCNCIkOZWHKyTU0r8t2dN3haQ==", "dev": true, "optional": true }, "@swc/core-linux-arm64-gnu": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.92.tgz", - "integrity": "sha512-lFfGhX32w8h1j74Iyz0Wv7JByXIwX11OE9UxG+oT7lG0RyXkF4zKyxP8EoxfLrDXse4Oop434p95e3UNC3IfCw==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.91.tgz", + "integrity": "sha512-fki4ioRP/Esy4vdp8T34RCV+V9dqkRmOt763pf74pdiyFV2dPLXa5lnw/XvR1RTfPGknrYgjEQLCfZlReTryRw==", "dev": true, "optional": true }, "@swc/core-linux-arm64-musl": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.92.tgz", - "integrity": "sha512-rOZtRcLj57MSAbiecMsqjzBcZDuaCZ8F6l6JDwGkQ7u1NYR57cqF0QDyU7RKS1Jq27Z/Vg21z5cwqoH5fLN+Sg==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.91.tgz", + "integrity": "sha512-XrG+DUUqNtfVLcJ20imby7fpBwQNG5VsEQBzQndSonPyUOa2YkTbBb60YDondfQGDABopuHH8gHN8o2H2/VCnQ==", "dev": true, "optional": true }, "@swc/core-linux-x64-gnu": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.92.tgz", - "integrity": "sha512-qptoMGnBL6v89x/Qpn+l1TH1Y0ed+v0qhNfAEVzZvCvzEMTFXphhlhYbDdpxbzRmCjH6GOGq7Y+xrWt9T1/ARg==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.91.tgz", + "integrity": "sha512-d11bYhX+YPBr/Frcjc6eVn3C0LuS/9U1Li9EmQ+6s9EpYtYRl2ygSlC8eueLbaiazBnCVYFnc8bU4o0kc5B9sw==", "dev": true, "optional": true }, "@swc/core-linux-x64-musl": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.92.tgz", - "integrity": "sha512-g2KrJ43bZkCZHH4zsIV5ErojuV1OIpUHaEyW1gf7JWKaFBpWYVyubzFPvPkjcxHGLbMsEzO7w/NVfxtGMlFH/Q==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.91.tgz", + "integrity": "sha512-2SRp5Dke2P4jCQePkDx9trkkTstnRpZJVw5r3jvYdk0zeO6iC4+ZPvvoWXJLigqQv/fZnIiSUfJ6ssOoaEqTzQ==", "dev": true, "optional": true }, "@swc/core-win32-arm64-msvc": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.92.tgz", - "integrity": "sha512-3MCRGPAYDoQ8Yyd3WsCMc8eFSyKXY5kQLyg/R5zEqA0uthomo0m0F5/fxAJMZGaSdYkU1DgF73ctOWOf+Z/EzQ==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.91.tgz", + "integrity": "sha512-l9qKXikOxj42UIjbeZpz9xtBmr736jOMqInNP8mVF2/U+ws5sI8zJjcOFFtfis4ru7vWCXhB1wtltdlJYO2vGA==", "dev": true, "optional": true }, "@swc/core-win32-ia32-msvc": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.92.tgz", - "integrity": "sha512-zqTBKQhgfWm73SVGS8FKhFYDovyRl1f5dTX1IwSKynO0qHkRCqJwauFJv/yevkpJWsI2pFh03xsRs9HncTQKSA==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.91.tgz", + "integrity": "sha512-+s+52O0QVPmzOgjEe/rcb0AK6q/J7EHKwAyJCu/FaYO9df5ovE0HJjSKP6HAF0dGPO5hkENrXuNGujofUH9vtQ==", "dev": true, "optional": true }, "@swc/core-win32-x64-msvc": { - "version": "1.3.92", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.92.tgz", - "integrity": "sha512-41bE66ddr9o/Fi1FBh0sHdaKdENPTuDpv1IFHxSg0dJyM/jX8LbkjnpdInYXHBxhcLVAPraVRrNsC4SaoPw2Pg==", + "version": "1.3.91", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.91.tgz", + "integrity": "sha512-7u9HDQhjUC3Gv43EFW84dZtduWCSa4MgltK+Sp9zEGti6WXqDPu/ESjvDsQEVYTBEMEvZs/xVAXPgLVHorV5nQ==", "dev": true, "optional": true }, @@ -13670,9 +13734,9 @@ "integrity": "sha512-kMpQpfZKSCBqltAJwskgePRaYRFukDkm1oItcAbC3gNELR20XIBcN9VRgg4+m8DKsTfkWeA4m4Imp4DDuWy7FQ==" }, "@types/react": { - "version": "18.2.25", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.25.tgz", - "integrity": "sha512-24xqse6+VByVLIr+xWaQ9muX1B4bXJKXBbjszbld/UEDslGLY53+ZucF44HCmLbMPejTzGG9XgR+3m2/Wqu1kw==", + "version": "18.2.24", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.24.tgz", + "integrity": "sha512-Ee0Jt4sbJxMu1iDcetZEIKQr99J1Zfb6D4F3qfUWoR1JpInkY1Wdg4WwCyBjL257D0+jGqSl1twBjV8iCaC0Aw==", "requires": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -13680,9 +13744,9 @@ } }, "@types/react-dom": { - "version": "18.2.10", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.10.tgz", - "integrity": "sha512-5VEC5RgXIk1HHdyN1pHlg0cOqnxHzvPGpMMyGAP5qSaDRmyZNDaQ0kkVAkK6NYlDhP6YBID3llaXlmAS/mdgCA==", + "version": "18.2.8", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.8.tgz", + "integrity": "sha512-bAIvO5lN/U8sPGvs1Xm61rlRHHaq5rp5N3kp9C+NJ/Q41P8iqjkXSu0+/qu8POsjH9pNWb0OYabFez7taP7omw==", "devOptional": true, "requires": { "@types/react": "*" @@ -14162,9 +14226,9 @@ "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==" }, "caniuse-lite": { - "version": "1.0.30001546", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz", - "integrity": "sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==" + "version": "1.0.30001543", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001543.tgz", + "integrity": "sha512-qxdO8KPWPQ+Zk6bvNpPeQIOH47qZSYdFZd6dXQzb2KzhnSXju4Kd7H1PkSJx6NICSMgo/IhRZRhhfPTHYpJUCA==" }, "ccount": { "version": "2.0.1", @@ -14469,9 +14533,9 @@ } }, "daisyui": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-3.9.2.tgz", - "integrity": "sha512-yJZ1QjHUaL+r9BkquTdzNHb7KIgAJVFh0zbOXql2Wu0r7zx5qZNLxclhjN0WLoIpY+o2h/8lqXg7ijj8oTigOw==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-3.8.3.tgz", + "integrity": "sha512-64QuR6niTv58E5YyAVBkoXQGngp04jt6XOcKGxnq1C/7r5ZE3bDuOSc4ktT7CPacTRjl5cCeNYY13VxLpZP+7A==", "dev": true, "requires": { "colord": "^2.9", @@ -14682,9 +14746,9 @@ } }, "electron-to-chromium": { - "version": "1.4.543", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.543.tgz", - "integrity": "sha512-t2ZP4AcGE0iKCCQCBx/K2426crYdxD3YU6l0uK2EO3FZH0pbC4pFz/sZm2ruZsND6hQBTcDWWlo/MLpiOdif5g==" + "version": "1.4.540", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.540.tgz", + "integrity": "sha512-aoCqgU6r9+o9/S7wkcSbmPRFi7OWZWiXS9rtjEd+Ouyu/Xyw5RSq2XN8s5Qp8IaFOLiRrhQCphCIjAxgG3eCAg==" }, "emoji-regex": { "version": "8.0.0", @@ -15018,9 +15082,9 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "optional": true }, "function-bind": { @@ -16783,6 +16847,22 @@ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==" }, + "playwright": { + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz", + "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==", + "dev": true, + "requires": { + "fsevents": "2.3.2", + "playwright-core": "1.38.1" + } + }, + "playwright-core": { + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz", + "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==", + "dev": true + }, "postcss": { "version": "8.4.31", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", @@ -17173,6 +17253,12 @@ "prop-types": "^15.6.2" } }, + "react18-json-view": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/react18-json-view/-/react18-json-view-0.2.5.tgz", + "integrity": "sha512-BiCWyRUCVbnaK4kfNay8crOXZnWsZ6XsnY3fwOf5C+ZaY9w9FSTawo2p+h2UG/KcDP8meZuGlkP95klfFG9GfQ==", + "requires": {} + }, "reactflow": { "version": "11.9.2", "resolved": "https://registry.npmjs.org/reactflow/-/reactflow-11.9.2.tgz", @@ -18323,9 +18409,9 @@ } }, "vite": { - "version": "4.4.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.11.tgz", - "integrity": "sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==", + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.10.tgz", + "integrity": "sha512-TzIjiqx9BEXF8yzYdF2NTf1kFFbjMjUSV0LFZ3HyHoI3SGSPLnnFUKiIQtL3gl2AjHvMrprOvQ3amzaHgQlAxw==", "requires": { "esbuild": "^0.18.10", "fsevents": "~2.3.2", @@ -18659,14 +18745,14 @@ "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" }, "zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==" + "version": "3.22.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.3.tgz", + "integrity": "sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug==" }, "zustand": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.3.tgz", - "integrity": "sha512-oRy+X3ZazZvLfmv6viIaQmtLOMeij1noakIsK/Y47PWYhT8glfXzQ4j0YcP5i0P0qI1A4rIB//SGROGyZhx91A==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.2.tgz", + "integrity": "sha512-qF3/vZHCrjPUX5DvPE3DPDZlh+FiAWRKlP9PI7SlW1MCk8q4vUCDqyWsbF8K41ne0Yx8eeeb0m1cypn1LqUMYQ==", "requires": { "use-sync-external-store": "1.2.0" } diff --git a/src/frontend/package.json b/src/frontend/package.json index 8d7d25d88..0be0c9260 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -53,7 +53,8 @@ "react-syntax-highlighter": "^15.5.0", "react-tabs": "^6.0.2", "react-tooltip": "^5.21.1", - "reactflow": "^11.8.3", + "react18-json-view": "^0.2.3", + "reactflow": "^11.9.2", "rehype-mathjax": "^4.0.3", "remark-gfm": "^3.0.1", "remark-math": "^5.1.1", @@ -72,7 +73,7 @@ "start": "vite", "build": "vite build", "serve": "vite preview", - "format": "npx prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"", + "format": "npx prettier --write \"./**/*.{js,jsx,ts,tsx,json,md}\"", "type-check": "tsc --noEmit --pretty --project tsconfig.json && vite" }, "eslintConfig": { @@ -95,6 +96,7 @@ }, "proxy": "http://127.0.0.1:7860", "devDependencies": { + "@playwright/test": "^1.38.0", "@swc/cli": "^0.1.62", "@swc/core": "^1.3.80", "@tailwindcss/typography": "^0.5.9", diff --git a/src/frontend/playwright.config.ts b/src/frontend/playwright.config.ts new file mode 100644 index 000000000..6af6cb8d7 --- /dev/null +++ b/src/frontend/playwright.config.ts @@ -0,0 +1,77 @@ +import { defineConfig, devices } from "@playwright/test"; + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +// require('dotenv').config(); + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: "./tests", + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: "html", + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + // baseURL: 'http://127.0.0.1:3000', + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: "on-first-retry", + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: "chromium", + use: { ...devices["Desktop Chrome"] }, + }, + + { + name: "firefox", + use: { ...devices["Desktop Firefox"] }, + }, + + { + name: "webkit", + use: { ...devices["Desktop Safari"] }, + }, + + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { ...devices['Pixel 5'] }, + // }, + // { + // name: 'Mobile Safari', + // use: { ...devices['iPhone 12'] }, + // }, + + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { ...devices['Desktop Edge'], channel: 'msedge' }, + // }, + // { + // name: 'Google Chrome', + // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, + // }, + ], + + /* Run your local dev server before starting the tests */ + // webServer: { + // command: 'npm run start', + // url: 'http://127.0.0.1:3000', + // reuseExistingServer: !process.env.CI, + // }, +}); diff --git a/src/frontend/src/App.css b/src/frontend/src/App.css index be7173d7f..a7a8bad51 100644 --- a/src/frontend/src/App.css +++ b/src/frontend/src/App.css @@ -3,45 +3,85 @@ @tailwind utilities; .App { - text-align: center; + text-align: center; +} + +.react-flow__node { + width: auto; + height: auto; + border-radius: auto; + min-width: inherit; } .App-logo { - height: 40vmin; - pointer-events: none; + height: 40vmin; + pointer-events: none; } @media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } + .App-logo { + animation: App-logo-spin infinite 20s linear; + } } .App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; } .App-link { - color: #61dafb; + color: #61dafb; } @keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } } @font-face { - font-family: text-security-disc; - src: url("assets/text-security-disc.woff") format("woff"); + font-family: text-security-disc; + src: url("assets/text-security-disc.woff") format("woff"); +} + +.json-view { + height: 370px !important; + background-color: #2c2c2c !important; + border-radius: 10px !important; + padding: 10px !important; +} + +.jv-indent { + overflow-y: auto !important; + max-height: 310px !important; + border-radius: 10px; +} + +.jv-indent::-webkit-scrollbar { + width: 8px !important; + height: 8px !important; + border-radius: 10px; +} + +.jv-indent::-webkit-scrollbar-track { + background-color: #f1f1f1 !important; + border-radius: 10px; +} + +.jv-indent::-webkit-scrollbar-thumb { + background-color: #ccc !important; + border-radius: 999px !important; +} + +.jv-indent::-webkit-scrollbar-thumb:hover { + background-color: #bbb !important; } diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 790813c4b..bc373f313 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -9,6 +9,7 @@ import React, { import { Handle, Position, useUpdateNodeInternals } from "reactflow"; import ShadTooltip from "../../../../components/ShadTooltipComponent"; import CodeAreaComponent from "../../../../components/codeAreaComponent"; +import DictComponent from "../../../../components/dictComponent"; import Dropdown from "../../../../components/dropdownComponent"; import FloatComponent from "../../../../components/floatComponent"; import IconComponent from "../../../../components/genericIconComponent"; @@ -16,15 +17,20 @@ import InputComponent from "../../../../components/inputComponent"; import InputFileComponent from "../../../../components/inputFileComponent"; import InputListComponent from "../../../../components/inputListComponent"; import IntComponent from "../../../../components/intComponent"; +import KeypairListComponent from "../../../../components/keypairListComponent"; import PromptAreaComponent from "../../../../components/promptComponent"; import TextAreaComponent from "../../../../components/textAreaComponent"; import ToggleShadComponent from "../../../../components/toggleShadComponent"; +import { Button } from "../../../../components/ui/button"; import { TOOLTIP_EMPTY } from "../../../../constants/constants"; import { TabsContext } from "../../../../contexts/tabsContext"; import { typesContext } from "../../../../contexts/typesContext"; import { ParameterComponentType } from "../../../../types/components"; import { TabsState } from "../../../../types/tabs"; import { + convertObjToArray, + convertValuesToNumbers, + hasDuplicateKeys, isValidConnection, scapedJSONStringfy, } from "../../../../utils/reactflowUtils"; @@ -49,13 +55,14 @@ export default function ParameterComponent({ optionalHandle = null, info = "", proxy, + showNode, }: ParameterComponentType): JSX.Element { const ref = useRef(null); const refHtml = useRef(null); const infoHtml = useRef(null); const updateNodeInternals = useUpdateNodeInternals(); const [position, setPosition] = useState(0); - const { setTabsState, tabId, save, flows } = useContext(TabsContext); + const { setTabsState, tabId, flows } = useContext(TabsContext); const flow = flows.find((flow) => flow.id === tabId)?.data?.nodes ?? null; @@ -71,7 +78,9 @@ export default function ParameterComponent({ updateNodeInternals(data.id); }, [data.id, position, updateNodeInternals]); - const { reactFlowInstance } = useContext(typesContext); + const groupedEdge = useRef(null); + + const { reactFlowInstance, setFilterEdge } = useContext(typesContext); let disabled = reactFlowInstance ?.getEdges() @@ -79,13 +88,18 @@ export default function ParameterComponent({ const { data: myData } = useContext(typesContext); - const handleOnNewValue = (newValue: string | string[] | boolean): void => { + const handleOnNewValue = ( + newValue: string | string[] | boolean | Object[] + ): void => { let newData = cloneDeep(data); newData.node!.template[name].value = newValue; setData(newData); // Set state to pending //@ts-ignore setTabsState((prev: TabsState) => { + if (!prev[tabId]) { + return prev; + } return { ...prev, [tabId]: { @@ -98,6 +112,8 @@ export default function ParameterComponent({ renderTooltips(); }; + const [errorDuplicateKey, setErrorDuplicateKey] = useState(false); + useEffect(() => { // @ts-ignore infoHtml.current = ( @@ -112,7 +128,8 @@ export default function ParameterComponent({ }, [info]); function renderTooltips() { - let groupedObj = groupByFamily(myData, tooltipTitle!, left, flow!); + let groupedObj: any = groupByFamily(myData, tooltipTitle!, left, flow!); + groupedEdge.current = groupedObj; if (groupedObj && groupedObj.length > 0) { //@ts-ignore @@ -121,45 +138,54 @@ export default function ParameterComponent({ nodeIconsLucide[item.family] ?? nodeIconsLucide["unknown"]; return ( - 0 ? "mt-2 flex items-center" : "flex items-center" +
+ {index === 0 && ( + + {left + ? "Avaliable input components:" + : "Avaliable output components:"} + )} - > -
0 ? "mt-2 flex items-center" : "mt-3 flex items-center" + )} > - -
- - {nodeNames[item.family] ?? "Other"} - - {" "} - {item.type === "" ? "" : " - "} - {item.type.split(", ").length > 2 - ? item.type.split(", ").map((el, index) => ( - - - {index === item.type.split(", ").length - 1 - ? el - : (el += `, `)} - - - )) - : item.type} + > + +
+ + {nodeNames[item.family] ?? "Other"}{" "} + + {" "} + {item.type === "" ? "" : " - "} + {item.type.split(", ").length > 2 + ? item.type.split(", ").map((el, index) => ( + + + {index === item.type.split(", ").length - 1 + ? el + : (el += `, `)} + + + )) + : item.type} +
- + ); }); } else { @@ -172,7 +198,56 @@ export default function ParameterComponent({ renderTooltips(); }, [tooltipTitle, flow]); - return ( + return !showNode ? ( + left && + (type === "str" || + type === "bool" || + type === "float" || + type === "code" || + type === "prompt" || + type === "file" || + type === "int" || + type === "dict" || + type === "NestedDict") && + !optionalHandle ? ( + <> + ) : ( + + ) + ) : (
) : ( - - - isValidConnection(connection, reactFlowInstance!) - } - className={classNames( - left ? "-ml-0.5 " : "-mr-0.5 ", - "h-3 w-3 rounded-full border-2 bg-background" - )} - style={{ - borderColor: color, - top: position, - }} - > - + )} {left === true && @@ -330,7 +418,6 @@ export default function ParameterComponent({ suffixes={data.node?.template[name].suffixes} onFileChange={(filePath: string) => { data.node!.template[name].file_path = filePath; - save(); }} >
@@ -353,11 +440,55 @@ export default function ParameterComponent({ field_name={name} setNodeClass={(nodeClass) => { data.node = nodeClass; + const clone = cloneDeep(data); + clone.node = nodeClass; + setData(clone); }} nodeClass={data.node} disabled={disabled} value={data.node?.template[name].value ?? ""} - onChange={handleOnNewValue} + onChange={(e) => { + handleOnNewValue(e); + }} + /> + + ) : left === true && type === "NestedDict" ? ( +
+ { + data.node!.template[name].value = newValue; + handleOnNewValue(newValue); + }} + /> +
+ ) : left === true && type === "dict" ? ( +
+ { + const valueToNumbers = convertValuesToNumbers(newValue); + data.node!.template[name].value = valueToNumbers; + setErrorDuplicateKey(hasDuplicateKeys(valueToNumbers)); + handleOnNewValue(valueToNumbers); + }} />
) : ( diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index f69372b0d..7e6c04767 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -14,7 +14,6 @@ import { validationStatusType } from "../../types/components"; import { NodeDataType } from "../../types/flow"; import { cleanEdges, - getGroupStatus, handleKeyDown, scapedJSONStringfy, } from "../../utils/reactflowUtils"; @@ -36,7 +35,8 @@ export default function GenericNode({ const [data, setData] = useState(olddata); const { updateFlow, flows, tabId } = useContext(TabsContext); const updateNodeInternals = useUpdateNodeInternals(); - const { types, deleteNode, reactFlowInstance } = useContext(typesContext); + const { types, deleteNode, reactFlowInstance, setFilterEdge, getFilterEdge } = + useContext(typesContext); const name = nodeIconsLucide[data.type] ? data.type : types[data.type]; const [inputName, setInputName] = useState(true); const [nodeName, setNodeName] = useState(data.node!.display_name); @@ -46,6 +46,43 @@ export default function GenericNode({ ); const [validationStatus, setValidationStatus] = useState(null); + const [showNode, setShowNode] = useState(true); + const [handles, setHandles] = useState([]); + let numberOfInputs: boolean[] = []; + + function countHandles(): void { + numberOfInputs = Object.keys(data.node!.template) + .filter((templateField) => templateField.charAt(0) !== "_") + .map((templateCamp) => { + const { template } = data.node!; + if (template[templateCamp].input_types) return true; + if (!template[templateCamp].show) return false; + switch (template[templateCamp].type) { + case "str": + return false; + case "bool": + return false; + case "float": + return false; + case "code": + return false; + case "prompt": + return false; + case "file": + return false; + case "int": + return false; + default: + return true; + } + }); + setHandles(numberOfInputs); + } + + useEffect(() => { + countHandles(); + }, []); + // State for outline color const { sseData, isBuilding } = useSSE(); useEffect(() => { @@ -67,8 +104,15 @@ export default function GenericNode({ }); updateFlow(flow); } + countHandles(); }, [data]); + useEffect(() => { + setTimeout(() => { + updateNodeInternals(data.id); + }, 300); + }, [showNode]); + // New useEffect to watch for changes in sseData and update validation status useEffect(() => { const relevantData = sseData[data.id]; @@ -79,7 +123,6 @@ export default function GenericNode({ setValidationStatus(null); } }, [sseData, data.id]); - return ( <> @@ -88,141 +131,257 @@ export default function GenericNode({ data={data} setData={setData} deleteNode={deleteNode} + setShowNode={setShowNode} + numberOfHandles={handles} + showNode={showNode} >
- {data.node?.beta && ( + {data.node?.beta && showNode && (
BETA
)} -
-
- -
- {data.node?.flow && inputName ? ( -
- { - setInputName(false); - if (nodeName.trim() !== "") { - setNodeName(nodeName); - data.node!.display_name = nodeName; - } else { - setNodeName(data.node!.display_name); - } - }} - value={nodeName} - onChange={setNodeName} - password={false} - blurOnEnter={true} - /> +
+
+
+ + {showNode && ( +
+ {data.node?.flow && inputName ? ( +
+ { + setInputName(false); + if (nodeName.trim() !== "") { + setNodeName(nodeName); + data.node!.display_name = nodeName; + } else { + setNodeName(data.node!.display_name); + } + }} + value={nodeName} + onChange={setNodeName} + password={false} + blurOnEnter={true} + /> +
+ ) : ( + +
setInputName(true)} + > + {data.node?.display_name} +
+
+ )}
- ) : ( - -
setInputName(true)} - > - {data.node?.display_name} -
-
)}
-
-
- Building... - ) : !validationStatus ? ( - - Build{" "} - {" "} - flow to validate status. - - ) : ( -
- {typeof validationStatus.params === "string" - ? validationStatus.params - .split("\n") - .map((line: string, index: number) => ( -
{line}
- )) - : ""} -
- ) - } - > -
-
+ {Object.keys(data.node!.template) + .filter((templateField) => templateField.charAt(0) !== "_") + .map( + (templateField: string, idx) => + data.node!.template[templateField].show && + !data.node!.template[templateField].advanced && ( + + ) )} - >
-
-
-
-
+ 0 + ? data.node.output_types.join("|") + : data.type + } + tooltipTitle={data.node?.base_classes.join("\n")} + id={{ + baseClasses: data.node!.base_classes, + id: data.id, + dataType: data.type, + }} + type={data.node?.base_classes.join("|")} + left={false} + showNode={showNode} + /> + + )}
+ + {showNode && ( +
+
+ Building... + ) : !validationStatus ? ( + + Build{" "} + {" "} + flow to validate status. + + ) : ( +
+ {typeof validationStatus.params === "string" + ? validationStatus.params + .split("\n") + .map((line: string, index: number) => ( +
{line}
+ )) + : ""} +
+ ) + } + > +
+
+
+
+
+
+
+
+ )}
-
- {data.node?.flow && inputDescription ? ( -