arbi 0.1.1__py3-none-any.whl → 0.2.0__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.

Potentially problematic release.


This version of arbi might be problematic. Click here for more details.

Files changed (60) hide show
  1. arbi/__init__.py +3 -1
  2. arbi/_base_client.py +12 -12
  3. arbi/_client.py +8 -8
  4. arbi/_compat.py +48 -48
  5. arbi/_models.py +51 -45
  6. arbi/_qs.py +7 -7
  7. arbi/_types.py +53 -12
  8. arbi/_utils/__init__.py +9 -2
  9. arbi/_utils/_compat.py +45 -0
  10. arbi/_utils/_datetime_parse.py +136 -0
  11. arbi/_utils/_transform.py +13 -3
  12. arbi/_utils/_typing.py +6 -1
  13. arbi/_utils/_utils.py +4 -5
  14. arbi/_version.py +1 -1
  15. arbi/resources/api/api.py +3 -3
  16. arbi/resources/api/assistant.py +17 -17
  17. arbi/resources/api/configs.py +41 -33
  18. arbi/resources/api/conversation/conversation.py +11 -11
  19. arbi/resources/api/conversation/user.py +5 -5
  20. arbi/resources/api/document/annotation.py +17 -17
  21. arbi/resources/api/document/document.py +166 -33
  22. arbi/resources/api/health.py +129 -11
  23. arbi/resources/api/sso.py +9 -9
  24. arbi/resources/api/tag.py +26 -26
  25. arbi/resources/api/user/settings.py +28 -20
  26. arbi/resources/api/user/user.py +107 -16
  27. arbi/resources/api/workspace.py +69 -39
  28. arbi/types/api/__init__.py +5 -0
  29. arbi/types/api/assistant_query_params.py +16 -4
  30. arbi/types/api/assistant_retrieve_params.py +16 -4
  31. arbi/types/api/config_create_params.py +67 -2
  32. arbi/types/api/config_retrieve_response.py +98 -2
  33. arbi/types/api/conversation_retrieve_threads_response.py +13 -2
  34. arbi/types/api/document_date_extractor_llm_config.py +3 -3
  35. arbi/types/api/document_date_extractor_llm_config_param.py +3 -3
  36. arbi/types/api/document_upload_from_url_params.py +23 -0
  37. arbi/types/api/document_upload_params.py +3 -3
  38. arbi/types/api/embedder_config.py +12 -0
  39. arbi/types/api/embedder_config_param.py +12 -0
  40. arbi/types/api/health_check_app_response.py +6 -0
  41. arbi/types/api/health_retrieve_status_response.py +45 -0
  42. arbi/types/api/health_retrieve_version_response.py +8 -0
  43. arbi/types/api/query_llm_config.py +1 -1
  44. arbi/types/api/query_llm_config_param.py +1 -1
  45. arbi/types/api/tag_apply_to_docs_params.py +3 -2
  46. arbi/types/api/tag_remove_from_docs_params.py +3 -2
  47. arbi/types/api/title_llm_config.py +1 -1
  48. arbi/types/api/title_llm_config_param.py +1 -1
  49. arbi/types/api/user/setting_retrieve_response.py +10 -1
  50. arbi/types/api/user/setting_update_params.py +8 -2
  51. arbi/types/api/user_register_params.py +2 -0
  52. arbi/types/api/user_verify_email_params.py +11 -0
  53. arbi/types/api/user_verify_email_response.py +9 -0
  54. arbi/types/api/workspace_create_protected_params.py +2 -0
  55. arbi/types/api/workspace_response.py +2 -0
  56. arbi/types/api/workspace_update_params.py +2 -0
  57. {arbi-0.1.1.dist-info → arbi-0.2.0.dist-info}/METADATA +3 -3
  58. {arbi-0.1.1.dist-info → arbi-0.2.0.dist-info}/RECORD +60 -53
  59. {arbi-0.1.1.dist-info → arbi-0.2.0.dist-info}/WHEEL +0 -0
  60. {arbi-0.1.1.dist-info → arbi-0.2.0.dist-info}/licenses/LICENSE +0 -0
arbi/_types.py CHANGED
@@ -13,10 +13,21 @@ from typing import (
13
13
  Mapping,
14
14
  TypeVar,
15
15
  Callable,
16
+ Iterator,
16
17
  Optional,
17
18
  Sequence,
18
19
  )
