Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: fix formatting of multiagent tool

Sarah Wooderse27fb42884d9
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 6d9b7491d..5aea01246 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -13,18 +13,18 @@ repos:
hooks:
- id: autoflake
name: autoflake
- entry: bash -c 'cd apps/core && poetry run autoflake --remove-all-unused-imports --remove-unused-variables --in-place --recursive --ignore-init-module-imports .'
+ entry: bash -c 'poetry run autoflake --remove-all-unused-imports --remove-unused-variables --in-place --recursive --ignore-init-module-imports .'
language: system
types: [python]
- id: isort
name: isort
- entry: bash -c 'cd apps/core && poetry run isort --profile black .'
+ entry: bash -c 'poetry run isort --profile black .'
language: system
types: [python]
exclude: ^docs/
- id: black
name: black
- entry: bash -c 'cd apps/core && poetry run black --line-length 140 --target-version py310 --target-version py311 .'
+ entry: bash -c 'poetry run black --line-length 140 --target-version py310 --target-version py311 .'
language: system
types: [python]
exclude: ^docs/
diff --git a/letta/functions/helpers.py b/letta/functions/helpers.py
index 9ebe9494e..bd2643c49 100644
--- a/letta/functions/helpers.py
+++ b/letta/functions/helpers.py
@@ -269,9 +269,11 @@ def parse_letta_response_for_assistant_message(
fallback_reasoning.append(m.reasoning)
if messages:
- return f"Agent {target_agent_id} said: '{"\n".join(messages)}'"
+ messages_str = "\n".join(messages)
+ return f"Agent {target_agent_id} said: '{messages_str}'"
else:
- return f"Agent {target_agent_id}'s inner thoughts: '{"\n".join(messages)}'"
+ messages_str = "\n".join(fallback_reasoning)
+ return f"Agent {target_agent_id}'s inner thoughts: '{messages_str}'"
def execute_send_message_to_agent(
diff --git a/tests/test_tool_sandbox/restaurant_management_system/adjust_menu_prices.py b/tests/test_tool_sandbox/restaurant_management_system/adjust_menu_prices.py
index 57adc1639..1e5c090e6 100644
--- a/tests/test_tool_sandbox/restaurant_management_system/adjust_menu_prices.py
+++ b/tests/test_tool_sandbox/restaurant_management_system/adjust_menu_prices.py
@@ -8,7 +8,6 @@ def adjust_menu_prices(percentage: float) -> str:
str: A formatted string summarizing the price adjustments.
"""
import cowsay
-
from core.menu import Menu, MenuItem # Import a class from the codebase
from core.utils import format_currency # Use a utility function to test imports