fix: patch summarizers for integration_test_send_message.py (#4919)

* fix: integration_test_send_message.py

* patch summarizer

* remove print
This commit is contained in:
Sarah Wooders
2025-09-25 17:41:57 -07:00
committed by Caren Thomas
parent 155fa9c734
commit b5de42fefd
2 changed files with 15 additions and 13 deletions

View File

@@ -291,10 +291,11 @@ class AnthropicClient(LLMClientBase):
# Both drop heartbeats in the payload
data["messages"] = drop_heartbeats(data["messages"])
# And drop heartbeats in the tools
for tool in data["tools"]:
tool["input_schema"]["properties"].pop(REQUEST_HEARTBEAT_PARAM, None)
if REQUEST_HEARTBEAT_PARAM in tool["input_schema"]["required"]:
tool["input_schema"]["required"].remove(REQUEST_HEARTBEAT_PARAM)
if "tools" in data:
for tool in data["tools"]:
tool["input_schema"]["properties"].pop(REQUEST_HEARTBEAT_PARAM, None)
if REQUEST_HEARTBEAT_PARAM in tool["input_schema"]["required"]:
tool["input_schema"]["required"].remove(REQUEST_HEARTBEAT_PARAM)
else:
# Strip heartbeat pings if extended thinking

View File

@@ -458,15 +458,16 @@ class OpenAIClient(LLMClientBase):
# So strip them manually for v3
if agent_type == AgentType.letta_v1_agent:
new_tools = []
for tool in data.tools:
# Remove request_heartbeat from the properties if it exists
if tool.function.parameters and "properties" in tool.function.parameters:
tool.function.parameters["properties"].pop(REQUEST_HEARTBEAT_PARAM, None)
# Also remove from required list if present
if "required" in tool.function.parameters and REQUEST_HEARTBEAT_PARAM in tool.function.parameters["required"]:
tool.function.parameters["required"].remove(REQUEST_HEARTBEAT_PARAM)
new_tools.append(tool.model_copy(deep=True))
data.tools = new_tools
if data.tools:
for tool in data.tools:
# Remove request_heartbeat from the properties if it exists
if tool.function.parameters and "properties" in tool.function.parameters:
tool.function.parameters["properties"].pop(REQUEST_HEARTBEAT_PARAM, None)
# Also remove from required list if present
if "required" in tool.function.parameters and REQUEST_HEARTBEAT_PARAM in tool.function.parameters["required"]:
tool.function.parameters["required"].remove(REQUEST_HEARTBEAT_PARAM)
new_tools.append(tool.model_copy(deep=True))
data.tools = new_tools
if data.tools is not None and len(data.tools) > 0:
# Convert to structured output style (which has 'strict' and no optionals)