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 project id to letta client constructor (#3119)

cthomas57e08e46d73a
diff --git a/letta/server/rest_api/routers/v1/agents.py b/letta/server/rest_api/routers/v1/agents.py
index 15496985d..8c3c14ef8 100644
--- a/letta/server/rest_api/routers/v1/agents.py
+++ b/letta/server/rest_api/routers/v1/agents.py
@@ -242,7 +242,9 @@ async def create_agent(
agent: CreateAgentRequest = Body(...),
server: "SyncServer" = Depends(get_letta_server),
actor_id: Optional[str] = Header(None, alias="user_id"), # Extract user_id from header, default to None if not present
- x_project: Optional[str] = Header(None, alias="X-Project"), # Only handled by next js middleware
+ x_project: Optional[str] = Header(
+ None, alias="X-Project", description="The project slug to associate with the agent (cloud only)."
+ ), # Only handled by next js middleware
):
"""
Create a new agent with the specified configuration.
diff --git a/letta/server/rest_api/routers/v1/groups.py b/letta/server/rest_api/routers/v1/groups.py
index 559b98d5e..bbb511574 100644
--- a/letta/server/rest_api/routers/v1/groups.py
+++ b/letta/server/rest_api/routers/v1/groups.py
@@ -73,7 +73,9 @@ def create_group(
group: GroupCreate = Body(...),
server: "SyncServer" = Depends(get_letta_server),
actor_id: Optional[str] = Header(None, alias="user_id"),
- x_project: Optional[str] = Header(None, alias="X-Project"), # Only handled by next js middleware
+ x_project: Optional[str] = Header(
+ None, alias="X-Project", description="The project slug to associate with the group (cloud only)."
+ ), # Only handled by next js middleware
):
"""
Create a new multi-agent group with the specified configuration.
@@ -91,7 +93,9 @@ async def modify_group(
group: GroupUpdate = Body(...),
server: "SyncServer" = Depends(get_letta_server),
actor_id: Optional[str] = Header(None, alias="user_id"),
- x_project: Optional[str] = Header(None, alias="X-Project"), # Only handled by next js middleware
+ x_project: Optional[str] = Header(
+ None, alias="X-Project", description="The project slug to associate with the group (cloud only)."
+ ), # Only handled by next js middleware
):
"""
Create a new multi-agent group with the specified configuration.
diff --git a/letta/server/rest_api/routers/v1/identities.py b/letta/server/rest_api/routers/v1/identities.py
index 16cdbb26e..eb2d937fc 100644
--- a/letta/server/rest_api/routers/v1/identities.py
+++ b/letta/server/rest_api/routers/v1/identities.py
@@ -86,7 +86,9 @@ async def create_identity(
identity: IdentityCreate = Body(...),
server: "SyncServer" = Depends(get_letta_server),
actor_id: Optional[str] = Header(None, alias="user_id"), # Extract user_id from header, default to None if not present
- x_project: Optional[str] = Header(None, alias="X-Project"), # Only handled by next js middleware
+ x_project: Optional[str] = Header(
+ None, alias="X-Project", description="The project slug to associate with the identity (cloud only)."
+ ), # Only handled by next js middleware
):
try:
actor = await server.user_manager.get_actor_or_default_async(actor_id=actor_id)
@@ -110,7 +112,9 @@ async def upsert_identity(
identity: IdentityUpsert = Body(...),
server: "SyncServer" = Depends(get_letta_server),
actor_id: Optional[str] = Header(None, alias="user_id"), # Extract user_id from header, default to None if not present
- x_project: Optional[str] = Header(None, alias="X-Project"), # Only handled by next js middleware
+ x_project: Optional[str] = Header(
+ None, alias="X-Project", description="The project slug to associate with the identity (cloud only)."
+ ), # Only handled by next js middleware
):
try:
actor = await server.user_manager.get_actor_or_default_async(actor_id=actor_id)
diff --git a/poetry.lock b/poetry.lock
index 76979d66d..c8248b9d7 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -3396,14 +3396,14 @@ pytest = ["pytest (>=7.0.0)", "rich (>=13.9.4,<14.0.0)"]
[[package]]
name = "letta-client"
-version = "0.1.173"
+version = "0.1.183"
description = ""
optional = false
python-versions = "<4.0,>=3.8"
groups = ["main"]
files = [
- {file = "letta_client-0.1.173-py3-none-any.whl", hash = "sha256:8a1c9212cc673ff4cafae1e064a79b343c7b14cf32f02f3a5aeee82d3987c84f"},
- {file = "letta_client-0.1.173.tar.gz", hash = "sha256:0a477557e4e7661f287d778ed9fb5c622cad1490373de645e3313edfb20863d2"},
+ {file = "letta_client-0.1.183-py3-none-any.whl", hash = "sha256:72d7d53ae3093a6d79fcefd24d079a135be806b9ff1f77b1501d7966a14222dd"},
+ {file = "letta_client-0.1.183.tar.gz", hash = "sha256:f89026e96ffd0c24fec9cedb5f76895fdb8a5414d440f4f66c7e427f9a37e110"},
]
[package.dependencies]
@@ -7895,4 +7895,4 @@ tests = ["wikipedia"]
[metadata]
lock-version = "2.1"
python-versions = "<3.14,>=3.10"
-content-hash = "832b624269b0dcb405e353150f5b6e0de17d17c154a6945970d9d8acfbd2a6bc"
+content-hash = "185b0f643ff7eb3de0ddba12cdbbe1fd1553df2d6a7b35edc5ac4046c85f5b29"
diff --git a/pyproject.toml b/pyproject.toml
index 45448b280..c3703569f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -72,7 +72,7 @@ llama-index = "^0.12.2"
llama-index-embeddings-openai = "^0.3.1"
e2b-code-interpreter = {version = "^1.0.3", optional = true}
anthropic = "^0.49.0"
-letta_client = "^0.1.173"
+letta_client = "^0.1.183"
openai = "^1.60.0"
opentelemetry-api = "1.30.0"
opentelemetry-sdk = "1.30.0"