supermemory 3.0.0a23__tar.gz → 3.0.0a24__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/.gitignore +0 -1
  2. supermemory-3.0.0a24/.release-please-manifest.json +3 -0
  3. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/CHANGELOG.md +27 -0
  4. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/PKG-INFO +1 -1
  5. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/pyproject.toml +2 -2
  6. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_base_client.py +4 -1
  7. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_files.py +4 -4
  8. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_models.py +24 -3
  9. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_version.py +1 -1
  10. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/resources/memories.py +2 -2
  11. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_get_by_id_response.py +3 -2
  12. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_get_by_tags_response.py +3 -2
  13. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_list_response.py +3 -2
  14. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/search_execute_response.py +3 -0
  15. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_models.py +28 -1
  16. supermemory-3.0.0a23/.release-please-manifest.json +0 -3
  17. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/CONTRIBUTING.md +0 -0
  18. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/LICENSE +0 -0
  19. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/README.md +0 -0
  20. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/SECURITY.md +0 -0
  21. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/api.md +0 -0
  22. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/bin/check-release-environment +0 -0
  23. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/bin/publish-pypi +0 -0
  24. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/examples/.keep +0 -0
  25. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/mypy.ini +0 -0
  26. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/noxfile.py +0 -0
  27. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/release-please-config.json +0 -0
  28. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/requirements-dev.lock +0 -0
  29. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/requirements.lock +0 -0
  30. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/__init__.py +0 -0
  31. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_client.py +0 -0
  32. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_compat.py +0 -0
  33. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_constants.py +0 -0
  34. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_exceptions.py +0 -0
  35. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_qs.py +0 -0
  36. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_resource.py +0 -0
  37. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_response.py +0 -0
  38. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_streaming.py +0 -0
  39. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_types.py +0 -0
  40. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_utils/__init__.py +0 -0
  41. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_utils/_logs.py +0 -0
  42. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_utils/_proxy.py +0 -0
  43. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_utils/_reflection.py +0 -0
  44. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_utils/_resources_proxy.py +0 -0
  45. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_utils/_streams.py +0 -0
  46. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_utils/_sync.py +0 -0
  47. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_utils/_transform.py +0 -0
  48. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_utils/_typing.py +0 -0
  49. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/_utils/_utils.py +0 -0
  50. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/lib/.keep +0 -0
  51. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/py.typed +0 -0
  52. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/resources/__init__.py +0 -0
  53. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/resources/connections.py +0 -0
  54. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/resources/search.py +0 -0
  55. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/resources/settings.py +0 -0
  56. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/__init__.py +0 -0
  57. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_create_params.py +0 -0
  58. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_create_response.py +0 -0
  59. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_delete_by_id_response.py +0 -0
  60. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_delete_by_provider_params.py +0 -0
  61. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_delete_by_provider_response.py +0 -0
  62. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_get_by_tags_params.py +0 -0
  63. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_import_params.py +0 -0
  64. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_list_documents_params.py +0 -0
  65. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_list_documents_response.py +0 -0
  66. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/connection_list_params.py +0 -0
  67. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/memory_add_params.py +0 -0
  68. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/memory_add_response.py +0 -0
  69. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/memory_get_response.py +0 -0
  70. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/memory_list_params.py +0 -0
  71. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/memory_list_response.py +0 -0
  72. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/memory_update_params.py +0 -0
  73. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/memory_update_response.py +0 -0
  74. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/search_execute_params.py +0 -0
  75. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/setting_get_response.py +0 -0
  76. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/setting_update_params.py +0 -0
  77. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory/types/setting_update_response.py +0 -0
  78. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/src/supermemory_new/lib/.keep +0 -0
  79. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/__init__.py +0 -0
  80. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/api_resources/__init__.py +0 -0
  81. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/api_resources/test_connections.py +0 -0
  82. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/api_resources/test_memories.py +0 -0
  83. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/api_resources/test_search.py +0 -0
  84. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/api_resources/test_settings.py +0 -0
  85. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/conftest.py +0 -0
  86. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/sample_file.txt +0 -0
  87. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_client.py +0 -0
  88. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_deepcopy.py +0 -0
  89. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_extract_files.py +0 -0
  90. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_files.py +0 -0
  91. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_qs.py +0 -0
  92. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_required_args.py +0 -0
  93. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_response.py +0 -0
  94. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_streaming.py +0 -0
  95. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_transform.py +0 -0
  96. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_utils/test_proxy.py +0 -0
  97. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/test_utils/test_typing.py +0 -0
  98. {supermemory-3.0.0a23 → supermemory-3.0.0a24}/tests/utils.py +0 -0
