athena-intelligence 0.1.93__tar.gz → 0.1.95__tar.gz

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.
Files changed (95) hide show
  1. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/PKG-INFO +1 -1
  2. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/pyproject.toml +1 -1
  3. athena_intelligence-0.1.95/src/athena/__init__.py +40 -0
  4. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/base_client.py +4 -31
  5. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/client.py +4 -9
  6. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/client_wrapper.py +1 -1
  7. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/environment.py +1 -1
  8. athena_intelligence-0.1.95/src/athena/tools/client.py +299 -0
  9. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/tools/types/tools_data_frame_request_columns_item.py +1 -1
  10. athena_intelligence-0.1.95/src/athena/types/__init__.py +25 -0
  11. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/types/data_frame_request_out.py +5 -1
  12. athena_intelligence-0.1.93/src/athena/__init__.py +0 -115
  13. athena_intelligence-0.1.93/src/athena/chain/__init__.py +0 -2
  14. athena_intelligence-0.1.93/src/athena/chain/client.py +0 -302
  15. athena_intelligence-0.1.93/src/athena/dataset/__init__.py +0 -2
  16. athena_intelligence-0.1.93/src/athena/dataset/client.py +0 -124
  17. athena_intelligence-0.1.93/src/athena/message/__init__.py +0 -2
  18. athena_intelligence-0.1.93/src/athena/message/client.py +0 -249
  19. athena_intelligence-0.1.93/src/athena/polling_message_client.py +0 -125
  20. athena_intelligence-0.1.93/src/athena/query/__init__.py +0 -2
  21. athena_intelligence-0.1.93/src/athena/query/client.py +0 -123
  22. athena_intelligence-0.1.93/src/athena/report/__init__.py +0 -2
  23. athena_intelligence-0.1.93/src/athena/report/client.py +0 -125
  24. athena_intelligence-0.1.93/src/athena/search/__init__.py +0 -2
  25. athena_intelligence-0.1.93/src/athena/search/client.py +0 -171
  26. athena_intelligence-0.1.93/src/athena/snippet/__init__.py +0 -2
  27. athena_intelligence-0.1.93/src/athena/snippet/client.py +0 -208
  28. athena_intelligence-0.1.93/src/athena/tools/client.py +0 -1154
  29. athena_intelligence-0.1.93/src/athena/types/__init__.py +0 -91
  30. athena_intelligence-0.1.93/src/athena/types/athena_document_v_2_out.py +0 -29
  31. athena_intelligence-0.1.93/src/athena/types/convert_pdf_to_sheet_out.py +0 -30
  32. athena_intelligence-0.1.93/src/athena/types/dataset.py +0 -33
  33. athena_intelligence-0.1.93/src/athena/types/document.py +0 -47
  34. athena_intelligence-0.1.93/src/athena/types/excecute_tool_first_workflow_out.py +0 -29
  35. athena_intelligence-0.1.93/src/athena/types/file_data_response.py +0 -36
  36. athena_intelligence-0.1.93/src/athena/types/filter_model.py +0 -32
  37. athena_intelligence-0.1.93/src/athena/types/filter_operator.py +0 -73
  38. athena_intelligence-0.1.93/src/athena/types/firecrawl_scrape_url_data_reponse_dto.py +0 -32
  39. athena_intelligence-0.1.93/src/athena/types/firecrawl_scrape_url_metadata.py +0 -34
  40. athena_intelligence-0.1.93/src/athena/types/get_datasets_response.py +0 -34
  41. athena_intelligence-0.1.93/src/athena/types/get_snippet_out.py +0 -29
  42. athena_intelligence-0.1.93/src/athena/types/get_snippets_response.py +0 -34
  43. athena_intelligence-0.1.93/src/athena/types/langchain_documents_request_out.py +0 -29
  44. athena_intelligence-0.1.93/src/athena/types/llm_model.py +0 -141
  45. athena_intelligence-0.1.93/src/athena/types/map_reduce_chain_out.py +0 -32
  46. athena_intelligence-0.1.93/src/athena/types/message_out.py +0 -29
  47. athena_intelligence-0.1.93/src/athena/types/message_out_dto.py +0 -35
  48. athena_intelligence-0.1.93/src/athena/types/model.py +0 -93
  49. athena_intelligence-0.1.93/src/athena/types/publish_formats.py +0 -31
  50. athena_intelligence-0.1.93/src/athena/types/query_model.py +0 -40
  51. athena_intelligence-0.1.93/src/athena/types/report.py +0 -32
  52. athena_intelligence-0.1.93/src/athena/types/researcher_out.py +0 -29
  53. athena_intelligence-0.1.93/src/athena/types/semantic_query_out.py +0 -29
  54. athena_intelligence-0.1.93/src/athena/types/snippet.py +0 -35
  55. athena_intelligence-0.1.93/src/athena/types/sql_results.py +0 -29
  56. athena_intelligence-0.1.93/src/athena/types/status_enum.py +0 -29
  57. athena_intelligence-0.1.93/src/athena/types/structured_parse_result.py +0 -29
  58. athena_intelligence-0.1.93/src/athena/types/time_dimension_model.py +0 -33
  59. athena_intelligence-0.1.93/src/athena/types/tools.py +0 -57
  60. athena_intelligence-0.1.93/src/athena/types/upload_documents_out.py +0 -31
  61. athena_intelligence-0.1.93/src/athena/types/url_result.py +0 -29
  62. athena_intelligence-0.1.93/src/athena/types/workflow_status_out.py +0 -31
  63. athena_intelligence-0.1.93/src/athena/upload/__init__.py +0 -2
  64. athena_intelligence-0.1.93/src/athena/upload/client.py +0 -108
  65. athena_intelligence-0.1.93/src/athena/workflow/__init__.py +0 -2
  66. athena_intelligence-0.1.93/src/athena/workflow/client.py +0 -117
  67. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/README.md +0 -0
  68. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/__init__.py +0 -0
  69. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/api_error.py +0 -0
  70. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/datetime_utils.py +0 -0
  71. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/file.py +0 -0
  72. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/http_client.py +0 -0
  73. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/jsonable_encoder.py +0 -0
  74. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/pydantic_utilities.py +0 -0
  75. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/query_encoder.py +0 -0
  76. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/remove_none_from_dict.py +0 -0
  77. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/core/request_options.py +0 -0
  78. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/errors/__init__.py +0 -0
  79. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/errors/internal_server_error.py +0 -0
  80. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/errors/not_found_error.py +0 -0
  81. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/errors/unprocessable_entity_error.py +0 -0
  82. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/errors/unsupported_media_type_error.py +0 -0
  83. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/py.typed +0 -0
  84. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/tools/__init__.py +0 -0
  85. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/tools/types/__init__.py +0 -0
  86. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/types/data_frame_parsing_error.py +1 -1
  87. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/types/data_frame_request_out_columns_item.py +0 -0
  88. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/types/data_frame_request_out_data_item_item.py +0 -0
  89. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/types/data_frame_request_out_index_item.py +0 -0
  90. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/types/data_frame_unknown_format_error.py +1 -1
  91. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/types/file_fetch_error.py +0 -0
  92. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/types/http_validation_error.py +0 -0
  93. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/types/validation_error.py +0 -0
  94. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/types/validation_error_loc_item.py +0 -0
  95. {athena_intelligence-0.1.93 → athena_intelligence-0.1.95}/src/athena/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: athena-intelligence
