chunkr-ai 0.1.0a8__py3-none-any.whl → 0.1.0a10__py3-none-any.whl

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 (36) hide show
  1. chunkr_ai/__init__.py +3 -1
  2. chunkr_ai/_base_client.py +9 -9
  3. chunkr_ai/_client.py +8 -8
  4. chunkr_ai/_models.py +10 -4
  5. chunkr_ai/_qs.py +7 -7
  6. chunkr_ai/_types.py +18 -11
  7. chunkr_ai/_utils/_transform.py +2 -2
  8. chunkr_ai/_utils/_utils.py +4 -4
  9. chunkr_ai/_version.py +1 -1
  10. chunkr_ai/resources/files.py +29 -29
  11. chunkr_ai/resources/health.py +3 -3
  12. chunkr_ai/resources/tasks/extract.py +17 -17
  13. chunkr_ai/resources/tasks/parse.py +25 -34
  14. chunkr_ai/resources/tasks/tasks.py +31 -31
  15. chunkr_ai/resources/webhooks.py +3 -3
  16. chunkr_ai/types/__init__.py +0 -2
  17. chunkr_ai/types/file_info.py +3 -0
  18. chunkr_ai/types/ocr_result.py +6 -6
  19. chunkr_ai/types/parse_configuration.py +0 -4
  20. chunkr_ai/types/parse_configuration_param.py +0 -4
  21. chunkr_ai/types/segment.py +8 -5
  22. chunkr_ai/types/segment_processing.py +92 -2
  23. chunkr_ai/types/segment_processing_param.py +92 -2
  24. chunkr_ai/types/task_response.py +8 -2
  25. chunkr_ai/types/tasks/extract_create_response.py +7 -1
  26. chunkr_ai/types/tasks/extract_get_response.py +7 -1
  27. chunkr_ai/types/tasks/parse_create_params.py +0 -4
  28. chunkr_ai/types/tasks/parse_create_response.py +6 -0
  29. chunkr_ai/types/tasks/parse_get_response.py +6 -0
  30. chunkr_ai/types/version_info.py +1 -1
  31. {chunkr_ai-0.1.0a8.dist-info → chunkr_ai-0.1.0a10.dist-info}/METADATA +1 -1
  32. {chunkr_ai-0.1.0a8.dist-info → chunkr_ai-0.1.0a10.dist-info}/RECORD +34 -36
  33. chunkr_ai/types/llm_processing.py +0 -36
  34. chunkr_ai/types/llm_processing_param.py +0 -36
  35. {chunkr_ai-0.1.0a8.dist-info → chunkr_ai-0.1.0a10.dist-info}/WHEEL +0 -0
  36. {chunkr_ai-0.1.0a8.dist-info → chunkr_ai-0.1.0a10.dist-info}/licenses/LICENSE +0 -0
chunkr_ai/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  import typing as _t
4
4
 
5
5
  from . import types
6
- from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
6
+ from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
7
7
  from ._utils import file_from_path
8
8
  from ._client import Chunkr, Client, Stream, Timeout, Transport, AsyncChunkr, AsyncClient, AsyncStream, RequestOptions
9
9
  from ._models import BaseModel