@@ -1,5 +1,4 @@
1
1
  .prism.log
2
- .vscode
3
2
  _dev
4
3
 
5
4
  __pycache__
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "3.0.0-alpha.24"
3
+ }
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.0-alpha.24 (2025-08-10)
4
+
5
+ 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)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([4aacfa8](https://github.com/supermemoryai/python-sdk/commit/4aacfa8f2e35f50ab9ac01c4ae9b5086b8dc2230))
10
+ * **api:** api update ([9fe90d9](https://github.com/supermemoryai/python-sdk/commit/9fe90d99035348910c215cb196a27390b7c595d3))
11
+ * **api:** api update ([f9c7013](https://github.com/supermemoryai/python-sdk/commit/f9c70137f404d7638d6e77dbf360a276877a55a5))
12
+ * **api:** api update ([125afc9](https://github.com/supermemoryai/python-sdk/commit/125afc957cab83c2a0c75ba003479b09e5e0f63c))
13
+ * **api:** api update ([04b249d](https://github.com/supermemoryai/python-sdk/commit/04b249d0a09d2fcbd8aecd08bcfc6ff89673fb75))
14
+ * **client:** support file upload requests ([b6c42b1](https://github.com/supermemoryai/python-sdk/commit/b6c42b10e8412ccc5dbbed23d86c36598319df00))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **parsing:** ignore empty metadata ([a58758c](https://github.com/supermemoryai/python-sdk/commit/a58758ce1f1ae0c87d0fa3bea43367bb2d198891))
20
+ * **parsing:** parse extra field types ([5253128](https://github.com/supermemoryai/python-sdk/commit/5253128de66dc303f8c9e4d295f133f24f770d95))
21
+
22
+
23
+ ### Chores
24
+
25
+ * **internal:** fix ruff target version ([25adc14](https://github.com/supermemoryai/python-sdk/commit/25adc1412380631fa8ce53034b519e819b45dec3))
26
+ * **internal:** update comment in script ([8fc31e8](https://github.com/supermemoryai/python-sdk/commit/8fc31e8cb2058d8bb4da67c5aebbac421474c3b8))
27
+ * **project:** add settings file for vscode ([2327687](https://github.com/supermemoryai/python-sdk/commit/232768766d49d14af45667f08ad66b890cc6a230))
28
+ * update @stainless-api/prism-cli to v5.15.0 ([7f4ff8b](https://github.com/supermemoryai/python-sdk/commit/7f4ff8b2712055be8a6100a2c132b514cf7e2e6d))
29
+
3
30
  ## 3.0.0-alpha.23 (2025-07-15)
4
31
 
5
32
  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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: supermemory
3
- Version: 3.0.0a23
3
+ Version: 3.0.0a24
4
4
  Summary: The official Python library for the supermemory API
5
5
  Project-URL: Homepage, https://github.com/supermemoryai/python-sdk
6
6
  Project-URL: Repository, https://github.com/supermemoryai/python-sdk
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "supermemory"
3
- version = "3.0.0-alpha.23"
3
+ version = "3.0.0-alpha.24"
4
4
  description = "The official Python library for the supermemory API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -159,7 +159,7 @@ reportPrivateUsage = false
159
159
  [tool.ruff]
160
160
  line-length = 120
161
161
  output-format = "grouped"
162
- target-version = "py37"
162
+ target-version = "py38"
163
163
 
164
164
  [tool.ruff.format]
165
165
  docstring-code-format = true
@@ -532,7 +532,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
532
532
  is_body_allowed = options.method.lower() != "get"
533
533
 
534
534
  if is_body_allowed:
535
- kwargs["json"] = json_data if is_given(json_data) else None
535
+ if isinstance(json_data, bytes):
536
+ kwargs["content"] = json_data
537
+ else:
538
+ kwargs["json"] = json_data if is_given(json_data) else None
536
539
  kwargs["files"] = files
537
540
  else:
538
541
  headers.pop("Content-Type", None)
@@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes:
69
69
  return file
70
70
 
71
71
  if is_tuple_t(file):
72
- return (file[0], _read_file_content(file[1]), *file[2:])
72
+ return (file[0], read_file_content(file[1]), *file[2:])
73
73
 
74
74
  raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")
75
75
 
76
76
 
77
- def _read_file_content(file: FileContent) -> HttpxFileContent:
77
+ def read_file_content(file: FileContent) -> HttpxFileContent:
78
78
  if isinstance(file, os.PathLike):
79
79
  return pathlib.Path(file).read_bytes()
80
80
  return file
@@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes:
111
111
  return file
112
112
 
113
113
  if is_tuple_t(file):
114
- return (file[0], await _async_read_file_content(file[1]), *file[2:])
114
+ return (file[0], await async_read_file_content(file[1]), *file[2:])
115
115
 
116
116
  raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")
117
117
 
118
118
 
119
- async def _async_read_file_content(file: FileContent) -> HttpxFileContent:
119
+ async def async_read_file_content(file: FileContent) -> HttpxFileContent:
120
120
  if isinstance(file, os.PathLike):
121
121
  return await anyio.Path(file).read_bytes()
122
122
 
@@ -208,14 +208,18 @@ class BaseModel(pydantic.BaseModel):
208
208
  else:
209
209
  fields_values[name] = field_get_default(field)
210
210
 
211
+ extra_field_type = _get_extra_fields_type(__cls)
212
+
211
213
  _extra = {}
212
214
  for key, value in values.items():
213
215
  if key not in model_fields:
216
+ parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value
217
+
214
218
  if PYDANTIC_V2:
215
- _extra[key] = value
219
+ _extra[key] = parsed
216
220
  else:
217
221
  _fields_set.add(key)
218
- fields_values[key] = value
222
+ fields_values[key] = parsed
219
223
 
220
224
  object.__setattr__(m, "__dict__", fields_values)
221
225
 
@@ -370,6 +374,23 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
370
374
  return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None))
371
375
 
372
376
 
377
+ def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None:
378
+ if not PYDANTIC_V2:
379
+ # TODO
380
+ return None
381
+
382
+ schema = cls.__pydantic_core_schema__
383
+ if schema["type"] == "model":
384
+ fields = schema["schema"]
385
+ if fields["type"] == "model-fields":
386
+ extras = fields.get("extras_schema")
387
+ if extras and "cls" in extras:
388
+ # mypy can't narrow the type
389
+ return extras["cls"] # type: ignore[no-any-return]
390
+
391
+ return None
392
+
393
+
373
394
  def is_basemodel(type_: type) -> bool:
374
395
  """Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`"""
375
396
  if is_union(type_):
@@ -439,7 +460,7 @@ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]
439
460
  type_ = type_.__value__ # type: ignore[unreachable]
440
461
 
441
462
  # unwrap `Annotated[T, ...]` -> `T`
442
- if metadata is not None:
463
+ if metadata is not None and len(metadata) > 0:
443
464
  meta: tuple[Any, ...] = tuple(metadata)
444
465
  elif is_annotated_type(type_):
445
466
  meta = get_args(type_)[1:]
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "supermemory"
4
- __version__ = "3.0.0-alpha.23" # x-release-please-version
4
+ __version__ = "3.0.0-alpha.24" # x-release-please-version
@@ -186,7 +186,7 @@ class MemoriesResource(SyncAPIResource):
186
186
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
187
187
  ) -> None:
188
188
  """
189
- Delete a memory
189
+ Delete a memory by ID
190
190
 
191
191
  Args:
192
192
  extra_headers: Send extra headers
@@ -465,7 +465,7 @@ class AsyncMemoriesResource(AsyncAPIResource):
465
465
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
466
466
  ) -> None:
467
467
  """
468
- Delete a memory
468
+ Delete a memory by ID
469
469
 
470
470
  Args:
471
471
  extra_headers: Send extra headers
@@ -1,6 +1,7 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  from typing import Dict, Optional
4
+ from datetime import datetime
4
5
 
5
6
  from pydantic import Field as FieldInfo
6
7
 
@@ -12,7 +13,7 @@ __all__ = ["ConnectionGetByIDResponse"]
12
13
  class ConnectionGetByIDResponse(BaseModel):
13
14
  id: str
14
15
 
15
- created_at: float = FieldInfo(alias="createdAt")
16
+ created_at: datetime = FieldInfo(alias="createdAt")
16
17
 
17
18
  provider: str
18
19
 
@@ -20,6 +21,6 @@ class ConnectionGetByIDResponse(BaseModel):
20
21
 
21
22
  email: Optional[str] = None
22
23
 
23
- expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None)
24
+ expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None)
24
25
 
25
26
  metadata: Optional[Dict[str, object]] = None
@@ -1,6 +1,7 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  from typing import Dict, Optional
4
+ from datetime import datetime
4
5
 
5
6
  from pydantic import Field as FieldInfo
6
7
 
@@ -12,7 +13,7 @@ __all__ = ["ConnectionGetByTagsResponse"]
12
13
  class ConnectionGetByTagsResponse(BaseModel):
13
14
  id: str
14
15
 
15
- created_at: float = FieldInfo(alias="createdAt")
16
+ created_at: datetime = FieldInfo(alias="createdAt")
16
17
 
17
18
  provider: str
18
19
 
@@ -20,6 +21,6 @@ class ConnectionGetByTagsResponse(BaseModel):
20
21
 
21
22
  email: Optional[str] = None
22
23
 
23
- expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None)
24
+ expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None)
24
25
 
25
26
  metadata: Optional[Dict[str, object]] = None
@@ -1,6 +1,7 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  from typing import Dict, List, Optional
4
+ from datetime import datetime
4
5
  from typing_extensions import TypeAlias
5
6
 
6
7
  from pydantic import Field as FieldInfo
@@ -13,7 +14,7 @@ __all__ = ["ConnectionListResponse", "ConnectionListResponseItem"]
13
14
  class ConnectionListResponseItem(BaseModel):
14
15
  id: str
15
16
 
16
- created_at: float = FieldInfo(alias="createdAt")
17
+ created_at: datetime = FieldInfo(alias="createdAt")
17
18
 
18
19
  provider: str
19
20
 
@@ -21,7 +22,7 @@ class ConnectionListResponseItem(BaseModel):
21
22
 
22
23
  email: Optional[str] = None
23
24
 
24
- expires_at: Optional[float] = FieldInfo(alias="expiresAt", default=None)
25
+ expires_at: Optional[datetime] = FieldInfo(alias="expiresAt", default=None)
25
26
 
26
27
  metadata: Optional[Dict[str, object]] = None
27
28
 
@@ -40,6 +40,9 @@ class Result(BaseModel):
40
40
  title: Optional[str] = None
41
41
  """Document title"""
42
42
 
43
+ type: Optional[str] = None
44
+ """Document type"""
45
+
43
46
  updated_at: datetime = FieldInfo(alias="updatedAt")
44
47
  """Document last update date"""
45
48
 
@@ -1,5 +1,5 @@
1
1
  import json
2
- from typing import Any, Dict, List, Union, Optional, cast
2
+ from typing import TYPE_CHECKING, Any, Dict, List, Union, Optional, cast
3
3
  from datetime import datetime, timezone
4
4
  from typing_extensions import Literal, Annotated, TypeAliasType
5
5
 
@@ -934,3 +934,30 @@ def test_nested_discriminated_union() -> None:
934
934
  )
935
935
  assert isinstance(model, Type1)
936
936
  assert isinstance(model.value, InnerType2)
937
+
938
+
939
+ @pytest.mark.skipif(not PYDANTIC_V2, reason="this is only supported in pydantic v2 for now")
940
+ def test_extra_properties() -> None:
941
+ class Item(BaseModel):
942
+ prop: int
943
+
944
+ class Model(BaseModel):
945
+ __pydantic_extra__: Dict[str, Item] = Field(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
946
+
947
+ other: str
948
+
949
+ if TYPE_CHECKING:
950
+
951
+ def __getattr__(self, attr: str) -> Item: ...
952
+
953
+ model = construct_type(
954
+ type_=Model,
955
+ value={
956
+ "a": {"prop": 1},
957
+ "other": "foo",
958
+ },
959
+ )
960
+ assert isinstance(model, Model)
961
+ assert model.a.prop == 1
962
+ assert isinstance(model.a, Item)
963
+ assert model.other == "foo"
@@ -1,3 +0,0 @@
1
- {
2
- ".": "3.0.0-alpha.23"
3
- }
File without changes
File without changes
File without changes
File without changes