19
- from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
20
+ from typing_extensions import (
21
+ Set,
22
+ Literal,
23
+ Protocol,
24
+ TypeAlias,
25
+ TypedDict,
26
+ SupportsIndex,
27
+ overload,
28
+ override,
29
+ runtime_checkable,
30
+ )
20
31
 
21
32
  import httpx
22
33
  import pydantic
@@ -106,18 +117,21 @@ class RequestOptions(TypedDict, total=False):
106
117
  # Sentinel class used until PEP 0661 is accepted
107
118
  class NotGiven:
108
119
  """
109
- A sentinel singleton class used to distinguish omitted keyword arguments
110
- 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.
111
125
 
112
126
  For example:
113
127
 
114
128
  ```py
115
- def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ...
129
+ def create(timeout: Timeout | None | NotGiven = not_given): ...
116
130
 
117
131
 
118
- get(timeout=1) # 1s timeout
119
- get(timeout=None) # No timeout
120
- 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
121
135
  ```
122
136
  """
123
137
 
@@ -129,13 +143,14 @@ class NotGiven:
129
143
  return "NOT_GIVEN"
130
144
 
131
145
 
132
- NotGivenOr = Union[_T, NotGiven]
146
+ not_given = NotGiven()
147
+ # for backwards compatibility:
133
148
  NOT_GIVEN = NotGiven()
134
149
 
135
150
 
136
151
  class Omit:
137
- """In certain situations you need to be able to represent a case where a default value has
138
- 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`.
139
154
 
140
155
  ```py
141
156
  # as the default `Content-Type` header is `application/json` that will be sent
@@ -145,8 +160,8 @@ class Omit:
145
160
  # to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983'
146
161
  client.post(..., headers={"Content-Type": "multipart/form-data"})
147
162
 
148
- # instead you can remove the default `application/json` header by passing Omit
149
- 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})
150
165
  ```
151
166
  """
152
167
 
@@ -154,6 +169,9 @@ class Omit:
154
169
  return False
155
170
 
156
171
 
172
+ omit = Omit()
173
+
174
+
157
175
  @runtime_checkable
158
176
  class ModelBuilderProtocol(Protocol):
159
177
  @classmethod
@@ -217,3 +235,26 @@ class _GenericAlias(Protocol):
217
235
  class HttpxSendArgs(TypedDict, total=False):
218
236
  auth: httpx.Auth
219
237
  follow_redirects: bool