3
- Version: 0.1.93
3
+ Version: 0.1.95
4
4
  Summary: Athena Intelligence Python Library
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "athena-intelligence"
3
- version = "0.1.93"
3
+ version = "0.1.95"
4
4
  description = "Athena Intelligence Python Library"
5
5
  readme = "README.md"
6
6
  authors = []
@@ -0,0 +1,40 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .types import (
4
+ DataFrameParsingError,
5
+ DataFrameRequestOut,
6
+ DataFrameRequestOutColumnsItem,
7
+ DataFrameRequestOutDataItemItem,
8
+ DataFrameRequestOutIndexItem,
9
+ DataFrameUnknownFormatError,
10
+ FileFetchError,
11
+ HttpValidationError,
12
+ ValidationError,
13
+ ValidationErrorLocItem,
14
+ )
15
+ from .errors import InternalServerError, NotFoundError, UnprocessableEntityError, UnsupportedMediaTypeError
16
+ from . import tools
17
+ from .environment import AthenaEnvironment
18
+ from .tools import ToolsDataFrameRequestColumnsItem
19
+ from .version import __version__
20
+
21
+ __all__ = [
22
+ "AthenaEnvironment",
23
+ "DataFrameParsingError",
24
+ "DataFrameRequestOut",
25
+ "DataFrameRequestOutColumnsItem",
26
+ "DataFrameRequestOutDataItemItem",
27
+ "DataFrameRequestOutIndexItem",
28
+ "DataFrameUnknownFormatError",
29
+ "FileFetchError",
30
+ "HttpValidationError",
31
+ "InternalServerError",
32
+ "NotFoundError",
33
+ "ToolsDataFrameRequestColumnsItem",
34
+ "UnprocessableEntityError",
35
+ "UnsupportedMediaTypeError",
36
+ "ValidationError",
37
+ "ValidationErrorLocItem",
38
+ "__version__",
39
+ "tools",
40
+ ]
@@ -4,18 +4,9 @@ import typing
4
4
 