@@ -39,7 +39,9 @@ __all__ = [
39
39
  "ProxiesTypes",
40
40
  "NotGiven",
41
41
  "NOT_GIVEN",
42
+ "not_given",
42
43
  "Omit",
44
+ "omit",
43
45
  "ChunkrError",
44
46
  "APIError",
45
47
  "APIStatusError",
chunkr_ai/_base_client.py CHANGED
@@ -42,7 +42,6 @@ from . import _exceptions
42
42
  from ._qs import Querystring
43
43
  from ._files import to_httpx_files, async_to_httpx_files
44
44
  from ._types import (
45
- NOT_GIVEN,
46
45
  Body,
47
46
  Omit,
48
47
  Query,
@@ -57,6 +56,7 @@ from ._types import (
57
56
  RequestOptions,
58
57
  HttpxRequestFiles,
59
58
  ModelBuilderProtocol,
59
+ not_given,
60
60
  )
61
61
  from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
62
62
  from ._compat import PYDANTIC_V1, model_copy, model_dump
@@ -145,9 +145,9 @@ class PageInfo:
145
145
  def __init__(
146
146
  self,
147
147
  *,
148
- url: URL | NotGiven = NOT_GIVEN,
149
- json: Body | NotGiven = NOT_GIVEN,
150
- params: Query | NotGiven = NOT_GIVEN,
148
+ url: URL | NotGiven = not_given,
149
+ json: Body | NotGiven = not_given,
150
+ params: Query | NotGiven = not_given,
151
151
  ) -> None:
152
152
  self.url = url
153
153
  self.json = json
@@ -595,7 +595,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
595
595
  # we internally support defining a temporary header to override the
596
596
  # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
597
597
  # see _response.py for implementation details
598
- override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
598
+ override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
599
599
  if is_given(override_cast_to):
600
600
  options.headers = headers
601
601
  return cast(Type[ResponseT], override_cast_to)
@@ -825,7 +825,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
825
825
  version: str,
826
826
  base_url: str | URL,
827
827
  max_retries: int = DEFAULT_MAX_RETRIES,
828
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
828
+ timeout: float | Timeout | None | NotGiven = not_given,
829
829
  http_client: httpx.Client | None = None,
830
830
  custom_headers: Mapping[str, str] | None = None,
831
831
  custom_query: Mapping[str, object] | None = None,
@@ -1356,7 +1356,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1356
1356
  base_url: str | URL,
1357
1357
  _strict_response_validation: bool,
1358
1358
  max_retries: int = DEFAULT_MAX_RETRIES,
1359
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
1359
+ timeout: float | Timeout | None | NotGiven = not_given,
1360
1360
  http_client: httpx.AsyncClient | None = None,
1361
1361
  custom_headers: Mapping[str, str] | None = None,
1362
1362
  custom_query: Mapping[str, object] | None = None,
@@ -1818,8 +1818,8 @@ def make_request_options(
1818
1818
  extra_query: Query | None = None,
1819
1819
  extra_body: Body | None = None,
1820
1820
  idempotency_key: str | None = None,
1821
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1822
- post_parser: PostParser | NotGiven = NOT_GIVEN,
1821
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1822
+ post_parser: PostParser | NotGiven = not_given,
1823
1823
  ) -> RequestOptions:
1824
1824
  """Create a dict of type RequestOptions without keys of NotGiven values."""
1825
1825
  options: RequestOptions = {}
chunkr_ai/_client.py CHANGED
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import os
6
- from typing import Any, Union, Mapping
6
+ from typing import Any, Mapping
7
7
  from typing_extensions import Self, override
8
8
 
9
9
  import httpx
@@ -11,13 +11,13 @@ import httpx
11
11
  from . import _exceptions
12
12
  from ._qs import Querystring
13
13
  from ._types import (
14
- NOT_GIVEN,
15
14
  Omit,
16
15
  Timeout,
17
16
  NotGiven,
18
17
  Transport,
19
18
  ProxiesTypes,
20
19
  RequestOptions,
20
+ not_given,
21
21
  )
22
22
  from ._utils import is_given, get_async_library
23
23
  from ._version import __version__
@@ -52,7 +52,7 @@ class Chunkr(SyncAPIClient):
52
52
  api_key: str | None = None,
53
53
  webhook_key: str | None = None,
54
54
  base_url: str | httpx.URL | None = None,
55
- timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
55
+ timeout: float | Timeout | None | NotGiven = not_given,
56
56
  max_retries: int = DEFAULT_MAX_RETRIES,
57
57
  default_headers: Mapping[str, str] | None = None,
58
58
  default_query: Mapping[str, object] | None = None,
@@ -139,9 +139,9 @@ class Chunkr(SyncAPIClient):
139
139
  api_key: str | None = None,
140
140
  webhook_key: str | None = None,
141
141
  base_url: str | httpx.URL | None = None,
142
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
142
+ timeout: float | Timeout | None | NotGiven = not_given,
143
143
  http_client: httpx.Client | None = None,
144
- max_retries: int | NotGiven = NOT_GIVEN,
144
+ max_retries: int | NotGiven = not_given,
145
145
  default_headers: Mapping[str, str] | None = None,
146
146
  set_default_headers: Mapping[str, str] | None = None,
147
147
  default_query: Mapping[str, object] | None = None,
@@ -238,7 +238,7 @@ class AsyncChunkr(AsyncAPIClient):
238
238
  api_key: str | None = None,
239
239
  webhook_key: str | None = None,
240
240
  base_url: str | httpx.URL | None = None,
241
- timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
241
+ timeout: float | Timeout | None | NotGiven = not_given,
242
242
  max_retries: int = DEFAULT_MAX_RETRIES,
243
243
  default_headers: Mapping[str, str] | None = None,
244
244
  default_query: Mapping[str, object] | None = None,
@@ -325,9 +325,9 @@ class AsyncChunkr(AsyncAPIClient):
325
325
  api_key: str | None = None,
326
326
  webhook_key: str | None = None,
327
327
  base_url: str | httpx.URL | None = None,
328
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
328
+ timeout: float | Timeout | None | NotGiven = not_given,
329
329
  http_client: httpx.AsyncClient | None = None,
330
- max_retries: int | NotGiven = NOT_GIVEN,
330
+ max_retries: int | NotGiven = not_given,
331
331
  default_headers: Mapping[str, str] | None = None,
332
332
  set_default_headers: Mapping[str, str] | None = None,
333
333
  default_query: Mapping[str, object] | None = None,
chunkr_ai/_models.py CHANGED
@@ -256,7 +256,7 @@ class BaseModel(pydantic.BaseModel):
256
256
  mode: Literal["json", "python"] | str = "python",
257
257
  include: IncEx | None = None,
258
258
  exclude: IncEx | None = None,
259
- by_alias: bool = False,
259
+ by_alias: bool | None = None,
260
260
  exclude_unset: bool = False,
261
261
  exclude_defaults: bool = False,
262
262
  exclude_none: bool = False,
@@ -264,6 +264,7 @@ class BaseModel(pydantic.BaseModel):
264
264
  warnings: bool | Literal["none", "warn", "error"] = True,
265
265
  context: dict[str, Any] | None = None,
266
266
  serialize_as_any: bool = False,
267
+ fallback: Callable[[Any], Any] | None = None,
267
268
  ) -> dict[str, Any]:
268
269
  """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
269
270
 
@@ -295,10 +296,12 @@ class BaseModel(pydantic.BaseModel):
295
296
  raise ValueError("context is only supported in Pydantic v2")
296
297
  if serialize_as_any != False:
297
298
  raise ValueError("serialize_as_any is only supported in Pydantic v2")
299
+ if fallback is not None:
300
+ raise ValueError("fallback is only supported in Pydantic v2")
298
301
  dumped = super().dict( # pyright: ignore[reportDeprecated]
299
302
  include=include,
300
303
  exclude=exclude,
301
- by_alias=by_alias,
304
+ by_alias=by_alias if by_alias is not None else False,
302
305
  exclude_unset=exclude_unset,
303
306
  exclude_defaults=exclude_defaults,
304
307
  exclude_none=exclude_none,
@@ -313,13 +316,14 @@ class BaseModel(pydantic.BaseModel):
313
316
  indent: int | None = None,
314
317
  include: IncEx | None = None,
315
318
  exclude: IncEx | None = None,
316
- by_alias: bool = False,
319
+ by_alias: bool | None = None,
317
320
  exclude_unset: bool = False,
318
321
  exclude_defaults: bool = False,
319
322
  exclude_none: bool = False,
320
323
  round_trip: bool = False,
321
324
  warnings: bool | Literal["none", "warn", "error"] = True,
322
325
  context: dict[str, Any] | None = None,
326
+ fallback: Callable[[Any], Any] | None = None,
323
327
  serialize_as_any: bool = False,
324
328
  ) -> str:
325
329
  """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json
@@ -348,11 +352,13 @@ class BaseModel(pydantic.BaseModel):
348
352
  raise ValueError("context is only supported in Pydantic v2")
349
353
  if serialize_as_any != False:
350
354
  raise ValueError("serialize_as_any is only supported in Pydantic v2")
355
+ if fallback is not None:
356
+ raise ValueError("fallback is only supported in Pydantic v2")
351
357
  return super().json( # type: ignore[reportDeprecated]
352
358
  indent=indent,
353
359
  include=include,
354
360
  exclude=exclude,
355
- by_alias=by_alias,
361
+ by_alias=by_alias if by_alias is not None else False,
356
362
  exclude_unset=exclude_unset,
357
363
  exclude_defaults=exclude_defaults,
358
364
  exclude_none=exclude_none,
chunkr_ai/_qs.py CHANGED
@@ -4,7 +4,7 @@ from typing import Any, List, Tuple, Union, Mapping, TypeVar
4
4
  from urllib.parse import parse_qs, urlencode
5
5
  from typing_extensions import Literal, get_args
6
6
 
7
- from ._types import NOT_GIVEN, NotGiven, NotGivenOr
7
+ from ._types import NotGiven, not_given
8
8
  from ._utils import flatten
9
9
 
10
10
  _T = TypeVar("_T")
@@ -41,8 +41,8 @@ class Querystring:
41
41
  self,
42
42
  params: Params,
43
43
  *,
44
- array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
45
- nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
44
+ array_format: ArrayFormat | NotGiven = not_given,
45
+ nested_format: NestedFormat | NotGiven = not_given,
46
46
  ) -> str:
47
47
  return urlencode(
48
48
  self.stringify_items(
@@ -56,8 +56,8 @@ class Querystring:
56
56
  self,
57
57
  params: Params,
58
58
  *,
59
- array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
60
- nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
59
+ array_format: ArrayFormat | NotGiven = not_given,
60
+ nested_format: NestedFormat | NotGiven = not_given,
61
61
  ) -> list[tuple[str, str]]:
62
62
  opts = Options(
63
63
  qs=self,
@@ -143,8 +143,8 @@ class Options:
143
143
  self,
144
144
  qs: Querystring = _qs,
145
145
  *,
146
- array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
147
- nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
146
+ array_format: ArrayFormat | NotGiven = not_given,
147
+ nested_format: NestedFormat | NotGiven = not_given,
148
148
  ) -> None:
149
149
  self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format
150
150
  self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format
chunkr_ai/_types.py CHANGED
@@ -117,18 +117,21 @@ class RequestOptions(TypedDict, total=False):
117
117
  # Sentinel class used until PEP 0661 is accepted
118
118
  class NotGiven:
119
119
  """
120
- A sentinel singleton class used to distinguish omitted keyword arguments
121
- from those passed in with the value None (which may have different behavior).
120
+ For parameters with a meaningful None value, we need to distinguish between
121
+ the user explicitly passing None, and the user not passing the parameter at
122
+ all.
123
+
124
+ User code shouldn't need to use not_given directly.
122
125
 
123
126
  For example:
124
127
 
125
128
  ```py
126
- def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ...
129
+ def create(timeout: Timeout | None | NotGiven = not_given): ...
127
130
 
128
131
 
129
- get(timeout=1) # 1s timeout
130
- get(timeout=None) # No timeout
131
- get() # Default timeout behavior, which may not be statically known at the method definition.
132
+ create(timeout=1) # 1s timeout
133
+ create(timeout=None) # No timeout
134
+ create() # Default timeout behavior
132
135
  ```
133
136
  """
134
137
 
@@ -140,13 +143,14 @@ class NotGiven:
140
143
  return "NOT_GIVEN"
141
144
 
142
145
 
143
- NotGivenOr = Union[_T, NotGiven]
146
+ not_given = NotGiven()
147
+ # for backwards compatibility:
144
148
  NOT_GIVEN = NotGiven()
145
149
 
146
150
 
147
151
  class Omit:
148
- """In certain situations you need to be able to represent a case where a default value has
149
- to be explicitly removed and `None` is not an appropriate substitute, for example:
152
+ """
153
+ To explicitly omit something from being sent in a request, use `omit`.
150
154
 
151
155
  ```py
152
156
  # as the default `Content-Type` header is `application/json` that will be sent
@@ -156,8 +160,8 @@ class Omit:
156
160
  # to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983'
157
161
  client.post(..., headers={"Content-Type": "multipart/form-data"})
158
162
 
159
- # instead you can remove the default `application/json` header by passing Omit
160
- client.post(..., headers={"Content-Type": Omit()})
163
+ # instead you can remove the default `application/json` header by passing omit
164
+ client.post(..., headers={"Content-Type": omit})
161
165
  ```
162
166
  """
163
167
 
@@ -165,6 +169,9 @@ class Omit:
165
169
  return False
166
170
 
167
171
 
172
+ omit = Omit()
173
+
174
+
168
175
  @runtime_checkable
169
176
  class ModelBuilderProtocol(Protocol):
170
177
  @classmethod
@@ -268,7 +268,7 @@ def _transform_typeddict(
268
268
  annotations = get_type_hints(expected_type, include_extras=True)
269
269
  for key, value in data.items():
270
270
  if not is_given(value):
271
- # we don't need to include `NotGiven` values here as they'll
271
+ # we don't need to include omitted values here as they'll
272
272
  # be stripped out before the request is sent anyway
273
273
  continue
274
274
 
@@ -434,7 +434,7 @@ async def _async_transform_typeddict(
434
434
  annotations = get_type_hints(expected_type, include_extras=True)
435
435
  for key, value in data.items():
436
436
  if not is_given(value):
437
- # we don't need to include `NotGiven` values here as they'll
437
+ # we don't need to include omitted values here as they'll
438
438
  # be stripped out before the request is sent anyway
439
439
  continue
440
440
 
@@ -21,7 +21,7 @@ from typing_extensions import TypeGuard
21
21
 
22
22
  import sniffio
23
23
 
24
- from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike
24
+ from .._types import Omit, NotGiven, FileTypes, HeadersLike
25
25
 
26
26
  _T = TypeVar("_T")
27
27
  _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
@@ -63,7 +63,7 @@ def _extract_items(
63
63
  try:
64
64
  key = path[index]
65
65
  except IndexError:
66
- if isinstance(obj, NotGiven):
66
+ if not is_given(obj):
67
67
  # no value was provided - we can safely ignore
68
68
  return []
69
69
 
@@ -126,8 +126,8 @@ def _extract_items(
126
126
  return []
127
127
 
128
128
 
129
- def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]:
130
- return not isinstance(obj, NotGiven)
129
+ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
130
+ return not isinstance(obj, NotGiven) and not isinstance(obj, Omit)
131
131
 
132
132
 
133
133
  # Type safe methods for narrowing types with TypeVars.
chunkr_ai/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "chunkr_ai"
4
- __version__ = "0.1.0-alpha.8" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.10" # x-release-please-version
@@ -9,7 +9,7 @@ from typing_extensions import Literal
9
9
  import httpx
10
10
 
11
11
  from ..types import file_url_params, file_list_params, file_create_params
12
- from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes
12
+ from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, FileTypes, omit, not_given
13
13
  from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
14
14
  from .._compat import cached_property
15
15
  from .._resource import SyncAPIResource, AsyncAPIResource
@@ -52,13 +52,13 @@ class FilesResource(SyncAPIResource):
52
52
  self,
53
53
  *,
54
54
  file: FileTypes,
55
- file_metadata: Optional[str] | NotGiven = NOT_GIVEN,
55
+ file_metadata: Optional[str] | Omit = omit,
56
56
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
57
57
  # The extra values given here take precedence over values defined on the client or passed to this method.
58
58
  extra_headers: Headers | None = None,
59
59
  extra_query: Query | None = None,
60
60
  extra_body: Body | None = None,
61
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
62
62
  idempotency_key: str | None = None,
63
63
  ) -> File:
64
64
  """
@@ -110,17 +110,17 @@ class FilesResource(SyncAPIResource):
110
110
  def list(
111
111
  self,
112
112
  *,
113
- cursor: Union[str, datetime] | NotGiven = NOT_GIVEN,
114
- end: Union[str, datetime] | NotGiven = NOT_GIVEN,
115
- limit: int | NotGiven = NOT_GIVEN,
116
- sort: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
117
- start: Union[str, datetime] | NotGiven = NOT_GIVEN,
113
+ cursor: Union[str, datetime] | Omit = omit,
114
+ end: Union[str, datetime] | Omit = omit,
115
+ limit: int | Omit = omit,
116
+ sort: Literal["asc", "desc"] | Omit = omit,
117
+ start: Union[str, datetime] | Omit = omit,
118
118
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
119
119
  # The extra values given here take precedence over values defined on the client or passed to this method.
120
120
  extra_headers: Headers | None = None,
121
121
  extra_query: Query | None = None,
122
122
  extra_body: Body | None = None,
123
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
123
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
124
124
  ) -> SyncFilesPage[File]:
125
125
  """
126
126
  Lists files for the authenticated user with cursor-based pagination and optional
@@ -176,7 +176,7 @@ class FilesResource(SyncAPIResource):
176
176
  extra_headers: Headers | None = None,
177
177
  extra_query: Query | None = None,
178
178
  extra_body: Body | None = None,
179
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
179
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
180
180
  idempotency_key: str | None = None,
181
181
  ) -> Delete:
182
182
  """Delete file contents and scrub sensitive metadata.
@@ -218,7 +218,7 @@ class FilesResource(SyncAPIResource):
218
218
  extra_headers: Headers | None = None,
219
219
  extra_query: Query | None = None,
220
220
  extra_body: Body | None = None,
221
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
221
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
222
222
  ) -> None:
223
223
  """Streams the file bytes directly if authorized.
224
224
 
@@ -254,7 +254,7 @@ class FilesResource(SyncAPIResource):
254
254
  extra_headers: Headers | None = None,
255
255
  extra_query: Query | None = None,
256
256
  extra_body: Body | None = None,
257
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
257
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
258
258
  ) -> File:
259
259
  """Returns metadata for a file owned by the authenticated user.
260
260
 
@@ -288,14 +288,14 @@ class FilesResource(SyncAPIResource):
288
288
  self,
289
289
  file_id: str,
290
290
  *,
291
- base64_urls: bool | NotGiven = NOT_GIVEN,
292
- expires_in: int | NotGiven = NOT_GIVEN,
291
+ base64_urls: bool | Omit = omit,
292
+ expires_in: int | Omit = omit,
293
293
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
294
294
  # The extra values given here take precedence over values defined on the client or passed to this method.
295
295
  extra_headers: Headers | None = None,
296
296
  extra_query: Query | None = None,
297
297
  extra_body: Body | None = None,
298
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
298
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
299
299
  ) -> FileURL:
