athena-intelligence 0.1.118__py3-none-any.whl → 0.1.120__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.
Files changed (44) hide show
  1. athena/__init__.py +38 -1
  2. athena/agents/__init__.py +5 -0
  3. athena/agents/client.py +169 -0
  4. athena/agents/drive/__init__.py +2 -0
  5. athena/agents/drive/client.py +134 -0
  6. athena/agents/general/__init__.py +2 -0
  7. athena/agents/general/client.py +397 -0
  8. athena/agents/research/__init__.py +2 -0
  9. athena/agents/research/client.py +134 -0
  10. athena/agents/sql/__init__.py +2 -0
  11. athena/agents/sql/client.py +134 -0
  12. athena/base_client.py +3 -0
  13. athena/core/client_wrapper.py +1 -1
  14. athena/tools/__init__.py +2 -1
  15. athena/tools/calendar/__init__.py +2 -0
  16. athena/tools/calendar/client.py +155 -0
  17. athena/tools/client.py +12 -0
  18. athena/tools/email/__init__.py +2 -0
  19. athena/tools/email/client.py +223 -0
  20. athena/tools/structured_data_extractor/__init__.py +2 -0
  21. athena/tools/structured_data_extractor/client.py +150 -0
  22. athena/tools/tasks/__init__.py +2 -0
  23. athena/tools/tasks/client.py +87 -0
  24. athena/types/__init__.py +40 -0
  25. athena/types/custom_agent_response.py +32 -0
  26. athena/types/drive_agent_response.py +32 -0
  27. athena/types/general_agent_config.py +36 -0
  28. athena/types/general_agent_config_enabled_tools_item.py +7 -0
  29. athena/types/general_agent_request.py +39 -0
  30. athena/types/general_agent_request_messages_item.py +32 -0
  31. athena/types/general_agent_request_messages_item_content.py +7 -0
  32. athena/types/general_agent_request_messages_item_content_item.py +60 -0
  33. athena/types/general_agent_request_messages_item_content_item_image_url.py +29 -0
  34. athena/types/general_agent_request_messages_item_content_item_text.py +29 -0
  35. athena/types/general_agent_request_messages_item_type.py +25 -0
  36. athena/types/general_agent_response.py +33 -0
  37. athena/types/research_agent_response.py +32 -0
  38. athena/types/sql_agent_response.py +37 -0
  39. athena/types/structured_data_extractor_reponse.py +36 -0
  40. athena/types/tool.py +17 -0
  41. {athena_intelligence-0.1.118.dist-info → athena_intelligence-0.1.120.dist-info}/METADATA +1 -1
  42. athena_intelligence-0.1.120.dist-info/RECORD +82 -0
  43. athena_intelligence-0.1.118.dist-info/RECORD +0 -48
  44. {athena_intelligence-0.1.118.dist-info → athena_intelligence-0.1.120.dist-info}/WHEEL +0 -0
@@ -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.118",
20
+ "X-Fern-SDK-Version": "0.1.120",
21
21
  }
22
22
  headers["X-API-KEY"] = self.api_key
23
23
  return headers
athena/tools/__init__.py CHANGED
@@ -1,5 +1,6 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  from .types import ToolsDataFrameRequestColumnsItem
4
+ from . import calendar, email, structured_data_extractor, tasks
4
5
 
