Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
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.12"
".": "1.8.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 125
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-1c44d73b9152645e7b44512a238467b88c993a2c0151d5911b7f98d05583790e.yml
openapi_spec_hash: e0633c52cd8d694e72211de731d1354a
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-4f81cefe8beedee5e99c60f70160a0c3fe5a8b7e61a4e3eaf4ec77ddbda61d9f.yml
openapi_spec_hash: 5d46cb41efa2153e3628a530c5f1e64d
config_hash: 2dd2cc848568d7bec38b1cc774a5900c
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 1.8.0 (2026-03-18)

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

### Features

* add zai coding provider ([192fc35](https://github.com/letta-ai/letta-python/commit/192fc354c262fca4e4562816198006e92da1b1b4))
* always create otid for request ([f208278](https://github.com/letta-ai/letta-python/commit/f20827887378a6a0525d02731436c820e3c6ee06))


### Bug Fixes

* **deps:** bump minimum typing-extensions version ([fcebea1](https://github.com/letta-ai/letta-python/commit/fcebea132a9cfa2f4d87ab298ccdc32cf58f6884))
* **pydantic:** do not pass `by_alias` unless set ([6fd6fc5](https://github.com/letta-ai/letta-python/commit/6fd6fc5ab183d7a0eef902bb07f3ea4801b1e247))


### Chores

* **internal:** tweak CI branches ([0591087](https://github.com/letta-ai/letta-python/commit/05910876a703bbd272924a3c54d9a8fe2c993c94))


### Refactors

* **sglang:** use input_ids instead of text in native adapter ([66c6a22](https://github.com/letta-ai/letta-python/commit/66c6a223d1c3aa6b081289401185d528218efdba))

## 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)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "letta-client"
version = "1.7.12"
version = "1.8.0"
description = "The official Python library for the letta API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand All @@ -11,7 +11,7 @@ authors = [
dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"typing-extensions>=4.14, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
Expand Down
11 changes: 9 additions & 2 deletions src/letta_client/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
from datetime import date, datetime
from typing_extensions import Self, Literal
from typing_extensions import Self, Literal, TypedDict

import pydantic
from pydantic.fields import FieldInfo
Expand Down Expand Up @@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
return model.model_dump_json(indent=indent)


class _ModelDumpKwargs(TypedDict, total=False):
by_alias: bool


def model_dump(
model: pydantic.BaseModel,
*,
Expand All @@ -142,14 +146,17 @@ def model_dump(
by_alias: bool | None = None,
) -> dict[str, Any]:
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
kwargs: _ModelDumpKwargs = {}
if by_alias is not None:
kwargs["by_alias"] = by_alias
return model.model_dump(
mode=mode,
exclude=exclude,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
# warnings are not supported in Pydantic v1
warnings=True if PYDANTIC_V1 else warnings,
by_alias=by_alias,
**kwargs,
)
return cast(
"dict[str, Any]",
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.12" # x-release-please-version
__version__ = "1.8.0" # x-release-please-version
98 changes: 98 additions & 0 deletions src/letta_client/types/agent_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
"AgentCreateParams",
"CompactionSettings",
"CompactionSettingsModelSettings",
"CompactionSettingsModelSettingsSgLangModelSettings",
"CompactionSettingsModelSettingsSgLangModelSettingsReasoning",
"CompactionSettingsModelSettingsSgLangModelSettingsResponseFormat",
"CompactionSettingsModelSettingsZaiModelSettings",
"CompactionSettingsModelSettingsZaiModelSettingsResponseFormat",
"CompactionSettingsModelSettingsZaiModelSettingsThinking",
Expand All @@ -46,6 +49,9 @@
"CompactionSettingsModelSettingsChatGptoAuthModelSettings",
"CompactionSettingsModelSettingsChatGptoAuthModelSettingsReasoning",
"ModelSettings",
"ModelSettingsSgLangModelSettings",
"ModelSettingsSgLangModelSettingsReasoning",
"ModelSettingsSgLangModelSettingsResponseFormat",
"ModelSettingsZaiModelSettings",
"ModelSettingsZaiModelSettingsResponseFormat",
"ModelSettingsZaiModelSettingsThinking",
Expand Down Expand Up @@ -264,6 +270,51 @@ class AgentCreateParams(TypedDict, total=False):
"""The tools used by the agent."""


class CompactionSettingsModelSettingsSgLangModelSettingsReasoning(TypedDict, total=False):
"""The reasoning configuration for the model."""

reasoning_effort: Literal["none", "minimal", "low", "medium", "high", "xhigh"]
"""The reasoning effort to use when generating text reasoning models"""


CompactionSettingsModelSettingsSgLangModelSettingsResponseFormat: TypeAlias = Union[
TextResponseFormatParam, JsonSchemaResponseFormatParam, JsonObjectResponseFormatParam
]


class CompactionSettingsModelSettingsSgLangModelSettings(TypedDict, total=False):
"""
SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing).
"""

max_output_tokens: int
"""The maximum number of tokens the model can generate."""

parallel_tool_calls: bool
"""Whether to enable parallel tool calling."""

provider_type: Literal["sglang"]
"""The type of the provider."""

reasoning: CompactionSettingsModelSettingsSgLangModelSettingsReasoning
"""The reasoning configuration for the model."""

response_format: Optional[CompactionSettingsModelSettingsSgLangModelSettingsResponseFormat]
"""The response format for the model."""

strict: bool
"""Enable strict mode for tool calling.

When true, tool outputs are guaranteed to match JSON schemas.
"""

temperature: float
"""The temperature of the model."""

tool_call_parser: Optional[str]
"""SGLang tool call parser name (for example 'glm47', 'qwen25', or 'hermes')."""


CompactionSettingsModelSettingsZaiModelSettingsResponseFormat: TypeAlias = Union[
TextResponseFormatParam, JsonSchemaResponseFormatParam, JsonObjectResponseFormatParam
]
Expand Down Expand Up @@ -353,6 +404,7 @@ class CompactionSettingsModelSettingsChatGptoAuthModelSettings(TypedDict, total=

CompactionSettingsModelSettings: TypeAlias = Union[
OpenAIModelSettingsParam,
CompactionSettingsModelSettingsSgLangModelSettings,
AnthropicModelSettingsParam,
GoogleAIModelSettingsParam,
GoogleVertexModelSettingsParam,
Expand Down Expand Up @@ -409,6 +461,51 @@ class CompactionSettings(TypedDict, total=False):
"""


class ModelSettingsSgLangModelSettingsReasoning(TypedDict, total=False):
"""The reasoning configuration for the model."""

reasoning_effort: Literal["none", "minimal", "low", "medium", "high", "xhigh"]
"""The reasoning effort to use when generating text reasoning models"""


ModelSettingsSgLangModelSettingsResponseFormat: TypeAlias = Union[
TextResponseFormatParam, JsonSchemaResponseFormatParam, JsonObjectResponseFormatParam
]


class ModelSettingsSgLangModelSettings(TypedDict, total=False):
"""
SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing).
"""

max_output_tokens: int
"""The maximum number of tokens the model can generate."""

parallel_tool_calls: bool
"""Whether to enable parallel tool calling."""

provider_type: Literal["sglang"]
"""The type of the provider."""

reasoning: ModelSettingsSgLangModelSettingsReasoning
"""The reasoning configuration for the model."""

response_format: Optional[ModelSettingsSgLangModelSettingsResponseFormat]
"""The response format for the model."""

strict: bool
"""Enable strict mode for tool calling.

When true, tool outputs are guaranteed to match JSON schemas.
"""

temperature: float
"""The temperature of the model."""

tool_call_parser: Optional[str]
"""SGLang tool call parser name (for example 'glm47', 'qwen25', or 'hermes')."""


ModelSettingsZaiModelSettingsResponseFormat: TypeAlias = Union[
TextResponseFormatParam, JsonSchemaResponseFormatParam, JsonObjectResponseFormatParam
]
Expand Down Expand Up @@ -498,6 +595,7 @@ class ModelSettingsChatGptoAuthModelSettings(TypedDict, total=False):

ModelSettings: TypeAlias = Union[
OpenAIModelSettingsParam,
ModelSettingsSgLangModelSettings,
AnthropicModelSettingsParam,
GoogleAIModelSettingsParam,
GoogleVertexModelSettingsParam,
Expand Down
Loading