athena-intelligence 0.1.260__py3-none-any.whl → 0.1.375__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 +9 -15
- athena/assets/client.py +278 -0
- athena/assets/raw_client.py +416 -0
- athena/client.py +9 -13
- athena/core/client_wrapper.py +2 -2
- athena/environment.py +0 -2
- athena/tools/client.py +4 -15
- athena/tools/raw_client.py +12 -17
- athena/types/__init__.py +9 -15
- athena/types/border_model.py +8 -3
- athena/types/cell_format.py +15 -4
- athena/types/conversation_asset_info.py +5 -0
- athena/types/creatable_asset_type.py +5 -0
- athena/types/create_asset_response_out.py +46 -0
- athena/types/create_project_response_out.py +51 -0
- athena/types/dimension_properties.py +1 -1
- athena/types/sheet.py +13 -6
- athena/types/text_format_model.py +11 -2
- athena/types/thread_status_response_out.py +5 -0
- {athena_intelligence-0.1.260.dist-info → athena_intelligence-0.1.375.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.260.dist-info → athena_intelligence-0.1.375.dist-info}/RECORD +22 -24
- athena/types/backgroundcolor.py +0 -7
- athena/types/color.py +0 -7
- athena/types/document_chunk.py +0 -24
- athena/types/file_chunk_request_out.py +0 -24
- athena/types/tabcolor.py +0 -7
- {athena_intelligence-0.1.260.dist-info → athena_intelligence-0.1.375.dist-info}/WHEEL +0 -0
athena/assets/raw_client.py
CHANGED
|
@@ -9,12 +9,20 @@ from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
|
9
9
|
from ..core.jsonable_encoder import jsonable_encoder
|
|
10
10
|
from ..core.pydantic_utilities import parse_obj_as
|
|
11
11
|
from ..core.request_options import RequestOptions
|
|
12
|
+
from ..errors.bad_request_error import BadRequestError
|
|
13
|
+
from ..errors.internal_server_error import InternalServerError
|
|
12
14
|
from ..errors.not_found_error import NotFoundError
|
|
13
15
|
from ..errors.unauthorized_error import UnauthorizedError
|
|
14
16
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
17
|
+
from ..types.creatable_asset_type import CreatableAssetType
|
|
18
|
+
from ..types.create_asset_response_out import CreateAssetResponseOut
|
|
19
|
+
from ..types.create_project_response_out import CreateProjectResponseOut
|
|
15
20
|
from ..types.paginated_assets_out import PaginatedAssetsOut
|
|
16
21
|
from ..types.public_asset_out import PublicAssetOut
|
|
17
22
|
|
|
23
|
+
# this is used as the default value for optional parameters
|
|
24
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
25
|
+
|
|
18
26
|
|
|
19
27
|
class RawAssetsClient:
|
|
20
28
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
@@ -91,6 +99,210 @@ class RawAssetsClient:
|
|
|
91
99
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
92
100
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
93
101
|
|
|
102
|
+
def create(
|
|
103
|
+
self,
|
|
104
|
+
*,
|
|
105
|
+
asset_type: CreatableAssetType,
|
|
106
|
+
parent_folder_id: typing.Optional[str] = OMIT,
|
|
107
|
+
title: typing.Optional[str] = OMIT,
|
|
108
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
109
|
+
) -> HttpResponse[CreateAssetResponseOut]:
|
|
110
|
+
"""
|
|
111
|
+
Create a new asset such as a spreadsheet, document, or folder in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration.
|
|
112
|
+
|
|
113
|
+
Parameters
|
|
114
|
+
----------
|
|
115
|
+
asset_type : CreatableAssetType
|
|
116
|
+
Type of asset to create. Supported types: 'spreadsheet' (or 'sheet'), 'document' (or 'doc'), 'folder'
|
|
117
|
+
|
|
118
|
+
parent_folder_id : typing.Optional[str]
|
|
119
|
+
ID of the parent folder to create the asset in
|
|
120
|
+
|
|
121
|
+
title : typing.Optional[str]
|
|
122
|
+
Title for the new asset
|
|
123
|
+
|
|
124
|
+
request_options : typing.Optional[RequestOptions]
|
|
125
|
+
Request-specific configuration.
|
|
126
|
+
|
|
127
|
+
Returns
|
|
128
|
+
-------
|
|
129
|
+
HttpResponse[CreateAssetResponseOut]
|
|
130
|
+
Asset created successfully
|
|
131
|
+
"""
|
|
132
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
133
|
+
"api/v0/assets/create",
|
|
134
|
+
method="POST",
|
|
135
|
+
json={
|
|
136
|
+
"asset_type": asset_type,
|
|
137
|
+
"parent_folder_id": parent_folder_id,
|
|
138
|
+
"title": title,
|
|
139
|
+
},
|
|
140
|
+
headers={
|
|
141
|
+
"content-type": "application/json",
|
|
142
|
+
},
|
|
143
|
+
request_options=request_options,
|
|
144
|
+
omit=OMIT,
|
|
145
|
+
)
|
|
146
|
+
try:
|
|
147
|
+
if 200 <= _response.status_code < 300:
|
|
148
|
+
_data = typing.cast(
|
|
149
|
+
CreateAssetResponseOut,
|
|
150
|
+
parse_obj_as(
|
|
151
|
+
type_=CreateAssetResponseOut, # type: ignore
|
|
152
|
+
object_=_response.json(),
|
|
153
|
+
),
|
|
154
|
+
)
|
|
155
|
+
return HttpResponse(response=_response, data=_data)
|
|
156
|
+
if _response.status_code == 400:
|
|
157
|
+
raise BadRequestError(
|
|
158
|
+
headers=dict(_response.headers),
|
|
159
|
+
body=typing.cast(
|
|
160
|
+
typing.Optional[typing.Any],
|
|
161
|
+
parse_obj_as(
|
|
162
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
163
|
+
object_=_response.json(),
|
|
164
|
+
),
|
|
165
|
+
),
|
|
166
|
+
)
|
|
167
|
+
if _response.status_code == 422:
|
|
168
|
+
raise UnprocessableEntityError(
|
|
169
|
+
headers=dict(_response.headers),
|
|
170
|
+
body=typing.cast(
|
|
171
|
+
typing.Optional[typing.Any],
|
|
172
|
+
parse_obj_as(
|
|
173
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
174
|
+
object_=_response.json(),
|
|
175
|
+
),
|
|
176
|
+
),
|
|
177
|
+
)
|
|
178
|
+
if _response.status_code == 500:
|
|
179
|
+
raise InternalServerError(
|
|
180
|
+
headers=dict(_response.headers),
|
|
181
|
+
body=typing.cast(
|
|
182
|
+
typing.Optional[typing.Any],
|
|
183
|
+
parse_obj_as(
|
|
184
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
185
|
+
object_=_response.json(),
|
|
186
|
+
),
|
|
187
|
+
),
|
|
188
|
+
)
|
|
189
|
+
_response_json = _response.json()
|
|
190
|
+
except JSONDecodeError:
|
|
191
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
192
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
193
|
+
|
|
194
|
+
def create_project(
|
|
195
|
+
self,
|
|
196
|
+
*,
|
|
197
|
+
title: str,
|
|
198
|
+
custom_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
199
|
+
description: typing.Optional[str] = OMIT,
|
|
200
|
+
parent_folder_id: typing.Optional[str] = OMIT,
|
|
201
|
+
project_type: typing.Optional[str] = OMIT,
|
|
202
|
+
share_with_emails: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
203
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
204
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
205
|
+
) -> HttpResponse[CreateProjectResponseOut]:
|
|
206
|
+
"""
|
|
207
|
+
Create a new project with custom metadata. Projects can be typed (e.g., 'candidate', 'user', 'company') and include flexible custom metadata for storing additional information.
|
|
208
|
+
|
|
209
|
+
Parameters
|
|
210
|
+
----------
|
|
211
|
+
title : str
|
|
212
|
+
The project title
|
|
213
|
+
|
|
214
|
+
custom_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
215
|
+
A flexible dictionary for storing custom metadata
|
|
216
|
+
|
|
217
|
+
description : typing.Optional[str]
|
|
218
|
+
Optional project description
|
|
219
|
+
|
|
220
|
+
parent_folder_id : typing.Optional[str]
|
|
221
|
+
Optional parent folder ID
|
|
222
|
+
|
|
223
|
+
project_type : typing.Optional[str]
|
|
224
|
+
User-defined project type (e.g., 'candidate', 'user', 'company')
|
|
225
|
+
|
|
226
|
+
share_with_emails : typing.Optional[typing.Sequence[str]]
|
|
227
|
+
Optional list of email addresses to share the project with (VIEW permission)
|
|
228
|
+
|
|
229
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
230
|
+
Optional list of tags for categorizing the project
|
|
231
|
+
|
|
232
|
+
request_options : typing.Optional[RequestOptions]
|
|
233
|
+
Request-specific configuration.
|
|
234
|
+
|
|
235
|
+
Returns
|
|
236
|
+
-------
|
|
237
|
+
HttpResponse[CreateProjectResponseOut]
|
|
238
|
+
Project created successfully
|
|
239
|
+
"""
|
|
240
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
241
|
+
"api/v0/assets/create_project",
|
|
242
|
+
method="POST",
|
|
243
|
+
json={
|
|
244
|
+
"custom_metadata": custom_metadata,
|
|
245
|
+
"description": description,
|
|
246
|
+
"parent_folder_id": parent_folder_id,
|
|
247
|
+
"project_type": project_type,
|
|
248
|
+
"share_with_emails": share_with_emails,
|
|
249
|
+
"tags": tags,
|
|
250
|
+
"title": title,
|
|
251
|
+
},
|
|
252
|
+
headers={
|
|
253
|
+
"content-type": "application/json",
|
|
254
|
+
},
|
|
255
|
+
request_options=request_options,
|
|
256
|
+
omit=OMIT,
|
|
257
|
+
)
|
|
258
|
+
try:
|
|
259
|
+
if 200 <= _response.status_code < 300:
|
|
260
|
+
_data = typing.cast(
|
|
261
|
+
CreateProjectResponseOut,
|
|
262
|
+
parse_obj_as(
|
|
263
|
+
type_=CreateProjectResponseOut, # type: ignore
|
|
264
|
+
object_=_response.json(),
|
|
265
|
+
),
|
|
266
|
+
)
|
|
267
|
+
return HttpResponse(response=_response, data=_data)
|
|
268
|
+
if _response.status_code == 400:
|
|
269
|
+
raise BadRequestError(
|
|
270
|
+
headers=dict(_response.headers),
|
|
271
|
+
body=typing.cast(
|
|
272
|
+
typing.Optional[typing.Any],
|
|
273
|
+
parse_obj_as(
|
|
274
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
275
|
+
object_=_response.json(),
|
|
276
|
+
),
|
|
277
|
+
),
|
|
278
|
+
)
|
|
279
|
+
if _response.status_code == 422:
|
|
280
|
+
raise UnprocessableEntityError(
|
|
281
|
+
headers=dict(_response.headers),
|
|
282
|
+
body=typing.cast(
|
|
283
|
+
typing.Optional[typing.Any],
|
|
284
|
+
parse_obj_as(
|
|
285
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
286
|
+
object_=_response.json(),
|
|
287
|
+
),
|
|
288
|
+
),
|
|
289
|
+
)
|
|
290
|
+
if _response.status_code == 500:
|
|
291
|
+
raise InternalServerError(
|
|
292
|
+
headers=dict(_response.headers),
|
|
293
|
+
body=typing.cast(
|
|
294
|
+
typing.Optional[typing.Any],
|
|
295
|
+
parse_obj_as(
|
|
296
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
297
|
+
object_=_response.json(),
|
|
298
|
+
),
|
|
299
|
+
),
|
|
300
|
+
)
|
|
301
|
+
_response_json = _response.json()
|
|
302
|
+
except JSONDecodeError:
|
|
303
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
304
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
305
|
+
|
|
94
306
|
def get(
|
|
95
307
|
self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
96
308
|
) -> HttpResponse[PublicAssetOut]:
|
|
@@ -238,6 +450,210 @@ class AsyncRawAssetsClient:
|
|
|
238
450
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
239
451
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
240
452
|
|
|
453
|
+
async def create(
|
|
454
|
+
self,
|
|
455
|
+
*,
|
|
456
|
+
asset_type: CreatableAssetType,
|
|
457
|
+
parent_folder_id: typing.Optional[str] = OMIT,
|
|
458
|
+
title: typing.Optional[str] = OMIT,
|
|
459
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
460
|
+
) -> AsyncHttpResponse[CreateAssetResponseOut]:
|
|
461
|
+
"""
|
|
462
|
+
Create a new asset such as a spreadsheet, document, or folder in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration.
|
|
463
|
+
|
|
464
|
+
Parameters
|
|
465
|
+
----------
|
|
466
|
+
asset_type : CreatableAssetType
|
|
467
|
+
Type of asset to create. Supported types: 'spreadsheet' (or 'sheet'), 'document' (or 'doc'), 'folder'
|
|
468
|
+
|
|
469
|
+
parent_folder_id : typing.Optional[str]
|
|
470
|
+
ID of the parent folder to create the asset in
|
|
471
|
+
|
|
472
|
+
title : typing.Optional[str]
|
|
473
|
+
Title for the new asset
|
|
474
|
+
|
|
475
|
+
request_options : typing.Optional[RequestOptions]
|
|
476
|
+
Request-specific configuration.
|
|
477
|
+
|
|
478
|
+
Returns
|
|
479
|
+
-------
|
|
480
|
+
AsyncHttpResponse[CreateAssetResponseOut]
|
|
481
|
+
Asset created successfully
|
|
482
|
+
"""
|
|
483
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
484
|
+
"api/v0/assets/create",
|
|
485
|
+
method="POST",
|
|
486
|
+
json={
|
|
487
|
+
"asset_type": asset_type,
|
|
488
|
+
"parent_folder_id": parent_folder_id,
|
|
489
|
+
"title": title,
|
|
490
|
+
},
|
|
491
|
+
headers={
|
|
492
|
+
"content-type": "application/json",
|
|
493
|
+
},
|
|
494
|
+
request_options=request_options,
|
|
495
|
+
omit=OMIT,
|
|
496
|
+
)
|
|
497
|
+
try:
|
|
498
|
+
if 200 <= _response.status_code < 300:
|
|
499
|
+
_data = typing.cast(
|
|
500
|
+
CreateAssetResponseOut,
|
|
501
|
+
parse_obj_as(
|
|
502
|
+
type_=CreateAssetResponseOut, # type: ignore
|
|
503
|
+
object_=_response.json(),
|
|
504
|
+
),
|
|
505
|
+
)
|
|
506
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
507
|
+
if _response.status_code == 400:
|
|
508
|
+
raise BadRequestError(
|
|
509
|
+
headers=dict(_response.headers),
|
|
510
|
+
body=typing.cast(
|
|
511
|
+
typing.Optional[typing.Any],
|
|
512
|
+
parse_obj_as(
|
|
513
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
514
|
+
object_=_response.json(),
|
|
515
|
+
),
|
|
516
|
+
),
|
|
517
|
+
)
|
|
518
|
+
if _response.status_code == 422:
|
|
519
|
+
raise UnprocessableEntityError(
|
|
520
|
+
headers=dict(_response.headers),
|
|
521
|
+
body=typing.cast(
|
|
522
|
+
typing.Optional[typing.Any],
|
|
523
|
+
parse_obj_as(
|
|
524
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
525
|
+
object_=_response.json(),
|
|
526
|
+
),
|
|
527
|
+
),
|
|
528
|
+
)
|
|
529
|
+
if _response.status_code == 500:
|
|
530
|
+
raise InternalServerError(
|
|
531
|
+
headers=dict(_response.headers),
|
|
532
|
+
body=typing.cast(
|
|
533
|
+
typing.Optional[typing.Any],
|
|
534
|
+
parse_obj_as(
|
|
535
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
536
|
+
object_=_response.json(),
|
|
537
|
+
),
|
|
538
|
+
),
|
|
539
|
+
)
|
|
540
|
+
_response_json = _response.json()
|
|
541
|
+
except JSONDecodeError:
|
|
542
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
543
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
544
|
+
|
|
545
|
+
async def create_project(
|
|
546
|
+
self,
|
|
547
|
+
*,
|
|
548
|
+
title: str,
|
|
549
|
+
custom_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
550
|
+
description: typing.Optional[str] = OMIT,
|
|
551
|
+
parent_folder_id: typing.Optional[str] = OMIT,
|
|
552
|
+
project_type: typing.Optional[str] = OMIT,
|
|
553
|
+
share_with_emails: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
554
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
555
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
556
|
+
) -> AsyncHttpResponse[CreateProjectResponseOut]:
|
|
557
|
+
"""
|
|
558
|
+
Create a new project with custom metadata. Projects can be typed (e.g., 'candidate', 'user', 'company') and include flexible custom metadata for storing additional information.
|
|
559
|
+
|
|
560
|
+
Parameters
|
|
561
|
+
----------
|
|
562
|
+
title : str
|
|
563
|
+
The project title
|
|
564
|
+
|
|
565
|
+
custom_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
566
|
+
A flexible dictionary for storing custom metadata
|
|
567
|
+
|
|
568
|
+
description : typing.Optional[str]
|
|
569
|
+
Optional project description
|
|
570
|
+
|
|
571
|
+
parent_folder_id : typing.Optional[str]
|
|
572
|
+
Optional parent folder ID
|
|
573
|
+
|
|
574
|
+
project_type : typing.Optional[str]
|
|
575
|
+
User-defined project type (e.g., 'candidate', 'user', 'company')
|
|
576
|
+
|
|
577
|
+
share_with_emails : typing.Optional[typing.Sequence[str]]
|
|
578
|
+
Optional list of email addresses to share the project with (VIEW permission)
|
|
579
|
+
|
|
580
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
581
|
+
Optional list of tags for categorizing the project
|
|
582
|
+
|
|
583
|
+
request_options : typing.Optional[RequestOptions]
|
|
584
|
+
Request-specific configuration.
|
|
585
|
+
|
|
586
|
+
Returns
|
|
587
|
+
-------
|
|
588
|
+
AsyncHttpResponse[CreateProjectResponseOut]
|
|
589
|
+
Project created successfully
|
|
590
|
+
"""
|
|
591
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
592
|
+
"api/v0/assets/create_project",
|
|
593
|
+
method="POST",
|
|
594
|
+
json={
|
|
595
|
+
"custom_metadata": custom_metadata,
|
|
596
|
+
"description": description,
|
|
597
|
+
"parent_folder_id": parent_folder_id,
|
|
598
|
+
"project_type": project_type,
|
|
599
|
+
"share_with_emails": share_with_emails,
|
|
600
|
+
"tags": tags,
|
|
601
|
+
"title": title,
|
|
602
|
+
},
|
|
603
|
+
headers={
|
|
604
|
+
"content-type": "application/json",
|
|
605
|
+
},
|
|
606
|
+
request_options=request_options,
|
|
607
|
+
omit=OMIT,
|
|
608
|
+
)
|
|
609
|
+
try:
|
|
610
|
+
if 200 <= _response.status_code < 300:
|
|
611
|
+
_data = typing.cast(
|
|
612
|
+
CreateProjectResponseOut,
|
|
613
|
+
parse_obj_as(
|
|
614
|
+
type_=CreateProjectResponseOut, # type: ignore
|
|
615
|
+
object_=_response.json(),
|
|
616
|
+
),
|
|
617
|
+
)
|
|
618
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
619
|
+
if _response.status_code == 400:
|
|
620
|
+
raise BadRequestError(
|
|
621
|
+
headers=dict(_response.headers),
|
|
622
|
+
body=typing.cast(
|
|
623
|
+
typing.Optional[typing.Any],
|
|
624
|
+
parse_obj_as(
|
|
625
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
626
|
+
object_=_response.json(),
|
|
627
|
+
),
|
|
628
|
+
),
|
|
629
|
+
)
|
|
630
|
+
if _response.status_code == 422:
|
|
631
|
+
raise UnprocessableEntityError(
|
|
632
|
+
headers=dict(_response.headers),
|
|
633
|
+
body=typing.cast(
|
|
634
|
+
typing.Optional[typing.Any],
|
|
635
|
+
parse_obj_as(
|
|
636
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
637
|
+
object_=_response.json(),
|
|
638
|
+
),
|
|
639
|
+
),
|
|
640
|
+
)
|
|
641
|
+
if _response.status_code == 500:
|
|
642
|
+
raise InternalServerError(
|
|
643
|
+
headers=dict(_response.headers),
|
|
644
|
+
body=typing.cast(
|
|
645
|
+
typing.Optional[typing.Any],
|
|
646
|
+
parse_obj_as(
|
|
647
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
648
|
+
object_=_response.json(),
|
|
649
|
+
),
|
|
650
|
+
),
|
|
651
|
+
)
|
|
652
|
+
_response_json = _response.json()
|
|
653
|
+
except JSONDecodeError:
|
|
654
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
655
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
656
|
+
|
|
241
657
|
async def get(
|
|
242
658
|
self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
243
659
|
) -> AsyncHttpResponse[PublicAssetOut]:
|
athena/client.py
CHANGED
|
@@ -413,7 +413,7 @@ class AthenaModel(RemoteRunnable):
|
|
|
413
413
|
self.api_key = api_key
|
|
414
414
|
self.timeout = timeout
|
|
415
415
|
super().__init__(
|
|
416
|
-
base_url + "/api/
|
|
416
|
+
base_url + "/api/v0/agents/general",
|
|
417
417
|
headers={"X-API-KEY": api_key},
|
|
418
418
|
timeout=timeout,
|
|
419
419
|
)
|
|
@@ -467,14 +467,12 @@ class Athena(BaseAthena):
|
|
|
467
467
|
" (ATHENA_API_KEY environment variable not found)"
|
|
468
468
|
)
|
|
469
469
|
if environment == SpecialEnvironments.AUTODETECT_ENVIRONMENT:
|
|
470
|
-
|
|
470
|
+
current_url = os.environ.get("ATHENA_API_URL", "https://api.athenaintel.com")
|
|
471
471
|
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
class _CurrentEnv(enum.Enum):
|
|
473
|
+
CURRENT = current_url
|
|
474
474
|
|
|
475
|
-
|
|
476
|
-
else:
|
|
477
|
-
environment = AthenaEnvironment.PRODUCTION
|
|
475
|
+
environment = cast(AthenaEnvironment, _CurrentEnv.CURRENT)
|
|
478
476
|
super().__init__(
|
|
479
477
|
base_url=base_url,
|
|
480
478
|
environment=environment, # type: ignore[arg-type]
|
|
@@ -543,14 +541,12 @@ class AsyncAthena(AsyncBaseAthena):
|
|
|
543
541
|
" (ATHENA_API_KEY environment variable not found)"
|
|
544
542
|
)
|
|
545
543
|
if environment == SpecialEnvironments.AUTODETECT_ENVIRONMENT:
|
|
546
|
-
|
|
544
|
+
current_url = os.environ.get("ATHENA_API_URL", "https://api.athenaintel.com")
|
|
547
545
|
|
|
548
|
-
|
|
549
|
-
|
|
546
|
+
class _CurrentEnv(enum.Enum):
|
|
547
|
+
CURRENT = current_url
|
|
550
548
|
|
|
551
|
-
|
|
552
|
-
else:
|
|
553
|
-
environment = AthenaEnvironment.PRODUCTION
|
|
549
|
+
environment = cast(AthenaEnvironment, _CurrentEnv.CURRENT)
|
|
554
550
|
self._tools: typing.Optional[WrappedAsyncToolsClient] = None
|
|
555
551
|
super().__init__(
|
|
556
552
|
base_url=base_url,
|
athena/core/client_wrapper.py
CHANGED
|
@@ -22,10 +22,10 @@ class BaseClientWrapper:
|
|
|
22
22
|
|
|
23
23
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
24
24
|
headers: typing.Dict[str, str] = {
|
|
25
|
-
"User-Agent": "athena-intelligence/0.1.
|
|
25
|
+
"User-Agent": "athena-intelligence/0.1.375",
|
|
26
26
|
"X-Fern-Language": "Python",
|
|
27
27
|
"X-Fern-SDK-Name": "athena-intelligence",
|
|
28
|
-
"X-Fern-SDK-Version": "0.1.
|
|
28
|
+
"X-Fern-SDK-Version": "0.1.375",
|
|
29
29
|
**(self.get_custom_headers() or {}),
|
|
30
30
|
}
|
|
31
31
|
headers["X-API-KEY"] = self.api_key
|
athena/environment.py
CHANGED
athena/tools/client.py
CHANGED
|
@@ -10,7 +10,6 @@ from ..core.request_options import RequestOptions
|
|
|
10
10
|
from ..types.asset_content_request_out import AssetContentRequestOut
|
|
11
11
|
from ..types.asset_screenshot_response_out import AssetScreenshotResponseOut
|
|
12
12
|
from ..types.data_frame_request_out import DataFrameRequestOut
|
|
13
|
-
from ..types.file_chunk_request_out import FileChunkRequestOut
|
|
14
13
|
from ..types.folder_response import FolderResponse
|
|
15
14
|
from ..types.save_asset_request_out import SaveAssetRequestOut
|
|
16
15
|
from .raw_client import AsyncRawToolsClient, RawToolsClient
|
|
@@ -49,7 +48,7 @@ class ToolsClient:
|
|
|
49
48
|
|
|
50
49
|
def get_asset_chunks(
|
|
51
50
|
self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
52
|
-
) ->
|
|
51
|
+
) -> typing.Optional[typing.Any]:
|
|
53
52
|
"""
|
|
54
53
|
Get the chunks of a file.
|
|
55
54
|
|
|
@@ -63,7 +62,7 @@ class ToolsClient:
|
|
|
63
62
|
|
|
64
63
|
Returns
|
|
65
64
|
-------
|
|
66
|
-
|
|
65
|
+
typing.Optional[typing.Any]
|
|
67
66
|
Successful Response
|
|
68
67
|
|
|
69
68
|
Examples
|
|
@@ -160,7 +159,6 @@ class ToolsClient:
|
|
|
160
159
|
self,
|
|
161
160
|
*,
|
|
162
161
|
asset_id: typing.Optional[str] = None,
|
|
163
|
-
folder_id: typing.Optional[str] = None,
|
|
164
162
|
include_asset_details: typing.Optional[bool] = None,
|
|
165
163
|
include_system_files: typing.Optional[bool] = None,
|
|
166
164
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -172,8 +170,6 @@ class ToolsClient:
|
|
|
172
170
|
----------
|
|
173
171
|
asset_id : typing.Optional[str]
|
|
174
172
|
|
|
175
|
-
folder_id : typing.Optional[str]
|
|
176
|
-
|
|
177
173
|
include_asset_details : typing.Optional[bool]
|
|
178
174
|
|
|
179
175
|
include_system_files : typing.Optional[bool]
|
|
@@ -195,14 +191,12 @@ class ToolsClient:
|
|
|
195
191
|
)
|
|
196
192
|
client.tools.list_contents(
|
|
197
193
|
asset_id="asset_id",
|
|
198
|
-
folder_id="folder_id",
|
|
199
194
|
include_asset_details=True,
|
|
200
195
|
include_system_files=True,
|
|
201
196
|
)
|
|
202
197
|
"""
|
|
203
198
|
_response = self._raw_client.list_contents(
|
|
204
199
|
asset_id=asset_id,
|
|
205
|
-
folder_id=folder_id,
|
|
206
200
|
include_asset_details=include_asset_details,
|
|
207
201
|
include_system_files=include_system_files,
|
|
208
202
|
request_options=request_options,
|
|
@@ -410,7 +404,7 @@ class AsyncToolsClient:
|
|
|
410
404
|
|
|
411
405
|
async def get_asset_chunks(
|
|
412
406
|
self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
413
|
-
) ->
|
|
407
|
+
) -> typing.Optional[typing.Any]:
|
|
414
408
|
"""
|
|
415
409
|
Get the chunks of a file.
|
|
416
410
|
|
|
@@ -424,7 +418,7 @@ class AsyncToolsClient:
|
|
|
424
418
|
|
|
425
419
|
Returns
|
|
426
420
|
-------
|
|
427
|
-
|
|
421
|
+
typing.Optional[typing.Any]
|
|
428
422
|
Successful Response
|
|
429
423
|
|
|
430
424
|
Examples
|
|
@@ -545,7 +539,6 @@ class AsyncToolsClient:
|
|
|
545
539
|
self,
|
|
546
540
|
*,
|
|
547
541
|
asset_id: typing.Optional[str] = None,
|
|
548
|
-
folder_id: typing.Optional[str] = None,
|
|
549
542
|
include_asset_details: typing.Optional[bool] = None,
|
|
550
543
|
include_system_files: typing.Optional[bool] = None,
|
|
551
544
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -557,8 +550,6 @@ class AsyncToolsClient:
|
|
|
557
550
|
----------
|
|
558
551
|
asset_id : typing.Optional[str]
|
|
559
552
|
|
|
560
|
-
folder_id : typing.Optional[str]
|
|
561
|
-
|
|
562
553
|
include_asset_details : typing.Optional[bool]
|
|
563
554
|
|
|
564
555
|
include_system_files : typing.Optional[bool]
|
|
@@ -585,7 +576,6 @@ class AsyncToolsClient:
|
|
|
585
576
|
async def main() -> None:
|
|
586
577
|
await client.tools.list_contents(
|
|
587
578
|
asset_id="asset_id",
|
|
588
|
-
folder_id="folder_id",
|
|
589
579
|
include_asset_details=True,
|
|
590
580
|
include_system_files=True,
|
|
591
581
|
)
|
|
@@ -595,7 +585,6 @@ class AsyncToolsClient:
|
|
|
595
585
|
"""
|
|
596
586
|
_response = await self._raw_client.list_contents(
|
|
597
587
|
asset_id=asset_id,
|
|
598
|
-
folder_id=folder_id,
|
|
599
588
|
include_asset_details=include_asset_details,
|
|
600
589
|
include_system_files=include_system_files,
|
|
601
590
|
request_options=request_options,
|