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.

feat: add placeholder for image inputs in Anthropic proxy [LET-6449] (#6522)

cthomas0d18ecc2ec88
diff --git a/letta/server/rest_api/routers/v1/anthropic.py b/letta/server/rest_api/routers/v1/anthropic.py
index 4fd003e24..3b08875cd 100644
--- a/letta/server/rest_api/routers/v1/anthropic.py
+++ b/letta/server/rest_api/routers/v1/anthropic.py
@@ -34,8 +34,11 @@ def extract_user_messages(body: bytes) -> list[str]:
user_messages.append(content)
elif isinstance(content, list):
for block in content:
- if isinstance(block, dict) and block.get("type") == "text":
- user_messages.append(block.get("text", ""))
+ if isinstance(block, dict):
+ if block.get("type") == "text":
+ user_messages.append(block.get("text", ""))
+ elif block.get("type") == "image":
+ user_messages.append("[IMAGE]")
return user_messages
except Exception as e: