Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

tweak(platform): Update block descriptions and tweak block card ui (#8147)

Swifty1d2e7b89ea0b
diff --git a/autogpt_platform/backend/backend/blocks/basic.py b/autogpt_platform/backend/backend/blocks/basic.py
index a38f8f1628..463bd73129 100644
--- a/autogpt_platform/backend/backend/blocks/basic.py
+++ b/autogpt_platform/backend/backend/blocks/basic.py
@@ -41,8 +41,7 @@ class StoreValueBlock(Block):
def __init__(self):
super().__init__(
id="1ff065e9-88e8-4358-9d82-8dc91f622ba9",
- description="This block forwards the `input` pin to `output` pin. "
- "This block output will be static, the output can be consumed many times.",
+ description="This block forwards an input value as output, allowing reuse without change.",
categories={BlockCategory.BASIC},
input_schema=StoreValueBlock.Input,
output_schema=StoreValueBlock.Output,
@@ -244,14 +243,7 @@ class AgentOutputBlock(Block):
def __init__(self):
super().__init__(
id="363ae599-353e-4804-937e-b2ee3cef3da4",
- description=(
- "This block records the graph output. It takes a value to record, "
- "with a name, description, and optional format string. If a format "
- "string is given, it tries to format the recorded value. The "
- "formatted (or raw, if formatting fails) value is then output. "
- "This block is key for capturing and presenting final results or "
- "important intermediate outputs of the graph execution."
- ),
+ description=("Stores the output of the graph for users to see."),
input_schema=AgentOutputBlock.Input,
output_schema=AgentOutputBlock.Output,
test_input=[
diff --git a/autogpt_platform/backend/backend/blocks/csv.py b/autogpt_platform/backend/backend/blocks/csv.py
index ccac4e556e..b19a65f24e 100644
--- a/autogpt_platform/backend/backend/blocks/csv.py
+++ b/autogpt_platform/backend/backend/blocks/csv.py
@@ -22,6 +22,7 @@ class ReadCsvBlock(Block):
id="acf7625e-d2cb-4941-bfeb-2819fc6fc015",
input_schema=ReadCsvBlock.Input,
output_schema=ReadCsvBlock.Output,
+ description="Reads a CSV file and outputs the data as a list of dictionaries and individual rows via rows.",
contributors=[ContributorDetails(name="Nicholas Tindle")],
categories={BlockCategory.TEXT},
test_input={
diff --git a/autogpt_platform/backend/backend/blocks/discord.py b/autogpt_platform/backend/backend/blocks/discord.py
index bebe54d906..8565684a07 100644
--- a/autogpt_platform/backend/backend/blocks/discord.py
+++ b/autogpt_platform/backend/backend/blocks/discord.py
@@ -31,6 +31,7 @@ class ReadDiscordMessagesBlock(Block):
id="d3f4g5h6-1i2j-3k4l-5m6n-7o8p9q0r1s2t", # Unique ID for the node
input_schema=ReadDiscordMessagesBlock.Input, # Assign input schema
output_schema=ReadDiscordMessagesBlock.Output, # Assign output schema
+ description="Reads messages from a Discord channel using a bot token.",
categories={BlockCategory.SOCIAL},
test_input={"discord_bot_token": "test_token", "continuous_read": False},
test_output=[
@@ -148,6 +149,7 @@ class SendDiscordMessageBlock(Block):
id="h1i2j3k4-5l6m-7n8o-9p0q-r1s2t3u4v5w6", # Unique ID for the node
input_schema=SendDiscordMessageBlock.Input, # Assign input schema
output_schema=SendDiscordMessageBlock.Output, # Assign output schema
+ description="Sends a message to a Discord channel using a bot token.",
categories={BlockCategory.SOCIAL},
test_input={
"discord_bot_token": "YOUR_DISCORD_BOT_TOKEN",
diff --git a/autogpt_platform/backend/backend/blocks/iteration.py b/autogpt_platform/backend/backend/blocks/iteration.py
index 7da5b7703c..f863521c83 100644
--- a/autogpt_platform/backend/backend/blocks/iteration.py
+++ b/autogpt_platform/backend/backend/blocks/iteration.py
@@ -21,6 +21,7 @@ class ListIteratorBlock(Block):
id="f8e7d6c5-b4a3-2c1d-0e9f-8g7h6i5j4k3l",
input_schema=ListIteratorBlock.Input,
output_schema=ListIteratorBlock.Output,
+ description="Iterates over a list of items and outputs each item with its index.",
categories={BlockCategory.LOGIC},
test_input={"items": [1, "two", {"three": 3}, [4, 5]]},
test_output=[
diff --git a/autogpt_platform/backend/backend/blocks/maths.py b/autogpt_platform/backend/backend/blocks/maths.py
index 4a1301c9a6..cb65de1c09 100644
--- a/autogpt_platform/backend/backend/blocks/maths.py
+++ b/autogpt_platform/backend/backend/blocks/maths.py
@@ -39,6 +39,7 @@ class CalculatorBlock(Block):
id="b1ab9b19-67a6-406d-abf5-2dba76d00c79",
input_schema=CalculatorBlock.Input,
output_schema=CalculatorBlock.Output,
+ description="Performs a mathematical operation on two numbers.",
categories={BlockCategory.LOGIC},
test_input={
"operation": Operation.ADD.value,
@@ -98,6 +99,7 @@ class CountItemsBlock(Block):
id="3c9c2f42-b0c3-435f-ba35-05f7a25c772a",
input_schema=CountItemsBlock.Input,
output_schema=CountItemsBlock.Output,
+ description="Counts the number of items in a collection.",
categories={BlockCategory.LOGIC},
test_input={"collection": [1, 2, 3, 4, 5]},
test_output=[
diff --git a/autogpt_platform/backend/backend/blocks/medium.py b/autogpt_platform/backend/backend/blocks/medium.py
index 034f3cfa4b..9ca9b41bf4 100644
--- a/autogpt_platform/backend/backend/blocks/medium.py
+++ b/autogpt_platform/backend/backend/blocks/medium.py
@@ -69,6 +69,7 @@ class PublishToMediumBlock(Block):
id="3f7b2dcb-4a78-4e3f-b0f1-88132e1b89df",
input_schema=PublishToMediumBlock.Input,
output_schema=PublishToMediumBlock.Output,
+ description="Publishes a post to Medium.",
categories={BlockCategory.SOCIAL},
test_input={
"author_id": "1234567890abcdef",
diff --git a/autogpt_platform/backend/backend/blocks/rss.py b/autogpt_platform/backend/backend/blocks/rss.py
index 74184acc0d..3dd570385b 100644
--- a/autogpt_platform/backend/backend/blocks/rss.py
+++ b/autogpt_platform/backend/backend/blocks/rss.py
@@ -46,6 +46,7 @@ class ReadRSSFeedBlock(Block):
id="c6731acb-4105-4zp1-bc9b-03d0036h370g",
input_schema=ReadRSSFeedBlock.Input,
output_schema=ReadRSSFeedBlock.Output,
+ description="Reads RSS feed entries from a given URL.",
categories={BlockCategory.INPUT},
test_input={
"rss_url": "https://example.com/rss",
diff --git a/autogpt_platform/backend/backend/blocks/search.py b/autogpt_platform/backend/backend/blocks/search.py
index 1a1ec098e4..7414ca2f8a 100644
--- a/autogpt_platform/backend/backend/blocks/search.py
+++ b/autogpt_platform/backend/backend/blocks/search.py
@@ -148,6 +148,7 @@ class GetWeatherInformationBlock(Block, GetRequest):
id="f7a8b2c3-6d4e-5f8b-9e7f-6d4e5f8b9e7f",
input_schema=GetWeatherInformationBlock.Input,
output_schema=GetWeatherInformationBlock.Output,
+ description="Retrieves weather information for a specified location using OpenWeatherMap API.",
test_input={
"location": "New York",
"api_key": "YOUR_API_KEY",
diff --git a/autogpt_platform/backend/backend/blocks/text.py b/autogpt_platform/backend/backend/blocks/text.py
index 12215de61f..da287b94fa 100644
--- a/autogpt_platform/backend/backend/blocks/text.py
+++ b/autogpt_platform/backend/backend/blocks/text.py
@@ -25,9 +25,7 @@ class MatchTextPatternBlock(Block):
def __init__(self):
super().__init__(
id="3060088f-6ed9-4928-9ba7-9c92823a7ccd",
- description="This block matches the given text with the pattern (regex) and"
- " forwards the provided data to positive (if matching) or"
- " negative (if not matching) output.",
+ description="Matches text against a regex pattern and forwards data to positive or negative output based on the match.",
categories={BlockCategory.TEXT},
input_schema=MatchTextPatternBlock.Input,
output_schema=MatchTextPatternBlock.Output,
diff --git a/autogpt_platform/backend/backend/blocks/youtube.py b/autogpt_platform/backend/backend/blocks/youtube.py
index a5d48e5a30..e299b121aa 100644
--- a/autogpt_platform/backend/backend/blocks/youtube.py
+++ b/autogpt_platform/backend/backend/blocks/youtube.py
@@ -26,6 +26,7 @@ class TranscribeYouTubeVideoBlock(Block):
id="f3a8f7e1-4b1d-4e5f-9f2a-7c3d5a2e6b4c",
input_schema=TranscribeYouTubeVideoBlock.Input,
output_schema=TranscribeYouTubeVideoBlock.Output,
+ description="Transcribes a YouTube video.",
categories={BlockCategory.SOCIAL},
test_input={"youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"},
test_output=[
diff --git a/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx b/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx
index 4bf19c94d8..3163fa81f1 100644
--- a/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx
+++ b/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx
@@ -132,33 +132,31 @@ export const BlocksControl: React.FC<BlocksControlProps> = ({
{filteredBlocks.map((block) => (
<Card
key={block.id}
- className={`m-2 ${getPrimaryCategoryColor(block.categories)}`}
+ className="m-2 my-4 flex h-20 border"
data-id={`block-card-${block.id}`}
+ onClick={() => addBlock(block.id, block.name)}
>
- <div className="m-3 flex items-center justify-between">
+ {/* This div needs to be 10px wide and the same height as the card and be the primary color showing up on top of the card with matching rounded corners */}
+ <div
+ className={`z-20 flex min-w-4 flex-shrink-0 rounded-l-xl border ${getPrimaryCategoryColor(block.categories)}`}
+ ></div>
+
+ <div className="mx-3 flex flex-1 items-center justify-between">
<div className="mr-2 min-w-0 flex-1">
<span
- className="block truncate font-medium"
+ className="block truncate text-base font-semibold"
data-id={`block-name-${block.id}`}
>
{beautifyString(block.name)}
</span>
+ <span className="block break-words text-sm font-normal text-gray-500">
+ {block.description}
+ </span>
</div>
- <SchemaTooltip description={block.description} />
<div
className="flex flex-shrink-0 items-center gap-1"
data-id={`block-tooltip-${block.id}`}
- >
- <Button
- variant="ghost"
- size="icon"
- onClick={() => addBlock(block.id, block.name)}
- aria-label="Add block"
- data-id={`add-block-button-${block.id}`}
- >
- <PlusIcon />
- </Button>
- </div>
+ ></div>
</div>
</Card>
))}
diff --git a/autogpt_platform/frontend/src/components/ui/card.tsx b/autogpt_platform/frontend/src/components/ui/card.tsx
index d4ecf66baa..769ad50215 100644
--- a/autogpt_platform/frontend/src/components/ui/card.tsx
+++ b/autogpt_platform/frontend/src/components/ui/card.tsx
@@ -9,7 +9,7 @@ const Card = React.forwardRef<
<div
ref={ref}
className={cn(
- "rounded-xl border border-neutral-200 bg-white text-neutral-950 shadow dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
+ "rounded-xl bg-white text-neutral-950 shadow dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
className,
)}
{...props}