athena-intelligence 0.1.124__tar.gz → 0.1.125__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 (86) hide show
  1. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/PKG-INFO +1 -1
  2. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/pyproject.toml +1 -1
  3. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/client.py +35 -24
  4. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/client_wrapper.py +1 -1
  5. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/README.md +0 -0
  6. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/__init__.py +0 -0
  7. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/agents/__init__.py +0 -0
  8. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/agents/client.py +0 -0
  9. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/agents/drive/__init__.py +0 -0
  10. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/agents/drive/client.py +0 -0
  11. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/agents/general/__init__.py +0 -0
  12. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/agents/general/client.py +0 -0
  13. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/agents/research/__init__.py +0 -0
  14. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/agents/research/client.py +0 -0
  15. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/agents/sql/__init__.py +0 -0
  16. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/agents/sql/client.py +0 -0
  17. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/base_client.py +0 -0
  18. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/__init__.py +0 -0
  19. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/api_error.py +0 -0
  20. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/datetime_utils.py +0 -0
  21. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/file.py +0 -0
  22. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/http_client.py +0 -0
  23. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/jsonable_encoder.py +0 -0
  24. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/pydantic_utilities.py +0 -0
  25. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/query_encoder.py +0 -0
  26. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/remove_none_from_dict.py +0 -0
  27. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/core/request_options.py +0 -0
  28. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/environment.py +0 -0
  29. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/errors/__init__.py +0 -0
  30. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/errors/bad_request_error.py +0 -0
  31. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/errors/content_too_large_error.py +0 -0
  32. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/errors/internal_server_error.py +0 -0
  33. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/errors/not_found_error.py +0 -0
  34. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/errors/unauthorized_error.py +0 -0
  35. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/errors/unprocessable_entity_error.py +0 -0
  36. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/errors/unsupported_media_type_error.py +0 -0
  37. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/py.typed +0 -0
  38. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/query/__init__.py +0 -0
  39. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/query/client.py +0 -0
  40. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/query/types/__init__.py +0 -0
  41. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/query/types/query_execute_request_database_asset_ids.py +0 -0
  42. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/__init__.py +0 -0
  43. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/calendar/__init__.py +0 -0
  44. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/calendar/client.py +0 -0
  45. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/client.py +0 -0
  46. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/email/__init__.py +0 -0
  47. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/email/client.py +0 -0
  48. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/structured_data_extractor/__init__.py +0 -0
  49. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/structured_data_extractor/client.py +0 -0
  50. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/tasks/__init__.py +0 -0
  51. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/tasks/client.py +0 -0
  52. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/types/__init__.py +0 -0
  53. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/tools/types/tools_data_frame_request_columns_item.py +0 -0
  54. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/__init__.py +0 -0
  55. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/asset_node.py +0 -0
  56. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/asset_not_found_error.py +0 -0
  57. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/chunk.py +0 -0
  58. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/chunk_content_item.py +0 -0
  59. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/chunk_result.py +0 -0
  60. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/chunk_result_chunk_id.py +0 -0
  61. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/custom_agent_response.py +0 -0
  62. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/data_frame_request_out.py +0 -0
  63. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/data_frame_request_out_columns_item.py +0 -0
  64. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/data_frame_request_out_data_item_item.py +0 -0
  65. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/data_frame_request_out_index_item.py +0 -0
  66. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/data_frame_unknown_format_error.py +0 -0
  67. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/document_chunk.py +0 -0
  68. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/drive_agent_response.py +0 -0
  69. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/file_chunk_request_out.py +0 -0
  70. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/file_too_large_error.py +0 -0
  71. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/folder_response.py +0 -0
  72. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/general_agent_config.py +0 -0
  73. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/general_agent_config_enabled_tools_item.py +0 -0
  74. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/general_agent_request.py +0 -0
  75. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/general_agent_response.py +0 -0
  76. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/image_url_content.py +0 -0
  77. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/parent_folder_error.py +0 -0
  78. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/prompt_message.py +0 -0
  79. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/research_agent_response.py +0 -0
  80. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/save_asset_request_out.py +0 -0
  81. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/sql_agent_response.py +0 -0
  82. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/structured_data_extractor_response.py +0 -0
  83. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/text_content.py +0 -0
  84. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/tool.py +0 -0
  85. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/src/athena/types/type.py +0 -0
  86. {athena_intelligence-0.1.124 → athena_intelligence-0.1.125}/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.124
3
+ Version: 0.1.125
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.124"
3
+ version = "0.1.125"
4
4
  description = "Athena Intelligence Python Library"
5
5
  readme = "README.md"
6
6
  authors = []
@@ -7,7 +7,7 @@ import typing
7
7
  import warnings
8
8
 
9
9
  import httpx
10
- from typing import cast, List, Union
10
+ from typing import cast, List, Tuple, Union
11
11
  from typing_extensions import TypeVar, ParamSpec
12
12
 
13
13
  from . import core
@@ -116,8 +116,8 @@ class WrappedToolsClient(ToolsClient):
116
116
  client.tools.read_data_frame(asset_id="asset_id")
