perplexityai 0.3.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 perplexityai might be problematic. Click here for more details.

@@ -0,0 +1,421 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import re
5
+ import inspect
6
+ import functools
7
+ from typing import (
8
+ Any,
9
+ Tuple,
10
+ Mapping,
11
+ TypeVar,
12
+ Callable,
13
+ Iterable,
14
+ Sequence,
15
+ cast,
16
+ overload,
17
+ )
18
+ from pathlib import Path
19
+ from datetime import date, datetime
20
+ from typing_extensions import TypeGuard
21
+
22
+ import sniffio
23
+
24
+ from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike
25
+
26
+ _T = TypeVar("_T")
27
+ _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
28
+ _MappingT = TypeVar("_MappingT", bound=Mapping[str, object])
29
+ _SequenceT = TypeVar("_SequenceT", bound=Sequence[object])
30
+ CallableT = TypeVar("CallableT", bound=Callable[..., Any])
31
+
32
+
33
+ def flatten(t: Iterable[Iterable[_T]]) -> list[_T]:
34
+ return [item for sublist in t for item in sublist]
35
+
36
+
37
+ def extract_files(
38
+ # TODO: this needs to take Dict but variance issues.....
39
+ # create protocol type ?
40
+ query: Mapping[str, object],
41
+ *,
42
+ paths: Sequence[Sequence[str]],
43
+ ) -> list[tuple[str, FileTypes]]:
44
+ """Recursively extract files from the given dictionary based on specified paths.
45
+
46
+ A path may look like this ['foo', 'files', '<array>', 'data'].
47
+
48
+ Note: this mutates the given dictionary.
49
+ """
50
+ files: list[tuple[str, FileTypes]] = []
51
+ for path in paths:
52
+ files.extend(_extract_items(query, path, index=0, flattened_key=None))
53
+ return files
54
+
55
+
56
+ def _extract_items(
57
+ obj: object,
58
+ path: Sequence[str],
59
+ *,
60
+ index: int,
61
+ flattened_key: str | None,
62
+ ) -> list[tuple[str, FileTypes]]:
63
+ try:
64
+ key = path[index]
65
+ except IndexError:
66
+ if isinstance(obj, NotGiven):
67
+ # no value was provided - we can safely ignore
68
+ return []
69
+
70
+ # cyclical import
71
+ from .._files import assert_is_file_content
72
+
73
+ # We have exhausted the path, return the entry we found.
74
+ assert flattened_key is not None
75
+
76
+ if is_list(obj):
77
+ files: list[tuple[str, FileTypes]] = []
78
+ for entry in obj:
79
+ assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "")
80
+ files.append((flattened_key + "[]", cast(FileTypes, entry)))
81
+ return files
82
+
83
+ assert_is_file_content(obj, key=flattened_key)
84
+ return [(flattened_key, cast(FileTypes, obj))]
85
+
86
+ index += 1
87
+ if is_dict(obj):
88
+ try:
89
+ # We are at the last entry in the path so we must remove the field
90
+ if (len(path)) == index:
91
+ item = obj.pop(key)
92
+ else:
93
+ item = obj[key]
94
+ except KeyError:
95
+ # Key was not present in the dictionary, this is not indicative of an error
96
+ # as the given path may not point to a required field. We also do not want
97
+ # to enforce required fields as the API may differ from the spec in some cases.
98
+ return []
99
+ if flattened_key is None:
100
+ flattened_key = key
101
+ else:
102
+ flattened_key += f"[{key}]"
103
+ return _extract_items(
104
+ item,
105
+ path,
106
+ index=index,
107
+ flattened_key=flattened_key,
108
+ )
109
+ elif is_list(obj):
110
+ if key != "<array>":
111
+ return []
112
+
113
+ return flatten(
114
+ [
115
+ _extract_items(
116
+ item,
117
+ path,
118
+ index=index,
119
+ flattened_key=flattened_key + "[]" if flattened_key is not None else "[]",
120
+ )
121
+ for item in obj
122
+ ]
123
+ )
124
+
125
+ # Something unexpected was passed, just ignore it.
126
+ return []
127
+
128
+
129
+ def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]:
130
+ return not isinstance(obj, NotGiven)
131
+
132
+
133
+ # Type safe methods for narrowing types with TypeVars.
134
+ # The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
135
+ # however this cause Pyright to rightfully report errors. As we know we don't
136
+ # care about the contained types we can safely use `object` in it's place.
137
+ #
138
+ # There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
139
+ # `is_*` is for when you're dealing with an unknown input
140
+ # `is_*_t` is for when you're narrowing a known union type to a specific subset
141
+
142
+
143
+ def is_tuple(obj: object) -> TypeGuard[tuple[object, ...]]:
144
+ return isinstance(obj, tuple)
145
+
146
+
147
+ def is_tuple_t(obj: _TupleT | object) -> TypeGuard[_TupleT]:
148
+ return isinstance(obj, tuple)
149
+
150
+
151
+ def is_sequence(obj: object) -> TypeGuard[Sequence[object]]:
152
+ return isinstance(obj, Sequence)
153
+
154
+
155
+ def is_sequence_t(obj: _SequenceT | object) -> TypeGuard[_SequenceT]:
156
+ return isinstance(obj, Sequence)
157
+
158
+
159
+ def is_mapping(obj: object) -> TypeGuard[Mapping[str, object]]:
160
+ return isinstance(obj, Mapping)
161
+
162
+
163
+ def is_mapping_t(obj: _MappingT | object) -> TypeGuard[_MappingT]:
164
+ return isinstance(obj, Mapping)
165
+
166
+
167
+ def is_dict(obj: object) -> TypeGuard[dict[object, object]]:
168
+ return isinstance(obj, dict)
169
+
170
+
171
+ def is_list(obj: object) -> TypeGuard[list[object]]:
172
+ return isinstance(obj, list)
173
+
174
+
175
+ def is_iterable(obj: object) -> TypeGuard[Iterable[object]]:
176
+ return isinstance(obj, Iterable)
177
+
178
+
179
+ def deepcopy_minimal(item: _T) -> _T:
180
+ """Minimal reimplementation of copy.deepcopy() that will only copy certain object types:
181
+
182
+ - mappings, e.g. `dict`
183
+ - list
184
+
185
+ This is done for performance reasons.
186
+ """
187
+ if is_mapping(item):
188
+ return cast(_T, {k: deepcopy_minimal(v) for k, v in item.items()})
189
+ if is_list(item):
190
+ return cast(_T, [deepcopy_minimal(entry) for entry in item])
191
+ return item
192
+
193
+
194
+ # copied from https://github.com/Rapptz/RoboDanny
195
+ def human_join(seq: Sequence[str], *, delim: str = ", ", final: str = "or") -> str:
196
+ size = len(seq)
197
+ if size == 0:
198
+ return ""
199
+
200
+ if size == 1:
201
+ return seq[0]
202
+
203
+ if size == 2:
204
+ return f"{seq[0]} {final} {seq[1]}"
205
+
206
+ return delim.join(seq[:-1]) + f" {final} {seq[-1]}"
207
+
208
+
209
+ def quote(string: str) -> str:
210
+ """Add single quotation marks around the given string. Does *not* do any escaping."""
211
+ return f"'{string}'"
212
+
213
+
214
+ def required_args(*variants: Sequence[str]) -> Callable[[CallableT], CallableT]:
215
+ """Decorator to enforce a given set of arguments or variants of arguments are passed to the decorated function.
216
+
217
+ Useful for enforcing runtime validation of overloaded functions.
218
+
219
+ Example usage:
220
+ ```py
221
+ @overload
222
+ def foo(*, a: str) -> str: ...
223
+
224
+
225
+ @overload
226
+ def foo(*, b: bool) -> str: ...
227
+
228
+
229
+ # This enforces the same constraints that a static type checker would
230
+ # i.e. that either a or b must be passed to the function
231
+ @required_args(["a"], ["b"])
232
+ def foo(*, a: str | None = None, b: bool | None = None) -> str: ...
233
+ ```
234
+ """
235
+
236
+ def inner(func: CallableT) -> CallableT:
237
+ params = inspect.signature(func).parameters
238
+ positional = [
239
+ name
240
+ for name, param in params.items()
241
+ if param.kind
242
+ in {
243
+ param.POSITIONAL_ONLY,
244
+ param.POSITIONAL_OR_KEYWORD,
245
+ }
246
+ ]
247
+
248
+ @functools.wraps(func)
249
+ def wrapper(*args: object, **kwargs: object) -> object:
250
+ given_params: set[str] = set()
251
+ for i, _ in enumerate(args):
252
+ try:
253
+ given_params.add(positional[i])
254
+ except IndexError:
255
+ raise TypeError(
256
+ f"{func.__name__}() takes {len(positional)} argument(s) but {len(args)} were given"
257
+ ) from None
258
+
259
+ for key in kwargs.keys():
260
+ given_params.add(key)
261
+
262
+ for variant in variants:
263
+ matches = all((param in given_params for param in variant))
264
+ if matches:
265
+ break
266
+ else: # no break
267
+ if len(variants) > 1:
268
+ variations = human_join(
269
+ ["(" + human_join([quote(arg) for arg in variant], final="and") + ")" for variant in variants]
270
+ )
271
+ msg = f"Missing required arguments; Expected either {variations} arguments to be given"
272
+ else:
273
+ assert len(variants) > 0
274
+
275
+ # TODO: this error message is not deterministic
276
+ missing = list(set(variants[0]) - given_params)
277
+ if len(missing) > 1:
278
+ msg = f"Missing required arguments: {human_join([quote(arg) for arg in missing])}"
279
+ else:
280
+ msg = f"Missing required argument: {quote(missing[0])}"
281
+ raise TypeError(msg)
282
+ return func(*args, **kwargs)
283
+
284
+ return wrapper # type: ignore
285
+
286
+ return inner
287
+
288
+
289
+ _K = TypeVar("_K")
290
+ _V = TypeVar("_V")
291
+
292
+
293
+ @overload
294
+ def strip_not_given(obj: None) -> None: ...
295
+
296
+
297
+ @overload
298
+ def strip_not_given(obj: Mapping[_K, _V | NotGiven]) -> dict[_K, _V]: ...
299
+
300
+
301
+ @overload
302
+ def strip_not_given(obj: object) -> object: ...
303
+
304
+
305
+ def strip_not_given(obj: object | None) -> object:
306
+ """Remove all top-level keys where their values are instances of `NotGiven`"""
307
+ if obj is None:
308
+ return None
309
+
310
+ if not is_mapping(obj):
311
+ return obj
312
+
313
+ return {key: value for key, value in obj.items() if not isinstance(value, NotGiven)}
314
+
315
+
316
+ def coerce_integer(val: str) -> int:
317
+ return int(val, base=10)
318
+
319
+
320
+ def coerce_float(val: str) -> float:
321
+ return float(val)
322
+
323
+
324
+ def coerce_boolean(val: str) -> bool:
325
+ return val == "true" or val == "1" or val == "on"
326
+
327
+
328
+ def maybe_coerce_integer(val: str | None) -> int | None:
329
+ if val is None:
330
+ return None
331
+ return coerce_integer(val)
332
+
333
+
334
+ def maybe_coerce_float(val: str | None) -> float | None:
335
+ if val is None:
336
+ return None
337
+ return coerce_float(val)
338
+
339
+
340
+ def maybe_coerce_boolean(val: str | None) -> bool | None:
341
+ if val is None:
342
+ return None
343
+ return coerce_boolean(val)
344
+
345
+
346
+ def removeprefix(string: str, prefix: str) -> str:
347
+ """Remove a prefix from a string.
348
+
349
+ Backport of `str.removeprefix` for Python < 3.9
350
+ """
351
+ if string.startswith(prefix):
352
+ return string[len(prefix) :]
353
+ return string
354
+
355
+
356
+ def removesuffix(string: str, suffix: str) -> str:
357
+ """Remove a suffix from a string.
358
+
359
+ Backport of `str.removesuffix` for Python < 3.9
360
+ """
361
+ if string.endswith(suffix):
362
+ return string[: -len(suffix)]
363
+ return string
364
+
365
+
366
+ def file_from_path(path: str) -> FileTypes:
367
+ contents = Path(path).read_bytes()
368
+ file_name = os.path.basename(path)
369
+ return (file_name, contents)
370
+
371
+
372
+ def get_required_header(headers: HeadersLike, header: str) -> str:
373
+ lower_header = header.lower()
374
+ if is_mapping_t(headers):
375
+ # mypy doesn't understand the type narrowing here
376
+ for k, v in headers.items(): # type: ignore
377
+ if k.lower() == lower_header and isinstance(v, str):
378
+ return v
379
+
380
+ # to deal with the case where the header looks like Stainless-Event-Id
381
+ intercaps_header = re.sub(r"([^\w])(\w)", lambda pat: pat.group(1) + pat.group(2).upper(), header.capitalize())
382
+
383
+ for normalized_header in [header, lower_header, header.upper(), intercaps_header]:
384
+ value = headers.get(normalized_header)
385
+ if value:
386
+ return value
387
+
388
+ raise ValueError(f"Could not find {header} header")
389
+
390
+
391
+ def get_async_library() -> str:
392
+ try:
393
+ return sniffio.current_async_library()
394
+ except Exception:
395
+ return "false"
396
+
397
+
398
+ def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]:
399
+ """A version of functools.lru_cache that retains the type signature
400
+ for the wrapped function arguments.
401
+ """
402
+ wrapper = functools.lru_cache( # noqa: TID251
403
+ maxsize=maxsize,
404
+ )
405
+ return cast(Any, wrapper) # type: ignore[no-any-return]
406
+
407
+
408
+ def json_safe(data: object) -> object:
409
+ """Translates a mapping / sequence recursively in the same fashion
410
+ as `pydantic` v2's `model_dump(mode="json")`.
411
+ """
412
+ if is_mapping(data):
413
+ return {json_safe(key): json_safe(value) for key, value in data.items()}
414
+
415
+ if is_iterable(data) and not isinstance(data, (str, bytes, bytearray)):
416
+ return [json_safe(item) for item in data]
417
+
418
+ if isinstance(data, (datetime, date)):
419
+ return data.isoformat()
420
+
421
+ return data
perplexity/_version.py ADDED
@@ -0,0 +1,4 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ __title__ = "perplexity"
4
+ __version__ = "0.3.0" # x-release-please-version
perplexity/lib/.keep ADDED
@@ -0,0 +1,4 @@
1
+ File generated from our OpenAPI spec by Stainless.
2
+
3
+ This directory can be used to store custom files to expand the SDK.
4
+ It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.
perplexity/py.typed ADDED
File without changes
@@ -0,0 +1,19 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .search import (
4
+ SearchResource,
5
+ AsyncSearchResource,
6
+ SearchResourceWithRawResponse,
7
+ AsyncSearchResourceWithRawResponse,
8
+ SearchResourceWithStreamingResponse,
9
+ AsyncSearchResourceWithStreamingResponse,
10
+ )
11
+
12
+ __all__ = [
13
+ "SearchResource",
14
+ "AsyncSearchResource",
15
+ "SearchResourceWithRawResponse",
16
+ "AsyncSearchResourceWithRawResponse",
17
+ "SearchResourceWithStreamingResponse",
18
+ "AsyncSearchResourceWithStreamingResponse",
19
+ ]
@@ -0,0 +1,220 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union, Optional
6
+ from typing_extensions import Literal
7
+
8
+ import httpx
9
+
10
+ from ..types import search_perform_params
11
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
12
+ from .._utils import maybe_transform, async_maybe_transform
13
+ from .._compat import cached_property
14
+ from .._resource import SyncAPIResource, AsyncAPIResource
15
+ from .._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from .._base_client import make_request_options
22
+ from ..types.search_perform_response import SearchPerformResponse
23
+
24
+ __all__ = ["SearchResource", "AsyncSearchResource"]
25
+
26
+
27
+ class SearchResource(SyncAPIResource):
28
+ @cached_property
29
+ def with_raw_response(self) -> SearchResourceWithRawResponse:
30
+ """
31
+ This property can be used as a prefix for any HTTP method call to return
32
+ the raw response object instead of the parsed content.
33
+
34
+ For more information, see https://www.github.com/ppl-ai/perplexity-py#accessing-raw-response-data-eg-headers
35
+ """
36
+ return SearchResourceWithRawResponse(self)
37
+
38
+ @cached_property
39
+ def with_streaming_response(self) -> SearchResourceWithStreamingResponse:
40
+ """
41
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
42
+
43
+ For more information, see https://www.github.com/ppl-ai/perplexity-py#with_streaming_response
44
+ """
45
+ return SearchResourceWithStreamingResponse(self)
46
+
47
+ def perform(
48
+ self,
49
+ *,
50
+ query: Union[str, SequenceNotStr[str]],
51
+ country: Optional[str] | NotGiven = NOT_GIVEN,
52
+ last_updated_after_filter: Optional[str] | NotGiven = NOT_GIVEN,
53
+ last_updated_before_filter: Optional[str] | NotGiven = NOT_GIVEN,
54
+ max_results: int | NotGiven = NOT_GIVEN,
55
+ max_tokens: int | NotGiven = NOT_GIVEN,
56
+ safe_search: Optional[bool] | NotGiven = NOT_GIVEN,
57
+ search_after_date_filter: Optional[str] | NotGiven = NOT_GIVEN,
58
+ search_before_date_filter: Optional[str] | NotGiven = NOT_GIVEN,
59
+ search_domain_filter: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
60
+ search_mode: Optional[Literal["web", "academic", "sec"]] | NotGiven = NOT_GIVEN,
61
+ search_recency_filter: Optional[Literal["hour", "day", "week", "month", "year"]] | NotGiven = NOT_GIVEN,
62
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
63
+ # The extra values given here take precedence over values defined on the client or passed to this method.
64
+ extra_headers: Headers | None = None,
65
+ extra_query: Query | None = None,
66
+ extra_body: Body | None = None,
67
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
68
+ ) -> SearchPerformResponse:
69
+ """
70
+ Search
71
+
72
+ Args:
73
+ extra_headers: Send extra headers
74
+
75
+ extra_query: Add additional query parameters to the request
76
+
77
+ extra_body: Add additional JSON properties to the request
78
+
79
+ timeout: Override the client-level default timeout for this request, in seconds
80
+ """
81
+ return self._post(
82
+ "/search",
83
+ body=maybe_transform(
84
+ {
85
+ "query": query,
86
+ "country": country,
87
+ "last_updated_after_filter": last_updated_after_filter,
88
+ "last_updated_before_filter": last_updated_before_filter,
89
+ "max_results": max_results,
90
+ "max_tokens": max_tokens,
91
+ "safe_search": safe_search,
92
+ "search_after_date_filter": search_after_date_filter,
93
+ "search_before_date_filter": search_before_date_filter,
94
+ "search_domain_filter": search_domain_filter,
95
+ "search_mode": search_mode,
96
+ "search_recency_filter": search_recency_filter,
97
+ },
98
+ search_perform_params.SearchPerformParams,
99
+ ),
100
+ options=make_request_options(
101
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
102
+ ),
103
+ cast_to=SearchPerformResponse,
104
+ )
105
+
106
+
107
+ class AsyncSearchResource(AsyncAPIResource):
108
+ @cached_property
109
+ def with_raw_response(self) -> AsyncSearchResourceWithRawResponse:
110
+ """
111
+ This property can be used as a prefix for any HTTP method call to return
112
+ the raw response object instead of the parsed content.
113
+
114
+ For more information, see https://www.github.com/ppl-ai/perplexity-py#accessing-raw-response-data-eg-headers
115
+ """
116
+ return AsyncSearchResourceWithRawResponse(self)
117
+
118
+ @cached_property
119
+ def with_streaming_response(self) -> AsyncSearchResourceWithStreamingResponse:
120
+ """
121
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
122
+
123
+ For more information, see https://www.github.com/ppl-ai/perplexity-py#with_streaming_response
124
+ """
125
+ return AsyncSearchResourceWithStreamingResponse(self)
126
+
127
+ async def perform(
128
+ self,
129
+ *,
130
+ query: Union[str, SequenceNotStr[str]],
131
+ country: Optional[str] | NotGiven = NOT_GIVEN,
132
+ last_updated_after_filter: Optional[str] | NotGiven = NOT_GIVEN,
133
+ last_updated_before_filter: Optional[str] | NotGiven = NOT_GIVEN,
134
+ max_results: int | NotGiven = NOT_GIVEN,
135
+ max_tokens: int | NotGiven = NOT_GIVEN,
136
+ safe_search: Optional[bool] | NotGiven = NOT_GIVEN,
137
+ search_after_date_filter: Optional[str] | NotGiven = NOT_GIVEN,
138
+ search_before_date_filter: Optional[str] | NotGiven = NOT_GIVEN,
139
+ search_domain_filter: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
140
+ search_mode: Optional[Literal["web", "academic", "sec"]] | NotGiven = NOT_GIVEN,
141
+ search_recency_filter: Optional[Literal["hour", "day", "week", "month", "year"]] | NotGiven = NOT_GIVEN,
142
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
143
+ # The extra values given here take precedence over values defined on the client or passed to this method.
144
+ extra_headers: Headers | None = None,
145
+ extra_query: Query | None = None,
146
+ extra_body: Body | None = None,
147
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
148
+ ) -> SearchPerformResponse:
149
+ """
150
+ Search
151
+
152
+ Args:
153
+ extra_headers: Send extra headers
154
+
155
+ extra_query: Add additional query parameters to the request
156
+
157
+ extra_body: Add additional JSON properties to the request
158
+
159
+ timeout: Override the client-level default timeout for this request, in seconds
160
+ """
161
+ return await self._post(
162
+ "/search",
163
+ body=await async_maybe_transform(
164
+ {
165
+ "query": query,
166
+ "country": country,
167
+ "last_updated_after_filter": last_updated_after_filter,
168
+ "last_updated_before_filter": last_updated_before_filter,
169
+ "max_results": max_results,
170
+ "max_tokens": max_tokens,
171
+ "safe_search": safe_search,
172
+ "search_after_date_filter": search_after_date_filter,
173
+ "search_before_date_filter": search_before_date_filter,
174
+ "search_domain_filter": search_domain_filter,
175
+ "search_mode": search_mode,
176
+ "search_recency_filter": search_recency_filter,
177
+ },
178
+ search_perform_params.SearchPerformParams,
179
+ ),
180
+ options=make_request_options(
181
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
182
+ ),
183
+ cast_to=SearchPerformResponse,
184
+ )
185
+
186
+
187
+ class SearchResourceWithRawResponse:
188
+ def __init__(self, search: SearchResource) -> None:
189
+ self._search = search
190
+
191
+ self.perform = to_raw_response_wrapper(
192
+ search.perform,
193
+ )
194
+
195
+
196
+ class AsyncSearchResourceWithRawResponse:
197
+ def __init__(self, search: AsyncSearchResource) -> None:
198
+ self._search = search
199
+
200
+ self.perform = async_to_raw_response_wrapper(
201
+ search.perform,
202
+ )
203
+
204
+
205
+ class SearchResourceWithStreamingResponse:
206
+ def __init__(self, search: SearchResource) -> None:
207
+ self._search = search
208
+
209
+ self.perform = to_streamed_response_wrapper(
210
+ search.perform,
211
+ )
212
+
213
+
214
+ class AsyncSearchResourceWithStreamingResponse:
215
+ def __init__(self, search: AsyncSearchResource) -> None:
216
+ self._search = search
217
+
218
+ self.perform = async_to_streamed_response_wrapper(
219
+ search.perform,
220
+ )
@@ -0,0 +1,6 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .search_perform_params import SearchPerformParams as SearchPerformParams
6
+ from .search_perform_response import SearchPerformResponse as SearchPerformResponse