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: patch failing gemini unit tests (#786)

Charles Packerde3adfea4f5f
diff --git a/letta/functions/schema_generator.py b/letta/functions/schema_generator.py
index 7c2764ae1..3b1560e8c 100644
--- a/letta/functions/schema_generator.py
+++ b/letta/functions/schema_generator.py
@@ -437,6 +437,7 @@ def generate_tool_schema_for_composio(
name: str,
description: str,
append_heartbeat: bool = True,
+ strict: bool = False,
) -> Dict[str, Any]:
properties_json = {}
required_fields = parameters_model.required or []
@@ -473,14 +474,26 @@ def generate_tool_schema_for_composio(
required_fields.append("request_heartbeat")
# Return the final schema
- return {
- "name": name,
- "description": description,
- "strict": True,
- "parameters": {
- "type": "object",
- "properties": properties_json,
- "additionalProperties": False,
- "required": required_fields,
- },
- }
+ if strict:
+ # https://platform.openai.com/docs/guides/function-calling#strict-mode
+ return {
+ "name": name,
+ "description": description,
+ "strict": True, # NOTE
+ "parameters": {
+ "type": "object",
+ "properties": properties_json,
+ "additionalProperties": False, # NOTE
+ "required": required_fields,
+ },
+ }
+ else:
+ return {
+ "name": name,
+ "description": description,
+ "parameters": {
+ "type": "object",
+ "properties": properties_json,
+ "required": required_fields,
+ },
+ }
diff --git a/letta/services/helpers/agent_manager_helper.py b/letta/services/helpers/agent_manager_helper.py
index 0b32dcbe0..95053cd67 100644
--- a/letta/services/helpers/agent_manager_helper.py
+++ b/letta/services/helpers/agent_manager_helper.py
@@ -191,7 +191,6 @@ def compile_system_message(
# render the variables using the built-in templater
try:
formatted_prompt = safe_format(system_prompt, variables)
- print(f"Formatted system prompt:\n{formatted_prompt}")
except Exception as e:
raise ValueError(f"Failed to format system prompt - {str(e)}. System prompt value:\n{system_prompt}")