300
300
  """Returns a presigned download URL by default.
301
301
 
@@ -360,13 +360,13 @@ class AsyncFilesResource(AsyncAPIResource):
360
360
  self,
361
361
  *,
362
362
  file: FileTypes,
363
- file_metadata: Optional[str] | NotGiven = NOT_GIVEN,
363
+ file_metadata: Optional[str] | Omit = omit,
364
364
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
365
365
  # The extra values given here take precedence over values defined on the client or passed to this method.
366
366
  extra_headers: Headers | None = None,
367
367
  extra_query: Query | None = None,
368
368
  extra_body: Body | None = None,
369
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
369
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
370
370
  idempotency_key: str | None = None,
371
371
  ) -> File:
372
372
  """
@@ -418,17 +418,17 @@ class AsyncFilesResource(AsyncAPIResource):
418
418
  def list(
419
419
  self,
420
420
  *,
421
- cursor: Union[str, datetime] | NotGiven = NOT_GIVEN,
422
- end: Union[str, datetime] | NotGiven = NOT_GIVEN,
423
- limit: int | NotGiven = NOT_GIVEN,
424
- sort: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
425
- start: Union[str, datetime] | NotGiven = NOT_GIVEN,
421
+ cursor: Union[str, datetime] | Omit = omit,
422
+ end: Union[str, datetime] | Omit = omit,
423
+ limit: int | Omit = omit,
424
+ sort: Literal["asc", "desc"] | Omit = omit,
425
+ start: Union[str, datetime] | Omit = omit,
426
426
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
427
427
  # The extra values given here take precedence over values defined on the client or passed to this method.
428
428
  extra_headers: Headers | None = None,
429
429
  extra_query: Query | None = None,
430
430
  extra_body: Body | None = None,
431
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
431
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
432
432
  ) -> AsyncPaginator[File, AsyncFilesPage[File]]:
