athena-intelligence 0.1.127__py3-none-any.whl → 0.1.184__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 +24 -3
- athena/agents/__init__.py +2 -0
- athena/agents/client.py +51 -95
- athena/agents/drive/__init__.py +2 -0
- athena/agents/drive/client.py +31 -80
- athena/agents/drive/raw_client.py +155 -0
- athena/agents/general/__init__.py +2 -0
- athena/agents/general/client.py +91 -238
- athena/agents/general/raw_client.py +369 -0
- athena/agents/raw_client.py +176 -0
- athena/agents/research/__init__.py +2 -0
- athena/agents/research/client.py +31 -80
- athena/agents/research/raw_client.py +155 -0
- athena/agents/sql/__init__.py +2 -0
- athena/agents/sql/client.py +31 -80
- athena/agents/sql/raw_client.py +155 -0
- athena/assets/__init__.py +4 -0
- athena/assets/client.py +144 -0
- athena/assets/raw_client.py +164 -0
- athena/base_client.py +25 -11
- athena/client.py +1 -1
- athena/core/__init__.py +5 -0
- athena/core/api_error.py +13 -5
- athena/core/client_wrapper.py +33 -8
- athena/core/force_multipart.py +16 -0
- athena/core/http_client.py +70 -26
- athena/core/http_response.py +55 -0
- athena/core/jsonable_encoder.py +0 -1
- athena/core/pydantic_utilities.py +70 -111
- athena/core/serialization.py +7 -3
- athena/errors/__init__.py +2 -0
- athena/errors/bad_request_error.py +4 -2
- athena/errors/content_too_large_error.py +4 -2
- athena/errors/internal_server_error.py +4 -3
- athena/errors/not_found_error.py +4 -2
- athena/errors/unauthorized_error.py +4 -3
- athena/errors/unprocessable_entity_error.py +4 -3
- athena/errors/unsupported_media_type_error.py +4 -2
- athena/query/__init__.py +2 -0
- athena/query/client.py +39 -219
- athena/query/raw_client.py +344 -0
- athena/query/types/__init__.py +2 -0
- athena/tools/__init__.py +2 -0
- athena/tools/calendar/__init__.py +2 -0
- athena/tools/calendar/client.py +35 -79
- athena/tools/calendar/raw_client.py +172 -0
- athena/tools/client.py +114 -876
- athena/tools/email/__init__.py +2 -0
- athena/tools/email/client.py +39 -115
- athena/tools/email/raw_client.py +248 -0
- athena/tools/raw_client.py +1328 -0
- athena/tools/structured_data_extractor/__init__.py +2 -0
- athena/tools/structured_data_extractor/client.py +42 -96
- athena/tools/structured_data_extractor/raw_client.py +240 -0
- athena/tools/tasks/__init__.py +2 -0
- athena/tools/tasks/client.py +31 -43
- athena/tools/tasks/raw_client.py +96 -0
- athena/tools/types/__init__.py +2 -0
- athena/types/__init__.py +24 -2
- athena/types/asset_content_request_out.py +3 -3
- athena/types/asset_node.py +3 -3
- athena/types/asset_not_found_error.py +2 -2
- athena/types/asset_screenshot_response_out.py +4 -4
- athena/types/chunk.py +3 -3
- athena/types/chunk_content_item.py +3 -2
- athena/types/chunk_result.py +3 -3
- athena/types/content.py +7 -0
- athena/types/custom_agent_response.py +2 -2
- athena/types/data_frame_request_out.py +3 -3
- athena/types/data_frame_unknown_format_error.py +2 -2
- athena/types/document_chunk.py +2 -2
- athena/types/drive_agent_response.py +2 -2
- athena/types/file_chunk_request_out.py +3 -3
- athena/types/file_too_large_error.py +2 -2
- athena/types/folder_response.py +10 -4
- athena/types/general_agent_config.py +3 -3
- athena/types/general_agent_config_enabled_tools_item.py +1 -2
- athena/types/general_agent_request.py +15 -4
- athena/types/general_agent_response.py +4 -3
- athena/types/general_agent_response_message.py +100 -0
- athena/types/general_agent_response_message_kwargs.py +74 -0
- athena/types/{tool.py → id.py} +1 -1
- athena/types/image_url_content.py +2 -2
- athena/types/input_message.py +29 -0
- athena/types/input_message_content_item.py +39 -0
- athena/types/paginated_assets_out.py +52 -0
- athena/types/parent_folder_error.py +2 -2
- athena/types/prompt_message.py +3 -3
- athena/types/public_asset_out.py +97 -0
- athena/types/research_agent_response.py +2 -2
- athena/types/save_asset_request_out.py +2 -2
- athena/types/sql_agent_response.py +2 -2
- athena/types/structured_data_extractor_response.py +3 -3
- athena/types/text_content.py +2 -2
- athena/types/type.py +1 -1
- {athena_intelligence-0.1.127.dist-info → athena_intelligence-0.1.184.dist-info}/METADATA +3 -7
- athena_intelligence-0.1.184.dist-info/RECORD +112 -0
- {athena_intelligence-0.1.127.dist-info → athena_intelligence-0.1.184.dist-info}/WHEEL +1 -1
- athena_intelligence-0.1.127.dist-info/RECORD +0 -89
@@ -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.http_response import AsyncHttpResponse, HttpResponse
|
9
|
+
from ...core.pydantic_utilities import parse_obj_as
|
10
|
+
from ...core.request_options import RequestOptions
|
11
|
+
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
12
|
+
from ...types.research_agent_response import ResearchAgentResponse
|
13
|
+
|
14
|
+
# this is used as the default value for optional parameters
|
15
|
+
OMIT = typing.cast(typing.Any, ...)
|
16
|
+
|
17
|
+
|
18
|
+
class RawResearchClient:
|
19
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
20
|
+
self._client_wrapper = client_wrapper
|
21
|
+
|
22
|
+
def invoke(
|
23
|
+
self,
|
24
|
+
*,
|
25
|
+
config: typing.Dict[str, typing.Optional[typing.Any]],
|
26
|
+
messages: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
27
|
+
request_options: typing.Optional[RequestOptions] = None,
|
28
|
+
) -> HttpResponse[ResearchAgentResponse]:
|
29
|
+
"""
|
30
|
+
Coming soon! Conduct research using web and other sources.
|
31
|
+
|
32
|
+
Parameters
|
33
|
+
----------
|
34
|
+
config : typing.Dict[str, typing.Optional[typing.Any]]
|
35
|
+
Configuration for the research agent including search parameters and sources
|
36
|
+
|
37
|
+
messages : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
38
|
+
The messages to send to the research agent
|
39
|
+
|
40
|
+
request_options : typing.Optional[RequestOptions]
|
41
|
+
Request-specific configuration.
|
42
|
+
|
43
|
+
Returns
|
44
|
+
-------
|
45
|
+
HttpResponse[ResearchAgentResponse]
|
46
|
+
Successful Response
|
47
|
+
"""
|
48
|
+
_response = self._client_wrapper.httpx_client.request(
|
49
|
+
"api/v0/agents/research/invoke",
|
50
|
+
method="POST",
|
51
|
+
json={
|
52
|
+
"config": config,
|
53
|
+
"messages": messages,
|
54
|
+
},
|
55
|
+
headers={
|
56
|
+
"content-type": "application/json",
|
57
|
+
},
|
58
|
+
request_options=request_options,
|
59
|
+
omit=OMIT,
|
60
|
+
)
|
61
|
+
try:
|
62
|
+
if 200 <= _response.status_code < 300:
|
63
|
+
_data = typing.cast(
|
64
|
+
ResearchAgentResponse,
|
65
|
+
parse_obj_as(
|
66
|
+
type_=ResearchAgentResponse, # type: ignore
|
67
|
+
object_=_response.json(),
|
68
|
+
),
|
69
|
+
)
|
70
|
+
return HttpResponse(response=_response, data=_data)
|
71
|
+
if _response.status_code == 422:
|
72
|
+
raise UnprocessableEntityError(
|
73
|
+
headers=dict(_response.headers),
|
74
|
+
body=typing.cast(
|
75
|
+
typing.Optional[typing.Any],
|
76
|
+
parse_obj_as(
|
77
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
78
|
+
object_=_response.json(),
|
79
|
+
),
|
80
|
+
),
|
81
|
+
)
|
82
|
+
_response_json = _response.json()
|
83
|
+
except JSONDecodeError:
|
84
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
85
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
86
|
+
|
87
|
+
|
88
|
+
class AsyncRawResearchClient:
|
89
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
90
|
+
self._client_wrapper = client_wrapper
|
91
|
+
|
92
|
+
async def invoke(
|
93
|
+
self,
|
94
|
+
*,
|
95
|
+
config: typing.Dict[str, typing.Optional[typing.Any]],
|
96
|
+
messages: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
97
|
+
request_options: typing.Optional[RequestOptions] = None,
|
98
|
+
) -> AsyncHttpResponse[ResearchAgentResponse]:
|
99
|
+
"""
|
100
|
+
Coming soon! Conduct research using web and other sources.
|
101
|
+
|
102
|
+
Parameters
|
103
|
+
----------
|
104
|
+
config : typing.Dict[str, typing.Optional[typing.Any]]
|
105
|
+
Configuration for the research agent including search parameters and sources
|
106
|
+
|
107
|
+
messages : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
108
|
+
The messages to send to the research agent
|
109
|
+
|
110
|
+
request_options : typing.Optional[RequestOptions]
|
111
|
+
Request-specific configuration.
|
112
|
+
|
113
|
+
Returns
|
114
|
+
-------
|
115
|
+
AsyncHttpResponse[ResearchAgentResponse]
|
116
|
+
Successful Response
|
117
|
+
"""
|
118
|
+
_response = await self._client_wrapper.httpx_client.request(
|
119
|
+
"api/v0/agents/research/invoke",
|
120
|
+
method="POST",
|
121
|
+
json={
|
122
|
+
"config": config,
|
123
|
+
"messages": messages,
|
124
|
+
},
|
125
|
+
headers={
|
126
|
+
"content-type": "application/json",
|
127
|
+
},
|
128
|
+
request_options=request_options,
|
129
|
+
omit=OMIT,
|
130
|
+
)
|
131
|
+
try:
|
132
|
+
if 200 <= _response.status_code < 300:
|
133
|
+
_data = typing.cast(
|
134
|
+
ResearchAgentResponse,
|
135
|
+
parse_obj_as(
|
136
|
+
type_=ResearchAgentResponse, # type: ignore
|
137
|
+
object_=_response.json(),
|
138
|
+
),
|
139
|
+
)
|
140
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
141
|
+
if _response.status_code == 422:
|
142
|
+
raise UnprocessableEntityError(
|
143
|
+
headers=dict(_response.headers),
|
144
|
+
body=typing.cast(
|
145
|
+
typing.Optional[typing.Any],
|
146
|
+
parse_obj_as(
|
147
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
148
|
+
object_=_response.json(),
|
149
|
+
),
|
150
|
+
),
|
151
|
+
)
|
152
|
+
_response_json = _response.json()
|
153
|
+
except JSONDecodeError:
|
154
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
155
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
athena/agents/sql/__init__.py
CHANGED
athena/agents/sql/client.py
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
import typing
|
4
|
-
|
4
|
+
|
5
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
5
6
|
from ...core.request_options import RequestOptions
|
6
7
|
from ...types.sql_agent_response import SqlAgentResponse
|
7
|
-
from
|
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
|
8
|
+
from .raw_client import AsyncRawSqlClient, RawSqlClient
|
12
9
|
|
13
10
|
# this is used as the default value for optional parameters
|
14
11
|
OMIT = typing.cast(typing.Any, ...)
|
@@ -16,7 +13,18 @@ OMIT = typing.cast(typing.Any, ...)
|
|
16
13
|
|
17
14
|
class SqlClient:
|
18
15
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
19
|
-
self.
|
16
|
+
self._raw_client = RawSqlClient(client_wrapper=client_wrapper)
|
17
|
+
|
18
|
+
@property
|
19
|
+
def with_raw_response(self) -> RawSqlClient:
|
20
|
+
"""
|
21
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
22
|
+
|
23
|
+
Returns
|
24
|
+
-------
|
25
|
+
RawSqlClient
|
26
|
+
"""
|
27
|
+
return self._raw_client
|
20
28
|
|
21
29
|
def invoke(
|
22
30
|
self,
|
@@ -56,47 +64,24 @@ class SqlClient:
|
|
56
64
|
messages=[{"key": "value"}],
|
57
65
|
)
|
58
66
|
"""
|
59
|
-
_response = self.
|
60
|
-
|
61
|
-
method="POST",
|
62
|
-
json={
|
63
|
-
"config": config,
|
64
|
-
"messages": messages,
|
65
|
-
},
|
66
|
-
headers={
|
67
|
-
"content-type": "application/json",
|
68
|
-
},
|
69
|
-
request_options=request_options,
|
70
|
-
omit=OMIT,
|
71
|
-
)
|
72
|
-
try:
|
73
|
-
if 200 <= _response.status_code < 300:
|
74
|
-
return typing.cast(
|
75
|
-
SqlAgentResponse,
|
76
|
-
parse_obj_as(
|
77
|
-
type_=SqlAgentResponse, # 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
|
-
)
|
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)
|
67
|
+
_response = self._raw_client.invoke(config=config, messages=messages, request_options=request_options)
|
68
|
+
return _response.data
|
95
69
|
|
96
70
|
|
97
71
|
class AsyncSqlClient:
|
98
72
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
99
|
-
self.
|
73
|
+
self._raw_client = AsyncRawSqlClient(client_wrapper=client_wrapper)
|
74
|
+
|
75
|
+
@property
|
76
|
+
def with_raw_response(self) -> AsyncRawSqlClient:
|
77
|
+
"""
|
78
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
79
|
+
|
80
|
+
Returns
|
81
|
+
-------
|
82
|
+
AsyncRawSqlClient
|
83
|
+
"""
|
84
|
+
return self._raw_client
|
100
85
|
|
101
86
|
async def invoke(
|
102
87
|
self,
|
@@ -144,39 +129,5 @@ class AsyncSqlClient:
|
|
144
129
|
|
145
130
|
asyncio.run(main())
|
146
131
|
"""
|
147
|
-
_response = await self.
|
148
|
-
|
149
|
-
method="POST",
|
150
|
-
json={
|
151
|
-
"config": config,
|
152
|
-
"messages": messages,
|
153
|
-
},
|
154
|
-
headers={
|
155
|
-
"content-type": "application/json",
|
156
|
-
},
|
157
|
-
request_options=request_options,
|
158
|
-
omit=OMIT,
|
159
|
-
)
|
160
|
-
try:
|
161
|
-
if 200 <= _response.status_code < 300:
|
162
|
-
return typing.cast(
|
163
|
-
SqlAgentResponse,
|
164
|
-
parse_obj_as(
|
165
|
-
type_=SqlAgentResponse, # 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
|
-
)
|
179
|
-
_response_json = _response.json()
|
180
|
-
except JSONDecodeError:
|
181
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
182
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
132
|
+
_response = await self._raw_client.invoke(config=config, messages=messages, request_options=request_options)
|
133
|
+
return _response.data
|
@@ -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.http_response import AsyncHttpResponse, HttpResponse
|
9
|
+
from ...core.pydantic_utilities import parse_obj_as
|
10
|
+
from ...core.request_options import RequestOptions
|
11
|
+
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
12
|
+
from ...types.sql_agent_response import SqlAgentResponse
|
13
|
+
|
14
|
+
# this is used as the default value for optional parameters
|
15
|
+
OMIT = typing.cast(typing.Any, ...)
|
16
|
+
|
17
|
+
|
18
|
+
class RawSqlClient:
|
19
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
20
|
+
self._client_wrapper = client_wrapper
|
21
|
+
|
22
|
+
def invoke(
|
23
|
+
self,
|
24
|
+
*,
|
25
|
+
config: typing.Dict[str, typing.Optional[typing.Any]],
|
26
|
+
messages: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
27
|
+
request_options: typing.Optional[RequestOptions] = None,
|
28
|
+
) -> HttpResponse[SqlAgentResponse]:
|
29
|
+
"""
|
30
|
+
Coming soon! Generate, execute, and test SQL queries. Returns an asset ID for the query object.
|
31
|
+
|
32
|
+
Parameters
|
33
|
+
----------
|
34
|
+
config : typing.Dict[str, typing.Optional[typing.Any]]
|
35
|
+
Configuration for the SQL agent including database connection details and query parameters
|
36
|
+
|
37
|
+
messages : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
38
|
+
The messages to send to the SQL agent
|
39
|
+
|
40
|
+
request_options : typing.Optional[RequestOptions]
|
41
|
+
Request-specific configuration.
|
42
|
+
|
43
|
+
Returns
|
44
|
+
-------
|
45
|
+
HttpResponse[SqlAgentResponse]
|
46
|
+
Successful Response
|
47
|
+
"""
|
48
|
+
_response = self._client_wrapper.httpx_client.request(
|
49
|
+
"api/v0/agents/sql/invoke",
|
50
|
+
method="POST",
|
51
|
+
json={
|
52
|
+
"config": config,
|
53
|
+
"messages": messages,
|
54
|
+
},
|
55
|
+
headers={
|
56
|
+
"content-type": "application/json",
|
57
|
+
},
|
58
|
+
request_options=request_options,
|
59
|
+
omit=OMIT,
|
60
|
+
)
|
61
|
+
try:
|
62
|
+
if 200 <= _response.status_code < 300:
|
63
|
+
_data = typing.cast(
|
64
|
+
SqlAgentResponse,
|
65
|
+
parse_obj_as(
|
66
|
+
type_=SqlAgentResponse, # type: ignore
|
67
|
+
object_=_response.json(),
|
68
|
+
),
|
69
|
+
)
|
70
|
+
return HttpResponse(response=_response, data=_data)
|
71
|
+
if _response.status_code == 422:
|
72
|
+
raise UnprocessableEntityError(
|
73
|
+
headers=dict(_response.headers),
|
74
|
+
body=typing.cast(
|
75
|
+
typing.Optional[typing.Any],
|
76
|
+
parse_obj_as(
|
77
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
78
|
+
object_=_response.json(),
|
79
|
+
),
|
80
|
+
),
|
81
|
+
)
|
82
|
+
_response_json = _response.json()
|
83
|
+
except JSONDecodeError:
|
84
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
85
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
86
|
+
|
87
|
+
|
88
|
+
class AsyncRawSqlClient:
|
89
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
90
|
+
self._client_wrapper = client_wrapper
|
91
|
+
|
92
|
+
async def invoke(
|
93
|
+
self,
|
94
|
+
*,
|
95
|
+
config: typing.Dict[str, typing.Optional[typing.Any]],
|
96
|
+
messages: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
97
|
+
request_options: typing.Optional[RequestOptions] = None,
|
98
|
+
) -> AsyncHttpResponse[SqlAgentResponse]:
|
99
|
+
"""
|
100
|
+
Coming soon! Generate, execute, and test SQL queries. Returns an asset ID for the query object.
|
101
|
+
|
102
|
+
Parameters
|
103
|
+
----------
|
104
|
+
config : typing.Dict[str, typing.Optional[typing.Any]]
|
105
|
+
Configuration for the SQL agent including database connection details and query parameters
|
106
|
+
|
107
|
+
messages : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
108
|
+
The messages to send to the SQL agent
|
109
|
+
|
110
|
+
request_options : typing.Optional[RequestOptions]
|
111
|
+
Request-specific configuration.
|
112
|
+
|
113
|
+
Returns
|
114
|
+
-------
|
115
|
+
AsyncHttpResponse[SqlAgentResponse]
|
116
|
+
Successful Response
|
117
|
+
"""
|
118
|
+
_response = await self._client_wrapper.httpx_client.request(
|
119
|
+
"api/v0/agents/sql/invoke",
|
120
|
+
method="POST",
|
121
|
+
json={
|
122
|
+
"config": config,
|
123
|
+
"messages": messages,
|
124
|
+
},
|
125
|
+
headers={
|
126
|
+
"content-type": "application/json",
|
127
|
+
},
|
128
|
+
request_options=request_options,
|
129
|
+
omit=OMIT,
|
130
|
+
)
|
131
|
+
try:
|
132
|
+
if 200 <= _response.status_code < 300:
|
133
|
+
_data = typing.cast(
|
134
|
+
SqlAgentResponse,
|
135
|
+
parse_obj_as(
|
136
|
+
type_=SqlAgentResponse, # type: ignore
|
137
|
+
object_=_response.json(),
|
138
|
+
),
|
139
|
+
)
|
140
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
141
|
+
if _response.status_code == 422:
|
142
|
+
raise UnprocessableEntityError(
|
143
|
+
headers=dict(_response.headers),
|
144
|
+
body=typing.cast(
|
145
|
+
typing.Optional[typing.Any],
|
146
|
+
parse_obj_as(
|
147
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
148
|
+
object_=_response.json(),
|
149
|
+
),
|
150
|
+
),
|
151
|
+
)
|
152
|
+
_response_json = _response.json()
|
153
|
+
except JSONDecodeError:
|
154
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
155
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
athena/assets/client.py
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
6
|
+
from ..core.request_options import RequestOptions
|
7
|
+
from ..types.paginated_assets_out import PaginatedAssetsOut
|
8
|
+
from .raw_client import AsyncRawAssetsClient, RawAssetsClient
|
9
|
+
|
10
|
+
|
11
|
+
class AssetsClient:
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
13
|
+
self._raw_client = RawAssetsClient(client_wrapper=client_wrapper)
|
14
|
+
|
15
|
+
@property
|
16
|
+
def with_raw_response(self) -> RawAssetsClient:
|
17
|
+
"""
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
19
|
+
|
20
|
+
Returns
|
21
|
+
-------
|
22
|
+
RawAssetsClient
|
23
|
+
"""
|
24
|
+
return self._raw_client
|
25
|
+
|
26
|
+
def list(
|
27
|
+
self,
|
28
|
+
*,
|
29
|
+
limit: typing.Optional[int] = None,
|
30
|
+
offset: typing.Optional[int] = None,
|
31
|
+
filters: typing.Optional[str] = None,
|
32
|
+
sort: typing.Optional[str] = None,
|
33
|
+
request_options: typing.Optional[RequestOptions] = None,
|
34
|
+
) -> PaginatedAssetsOut:
|
35
|
+
"""
|
36
|
+
Retrieve a paginated list of assets with optional filtering and sorting. Assets include documents, presentations, spreadsheets, images, videos, and other file types managed by Athena Intelligence.
|
37
|
+
|
38
|
+
Parameters
|
39
|
+
----------
|
40
|
+
limit : typing.Optional[int]
|
41
|
+
Maximum number of assets to return per page (1-500)
|
42
|
+
|
43
|
+
offset : typing.Optional[int]
|
44
|
+
Number of assets to skip for pagination
|
45
|
+
|
46
|
+
filters : typing.Optional[str]
|
47
|
+
JSON string of filter criteria. Supports: created_by_id, created_by_email, tags, created_after/before, updated_after/before, title_substring, is_archived, is_hidden, athena_metadata, media_type, athena_converted_type, athena_original_type, summary_ready, summary_status
|
48
|
+
|
49
|
+
sort : typing.Optional[str]
|
50
|
+
JSON string of sort criteria: [{"field": "updated_at", "direction": "desc"}]. Supported fields: created_by_id, created_by_email, created_at, updated_at, is_archived, is_hidden, summary_ready, summary_status
|
51
|
+
|
52
|
+
request_options : typing.Optional[RequestOptions]
|
53
|
+
Request-specific configuration.
|
54
|
+
|
55
|
+
Returns
|
56
|
+
-------
|
57
|
+
PaginatedAssetsOut
|
58
|
+
Successfully retrieved paginated list of assets
|
59
|
+
|
60
|
+
Examples
|
61
|
+
--------
|
62
|
+
from athena import Athena
|
63
|
+
|
64
|
+
client = Athena(
|
65
|
+
api_key="YOUR_API_KEY",
|
66
|
+
)
|
67
|
+
client.assets.list()
|
68
|
+
"""
|
69
|
+
_response = self._raw_client.list(
|
70
|
+
limit=limit, offset=offset, filters=filters, sort=sort, request_options=request_options
|
71
|
+
)
|
72
|
+
return _response.data
|
73
|
+
|
74
|
+
|
75
|
+
class AsyncAssetsClient:
|
76
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
77
|
+
self._raw_client = AsyncRawAssetsClient(client_wrapper=client_wrapper)
|
78
|
+
|
79
|
+
@property
|
80
|
+
def with_raw_response(self) -> AsyncRawAssetsClient:
|
81
|
+
"""
|
82
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
83
|
+
|
84
|
+
Returns
|
85
|
+
-------
|
86
|
+
AsyncRawAssetsClient
|
87
|
+
"""
|
88
|
+
return self._raw_client
|
89
|
+
|
90
|
+
async def list(
|
91
|
+
self,
|
92
|
+
*,
|
93
|
+
limit: typing.Optional[int] = None,
|
94
|
+
offset: typing.Optional[int] = None,
|
95
|
+
filters: typing.Optional[str] = None,
|
96
|
+
sort: typing.Optional[str] = None,
|
97
|
+
request_options: typing.Optional[RequestOptions] = None,
|
98
|
+
) -> PaginatedAssetsOut:
|
99
|
+
"""
|
100
|
+
Retrieve a paginated list of assets with optional filtering and sorting. Assets include documents, presentations, spreadsheets, images, videos, and other file types managed by Athena Intelligence.
|
101
|
+
|
102
|
+
Parameters
|
103
|
+
----------
|
104
|
+
limit : typing.Optional[int]
|
105
|
+
Maximum number of assets to return per page (1-500)
|
106
|
+
|
107
|
+
offset : typing.Optional[int]
|
108
|
+
Number of assets to skip for pagination
|
109
|
+
|
110
|
+
filters : typing.Optional[str]
|
111
|
+
JSON string of filter criteria. Supports: created_by_id, created_by_email, tags, created_after/before, updated_after/before, title_substring, is_archived, is_hidden, athena_metadata, media_type, athena_converted_type, athena_original_type, summary_ready, summary_status
|
112
|
+
|
113
|
+
sort : typing.Optional[str]
|
114
|
+
JSON string of sort criteria: [{"field": "updated_at", "direction": "desc"}]. Supported fields: created_by_id, created_by_email, created_at, updated_at, is_archived, is_hidden, summary_ready, summary_status
|
115
|
+
|
116
|
+
request_options : typing.Optional[RequestOptions]
|
117
|
+
Request-specific configuration.
|
118
|
+
|
119
|
+
Returns
|
120
|
+
-------
|
121
|
+
PaginatedAssetsOut
|
122
|
+
Successfully retrieved paginated list of assets
|
123
|
+
|
124
|
+
Examples
|
125
|
+
--------
|
126
|
+
import asyncio
|
127
|
+
|
128
|
+
from athena import AsyncAthena
|
129
|
+
|
130
|
+
client = AsyncAthena(
|
131
|
+
api_key="YOUR_API_KEY",
|
132
|
+
)
|
133
|
+
|
134
|
+
|
135
|
+
async def main() -> None:
|
136
|
+
await client.assets.list()
|
137
|
+
|
138
|
+
|
139
|
+
asyncio.run(main())
|
140
|
+
"""
|
141
|
+
_response = await self._raw_client.list(
|
142
|
+
limit=limit, offset=offset, filters=filters, sort=sort, request_options=request_options
|
143
|
+
)
|
144
|
+
return _response.data
|