From 951948d239a9de5d9bedf984c993c6d951e14ed7 Mon Sep 17 00:00:00 2001 From: Abhimanyu Yadav <122007096+Abhi1992002@users.noreply.github.com> Date: Wed, 27 Nov 2024 02:10:51 +0530 Subject: [PATCH] fix(platform): allowing condition block to compare 2 strings (#8771) Co-authored-by: Reinier van der Leer Co-authored-by: Bently --- autogpt_platform/backend/backend/blocks/branching.py | 10 ++++++++-- docs/content/platform/advanced_setup.md | 2 +- docs/content/platform/getting-started.md | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/autogpt_platform/backend/backend/blocks/branching.py b/autogpt_platform/backend/backend/blocks/branching.py index 65a01c977268..daf967bc6a7d 100644 --- a/autogpt_platform/backend/backend/blocks/branching.py +++ b/autogpt_platform/backend/backend/blocks/branching.py @@ -75,11 +75,17 @@ def run(self, input_data: Input, **kwargs) -> BlockOutput: value1 = input_data.value1 if isinstance(value1, str): - value1 = float(value1.strip()) + try: + value1 = float(value1.strip()) + except ValueError: + value1 = value1.strip() value2 = input_data.value2 if isinstance(value2, str): - value2 = float(value2.strip()) + try: + value2 = float(value2.strip()) + except ValueError: + value2 = value2.strip() yes_value = input_data.yes_value if input_data.yes_value is not None else value1 no_value = input_data.no_value if input_data.no_value is not None else value2 diff --git a/docs/content/platform/advanced_setup.md b/docs/content/platform/advanced_setup.md index 9bb413b70a51..cfe8f9ae9bb4 100644 --- a/docs/content/platform/advanced_setup.md +++ b/docs/content/platform/advanced_setup.md @@ -55,7 +55,7 @@ This will generate the Prisma client for PostgreSQL. You will also need to run t ```bash cd autogpt_platform/ -docker compose up -d +docker compose up -d --build ``` You can then run the migrations from the `backend` directory. diff --git a/docs/content/platform/getting-started.md b/docs/content/platform/getting-started.md index f4e82392be5a..b57ff7de8f63 100644 --- a/docs/content/platform/getting-started.md +++ b/docs/content/platform/getting-started.md @@ -90,7 +90,7 @@ To run the backend services, follow these steps: * Run the backend services: ``` - docker compose up -d + docker compose up -d --build ``` This command will start all the necessary backend services defined in the `docker-compose.combined.yml` file in detached mode.