5
5
  import httpx
6
6
 
7
- from .chain.client import AsyncChainClient, ChainClient
8
7
  from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
- from .dataset.client import AsyncDatasetClient, DatasetClient
10
8
  from .environment import AthenaEnvironment
11
- from .message.client import AsyncMessageClient, MessageClient
12
- from .query.client import AsyncQueryClient, QueryClient
13
- from .report.client import AsyncReportClient, ReportClient
14
- from .search.client import AsyncSearchClient, SearchClient
15
- from .snippet.client import AsyncSnippetClient, SnippetClient
16
9
  from .tools.client import AsyncToolsClient, ToolsClient
17
- from .upload.client import AsyncUploadClient, UploadClient
18
- from .workflow.client import AsyncWorkflowClient, WorkflowClient
19
10
 
20
11
 
21
12
  class BaseAthena:
@@ -32,7 +23,7 @@ class BaseAthena:
32
23
 
33
24
 
34
25
 
35
- Defaults to AthenaEnvironment.DEFAULT
26
+ Defaults to AthenaEnvironment.PRODUCTION
36
27
 
37
28
 
38
29
 
@@ -59,7 +50,7 @@ class BaseAthena:
59
50
  self,
60
51
  *,
61
52
  base_url: typing.Optional[str] = None,
62
- environment: AthenaEnvironment = AthenaEnvironment.DEFAULT,
53
+ environment: AthenaEnvironment = AthenaEnvironment.PRODUCTION,
63
54
  api_key: str,
64
55
  timeout: typing.Optional[float] = None,
65
56
  follow_redirects: typing.Optional[bool] = True,
@@ -76,16 +67,7 @@ class BaseAthena:
76
67
  else httpx.Client(timeout=_defaulted_timeout),
77
68
  timeout=_defaulted_timeout,
78
69
  )
79
- self.message = MessageClient(client_wrapper=self._client_wrapper)
80
- self.dataset = DatasetClient(client_wrapper=self._client_wrapper)
81
- self.snippet = SnippetClient(client_wrapper=self._client_wrapper)
82
- self.report = ReportClient(client_wrapper=self._client_wrapper)
83
- self.query = QueryClient(client_wrapper=self._client_wrapper)
84
- self.search = SearchClient(client_wrapper=self._client_wrapper)
85
- self.chain = ChainClient(client_wrapper=self._client_wrapper)
86
70
  self.tools = ToolsClient(client_wrapper=self._client_wrapper)
87
- self.upload = UploadClient(client_wrapper=self._client_wrapper)
88
- self.workflow = WorkflowClient(client_wrapper=self._client_wrapper)
89
71
 
90
72
 
91
73
  class AsyncBaseAthena:
@@ -102,7 +84,7 @@ class AsyncBaseAthena:
102
84
 
103
85
 
104
86
 
105
- Defaults to AthenaEnvironment.DEFAULT
87
+ Defaults to AthenaEnvironment.PRODUCTION
106
88
 
107
89
 
108
90
 
@@ -129,7 +111,7 @@ class AsyncBaseAthena:
129
111
  self,
130
112
  *,
131
113
  base_url: typing.Optional[str] = None,
132
- environment: AthenaEnvironment = AthenaEnvironment.DEFAULT,
114
+ environment: AthenaEnvironment = AthenaEnvironment.PRODUCTION,
133
115
  api_key: str,
134
116
  timeout: typing.Optional[float] = None,
135
117
  follow_redirects: typing.Optional[bool] = True,
@@ -146,16 +128,7 @@ class AsyncBaseAthena:
146
128
  else httpx.AsyncClient(timeout=_defaulted_timeout),
147
129
  timeout=_defaulted_timeout,
