athena-intelligence 0.1.88__tar.gz → 0.1.89__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.
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/PKG-INFO +1 -1
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/pyproject.toml +1 -1
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/client.py +71 -6
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/client_wrapper.py +1 -1
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/README.md +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/base_client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/chain/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/chain/client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/api_error.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/datetime_utils.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/file.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/http_client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/jsonable_encoder.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/pydantic_utilities.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/query_encoder.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/remove_none_from_dict.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/request_options.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/dataset/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/dataset/client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/environment.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/errors/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/errors/internal_server_error.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/errors/not_found_error.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/errors/unprocessable_entity_error.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/errors/unsupported_media_type_error.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/message/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/message/client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/polling_message_client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/py.typed +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/query/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/query/client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/report/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/report/client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/search/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/search/client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/snippet/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/snippet/client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/tools/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/tools/client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/tools/types/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/tools/types/tools_data_frame_request_columns_item.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/athena_document_v_2_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/convert_pdf_to_sheet_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/data_frame_parsing_error.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/data_frame_request_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/data_frame_request_out_columns_item.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/data_frame_request_out_data_item_item.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/data_frame_request_out_index_item.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/data_frame_unknown_format_error.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/dataset.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/document.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/excecute_tool_first_workflow_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/file_data_response.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/file_fetch_error.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/filter_model.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/filter_operator.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/firecrawl_scrape_url_data_reponse_dto.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/firecrawl_scrape_url_metadata.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/get_datasets_response.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/get_snippet_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/get_snippets_response.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/http_validation_error.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/langchain_documents_request_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/llm_model.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/map_reduce_chain_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/message_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/message_out_dto.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/model.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/publish_formats.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/query_model.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/report.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/researcher_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/semantic_query_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/snippet.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/sql_results.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/status_enum.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/structured_parse_result.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/time_dimension_model.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/tools.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/upload_documents_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/url_result.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/validation_error.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/validation_error_loc_item.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/workflow_status_out.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/upload/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/upload/client.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/version.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/workflow/__init__.py +0 -0
- {athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/workflow/client.py +0 -0
@@ -21,42 +21,103 @@ T = TypeVar("T")
|
|
21
21
|
U = TypeVar('U')
|
22
22
|
|
23
23
|
|
24
|
-
def
|
25
|
-
|
24
|
+
def _inherit_signature_and_doc(
|
25
|
+
f: typing.Callable[P, T],
|
26
|
+
replace_in_doc: typing.Dict[str, str]
|
27
|
+
) -> typing.Callable[..., typing.Callable[P, U]]:
|
28
|
+
def decorator(decorated):
|
29
|
+
for old, new in replace_in_doc.items():
|
30
|
+
assert old in f.__doc__
|
31
|
+
decorated.__doc__ = f.__doc__.replace(old, new)
|
32
|
+
return decorated
|
33
|
+
return decorator
|
26
34
|
|
27
35
|
|
28
36
|
class WrappedToolsClient(ToolsClient):
|
29
37
|
|
30
38
|
def get_file(self, document_id: str) -> io.BytesIO:
|
39
|
+
"""
|
40
|
+
Parameters
|
41
|
+
----------
|
42
|
+
document_id : str
|
43
|
+
|
44
|
+
Returns
|
45
|
+
-------
|
46
|
+
io.BytesIO
|
47
|
+
|
48
|
+
Examples
|
49
|
+
--------
|
50
|
+
import polars as pl
|
51
|
+
from athena.client import Athena
|
52
|
+
|
53
|
+
client = Athena(api_key="YOUR_API_KEY")
|
54
|
+
file_io = client.tools.get_file(document_id="document_id")
|
55
|
+
pl.read_csv(file_io)
|
56
|
+
"""
|
31
57
|
file_bytes = b''.join(self.raw_data(document_id=document_id))
|
32
58
|
bytes_io = io.BytesIO(file_bytes)
|
33
59
|
return bytes_io
|
34
60
|
|
35
|
-
@
|
61
|
+
@_inherit_signature_and_doc(ToolsClient.data_frame, {'DataFrameRequestOut': 'pd.DataFrame'})
|
36
62
|
def data_frame(self, *, document_id: str, **kwargs) -> 'pd.DataFrame':
|
37
63
|
_check_pandas_installed()
|
38
64
|
model = super().data_frame(document_id=document_id, **kwargs)
|
39
65
|
return _read_json_frame(model)
|
40
66
|
|
41
67
|
def read_data_frame(self, document_id: str, *args, **kwargs) -> 'pd.DataFrame':
|
68
|
+
"""
|
69
|
+
Parameters
|
70
|
+
----------
|
71
|
+
document_id : str
|
72
|
+
|
73
|
+
**kwargs : dict
|
74
|
+
keyword arguments passed to pandas `read_csv` or `read_excel` function,
|
75
|
+
depending on the file type of the document identified by `document_id`.
|
76
|
+
|
77
|
+
Returns
|
78
|
+
-------
|
79
|
+
pd.DataFrame
|
80
|
+
|
81
|
+
Examples
|
82
|
+
--------
|
83
|
+
from athena.client import Athena
|
84
|
+
|
85
|
+
client = Athena(api_key="YOUR_API_KEY")
|
86
|
+
client.tools.read_data_frame(document_id="document_id")
|
87
|
+
"""
|
42
88
|
_check_pandas_installed()
|
43
89
|
file_bytes = self.get_file(document_id)
|
44
90
|
return _to_pandas_df(file_bytes, *args, **kwargs)
|
45
91
|
|
46
92
|
|
93
|
+
def _add_docs_for_async_variant(obj):
|
94
|
+
def decorator(decorated):
|
95
|
+
doc = obj.__doc__
|
96
|
+
name = obj.__name__
|
97
|
+
decorated.__doc__ = (
|
98
|
+
doc
|
99
|
+
.replace('client = Athena', 'client = AsyncAthena')
|
100
|
+
.replace(f'client.tools.{name}', f'await client.tools.{name}')
|
101
|
+
)
|
102
|
+
return decorated
|
103
|
+
return decorator
|
104
|
+
|
105
|
+
|
47
106
|
class WrappedAsyncToolsClient(AsyncToolsClient):
|
48
107
|
|
108
|
+
@_add_docs_for_async_variant(WrappedToolsClient.get_file)
|
49
109
|
async def get_file(self, document_id: str) -> io.BytesIO:
|
50
110
|
file_bytes = b''.join([gen async for gen in self.raw_data(document_id=document_id)])
|
51
111
|
bytes_io = io.BytesIO(file_bytes)
|
52
112
|
return bytes_io
|
53
113
|
|
54
|
-
@
|
114
|
+
@_inherit_signature_and_doc(AsyncToolsClient.data_frame, {'DataFrameRequestOut': 'pd.DataFrame'})
|
55
115
|
async def data_frame(self, *, document_id: str, **kwargs) -> 'pd.DataFrame':
|
56
116
|
_check_pandas_installed()
|
57
117
|
model = await super().data_frame(document_id=document_id, **kwargs)
|
58
118
|
return _read_json_frame(model)
|
59
119
|
|
120
|
+
@_add_docs_for_async_variant(WrappedToolsClient.read_data_frame)
|
60
121
|
async def read_data_frame(self, document_id: str, *args, **kwargs) -> 'pd.DataFrame':
|
61
122
|
_check_pandas_installed()
|
62
123
|
file_bytes = await self.get_file(document_id)
|
@@ -83,7 +144,7 @@ class Athena(BaseAthena):
|
|
83
144
|
|
84
145
|
api_key: typing.Optional[str]. The API key. Required when used outside of the athena notebook environment.
|
85
146
|
timeout : typing.Optional[float]
|
86
|
-
The timeout to be used, in seconds, for requests
|
147
|
+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
87
148
|
|
88
149
|
httpx_client : typing.Optional[httpx.Client]
|
89
150
|
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
@@ -97,6 +158,8 @@ class Athena(BaseAthena):
|
|
97
158
|
)
|
98
159
|
"""
|
99
160
|
|
161
|
+
tools: WrappedToolsClient
|
162
|
+
|
100
163
|
def __init__(
|
101
164
|
self,
|
102
165
|
*,
|
@@ -147,7 +210,7 @@ class AsyncAthena(AsyncBaseAthena):
|
|
147
210
|
|
148
211
|
api_key: typing.Optional[str]. The API key. Required when used outside of the athena notebook environment.
|
149
212
|
timeout : typing.Optional[float]
|
150
|
-
The timeout to be used, in seconds, for requests
|
213
|
+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
151
214
|
|
152
215
|
httpx_client : typing.Optional[httpx.AsyncClient]
|
153
216
|
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
@@ -161,6 +224,8 @@ class AsyncAthena(AsyncBaseAthena):
|
|
161
224
|
)
|
162
225
|
"""
|
163
226
|
|
227
|
+
tools: WrappedAsyncToolsClient
|
228
|
+
|
164
229
|
def __init__(
|
165
230
|
self,
|
166
231
|
*,
|
@@ -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.
|
20
|
+
"X-Fern-SDK-Version": "0.1.89",
|
21
21
|
}
|
22
22
|
headers["X-API-KEY"] = self.api_key
|
23
23
|
return headers
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/jsonable_encoder.py
RENAMED
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/pydantic_utilities.py
RENAMED
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/remove_none_from_dict.py
RENAMED
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/core/request_options.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/errors/internal_server_error.py
RENAMED
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/errors/not_found_error.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/polling_message_client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/tools/types/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/data_frame_request_out.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/file_data_response.py
RENAMED
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/file_fetch_error.py
RENAMED
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/filter_operator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/get_datasets_response.py
RENAMED
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/get_snippet_out.py
RENAMED
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/get_snippets_response.py
RENAMED
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/http_validation_error.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/map_reduce_chain_out.py
RENAMED
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/message_out_dto.py
RENAMED
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/publish_formats.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/researcher_out.py
RENAMED
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/semantic_query_out.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/time_dimension_model.py
RENAMED
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/upload_documents_out.py
RENAMED
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/validation_error.py
RENAMED
File without changes
|
File without changes
|
{athena_intelligence-0.1.88 → athena_intelligence-0.1.89}/src/athena/types/workflow_status_out.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|