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.

chore: deprecate identities/groups APIs and remove from SDK (#8580)

Sarah Wooders9aac2abdfe24
diff --git a/letta/server/rest_api/routers/v1/groups.py b/letta/server/rest_api/routers/v1/groups.py
index 190767836..49553224b 100644
--- a/letta/server/rest_api/routers/v1/groups.py
+++ b/letta/server/rest_api/routers/v1/groups.py
@@ -17,7 +17,7 @@ from letta.validators import GroupId, MessageId
router = APIRouter(prefix="/groups", tags=["groups"])
[email protected]("/", response_model=List[Group], operation_id="list_groups")
[email protected]("/", response_model=List[Group], operation_id="list_groups", deprecated=True)
async def list_groups(
server: "SyncServer" = Depends(get_letta_server),
headers: HeaderParams = Depends(get_headers),
@@ -56,7 +56,7 @@ async def list_groups(
)
[email protected]("/count", response_model=int, operation_id="count_groups")
[email protected]("/count", response_model=int, operation_id="count_groups", deprecated=True)
async def count_groups(
server: SyncServer = Depends(get_letta_server),
headers: HeaderParams = Depends(get_headers),
@@ -68,7 +68,7 @@ async def count_groups(
return await server.group_manager.size(actor=actor)
[email protected]("/{group_id}", response_model=Group, operation_id="retrieve_group")
[email protected]("/{group_id}", response_model=Group, operation_id="retrieve_group", deprecated=True)
async def retrieve_group(
group_id: GroupId,
server: "SyncServer" = Depends(get_letta_server),
@@ -81,7 +81,7 @@ async def retrieve_group(
return await server.group_manager.retrieve_group_async(group_id=group_id, actor=actor)
[email protected]("/", response_model=Group, operation_id="create_group")
[email protected]("/", response_model=Group, operation_id="create_group", deprecated=True)
async def create_group(
group: GroupCreate = Body(...),
server: "SyncServer" = Depends(get_letta_server),
@@ -97,7 +97,7 @@ async def create_group(
return await server.group_manager.create_group_async(group, actor=actor)
[email protected]("/{group_id}", response_model=Group, operation_id="modify_group")
[email protected]("/{group_id}", response_model=Group, operation_id="modify_group", deprecated=True)
async def modify_group(
group_id: GroupId,
group: GroupUpdate = Body(...),
@@ -114,7 +114,7 @@ async def modify_group(
return await server.group_manager.modify_group_async(group_id=group_id, group_update=group, actor=actor)
[email protected]("/{group_id}", response_model=None, operation_id="delete_group")
[email protected]("/{group_id}", response_model=None, operation_id="delete_group", deprecated=True)
async def delete_group(
group_id: GroupId,
server: "SyncServer" = Depends(get_letta_server),
@@ -132,6 +132,7 @@ async def delete_group(
"/{group_id}/messages",
response_model=LettaResponse,
operation_id="send_group_message",
+ deprecated=True,
)
async def send_group_message(
group_id: GroupId,
@@ -162,6 +163,7 @@ async def send_group_message(
"/{group_id}/messages/stream",
response_model=None,
operation_id="send_group_message_streaming",
+ deprecated=True,
responses={
200: {
"description": "Successful response",
@@ -202,7 +204,7 @@ GroupMessagesResponse = Annotated[
]
[email protected]("/{group_id}/messages/{message_id}", response_model=LettaMessageUnion, operation_id="modify_group_message")
[email protected]("/{group_id}/messages/{message_id}", response_model=LettaMessageUnion, operation_id="modify_group_message", deprecated=True)
async def modify_group_message(
group_id: GroupId,
message_id: MessageId,
@@ -218,7 +220,7 @@ async def modify_group_message(
return await server.message_manager.update_message_by_letta_message(message_id=message_id, letta_message_update=request, actor=actor)
[email protected]("/{group_id}/messages", response_model=GroupMessagesResponse, operation_id="list_group_messages")
[email protected]("/{group_id}/messages", response_model=GroupMessagesResponse, operation_id="list_group_messages", deprecated=True)
async def list_group_messages(
group_id: GroupId,
before: Optional[str] = Query(
@@ -273,7 +275,7 @@ async def list_group_messages(
)
[email protected]("/{group_id}/reset-messages", response_model=None, operation_id="reset_group_messages")
[email protected]("/{group_id}/reset-messages", response_model=None, operation_id="reset_group_messages", deprecated=True)
async def reset_group_messages(
group_id: GroupId,
server: "SyncServer" = Depends(get_letta_server),
@@ -286,7 +288,7 @@ async def reset_group_messages(
await server.group_manager.reset_messages_async(group_id=group_id, actor=actor)
[email protected]("/{group_id}/blocks/attach/{block_id}", response_model=None, operation_id="attach_block_to_group")
[email protected]("/{group_id}/blocks/attach/{block_id}", response_model=None, operation_id="attach_block_to_group", deprecated=True)
async def attach_block_to_group(
block_id: str,
group_id: GroupId,
@@ -306,7 +308,7 @@ async def attach_block_to_group(
return None
[email protected]("/{group_id}/blocks/detach/{block_id}", response_model=None, operation_id="detach_block_from_group")
[email protected]("/{group_id}/blocks/detach/{block_id}", response_model=None, operation_id="detach_block_from_group", deprecated=True)
async def detach_block_from_group(
block_id: str,
group_id: GroupId,
diff --git a/letta/server/rest_api/routers/v1/identities.py b/letta/server/rest_api/routers/v1/identities.py
index 892c29d01..2fca5a7ae 100644
--- a/letta/server/rest_api/routers/v1/identities.py
+++ b/letta/server/rest_api/routers/v1/identities.py
@@ -22,7 +22,7 @@ if TYPE_CHECKING:
router = APIRouter(prefix="/identities", tags=["identities"])
[email protected]("/", tags=["identities"], response_model=List[Identity], operation_id="list_identities")
[email protected]("/", tags=["identities"], response_model=List[Identity], operation_id="list_identities", deprecated=True)
async def list_identities(
name: Optional[str] = Query(None),
project_id: Optional[str] = Query(
@@ -68,7 +68,7 @@ async def list_identities(
return identities
[email protected]("/count", tags=["identities"], response_model=int, operation_id="count_identities")
[email protected]("/count", tags=["identities"], response_model=int, operation_id="count_identities", deprecated=True)
async def count_identities(
server: "SyncServer" = Depends(get_letta_server),
headers: HeaderParams = Depends(get_headers),
@@ -83,7 +83,7 @@ async def count_identities(
return 0
[email protected]("/{identity_id}", tags=["identities"], response_model=Identity, operation_id="retrieve_identity")
[email protected]("/{identity_id}", tags=["identities"], response_model=Identity, operation_id="retrieve_identity", deprecated=True)
async def retrieve_identity(
identity_id: IdentityId,
server: "SyncServer" = Depends(get_letta_server),
@@ -93,7 +93,7 @@ async def retrieve_identity(
return await server.identity_manager.get_identity_async(identity_id=identity_id, actor=actor)
[email protected]("/", tags=["identities"], response_model=Identity, operation_id="create_identity")
[email protected]("/", tags=["identities"], response_model=Identity, operation_id="create_identity", deprecated=True)
async def create_identity(
identity: IdentityCreate = Body(...),
server: "SyncServer" = Depends(get_letta_server),
@@ -106,7 +106,7 @@ async def create_identity(
return await server.identity_manager.create_identity_async(identity=identity, actor=actor)
[email protected]("/", tags=["identities"], response_model=Identity, operation_id="upsert_identity")
[email protected]("/", tags=["identities"], response_model=Identity, operation_id="upsert_identity", deprecated=True)
async def upsert_identity(
identity: IdentityUpsert = Body(...),
server: "SyncServer" = Depends(get_letta_server),
@@ -119,7 +119,7 @@ async def upsert_identity(
return await server.identity_manager.upsert_identity_async(identity=identity, actor=actor)
[email protected]("/{identity_id}", tags=["identities"], response_model=Identity, operation_id="update_identity")
[email protected]("/{identity_id}", tags=["identities"], response_model=Identity, operation_id="update_identity", deprecated=True)
async def modify_identity(
identity_id: IdentityId,
identity: IdentityUpdate = Body(...),
@@ -130,7 +130,7 @@ async def modify_identity(
return await server.identity_manager.update_identity_async(identity_id=identity_id, identity=identity, actor=actor)
[email protected]("/{identity_id}/properties", tags=["identities"], operation_id="upsert_properties_for_identity")
[email protected]("/{identity_id}/properties", tags=["identities"], operation_id="upsert_properties_for_identity", deprecated=True)
async def upsert_properties_for_identity(
identity_id: IdentityId,
properties: List[IdentityProperty] = Body(...),
@@ -141,7 +141,7 @@ async def upsert_properties_for_identity(
return await server.identity_manager.upsert_identity_properties_async(identity_id=identity_id, properties=properties, actor=actor)
[email protected]("/{identity_id}", tags=["identities"], operation_id="delete_identity")
[email protected]("/{identity_id}", tags=["identities"], operation_id="delete_identity", deprecated=True)
async def delete_identity(
identity_id: IdentityId,
server: "SyncServer" = Depends(get_letta_server),
@@ -154,7 +154,7 @@ async def delete_identity(
await server.identity_manager.delete_identity_async(identity_id=identity_id, actor=actor)
[email protected]("/{identity_id}/agents", response_model=List[AgentState], operation_id="list_agents_for_identity")
[email protected]("/{identity_id}/agents", response_model=List[AgentState], operation_id="list_agents_for_identity", deprecated=True)
async def list_agents_for_identity(
identity_id: IdentityId,
before: Optional[str] = Query(
@@ -192,7 +192,7 @@ async def list_agents_for_identity(
)
[email protected]("/{identity_id}/blocks", response_model=List[BlockResponse], operation_id="list_blocks_for_identity")
[email protected]("/{identity_id}/blocks", response_model=List[BlockResponse], operation_id="list_blocks_for_identity", deprecated=True)
async def list_blocks_for_identity(
identity_id: IdentityId,
before: Optional[str] = Query(