433
433
  """
434
434
  Lists files for the authenticated user with cursor-based pagination and optional
@@ -484,7 +484,7 @@ class AsyncFilesResource(AsyncAPIResource):
484
484
  extra_headers: Headers | None = None,
485
485
  extra_query: Query | None = None,
486
486
  extra_body: Body | None = None,
487
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
487
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
488
488
  idempotency_key: str | None = None,
489
489
  ) -> Delete:
490
490
  """Delete file contents and scrub sensitive metadata.
@@ -526,7 +526,7 @@ class AsyncFilesResource(AsyncAPIResource):
526
526
  extra_headers: Headers | None = None,
527
527
  extra_query: Query | None = None,
528
528
  extra_body: Body | None = None,
529
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
529
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
530
530
  ) -> None:
531
531
  """Streams the file bytes directly if authorized.
532
532
 
@@ -562,7 +562,7 @@ class AsyncFilesResource(AsyncAPIResource):
562
562
  extra_headers: Headers | None = None,
563
563
  extra_query: Query | None = None,
564
564
  extra_body: Body | None = None,
565
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
565
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
566
566
  ) -> File:
567
567
  """Returns metadata for a file owned by the authenticated user.
568
568
 
@@ -596,14 +596,14 @@ class AsyncFilesResource(AsyncAPIResource):
596
596
  self,
