Skip to content
Merged
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,18 @@ jobs:
run: rye build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/letta-sdk-python'
if: |-
github.repository == 'stainless-sdks/letta-sdk-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/letta-sdk-python'
if: |-
github.repository == 'stainless-sdks/letta-sdk-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.7.11"
".": "1.7.12"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 123
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-641193c8d6dd0ca97bc8f6ffc12534764d4cd9dda8fc5ace158397cb74b7787b.yml
openapi_spec_hash: e0eef8afab116c4dba3540ab6fd26a8f
config_hash: 98feceec44cc57270fce259ddbbec999
configured_endpoints: 125
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-1c44d73b9152645e7b44512a238467b88c993a2c0151d5911b7f98d05583790e.yml
openapi_spec_hash: e0633c52cd8d694e72211de731d1354a
config_hash: 2dd2cc848568d7bec38b1cc774a5900c
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 1.7.12 (2026-03-09)

Full Changelog: [v1.7.11...v1.7.12](https://github.com/letta-ai/letta-python/compare/v1.7.11...v1.7.12)

### Features

* add conversation recompile endpoint ([65f0013](https://github.com/letta-ai/letta-python/commit/65f0013b623c195ec21ef627f0f2b68cce0be6ea))
* add fireworks provider ([8b536c2](https://github.com/letta-ai/letta-python/commit/8b536c2d3709d421a493481b357e8aa254aa0779))
* add recompile system endpoint to Stainless SDK ([40d9492](https://github.com/letta-ai/letta-python/commit/40d9492580644f1a9b922a0b510c5924a8d01482))
* **core:** restructure memFS system prompt rendering + add client_skills [LET-7760] ([cc0756b](https://github.com/letta-ai/letta-python/commit/cc0756bfeea232f7d0b94b49e7fe8aa247ed9875))
* **helm:** M3 multi-signal HPA external metrics + behavior (dev shadow, prod disabled) ([56f66ce](https://github.com/letta-ai/letta-python/commit/56f66cee54e0dfd0cb56156abe7744ee92434336))
* **readiness:** M2 readiness enforcement scaffold (default OFF) ([5568b66](https://github.com/letta-ai/letta-python/commit/5568b66a784f913408125548fea2b2d9f8445e69))


### Chores

* **ci:** skip uploading artifacts on stainless-internal branches ([c179828](https://github.com/letta-ai/letta-python/commit/c17982832afdfcf0d87f81d151f1f33bb9891dde))
* update placeholder string ([7142275](https://github.com/letta-ai/letta-python/commit/71422757db6f3f9cd572ec32c27217f5229e1cee))

## 1.7.11 (2026-03-04)

Full Changelog: [v1.7.10...v1.7.11](https://github.com/letta-ai/letta-python/compare/v1.7.10...v1.7.11)
Expand Down
4 changes: 4 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ from letta_client.types import (
XaiModelSettings,
AgentExportFileResponse,
AgentImportFileResponse,
AgentRecompileResponse,
)
```

Expand All @@ -57,6 +58,7 @@ Methods:
- <code title="delete /v1/agents/{agent_id}">client.agents.<a href="./src/letta_client/resources/agents/agents.py">delete</a>(agent_id) -> object</code>
- <code title="get /v1/agents/{agent_id}/export">client.agents.<a href="./src/letta_client/resources/agents/agents.py">export_file</a>(agent_id, \*\*<a href="src/letta_client/types/agent_export_file_params.py">params</a>) -> str</code>
- <code title="post /v1/agents/import">client.agents.<a href="./src/letta_client/resources/agents/agents.py">import_file</a>(\*\*<a href="src/letta_client/types/agent_import_file_params.py">params</a>) -> <a href="./src/letta_client/types/agent_import_file_response.py">AgentImportFileResponse</a></code>
- <code title="post /v1/agents/{agent_id}/recompile">client.agents.<a href="./src/letta_client/resources/agents/agents.py">recompile</a>(agent_id, \*\*<a href="src/letta_client/types/agent_recompile_params.py">params</a>) -> str</code>

## Messages

Expand Down Expand Up @@ -619,6 +621,7 @@ from letta_client.types import (
UpdateConversation,
ConversationListResponse,
ConversationCancelResponse,
ConversationRecompileResponse,
)
```

Expand All @@ -630,6 +633,7 @@ Methods:
- <code title="get /v1/conversations/">client.conversations.<a href="./src/letta_client/resources/conversations/conversations.py">list</a>(\*\*<a href="src/letta_client/types/conversation_list_params.py">params</a>) -> <a href="./src/letta_client/types/conversation_list_response.py">ConversationListResponse</a></code>
- <code title="delete /v1/conversations/{conversation_id}">client.conversations.<a href="./src/letta_client/resources/conversations/conversations.py">delete</a>(conversation_id) -> object</code>
- <code title="post /v1/conversations/{conversation_id}/cancel">client.conversations.<a href="./src/letta_client/resources/conversations/conversations.py">cancel</a>(conversation_id, \*\*<a href="src/letta_client/types/conversation_cancel_params.py">params</a>) -> <a href="./src/letta_client/types/conversation_cancel_response.py">ConversationCancelResponse</a></code>
- <code title="post /v1/conversations/{conversation_id}/recompile">client.conversations.<a href="./src/letta_client/resources/conversations/conversations.py">recompile</a>(conversation_id, \*\*<a href="src/letta_client/types/conversation_recompile_params.py">params</a>) -> str</code>

## Messages

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "letta-client"
version = "1.7.11"
version = "1.7.12"
description = "The official Python library for the letta API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions src/letta_client/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def health(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> HealthResponse:
"""Async health check endpoint."""
"""Liveness endpoint; returns 200 when process is responsive."""
return self.get(
"/v1/health/",
options=make_request_options(
Expand Down Expand Up @@ -684,7 +684,7 @@ async def health(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> HealthResponse:
"""Async health check endpoint."""
"""Liveness endpoint; returns 200 when process is responsive."""
return await self.get(
"/v1/health/",
options=make_request_options(
Expand Down
2 changes: 1 addition & 1 deletion src/letta_client/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "letta_client"
__version__ = "1.7.11" # x-release-please-version
__version__ = "1.7.12" # x-release-please-version
117 changes: 117 additions & 0 deletions src/letta_client/resources/agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
agent_create_params,
agent_update_params,
agent_retrieve_params,
agent_recompile_params,
agent_export_file_params,
agent_import_file_params,
)
Expand Down Expand Up @@ -1038,6 +1039,58 @@ def import_file(
cast_to=AgentImportFileResponse,
)

def recompile(
self,
agent_id: str,
*,
dry_run: bool | Omit = omit,
update_timestamp: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> str:
"""
Manually trigger system prompt recompilation for an agent.

Args:
agent_id: The ID of the agent in the format 'agent-<uuid4>'

dry_run: If True, do not persist changes; still returns the compiled system prompt.

update_timestamp: If True, update the in-context memory last edit timestamp embedded in the system
prompt.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not agent_id:
raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
return self._post(
f"/v1/agents/{agent_id}/recompile",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"dry_run": dry_run,
"update_timestamp": update_timestamp,
},
agent_recompile_params.AgentRecompileParams,
),
),
cast_to=str,
)


class AsyncAgentsResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -1953,6 +2006,58 @@ async def import_file(
cast_to=AgentImportFileResponse,
)

async def recompile(
self,
agent_id: str,
*,
dry_run: bool | Omit = omit,
update_timestamp: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> str:
"""
Manually trigger system prompt recompilation for an agent.

Args:
agent_id: The ID of the agent in the format 'agent-<uuid4>'

dry_run: If True, do not persist changes; still returns the compiled system prompt.

update_timestamp: If True, update the in-context memory last edit timestamp embedded in the system
prompt.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not agent_id:
raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
return await self._post(
f"/v1/agents/{agent_id}/recompile",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{
"dry_run": dry_run,
"update_timestamp": update_timestamp,
},
agent_recompile_params.AgentRecompileParams,
),
),
cast_to=str,
)


class AgentsResourceWithRawResponse:
def __init__(self, agents: AgentsResource) -> None:
Expand All @@ -1979,6 +2084,9 @@ def __init__(self, agents: AgentsResource) -> None:
self.import_file = to_raw_response_wrapper(
agents.import_file,
)
self.recompile = to_raw_response_wrapper(
agents.recompile,
)

@cached_property
def messages(self) -> MessagesResourceWithRawResponse:
Expand Down Expand Up @@ -2042,6 +2150,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None:
self.import_file = async_to_raw_response_wrapper(
agents.import_file,
)
self.recompile = async_to_raw_response_wrapper(
agents.recompile,
)

@cached_property
def messages(self) -> AsyncMessagesResourceWithRawResponse:
Expand Down Expand Up @@ -2105,6 +2216,9 @@ def __init__(self, agents: AgentsResource) -> None:
self.import_file = to_streamed_response_wrapper(
agents.import_file,
)
self.recompile = to_streamed_response_wrapper(
agents.recompile,
)

@cached_property
def messages(self) -> MessagesResourceWithStreamingResponse:
Expand Down Expand Up @@ -2168,6 +2282,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None:
self.import_file = async_to_streamed_response_wrapper(
agents.import_file,
)
self.recompile = async_to_streamed_response_wrapper(
agents.recompile,
)

@cached_property
def messages(self) -> AsyncMessagesResourceWithStreamingResponse:
Expand Down
Loading