148
130
  )
149
- self.message = AsyncMessageClient(client_wrapper=self._client_wrapper)
150
- self.dataset = AsyncDatasetClient(client_wrapper=self._client_wrapper)
151
- self.snippet = AsyncSnippetClient(client_wrapper=self._client_wrapper)
152
- self.report = AsyncReportClient(client_wrapper=self._client_wrapper)
153
- self.query = AsyncQueryClient(client_wrapper=self._client_wrapper)
154
- self.search = AsyncSearchClient(client_wrapper=self._client_wrapper)
155
- self.chain = AsyncChainClient(client_wrapper=self._client_wrapper)
156
131
  self.tools = AsyncToolsClient(client_wrapper=self._client_wrapper)
157
- self.upload = AsyncUploadClient(client_wrapper=self._client_wrapper)
158
- self.workflow = AsyncWorkflowClient(client_wrapper=self._client_wrapper)
159
132
 
160
133
 
161
134
  def _get_base_url(*, base_url: typing.Optional[str] = None, environment: AthenaEnvironment) -> str:
@@ -8,7 +8,6 @@ from typing_extensions import TypeVar, ParamSpec
8
8
 
9
9
  from .base_client import BaseAthena, AsyncBaseAthena
10
10
  from .environment import AthenaEnvironment
11
- from .polling_message_client import MessagePollingClient, AsyncMessagePollingClient
12
11
  from .tools.client import AsyncToolsClient, ToolsClient
13
12
  from .types.data_frame_request_out import DataFrameRequestOut
14
13
 
@@ -138,7 +137,7 @@ class Athena(BaseAthena):
138
137
 
139
138
 
140
139
 
141
- Defaults to AthenaEnvironment.DEFAULT
140
+ Defaults to AthenaEnvironment.PRODUCTION
142
141
 
143
142
 
144
143
 
@@ -164,7 +163,7 @@ class Athena(BaseAthena):
164
163
  self,
165
164
  *,
166
165
  base_url: typing.Optional[str] = None,
167
- environment: AthenaEnvironment = AthenaEnvironment.DEFAULT,
166
+ environment: AthenaEnvironment = AthenaEnvironment.PRODUCTION,
168
167
  api_key: typing.Optional[str] = None,
169
168
  timeout: typing.Optional[float] = 60,
170
169
  httpx_client: typing.Optional[httpx.Client] = None
@@ -184,8 +183,6 @@ class Athena(BaseAthena):
184
183
  timeout=timeout,
185
184
  httpx_client=httpx_client,
186
185
  )
187
- self.message = MessagePollingClient(
188
- client_wrapper=self._client_wrapper)
189
186
  self.tools = WrappedToolsClient(client_wrapper=self._client_wrapper)
190
187
 
191
188
 
@@ -204,7 +201,7 @@ class AsyncAthena(AsyncBaseAthena):
204
201
 
205
202
 
206
203
 
207
- Defaults to AthenaEnvironment.DEFAULT
204
+ Defaults to AthenaEnvironment.PRODUCTION
208
205
 
209
206
 
210
207
 
@@ -230,7 +227,7 @@ class AsyncAthena(AsyncBaseAthena):
230
227
  self,
231
228
  *,
232
229
  base_url: typing.Optional[str] = None,
233
- environment: AthenaEnvironment = AthenaEnvironment.DEFAULT,
230
+ environment: AthenaEnvironment = AthenaEnvironment.PRODUCTION,
234
231
  api_key: typing.Optional[str] = None,
235
232
  timeout: typing.Optional[float] = 60,
236
233
  httpx_client: typing.Optional[httpx.AsyncClient] = None
@@ -250,8 +247,6 @@ class AsyncAthena(AsyncBaseAthena):
250
247
  timeout=timeout,
251
248
  httpx_client=httpx_client,
252
249
  )
253
- self.message = AsyncMessagePollingClient(
254
- client_wrapper=self._client_wrapper)
255
250
  self.tools = WrappedAsyncToolsClient(client_wrapper=self._client_wrapper)
256
251
 
257
252
 
@@ -17,7 +17,7 @@ class BaseClientWrapper:
17
17
  headers: typing.Dict[str, str] = {
18
18
  "X-Fern-Language": "Python",
19
19
  "X-Fern-SDK-Name": "athena-intelligence",
20
- "X-Fern-SDK-Version": "0.1.93",
20
+ "X-Fern-SDK-Version": "0.1.95",
21
21
  }
