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.

fix formatting

Reinier van der Leerc7f2a7dd03ed
diff --git a/autogpt_platform/backend/backend/blocks/smart_decision_maker.py b/autogpt_platform/backend/backend/blocks/smart_decision_maker.py
index b0a32b741c..49680548af 100644
--- a/autogpt_platform/backend/backend/blocks/smart_decision_maker.py
+++ b/autogpt_platform/backend/backend/blocks/smart_decision_maker.py
@@ -1050,9 +1050,7 @@ class SmartDecisionMakerBlock(Block):
values = input_data.prompt_values
if values:
- input_data.prompt = await llm.fmt.format_string(
- input_data.prompt, values
- )
+ input_data.prompt = await llm.fmt.format_string(input_data.prompt, values)
input_data.sys_prompt = await llm.fmt.format_string(
input_data.sys_prompt, values
)
diff --git a/autogpt_platform/backend/backend/notifications/notifications.py b/autogpt_platform/backend/backend/notifications/notifications.py
index 4295739985..674b0d0223 100644
--- a/autogpt_platform/backend/backend/notifications/notifications.py
+++ b/autogpt_platform/backend/backend/notifications/notifications.py
@@ -715,12 +715,14 @@ class NotificationManager(AppService):
try:
# Try to render the email to check its size
template = self.email_sender._get_template(event.type)
- _, test_message = await self.email_sender.formatter.format_email(
- base_template=template.base_template,
- subject_template=template.subject_template,
- content_template=template.body_template,
- data={"notifications": chunk},
- unsubscribe_link=f"{self.email_sender.formatter.env.globals.get('base_url', '')}/profile/settings",
+ _, test_message = (
+ await self.email_sender.formatter.format_email(
+ base_template=template.base_template,
+ subject_template=template.subject_template,
+ content_template=template.body_template,
+ data={"notifications": chunk},
+ unsubscribe_link=f"{self.email_sender.formatter.env.globals.get('base_url', '')}/profile/settings",
+ )
)
if len(test_message) < MAX_EMAIL_SIZE:
diff --git a/autogpt_platform/backend/backend/util/text.py b/autogpt_platform/backend/backend/util/text.py
index a75f232058..6258b42a1a 100644
--- a/autogpt_platform/backend/backend/util/text.py
+++ b/autogpt_platform/backend/backend/util/text.py
@@ -196,9 +196,7 @@ def _safe_range(*args: int) -> range:
"""range() replacement that caps the number of items to prevent DoS."""
r = range(*args)
if len(r) > MAX_RANGE:
- raise OverflowError(
- f"range() too large ({len(r)} items, max {MAX_RANGE})"
- )
+ raise OverflowError(f"range() too large ({len(r)} items, max {MAX_RANGE})")
return r
@@ -223,9 +221,7 @@ class _RestrictedEnvironment(SandboxedEnvironment):
if __obj is pow and len(args) >= 2:
base, exp = args[0], args[1]
if isinstance(exp, (int, float)) and abs(exp) > MAX_EXPONENT:
- raise OverflowError(
- f"Exponent too large (max {MAX_EXPONENT})"
- )
+ raise OverflowError(f"Exponent too large (max {MAX_EXPONENT})")
if isinstance(base, (int, float)) and abs(base) > MAX_EXPONENT:
raise OverflowError(
f"Base too large for exponentiation (max {MAX_EXPONENT})"
@@ -236,9 +232,7 @@ class _RestrictedEnvironment(SandboxedEnvironment):
# Intercept the ** (power) operator
if operator == "**":
if isinstance(right, (int, float)) and abs(right) > MAX_EXPONENT:
- raise OverflowError(
- f"Exponent too large (max {MAX_EXPONENT})"
- )
+ raise OverflowError(f"Exponent too large (max {MAX_EXPONENT})")
if isinstance(left, (int, float)) and abs(left) > MAX_EXPONENT:
raise OverflowError(
f"Base too large for exponentiation (max {MAX_EXPONENT})"