athena-intelligence 0.1.125__tar.gz → 0.1.127__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.125 → athena_intelligence-0.1.127}/PKG-INFO +12 -4
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/pyproject.toml +15 -4
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/__init__.py +7 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/client.py +88 -36
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/drive/client.py +80 -32
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/general/client.py +222 -91
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/research/client.py +80 -32
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/sql/client.py +80 -32
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/base_client.py +13 -11
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/client.py +161 -61
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/core/__init__.py +21 -4
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/core/client_wrapper.py +9 -10
- athena_intelligence-0.1.127/src/athena/core/file.py +67 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/core/http_client.py +97 -41
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/core/jsonable_encoder.py +33 -31
- athena_intelligence-0.1.127/src/athena/core/pydantic_utilities.py +296 -0
- athena_intelligence-0.1.127/src/athena/core/query_encoder.py +58 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/core/request_options.py +5 -2
- athena_intelligence-0.1.127/src/athena/core/serialization.py +272 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/errors/internal_server_error.py +2 -3
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/errors/unauthorized_error.py +2 -3
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/errors/unprocessable_entity_error.py +2 -3
- athena_intelligence-0.1.127/src/athena/query/client.py +389 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/calendar/client.py +82 -30
- athena_intelligence-0.1.127/src/athena/tools/client.py +1431 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/email/client.py +117 -43
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/structured_data_extractor/client.py +118 -67
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/tasks/client.py +41 -17
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/types/__init__.py +4 -0
- athena_intelligence-0.1.127/src/athena/types/asset_content_request_out.py +26 -0
- athena_intelligence-0.1.127/src/athena/types/asset_node.py +32 -0
- athena_intelligence-0.1.127/src/athena/types/asset_not_found_error.py +19 -0
- athena_intelligence-0.1.127/src/athena/types/asset_screenshot_response_out.py +43 -0
- athena_intelligence-0.1.127/src/athena/types/chunk.py +26 -0
- athena_intelligence-0.1.127/src/athena/types/chunk_content_item.py +38 -0
- athena_intelligence-0.1.127/src/athena/types/chunk_result.py +25 -0
- athena_intelligence-0.1.127/src/athena/types/custom_agent_response.py +22 -0
- athena_intelligence-0.1.127/src/athena/types/data_frame_request_out.py +28 -0
- athena_intelligence-0.1.127/src/athena/types/data_frame_unknown_format_error.py +21 -0
- athena_intelligence-0.1.127/src/athena/types/document_chunk.py +24 -0
- athena_intelligence-0.1.127/src/athena/types/drive_agent_response.py +22 -0
- athena_intelligence-0.1.127/src/athena/types/file_chunk_request_out.py +24 -0
- athena_intelligence-0.1.127/src/athena/types/file_too_large_error.py +19 -0
- athena_intelligence-0.1.127/src/athena/types/folder_response.py +25 -0
- athena_intelligence-0.1.127/src/athena/types/general_agent_config.py +27 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/types/general_agent_config_enabled_tools_item.py +0 -1
- athena_intelligence-0.1.127/src/athena/types/general_agent_request.py +28 -0
- athena_intelligence-0.1.127/src/athena/types/general_agent_response.py +23 -0
- athena_intelligence-0.1.127/src/athena/types/image_url_content.py +23 -0
- athena_intelligence-0.1.127/src/athena/types/parent_folder_error.py +19 -0
- athena_intelligence-0.1.127/src/athena/types/prompt_message.py +25 -0
- athena_intelligence-0.1.127/src/athena/types/research_agent_response.py +22 -0
- athena_intelligence-0.1.127/src/athena/types/save_asset_request_out.py +23 -0
- athena_intelligence-0.1.127/src/athena/types/sql_agent_response.py +27 -0
- athena_intelligence-0.1.127/src/athena/types/structured_data_extractor_response.py +32 -0
- athena_intelligence-0.1.127/src/athena/types/text_content.py +23 -0
- athena_intelligence-0.1.127/src/athena/types/tool.py +5 -0
- athena_intelligence-0.1.127/src/athena/types/type.py +5 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/version.py +0 -1
- athena_intelligence-0.1.125/src/athena/core/file.py +0 -38
- athena_intelligence-0.1.125/src/athena/core/pydantic_utilities.py +0 -28
- athena_intelligence-0.1.125/src/athena/core/query_encoder.py +0 -33
- athena_intelligence-0.1.125/src/athena/query/client.py +0 -239
- athena_intelligence-0.1.125/src/athena/tools/client.py +0 -663
- athena_intelligence-0.1.125/src/athena/types/asset_node.py +0 -42
- athena_intelligence-0.1.125/src/athena/types/asset_not_found_error.py +0 -29
- athena_intelligence-0.1.125/src/athena/types/chunk.py +0 -36
- athena_intelligence-0.1.125/src/athena/types/chunk_content_item.py +0 -58
- athena_intelligence-0.1.125/src/athena/types/chunk_result.py +0 -35
- athena_intelligence-0.1.125/src/athena/types/custom_agent_response.py +0 -32
- athena_intelligence-0.1.125/src/athena/types/data_frame_request_out.py +0 -38
- athena_intelligence-0.1.125/src/athena/types/data_frame_unknown_format_error.py +0 -31
- athena_intelligence-0.1.125/src/athena/types/document_chunk.py +0 -34
- athena_intelligence-0.1.125/src/athena/types/drive_agent_response.py +0 -32
- athena_intelligence-0.1.125/src/athena/types/file_chunk_request_out.py +0 -34
- athena_intelligence-0.1.125/src/athena/types/file_too_large_error.py +0 -29
- athena_intelligence-0.1.125/src/athena/types/folder_response.py +0 -35
- athena_intelligence-0.1.125/src/athena/types/general_agent_config.py +0 -36
- athena_intelligence-0.1.125/src/athena/types/general_agent_request.py +0 -38
- athena_intelligence-0.1.125/src/athena/types/general_agent_response.py +0 -33
- athena_intelligence-0.1.125/src/athena/types/image_url_content.py +0 -33
- athena_intelligence-0.1.125/src/athena/types/parent_folder_error.py +0 -29
- athena_intelligence-0.1.125/src/athena/types/prompt_message.py +0 -35
- athena_intelligence-0.1.125/src/athena/types/research_agent_response.py +0 -32
- athena_intelligence-0.1.125/src/athena/types/save_asset_request_out.py +0 -33
- athena_intelligence-0.1.125/src/athena/types/sql_agent_response.py +0 -37
- athena_intelligence-0.1.125/src/athena/types/structured_data_extractor_response.py +0 -42
- athena_intelligence-0.1.125/src/athena/types/text_content.py +0 -33
- athena_intelligence-0.1.125/src/athena/types/tool.py +0 -17
- athena_intelligence-0.1.125/src/athena/types/type.py +0 -25
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/README.md +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/drive/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/general/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/research/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/sql/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/core/api_error.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/core/datetime_utils.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/core/remove_none_from_dict.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/environment.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/errors/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/errors/bad_request_error.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/errors/content_too_large_error.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/errors/not_found_error.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/errors/unsupported_media_type_error.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/py.typed +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/query/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/query/types/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/query/types/query_execute_request_database_asset_ids.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/calendar/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/email/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/structured_data_extractor/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/tasks/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/types/__init__.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/tools/types/tools_data_frame_request_columns_item.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/types/chunk_result_chunk_id.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/types/data_frame_request_out_columns_item.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/types/data_frame_request_out_data_item_item.py +0 -0
- {athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/types/data_frame_request_out_index_item.py +0 -0
@@ -1,8 +1,8 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.3
|
2
2
|
Name: athena-intelligence
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.127
|
4
4
|
Summary: Athena Intelligence Python Library
|
5
|
-
Requires-Python: >=3.
|
5
|
+
Requires-Python: >=3.9,<4.0
|
6
6
|
Classifier: Intended Audience :: Developers
|
7
7
|
Classifier: Operating System :: MacOS
|
8
8
|
Classifier: Operating System :: Microsoft :: Windows
|
@@ -11,17 +11,25 @@ Classifier: Operating System :: POSIX
|
|
11
11
|
Classifier: Operating System :: POSIX :: Linux
|
12
12
|
Classifier: Programming Language :: Python
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
15
14
|
Classifier: Programming Language :: Python :: 3.9
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
18
17
|
Classifier: Programming Language :: Python :: 3.12
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
19
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
20
21
|
Classifier: Typing :: Typed
|
22
|
+
Requires-Dist: fastapi (==0.115.10)
|
21
23
|
Requires-Dist: httpx (>=0.21.2)
|
24
|
+
Requires-Dist: langchain_core (>=0.3.40,<0.4.0)
|
25
|
+
Requires-Dist: langserve (>=0.3.1,<0.4.0)
|
22
26
|
Requires-Dist: pydantic (>=1.9.2)
|
27
|
+
Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
|
23
28
|
Requires-Dist: python-magic (==0.4.27)
|
24
29
|
Requires-Dist: typing_extensions (>=4.0.0)
|
30
|
+
Project-URL: Documentation, https://docs.athenaintel.com/
|
31
|
+
Project-URL: Homepage, https://www.athenaintel.com/
|
32
|
+
Project-URL: Repository, https://github.com/Athena-Intel/athena-python
|
25
33
|
Description-Content-Type: text/markdown
|
26
34
|
|
27
35
|
# Athena Intelligence Python Library
|
@@ -1,6 +1,9 @@
|
|
1
|
+
[project]
|
2
|
+
name = "athena-intelligence"
|
3
|
+
|
1
4
|
[tool.poetry]
|
2
5
|
name = "athena-intelligence"
|
3
|
-
version = "0.1.
|
6
|
+
version = "0.1.127"
|
4
7
|
description = "Athena Intelligence Python Library"
|
5
8
|
readme = "README.md"
|
6
9
|
authors = []
|
@@ -28,14 +31,18 @@ packages = [
|
|
28
31
|
]
|
29
32
|
|
30
33
|
[project.urls]
|
31
|
-
Documentation = 'https://docs.
|
32
|
-
Homepage = 'https://www.
|
34
|
+
Documentation = 'https://docs.athenaintel.com/'
|
35
|
+
Homepage = 'https://www.athenaintel.com/'
|
33
36
|
Repository = 'https://github.com/Athena-Intel/athena-python'
|
34
37
|
|
35
38
|
[tool.poetry.dependencies]
|
36
|
-
python = "
|
39
|
+
python = ">=3.9,<4.0"
|
40
|
+
fastapi = "0.115.10"
|
37
41
|
httpx = ">=0.21.2"
|
42
|
+
langchain_core = "^0.3.40"
|
43
|
+
langserve = "^0.3.1"
|
38
44
|
pydantic = ">= 1.9.2"
|
45
|
+
pydantic-core = "^2.18.2"
|
39
46
|
python-magic = "0.4.27"
|
40
47
|
typing_extensions = ">= 4.0.0"
|
41
48
|
|
@@ -47,6 +54,7 @@ python-dateutil = "^2.9.0"
|
|
47
54
|
types-python-dateutil = "^2.9.0.20240316"
|
48
55
|
pandas = ">= 1.5.3"
|
49
56
|
pandas-stubs = ">= 1.5.3"
|
57
|
+
ruff = "^0.5.6"
|
50
58
|
|
51
59
|
[tool.pytest.ini_options]
|
52
60
|
testpaths = [ "tests" ]
|
@@ -55,6 +63,9 @@ asyncio_mode = "auto"
|
|
55
63
|
[tool.mypy]
|
56
64
|
plugins = ["pydantic.mypy"]
|
57
65
|
|
66
|
+
[tool.ruff]
|
67
|
+
line-length = 120
|
68
|
+
|
58
69
|
|
59
70
|
[build-system]
|
60
71
|
requires = ["poetry-core"]
|
@@ -1,8 +1,10 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
from .types import (
|
4
|
+
AssetContentRequestOut,
|
4
5
|
AssetNode,
|
5
6
|
AssetNotFoundError,
|
7
|
+
AssetScreenshotResponseOut,
|
6
8
|
Chunk,
|
7
9
|
ChunkContentItem,
|
8
10
|
ChunkContentItem_ImageUrl,
|
@@ -45,14 +47,19 @@ from .errors import (
|
|
45
47
|
UnsupportedMediaTypeError,
|
46
48
|
)
|
47
49
|
from . import agents, query, tools
|
50
|
+
from .client import AsyncAthena, Athena
|
48
51
|
from .environment import AthenaEnvironment
|
49
52
|
from .query import QueryExecuteRequestDatabaseAssetIds
|
50
53
|
from .tools import ToolsDataFrameRequestColumnsItem
|
51
54
|
from .version import __version__
|
52
55
|
|
53
56
|
__all__ = [
|
57
|
+
"AssetContentRequestOut",
|
54
58
|
"AssetNode",
|
55
59
|
"AssetNotFoundError",
|
60
|
+
"AssetScreenshotResponseOut",
|
61
|
+
"AsyncAthena",
|
62
|
+
"Athena",
|
56
63
|
"AthenaEnvironment",
|
57
64
|
"BadRequestError",
|
58
65
|
"Chunk",
|
@@ -1,19 +1,23 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
import typing
|
4
|
-
from
|
5
|
-
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from
|
9
|
-
from ..core.pydantic_utilities import pydantic_v1
|
4
|
+
from ..core.client_wrapper import SyncClientWrapper
|
5
|
+
from .drive.client import DriveClient
|
6
|
+
from .general.client import GeneralClient
|
7
|
+
from .research.client import ResearchClient
|
8
|
+
from .sql.client import SqlClient
|
10
9
|
from ..core.request_options import RequestOptions
|
11
|
-
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
12
10
|
from ..types.custom_agent_response import CustomAgentResponse
|
13
|
-
from .
|
14
|
-
from .
|
15
|
-
from .
|
16
|
-
from .
|
11
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
12
|
+
from ..core.pydantic_utilities import parse_obj_as
|
13
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
14
|
+
from json.decoder import JSONDecodeError
|
15
|
+
from ..core.api_error import ApiError
|
16
|
+
from ..core.client_wrapper import AsyncClientWrapper
|
17
|
+
from .drive.client import AsyncDriveClient
|
18
|
+
from .general.client import AsyncGeneralClient
|
19
|
+
from .research.client import AsyncResearchClient
|
20
|
+
from .sql.client import AsyncSqlClient
|
17
21
|
|
18
22
|
# this is used as the default value for optional parameters
|
19
23
|
OMIT = typing.cast(typing.Any, ...)
|
@@ -31,8 +35,8 @@ class AgentsClient:
|
|
31
35
|
self,
|
32
36
|
agent_id: str,
|
33
37
|
*,
|
34
|
-
config: typing.Dict[str, typing.Any],
|
35
|
-
messages: typing.Sequence[typing.Dict[str, typing.Any]],
|
38
|
+
config: typing.Dict[str, typing.Optional[typing.Any]],
|
39
|
+
messages: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
36
40
|
request_options: typing.Optional[RequestOptions] = None,
|
37
41
|
) -> CustomAgentResponse:
|
38
42
|
"""
|
@@ -49,10 +53,10 @@ class AgentsClient:
|
|
49
53
|
agent_id : str
|
50
54
|
The ID of the custom agent to invoke. Create custom agents in [spaces](https://resources.athenaintel.com/docs/agents/create-your-agent).
|
51
55
|
|
52
|
-
config : typing.Dict[str, typing.Any]
|
56
|
+
config : typing.Dict[str, typing.Optional[typing.Any]]
|
53
57
|
Configuration for the custom agent. See the agent's documentation for specific configuration options.
|
54
58
|
|
55
|
-
messages : typing.Sequence[typing.Dict[str, typing.Any]]
|
59
|
+
messages : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
56
60
|
The messages to send to the custom agent
|
57
61
|
|
58
62
|
request_options : typing.Optional[RequestOptions]
|
@@ -65,7 +69,7 @@ class AgentsClient:
|
|
65
69
|
|
66
70
|
Examples
|
67
71
|
--------
|
68
|
-
from athena
|
72
|
+
from athena import Athena
|
69
73
|
|
70
74
|
client = Athena(
|
71
75
|
api_key="YOUR_API_KEY",
|
@@ -79,15 +83,35 @@ class AgentsClient:
|
|
79
83
|
_response = self._client_wrapper.httpx_client.request(
|
80
84
|
f"api/v0/agents/{jsonable_encoder(agent_id)}/invoke",
|
81
85
|
method="POST",
|
82
|
-
json={
|
86
|
+
json={
|
87
|
+
"config": config,
|
88
|
+
"messages": messages,
|
89
|
+
},
|
90
|
+
headers={
|
91
|
+
"content-type": "application/json",
|
92
|
+
},
|
83
93
|
request_options=request_options,
|
84
94
|
omit=OMIT,
|
85
95
|
)
|
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
96
|
try:
|
97
|
+
if 200 <= _response.status_code < 300:
|
98
|
+
return typing.cast(
|
99
|
+
CustomAgentResponse,
|
100
|
+
parse_obj_as(
|
101
|
+
type_=CustomAgentResponse, # type: ignore
|
102
|
+
object_=_response.json(),
|
103
|
+
),
|
104
|
+
)
|
105
|
+
if _response.status_code == 422:
|
106
|
+
raise UnprocessableEntityError(
|
107
|
+
typing.cast(
|
108
|
+
typing.Optional[typing.Any],
|
109
|
+
parse_obj_as(
|
110
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
111
|
+
object_=_response.json(),
|
112
|
+
),
|
113
|
+
)
|
114
|
+
)
|
91
115
|
_response_json = _response.json()
|
92
116
|
except JSONDecodeError:
|
93
117
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -106,8 +130,8 @@ class AsyncAgentsClient:
|
|
106
130
|
self,
|
107
131
|
agent_id: str,
|
108
132
|
*,
|
109
|
-
config: typing.Dict[str, typing.Any],
|
110
|
-
messages: typing.Sequence[typing.Dict[str, typing.Any]],
|
133
|
+
config: typing.Dict[str, typing.Optional[typing.Any]],
|
134
|
+
messages: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
111
135
|
request_options: typing.Optional[RequestOptions] = None,
|
112
136
|
) -> CustomAgentResponse:
|
113
137
|
"""
|
@@ -124,10 +148,10 @@ class AsyncAgentsClient:
|
|
124
148
|
agent_id : str
|
125
149
|
The ID of the custom agent to invoke. Create custom agents in [spaces](https://resources.athenaintel.com/docs/agents/create-your-agent).
|
126
150
|
|
127
|
-
config : typing.Dict[str, typing.Any]
|
151
|
+
config : typing.Dict[str, typing.Optional[typing.Any]]
|
128
152
|
Configuration for the custom agent. See the agent's documentation for specific configuration options.
|
129
153
|
|
130
|
-
messages : typing.Sequence[typing.Dict[str, typing.Any]]
|
154
|
+
messages : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
131
155
|
The messages to send to the custom agent
|
132
156
|
|
133
157
|
request_options : typing.Optional[RequestOptions]
|
@@ -140,29 +164,57 @@ class AsyncAgentsClient:
|
|
140
164
|
|
141
165
|
Examples
|
142
166
|
--------
|
143
|
-
|
167
|
+
import asyncio
|
168
|
+
|
169
|
+
from athena import AsyncAthena
|
144
170
|
|
145
171
|
client = AsyncAthena(
|
146
172
|
api_key="YOUR_API_KEY",
|
147
173
|
)
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
174
|
+
|
175
|
+
|
176
|
+
async def main() -> None:
|
177
|
+
await client.agents.invoke_by_id(
|
178
|
+
agent_id="agent_id",
|
179
|
+
config={"key": "value"},
|
180
|
+
messages=[{"key": "value"}],
|
181
|
+
)
|
182
|
+
|
183
|
+
|
184
|
+
asyncio.run(main())
|
153
185
|
"""
|
154
186
|
_response = await self._client_wrapper.httpx_client.request(
|
155
187
|
f"api/v0/agents/{jsonable_encoder(agent_id)}/invoke",
|
156
188
|
method="POST",
|
157
|
-
json={
|
189
|
+
json={
|
190
|
+
"config": config,
|
191
|
+
"messages": messages,
|
192
|
+
},
|
193
|
+
headers={
|
194
|
+
"content-type": "application/json",
|
195
|
+
},
|
158
196
|
request_options=request_options,
|
159
197
|
omit=OMIT,
|
160
198
|
)
|
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
199
|
try:
|
200
|
+
if 200 <= _response.status_code < 300:
|
201
|
+
return typing.cast(
|
202
|
+
CustomAgentResponse,
|
203
|
+
parse_obj_as(
|
204
|
+
type_=CustomAgentResponse, # type: ignore
|
205
|
+
object_=_response.json(),
|
206
|
+
),
|
207
|
+
)
|
208
|
+
if _response.status_code == 422:
|
209
|
+
raise UnprocessableEntityError(
|
210
|
+
typing.cast(
|
211
|
+
typing.Optional[typing.Any],
|
212
|
+
parse_obj_as(
|
213
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
214
|
+
object_=_response.json(),
|
215
|
+
),
|
216
|
+
)
|
217
|
+
)
|
166
218
|
_response_json = _response.json()
|
167
219
|
except JSONDecodeError:
|
168
220
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
{athena_intelligence-0.1.125 → athena_intelligence-0.1.127}/src/athena/agents/drive/client.py
RENAMED
@@ -1,14 +1,14 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
import typing
|
4
|
-
from
|
5
|
-
|
6
|
-
from ...core.api_error import ApiError
|
7
|
-
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
8
|
-
from ...core.pydantic_utilities import pydantic_v1
|
4
|
+
from ...core.client_wrapper import SyncClientWrapper
|
9
5
|
from ...core.request_options import RequestOptions
|
10
|
-
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
11
6
|
from ...types.drive_agent_response import DriveAgentResponse
|
7
|
+
from ...core.pydantic_utilities import parse_obj_as
|
8
|
+
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
9
|
+
from json.decoder import JSONDecodeError
|
10
|
+
from ...core.api_error import ApiError
|
11
|
+
from ...core.client_wrapper import AsyncClientWrapper
|
12
12
|
|
13
13
|
# this is used as the default value for optional parameters
|
14
14
|
OMIT = typing.cast(typing.Any, ...)
|
@@ -21,19 +21,19 @@ class DriveClient:
|
|
21
21
|
def invoke(
|
22
22
|
self,
|
23
23
|
*,
|
24
|
-
config: typing.Dict[str, typing.Any],
|
25
|
-
messages: typing.Sequence[typing.Dict[str, typing.Any]],
|
26
|
-
request_options: typing.Optional[RequestOptions] = None
|
24
|
+
config: typing.Dict[str, typing.Optional[typing.Any]],
|
25
|
+
messages: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
26
|
+
request_options: typing.Optional[RequestOptions] = None,
|
27
27
|
) -> DriveAgentResponse:
|
28
28
|
"""
|
29
29
|
Coming soon! Manage folders and search for files in the internal drive.
|
30
30
|
|
31
31
|
Parameters
|
32
32
|
----------
|
33
|
-
config : typing.Dict[str, typing.Any]
|
33
|
+
config : typing.Dict[str, typing.Optional[typing.Any]]
|
34
34
|
Configuration for the drive agent including folder paths and search parameters
|
35
35
|
|
36
|
-
messages : typing.Sequence[typing.Dict[str, typing.Any]]
|
36
|
+
messages : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
37
37
|
The messages to send to the drive agent
|
38
38
|
|
39
39
|
request_options : typing.Optional[RequestOptions]
|
@@ -46,7 +46,7 @@ class DriveClient:
|
|
46
46
|
|
47
47
|
Examples
|
48
48
|
--------
|
49
|
-
from athena
|
49
|
+
from athena import Athena
|
50
50
|
|
51
51
|
client = Athena(
|
52
52
|
api_key="YOUR_API_KEY",
|
@@ -59,15 +59,35 @@ class DriveClient:
|
|
59
59
|
_response = self._client_wrapper.httpx_client.request(
|
60
60
|
"api/v0/agents/drive/invoke",
|
61
61
|
method="POST",
|
62
|
-
json={
|
62
|
+
json={
|
63
|
+
"config": config,
|
64
|
+
"messages": messages,
|
65
|
+
},
|
66
|
+
headers={
|
67
|
+
"content-type": "application/json",
|
68
|
+
},
|
63
69
|
request_options=request_options,
|
64
70
|
omit=OMIT,
|
65
71
|
)
|
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
72
|
try:
|
73
|
+
if 200 <= _response.status_code < 300:
|
74
|
+
return typing.cast(
|
75
|
+
DriveAgentResponse,
|
76
|
+
parse_obj_as(
|
77
|
+
type_=DriveAgentResponse, # type: ignore
|
78
|
+
object_=_response.json(),
|
79
|
+
),
|
80
|
+
)
|
81
|
+
if _response.status_code == 422:
|
82
|
+
raise UnprocessableEntityError(
|
83
|
+
typing.cast(
|
84
|
+
typing.Optional[typing.Any],
|
85
|
+
parse_obj_as(
|
86
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
87
|
+
object_=_response.json(),
|
88
|
+
),
|
89
|
+
)
|
90
|
+
)
|
71
91
|
_response_json = _response.json()
|
72
92
|
except JSONDecodeError:
|
73
93
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -81,19 +101,19 @@ class AsyncDriveClient:
|
|
81
101
|
async def invoke(
|
82
102
|
self,
|
83
103
|
*,
|
84
|
-
config: typing.Dict[str, typing.Any],
|
85
|
-
messages: typing.Sequence[typing.Dict[str, typing.Any]],
|
86
|
-
request_options: typing.Optional[RequestOptions] = None
|
104
|
+
config: typing.Dict[str, typing.Optional[typing.Any]],
|
105
|
+
messages: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
106
|
+
request_options: typing.Optional[RequestOptions] = None,
|
87
107
|
) -> DriveAgentResponse:
|
88
108
|
"""
|
89
109
|
Coming soon! Manage folders and search for files in the internal drive.
|
90
110
|
|
91
111
|
Parameters
|
92
112
|
----------
|
93
|
-
config : typing.Dict[str, typing.Any]
|
113
|
+
config : typing.Dict[str, typing.Optional[typing.Any]]
|
94
114
|
Configuration for the drive agent including folder paths and search parameters
|
95
115
|
|
96
|
-
messages : typing.Sequence[typing.Dict[str, typing.Any]]
|
116
|
+
messages : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
97
117
|
The messages to send to the drive agent
|
98
118
|
|
99
119
|
request_options : typing.Optional[RequestOptions]
|
@@ -106,28 +126,56 @@ class AsyncDriveClient:
|
|
106
126
|
|
107
127
|
Examples
|
108
128
|
--------
|
109
|
-
|
129
|
+
import asyncio
|
130
|
+
|
131
|
+
from athena import AsyncAthena
|
110
132
|
|
111
133
|
client = AsyncAthena(
|
112
134
|
api_key="YOUR_API_KEY",
|
113
135
|
)
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
136
|
+
|
137
|
+
|
138
|
+
async def main() -> None:
|
139
|
+
await client.agents.drive.invoke(
|
140
|
+
config={"key": "value"},
|
141
|
+
messages=[{"key": "value"}],
|
142
|
+
)
|
143
|
+
|
144
|
+
|
145
|
+
asyncio.run(main())
|
118
146
|
"""
|
119
147
|
_response = await self._client_wrapper.httpx_client.request(
|
120
148
|
"api/v0/agents/drive/invoke",
|
121
149
|
method="POST",
|
122
|
-
json={
|
150
|
+
json={
|
151
|
+
"config": config,
|
152
|
+
"messages": messages,
|
153
|
+
},
|
154
|
+
headers={
|
155
|
+
"content-type": "application/json",
|
156
|
+
},
|
123
157
|
request_options=request_options,
|
124
158
|
omit=OMIT,
|
125
159
|
)
|
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
160
|
try:
|
161
|
+
if 200 <= _response.status_code < 300:
|
162
|
+
return typing.cast(
|
163
|
+
DriveAgentResponse,
|
164
|
+
parse_obj_as(
|
165
|
+
type_=DriveAgentResponse, # type: ignore
|
166
|
+
object_=_response.json(),
|
167
|
+
),
|
168
|
+
)
|
169
|
+
if _response.status_code == 422:
|
170
|
+
raise UnprocessableEntityError(
|
171
|
+
typing.cast(
|
172
|
+
typing.Optional[typing.Any],
|
173
|
+
parse_obj_as(
|
174
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
175
|
+
object_=_response.json(),
|
176
|
+
),
|
177
|
+
)
|
178
|
+
)
|
131
179
|
_response_json = _response.json()
|
132
180
|
except JSONDecodeError:
|
133
181
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|