22
22
  headers["X-API-KEY"] = self.api_key
23
23
  return headers
@@ -4,4 +4,4 @@ import enum
4
4
 
5
5
 
6
6
  class AthenaEnvironment(enum.Enum):
7
- DEFAULT = "https://api.athenaintelligence.ai"
7
+ PRODUCTION = "https://api.athenaintel.com"
@@ -0,0 +1,299 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..core.api_error import ApiError
7
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ..core.pydantic_utilities import pydantic_v1
9
+ from ..core.request_options import RequestOptions
10
+ from ..errors.internal_server_error import InternalServerError
11
+ from ..errors.not_found_error import NotFoundError
12
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
13
+ from ..errors.unsupported_media_type_error import UnsupportedMediaTypeError
14
+ from ..types.data_frame_parsing_error import DataFrameParsingError
15
+ from ..types.data_frame_request_out import DataFrameRequestOut
16
+ from ..types.data_frame_unknown_format_error import DataFrameUnknownFormatError
17
+ from ..types.file_fetch_error import FileFetchError
18
+ from ..types.http_validation_error import HttpValidationError
19
+ from .types.tools_data_frame_request_columns_item import ToolsDataFrameRequestColumnsItem
20
+
21
+
22
+ class ToolsClient:
23
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
24
+ self._client_wrapper = client_wrapper
25
+
26
+ def data_frame(
27
+ self,
28
+ *,
29
+ document_id: str,
30
+ row_limit: typing.Optional[int] = None,
31
+ index_column: typing.Optional[int] = None,
32
+ columns: typing.Optional[
33
+ typing.Union[ToolsDataFrameRequestColumnsItem, typing.Sequence[ToolsDataFrameRequestColumnsItem]]
34
+ ] = None,
35
+ sheet_name: typing.Optional[str] = None,
36
+ separator: typing.Optional[str] = None,
37
+ request_options: typing.Optional[RequestOptions] = None
38
+ ) -> DataFrameRequestOut:
39
+ """
40
+ Parameters
41
+ ----------
42
+ document_id : str
43
+
44
+ row_limit : typing.Optional[int]
45
+
46
+ index_column : typing.Optional[int]
47
+
48
+ columns : typing.Optional[typing.Union[ToolsDataFrameRequestColumnsItem, typing.Sequence[ToolsDataFrameRequestColumnsItem]]]
49
+ should be a list of strings or a list of integers
50
+
51
+ sheet_name : typing.Optional[str]
52
+ only for excel files
53
+
54
+ separator : typing.Optional[str]
55
+ only for csv files
56
+
57
+ request_options : typing.Optional[RequestOptions]
58
+ Request-specific configuration.
59
+
60
+ Returns
61
+ -------
62
+ DataFrameRequestOut
63
+ Successful Response
64
+
65
+ Examples
66
+ --------
67
+ from athena.client import Athena
68
+
69
+ client = Athena(
70
+ api_key="YOUR_API_KEY",
71
+ )
72
+ client.tools.data_frame(
73
+ document_id="document_id",
74
+ )
75
+ """
76
+ _response = self._client_wrapper.httpx_client.request(
77
+ "api/v0/tools/file/data-frame",
78
+ method="GET",
79
+ params={
80
+ "document_id": document_id,
81
+ "row_limit": row_limit,
82
+ "index_column": index_column,
83
+ "columns": columns,
84
+ "sheet_name": sheet_name,
85
+ "separator": separator,
86
+ },
87
+ request_options=request_options,
88
+ )
89
+ if 200 <= _response.status_code < 300:
90
+ return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
91
+ if _response.status_code == 404:
92
+ raise NotFoundError(pydantic_v1.parse_obj_as(FileFetchError, _response.json())) # type: ignore
93
+ if _response.status_code == 415:
94
+ raise UnsupportedMediaTypeError(
95
+ pydantic_v1.parse_obj_as(DataFrameUnknownFormatError, _response.json()) # type: ignore
96
+ )
97
+ if _response.status_code == 422:
98
+ raise UnprocessableEntityError(
99
+ pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
100
+ )
101
+ if _response.status_code == 500:
102
+ raise InternalServerError(pydantic_v1.parse_obj_as(DataFrameParsingError, _response.json())) # type: ignore
103
+ try:
104
+ _response_json = _response.json()
105
+ except JSONDecodeError:
106
+ raise ApiError(status_code=_response.status_code, body=_response.text)
107
+ raise ApiError(status_code=_response.status_code, body=_response_json)
108
+
109
+ def raw_data(
110
+ self, *, document_id: str, request_options: typing.Optional[RequestOptions] = None
111
+ ) -> typing.Iterator[bytes]:
112
+ """
113
+ Get the raw file data for given asset.
114
+
115
+ Parameters
116
+ ----------
117
+ document_id : str
118
+
119
+ request_options : typing.Optional[RequestOptions]
120
+ Request-specific configuration.
121
+
122
+ Yields
123
+ ------
124
+ typing.Iterator[bytes]
125
+ Stream the file in original format.
126
+
127
+ Examples
128
+ --------
129
+ from athena.client import Athena
130
+
131
+ client = Athena(
132
+ api_key="YOUR_API_KEY",
133
+ )
134
+ client.tools.raw_data(
135
+ document_id="string",
136
+ )
137
+ """
138
+ with self._client_wrapper.httpx_client.stream(
139
+ "api/v0/tools/file/raw-data",
140
+ method="GET",
141
+ params={"document_id": document_id},
142
+ request_options=request_options,
143
+ ) as _response:
144
+ if 200 <= _response.status_code < 300:
145
+ for _chunk in _response.iter_bytes():
146
+ yield _chunk
147
+ return
148
+ _response.read()
149
+ if _response.status_code == 404:
150
+ raise NotFoundError(pydantic_v1.parse_obj_as(FileFetchError, _response.json())) # type: ignore
151
+ if _response.status_code == 422:
152
+ raise UnprocessableEntityError(
153
+ pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
154
+ )
155
+ try:
156
+ _response_json = _response.json()
157
+ except JSONDecodeError:
158
+ raise ApiError(status_code=_response.status_code, body=_response.text)
159
+ raise ApiError(status_code=_response.status_code, body=_response_json)
160
+
161
+
162
+ class AsyncToolsClient:
163
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
164
+ self._client_wrapper = client_wrapper
165
+
166
+ async def data_frame(
167
+ self,
168
+ *,
169
+ document_id: str,
170
+ row_limit: typing.Optional[int] = None,
171
+ index_column: typing.Optional[int] = None,
172
+ columns: typing.Optional[
173
+ typing.Union[ToolsDataFrameRequestColumnsItem, typing.Sequence[ToolsDataFrameRequestColumnsItem]]
174
+ ] = None,
175
+ sheet_name: typing.Optional[str] = None,
176
+ separator: typing.Optional[str] = None,
177
+ request_options: typing.Optional[RequestOptions] = None
178
+ ) -> DataFrameRequestOut:
179
+ """
180
+ Parameters
181
+ ----------
182
+ document_id : str
183
+
184
+ row_limit : typing.Optional[int]
185
+
186
+ index_column : typing.Optional[int]
187
+
188
+ columns : typing.Optional[typing.Union[ToolsDataFrameRequestColumnsItem, typing.Sequence[ToolsDataFrameRequestColumnsItem]]]
189
+ should be a list of strings or a list of integers
190
+
191
+ sheet_name : typing.Optional[str]
192
+ only for excel files
193
+
194
+ separator : typing.Optional[str]
195
+ only for csv files
196
+
197
+ request_options : typing.Optional[RequestOptions]
198
+ Request-specific configuration.
199
+
200
+ Returns
201
+ -------
202
+ DataFrameRequestOut
203
+ Successful Response
204
+
205
+ Examples
206
+ --------
207
+ from athena.client import AsyncAthena
208
+
209
+ client = AsyncAthena(
210
+ api_key="YOUR_API_KEY",
211
+ )
212
+ await client.tools.data_frame(
213
+ document_id="document_id",
214
+ )
215
+ """
216
+ _response = await self._client_wrapper.httpx_client.request(
217
+ "api/v0/tools/file/data-frame",
218
+ method="GET",
219
+ params={
220
+ "document_id": document_id,
221
+ "row_limit": row_limit,
222
+ "index_column": index_column,
223
+ "columns": columns,
224
+ "sheet_name": sheet_name,
225
+ "separator": separator,
226
+ },
227
+ request_options=request_options,
228
+ )
229
+ if 200 <= _response.status_code < 300:
230
+ return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
231
+ if _response.status_code == 404:
232
+ raise NotFoundError(pydantic_v1.parse_obj_as(FileFetchError, _response.json())) # type: ignore
233
+ if _response.status_code == 415:
234
+ raise UnsupportedMediaTypeError(
235
+ pydantic_v1.parse_obj_as(DataFrameUnknownFormatError, _response.json()) # type: ignore
236
+ )
237
+ if _response.status_code == 422:
238
+ raise UnprocessableEntityError(
239
+ pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
240
+ )
241
+ if _response.status_code == 500:
242
+ raise InternalServerError(pydantic_v1.parse_obj_as(DataFrameParsingError, _response.json())) # type: ignore
243
+ try:
244
+ _response_json = _response.json()
245
+ except JSONDecodeError:
246
+ raise ApiError(status_code=_response.status_code, body=_response.text)
247
+ raise ApiError(status_code=_response.status_code, body=_response_json)
248
+
249
+ async def raw_data(
250
+ self, *, document_id: str, request_options: typing.Optional[RequestOptions] = None
251
+ ) -> typing.AsyncIterator[bytes]:
252
+ """
253
+ Get the raw file data for given asset.
254
+
255
+ Parameters
256
+ ----------
257
+ document_id : str
258
+
259
+ request_options : typing.Optional[RequestOptions]
260
+ Request-specific configuration.
261
+
262
+ Yields
263
+ ------
264
+ typing.AsyncIterator[bytes]
265
+ Stream the file in original format.
266
+
267
+ Examples
268
+ --------
269
+ from athena.client import AsyncAthena
270
+
271
+ client = AsyncAthena(
272
+ api_key="YOUR_API_KEY",
273
+ )
274
+ await client.tools.raw_data(
275
+ document_id="string",
276
+ )
277
+ """
278
+ async with self._client_wrapper.httpx_client.stream(
279
+ "api/v0/tools/file/raw-data",
280
+ method="GET",
281
+ params={"document_id": document_id},
282
+ request_options=request_options,
283
+ ) as _response:
284
+ if 200 <= _response.status_code < 300:
285
+ async for _chunk in _response.aiter_bytes():
286
+ yield _chunk
287
+ return
288
+ await _response.aread()
289
+ if _response.status_code == 404:
290
+ raise NotFoundError(pydantic_v1.parse_obj_as(FileFetchError, _response.json())) # type: ignore
291
+ if _response.status_code == 422:
292
+ raise UnprocessableEntityError(
293
+ pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
294
+ )
295
+ try:
296
+ _response_json = _response.json()
297
+ except JSONDecodeError:
298
+ raise ApiError(status_code=_response.status_code, body=_response.text)
299
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- ToolsDataFrameRequestColumnsItem = typing.Union[int, str]
5
+ ToolsDataFrameRequestColumnsItem = typing.Union[str, int]
@@ -0,0 +1,25 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .data_frame_parsing_error import DataFrameParsingError
4
+ from .data_frame_request_out import DataFrameRequestOut
5
+ from .data_frame_request_out_columns_item import DataFrameRequestOutColumnsItem
6
+ from .data_frame_request_out_data_item_item import DataFrameRequestOutDataItemItem
7
+ from .data_frame_request_out_index_item import DataFrameRequestOutIndexItem
8
+ from .data_frame_unknown_format_error import DataFrameUnknownFormatError
9
+ from .file_fetch_error import FileFetchError
10
+ from .http_validation_error import HttpValidationError
11
+ from .validation_error import ValidationError
12
+ from .validation_error_loc_item import ValidationErrorLocItem
13
+
14
+ __all__ = [
15
+ "DataFrameParsingError",
16
+ "DataFrameRequestOut",
17
+ "DataFrameRequestOutColumnsItem",
18
+ "DataFrameRequestOutDataItemItem",
19
+ "DataFrameRequestOutIndexItem",
20
+ "DataFrameUnknownFormatError",
21
+ "FileFetchError",
22
+ "HttpValidationError",
23
+ "ValidationError",
24
+ "ValidationErrorLocItem",
25
+ ]
@@ -11,9 +11,13 @@ from .data_frame_request_out_index_item import DataFrameRequestOutIndexItem
11
11
 
