athena-intelligence 0.1.119__py3-none-any.whl → 0.1.121__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- athena/__init__.py +16 -8
- athena/agents/__init__.py +2 -2
- athena/agents/client.py +156 -6
- athena/agents/drive/client.py +134 -0
- athena/agents/{athena_assistant → general}/client.py +106 -98
- athena/agents/research/__init__.py +2 -0
- athena/agents/research/client.py +134 -0
- athena/agents/sql/__init__.py +2 -0
- athena/agents/sql/client.py +134 -0
- athena/core/client_wrapper.py +1 -1
- athena/tools/__init__.py +2 -1
- athena/tools/calendar/__init__.py +2 -0
- athena/tools/calendar/client.py +155 -0
- athena/tools/client.py +12 -0
- athena/tools/email/__init__.py +2 -0
- athena/tools/email/client.py +223 -0
- athena/tools/structured_data_extractor/__init__.py +2 -0
- athena/{agents → tools}/structured_data_extractor/client.py +6 -6
- athena/tools/tasks/__init__.py +2 -0
- athena/tools/tasks/client.py +87 -0
- athena/types/__init__.py +16 -8
- athena/types/custom_agent_response.py +32 -0
- athena/types/drive_agent_response.py +32 -0
- athena/types/{athena_assistant_config.py → general_agent_config.py} +4 -4
- athena/types/{athena_assistant_config_enabled_tools_item.py → general_agent_config_enabled_tools_item.py} +1 -1
- athena/types/{athena_assistant_request.py → general_agent_request.py} +4 -4
- athena/types/{athena_assistant_reponse.py → general_agent_response.py} +2 -2
- athena/types/research_agent_response.py +32 -0
- athena/types/sql_agent_response.py +37 -0
- {athena_intelligence-0.1.119.dist-info → athena_intelligence-0.1.121.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.119.dist-info → athena_intelligence-0.1.121.dist-info}/RECORD +34 -18
- /athena/agents/{athena_assistant → drive}/__init__.py +0 -0
- /athena/agents/{structured_data_extractor → general}/__init__.py +0 -0
- {athena_intelligence-0.1.119.dist-info → athena_intelligence-0.1.121.dist-info}/WHEEL +0 -0
@@ -0,0 +1,134 @@
|
|
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.sql_agent_response import SqlAgentResponse
|
12
|
+
|
13
|
+
# this is used as the default value for optional parameters
|
14
|
+
OMIT = typing.cast(typing.Any, ...)
|
15
|
+
|
16
|
+
|
17
|
+
class SqlClient:
|
18
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
19
|
+
self._client_wrapper = client_wrapper
|
20
|
+
|
21
|
+
def invoke(
|
22
|
+
self,
|
23
|
+
*,
|
24
|
+
config: typing.Dict[str, typing.Any],
|
25
|
+
messages: typing.Sequence[typing.Dict[str, typing.Any]],
|
26
|
+
request_options: typing.Optional[RequestOptions] = None
|
27
|
+
) -> SqlAgentResponse:
|
28
|
+
"""
|
29
|
+
Coming soon! Generate, execute, and test SQL queries. Returns an asset ID for the query object.
|
30
|
+
|
31
|
+
Parameters
|
32
|
+
----------
|
33
|
+
config : typing.Dict[str, typing.Any]
|
34
|
+
Configuration for the SQL agent including database connection details and query parameters
|
35
|
+
|
36
|
+
messages : typing.Sequence[typing.Dict[str, typing.Any]]
|
37
|
+
The messages to send to the SQL agent
|
38
|
+
|
39
|
+
request_options : typing.Optional[RequestOptions]
|
40
|
+
Request-specific configuration.
|
41
|
+
|
42
|
+
Returns
|
43
|
+
-------
|
44
|
+
SqlAgentResponse
|
45
|
+
Successful Response
|
46
|
+
|
47
|
+
Examples
|
48
|
+
--------
|
49
|
+
from athena.client import Athena
|
50
|
+
|
51
|
+
client = Athena(
|
52
|
+
api_key="YOUR_API_KEY",
|
53
|
+
)
|
54
|
+
client.agents.sql.invoke(
|
55
|
+
config={"key": "value"},
|
56
|
+
messages=[{"key": "value"}],
|
57
|
+
)
|
58
|
+
"""
|
59
|
+
_response = self._client_wrapper.httpx_client.request(
|
60
|
+
"api/v0/agents/sql/invoke",
|
61
|
+
method="POST",
|
62
|
+
json={"config": config, "messages": messages},
|
63
|
+
request_options=request_options,
|
64
|
+
omit=OMIT,
|
65
|
+
)
|
66
|
+
if 200 <= _response.status_code < 300:
|
67
|
+
return pydantic_v1.parse_obj_as(SqlAgentResponse, _response.json()) # type: ignore
|
68
|
+
if _response.status_code == 422:
|
69
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
70
|
+
try:
|
71
|
+
_response_json = _response.json()
|
72
|
+
except JSONDecodeError:
|
73
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
74
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
75
|
+
|
76
|
+
|
77
|
+
class AsyncSqlClient:
|
78
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
79
|
+
self._client_wrapper = client_wrapper
|
80
|
+
|
81
|
+
async def invoke(
|
82
|
+
self,
|
83
|
+
*,
|
84
|
+
config: typing.Dict[str, typing.Any],
|
85
|
+
messages: typing.Sequence[typing.Dict[str, typing.Any]],
|
86
|
+
request_options: typing.Optional[RequestOptions] = None
|
87
|
+
) -> SqlAgentResponse:
|
88
|
+
"""
|
89
|
+
Coming soon! Generate, execute, and test SQL queries. Returns an asset ID for the query object.
|
90
|
+
|
91
|
+
Parameters
|
92
|
+
----------
|
93
|
+
config : typing.Dict[str, typing.Any]
|
94
|
+
Configuration for the SQL agent including database connection details and query parameters
|
95
|
+
|
96
|
+
messages : typing.Sequence[typing.Dict[str, typing.Any]]
|
97
|
+
The messages to send to the SQL agent
|
98
|
+
|
99
|
+
request_options : typing.Optional[RequestOptions]
|
100
|
+
Request-specific configuration.
|
101
|
+
|
102
|
+
Returns
|
103
|
+
-------
|
104
|
+
SqlAgentResponse
|
105
|
+
Successful Response
|
106
|
+
|
107
|
+
Examples
|
108
|
+
--------
|
109
|
+
from athena.client import AsyncAthena
|
110
|
+
|
111
|
+
client = AsyncAthena(
|
112
|
+
api_key="YOUR_API_KEY",
|
113
|
+
)
|
114
|
+
await client.agents.sql.invoke(
|
115
|
+
config={"key": "value"},
|
116
|
+
messages=[{"key": "value"}],
|
117
|
+
)
|
118
|
+
"""
|
119
|
+
_response = await self._client_wrapper.httpx_client.request(
|
120
|
+
"api/v0/agents/sql/invoke",
|
121
|
+
method="POST",
|
122
|
+
json={"config": config, "messages": messages},
|
123
|
+
request_options=request_options,
|
124
|
+
omit=OMIT,
|
125
|
+
)
|
126
|
+
if 200 <= _response.status_code < 300:
|
127
|
+
return pydantic_v1.parse_obj_as(SqlAgentResponse, _response.json()) # type: ignore
|
128
|
+
if _response.status_code == 422:
|
129
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
130
|
+
try:
|
131
|
+
_response_json = _response.json()
|
132
|
+
except JSONDecodeError:
|
133
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
134
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
athena/core/client_wrapper.py
CHANGED
@@ -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.121",
|
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,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,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)
|
@@ -36,7 +36,7 @@ class StructuredDataExtractorClient:
|
|
36
36
|
The IDs of the assets from which to extract structured data matching `json_schema`.
|
37
37
|
|
38
38
|
json_schema : typing.Dict[str, typing.Any]
|
39
|
-
The JSON schema to use for validation.
|
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
40
|
|
41
41
|
map_ : typing.Optional[bool]
|
42
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.
|
@@ -59,13 +59,13 @@ class StructuredDataExtractorClient:
|
|
59
59
|
client = Athena(
|
60
60
|
api_key="YOUR_API_KEY",
|
61
61
|
)
|
62
|
-
client.
|
62
|
+
client.tools.structured_data_extractor.invoke(
|
63
63
|
asset_ids=["asset_ids"],
|
64
64
|
json_schema={"key": "value"},
|
65
65
|
)
|
66
66
|
"""
|
67
67
|
_response = self._client_wrapper.httpx_client.request(
|
68
|
-
"api/v0/
|
68
|
+
"api/v0/tools/structured-data-extractor/invoke",
|
69
69
|
method="POST",
|
70
70
|
json={"asset_ids": asset_ids, "json_schema": json_schema, "map": map_, "reduce": reduce},
|
71
71
|
request_options=request_options,
|
@@ -104,7 +104,7 @@ class AsyncStructuredDataExtractorClient:
|
|
104
104
|
The IDs of the assets from which to extract structured data matching `json_schema`.
|
105
105
|
|
106
106
|
json_schema : typing.Dict[str, typing.Any]
|
107
|
-
The JSON schema to use for validation.
|
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
108
|
|
109
109
|
map_ : typing.Optional[bool]
|
110
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.
|
@@ -127,13 +127,13 @@ class AsyncStructuredDataExtractorClient:
|
|
127
127
|
client = AsyncAthena(
|
128
128
|
api_key="YOUR_API_KEY",
|
129
129
|
)
|
130
|
-
await client.
|
130
|
+
await client.tools.structured_data_extractor.invoke(
|
131
131
|
asset_ids=["asset_ids"],
|
132
132
|
json_schema={"key": "value"},
|
133
133
|
)
|
134
134
|
"""
|
135
135
|
_response = await self._client_wrapper.httpx_client.request(
|
136
|
-
"api/v0/
|
136
|
+
"api/v0/tools/structured-data-extractor/invoke",
|
137
137
|
method="POST",
|
138
138
|
json={"asset_ids": asset_ids, "json_schema": json_schema, "map": map_, "reduce": reduce},
|
139
139
|
request_options=request_options,
|