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.

feat(blocks/exa): Fix Exa blocks error reporting (#10020)

Reinier van der Leera51af3629622
diff --git a/autogpt_platform/backend/backend/blocks/exa/contents.py b/autogpt_platform/backend/backend/blocks/exa/contents.py
index 663e4461d6..7210af433d 100644
--- a/autogpt_platform/backend/backend/blocks/exa/contents.py
+++ b/autogpt_platform/backend/backend/blocks/exa/contents.py
@@ -85,4 +85,3 @@ class ExaContentsBlock(Block):
yield "results", data.get("results", [])
except Exception as e:
yield "error", str(e)
- yield "results", []
diff --git a/autogpt_platform/backend/backend/blocks/exa/search.py b/autogpt_platform/backend/backend/blocks/exa/search.py
index b11737de74..5915455a56 100644
--- a/autogpt_platform/backend/backend/blocks/exa/search.py
+++ b/autogpt_platform/backend/backend/blocks/exa/search.py
@@ -78,6 +78,9 @@ class ExaSearchBlock(Block):
description="List of search results",
default_factory=list,
)
+ error: str = SchemaField(
+ description="Error message if the request failed",
+ )
def __init__(self):
super().__init__(
@@ -140,4 +143,3 @@ class ExaSearchBlock(Block):
yield "results", data.get("results", [])
except Exception as e:
yield "error", str(e)
- yield "results", []
diff --git a/autogpt_platform/backend/backend/blocks/exa/similar.py b/autogpt_platform/backend/backend/blocks/exa/similar.py
index 78c0ad5dac..036d26a481 100644
--- a/autogpt_platform/backend/backend/blocks/exa/similar.py
+++ b/autogpt_platform/backend/backend/blocks/exa/similar.py
@@ -67,6 +67,7 @@ class ExaFindSimilarBlock(Block):
description="List of similar documents with title, URL, published date, author, and score",
default_factory=list,
)
+ error: str = SchemaField(description="Error message if the request failed")
def __init__(self):
super().__init__(
@@ -125,4 +126,3 @@ class ExaFindSimilarBlock(Block):
yield "results", data.get("results", [])
except Exception as e:
yield "error", str(e)
- yield "results", []