redpine-sdk 0.1.5__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.
- redpine/__init__.py +33 -0
- redpine/_generated/__init__.py +8 -0
- redpine/_generated/api/__init__.py +1 -0
- redpine/_generated/api/search/__init__.py +1 -0
- redpine/_generated/api/search/get_cached_result.py +199 -0
- redpine/_generated/api/search/get_quota.py +142 -0
- redpine/_generated/api/search/list_collections.py +152 -0
- redpine/_generated/api/search/search_assisted.py +222 -0
- redpine/_generated/api/search/search_collection.py +231 -0
- redpine/_generated/api/search/search_preview.py +235 -0
- redpine/_generated/api/search/search_query.py +215 -0
- redpine/_generated/api/search/search_unlock.py +212 -0
- redpine/_generated/client.py +272 -0
- redpine/_generated/errors.py +16 -0
- redpine/_generated/models/__init__.py +69 -0
- redpine/_generated/models/assisted_billing_info.py +71 -0
- redpine/_generated/models/assisted_search_request.py +226 -0
- redpine/_generated/models/assisted_search_request_filters_type_0.py +48 -0
- redpine/_generated/models/assisted_search_response.py +265 -0
- redpine/_generated/models/assisted_search_response_status.py +10 -0
- redpine/_generated/models/assisted_search_result.py +187 -0
- redpine/_generated/models/assisted_search_result_metadata_type_0.py +48 -0
- redpine/_generated/models/clarification_info.py +73 -0
- redpine/_generated/models/collections_response.py +86 -0
- redpine/_generated/models/collections_response_collections_item.py +70 -0
- redpine/_generated/models/error.py +68 -0
- redpine/_generated/models/error_error.py +81 -0
- redpine/_generated/models/filter_warning.py +78 -0
- redpine/_generated/models/journal_metric_expansion.py +99 -0
- redpine/_generated/models/preview_result.py +182 -0
- redpine/_generated/models/preview_result_metadata_type_0.py +51 -0
- redpine/_generated/models/preview_unlock_response.py +213 -0
- redpine/_generated/models/query_understanding.py +111 -0
- redpine/_generated/models/query_understanding_filters.py +52 -0
- redpine/_generated/models/quota_info.py +102 -0
- redpine/_generated/models/relevance_info.py +85 -0
- redpine/_generated/models/search_collection_body.py +165 -0
- redpine/_generated/models/search_collection_body_filters_type_0.py +74 -0
- redpine/_generated/models/search_preview_request.py +192 -0
- redpine/_generated/models/search_preview_request_filters_type_0.py +74 -0
- redpine/_generated/models/search_request.py +236 -0
- redpine/_generated/models/search_request_filters_type_0.py +74 -0
- redpine/_generated/models/search_response.py +190 -0
- redpine/_generated/models/search_result.py +132 -0
- redpine/_generated/models/search_result_metadata_type_0.py +48 -0
- redpine/_generated/models/search_results_preview_response.py +189 -0
- redpine/_generated/models/unlock_request.py +96 -0
- redpine/_generated/types.py +54 -0
- redpine/_retry.py +28 -0
- redpine/client.py +423 -0
- redpine/errors.py +131 -0
- redpine/filters.py +101 -0
- redpine/py.typed +0 -0
- redpine_sdk-0.1.5.dist-info/METADATA +47 -0
- redpine_sdk-0.1.5.dist-info/RECORD +56 -0
- redpine_sdk-0.1.5.dist-info/WHEEL +4 -0
redpine/__init__.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Redpine SDK — Python client for the Redpine search API."""
|
|
2
|
+
|
|
3
|
+
from .client import AsyncRedpine, Redpine
|
|
4
|
+
from .errors import (
|
|
5
|
+
AccessDenied,
|
|
6
|
+
AssistedUnavailable,
|
|
7
|
+
AuthError,
|
|
8
|
+
Expired,
|
|
9
|
+
InsufficientCredits,
|
|
10
|
+
NotFound,
|
|
11
|
+
QuotaExceeded,
|
|
12
|
+
RedpineError,
|
|
13
|
+
ValidationError,
|
|
14
|
+
)
|
|
15
|
+
from .filters import F, Field, Filter
|
|
16
|
+
|
|
17
|
+
__version__ = "0.1.5"
|
|
18
|
+
__all__ = [
|
|
19
|
+
"AccessDenied",
|
|
20
|
+
"AssistedUnavailable",
|
|
21
|
+
"AsyncRedpine",
|
|
22
|
+
"AuthError",
|
|
23
|
+
"Expired",
|
|
24
|
+
"F",
|
|
25
|
+
"Field",
|
|
26
|
+
"Filter",
|
|
27
|
+
"InsufficientCredits",
|
|
28
|
+
"NotFound",
|
|
29
|
+
"QuotaExceeded",
|
|
30
|
+
"Redpine",
|
|
31
|
+
"RedpineError",
|
|
32
|
+
"ValidationError",
|
|
33
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains methods for accessing the API"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.error import Error
|
|
10
|
+
from ...models.search_results_preview_response import SearchResultsPreviewResponse
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
query_id: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "get",
|
|
20
|
+
"url": "/api/v1/search/results/{query_id}".format(
|
|
21
|
+
query_id=quote(str(query_id), safe=""),
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return _kwargs
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _parse_response(
|
|
29
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
30
|
+
) -> Error | SearchResultsPreviewResponse | None:
|
|
31
|
+
if response.status_code == 200:
|
|
32
|
+
response_200 = SearchResultsPreviewResponse.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_200
|
|
35
|
+
|
|
36
|
+
if response.status_code == 401:
|
|
37
|
+
response_401 = Error.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_401
|
|
40
|
+
|
|
41
|
+
if response.status_code == 404:
|
|
42
|
+
response_404 = Error.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_404
|
|
45
|
+
|
|
46
|
+
if response.status_code == 410:
|
|
47
|
+
response_410 = Error.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_410
|
|
50
|
+
|
|
51
|
+
if client.raise_on_unexpected_status:
|
|
52
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
53
|
+
else:
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _build_response(
|
|
58
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
59
|
+
) -> Response[Error | SearchResultsPreviewResponse]:
|
|
60
|
+
return Response(
|
|
61
|
+
status_code=HTTPStatus(response.status_code),
|
|
62
|
+
content=response.content,
|
|
63
|
+
headers=response.headers,
|
|
64
|
+
parsed=_parse_response(client=client, response=response),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def sync_detailed(
|
|
69
|
+
query_id: str,
|
|
70
|
+
*,
|
|
71
|
+
client: AuthenticatedClient | Client,
|
|
72
|
+
) -> Response[Error | SearchResultsPreviewResponse]:
|
|
73
|
+
"""Re-fetch cached results
|
|
74
|
+
|
|
75
|
+
Retrieve previously returned search results using the queryId from a prior search response. Returns
|
|
76
|
+
the same results without billing. The request must use the same API key that performed the original
|
|
77
|
+
search. Results are available for 7 days.
|
|
78
|
+
|
|
79
|
+
Each result carries `locked`/`tokens`/`cost`: a result not yet paid for through POST
|
|
80
|
+
/api/v1/search/unlock comes back as a teaser (`locked: true`), never the full text.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
query_id (str):
|
|
84
|
+
|
|
85
|
+
Raises:
|
|
86
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
87
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
Response[Error | SearchResultsPreviewResponse]
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
kwargs = _get_kwargs(
|
|
94
|
+
query_id=query_id,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
response = client.get_httpx_client().request(
|
|
98
|
+
**kwargs,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
return _build_response(client=client, response=response)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def sync(
|
|
105
|
+
query_id: str,
|
|
106
|
+
*,
|
|
107
|
+
client: AuthenticatedClient | Client,
|
|
108
|
+
) -> Error | SearchResultsPreviewResponse | None:
|
|
109
|
+
"""Re-fetch cached results
|
|
110
|
+
|
|
111
|
+
Retrieve previously returned search results using the queryId from a prior search response. Returns
|
|
112
|
+
the same results without billing. The request must use the same API key that performed the original
|
|
113
|
+
search. Results are available for 7 days.
|
|
114
|
+
|
|
115
|
+
Each result carries `locked`/`tokens`/`cost`: a result not yet paid for through POST
|
|
116
|
+
/api/v1/search/unlock comes back as a teaser (`locked: true`), never the full text.
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
query_id (str):
|
|
120
|
+
|
|
121
|
+
Raises:
|
|
122
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
123
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
124
|
+
|
|
125
|
+
Returns:
|
|
126
|
+
Error | SearchResultsPreviewResponse
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
return sync_detailed(
|
|
130
|
+
query_id=query_id,
|
|
131
|
+
client=client,
|
|
132
|
+
).parsed
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
async def asyncio_detailed(
|
|
136
|
+
query_id: str,
|
|
137
|
+
*,
|
|
138
|
+
client: AuthenticatedClient | Client,
|
|
139
|
+
) -> Response[Error | SearchResultsPreviewResponse]:
|
|
140
|
+
"""Re-fetch cached results
|
|
141
|
+
|
|
142
|
+
Retrieve previously returned search results using the queryId from a prior search response. Returns
|
|
143
|
+
the same results without billing. The request must use the same API key that performed the original
|
|
144
|
+
search. Results are available for 7 days.
|
|
145
|
+
|
|
146
|
+
Each result carries `locked`/`tokens`/`cost`: a result not yet paid for through POST
|
|
147
|
+
/api/v1/search/unlock comes back as a teaser (`locked: true`), never the full text.
|
|
148
|
+
|
|
149
|
+
Args:
|
|
150
|
+
query_id (str):
|
|
151
|
+
|
|
152
|
+
Raises:
|
|
153
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
154
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
Response[Error | SearchResultsPreviewResponse]
|
|
158
|
+
"""
|
|
159
|
+
|
|
160
|
+
kwargs = _get_kwargs(
|
|
161
|
+
query_id=query_id,
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
165
|
+
|
|
166
|
+
return _build_response(client=client, response=response)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
async def asyncio(
|
|
170
|
+
query_id: str,
|
|
171
|
+
*,
|
|
172
|
+
client: AuthenticatedClient | Client,
|
|
173
|
+
) -> Error | SearchResultsPreviewResponse | None:
|
|
174
|
+
"""Re-fetch cached results
|
|
175
|
+
|
|
176
|
+
Retrieve previously returned search results using the queryId from a prior search response. Returns
|
|
177
|
+
the same results without billing. The request must use the same API key that performed the original
|
|
178
|
+
search. Results are available for 7 days.
|
|
179
|
+
|
|
180
|
+
Each result carries `locked`/`tokens`/`cost`: a result not yet paid for through POST
|
|
181
|
+
/api/v1/search/unlock comes back as a teaser (`locked: true`), never the full text.
|
|
182
|
+
|
|
183
|
+
Args:
|
|
184
|
+
query_id (str):
|
|
185
|
+
|
|
186
|
+
Raises:
|
|
187
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
188
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
189
|
+
|
|
190
|
+
Returns:
|
|
191
|
+
Error | SearchResultsPreviewResponse
|
|
192
|
+
"""
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
await asyncio_detailed(
|
|
196
|
+
query_id=query_id,
|
|
197
|
+
client=client,
|
|
198
|
+
)
|
|
199
|
+
).parsed
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.error import Error
|
|
9
|
+
from ...models.quota_info import QuotaInfo
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
14
|
+
|
|
15
|
+
_kwargs: dict[str, Any] = {
|
|
16
|
+
"method": "get",
|
|
17
|
+
"url": "/api/v1/search/quota",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return _kwargs
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _parse_response(
|
|
24
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
25
|
+
) -> Error | QuotaInfo | None:
|
|
26
|
+
if response.status_code == 200:
|
|
27
|
+
response_200 = QuotaInfo.from_dict(response.json())
|
|
28
|
+
|
|
29
|
+
return response_200
|
|
30
|
+
|
|
31
|
+
if response.status_code == 401:
|
|
32
|
+
response_401 = Error.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_401
|
|
35
|
+
|
|
36
|
+
if client.raise_on_unexpected_status:
|
|
37
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
38
|
+
else:
|
|
39
|
+
return None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _build_response(
|
|
43
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
44
|
+
) -> Response[Error | QuotaInfo]:
|
|
45
|
+
return Response(
|
|
46
|
+
status_code=HTTPStatus(response.status_code),
|
|
47
|
+
content=response.content,
|
|
48
|
+
headers=response.headers,
|
|
49
|
+
parsed=_parse_response(client=client, response=response),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def sync_detailed(
|
|
54
|
+
*,
|
|
55
|
+
client: AuthenticatedClient | Client,
|
|
56
|
+
) -> Response[Error | QuotaInfo]:
|
|
57
|
+
"""Current quota usage and limits
|
|
58
|
+
|
|
59
|
+
Daily and monthly query usage and limits for the authenticated organization.
|
|
60
|
+
|
|
61
|
+
Raises:
|
|
62
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
63
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
Response[Error | QuotaInfo]
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
kwargs = _get_kwargs()
|
|
70
|
+
|
|
71
|
+
response = client.get_httpx_client().request(
|
|
72
|
+
**kwargs,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
return _build_response(client=client, response=response)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def sync(
|
|
79
|
+
*,
|
|
80
|
+
client: AuthenticatedClient | Client,
|
|
81
|
+
) -> Error | QuotaInfo | None:
|
|
82
|
+
"""Current quota usage and limits
|
|
83
|
+
|
|
84
|
+
Daily and monthly query usage and limits for the authenticated organization.
|
|
85
|
+
|
|
86
|
+
Raises:
|
|
87
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
88
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
Error | QuotaInfo
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
return sync_detailed(
|
|
95
|
+
client=client,
|
|
96
|
+
).parsed
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
async def asyncio_detailed(
|
|
100
|
+
*,
|
|
101
|
+
client: AuthenticatedClient | Client,
|
|
102
|
+
) -> Response[Error | QuotaInfo]:
|
|
103
|
+
"""Current quota usage and limits
|
|
104
|
+
|
|
105
|
+
Daily and monthly query usage and limits for the authenticated organization.
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
109
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
Response[Error | QuotaInfo]
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
kwargs = _get_kwargs()
|
|
116
|
+
|
|
117
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
118
|
+
|
|
119
|
+
return _build_response(client=client, response=response)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
async def asyncio(
|
|
123
|
+
*,
|
|
124
|
+
client: AuthenticatedClient | Client,
|
|
125
|
+
) -> Error | QuotaInfo | None:
|
|
126
|
+
"""Current quota usage and limits
|
|
127
|
+
|
|
128
|
+
Daily and monthly query usage and limits for the authenticated organization.
|
|
129
|
+
|
|
130
|
+
Raises:
|
|
131
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
132
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
Error | QuotaInfo
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
await asyncio_detailed(
|
|
140
|
+
client=client,
|
|
141
|
+
)
|
|
142
|
+
).parsed
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.collections_response import CollectionsResponse
|
|
9
|
+
from ...models.error import Error
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
14
|
+
|
|
15
|
+
_kwargs: dict[str, Any] = {
|
|
16
|
+
"method": "get",
|
|
17
|
+
"url": "/api/v1/search/collections",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return _kwargs
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _parse_response(
|
|
24
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
25
|
+
) -> CollectionsResponse | Error | None:
|
|
26
|
+
if response.status_code == 200:
|
|
27
|
+
response_200 = CollectionsResponse.from_dict(response.json())
|
|
28
|
+
|
|
29
|
+
return response_200
|
|
30
|
+
|
|
31
|
+
if response.status_code == 401:
|
|
32
|
+
response_401 = Error.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_401
|
|
35
|
+
|
|
36
|
+
if response.status_code == 403:
|
|
37
|
+
response_403 = Error.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_403
|
|
40
|
+
|
|
41
|
+
if response.status_code == 429:
|
|
42
|
+
response_429 = Error.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_429
|
|
45
|
+
|
|
46
|
+
if client.raise_on_unexpected_status:
|
|
47
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
48
|
+
else:
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _build_response(
|
|
53
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
54
|
+
) -> Response[CollectionsResponse | Error]:
|
|
55
|
+
return Response(
|
|
56
|
+
status_code=HTTPStatus(response.status_code),
|
|
57
|
+
content=response.content,
|
|
58
|
+
headers=response.headers,
|
|
59
|
+
parsed=_parse_response(client=client, response=response),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def sync_detailed(
|
|
64
|
+
*,
|
|
65
|
+
client: AuthenticatedClient | Client,
|
|
66
|
+
) -> Response[CollectionsResponse | Error]:
|
|
67
|
+
"""List collections
|
|
68
|
+
|
|
69
|
+
List all document collections accessible to the authenticated API key.
|
|
70
|
+
|
|
71
|
+
Raises:
|
|
72
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
73
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
Response[CollectionsResponse | Error]
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
kwargs = _get_kwargs()
|
|
80
|
+
|
|
81
|
+
response = client.get_httpx_client().request(
|
|
82
|
+
**kwargs,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return _build_response(client=client, response=response)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def sync(
|
|
89
|
+
*,
|
|
90
|
+
client: AuthenticatedClient | Client,
|
|
91
|
+
) -> CollectionsResponse | Error | None:
|
|
92
|
+
"""List collections
|
|
93
|
+
|
|
94
|
+
List all document collections accessible to the authenticated API key.
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
98
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
CollectionsResponse | Error
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
return sync_detailed(
|
|
105
|
+
client=client,
|
|
106
|
+
).parsed
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
async def asyncio_detailed(
|
|
110
|
+
*,
|
|
111
|
+
client: AuthenticatedClient | Client,
|
|
112
|
+
) -> Response[CollectionsResponse | Error]:
|
|
113
|
+
"""List collections
|
|
114
|
+
|
|
115
|
+
List all document collections accessible to the authenticated API key.
|
|
116
|
+
|
|
117
|
+
Raises:
|
|
118
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
119
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
Response[CollectionsResponse | Error]
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
kwargs = _get_kwargs()
|
|
126
|
+
|
|
127
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
128
|
+
|
|
129
|
+
return _build_response(client=client, response=response)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
async def asyncio(
|
|
133
|
+
*,
|
|
134
|
+
client: AuthenticatedClient | Client,
|
|
135
|
+
) -> CollectionsResponse | Error | None:
|
|
136
|
+
"""List collections
|
|
137
|
+
|
|
138
|
+
List all document collections accessible to the authenticated API key.
|
|
139
|
+
|
|
140
|
+
Raises:
|
|
141
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
142
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
CollectionsResponse | Error
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
await asyncio_detailed(
|
|
150
|
+
client=client,
|
|
151
|
+
)
|
|
152
|
+
).parsed
|