117
117
  """
118
118
  _check_pandas_installed()
119
- file_bytes = self.get_file(asset_id)
120
- return _to_pandas_df(file_bytes, *args, **kwargs)
119
+ file_bytes, media_type = self._get_file_and_media_type(asset_id=asset_id)
120
+ return _to_pandas_df(file_bytes, *args, media_type=media_type, **kwargs)
121
121
 
122
122
 
123
123
  def save_asset( # type: ignore[override]
@@ -131,7 +131,7 @@ class WrappedToolsClient(ToolsClient):
131
131
  """
132
132
  Parameters
133
133
  ----------
134
- asset_object : pd.DataFrame | pd.Series | core.File
134
+ asset_object : pd.DataFrame | pd.Series | matplotlib.figure.Figure | core.File
135
135
  A pandas data frame, series, matplotlib figure, or core.File
136
136
 
137
137
  parent_folder_id : typing.Optional[str]
@@ -143,6 +143,8 @@ class WrappedToolsClient(ToolsClient):
143
143
  request_options : typing.Optional[RequestOptions]
144
144
  Request-specific configuration.
145
145
 
146
+ **kwargs : passed down to conversion methods
147
+
146
148
  Returns
147
149
  -------
148
150
  SaveAssetRequestOut
@@ -155,27 +157,14 @@ class WrappedToolsClient(ToolsClient):
155
157
  client = Athena(api_key="YOUR_API_KEY")
156
158
  client.tools.save_asset(df)
157
159
  """
158
- asset_object = _convert_asset_object(asset_object=asset_object, name=name)
160
+ asset_object = _convert_asset_object(asset_object=asset_object, name=name, **kwargs)
159
161
  return super().save_asset(
160
- file=asset_object, parent_folder_id=parent_folder_id, **kwargs
162
+ file=asset_object, parent_folder_id=parent_folder_id
161
163
  )
162
164
 
163
- def get_asset(self, asset_id: str) -> Union["pd.DataFrame", AthenaAsset]:
165
+ def _get_file_and_media_type(self, asset_id: str) -> Tuple[io.BytesIO, str]:
164
166
  """
165
- Parameters
166
- ----------
167
- asset_id : str
168
-
169
- Returns
170
- -------
171
- pd.DataFrame or AthenaAsset
172
-
173
- Examples
174
- --------
175
- from athena.client import Athena
176
-
177
- client = Athena(api_key="YOUR_API_KEY")
178
- client.tools.get_asset(asset_id="asset_id")
167
+ Gets the file togehter with media type returned by server
179
168
  """
180
169
  # while we wait for https://github.com/fern-api/fern/issues/4316
181
170
  result = self._client_wrapper.httpx_client.request(
@@ -196,6 +185,27 @@ class WrappedToolsClient(ToolsClient):
196
185
  # fallback to `libmagic` inference
197
186
  media_type = _infer_media_type(bytes_io=file_bytes)
198
187
 
188
+ return file_bytes, media_type
189
+
190
+ def get_asset(self, asset_id: str) -> Union["pd.DataFrame", AthenaAsset]:
191
+ """
192
+ Parameters
193
+ ----------
194
+ asset_id : str
195
+
196
+ Returns
197
+ -------
198
+ pd.DataFrame or AthenaAsset
199
+
200
+ Examples
201
+ --------
202
+ from athena.client import Athena
203
+
204
+ client = Athena(api_key="YOUR_API_KEY")
205
+ client.tools.get_asset(asset_id="asset_id")
206
+ """
207
+ file_bytes, media_type = self._get_file_and_media_type(asset_id=asset_id)
208
+
199
209
  media_type_aliases = {"image/jpg": "image/jpeg"}
200
210
  media_type = media_type_aliases.get(media_type, media_type)
201
211
 
@@ -289,9 +299,9 @@ class WrappedAsyncToolsClient(AsyncToolsClient):
289
299
  name: Union[str, None] = None,
290
300
  **kwargs,
291
301
  ) -> SaveAssetRequestOut:
292
- asset_object = _convert_asset_object(asset_object=asset_object, name=name)
302
+ asset_object = _convert_asset_object(asset_object=asset_object, name=name, **kwargs)
293
303
  return await super().save_asset(
294
- file=asset_object, parent_folder_id=parent_folder_id, **kwargs
304
+ file=asset_object, parent_folder_id=parent_folder_id
295
305
  )
296
306
 
297
307
 
@@ -514,6 +524,7 @@ def _to_pandas_df(
514
524
  def _convert_asset_object(
515
525
  asset_object: Union["pd.DataFrame", "pd.Series", core.File],
516
526
  name: Union[str, None] = None,
527
+ **kwargs
517
528
  ) -> core.File:
518
529
  import pandas as pd
519
530
  try:
@@ -526,7 +537,7 @@ def _convert_asset_object(
526
537
  if isinstance(asset_object, pd.DataFrame):
527
538
  return (
528
539
  name or "Uploaded data frame",
529
- asset_object.to_parquet(path=None),
540
+ asset_object.to_parquet(path=None, **kwargs),
530
541
  "application/vnd.apache.parquet",
531
542
  )
532
543
  if format_display_data:
@@ -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.124",
20
+ "X-Fern-SDK-Version": "0.1.125",
21
21
  }
22
22
  headers["X-API-KEY"] = self.api_key
23
23
  return headers