athena-intelligence 0.1.82__py3-none-any.whl → 0.1.84__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.
- athena/base_client.py +40 -18
- athena/chain/client.py +85 -36
- athena/client.py +91 -4
- athena/core/__init__.py +4 -1
- athena/core/client_wrapper.py +1 -1
- athena/core/pydantic_utilities.py +16 -0
- athena/core/query_encoder.py +33 -0
- athena/dataset/client.py +59 -32
- athena/message/client.py +77 -32
- athena/query/client.py +37 -14
- athena/report/client.py +37 -14
- athena/search/client.py +45 -22
- athena/snippet/client.py +93 -44
- athena/tools/client.py +357 -174
- athena/types/convert_pdf_to_sheet_out.py +7 -3
- athena/types/data_frame_parsing_error.py +7 -3
- athena/types/data_frame_request_out.py +7 -3
- athena/types/data_frame_unknown_format_error.py +7 -3
- athena/types/dataset.py +7 -3
- athena/types/document.py +7 -3
- athena/types/excecute_tool_first_workflow_out.py +7 -3
- athena/types/file_data_response.py +7 -3
- athena/types/file_fetch_error.py +7 -3
- athena/types/filter_model.py +7 -3
- athena/types/firecrawl_scrape_url_data_reponse_dto.py +7 -3
- athena/types/firecrawl_scrape_url_metadata.py +7 -3
- athena/types/get_datasets_response.py +7 -3
- athena/types/get_snippet_out.py +7 -3
- athena/types/get_snippets_response.py +7 -3
- athena/types/http_validation_error.py +7 -3
- athena/types/langchain_documents_request_out.py +7 -3
- athena/types/map_reduce_chain_out.py +7 -3
- athena/types/message_out.py +7 -3
- athena/types/message_out_dto.py +7 -3
- athena/types/publish_formats.py +7 -3
- athena/types/query_model.py +7 -3
- athena/types/report.py +7 -3
- athena/types/researcher_out.py +7 -3
- athena/types/semantic_query_out.py +7 -3
- athena/types/snippet.py +7 -3
- athena/types/sql_results.py +7 -3
- athena/types/structured_parse_result.py +7 -3
- athena/types/time_dimension_model.py +7 -3
- athena/types/upload_documents_out.py +7 -3
- athena/types/url_result.py +7 -3
- athena/types/validation_error.py +7 -3
- athena/types/workflow_status_out.py +7 -3
- athena/upload/client.py +37 -12
- athena/workflow/client.py +35 -12
- {athena_intelligence-0.1.82.dist-info → athena_intelligence-0.1.84.dist-info}/METADATA +12 -2
- athena_intelligence-0.1.84.dist-info/RECORD +91 -0
- athena_intelligence-0.1.82.dist-info/RECORD +0 -90
- {athena_intelligence-0.1.82.dist-info → athena_intelligence-0.1.84.dist-info}/WHEEL +0 -0
athena/message/client.py
CHANGED
@@ -8,6 +8,7 @@ from ..core.api_error import ApiError
|
|
8
8
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
9
|
from ..core.jsonable_encoder import jsonable_encoder
|
10
10
|
from ..core.pydantic_utilities import pydantic_v1
|
11
|
+
from ..core.query_encoder import encode_query
|
11
12
|
from ..core.remove_none_from_dict import remove_none_from_dict
|
12
13
|
from ..core.request_options import RequestOptions
|
13
14
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
@@ -36,19 +37,28 @@ class MessageClient:
|
|
36
37
|
request_options: typing.Optional[RequestOptions] = None,
|
37
38
|
) -> MessageOut:
|
38
39
|
"""
|
39
|
-
Parameters
|
40
|
-
|
40
|
+
Parameters
|
41
|
+
----------
|
42
|
+
content : str
|
41
43
|
|
42
|
-
|
44
|
+
model : typing.Optional[Model]
|
43
45
|
|
44
|
-
|
46
|
+
tools : typing.Optional[typing.Sequence[Tools]]
|
45
47
|
|
46
|
-
|
48
|
+
conversation_id : typing.Optional[str]
|
47
49
|
|
48
|
-
|
50
|
+
conversation_name : typing.Optional[str]
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
+
request_options : typing.Optional[RequestOptions]
|
53
|
+
Request-specific configuration.
|
54
|
+
|
55
|
+
Returns
|
56
|
+
-------
|
57
|
+
MessageOut
|
58
|
+
Successful Response
|
59
|
+
|
60
|
+
Examples
|
61
|
+
--------
|
52
62
|
from athena import Model, Tools
|
53
63
|
from athena.client import Athena
|
54
64
|
|
@@ -73,8 +83,10 @@ class MessageClient:
|
|
73
83
|
_response = self._client_wrapper.httpx_client.request(
|
74
84
|
method="POST",
|
75
85
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/message"),
|
76
|
-
params=
|
77
|
-
|
86
|
+
params=encode_query(
|
87
|
+
jsonable_encoder(
|
88
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
89
|
+
)
|
78
90
|
),
|
79
91
|
json=jsonable_encoder(_request)
|
80
92
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -110,11 +122,20 @@ class MessageClient:
|
|
110
122
|
|
111
123
|
def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> MessageOutDto:
|
112
124
|
"""
|
113
|
-
Parameters
|
114
|
-
|
125
|
+
Parameters
|
126
|
+
----------
|
127
|
+
id : str
|
115
128
|
|
116
|
-
|
117
|
-
|
129
|
+
request_options : typing.Optional[RequestOptions]
|
130
|
+
Request-specific configuration.
|
131
|
+
|
132
|
+
Returns
|
133
|
+
-------
|
134
|
+
MessageOutDto
|
135
|
+
Successful Response
|
136
|
+
|
137
|
+
Examples
|
138
|
+
--------
|
118
139
|
from athena.client import Athena
|
119
140
|
|
120
141
|
client = Athena(
|
@@ -129,8 +150,10 @@ class MessageClient:
|
|
129
150
|
url=urllib.parse.urljoin(
|
130
151
|
f"{self._client_wrapper.get_base_url()}/", f"api/v0/message/{jsonable_encoder(id)}"
|
131
152
|
),
|
132
|
-
params=
|
133
|
-
|
153
|
+
params=encode_query(
|
154
|
+
jsonable_encoder(
|
155
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
156
|
+
)
|
134
157
|
),
|
135
158
|
headers=jsonable_encoder(
|
136
159
|
remove_none_from_dict(
|
@@ -174,19 +197,28 @@ class AsyncMessageClient:
|
|
174
197
|
request_options: typing.Optional[RequestOptions] = None,
|
175
198
|
) -> MessageOut:
|
176
199
|
"""
|
177
|
-
Parameters
|
178
|
-
|
200
|
+
Parameters
|
201
|
+
----------
|
202
|
+
content : str
|
179
203
|
|
180
|
-
|
204
|
+
model : typing.Optional[Model]
|
181
205
|
|
182
|
-
|
206
|
+
tools : typing.Optional[typing.Sequence[Tools]]
|
183
207
|
|
184
|
-
|
208
|
+
conversation_id : typing.Optional[str]
|
185
209
|
|
186
|
-
|
210
|
+
conversation_name : typing.Optional[str]
|
187
211
|
|
188
|
-
|
189
|
-
|
212
|
+
request_options : typing.Optional[RequestOptions]
|
213
|
+
Request-specific configuration.
|
214
|
+
|
215
|
+
Returns
|
216
|
+
-------
|
217
|
+
MessageOut
|
218
|
+
Successful Response
|
219
|
+
|
220
|
+
Examples
|
221
|
+
--------
|
190
222
|
from athena import Model, Tools
|
191
223
|
from athena.client import AsyncAthena
|
192
224
|
|
@@ -211,8 +243,10 @@ class AsyncMessageClient:
|
|
211
243
|
_response = await self._client_wrapper.httpx_client.request(
|
212
244
|
method="POST",
|
213
245
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/message"),
|
214
|
-
params=
|
215
|
-
|
246
|
+
params=encode_query(
|
247
|
+
jsonable_encoder(
|
248
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
249
|
+
)
|
216
250
|
),
|
217
251
|
json=jsonable_encoder(_request)
|
218
252
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -248,11 +282,20 @@ class AsyncMessageClient:
|
|
248
282
|
|
249
283
|
async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> MessageOutDto:
|
250
284
|
"""
|
251
|
-
Parameters
|
252
|
-
|
285
|
+
Parameters
|
286
|
+
----------
|
287
|
+
id : str
|
253
288
|
|
254
|
-
|
255
|
-
|
289
|
+
request_options : typing.Optional[RequestOptions]
|
290
|
+
Request-specific configuration.
|
291
|
+
|
292
|
+
Returns
|
293
|
+
-------
|
294
|
+
MessageOutDto
|
295
|
+
Successful Response
|
296
|
+
|
297
|
+
Examples
|
298
|
+
--------
|
256
299
|
from athena.client import AsyncAthena
|
257
300
|
|
258
301
|
client = AsyncAthena(
|
@@ -267,8 +310,10 @@ class AsyncMessageClient:
|
|
267
310
|
url=urllib.parse.urljoin(
|
268
311
|
f"{self._client_wrapper.get_base_url()}/", f"api/v0/message/{jsonable_encoder(id)}"
|
269
312
|
),
|
270
|
-
params=
|
271
|
-
|
313
|
+
params=encode_query(
|
314
|
+
jsonable_encoder(
|
315
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
316
|
+
)
|
272
317
|
),
|
273
318
|
headers=jsonable_encoder(
|
274
319
|
remove_none_from_dict(
|
athena/query/client.py
CHANGED
@@ -8,6 +8,7 @@ from ..core.api_error import ApiError
|
|
8
8
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
9
|
from ..core.jsonable_encoder import jsonable_encoder
|
10
10
|
from ..core.pydantic_utilities import pydantic_v1
|
11
|
+
from ..core.query_encoder import encode_query
|
11
12
|
from ..core.remove_none_from_dict import remove_none_from_dict
|
12
13
|
from ..core.request_options import RequestOptions
|
13
14
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
@@ -26,13 +27,22 @@ class QueryClient:
|
|
26
27
|
self, *, sql_command: str, database_id: int, request_options: typing.Optional[RequestOptions] = None
|
27
28
|
) -> SqlResults:
|
28
29
|
"""
|
29
|
-
Parameters
|
30
|
-
|
30
|
+
Parameters
|
31
|
+
----------
|
32
|
+
sql_command : str
|
31
33
|
|
32
|
-
|
34
|
+
database_id : int
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
+
request_options : typing.Optional[RequestOptions]
|
37
|
+
Request-specific configuration.
|
38
|
+
|
39
|
+
Returns
|
40
|
+
-------
|
41
|
+
SqlResults
|
42
|
+
Successful Response
|
43
|
+
|
44
|
+
Examples
|
45
|
+
--------
|
36
46
|
from athena.client import Athena
|
37
47
|
|
38
48
|
client = Athena(
|
@@ -46,8 +56,10 @@ class QueryClient:
|
|
46
56
|
_response = self._client_wrapper.httpx_client.request(
|
47
57
|
method="POST",
|
48
58
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/execute-sql"),
|
49
|
-
params=
|
50
|
-
|
59
|
+
params=encode_query(
|
60
|
+
jsonable_encoder(
|
61
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
62
|
+
)
|
51
63
|
),
|
52
64
|
json=jsonable_encoder({"sql_command": sql_command, "database_id": database_id})
|
53
65
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -90,13 +102,22 @@ class AsyncQueryClient:
|
|
90
102
|
self, *, sql_command: str, database_id: int, request_options: typing.Optional[RequestOptions] = None
|
91
103
|
) -> SqlResults:
|
92
104
|
"""
|
93
|
-
Parameters
|
94
|
-
|
105
|
+
Parameters
|
106
|
+
----------
|
107
|
+
sql_command : str
|
95
108
|
|
96
|
-
|
109
|
+
database_id : int
|
97
110
|
|
98
|
-
|
99
|
-
|
111
|
+
request_options : typing.Optional[RequestOptions]
|
112
|
+
Request-specific configuration.
|
113
|
+
|
114
|
+
Returns
|
115
|
+
-------
|
116
|
+
SqlResults
|
117
|
+
Successful Response
|
118
|
+
|
119
|
+
Examples
|
120
|
+
--------
|
100
121
|
from athena.client import AsyncAthena
|
101
122
|
|
102
123
|
client = AsyncAthena(
|
@@ -110,8 +131,10 @@ class AsyncQueryClient:
|
|
110
131
|
_response = await self._client_wrapper.httpx_client.request(
|
111
132
|
method="POST",
|
112
133
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/execute-sql"),
|
113
|
-
params=
|
114
|
-
|
134
|
+
params=encode_query(
|
135
|
+
jsonable_encoder(
|
136
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
137
|
+
)
|
115
138
|
),
|
116
139
|
json=jsonable_encoder({"sql_command": sql_command, "database_id": database_id})
|
117
140
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
athena/report/client.py
CHANGED
@@ -8,6 +8,7 @@ from ..core.api_error import ApiError
|
|
8
8
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
9
|
from ..core.jsonable_encoder import jsonable_encoder
|
10
10
|
from ..core.pydantic_utilities import pydantic_v1
|
11
|
+
from ..core.query_encoder import encode_query
|
11
12
|
from ..core.remove_none_from_dict import remove_none_from_dict
|
12
13
|
from ..core.request_options import RequestOptions
|
13
14
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
@@ -30,13 +31,22 @@ class ReportClient:
|
|
30
31
|
request_options: typing.Optional[RequestOptions] = None,
|
31
32
|
) -> Report:
|
32
33
|
"""
|
33
|
-
Parameters
|
34
|
-
|
34
|
+
Parameters
|
35
|
+
----------
|
36
|
+
name : typing.Optional[str]
|
35
37
|
|
36
|
-
|
38
|
+
workspace_access : typing.Optional[bool]
|
37
39
|
|
38
|
-
|
39
|
-
|
40
|
+
request_options : typing.Optional[RequestOptions]
|
41
|
+
Request-specific configuration.
|
42
|
+
|
43
|
+
Returns
|
44
|
+
-------
|
45
|
+
Report
|
46
|
+
Successful Response
|
47
|
+
|
48
|
+
Examples
|
49
|
+
--------
|
40
50
|
from athena.client import Athena
|
41
51
|
|
42
52
|
client = Athena(
|
@@ -52,8 +62,10 @@ class ReportClient:
|
|
52
62
|
_response = self._client_wrapper.httpx_client.request(
|
53
63
|
method="POST",
|
54
64
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/report"),
|
55
|
-
params=
|
56
|
-
|
65
|
+
params=encode_query(
|
66
|
+
jsonable_encoder(
|
67
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
68
|
+
)
|
57
69
|
),
|
58
70
|
json=jsonable_encoder(_request)
|
59
71
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -100,13 +112,22 @@ class AsyncReportClient:
|
|
100
112
|
request_options: typing.Optional[RequestOptions] = None,
|
101
113
|
) -> Report:
|
102
114
|
"""
|
103
|
-
Parameters
|
104
|
-
|
115
|
+
Parameters
|
116
|
+
----------
|
117
|
+
name : typing.Optional[str]
|
105
118
|
|
106
|
-
|
119
|
+
workspace_access : typing.Optional[bool]
|
107
120
|
|
108
|
-
|
109
|
-
|
121
|
+
request_options : typing.Optional[RequestOptions]
|
122
|
+
Request-specific configuration.
|
123
|
+
|
124
|
+
Returns
|
125
|
+
-------
|
126
|
+
Report
|
127
|
+
Successful Response
|
128
|
+
|
129
|
+
Examples
|
130
|
+
--------
|
110
131
|
from athena.client import AsyncAthena
|
111
132
|
|
112
133
|
client = AsyncAthena(
|
@@ -122,8 +143,10 @@ class AsyncReportClient:
|
|
122
143
|
_response = await self._client_wrapper.httpx_client.request(
|
123
144
|
method="POST",
|
124
145
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/report"),
|
125
|
-
params=
|
126
|
-
|
146
|
+
params=encode_query(
|
147
|
+
jsonable_encoder(
|
148
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
149
|
+
)
|
127
150
|
),
|
128
151
|
json=jsonable_encoder(_request)
|
129
152
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
athena/search/client.py
CHANGED
@@ -8,6 +8,7 @@ from ..core.api_error import ApiError
|
|
8
8
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
9
|
from ..core.jsonable_encoder import jsonable_encoder
|
10
10
|
from ..core.pydantic_utilities import pydantic_v1
|
11
|
+
from ..core.query_encoder import encode_query
|
11
12
|
from ..core.remove_none_from_dict import remove_none_from_dict
|
12
13
|
from ..core.request_options import RequestOptions
|
13
14
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
@@ -34,21 +35,30 @@ class SearchClient:
|
|
34
35
|
request_options: typing.Optional[RequestOptions] = None,
|
35
36
|
) -> UrlResult:
|
36
37
|
"""
|
37
|
-
Parameters
|
38
|
-
|
38
|
+
Parameters
|
39
|
+
----------
|
40
|
+
query : str
|
39
41
|
|
40
|
-
|
42
|
+
num_urls : int
|
41
43
|
|
42
|
-
|
44
|
+
tbs : str
|
43
45
|
|
44
|
-
|
46
|
+
country_code : typing.Optional[str]
|
45
47
|
|
46
|
-
|
48
|
+
country_restrict : typing.Optional[str]
|
47
49
|
|
48
|
-
|
50
|
+
site : typing.Optional[str]
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
+
request_options : typing.Optional[RequestOptions]
|
53
|
+
Request-specific configuration.
|
54
|
+
|
55
|
+
Returns
|
56
|
+
-------
|
57
|
+
UrlResult
|
58
|
+
Successful Response
|
59
|
+
|
60
|
+
Examples
|
61
|
+
--------
|
52
62
|
from athena.client import Athena
|
53
63
|
|
54
64
|
client = Athena(
|
@@ -70,8 +80,10 @@ class SearchClient:
|
|
70
80
|
_response = self._client_wrapper.httpx_client.request(
|
71
81
|
method="POST",
|
72
82
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/search/get-urls"),
|
73
|
-
params=
|
74
|
-
|
83
|
+
params=encode_query(
|
84
|
+
jsonable_encoder(
|
85
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
86
|
+
)
|
75
87
|
),
|
76
88
|
json=jsonable_encoder(_request)
|
77
89
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -122,21 +134,30 @@ class AsyncSearchClient:
|
|
122
134
|
request_options: typing.Optional[RequestOptions] = None,
|
123
135
|
) -> UrlResult:
|
124
136
|
"""
|
125
|
-
Parameters
|
126
|
-
|
137
|
+
Parameters
|
138
|
+
----------
|
139
|
+
query : str
|
127
140
|
|
128
|
-
|
141
|
+
num_urls : int
|
129
142
|
|
130
|
-
|
143
|
+
tbs : str
|
131
144
|
|
132
|
-
|
145
|
+
country_code : typing.Optional[str]
|
133
146
|
|
134
|
-
|
147
|
+
country_restrict : typing.Optional[str]
|
135
148
|
|
136
|
-
|
149
|
+
site : typing.Optional[str]
|
137
150
|
|
138
|
-
|
139
|
-
|
151
|
+
request_options : typing.Optional[RequestOptions]
|
152
|
+
Request-specific configuration.
|
153
|
+
|
154
|
+
Returns
|
155
|
+
-------
|
156
|
+
UrlResult
|
157
|
+
Successful Response
|
158
|
+
|
159
|
+
Examples
|
160
|
+
--------
|
140
161
|
from athena.client import AsyncAthena
|
141
162
|
|
142
163
|
client = AsyncAthena(
|
@@ -158,8 +179,10 @@ class AsyncSearchClient:
|
|
158
179
|
_response = await self._client_wrapper.httpx_client.request(
|
159
180
|
method="POST",
|
160
181
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/search/get-urls"),
|
161
|
-
params=
|
162
|
-
|
182
|
+
params=encode_query(
|
183
|
+
jsonable_encoder(
|
184
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
185
|
+
)
|
163
186
|
),
|
164
187
|
json=jsonable_encoder(_request)
|
165
188
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
athena/snippet/client.py
CHANGED
@@ -8,6 +8,7 @@ from ..core.api_error import ApiError
|
|
8
8
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
9
|
from ..core.jsonable_encoder import jsonable_encoder
|
10
10
|
from ..core.pydantic_utilities import pydantic_v1
|
11
|
+
from ..core.query_encoder import encode_query
|
11
12
|
from ..core.remove_none_from_dict import remove_none_from_dict
|
12
13
|
from ..core.request_options import RequestOptions
|
13
14
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
@@ -31,13 +32,24 @@ class SnippetClient:
|
|
31
32
|
request_options: typing.Optional[RequestOptions] = None,
|
32
33
|
) -> GetSnippetsResponse:
|
33
34
|
"""
|
34
|
-
Parameters
|
35
|
-
|
35
|
+
Parameters
|
36
|
+
----------
|
37
|
+
page : typing.Optional[int]
|
38
|
+
Page number starting from 1
|
36
39
|
|
37
|
-
|
40
|
+
page_size : typing.Optional[int]
|
41
|
+
Number of items per page
|
38
42
|
|
39
|
-
|
40
|
-
|
43
|
+
request_options : typing.Optional[RequestOptions]
|
44
|
+
Request-specific configuration.
|
45
|
+
|
46
|
+
Returns
|
47
|
+
-------
|
48
|
+
GetSnippetsResponse
|
49
|
+
Successful Response
|
50
|
+
|
51
|
+
Examples
|
52
|
+
--------
|
41
53
|
from athena.client import Athena
|
42
54
|
|
43
55
|
client = Athena(
|
@@ -48,17 +60,19 @@ class SnippetClient:
|
|
48
60
|
_response = self._client_wrapper.httpx_client.request(
|
49
61
|
method="GET",
|
50
62
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/snippets"),
|
51
|
-
params=
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
63
|
+
params=encode_query(
|
64
|
+
jsonable_encoder(
|
65
|
+
remove_none_from_dict(
|
66
|
+
{
|
67
|
+
"page": page,
|
68
|
+
"page_size": page_size,
|
69
|
+
**(
|
70
|
+
request_options.get("additional_query_parameters", {})
|
71
|
+
if request_options is not None
|
72
|
+
else {}
|
73
|
+
),
|
74
|
+
}
|
75
|
+
)
|
62
76
|
)
|
63
77
|
),
|
64
78
|
headers=jsonable_encoder(
|
@@ -89,11 +103,20 @@ class SnippetClient:
|
|
89
103
|
|
90
104
|
def get_by_id(self, *, id: str, request_options: typing.Optional[RequestOptions] = None) -> GetSnippetOut:
|
91
105
|
"""
|
92
|
-
Parameters
|
93
|
-
|
106
|
+
Parameters
|
107
|
+
----------
|
108
|
+
id : str
|
109
|
+
|
110
|
+
request_options : typing.Optional[RequestOptions]
|
111
|
+
Request-specific configuration.
|
94
112
|
|
95
|
-
|
96
|
-
|
113
|
+
Returns
|
114
|
+
-------
|
115
|
+
GetSnippetOut
|
116
|
+
Successful Response
|
117
|
+
|
118
|
+
Examples
|
119
|
+
--------
|
97
120
|
from athena.client import Athena
|
98
121
|
|
99
122
|
client = Athena(
|
@@ -106,8 +129,10 @@ class SnippetClient:
|
|
106
129
|
_response = self._client_wrapper.httpx_client.request(
|
107
130
|
method="POST",
|
108
131
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/snippet"),
|
109
|
-
params=
|
110
|
-
|
132
|
+
params=encode_query(
|
133
|
+
jsonable_encoder(
|
134
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
135
|
+
)
|
111
136
|
),
|
112
137
|
json=jsonable_encoder({"id": id})
|
113
138
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -154,13 +179,24 @@ class AsyncSnippetClient:
|
|
154
179
|
request_options: typing.Optional[RequestOptions] = None,
|
155
180
|
) -> GetSnippetsResponse:
|
156
181
|
"""
|
157
|
-
Parameters
|
158
|
-
|
182
|
+
Parameters
|
183
|
+
----------
|
184
|
+
page : typing.Optional[int]
|
185
|
+
Page number starting from 1
|
159
186
|
|
160
|
-
|
187
|
+
page_size : typing.Optional[int]
|
188
|
+
Number of items per page
|
161
189
|
|
162
|
-
|
163
|
-
|
190
|
+
request_options : typing.Optional[RequestOptions]
|
191
|
+
Request-specific configuration.
|
192
|
+
|
193
|
+
Returns
|
194
|
+
-------
|
195
|
+
GetSnippetsResponse
|
196
|
+
Successful Response
|
197
|
+
|
198
|
+
Examples
|
199
|
+
--------
|
164
200
|
from athena.client import AsyncAthena
|
165
201
|
|
166
202
|
client = AsyncAthena(
|
@@ -171,17 +207,19 @@ class AsyncSnippetClient:
|
|
171
207
|
_response = await self._client_wrapper.httpx_client.request(
|
172
208
|
method="GET",
|
173
209
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/snippets"),
|
174
|
-
params=
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
210
|
+
params=encode_query(
|
211
|
+
jsonable_encoder(
|
212
|
+
remove_none_from_dict(
|
213
|
+
{
|
214
|
+
"page": page,
|
215
|
+
"page_size": page_size,
|
216
|
+
**(
|
217
|
+
request_options.get("additional_query_parameters", {})
|
218
|
+
if request_options is not None
|
219
|
+
else {}
|
220
|
+
),
|
221
|
+
}
|
222
|
+
)
|
185
223
|
)
|
186
224
|
),
|
187
225
|
headers=jsonable_encoder(
|
@@ -212,11 +250,20 @@ class AsyncSnippetClient:
|
|
212
250
|
|
213
251
|
async def get_by_id(self, *, id: str, request_options: typing.Optional[RequestOptions] = None) -> GetSnippetOut:
|
214
252
|
"""
|
215
|
-
Parameters
|
216
|
-
|
253
|
+
Parameters
|
254
|
+
----------
|
255
|
+
id : str
|
256
|
+
|
257
|
+
request_options : typing.Optional[RequestOptions]
|
258
|
+
Request-specific configuration.
|
217
259
|
|
218
|
-
|
219
|
-
|
260
|
+
Returns
|
261
|
+
-------
|
262
|
+
GetSnippetOut
|
263
|
+
Successful Response
|
264
|
+
|
265
|
+
Examples
|
266
|
+
--------
|
220
267
|
from athena.client import AsyncAthena
|
221
268
|
|
222
269
|
client = AsyncAthena(
|
@@ -229,8 +276,10 @@ class AsyncSnippetClient:
|
|
229
276
|
_response = await self._client_wrapper.httpx_client.request(
|
230
277
|
method="POST",
|
231
278
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/snippet"),
|
232
|
-
params=
|
233
|
-
|
279
|
+
params=encode_query(
|
280
|
+
jsonable_encoder(
|
281
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
282
|
+
)
|
234
283
|
),
|
235
284
|
json=jsonable_encoder({"id": id})
|
236
285
|
if request_options is None or request_options.get("additional_body_parameters") is None
|