12
12
 
13
13
  class DataFrameRequestOut(pydantic_v1.BaseModel):
14
+ """
15
+ Response model with JSON dataframe representation.
16
+ """
17
+
14
18
  columns: typing.List[DataFrameRequestOutColumnsItem]
15
- index: typing.List[DataFrameRequestOutIndexItem]
16
19
  data: typing.List[typing.List[DataFrameRequestOutDataItemItem]]
20
+ index: typing.List[DataFrameRequestOutIndexItem]
17
21
 
18
22
  def json(self, **kwargs: typing.Any) -> str:
19
23
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -1,115 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from .types import (
4
- AthenaDocumentV2Out,
5
- ConvertPdfToSheetOut,
6
- DataFrameParsingError,
7
- DataFrameRequestOut,
8
- DataFrameRequestOutColumnsItem,
9
- DataFrameRequestOutDataItemItem,
10
- DataFrameRequestOutIndexItem,
11
- DataFrameUnknownFormatError,
12
- Dataset,
13
- Document,
14
- ExcecuteToolFirstWorkflowOut,
15
- FileDataResponse,
16
- FileFetchError,
17
- FilterModel,
18
- FilterOperator,
19
- FirecrawlScrapeUrlDataReponseDto,
20
- FirecrawlScrapeUrlMetadata,
21
- GetDatasetsResponse,
22
- GetSnippetOut,
23
- GetSnippetsResponse,
24
- HttpValidationError,
25
- LangchainDocumentsRequestOut,
26
- LlmModel,
27
- MapReduceChainOut,
28
- MessageOut,
29
- MessageOutDto,
30
- Model,
31
- PublishFormats,
32
- QueryModel,
33
- Report,
34
- ResearcherOut,
35
- SemanticQueryOut,
36
- Snippet,
37
- SqlResults,
38
- StatusEnum,
39
- StructuredParseResult,
40
- TimeDimensionModel,
41
- Tools,
42
- UploadDocumentsOut,
43
- UrlResult,
44
- ValidationError,
45
- ValidationErrorLocItem,
46
- WorkflowStatusOut,
47
- )
48
- from .errors import InternalServerError, NotFoundError, UnprocessableEntityError, UnsupportedMediaTypeError
49
- from . import chain, dataset, message, query, report, search, snippet, tools, upload, workflow
50
- from .environment import AthenaEnvironment
51
- from .tools import ToolsDataFrameRequestColumnsItem
52
- from .version import __version__
53
-
54
- __all__ = [
55
- "AthenaDocumentV2Out",
56
- "AthenaEnvironment",
57
- "ConvertPdfToSheetOut",
58
- "DataFrameParsingError",
59
- "DataFrameRequestOut",
60
- "DataFrameRequestOutColumnsItem",
61
- "DataFrameRequestOutDataItemItem",
62
- "DataFrameRequestOutIndexItem",
63
- "DataFrameUnknownFormatError",
64
- "Dataset",
65
- "Document",
66
- "ExcecuteToolFirstWorkflowOut",
67
- "FileDataResponse",
68
- "FileFetchError",
69
- "FilterModel",
70
- "FilterOperator",
71
- "FirecrawlScrapeUrlDataReponseDto",
72
- "FirecrawlScrapeUrlMetadata",
73
- "GetDatasetsResponse",
74
- "GetSnippetOut",
75
- "GetSnippetsResponse",
76
- "HttpValidationError",
77
- "InternalServerError",
78
- "LangchainDocumentsRequestOut",
79
- "LlmModel",
80
- "MapReduceChainOut",
81
- "MessageOut",
82
- "MessageOutDto",
83
- "Model",
84
- "NotFoundError",
85
- "PublishFormats",
86
- "QueryModel",
87
- "Report",
88
- "ResearcherOut",
89
- "SemanticQueryOut",
90
- "Snippet",
91
- "SqlResults",
92
- "StatusEnum",
93
- "StructuredParseResult",
94
- "TimeDimensionModel",
95
- "Tools",
96
- "ToolsDataFrameRequestColumnsItem",
97
- "UnprocessableEntityError",
98
- "UnsupportedMediaTypeError",
99
- "UploadDocumentsOut",
100
- "UrlResult",
101
- "ValidationError",
102
- "ValidationErrorLocItem",
103
- "WorkflowStatusOut",
104
- "__version__",
105
- "chain",
106
- "dataset",
107
- "message",
108
- "query",
109
- "report",
110
- "search",
111
- "snippet",
112
- "tools",
113
- "upload",
114
- "workflow",
115
- ]
@@ -1,2 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-