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
athena/__init__.py
CHANGED
@@ -2,20 +2,24 @@
|
|
2
2
|
|
3
3
|
from .types import (
|
4
4
|
AssetNotFoundError,
|
5
|
-
|
6
|
-
AthenaAssistantConfigEnabledToolsItem,
|
7
|
-
AthenaAssistantReponse,
|
8
|
-
AthenaAssistantRequest,
|
5
|
+
CustomAgentResponse,
|
9
6
|
DataFrameRequestOut,
|
10
7
|
DataFrameRequestOutColumnsItem,
|
11
8
|
DataFrameRequestOutDataItemItem,
|
12
9
|
DataFrameRequestOutIndexItem,
|
13
10
|
DataFrameUnknownFormatError,
|
14
11
|
DocumentChunk,
|
12
|
+
DriveAgentResponse,
|
15
13
|
FileChunkRequestOut,
|
16
14
|
FileTooLargeError,
|
15
|
+
GeneralAgentConfig,
|
16
|
+
GeneralAgentConfigEnabledToolsItem,
|
17
|
+
GeneralAgentRequest,
|
18
|
+
GeneralAgentResponse,
|
17
19
|
ParentFolderError,
|
20
|
+
ResearchAgentResponse,
|
18
21
|
SaveAssetRequestOut,
|
22
|
+
SqlAgentResponse,
|
19
23
|
StructuredDataExtractorReponse,
|
20
24
|
Tool,
|
21
25
|
)
|
@@ -36,26 +40,30 @@ from .version import __version__
|
|
36
40
|
|
37
41
|
__all__ = [
|
38
42
|
"AssetNotFoundError",
|
39
|
-
"AthenaAssistantConfig",
|
40
|
-
"AthenaAssistantConfigEnabledToolsItem",
|
41
|
-
"AthenaAssistantReponse",
|
42
|
-
"AthenaAssistantRequest",
|
43
43
|
"AthenaEnvironment",
|
44
44
|
"BadRequestError",
|
45
45
|
"ContentTooLargeError",
|
46
|
+
"CustomAgentResponse",
|
46
47
|
"DataFrameRequestOut",
|
47
48
|
"DataFrameRequestOutColumnsItem",
|
48
49
|
"DataFrameRequestOutDataItemItem",
|
49
50
|
"DataFrameRequestOutIndexItem",
|
50
51
|
"DataFrameUnknownFormatError",
|
51
52
|
"DocumentChunk",
|
53
|
+
"DriveAgentResponse",
|
52
54
|
"FileChunkRequestOut",
|
53
55
|
"FileTooLargeError",
|
56
|
+
"GeneralAgentConfig",
|
57
|
+
"GeneralAgentConfigEnabledToolsItem",
|
58
|
+
"GeneralAgentRequest",
|
59
|
+
"GeneralAgentResponse",
|
54
60
|
"InternalServerError",
|
55
61
|
"NotFoundError",
|
56
62
|
"ParentFolderError",
|
57
63
|
"QueryExecuteRequestDatabaseAssetIds",
|
64
|
+
"ResearchAgentResponse",
|
58
65
|
"SaveAssetRequestOut",
|
66
|
+
"SqlAgentResponse",
|
59
67
|
"StructuredDataExtractorReponse",
|
60
68
|
"Tool",
|
61
69
|
"ToolsDataFrameRequestColumnsItem",
|
athena/agents/__init__.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from . import
|
3
|
+
from . import drive, general, research, sql
|
4
4
|
|
5
|
-
__all__ = ["
|
5
|
+
__all__ = ["drive", "general", "research", "sql"]
|
athena/agents/client.py
CHANGED
@@ -1,19 +1,169 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
import typing
|
4
|
+
from json.decoder import JSONDecodeError
|
5
|
+
|
6
|
+
from ..core.api_error import ApiError
|
3
7
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
4
|
-
from .
|
5
|
-
from .
|
8
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
9
|
+
from ..core.pydantic_utilities import pydantic_v1
|
10
|
+
from ..core.request_options import RequestOptions
|
11
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
12
|
+
from ..types.custom_agent_response import CustomAgentResponse
|
13
|
+
from .drive.client import AsyncDriveClient, DriveClient
|
14
|
+
from .general.client import AsyncGeneralClient, GeneralClient
|
15
|
+
from .research.client import AsyncResearchClient, ResearchClient
|
16
|
+
from .sql.client import AsyncSqlClient, SqlClient
|
17
|
+
|
18
|
+
# this is used as the default value for optional parameters
|
19
|
+
OMIT = typing.cast(typing.Any, ...)
|
6
20
|
|
7
21
|
|
8
22
|
class AgentsClient:
|
9
23
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
10
24
|
self._client_wrapper = client_wrapper
|
11
|
-
self.
|
12
|
-
self.
|
25
|
+
self.drive = DriveClient(client_wrapper=self._client_wrapper)
|
26
|
+
self.general = GeneralClient(client_wrapper=self._client_wrapper)
|
27
|
+
self.research = ResearchClient(client_wrapper=self._client_wrapper)
|
28
|
+
self.sql = SqlClient(client_wrapper=self._client_wrapper)
|
29
|
+
|
30
|
+
def invoke_by_id(
|
31
|
+
self,
|
32
|
+
agent_id: str,
|
33
|
+
*,
|
34
|
+
config: typing.Dict[str, typing.Any],
|
35
|
+
messages: typing.Sequence[typing.Dict[str, typing.Any]],
|
36
|
+
request_options: typing.Optional[RequestOptions] = None,
|
37
|
+
) -> CustomAgentResponse:
|
38
|
+
"""
|
39
|
+
Coming soon!
|
40
|
+
|
41
|
+
Invoke a custom agent created in [spaces](https://resources.athenaintel.com/docs/agents/create-your-agent).
|
42
|
+
|
43
|
+
Custom agents can be created and configured in spaces to perform specialized tasks.
|
44
|
+
Refer to the specific agent's documentation for details on configuration options
|
45
|
+
and expected responses.
|
46
|
+
|
47
|
+
Parameters
|
48
|
+
----------
|
49
|
+
agent_id : str
|
50
|
+
The ID of the custom agent to invoke. Create custom agents in [spaces](https://resources.athenaintel.com/docs/agents/create-your-agent).
|
51
|
+
|
52
|
+
config : typing.Dict[str, typing.Any]
|
53
|
+
Configuration for the custom agent. See the agent's documentation for specific configuration options.
|
54
|
+
|
55
|
+
messages : typing.Sequence[typing.Dict[str, typing.Any]]
|
56
|
+
The messages to send to the custom agent
|
57
|
+
|
58
|
+
request_options : typing.Optional[RequestOptions]
|
59
|
+
Request-specific configuration.
|
60
|
+
|
61
|
+
Returns
|
62
|
+
-------
|
63
|
+
CustomAgentResponse
|
64
|
+
Successful Response
|
65
|
+
|
66
|
+
Examples
|
67
|
+
--------
|
68
|
+
from athena.client import Athena
|
69
|
+
|
70
|
+
client = Athena(
|
71
|
+
api_key="YOUR_API_KEY",
|
72
|
+
)
|
73
|
+
client.agents.invoke_by_id(
|
74
|
+
agent_id="agent_id",
|
75
|
+
config={"key": "value"},
|
76
|
+
messages=[{"key": "value"}],
|
77
|
+
)
|
78
|
+
"""
|
79
|
+
_response = self._client_wrapper.httpx_client.request(
|
80
|
+
f"api/v0/agents/{jsonable_encoder(agent_id)}/invoke",
|
81
|
+
method="POST",
|
82
|
+
json={"config": config, "messages": messages},
|
83
|
+
request_options=request_options,
|
84
|
+
omit=OMIT,
|
85
|
+
)
|
86
|
+
if 200 <= _response.status_code < 300:
|
87
|
+
return pydantic_v1.parse_obj_as(CustomAgentResponse, _response.json()) # type: ignore
|
88
|
+
if _response.status_code == 422:
|
89
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
90
|
+
try:
|
91
|
+
_response_json = _response.json()
|
92
|
+
except JSONDecodeError:
|
93
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
94
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
13
95
|
|
14
96
|
|
15
97
|
class AsyncAgentsClient:
|
16
98
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
17
99
|
self._client_wrapper = client_wrapper
|
18
|
-
self.
|
19
|
-
self.
|
100
|
+
self.drive = AsyncDriveClient(client_wrapper=self._client_wrapper)
|
101
|
+
self.general = AsyncGeneralClient(client_wrapper=self._client_wrapper)
|
102
|
+
self.research = AsyncResearchClient(client_wrapper=self._client_wrapper)
|
103
|
+
self.sql = AsyncSqlClient(client_wrapper=self._client_wrapper)
|
104
|
+
|
105
|
+
async def invoke_by_id(
|
106
|
+
self,
|
107
|
+
agent_id: str,
|
108
|
+
*,
|
109
|
+
config: typing.Dict[str, typing.Any],
|
110
|
+
messages: typing.Sequence[typing.Dict[str, typing.Any]],
|
111
|
+
request_options: typing.Optional[RequestOptions] = None,
|
112
|
+
) -> CustomAgentResponse:
|
113
|
+
"""
|
114
|
+
Coming soon!
|
115
|
+
|
116
|
+
Invoke a custom agent created in [spaces](https://resources.athenaintel.com/docs/agents/create-your-agent).
|
117
|
+
|
118
|
+
Custom agents can be created and configured in spaces to perform specialized tasks.
|
119
|
+
Refer to the specific agent's documentation for details on configuration options
|
120
|
+
and expected responses.
|
121
|
+
|
122
|
+
Parameters
|
123
|
+
----------
|
124
|
+
agent_id : str
|
125
|
+
The ID of the custom agent to invoke. Create custom agents in [spaces](https://resources.athenaintel.com/docs/agents/create-your-agent).
|
126
|
+
|
127
|
+
config : typing.Dict[str, typing.Any]
|
128
|
+
Configuration for the custom agent. See the agent's documentation for specific configuration options.
|
129
|
+
|
130
|
+
messages : typing.Sequence[typing.Dict[str, typing.Any]]
|
131
|
+
The messages to send to the custom agent
|
132
|
+
|
133
|
+
request_options : typing.Optional[RequestOptions]
|
134
|
+
Request-specific configuration.
|
135
|
+
|
136
|
+
Returns
|
137
|
+
-------
|
138
|
+
CustomAgentResponse
|
139
|
+
Successful Response
|
140
|
+
|
141
|
+
Examples
|
142
|
+
--------
|
143
|
+
from athena.client import AsyncAthena
|
144
|
+
|
145
|
+
client = AsyncAthena(
|
146
|
+
api_key="YOUR_API_KEY",
|
147
|
+
)
|
148
|
+
await client.agents.invoke_by_id(
|
149
|
+
agent_id="agent_id",
|
150
|
+
config={"key": "value"},
|
151
|
+
messages=[{"key": "value"}],
|
152
|
+
)
|
153
|
+
"""
|
154
|
+
_response = await self._client_wrapper.httpx_client.request(
|
155
|
+
f"api/v0/agents/{jsonable_encoder(agent_id)}/invoke",
|
156
|
+
method="POST",
|
157
|
+
json={"config": config, "messages": messages},
|
158
|
+
request_options=request_options,
|
159
|
+
omit=OMIT,
|
160
|
+
)
|
161
|
+
if 200 <= _response.status_code < 300:
|
162
|
+
return pydantic_v1.parse_obj_as(CustomAgentResponse, _response.json()) # type: ignore
|
163
|
+
if _response.status_code == 422:
|
164
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
165
|
+
try:
|
166
|
+
_response_json = _response.json()
|
167
|
+
except JSONDecodeError:
|
168
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
169
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
@@ -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.drive_agent_response import DriveAgentResponse
|
12
|
+
|
13
|
+
# this is used as the default value for optional parameters
|
14
|
+
OMIT = typing.cast(typing.Any, ...)
|
15
|
+
|
16
|
+
|
17
|
+
class DriveClient:
|
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
|
+
) -> DriveAgentResponse:
|
28
|
+
"""
|
29
|
+
Coming soon! Manage folders and search for files in the internal drive.
|
30
|
+
|
31
|
+
Parameters
|
32
|
+
----------
|
33
|
+
config : typing.Dict[str, typing.Any]
|
34
|
+
Configuration for the drive agent including folder paths and search parameters
|
35
|
+
|
36
|
+
messages : typing.Sequence[typing.Dict[str, typing.Any]]
|
37
|
+
The messages to send to the drive agent
|
38
|
+
|
39
|
+
request_options : typing.Optional[RequestOptions]
|
40
|
+
Request-specific configuration.
|
41
|
+
|
42
|
+
Returns
|
43
|
+
-------
|
44
|
+
DriveAgentResponse
|
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.drive.invoke(
|
55
|
+
config={"key": "value"},
|
56
|
+
messages=[{"key": "value"}],
|
57
|
+
)
|
58
|
+
"""
|
59
|
+
_response = self._client_wrapper.httpx_client.request(
|
60
|
+
"api/v0/agents/drive/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(DriveAgentResponse, _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 AsyncDriveClient:
|
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
|
+
) -> DriveAgentResponse:
|
88
|
+
"""
|
89
|
+
Coming soon! Manage folders and search for files in the internal drive.
|
90
|
+
|
91
|
+
Parameters
|
92
|
+
----------
|
93
|
+
config : typing.Dict[str, typing.Any]
|
94
|
+
Configuration for the drive agent including folder paths and search parameters
|
95
|
+
|
96
|
+
messages : typing.Sequence[typing.Dict[str, typing.Any]]
|
97
|
+
The messages to send to the drive agent
|
98
|
+
|
99
|
+
request_options : typing.Optional[RequestOptions]
|
100
|
+
Request-specific configuration.
|
101
|
+
|
102
|
+
Returns
|
103
|
+
-------
|
104
|
+
DriveAgentResponse
|
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.drive.invoke(
|
115
|
+
config={"key": "value"},
|
116
|
+
messages=[{"key": "value"}],
|
117
|
+
)
|
118
|
+
"""
|
119
|
+
_response = await self._client_wrapper.httpx_client.request(
|
120
|
+
"api/v0/agents/drive/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(DriveAgentResponse, _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)
|