athena-intelligence 0.1.83__py3-none-any.whl → 0.1.85__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/__init__.py +2 -0
- athena/chain/client.py +17 -8
- 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 +27 -22
- athena/message/client.py +17 -8
- athena/query/client.py +9 -4
- athena/report/client.py +9 -4
- athena/search/client.py +9 -4
- athena/snippet/client.py +35 -26
- athena/tools/client.py +246 -78
- athena/types/__init__.py +2 -0
- athena/types/athena_document_v_2_out.py +29 -0
- 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 +8 -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 +9 -4
- athena/workflow/client.py +9 -4
- {athena_intelligence-0.1.83.dist-info → athena_intelligence-0.1.85.dist-info}/METADATA +12 -2
- athena_intelligence-0.1.85.dist-info/RECORD +92 -0
- athena_intelligence-0.1.83.dist-info/RECORD +0 -90
- {athena_intelligence-0.1.83.dist-info → athena_intelligence-0.1.85.dist-info}/WHEEL +0 -0
athena/tools/client.py
CHANGED
@@ -8,12 +8,14 @@ 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.internal_server_error import InternalServerError
|
14
15
|
from ..errors.not_found_error import NotFoundError
|
15
16
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
16
17
|
from ..errors.unsupported_media_type_error import UnsupportedMediaTypeError
|
18
|
+
from ..types.athena_document_v_2_out import AthenaDocumentV2Out
|
17
19
|
from ..types.convert_pdf_to_sheet_out import ConvertPdfToSheetOut
|
18
20
|
from ..types.data_frame_parsing_error import DataFrameParsingError
|
19
21
|
from ..types.data_frame_request_out import DataFrameRequestOut
|
@@ -78,8 +80,10 @@ class ToolsClient:
|
|
78
80
|
_response = self._client_wrapper.httpx_client.request(
|
79
81
|
method="POST",
|
80
82
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/firecrawl/scrape-url"),
|
81
|
-
params=
|
82
|
-
|
83
|
+
params=encode_query(
|
84
|
+
jsonable_encoder(
|
85
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
86
|
+
)
|
83
87
|
),
|
84
88
|
json=jsonable_encoder(_request)
|
85
89
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -161,8 +165,10 @@ class ToolsClient:
|
|
161
165
|
url=urllib.parse.urljoin(
|
162
166
|
f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/file/langchain-documents"
|
163
167
|
),
|
164
|
-
params=
|
165
|
-
|
168
|
+
params=encode_query(
|
169
|
+
jsonable_encoder(
|
170
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
171
|
+
)
|
166
172
|
),
|
167
173
|
json=jsonable_encoder(_request)
|
168
174
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -205,7 +211,7 @@ class ToolsClient:
|
|
205
211
|
columns: typing.Optional[
|
206
212
|
typing.Union[ToolsDataFrameRequestColumnsItem, typing.Sequence[ToolsDataFrameRequestColumnsItem]]
|
207
213
|
] = None,
|
208
|
-
sheet_name: typing.Optional[
|
214
|
+
sheet_name: typing.Optional[int] = None,
|
209
215
|
separator: typing.Optional[str] = None,
|
210
216
|
request_options: typing.Optional[RequestOptions] = None,
|
211
217
|
) -> DataFrameRequestOut:
|
@@ -221,7 +227,7 @@ class ToolsClient:
|
|
221
227
|
columns : typing.Optional[typing.Union[ToolsDataFrameRequestColumnsItem, typing.Sequence[ToolsDataFrameRequestColumnsItem]]]
|
222
228
|
should be a list of strings or a list of integers
|
223
229
|
|
224
|
-
sheet_name : typing.Optional[
|
230
|
+
sheet_name : typing.Optional[int]
|
225
231
|
only for excel files
|
226
232
|
|
227
233
|
separator : typing.Optional[str]
|
@@ -249,21 +255,23 @@ class ToolsClient:
|
|
249
255
|
_response = self._client_wrapper.httpx_client.request(
|
250
256
|
method="GET",
|
251
257
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/file/data-frame"),
|
252
|
-
params=
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
258
|
+
params=encode_query(
|
259
|
+
jsonable_encoder(
|
260
|
+
remove_none_from_dict(
|
261
|
+
{
|
262
|
+
"document_id": document_id,
|
263
|
+
"row_limit": row_limit,
|
264
|
+
"index_column": index_column,
|
265
|
+
"columns": columns,
|
266
|
+
"sheet_name": sheet_name,
|
267
|
+
"separator": separator,
|
268
|
+
**(
|
269
|
+
request_options.get("additional_query_parameters", {})
|
270
|
+
if request_options is not None
|
271
|
+
else {}
|
272
|
+
),
|
273
|
+
}
|
274
|
+
)
|
267
275
|
)
|
268
276
|
),
|
269
277
|
headers=jsonable_encoder(
|
@@ -330,16 +338,18 @@ class ToolsClient:
|
|
330
338
|
with self._client_wrapper.httpx_client.stream(
|
331
339
|
method="GET",
|
332
340
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/file/raw-data"),
|
333
|
-
params=
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
341
|
+
params=encode_query(
|
342
|
+
jsonable_encoder(
|
343
|
+
remove_none_from_dict(
|
344
|
+
{
|
345
|
+
"document_id": document_id,
|
346
|
+
**(
|
347
|
+
request_options.get("additional_query_parameters", {})
|
348
|
+
if request_options is not None
|
349
|
+
else {}
|
350
|
+
),
|
351
|
+
}
|
352
|
+
)
|
343
353
|
)
|
344
354
|
),
|
345
355
|
headers=jsonable_encoder(
|
@@ -424,8 +434,10 @@ class ToolsClient:
|
|
424
434
|
_response = self._client_wrapper.httpx_client.request(
|
425
435
|
method="POST",
|
426
436
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/first-agent"),
|
427
|
-
params=
|
428
|
-
|
437
|
+
params=encode_query(
|
438
|
+
jsonable_encoder(
|
439
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
440
|
+
)
|
429
441
|
),
|
430
442
|
json=jsonable_encoder(_request)
|
431
443
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -532,8 +544,10 @@ class ToolsClient:
|
|
532
544
|
_response = self._client_wrapper.httpx_client.request(
|
533
545
|
method="POST",
|
534
546
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/researcher"),
|
535
|
-
params=
|
536
|
-
|
547
|
+
params=encode_query(
|
548
|
+
jsonable_encoder(
|
549
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
550
|
+
)
|
537
551
|
),
|
538
552
|
json=jsonable_encoder(_request)
|
539
553
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -597,8 +611,10 @@ class ToolsClient:
|
|
597
611
|
_response = self._client_wrapper.httpx_client.request(
|
598
612
|
method="POST",
|
599
613
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/convert-pdf-to-sheet"),
|
600
|
-
params=
|
601
|
-
|
614
|
+
params=encode_query(
|
615
|
+
jsonable_encoder(
|
616
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
617
|
+
)
|
602
618
|
),
|
603
619
|
json=jsonable_encoder({"document_id": document_id})
|
604
620
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -689,8 +705,10 @@ class ToolsClient:
|
|
689
705
|
_response = self._client_wrapper.httpx_client.request(
|
690
706
|
method="POST",
|
691
707
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/strict-semantic-query"),
|
692
|
-
params=
|
693
|
-
|
708
|
+
params=encode_query(
|
709
|
+
jsonable_encoder(
|
710
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
711
|
+
)
|
694
712
|
),
|
695
713
|
json=jsonable_encoder(_request)
|
696
714
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -724,6 +742,73 @@ class ToolsClient:
|
|
724
742
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
725
743
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
726
744
|
|
745
|
+
def athena_documents(
|
746
|
+
self, *, document_id: str, request_options: typing.Optional[RequestOptions] = None
|
747
|
+
) -> AthenaDocumentV2Out:
|
748
|
+
"""
|
749
|
+
Parameters
|
750
|
+
----------
|
751
|
+
document_id : str
|
752
|
+
|
753
|
+
request_options : typing.Optional[RequestOptions]
|
754
|
+
Request-specific configuration.
|
755
|
+
|
756
|
+
Returns
|
757
|
+
-------
|
758
|
+
AthenaDocumentV2Out
|
759
|
+
Successful Response
|
760
|
+
|
761
|
+
Examples
|
762
|
+
--------
|
763
|
+
from athena.client import Athena
|
764
|
+
|
765
|
+
client = Athena(
|
766
|
+
api_key="YOUR_API_KEY",
|
767
|
+
)
|
768
|
+
client.tools.athena_documents(
|
769
|
+
document_id="doc_9249292-d118-42d3-95b4-00eccfe0754f",
|
770
|
+
)
|
771
|
+
"""
|
772
|
+
_response = self._client_wrapper.httpx_client.request(
|
773
|
+
method="POST",
|
774
|
+
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/athena-document-v2"),
|
775
|
+
params=encode_query(
|
776
|
+
jsonable_encoder(
|
777
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
778
|
+
)
|
779
|
+
),
|
780
|
+
json=jsonable_encoder({"document_id": document_id})
|
781
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
782
|
+
else {
|
783
|
+
**jsonable_encoder({"document_id": document_id}),
|
784
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
785
|
+
},
|
786
|
+
headers=jsonable_encoder(
|
787
|
+
remove_none_from_dict(
|
788
|
+
{
|
789
|
+
**self._client_wrapper.get_headers(),
|
790
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
791
|
+
}
|
792
|
+
)
|
793
|
+
),
|
794
|
+
timeout=request_options.get("timeout_in_seconds")
|
795
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
796
|
+
else self._client_wrapper.get_timeout(),
|
797
|
+
retries=0,
|
798
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
799
|
+
)
|
800
|
+
if 200 <= _response.status_code < 300:
|
801
|
+
return pydantic_v1.parse_obj_as(AthenaDocumentV2Out, _response.json()) # type: ignore
|
802
|
+
if _response.status_code == 422:
|
803
|
+
raise UnprocessableEntityError(
|
804
|
+
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
805
|
+
)
|
806
|
+
try:
|
807
|
+
_response_json = _response.json()
|
808
|
+
except JSONDecodeError:
|
809
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
810
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
811
|
+
|
727
812
|
|
728
813
|
class AsyncToolsClient:
|
729
814
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
@@ -769,8 +854,10 @@ class AsyncToolsClient:
|
|
769
854
|
_response = await self._client_wrapper.httpx_client.request(
|
770
855
|
method="POST",
|
771
856
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/firecrawl/scrape-url"),
|
772
|
-
params=
|
773
|
-
|
857
|
+
params=encode_query(
|
858
|
+
jsonable_encoder(
|
859
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
860
|
+
)
|
774
861
|
),
|
775
862
|
json=jsonable_encoder(_request)
|
776
863
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -852,8 +939,10 @@ class AsyncToolsClient:
|
|
852
939
|
url=urllib.parse.urljoin(
|
853
940
|
f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/file/langchain-documents"
|
854
941
|
),
|
855
|
-
params=
|
856
|
-
|
942
|
+
params=encode_query(
|
943
|
+
jsonable_encoder(
|
944
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
945
|
+
)
|
857
946
|
),
|
858
947
|
json=jsonable_encoder(_request)
|
859
948
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -896,7 +985,7 @@ class AsyncToolsClient:
|
|
896
985
|
columns: typing.Optional[
|
897
986
|
typing.Union[ToolsDataFrameRequestColumnsItem, typing.Sequence[ToolsDataFrameRequestColumnsItem]]
|
898
987
|
] = None,
|
899
|
-
sheet_name: typing.Optional[
|
988
|
+
sheet_name: typing.Optional[int] = None,
|
900
989
|
separator: typing.Optional[str] = None,
|
901
990
|
request_options: typing.Optional[RequestOptions] = None,
|
902
991
|
) -> DataFrameRequestOut:
|
@@ -912,7 +1001,7 @@ class AsyncToolsClient:
|
|
912
1001
|
columns : typing.Optional[typing.Union[ToolsDataFrameRequestColumnsItem, typing.Sequence[ToolsDataFrameRequestColumnsItem]]]
|
913
1002
|
should be a list of strings or a list of integers
|
914
1003
|
|
915
|
-
sheet_name : typing.Optional[
|
1004
|
+
sheet_name : typing.Optional[int]
|
916
1005
|
only for excel files
|
917
1006
|
|
918
1007
|
separator : typing.Optional[str]
|
@@ -940,21 +1029,23 @@ class AsyncToolsClient:
|
|
940
1029
|
_response = await self._client_wrapper.httpx_client.request(
|
941
1030
|
method="GET",
|
942
1031
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/file/data-frame"),
|
943
|
-
params=
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
1032
|
+
params=encode_query(
|
1033
|
+
jsonable_encoder(
|
1034
|
+
remove_none_from_dict(
|
1035
|
+
{
|
1036
|
+
"document_id": document_id,
|
1037
|
+
"row_limit": row_limit,
|
1038
|
+
"index_column": index_column,
|
1039
|
+
"columns": columns,
|
1040
|
+
"sheet_name": sheet_name,
|
1041
|
+
"separator": separator,
|
1042
|
+
**(
|
1043
|
+
request_options.get("additional_query_parameters", {})
|
1044
|
+
if request_options is not None
|
1045
|
+
else {}
|
1046
|
+
),
|
1047
|
+
}
|
1048
|
+
)
|
958
1049
|
)
|
959
1050
|
),
|
960
1051
|
headers=jsonable_encoder(
|
@@ -1021,16 +1112,18 @@ class AsyncToolsClient:
|
|
1021
1112
|
async with self._client_wrapper.httpx_client.stream(
|
1022
1113
|
method="GET",
|
1023
1114
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/file/raw-data"),
|
1024
|
-
params=
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1115
|
+
params=encode_query(
|
1116
|
+
jsonable_encoder(
|
1117
|
+
remove_none_from_dict(
|
1118
|
+
{
|
1119
|
+
"document_id": document_id,
|
1120
|
+
**(
|
1121
|
+
request_options.get("additional_query_parameters", {})
|
1122
|
+
if request_options is not None
|
1123
|
+
else {}
|
1124
|
+
),
|
1125
|
+
}
|
1126
|
+
)
|
1034
1127
|
)
|
1035
1128
|
),
|
1036
1129
|
headers=jsonable_encoder(
|
@@ -1115,8 +1208,10 @@ class AsyncToolsClient:
|
|
1115
1208
|
_response = await self._client_wrapper.httpx_client.request(
|
1116
1209
|
method="POST",
|
1117
1210
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/first-agent"),
|
1118
|
-
params=
|
1119
|
-
|
1211
|
+
params=encode_query(
|
1212
|
+
jsonable_encoder(
|
1213
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
1214
|
+
)
|
1120
1215
|
),
|
1121
1216
|
json=jsonable_encoder(_request)
|
1122
1217
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -1223,8 +1318,10 @@ class AsyncToolsClient:
|
|
1223
1318
|
_response = await self._client_wrapper.httpx_client.request(
|
1224
1319
|
method="POST",
|
1225
1320
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/researcher"),
|
1226
|
-
params=
|
1227
|
-
|
1321
|
+
params=encode_query(
|
1322
|
+
jsonable_encoder(
|
1323
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
1324
|
+
)
|
1228
1325
|
),
|
1229
1326
|
json=jsonable_encoder(_request)
|
1230
1327
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -1288,8 +1385,10 @@ class AsyncToolsClient:
|
|
1288
1385
|
_response = await self._client_wrapper.httpx_client.request(
|
1289
1386
|
method="POST",
|
1290
1387
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/convert-pdf-to-sheet"),
|
1291
|
-
params=
|
1292
|
-
|
1388
|
+
params=encode_query(
|
1389
|
+
jsonable_encoder(
|
1390
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
1391
|
+
)
|
1293
1392
|
),
|
1294
1393
|
json=jsonable_encoder({"document_id": document_id})
|
1295
1394
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -1380,8 +1479,10 @@ class AsyncToolsClient:
|
|
1380
1479
|
_response = await self._client_wrapper.httpx_client.request(
|
1381
1480
|
method="POST",
|
1382
1481
|
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/strict-semantic-query"),
|
1383
|
-
params=
|
1384
|
-
|
1482
|
+
params=encode_query(
|
1483
|
+
jsonable_encoder(
|
1484
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
1485
|
+
)
|
1385
1486
|
),
|
1386
1487
|
json=jsonable_encoder(_request)
|
1387
1488
|
if request_options is None or request_options.get("additional_body_parameters") is None
|
@@ -1414,3 +1515,70 @@ class AsyncToolsClient:
|
|
1414
1515
|
except JSONDecodeError:
|
1415
1516
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1416
1517
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1518
|
+
|
1519
|
+
async def athena_documents(
|
1520
|
+
self, *, document_id: str, request_options: typing.Optional[RequestOptions] = None
|
1521
|
+
) -> AthenaDocumentV2Out:
|
1522
|
+
"""
|
1523
|
+
Parameters
|
1524
|
+
----------
|
1525
|
+
document_id : str
|
1526
|
+
|
1527
|
+
request_options : typing.Optional[RequestOptions]
|
1528
|
+
Request-specific configuration.
|
1529
|
+
|
1530
|
+
Returns
|
1531
|
+
-------
|
1532
|
+
AthenaDocumentV2Out
|
1533
|
+
Successful Response
|
1534
|
+
|
1535
|
+
Examples
|
1536
|
+
--------
|
1537
|
+
from athena.client import AsyncAthena
|
1538
|
+
|
1539
|
+
client = AsyncAthena(
|
1540
|
+
api_key="YOUR_API_KEY",
|
1541
|
+
)
|
1542
|
+
await client.tools.athena_documents(
|
1543
|
+
document_id="doc_9249292-d118-42d3-95b4-00eccfe0754f",
|
1544
|
+
)
|
1545
|
+
"""
|
1546
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1547
|
+
method="POST",
|
1548
|
+
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tools/athena-document-v2"),
|
1549
|
+
params=encode_query(
|
1550
|
+
jsonable_encoder(
|
1551
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
1552
|
+
)
|
1553
|
+
),
|
1554
|
+
json=jsonable_encoder({"document_id": document_id})
|
1555
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
1556
|
+
else {
|
1557
|
+
**jsonable_encoder({"document_id": document_id}),
|
1558
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
1559
|
+
},
|
1560
|
+
headers=jsonable_encoder(
|
1561
|
+
remove_none_from_dict(
|
1562
|
+
{
|
1563
|
+
**self._client_wrapper.get_headers(),
|
1564
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
1565
|
+
}
|
1566
|
+
)
|
1567
|
+
),
|
1568
|
+
timeout=request_options.get("timeout_in_seconds")
|
1569
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
1570
|
+
else self._client_wrapper.get_timeout(),
|
1571
|
+
retries=0,
|
1572
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
1573
|
+
)
|
1574
|
+
if 200 <= _response.status_code < 300:
|
1575
|
+
return pydantic_v1.parse_obj_as(AthenaDocumentV2Out, _response.json()) # type: ignore
|
1576
|
+
if _response.status_code == 422:
|
1577
|
+
raise UnprocessableEntityError(
|
1578
|
+
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
1579
|
+
)
|
1580
|
+
try:
|
1581
|
+
_response_json = _response.json()
|
1582
|
+
except JSONDecodeError:
|
1583
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1584
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
athena/types/__init__.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
from .athena_document_v_2_out import AthenaDocumentV2Out
|
3
4
|
from .convert_pdf_to_sheet_out import ConvertPdfToSheetOut
|
4
5
|
from .data_frame_parsing_error import DataFrameParsingError
|
5
6
|
from .data_frame_request_out import DataFrameRequestOut
|
@@ -44,6 +45,7 @@ from .validation_error_loc_item import ValidationErrorLocItem
|
|
44
45
|
from .workflow_status_out import WorkflowStatusOut
|
45
46
|
|
46
47
|
__all__ = [
|
48
|
+
"AthenaDocumentV2Out",
|
47
49
|
"ConvertPdfToSheetOut",
|
48
50
|
"DataFrameParsingError",
|
49
51
|
"DataFrameRequestOut",
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import datetime as dt
|
4
|
+
import typing
|
5
|
+
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
|
+
|
9
|
+
|
10
|
+
class AthenaDocumentV2Out(pydantic_v1.BaseModel):
|
11
|
+
output: typing.Dict[str, typing.Any]
|
12
|
+
|
13
|
+
def json(self, **kwargs: typing.Any) -> str:
|
14
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
15
|
+
return super().json(**kwargs_with_defaults)
|
16
|
+
|
17
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
18
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
19
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
20
|
+
|
21
|
+
return deep_union_pydantic_dicts(
|
22
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
23
|
+
)
|
24
|
+
|
25
|
+
class Config:
|
26
|
+
frozen = True
|
27
|
+
smart_union = True
|
28
|
+
extra = pydantic_v1.Extra.allow
|
29
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -4,7 +4,7 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import pydantic_v1
|
7
|
+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
8
|
|
9
9
|
|
10
10
|
class ConvertPdfToSheetOut(pydantic_v1.BaseModel):
|
@@ -16,8 +16,12 @@ class ConvertPdfToSheetOut(pydantic_v1.BaseModel):
|
|
16
16
|
return super().json(**kwargs_with_defaults)
|
17
17
|
|
18
18
|
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
19
|
-
|
20
|
-
|
19
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
20
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
21
|
+
|
22
|
+
return deep_union_pydantic_dicts(
|
23
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
24
|
+
)
|
21
25
|
|
22
26
|
class Config:
|
23
27
|
frozen = True
|
@@ -4,7 +4,7 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import pydantic_v1
|
7
|
+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
8
|
|
9
9
|
|
10
10
|
class DataFrameParsingError(pydantic_v1.BaseModel):
|
@@ -16,8 +16,12 @@ class DataFrameParsingError(pydantic_v1.BaseModel):
|
|
16
16
|
return super().json(**kwargs_with_defaults)
|
17
17
|
|
18
18
|
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
19
|
-
|
20
|
-
|
19
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
20
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
21
|
+
|
22
|
+
return deep_union_pydantic_dicts(
|
23
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
24
|
+
)
|
21
25
|
|
22
26
|
class Config:
|
23
27
|
frozen = True
|
@@ -4,7 +4,7 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import pydantic_v1
|
7
|
+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
8
|
from .data_frame_request_out_columns_item import DataFrameRequestOutColumnsItem
|
9
9
|
from .data_frame_request_out_data_item_item import DataFrameRequestOutDataItemItem
|
10
10
|
from .data_frame_request_out_index_item import DataFrameRequestOutIndexItem
|
@@ -20,8 +20,12 @@ class DataFrameRequestOut(pydantic_v1.BaseModel):
|
|
20
20
|
return super().json(**kwargs_with_defaults)
|
21
21
|
|
22
22
|
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
23
|
-
|
24
|
-
|
23
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
24
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
25
|
+
|
26
|
+
return deep_union_pydantic_dicts(
|
27
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
28
|
+
)
|
25
29
|
|
26
30
|
class Config:
|
27
31
|
frozen = True
|
@@ -4,7 +4,7 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import pydantic_v1
|
7
|
+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
8
|
|
9
9
|
|
10
10
|
class DataFrameUnknownFormatError(pydantic_v1.BaseModel):
|
@@ -17,8 +17,12 @@ class DataFrameUnknownFormatError(pydantic_v1.BaseModel):
|
|
17
17
|
return super().json(**kwargs_with_defaults)
|
18
18
|
|
19
19
|
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
20
|
-
|
21
|
-
|
20
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
21
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
22
|
+
|
23
|
+
return deep_union_pydantic_dicts(
|
24
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
25
|
+
)
|
22
26
|
|
23
27
|
class Config:
|
24
28
|
frozen = True
|
athena/types/dataset.py
CHANGED
@@ -4,7 +4,7 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import pydantic_v1
|
7
|
+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
8
|
|
9
9
|
|
10
10
|
class Dataset(pydantic_v1.BaseModel):
|
@@ -19,8 +19,12 @@ class Dataset(pydantic_v1.BaseModel):
|
|
19
19
|
return super().json(**kwargs_with_defaults)
|
20
20
|
|
21
21
|
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
22
|
-
|
23
|
-
|
22
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
23
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
24
|
+
|
25
|
+
return deep_union_pydantic_dicts(
|
26
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
27
|
+
)
|
24
28
|
|
25
29
|
class Config:
|
26
30
|
frozen = True
|