5
- __all__ = ["ToolsDataFrameRequestColumnsItem"]
6
+ __all__ = ["ToolsDataFrameRequestColumnsItem", "calendar", "email", "structured_data_extractor", "tasks"]
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,155 @@
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
+
11
+
12
+ class CalendarClient:
13
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
14
+ self._client_wrapper = client_wrapper
15
+
16
+ def list_events(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
17
+ """
18
+ Coming soon! List calendar events with optional filtering.
19
+
20
+ Parameters
21
+ ----------
22
+ request_options : typing.Optional[RequestOptions]
23
+ Request-specific configuration.
24
+
25
+ Returns
26
+ -------
27
+ typing.Any
28
+ Successful Response
29
+
30
+ Examples
31
+ --------
32
+ from athena.client import Athena
33
+
34
+ client = Athena(
35
+ api_key="YOUR_API_KEY",
36
+ )
37
+ client.tools.calendar.list_events()
38
+ """
39
+ _response = self._client_wrapper.httpx_client.request(
40
+ "api/v0/tools/calendar/events", method="GET", request_options=request_options
41
+ )
42
+ if 200 <= _response.status_code < 300:
43
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
44
+ try:
45
+ _response_json = _response.json()
46
+ except JSONDecodeError:
47
+ raise ApiError(status_code=_response.status_code, body=_response.text)
48
+ raise ApiError(status_code=_response.status_code, body=_response_json)
49
+
50
+ def create_event(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
51
+ """
52
+ Coming soon! Create new calendar events.
53
+
54
+ Parameters
55
+ ----------
56
+ request_options : typing.Optional[RequestOptions]
57
+ Request-specific configuration.
58
+
59
+ Returns
60
+ -------
61
+ typing.Any
62
+ Successful Response
63
+
64
+ Examples
65
+ --------
66
+ from athena.client import Athena
67
+
68
+ client = Athena(
69
+ api_key="YOUR_API_KEY",
70
+ )
71
+ client.tools.calendar.create_event()
72
+ """
73
+ _response = self._client_wrapper.httpx_client.request(
74
+ "api/v0/tools/calendar/events", method="POST", request_options=request_options
75
+ )
76
+ if 200 <= _response.status_code < 300:
77
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
78
+ try:
79
+ _response_json = _response.json()
80
+ except JSONDecodeError:
81
+ raise ApiError(status_code=_response.status_code, body=_response.text)
82
+ raise ApiError(status_code=_response.status_code, body=_response_json)
83
+
84
+
85
+ class AsyncCalendarClient:
86
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
87
+ self._client_wrapper = client_wrapper
88
+
89
+ async def list_events(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
90
+ """
91
+ Coming soon! List calendar events with optional filtering.
92
+
93
+ Parameters
94
+ ----------
95
+ request_options : typing.Optional[RequestOptions]
96
+ Request-specific configuration.
97
+
98
+ Returns
99
+ -------
100
+ typing.Any
101
+ Successful Response
102
+
103
+ Examples
104
+ --------
105
+ from athena.client import AsyncAthena
106
+
107
+ client = AsyncAthena(
108
+ api_key="YOUR_API_KEY",
109
+ )
110
+ await client.tools.calendar.list_events()
111
+ """
112
+ _response = await self._client_wrapper.httpx_client.request(
113
+ "api/v0/tools/calendar/events", method="GET", request_options=request_options
114
+ )
115
+ if 200 <= _response.status_code < 300:
116
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
117
+ try:
118
+ _response_json = _response.json()
119
+ except JSONDecodeError:
120
+ raise ApiError(status_code=_response.status_code, body=_response.text)
121
+ raise ApiError(status_code=_response.status_code, body=_response_json)
122
+
123
+ async def create_event(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
124
+ """
125
+ Coming soon! Create new calendar events.
126
+
127
+ Parameters
128
+ ----------
129
+ request_options : typing.Optional[RequestOptions]
130
+ Request-specific configuration.
131
+
132
+ Returns
133
+ -------
134
+ typing.Any
135
+ Successful Response
136
+
137
+ Examples
138
+ --------
139
+ from athena.client import AsyncAthena
140
+
141
+ client = AsyncAthena(
142
+ api_key="YOUR_API_KEY",
143
+ )
144
+ await client.tools.calendar.create_event()
145
+ """
146
+ _response = await self._client_wrapper.httpx_client.request(
147
+ "api/v0/tools/calendar/events", method="POST", request_options=request_options
148
+ )
149
+ if 200 <= _response.status_code < 300:
150
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
151
+ try:
152
+ _response_json = _response.json()
153
+ except JSONDecodeError:
154
+ raise ApiError(status_code=_response.status_code, body=_response.text)
155
+ raise ApiError(status_code=_response.status_code, body=_response_json)
athena/tools/client.py CHANGED
@@ -22,6 +22,10 @@ from ..types.file_chunk_request_out import FileChunkRequestOut
22
22
  from ..types.file_too_large_error import FileTooLargeError
23
23
  from ..types.parent_folder_error import ParentFolderError
24
24
  from ..types.save_asset_request_out import SaveAssetRequestOut
25
+ from .calendar.client import AsyncCalendarClient, CalendarClient
26
+ from .email.client import AsyncEmailClient, EmailClient
27
+ from .structured_data_extractor.client import AsyncStructuredDataExtractorClient, StructuredDataExtractorClient
28
+ from .tasks.client import AsyncTasksClient, TasksClient
25
29
  from .types.tools_data_frame_request_columns_item import ToolsDataFrameRequestColumnsItem
26
30
 
27
31
  # this is used as the default value for optional parameters
@@ -31,6 +35,10 @@ OMIT = typing.cast(typing.Any, ...)
31
35
  class ToolsClient:
32
36
  def __init__(self, *, client_wrapper: SyncClientWrapper):
33
37
  self._client_wrapper = client_wrapper
38
+ self.calendar = CalendarClient(client_wrapper=self._client_wrapper)
39
+ self.email = EmailClient(client_wrapper=self._client_wrapper)
40
+ self.structured_data_extractor = StructuredDataExtractorClient(client_wrapper=self._client_wrapper)
41
+ self.tasks = TasksClient(client_wrapper=self._client_wrapper)
34
42
 
35
43
  def get_asset_chunks(
36
44
  self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
@@ -280,6 +288,10 @@ class ToolsClient:
280
288
  class AsyncToolsClient:
281
289
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
282
290
  self._client_wrapper = client_wrapper
291
+ self.calendar = AsyncCalendarClient(client_wrapper=self._client_wrapper)
292
+ self.email = AsyncEmailClient(client_wrapper=self._client_wrapper)
293
+ self.structured_data_extractor = AsyncStructuredDataExtractorClient(client_wrapper=self._client_wrapper)
294
+ self.tasks = AsyncTasksClient(client_wrapper=self._client_wrapper)
283
295
 
284
296
  async def get_asset_chunks(
285
297
  self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,223 @@
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
+
11
+
12
+ class EmailClient:
13
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
14
+ self._client_wrapper = client_wrapper
15
+
16
+ def create_draft(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
17
+ """
18
+ Coming soon! Create email drafts with specified content and recipients.
19
+
20
+ Parameters
21
+ ----------
22
+ request_options : typing.Optional[RequestOptions]
23
+ Request-specific configuration.
24
+
25
+ Returns
26
+ -------
27
+ typing.Any
28
+ Successful Response
29
+
30
+ Examples
31
+ --------
32
+ from athena.client import Athena
33
+
34
+ client = Athena(
35
+ api_key="YOUR_API_KEY",
36
+ )
37
+ client.tools.email.create_draft()
38
+ """
39
+ _response = self._client_wrapper.httpx_client.request(
40
+ "api/v0/tools/email/draft", method="POST", request_options=request_options
41
+ )
42
+ if 200 <= _response.status_code < 300:
43
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
44
+ try:
45
+ _response_json = _response.json()
46
+ except JSONDecodeError:
47
+ raise ApiError(status_code=_response.status_code, body=_response.text)
48
+ raise ApiError(status_code=_response.status_code, body=_response_json)
49
+
50
+ def search(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
51
+ """
52
+ Coming soon! Search through emails with configurable filters.
53
+
54
+ Parameters
55
+ ----------
56
+ request_options : typing.Optional[RequestOptions]
57
+ Request-specific configuration.
58
+
59
+ Returns
60
+ -------
61
+ typing.Any
62
+ Successful Response
63
+
64
+ Examples
65
+ --------
66
+ from athena.client import Athena
67
+
68
+ client = Athena(
69
+ api_key="YOUR_API_KEY",
70
+ )
71
+ client.tools.email.search()
72
+ """
73
+ _response = self._client_wrapper.httpx_client.request(
74
+ "api/v0/tools/email/search", method="GET", request_options=request_options
75
+ )
76
+ if 200 <= _response.status_code < 300:
77
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
78
+ try:
79
+ _response_json = _response.json()
80
+ except JSONDecodeError:
81
+ raise ApiError(status_code=_response.status_code, body=_response.text)
82
+ raise ApiError(status_code=_response.status_code, body=_response_json)
83
+
84
+ def send(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
85
+ """
86
+ Coming soon! Send emails to specified recipients.
87
+
88
+ Parameters
89
+ ----------
90
+ request_options : typing.Optional[RequestOptions]
91
+ Request-specific configuration.
92
+
93
+ Returns
94
+ -------
95
+ typing.Any
96
+ Successful Response
97
+
98
+ Examples
99
+ --------
100
+ from athena.client import Athena
101
+
102
+ client = Athena(
103
+ api_key="YOUR_API_KEY",
104
+ )
105
+ client.tools.email.send()
106
+ """
107
+ _response = self._client_wrapper.httpx_client.request(
108
+ "api/v0/tools/email/send", method="POST", request_options=request_options
109
+ )
110
+ if 200 <= _response.status_code < 300:
111
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
112
+ try:
113
+ _response_json = _response.json()
114
+ except JSONDecodeError:
115
+ raise ApiError(status_code=_response.status_code, body=_response.text)
116
+ raise ApiError(status_code=_response.status_code, body=_response_json)
117
+
118
+
119
+ class AsyncEmailClient:
120
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
121
+ self._client_wrapper = client_wrapper
122
+
123
+ async def create_draft(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
124
+ """
125
+ Coming soon! Create email drafts with specified content and recipients.
126
+
127
+ Parameters
128
+ ----------
129
+ request_options : typing.Optional[RequestOptions]
130
+ Request-specific configuration.
131
+
132
+ Returns
133
+ -------
134
+ typing.Any
135
+ Successful Response
136
+
137
+ Examples
138
+ --------
139
+ from athena.client import AsyncAthena
140
+
141
+ client = AsyncAthena(
142
+ api_key="YOUR_API_KEY",
143
+ )
144
+ await client.tools.email.create_draft()
145
+ """
146
+ _response = await self._client_wrapper.httpx_client.request(
147
+ "api/v0/tools/email/draft", method="POST", request_options=request_options
148
+ )
149
+ if 200 <= _response.status_code < 300:
150
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
151
+ try:
152
+ _response_json = _response.json()
153
+ except JSONDecodeError:
154
+ raise ApiError(status_code=_response.status_code, body=_response.text)
155
+ raise ApiError(status_code=_response.status_code, body=_response_json)
156
+
157
+ async def search(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
158
+ """
159
+ Coming soon! Search through emails with configurable filters.
160
+
161
+ Parameters
162
+ ----------
163
+ request_options : typing.Optional[RequestOptions]
164
+ Request-specific configuration.
165
+
166
+ Returns
167
+ -------
168
+ typing.Any
169
+ Successful Response
170
+
171
+ Examples
172
+ --------
173
+ from athena.client import AsyncAthena
174
+
175
+ client = AsyncAthena(
176
+ api_key="YOUR_API_KEY",
177
+ )
178
+ await client.tools.email.search()
179
+ """
180
+ _response = await self._client_wrapper.httpx_client.request(
181
+ "api/v0/tools/email/search", method="GET", request_options=request_options
182
+ )
183
+ if 200 <= _response.status_code < 300:
184
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
185
+ try:
186
+ _response_json = _response.json()
187
+ except JSONDecodeError:
188
+ raise ApiError(status_code=_response.status_code, body=_response.text)
189
+ raise ApiError(status_code=_response.status_code, body=_response_json)
190
+
191
+ async def send(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
192
+ """
193
+ Coming soon! Send emails to specified recipients.
194
+
195
+ Parameters
196
+ ----------
197
+ request_options : typing.Optional[RequestOptions]
198
+ Request-specific configuration.
199
+
200
+ Returns
201
+ -------
202
+ typing.Any
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.email.send()
213
+ """
214
+ _response = await self._client_wrapper.httpx_client.request(
215
+ "api/v0/tools/email/send", method="POST", request_options=request_options
216
+ )
217
+ if 200 <= _response.status_code < 300:
218
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
219
+ try:
220
+ _response_json = _response.json()
221
+ except JSONDecodeError:
222
+ raise ApiError(status_code=_response.status_code, body=_response.text)
223
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,150 @@
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.unprocessable_entity_error import UnprocessableEntityError
11
+ from ...types.structured_data_extractor_reponse import StructuredDataExtractorReponse
12
+
13
+ # this is used as the default value for optional parameters
14
+ OMIT = typing.cast(typing.Any, ...)
15
+
16
+
17
+ class StructuredDataExtractorClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._client_wrapper = client_wrapper
20
+
21
+ def invoke(
22
+ self,
23
+ *,
24
+ asset_ids: typing.Sequence[str],
25
+ json_schema: typing.Dict[str, typing.Any],
26
+ map_: typing.Optional[bool] = OMIT,
27
+ reduce: typing.Optional[bool] = OMIT,
28
+ request_options: typing.Optional[RequestOptions] = None
29
+ ) -> StructuredDataExtractorReponse:
30
+ """
31
+ Coming soon! Extract structured data from assets of arbitrary length.
32
+
33
+ Parameters
34
+ ----------
35
+ asset_ids : typing.Sequence[str]
36
+ The IDs of the assets from which to extract structured data matching `json_schema`.
37
+
38
+ json_schema : typing.Dict[str, typing.Any]
39
+ The JSON schema to use for validation (version draft 2020-12). See the docs [here](https://json-schema.org/learn/getting-started-step-by-step).
40
+
41
+ map_ : typing.Optional[bool]
42
+ Whether to split the asset into chunks and attempt to extract the schema from each chunk. Set to false if you know the asset is small.
43
+
44
+ reduce : typing.Optional[bool]
45
+ If `map`, whether to reduce the chunks to a single structured object (true) or return the full list (false). Use True unless you want to preserve duplicates from each page or expect the object to overflow the output context.
46
+
47
+ request_options : typing.Optional[RequestOptions]
48
+ Request-specific configuration.
49
+
50
+ Returns
51
+ -------
52
+ StructuredDataExtractorReponse
53
+ Successful Response
54
+
55
+ Examples
56
+ --------
57
+ from athena.client import Athena
58
+
59
+ client = Athena(
60
+ api_key="YOUR_API_KEY",
61
+ )
62
+ client.tools.structured_data_extractor.invoke(
63
+ asset_ids=["asset_ids"],
64
+ json_schema={"key": "value"},
65
+ )
66
+ """
67
+ _response = self._client_wrapper.httpx_client.request(
68
+ "api/v0/tools/structured-data-extractor/invoke",
69
+ method="POST",
70
+ json={"asset_ids": asset_ids, "json_schema": json_schema, "map": map_, "reduce": reduce},
71
+ request_options=request_options,
72
+ omit=OMIT,
73
+ )
74
+ if 200 <= _response.status_code < 300:
75
+ return pydantic_v1.parse_obj_as(StructuredDataExtractorReponse, _response.json()) # type: ignore
76
+ if _response.status_code == 422:
77
+ raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
78
+ try:
79
+ _response_json = _response.json()
80
+ except JSONDecodeError:
81
+ raise ApiError(status_code=_response.status_code, body=_response.text)
82
+ raise ApiError(status_code=_response.status_code, body=_response_json)
83
+
84
+
85
+ class AsyncStructuredDataExtractorClient:
86
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
87
+ self._client_wrapper = client_wrapper
88
+
89
+ async def invoke(
90
+ self,
91
+ *,
92
+ asset_ids: typing.Sequence[str],
93
+ json_schema: typing.Dict[str, typing.Any],
94
+ map_: typing.Optional[bool] = OMIT,
95
+ reduce: typing.Optional[bool] = OMIT,
96
+ request_options: typing.Optional[RequestOptions] = None
97
+ ) -> StructuredDataExtractorReponse:
98
+ """
99
+ Coming soon! Extract structured data from assets of arbitrary length.
100
+
101
+ Parameters
102
+ ----------
103
+ asset_ids : typing.Sequence[str]
104
+ The IDs of the assets from which to extract structured data matching `json_schema`.
105
+
106
+ json_schema : typing.Dict[str, typing.Any]
107
+ The JSON schema to use for validation (version draft 2020-12). See the docs [here](https://json-schema.org/learn/getting-started-step-by-step).
108
+
109
+ map_ : typing.Optional[bool]
110
+ Whether to split the asset into chunks and attempt to extract the schema from each chunk. Set to false if you know the asset is small.
111
+
112
+ reduce : typing.Optional[bool]
113
+ If `map`, whether to reduce the chunks to a single structured object (true) or return the full list (false). Use True unless you want to preserve duplicates from each page or expect the object to overflow the output context.
114
+
115
+ request_options : typing.Optional[RequestOptions]
116
+ Request-specific configuration.
117
+
118
+ Returns
119
+ -------
120
+ StructuredDataExtractorReponse
121
+ Successful Response
122
+
123
+ Examples
124
+ --------
125
+ from athena.client import AsyncAthena
126
+
127
+ client = AsyncAthena(
128
+ api_key="YOUR_API_KEY",
129
+ )
130
+ await client.tools.structured_data_extractor.invoke(
131
+ asset_ids=["asset_ids"],
132
+ json_schema={"key": "value"},
133
+ )
134
+ """
135
+ _response = await self._client_wrapper.httpx_client.request(
136
+ "api/v0/tools/structured-data-extractor/invoke",
137
+ method="POST",
138
+ json={"asset_ids": asset_ids, "json_schema": json_schema, "map": map_, "reduce": reduce},
139
+ request_options=request_options,
140
+ omit=OMIT,
141
+ )
142
+ if 200 <= _response.status_code < 300:
143
+ return pydantic_v1.parse_obj_as(StructuredDataExtractorReponse, _response.json()) # type: ignore
144
+ if _response.status_code == 422:
145
+ raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
146
+ try:
147
+ _response_json = _response.json()
148
+ except JSONDecodeError:
149
+ raise ApiError(status_code=_response.status_code, body=_response.text)
150
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,87 @@
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
+
11
+
12
+ class TasksClient:
13
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
14
+ self._client_wrapper = client_wrapper
15
+
16
+ def run_task(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
17
+ """
18
+ Coming soon! Run a [task](https://resources.athenaintel.com/docs/task-studio/home).
19
+
20
+ Parameters
21
+ ----------
22
+ request_options : typing.Optional[RequestOptions]
23
+ Request-specific configuration.
24
+
25
+ Returns
26
+ -------
27
+ typing.Any
28
+ Successful Response
29
+
30
+ Examples
31
+ --------
32
+ from athena.client import Athena
33
+
34
+ client = Athena(
35
+ api_key="YOUR_API_KEY",
36
+ )
37
+ client.tools.tasks.run_task()
38
+ """
39
+ _response = self._client_wrapper.httpx_client.request(
40
+ "api/v0/tools/tasks/run", method="POST", request_options=request_options
41
+ )
42
+ if 200 <= _response.status_code < 300:
43
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
44
+ try:
45
+ _response_json = _response.json()
46
+ except JSONDecodeError:
47
+ raise ApiError(status_code=_response.status_code, body=_response.text)
48
+ raise ApiError(status_code=_response.status_code, body=_response_json)
49
+
50
+
51
+ class AsyncTasksClient:
52
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
53
+ self._client_wrapper = client_wrapper
54
+
55
+ async def run_task(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
56
+ """
57
+ Coming soon! Run a [task](https://resources.athenaintel.com/docs/task-studio/home).
58
+
59
+ Parameters
60
+ ----------
61
+ request_options : typing.Optional[RequestOptions]
62
+ Request-specific configuration.
63
+
64
+ Returns
65
+ -------
66
+ typing.Any
67
+ Successful Response
68
+
69
+ Examples
70
+ --------
71
+ from athena.client import AsyncAthena
72
+
73
+ client = AsyncAthena(
74
+ api_key="YOUR_API_KEY",
75
+ )
76
+ await client.tools.tasks.run_task()
77
+ """
78
+ _response = await self._client_wrapper.httpx_client.request(
79
+ "api/v0/tools/tasks/run", method="POST", request_options=request_options
80
+ )
81
+ if 200 <= _response.status_code < 300:
82
+ return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
83
+ try:
84
+ _response_json = _response.json()
85
+ except JSONDecodeError:
86
+ raise ApiError(status_code=_response.status_code, body=_response.text)
87
+ raise ApiError(status_code=_response.status_code, body=_response_json)