597
597
  file_id: str,
598
598
  *,
599
- base64_urls: bool | NotGiven = NOT_GIVEN,
600
- expires_in: int | NotGiven = NOT_GIVEN,
599
+ base64_urls: bool | Omit = omit,
600
+ expires_in: int | Omit = omit,
601
601
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
602
602
  # The extra values given here take precedence over values defined on the client or passed to this method.
603
603
  extra_headers: Headers | None = None,
604
604
  extra_query: Query | None = None,
605
605
  extra_body: Body | None = None,
606
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
606
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
607
607
  ) -> FileURL:
608
608
  """Returns a presigned download URL by default.
609
609
 
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import httpx
6
6
 
7
- from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
7
+ from .._types import Body, Query, Headers, NotGiven, not_given
8
8
  from .._compat import cached_property
9
9
  from .._resource import SyncAPIResource, AsyncAPIResource
10
10
  from .._response import (
@@ -46,7 +46,7 @@ class HealthResource(SyncAPIResource):
46
46
  extra_headers: Headers | None = None,
47
47
  extra_query: Query | None = None,
48
48
  extra_body: Body | None = None,
49
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
49
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
50
50
  ) -> str:
51
51
  """Confirmation that the service can respond to requests"""
52
52
  extra_headers = {"Accept": "text/plain", **(extra_headers or {})}
@@ -87,7 +87,7 @@ class AsyncHealthResource(AsyncAPIResource):
87
87
  extra_headers: Headers | None = None,
88
88
  extra_query: Query | None = None,
89
89
  extra_body: Body | None = None,
90
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
90
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
91
91
  ) -> str:
92
92
  """Confirmation that the service can respond to requests"""
93
93
  extra_headers = {"Accept": "text/plain", **(extra_headers or {})}