238
+
239
+
240
+ _T_co = TypeVar("_T_co", covariant=True)
241
+
242
+
243
+ if TYPE_CHECKING:
244
+ # This works because str.__contains__ does not accept object (either in typeshed or at runtime)
245
+ # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
246
+ class SequenceNotStr(Protocol[_T_co]):
247
+ @overload
248
+ def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
249
+ @overload
250
+ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ...
251
+ def __contains__(self, value: object, /) -> bool: ...
252
+ def __len__(self) -> int: ...
253
+ def __iter__(self) -> Iterator[_T_co]: ...
254
+ def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
255
+ def count(self, value: Any, /) -> int: ...
256
+ def __reversed__(self) -> Iterator[_T_co]: ...
257
+ else:
258
+ # just point this to a normal `Sequence` at runtime to avoid having to special case
259
+ # deserializing our custom sequence type
260
+ SequenceNotStr = Sequence
arbi/_utils/__init__.py CHANGED
@@ -10,7 +10,6 @@ from ._utils import (
10
10
  lru_cache as lru_cache,
11
11
  is_mapping as is_mapping,
12
12
  is_tuple_t as is_tuple_t,
13
- parse_date as parse_date,
14
13
  is_iterable as is_iterable,
15
14
  is_sequence as is_sequence,
16
15
  coerce_float as coerce_float,
@@ -23,7 +22,6 @@ from ._utils import (
23
22
  coerce_boolean as coerce_boolean,
24
23
  coerce_integer as coerce_integer,
25
24
  file_from_path as file_from_path,
26
- parse_datetime as parse_datetime,
27
25
  strip_not_given as strip_not_given,
28
26
  deepcopy_minimal as deepcopy_minimal,
29
27
  get_async_library as get_async_library,
@@ -32,12 +30,20 @@ from ._utils import (
32
30
  maybe_coerce_boolean as maybe_coerce_boolean,
33
31
  maybe_coerce_integer as maybe_coerce_integer,
34
32
  )
33
+ from ._compat import (
34
+ get_args as get_args,
35
+ is_union as is_union,
36
+ get_origin as get_origin,
37
+ is_typeddict as is_typeddict,
38
+ is_literal_type as is_literal_type,
39
+ )
35
40
  from ._typing import (
36
41
  is_list_type as is_list_type,
37
42
  is_union_type as is_union_type,
38
43
  extract_type_arg as extract_type_arg,
39
44
  is_iterable_type as is_iterable_type,
40
45
  is_required_type as is_required_type,
46
+ is_sequence_type as is_sequence_type,
41
47
  is_annotated_type as is_annotated_type,
42
48
  is_type_alias_type as is_type_alias_type,
43
49
  strip_annotated_type as strip_annotated_type,
@@ -55,3 +61,4 @@ from ._reflection import (
55
61
  function_has_argument as function_has_argument,
56
62
  assert_signatures_in_sync as assert_signatures_in_sync,
57
63
  )
64
+ from ._datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
arbi/_utils/_compat.py ADDED
@@ -0,0 +1,45 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+ import typing_extensions
5
+ from typing import Any, Type, Union, Literal, Optional
6
+ from datetime import date, datetime
7
+ from typing_extensions import get_args as _get_args, get_origin as _get_origin
8
+
9
+ from .._types import StrBytesIntFloat
10
+ from ._datetime_parse import parse_date as _parse_date, parse_datetime as _parse_datetime
11
+
12
+ _LITERAL_TYPES = {Literal, typing_extensions.Literal}
13
+
14
+
15
+ def get_args(tp: type[Any]) -> tuple[Any, ...]:
16
+ return _get_args(tp)
17
+
18
+
19
+ def get_origin(tp: type[Any]) -> type[Any] | None:
20
+ return _get_origin(tp)
21
+
22
+
23
+ def is_union(tp: Optional[Type[Any]]) -> bool:
24
+ if sys.version_info < (3, 10):
25
+ return tp is Union # type: ignore[comparison-overlap]
26
+ else:
27
+ import types
28
+
29
+ return tp is Union or tp is types.UnionType
30
+
31
+
32
+ def is_typeddict(tp: Type[Any]) -> bool:
33
+ return typing_extensions.is_typeddict(tp)
34
+
35
+
36
+ def is_literal_type(tp: Type[Any]) -> bool:
37
+ return get_origin(tp) in _LITERAL_TYPES
38
+
39
+
40
+ def parse_date(value: Union[date, StrBytesIntFloat]) -> date:
41
+ return _parse_date(value)
42
+
43
+
44
+ def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime:
45
+ return _parse_datetime(value)
@@ -0,0 +1,136 @@
1
+ """
2
+ This file contains code from https://github.com/pydantic/pydantic/blob/main/pydantic/v1/datetime_parse.py
3
+ without the Pydantic v1 specific errors.
4
+ """
5
+
6
+ from __future__ import annotations
7
+
8
+ import re
9
+ from typing import Dict, Union, Optional
10
+ from datetime import date, datetime, timezone, timedelta
11
+
12
+ from .._types import StrBytesIntFloat
13
+
14
+ date_expr = r"(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})"
15
+ time_expr = (
16
+ r"(?P<hour>\d{1,2}):(?P<minute>\d{1,2})"
17
+ r"(?::(?P<second>\d{1,2})(?:\.(?P<microsecond>\d{1,6})\d{0,6})?)?"
18
+ r"(?P<tzinfo>Z|[+-]\d{2}(?::?\d{2})?)?$"
19
+ )
20
+
21
+ date_re = re.compile(f"{date_expr}$")
22
+ datetime_re = re.compile(f"{date_expr}[T ]{time_expr}")
23
+
24
+
25
+ EPOCH = datetime(1970, 1, 1)
26
+ # if greater than this, the number is in ms, if less than or equal it's in seconds
27
+ # (in seconds this is 11th October 2603, in ms it's 20th August 1970)
28
+ MS_WATERSHED = int(2e10)
29
+ # slightly more than datetime.max in ns - (datetime.max - EPOCH).total_seconds() * 1e9
30
+ MAX_NUMBER = int(3e20)
31
+
32
+
33
+ def _get_numeric(value: StrBytesIntFloat, native_expected_type: str) -> Union[None, int, float]:
34
+ if isinstance(value, (int, float)):
35
+ return value
36
+ try:
37
+ return float(value)
38
+ except ValueError:
39
+ return None
40
+ except TypeError:
41
+ raise TypeError(f"invalid type; expected {native_expected_type}, string, bytes, int or float") from None
42
+
43
+
44
+ def _from_unix_seconds(seconds: Union[int, float]) -> datetime:
45
+ if seconds > MAX_NUMBER:
46
+ return datetime.max
47
+ elif seconds < -MAX_NUMBER:
48
+ return datetime.min
49
+
50
+ while abs(seconds) > MS_WATERSHED:
51
+ seconds /= 1000
52
+ dt = EPOCH + timedelta(seconds=seconds)
53
+ return dt.replace(tzinfo=timezone.utc)
54
+
55
+
56
+ def _parse_timezone(value: Optional[str]) -> Union[None, int, timezone]:
57
+ if value == "Z":
58
+ return timezone.utc
59
+ elif value is not None:
60
+ offset_mins = int(value[-2:]) if len(value) > 3 else 0
61
+ offset = 60 * int(value[1:3]) + offset_mins
62
+ if value[0] == "-":
63
+ offset = -offset
64
+ return timezone(timedelta(minutes=offset))
65
+ else:
66
+ return None
67
+
68
+
69
+ def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime:
70
+ """
71
+ Parse a datetime/int/float/string and return a datetime.datetime.
72
+
73
+ This function supports time zone offsets. When the input contains one,
74
+ the output uses a timezone with a fixed offset from UTC.
75
+
76
+ Raise ValueError if the input is well formatted but not a valid datetime.
77
+ Raise ValueError if the input isn't well formatted.
78
+ """
79
+ if isinstance(value, datetime):
80
+ return value
81
+
82
+ number = _get_numeric(value, "datetime")
83
+ if number is not None:
84
+ return _from_unix_seconds(number)
85
+
86
+ if isinstance(value, bytes):
87
+ value = value.decode()
88
+
89
+ assert not isinstance(value, (float, int))
90
+
91
+ match = datetime_re.match(value)
92
+ if match is None:
93
+ raise ValueError("invalid datetime format")
94
+
95
+ kw = match.groupdict()
96
+ if kw["microsecond"]:
97
+ kw["microsecond"] = kw["microsecond"].ljust(6, "0")
98
+
99
+ tzinfo = _parse_timezone(kw.pop("tzinfo"))
100
+ kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None}
101
+ kw_["tzinfo"] = tzinfo
102
+
103
+ return datetime(**kw_) # type: ignore
104
+
105
+
106
+ def parse_date(value: Union[date, StrBytesIntFloat]) -> date:
107
+ """
108
+ Parse a date/int/float/string and return a datetime.date.
109
+
110
+ Raise ValueError if the input is well formatted but not a valid date.
111
+ Raise ValueError if the input isn't well formatted.
112
+ """
113
+ if isinstance(value, date):
114
+ if isinstance(value, datetime):
115
+ return value.date()
116
+ else:
117
+ return value
118
+
119
+ number = _get_numeric(value, "date")
120
+ if number is not None:
121
+ return _from_unix_seconds(number).date()
122
+
123
+ if isinstance(value, bytes):
124
+ value = value.decode()
125
+
126
+ assert not isinstance(value, (float, int))
127
+ match = date_re.match(value)
128
+ if match is None:
129
+ raise ValueError("invalid date format")
130
+
131
+ kw = {k: int(v) for k, v in match.groupdict().items()}
132
+
133
+ try:
134
+ return date(**kw)
135
+ except ValueError:
136
+ raise ValueError("invalid date format") from None
arbi/_utils/_transform.py CHANGED
@@ -16,18 +16,20 @@ from ._utils import (
16
16
  lru_cache,
17
17
  is_mapping,
18
18
  is_iterable,
19
+ is_sequence,
19
20
  )
20
21
  from .._files import is_base64_file_input
22
+ from ._compat import get_origin, is_typeddict
21
23
  from ._typing import (
22
24
  is_list_type,
23
25
  is_union_type,
24
26
  extract_type_arg,
25
27
  is_iterable_type,
26
28
  is_required_type,
29
+ is_sequence_type,
27
30
  is_annotated_type,
28
31
  strip_annotated_type,
29
32
  )
30
- from .._compat import get_origin, model_dump, is_typeddict
31
33
 
32
34
  _T = TypeVar("_T")
33
35
 
@@ -167,6 +169,8 @@ def _transform_recursive(
167
169
 
168
170
  Defaults to the same value as the `annotation` argument.
169
171
  """
172
+ from .._compat import model_dump
173
+
170
174
  if inner_type is None:
171
175
  inner_type = annotation
172
176
 
@@ -184,6 +188,8 @@ def _transform_recursive(
184
188
  (is_list_type(stripped_type) and is_list(data))
185
189
  # Iterable[T]
186
190
  or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
191
+ # Sequence[T]
192
+ or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str))
187
193
  ):
188
194
  # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
189
195
  # intended as an iterable, so we don't transform it.
@@ -262,7 +268,7 @@ def _transform_typeddict(
262
268
  annotations = get_type_hints(expected_type, include_extras=True)
263
269
  for key, value in data.items():
264
270
  if not is_given(value):
265
- # 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
266
272
  # be stripped out before the request is sent anyway
267
273
  continue
268
274
 
@@ -329,6 +335,8 @@ async def _async_transform_recursive(
329
335
 
330
336
  Defaults to the same value as the `annotation` argument.
331
337
  """
338
+ from .._compat import model_dump
339
+
332
340
  if inner_type is None:
333
341
  inner_type = annotation
334
342
 
@@ -346,6 +354,8 @@ async def _async_transform_recursive(
346
354
  (is_list_type(stripped_type) and is_list(data))
347
355
  # Iterable[T]
348
356
  or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
357
+ # Sequence[T]
358
+ or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str))
349
359
  ):
350
360
  # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
351
361
  # intended as an iterable, so we don't transform it.
@@ -424,7 +434,7 @@ async def _async_transform_typeddict(
424
434
  annotations = get_type_hints(expected_type, include_extras=True)
425
435
  for key, value in data.items():
426
436
  if not is_given(value):
427
- # 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
428
438
  # be stripped out before the request is sent anyway
429
439
  continue
430
440
 
arbi/_utils/_typing.py CHANGED
@@ -15,7 +15,7 @@ from typing_extensions import (
15
15
 
16
16
  from ._utils import lru_cache
17
17
  from .._types import InheritsGeneric
18
- from .._compat import is_union as _is_union
18
+ from ._compat import is_union as _is_union
19
19
 
20
20
 
21
21
  def is_annotated_type(typ: type) -> bool:
@@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool:
26
26
  return (get_origin(typ) or typ) == list
27
27
 
28
28
 
29
+ def is_sequence_type(typ: type) -> bool:
30
+ origin = get_origin(typ) or typ
31
+ return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence
32
+
33
+
29
34
  def is_iterable_type(typ: type) -> bool:
30
35
  """If the given type is `typing.Iterable[T]`"""
31
36
  origin = get_origin(typ) or typ
arbi/_utils/_utils.py CHANGED
@@ -21,8 +21,7 @@ from typing_extensions import TypeGuard
21
21
 
22
22
  import sniffio
23
23
 
24
- from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike
25
- from .._compat import parse_date as parse_date, parse_datetime as parse_datetime
24
+ from .._types import Omit, NotGiven, FileTypes, HeadersLike
26
25
 
27
26
  _T = TypeVar("_T")
28
27
  _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
@@ -64,7 +63,7 @@ def _extract_items(
64
63
  try:
65
64
  key = path[index]
66
65
  except IndexError:
67
- if isinstance(obj, NotGiven):
66
+ if not is_given(obj):
68
67
  # no value was provided - we can safely ignore
69
68
  return []
70
69
 
@@ -127,8 +126,8 @@ def _extract_items(
127
126
  return []
128
127
 
129
128
 
130
- def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]:
131
- 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)
132
131
 
133
132
 
134
133
  # Type safe methods for narrowing types with TypeVars.
arbi/_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__ = "arbi"
4
- __version__ = "0.1.1" # x-release-please-version
4
+ __version__ = "0.2.0" # x-release-please-version
arbi/resources/api/api.py CHANGED
@@ -37,7 +37,7 @@ from .configs import (
37
37
  ConfigsResourceWithStreamingResponse,
38
38
  AsyncConfigsResourceWithStreamingResponse,
39
39
  )
40
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
40
+ from ..._types import Body, Query, Headers, NotGiven, not_given
41
41
  from ..._compat import cached_property
42
42
  from .assistant import (
43
43
  AssistantResource,
@@ -154,7 +154,7 @@ class APIResource(_resource.SyncAPIResource):
154
154
  extra_headers: Headers | None = None,
155
155
  extra_query: Query | None = None,
156
156
  extra_body: Body | None = None,
157
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
157
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
158
158
  ) -> object:
159
159
  """Serves the admin application page with necessary configuration variables."""
160
160
  return self._get(
@@ -230,7 +230,7 @@ class AsyncAPIResource(_resource.AsyncAPIResource):
230
230
  extra_headers: Headers | None = None,
231
231
  extra_query: Query | None = None,
232
232
  extra_body: Body | None = None,
233
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
233
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
234
234
  ) -> object:
235
235
  """Serves the admin application page with necessary configuration variables."""
236
236
  return await self._get(
@@ -6,7 +6,7 @@ from typing import Dict, Optional
6
6
 
7
7
  import httpx
8
8
 
9
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
10
10
  from ..._utils import maybe_transform, async_maybe_transform
11
11
  from ..._compat import cached_property
12
12
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -47,15 +47,15 @@ class AssistantResource(SyncAPIResource):
47
47
  *,
48
48
  content: str,
49
49
  workspace_ext_id: str,
50
- config_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
51
- parent_message_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
52
- tools: Dict[str, assistant_retrieve_params.Tools] | NotGiven = NOT_GIVEN,
50
+ config_ext_id: Optional[str] | Omit = omit,
51
+ parent_message_ext_id: Optional[str] | Omit = omit,
52
+ tools: Dict[str, assistant_retrieve_params.Tools] | Omit = omit,
53
53
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
54
54
  # The extra values given here take precedence over values defined on the client or passed to this method.
55
55
  extra_headers: Headers | None = None,
56
56
  extra_query: Query | None = None,
57
57
  extra_body: Body | None = None,
58
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
58
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
59
59
  ) -> object:
60
60
  """Retrieve relevant document chunks for a user message.
61
61
 
@@ -94,15 +94,15 @@ class AssistantResource(SyncAPIResource):
94
94
  *,
95
95
  content: str,
96
96
  workspace_ext_id: str,
97
- config_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
98
- parent_message_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
99
- tools: Dict[str, assistant_query_params.Tools] | NotGiven = NOT_GIVEN,
97
+ config_ext_id: Optional[str] | Omit = omit,
98
+ parent_message_ext_id: Optional[str] | Omit = omit,
99
+ tools: Dict[str, assistant_query_params.Tools] | Omit = omit,
100
100
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
101
101
  # The extra values given here take precedence over values defined on the client or passed to this method.
102
102
  extra_headers: Headers | None = None,
103
103
  extra_query: Query | None = None,
104
104
  extra_body: Body | None = None,
105
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
105
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
106
106
  ) -> object:
107
107
  """Process a user query against documents in a workspace.
108
108
 
@@ -162,15 +162,15 @@ class AsyncAssistantResource(AsyncAPIResource):
162
162
  *,
163
163
  content: str,
164
164
  workspace_ext_id: str,
165
- config_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
166
- parent_message_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
167
- tools: Dict[str, assistant_retrieve_params.Tools] | NotGiven = NOT_GIVEN,
165
+ config_ext_id: Optional[str] | Omit = omit,
166
+ parent_message_ext_id: Optional[str] | Omit = omit,
167
+ tools: Dict[str, assistant_retrieve_params.Tools] | Omit = omit,
168
168
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
169
169
  # The extra values given here take precedence over values defined on the client or passed to this method.
170
170
  extra_headers: Headers | None = None,
171
171
  extra_query: Query | None = None,
172
172
  extra_body: Body | None = None,
173
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
173
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
174
174
  ) -> object:
175
175
  """Retrieve relevant document chunks for a user message.
176
176
 
@@ -209,15 +209,15 @@ class AsyncAssistantResource(AsyncAPIResource):
209
209
  *,
210
210
  content: str,
211
211
  workspace_ext_id: str,
212
- config_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
213
- parent_message_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
214
- tools: Dict[str, assistant_query_params.Tools] | NotGiven = NOT_GIVEN,
212
+ config_ext_id: Optional[str] | Omit = omit,
213
+ parent_message_ext_id: Optional[str] | Omit = omit,
214
+ tools: Dict[str, assistant_query_params.Tools] | Omit = omit,
215
215
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
216
216
  # The extra values given here take precedence over values defined on the client or passed to this method.
217
217
  extra_headers: Headers | None = None,
218
218
  extra_query: Query | None = None,
219
219
  extra_body: Body | None = None,
220
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
220
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
221
221
  ) -> object:
222
222
  """Process a user query against documents in a workspace.
223
223