From 813041b6589b3c7458fe995066a45e7bd54a2c32 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 16 Jul 2025 20:14:15 +0000 Subject: [PATCH 01/22] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a97a100..3c425d42 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-886787346bfd9007dbd58542fddf6fad4592b1ccc2d1923f44378678dda7c1c1.yml -openapi_spec_hash: 1253fce7081c738f257275e9f49202b9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-839889e96f0b46bcb1ad8d910bdb91ab0807038c2eedc70016c023b96a3649d3.yml +openapi_spec_hash: 21ccea81835d4449e70f98e54ea37fdd config_hash: be10c837d5319a33f30809a3ec223caf From bd0a062977e3dfe0aee62efe4a62e6d84dea734b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 19 Jul 2025 01:14:03 +0000 Subject: [PATCH 02/22] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3c425d42..bfa8ee9e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-839889e96f0b46bcb1ad8d910bdb91ab0807038c2eedc70016c023b96a3649d3.yml -openapi_spec_hash: 21ccea81835d4449e70f98e54ea37fdd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-a5e5d1751d34da56028990da6f3dc2a5427a0df7855e4cc5fe8b81a3cf78ff93.yml +openapi_spec_hash: 3200080f265d6b6925732c1dc3dd7613 config_hash: be10c837d5319a33f30809a3ec223caf From 04b249d0a09d2fcbd8aecd08bcfc6ff89673fb75 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 19 Jul 2025 15:14:14 +0000 Subject: [PATCH 03/22] feat(api): api update --- .stats.yml | 4 ++-- src/supermemory/types/connection_get_by_id_response.py | 5 +++-- src/supermemory/types/connection_get_by_tags_response.py | 5 +++-- src/supermemory/types/connection_list_response.py | 5 +++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index bfa8ee9e..b7418b94 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-a5e5d1751d34da56028990da6f3dc2a5427a0df7855e4cc5fe8b81a3cf78ff93.yml -openapi_spec_hash: 3200080f265d6b6925732c1dc3dd7613 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-7cb3caf0cfb0a33cd2a27859c704bacae003e6314718f9bc517421ed20bd5cf6.yml +openapi_spec_hash: 037489c74046d49818dddd5765e541c4 config_hash: be10c837d5319a33f30809a3ec223caf diff --git a/src/supermemory/types/connection_get_by_id_response.py b/src/supermemory/types/connection_get_by_id_response.py index e8abd6fe..e0444126 100644 --- a/src/supermemory/types/connection_get_by_id_response.py +++ b/src/supermemory/types/connection_get_by_id_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, Optional +from datetime import datetime from pydantic import Field as FieldInfo @@ -12,7 +13,7 @@ class ConnectionGetByIDResponse(BaseModel): id: str - created_at: float = FieldInfo(alias="createdAt") + created_at: datetime = FieldInfo(alias="createdAt") provider: str @@ -20,6 +21,6 @@ class ConnectionGetByIDResponse(BaseModel): email: Optional[str] = None - expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None) + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) metadata: Optional[Dict[str, object]] = None diff --git a/src/supermemory/types/connection_get_by_tags_response.py b/src/supermemory/types/connection_get_by_tags_response.py index 221e6b20..5ca2478f 100644 --- a/src/supermemory/types/connection_get_by_tags_response.py +++ b/src/supermemory/types/connection_get_by_tags_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, Optional +from datetime import datetime from pydantic import Field as FieldInfo @@ -12,7 +13,7 @@ class ConnectionGetByTagsResponse(BaseModel): id: str - created_at: float = FieldInfo(alias="createdAt") + created_at: datetime = FieldInfo(alias="createdAt") provider: str @@ -20,6 +21,6 @@ class ConnectionGetByTagsResponse(BaseModel): email: Optional[str] = None - expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None) + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) metadata: Optional[Dict[str, object]] = None diff --git a/src/supermemory/types/connection_list_response.py b/src/supermemory/types/connection_list_response.py index 6da37725..866cdf86 100644 --- a/src/supermemory/types/connection_list_response.py +++ b/src/supermemory/types/connection_list_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional +from datetime import datetime from typing_extensions import TypeAlias from pydantic import Field as FieldInfo @@ -13,7 +14,7 @@ class ConnectionListResponseItem(BaseModel): id: str - created_at: float = FieldInfo(alias="createdAt") + created_at: datetime = FieldInfo(alias="createdAt") provider: str @@ -21,7 +22,7 @@ class ConnectionListResponseItem(BaseModel): email: Optional[str] = None - expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None) + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) metadata: Optional[Dict[str, object]] = None From 125afc957cab83c2a0c75ba003479b09e5e0f63c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 20 Jul 2025 04:14:13 +0000 Subject: [PATCH 04/22] feat(api): api update --- .stats.yml | 4 ++-- src/supermemory/types/connection_get_by_id_response.py | 5 ++--- src/supermemory/types/connection_get_by_tags_response.py | 5 ++--- src/supermemory/types/connection_list_response.py | 5 ++--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index b7418b94..bfa8ee9e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-7cb3caf0cfb0a33cd2a27859c704bacae003e6314718f9bc517421ed20bd5cf6.yml -openapi_spec_hash: 037489c74046d49818dddd5765e541c4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-a5e5d1751d34da56028990da6f3dc2a5427a0df7855e4cc5fe8b81a3cf78ff93.yml +openapi_spec_hash: 3200080f265d6b6925732c1dc3dd7613 config_hash: be10c837d5319a33f30809a3ec223caf diff --git a/src/supermemory/types/connection_get_by_id_response.py b/src/supermemory/types/connection_get_by_id_response.py index e0444126..e8abd6fe 100644 --- a/src/supermemory/types/connection_get_by_id_response.py +++ b/src/supermemory/types/connection_get_by_id_response.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, Optional -from datetime import datetime from pydantic import Field as FieldInfo @@ -13,7 +12,7 @@ class ConnectionGetByIDResponse(BaseModel): id: str - created_at: datetime = FieldInfo(alias="createdAt") + created_at: float = FieldInfo(alias="createdAt") provider: str @@ -21,6 +20,6 @@ class ConnectionGetByIDResponse(BaseModel): email: Optional[str] = None - expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) + expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None) metadata: Optional[Dict[str, object]] = None diff --git a/src/supermemory/types/connection_get_by_tags_response.py b/src/supermemory/types/connection_get_by_tags_response.py index 5ca2478f..221e6b20 100644 --- a/src/supermemory/types/connection_get_by_tags_response.py +++ b/src/supermemory/types/connection_get_by_tags_response.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, Optional -from datetime import datetime from pydantic import Field as FieldInfo @@ -13,7 +12,7 @@ class ConnectionGetByTagsResponse(BaseModel): id: str - created_at: datetime = FieldInfo(alias="createdAt") + created_at: float = FieldInfo(alias="createdAt") provider: str @@ -21,6 +20,6 @@ class ConnectionGetByTagsResponse(BaseModel): email: Optional[str] = None - expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) + expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None) metadata: Optional[Dict[str, object]] = None diff --git a/src/supermemory/types/connection_list_response.py b/src/supermemory/types/connection_list_response.py index 866cdf86..6da37725 100644 --- a/src/supermemory/types/connection_list_response.py +++ b/src/supermemory/types/connection_list_response.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional -from datetime import datetime from typing_extensions import TypeAlias from pydantic import Field as FieldInfo @@ -14,7 +13,7 @@ class ConnectionListResponseItem(BaseModel): id: str - created_at: datetime = FieldInfo(alias="createdAt") + created_at: float = FieldInfo(alias="createdAt") provider: str @@ -22,7 +21,7 @@ class ConnectionListResponseItem(BaseModel): email: Optional[str] = None - expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) + expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None) metadata: Optional[Dict[str, object]] = None From a58758ce1f1ae0c87d0fa3bea43367bb2d198891 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 02:02:21 +0000 Subject: [PATCH 05/22] fix(parsing): ignore empty metadata --- src/supermemory/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/supermemory/_models.py b/src/supermemory/_models.py index 528d5680..ffcbf67b 100644 --- a/src/supermemory/_models.py +++ b/src/supermemory/_models.py @@ -439,7 +439,7 @@ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any] type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` - if metadata is not None: + if metadata is not None and len(metadata) > 0: meta: tuple[Any, ...] = tuple(metadata) elif is_annotated_type(type_): meta = get_args(type_)[1:] From 5253128de66dc303f8c9e4d295f133f24f770d95 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 02:03:07 +0000 Subject: [PATCH 06/22] fix(parsing): parse extra field types --- src/supermemory/_models.py | 25 +++++++++++++++++++++++-- tests/test_models.py | 29 ++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/src/supermemory/_models.py b/src/supermemory/_models.py index ffcbf67b..b8387ce9 100644 --- a/src/supermemory/_models.py +++ b/src/supermemory/_models.py @@ -208,14 +208,18 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] else: fields_values[name] = field_get_default(field) + extra_field_type = _get_extra_fields_type(__cls) + _extra = {} for key, value in values.items(): if key not in model_fields: + parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value + if PYDANTIC_V2: - _extra[key] = value + _extra[key] = parsed else: _fields_set.add(key) - fields_values[key] = value + fields_values[key] = parsed object.__setattr__(m, "__dict__", fields_values) @@ -370,6 +374,23 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) +def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: + if not PYDANTIC_V2: + # TODO + return None + + schema = cls.__pydantic_core_schema__ + if schema["type"] == "model": + fields = schema["schema"] + if fields["type"] == "model-fields": + extras = fields.get("extras_schema") + if extras and "cls" in extras: + # mypy can't narrow the type + return extras["cls"] # type: ignore[no-any-return] + + return None + + def is_basemodel(type_: type) -> bool: """Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`""" if is_union(type_): diff --git a/tests/test_models.py b/tests/test_models.py index 44d0a95a..c9443074 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,5 +1,5 @@ import json -from typing import Any, Dict, List, Union, Optional, cast +from typing import TYPE_CHECKING, Any, Dict, List, Union, Optional, cast from datetime import datetime, timezone from typing_extensions import Literal, Annotated, TypeAliasType @@ -934,3 +934,30 @@ class Type2(BaseModel): ) assert isinstance(model, Type1) assert isinstance(model.value, InnerType2) + + +@pytest.mark.skipif(not PYDANTIC_V2, reason="this is only supported in pydantic v2 for now") +def test_extra_properties() -> None: + class Item(BaseModel): + prop: int + + class Model(BaseModel): + __pydantic_extra__: Dict[str, Item] = Field(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + other: str + + if TYPE_CHECKING: + + def __getattr__(self, attr: str) -> Item: ... + + model = construct_type( + type_=Model, + value={ + "a": {"prop": 1}, + "other": "foo", + }, + ) + assert isinstance(model, Model) + assert model.a.prop == 1 + assert isinstance(model.a, Item) + assert model.other == "foo" From 232768766d49d14af45667f08ad66b890cc6a230 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 02:19:13 +0000 Subject: [PATCH 07/22] chore(project): add settings file for vscode --- .gitignore | 1 - .vscode/settings.json | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 87797408..95ceb189 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .prism.log -.vscode _dev __pycache__ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..5b010307 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.importFormat": "relative", +} From f9c70137f404d7638d6e77dbf360a276877a55a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 07:14:15 +0000 Subject: [PATCH 08/22] feat(api): api update --- .stats.yml | 4 ++-- src/supermemory/types/connection_get_by_id_response.py | 5 +++-- src/supermemory/types/connection_get_by_tags_response.py | 5 +++-- src/supermemory/types/connection_list_response.py | 5 +++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index bfa8ee9e..f6930f52 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-a5e5d1751d34da56028990da6f3dc2a5427a0df7855e4cc5fe8b81a3cf78ff93.yml -openapi_spec_hash: 3200080f265d6b6925732c1dc3dd7613 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-626326a8e363cb766afd1aee4d241beb966c6dcf62f1751f8c50f04e3e068739.yml +openapi_spec_hash: ff152d7c318c1a7680fc61d434c1492a config_hash: be10c837d5319a33f30809a3ec223caf diff --git a/src/supermemory/types/connection_get_by_id_response.py b/src/supermemory/types/connection_get_by_id_response.py index e8abd6fe..e0444126 100644 --- a/src/supermemory/types/connection_get_by_id_response.py +++ b/src/supermemory/types/connection_get_by_id_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, Optional +from datetime import datetime from pydantic import Field as FieldInfo @@ -12,7 +13,7 @@ class ConnectionGetByIDResponse(BaseModel): id: str - created_at: float = FieldInfo(alias="createdAt") + created_at: datetime = FieldInfo(alias="createdAt") provider: str @@ -20,6 +21,6 @@ class ConnectionGetByIDResponse(BaseModel): email: Optional[str] = None - expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None) + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) metadata: Optional[Dict[str, object]] = None diff --git a/src/supermemory/types/connection_get_by_tags_response.py b/src/supermemory/types/connection_get_by_tags_response.py index 221e6b20..5ca2478f 100644 --- a/src/supermemory/types/connection_get_by_tags_response.py +++ b/src/supermemory/types/connection_get_by_tags_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, Optional +from datetime import datetime from pydantic import Field as FieldInfo @@ -12,7 +13,7 @@ class ConnectionGetByTagsResponse(BaseModel): id: str - created_at: float = FieldInfo(alias="createdAt") + created_at: datetime = FieldInfo(alias="createdAt") provider: str @@ -20,6 +21,6 @@ class ConnectionGetByTagsResponse(BaseModel): email: Optional[str] = None - expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None) + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) metadata: Optional[Dict[str, object]] = None diff --git a/src/supermemory/types/connection_list_response.py b/src/supermemory/types/connection_list_response.py index 6da37725..866cdf86 100644 --- a/src/supermemory/types/connection_list_response.py +++ b/src/supermemory/types/connection_list_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional +from datetime import datetime from typing_extensions import TypeAlias from pydantic import Field as FieldInfo @@ -13,7 +14,7 @@ class ConnectionListResponseItem(BaseModel): id: str - created_at: float = FieldInfo(alias="createdAt") + created_at: datetime = FieldInfo(alias="createdAt") provider: str @@ -21,7 +22,7 @@ class ConnectionListResponseItem(BaseModel): email: Optional[str] = None - expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None) + expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None) metadata: Optional[Dict[str, object]] = None From bc02f1bc5038adecec4ca0fff32253665d08606a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 20:14:17 +0000 Subject: [PATCH 09/22] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f6930f52..01c5f9a2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-626326a8e363cb766afd1aee4d241beb966c6dcf62f1751f8c50f04e3e068739.yml -openapi_spec_hash: ff152d7c318c1a7680fc61d434c1492a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-476f175529ab49aedc0e88fb711e78c4470198feceb4e2f36f60ee1a900aba3e.yml +openapi_spec_hash: 85c97b3be1c3c80d05ec37cc9a573a3e config_hash: be10c837d5319a33f30809a3ec223caf From 85797344c49cdf963176ac83df26f96fd1b817ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 07:14:22 +0000 Subject: [PATCH 10/22] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 01c5f9a2..b627b52e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-476f175529ab49aedc0e88fb711e78c4470198feceb4e2f36f60ee1a900aba3e.yml -openapi_spec_hash: 85c97b3be1c3c80d05ec37cc9a573a3e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-ad7cac322a76d282ab48443f16154c81363c27d899906c52940b8c1467705ba2.yml +openapi_spec_hash: dd11c19b97a889091916c5ba38cfe79d config_hash: be10c837d5319a33f30809a3ec223caf From b6c42b10e8412ccc5dbbed23d86c36598319df00 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 02:54:21 +0000 Subject: [PATCH 11/22] feat(client): support file upload requests --- src/supermemory/_base_client.py | 5 ++++- src/supermemory/_files.py | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/supermemory/_base_client.py b/src/supermemory/_base_client.py index b0c778db..07c3369e 100644 --- a/src/supermemory/_base_client.py +++ b/src/supermemory/_base_client.py @@ -532,7 +532,10 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - kwargs["json"] = json_data if is_given(json_data) else None + if isinstance(json_data, bytes): + kwargs["content"] = json_data + else: + kwargs["json"] = json_data if is_given(json_data) else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/supermemory/_files.py b/src/supermemory/_files.py index 715cc207..cc14c14f 100644 --- a/src/supermemory/_files.py +++ b/src/supermemory/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() From 9fe90d99035348910c215cb196a27390b7c595d3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 08:14:23 +0000 Subject: [PATCH 12/22] feat(api): api update --- .stats.yml | 4 ++-- src/supermemory/types/search_execute_response.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b627b52e..d6ccc2d7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-ad7cac322a76d282ab48443f16154c81363c27d899906c52940b8c1467705ba2.yml -openapi_spec_hash: dd11c19b97a889091916c5ba38cfe79d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-ad50e549ae6d8cf14f3ef8d8d1f890c6e296a875d59de69b803efdb1e27a91b8.yml +openapi_spec_hash: 7930c486986363485fa8354ed3663bcb config_hash: be10c837d5319a33f30809a3ec223caf diff --git a/src/supermemory/types/search_execute_response.py b/src/supermemory/types/search_execute_response.py index b48b351d..611ab279 100644 --- a/src/supermemory/types/search_execute_response.py +++ b/src/supermemory/types/search_execute_response.py @@ -40,6 +40,9 @@ class Result(BaseModel): title: Optional[str] = None """Document title""" + type: Optional[str] = None + """Document type""" + updated_at: datetime = FieldInfo(alias="updatedAt") """Document last update date""" From 25adc1412380631fa8ce53034b519e819b45dec3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 02:47:58 +0000 Subject: [PATCH 13/22] chore(internal): fix ruff target version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b4458538..3ac29691 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -159,7 +159,7 @@ reportPrivateUsage = false [tool.ruff] line-length = 120 output-format = "grouped" -target-version = "py37" +target-version = "py38" [tool.ruff.format] docstring-code-format = true From 5ec1caa2a8565e17ec0dd45ca779568af4dfa1a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 21:14:31 +0000 Subject: [PATCH 14/22] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d6ccc2d7..ba6eb9de 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-ad50e549ae6d8cf14f3ef8d8d1f890c6e296a875d59de69b803efdb1e27a91b8.yml -openapi_spec_hash: 7930c486986363485fa8354ed3663bcb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-6bf9fc5a011503ce358faa27f85c4ce6e58135845c0be49f54aa907b89e75dde.yml +openapi_spec_hash: 082c46af0730ca6c5585559a8719675e config_hash: be10c837d5319a33f30809a3ec223caf From bc257a5ecb97c1edb9c0e3b58198c2677c3d67c4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 02:14:33 +0000 Subject: [PATCH 15/22] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ba6eb9de..d6ccc2d7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-6bf9fc5a011503ce358faa27f85c4ce6e58135845c0be49f54aa907b89e75dde.yml -openapi_spec_hash: 082c46af0730ca6c5585559a8719675e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-ad50e549ae6d8cf14f3ef8d8d1f890c6e296a875d59de69b803efdb1e27a91b8.yml +openapi_spec_hash: 7930c486986363485fa8354ed3663bcb config_hash: be10c837d5319a33f30809a3ec223caf From 7f4ff8b2712055be8a6100a2c132b514cf7e2e6d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 02:28:59 +0000 Subject: [PATCH 16/22] chore: update @stainless-api/prism-cli to v5.15.0 --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index d2814ae6..0b28f6ea 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi From 8fc31e8cb2058d8bb4da67c5aebbac421474c3b8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 02:45:03 +0000 Subject: [PATCH 17/22] chore(internal): update comment in script --- scripts/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test b/scripts/test index 2b878456..dbeda2d2 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 From 1ea259c739848899db4b2e5a43849858b54bd71a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 18:14:32 +0000 Subject: [PATCH 18/22] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d6ccc2d7..fac97072 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-ad50e549ae6d8cf14f3ef8d8d1f890c6e296a875d59de69b803efdb1e27a91b8.yml -openapi_spec_hash: 7930c486986363485fa8354ed3663bcb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-4306d1355c4f5d08b38c693c9006508e900a0a5ded4a63bc537974ac4841307f.yml +openapi_spec_hash: d5beb78072ca0f90acee4ff3b142e246 config_hash: be10c837d5319a33f30809a3ec223caf From 78525748ffc2c5c9d5b9412a929081c13493aab8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 19:14:26 +0000 Subject: [PATCH 19/22] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fac97072..82e88309 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-4306d1355c4f5d08b38c693c9006508e900a0a5ded4a63bc537974ac4841307f.yml -openapi_spec_hash: d5beb78072ca0f90acee4ff3b142e246 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-fd19dc42911734e3b4e993ff4bd09620e78af7a59b9be225b93f5fcf163b529c.yml +openapi_spec_hash: 3b378c201460e4e8222f012afd678156 config_hash: be10c837d5319a33f30809a3ec223caf From 5d80a5ab75400e6a7e90a36133f8fa1a60ef0107 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 20:14:42 +0000 Subject: [PATCH 20/22] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 82e88309..43a0a43f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-fd19dc42911734e3b4e993ff4bd09620e78af7a59b9be225b93f5fcf163b529c.yml -openapi_spec_hash: 3b378c201460e4e8222f012afd678156 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-2a299fceb88de1170cf82aedfc0b9fd8df9639252f79342250b8e99e529ce43d.yml +openapi_spec_hash: 3e38c38138f6dbc62251455bf028846a config_hash: be10c837d5319a33f30809a3ec223caf From 4aacfa8f2e35f50ab9ac01c4ae9b5086b8dc2230 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 10 Aug 2025 00:14:25 +0000 Subject: [PATCH 21/22] feat(api): api update --- .stats.yml | 4 ++-- src/supermemory/resources/memories.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 43a0a43f..f1c39230 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-2a299fceb88de1170cf82aedfc0b9fd8df9639252f79342250b8e99e529ce43d.yml -openapi_spec_hash: 3e38c38138f6dbc62251455bf028846a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-ad1692cfae7a00899ce6af1fd56b8294e5fd17d772a154a1671ff76c6ae623a9.yml +openapi_spec_hash: 007d1c70c133a31305c06a62d0319aee config_hash: be10c837d5319a33f30809a3ec223caf diff --git a/src/supermemory/resources/memories.py b/src/supermemory/resources/memories.py index b7f1ee6a..0b34b676 100644 --- a/src/supermemory/resources/memories.py +++ b/src/supermemory/resources/memories.py @@ -186,7 +186,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> None: """ - Delete a memory + Delete a memory by ID Args: extra_headers: Send extra headers @@ -465,7 +465,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> None: """ - Delete a memory + Delete a memory by ID Args: extra_headers: Send extra headers From e11f95f2f665ebb1ecb00a7f6b1a8c7b2767da99 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 10 Aug 2025 00:14:42 +0000 Subject: [PATCH 22/22] release: 3.0.0-alpha.24 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 27 +++++++++++++++++++++++++++ pyproject.toml | 2 +- src/supermemory/_version.py | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 22bbc61b..613b23a3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.0.0-alpha.23" + ".": "3.0.0-alpha.24" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b3da35b5..fb517bad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## 3.0.0-alpha.24 (2025-08-10) + +Full Changelog: [v3.0.0-alpha.23...v3.0.0-alpha.24](https://github.com/supermemoryai/python-sdk/compare/v3.0.0-alpha.23...v3.0.0-alpha.24) + +### Features + +* **api:** api update ([4aacfa8](https://github.com/supermemoryai/python-sdk/commit/4aacfa8f2e35f50ab9ac01c4ae9b5086b8dc2230)) +* **api:** api update ([9fe90d9](https://github.com/supermemoryai/python-sdk/commit/9fe90d99035348910c215cb196a27390b7c595d3)) +* **api:** api update ([f9c7013](https://github.com/supermemoryai/python-sdk/commit/f9c70137f404d7638d6e77dbf360a276877a55a5)) +* **api:** api update ([125afc9](https://github.com/supermemoryai/python-sdk/commit/125afc957cab83c2a0c75ba003479b09e5e0f63c)) +* **api:** api update ([04b249d](https://github.com/supermemoryai/python-sdk/commit/04b249d0a09d2fcbd8aecd08bcfc6ff89673fb75)) +* **client:** support file upload requests ([b6c42b1](https://github.com/supermemoryai/python-sdk/commit/b6c42b10e8412ccc5dbbed23d86c36598319df00)) + + +### Bug Fixes + +* **parsing:** ignore empty metadata ([a58758c](https://github.com/supermemoryai/python-sdk/commit/a58758ce1f1ae0c87d0fa3bea43367bb2d198891)) +* **parsing:** parse extra field types ([5253128](https://github.com/supermemoryai/python-sdk/commit/5253128de66dc303f8c9e4d295f133f24f770d95)) + + +### Chores + +* **internal:** fix ruff target version ([25adc14](https://github.com/supermemoryai/python-sdk/commit/25adc1412380631fa8ce53034b519e819b45dec3)) +* **internal:** update comment in script ([8fc31e8](https://github.com/supermemoryai/python-sdk/commit/8fc31e8cb2058d8bb4da67c5aebbac421474c3b8)) +* **project:** add settings file for vscode ([2327687](https://github.com/supermemoryai/python-sdk/commit/232768766d49d14af45667f08ad66b890cc6a230)) +* update @stainless-api/prism-cli to v5.15.0 ([7f4ff8b](https://github.com/supermemoryai/python-sdk/commit/7f4ff8b2712055be8a6100a2c132b514cf7e2e6d)) + ## 3.0.0-alpha.23 (2025-07-15) Full Changelog: [v3.0.0-alpha.22...v3.0.0-alpha.23](https://github.com/supermemoryai/python-sdk/compare/v3.0.0-alpha.22...v3.0.0-alpha.23) diff --git a/pyproject.toml b/pyproject.toml index 3ac29691..4ef7070d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "3.0.0-alpha.23" +version = "3.0.0-alpha.24" description = "The official Python library for the supermemory API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/supermemory/_version.py b/src/supermemory/_version.py index 1295b6e1..b2c22a4e 100644 --- a/src/supermemory/_version.py +++ b/src/supermemory/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "supermemory" -__version__ = "3.0.0-alpha.23" # x-release-please-version +__version__ = "3.0.0-alpha.24" # x-release-please-version