athena-intelligence 0.1.260__py3-none-any.whl → 0.1.303__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 -6
- athena/assets/client.py +278 -0
- athena/assets/raw_client.py +416 -0
- athena/base_client.py +4 -4
- athena/client.py +9 -13
- athena/core/client_wrapper.py +2 -2
- athena/environment.py +1 -3
- athena/tools/client.py +4 -5
- athena/tools/raw_client.py +12 -9
- athena/types/__init__.py +9 -6
- 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/thread_status_response_out.py +5 -0
- {athena_intelligence-0.1.260.dist-info → athena_intelligence-0.1.303.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.260.dist-info → athena_intelligence-0.1.303.dist-info}/RECORD +18 -17
- athena/types/document_chunk.py +0 -24
- athena/types/file_chunk_request_out.py +0 -24
- {athena_intelligence-0.1.260.dist-info → athena_intelligence-0.1.303.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/base_client.py
CHANGED
|
@@ -31,7 +31,7 @@ class BaseAthena:
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
Defaults to AthenaEnvironment.
|
|
34
|
+
Defaults to AthenaEnvironment.DEVELOPMENT
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -61,7 +61,7 @@ class BaseAthena:
|
|
|
61
61
|
self,
|
|
62
62
|
*,
|
|
63
63
|
base_url: typing.Optional[str] = None,
|
|
64
|
-
environment: AthenaEnvironment = AthenaEnvironment.
|
|
64
|
+
environment: AthenaEnvironment = AthenaEnvironment.DEVELOPMENT,
|
|
65
65
|
api_key: str,
|
|
66
66
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
67
67
|
timeout: typing.Optional[float] = None,
|
|
@@ -152,7 +152,7 @@ class AsyncBaseAthena:
|
|
|
152
152
|
|
|
153
153
|
|
|
154
154
|
|
|
155
|
-
Defaults to AthenaEnvironment.
|
|
155
|
+
Defaults to AthenaEnvironment.DEVELOPMENT
|
|
156
156
|
|
|
157
157
|
|
|
158
158
|
|
|
@@ -182,7 +182,7 @@ class AsyncBaseAthena:
|
|
|
182
182
|
self,
|
|
183
183
|
*,
|
|
184
184
|
base_url: typing.Optional[str] = None,
|
|
185
|
-
environment: AthenaEnvironment = AthenaEnvironment.
|
|
185
|
+
environment: AthenaEnvironment = AthenaEnvironment.DEVELOPMENT,
|
|
186
186
|
api_key: str,
|
|
187
187
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
188
188
|
timeout: typing.Optional[float] = None,
|
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.303",
|
|
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.303",
|
|
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
|
|
@@ -410,7 +409,7 @@ class AsyncToolsClient:
|
|
|
410
409
|
|
|
411
410
|
async def get_asset_chunks(
|
|
412
411
|
self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
413
|
-
) ->
|
|
412
|
+
) -> typing.Optional[typing.Any]:
|
|
414
413
|
"""
|
|
415
414
|
Get the chunks of a file.
|
|
416
415
|
|
|
@@ -424,7 +423,7 @@ class AsyncToolsClient:
|
|
|
424
423
|
|
|
425
424
|
Returns
|
|
426
425
|
-------
|
|
427
|
-
|
|
426
|
+
typing.Optional[typing.Any]
|
|
428
427
|
Successful Response
|
|
429
428
|
|
|
430
429
|
Examples
|
athena/tools/raw_client.py
CHANGED
|
@@ -21,7 +21,6 @@ from ..types.asset_content_request_out import AssetContentRequestOut
|
|
|
21
21
|
from ..types.asset_screenshot_response_out import AssetScreenshotResponseOut
|
|
22
22
|
from ..types.data_frame_request_out import DataFrameRequestOut
|
|
23
23
|
from ..types.data_frame_unknown_format_error import DataFrameUnknownFormatError
|
|
24
|
-
from ..types.file_chunk_request_out import FileChunkRequestOut
|
|
25
24
|
from ..types.file_too_large_error import FileTooLargeError
|
|
26
25
|
from ..types.folder_response import FolderResponse
|
|
27
26
|
from ..types.save_asset_request_out import SaveAssetRequestOut
|
|
@@ -37,7 +36,7 @@ class RawToolsClient:
|
|
|
37
36
|
|
|
38
37
|
def get_asset_chunks(
|
|
39
38
|
self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
40
|
-
) -> HttpResponse[
|
|
39
|
+
) -> HttpResponse[typing.Optional[typing.Any]]:
|
|
41
40
|
"""
|
|
42
41
|
Get the chunks of a file.
|
|
43
42
|
|
|
@@ -51,7 +50,7 @@ class RawToolsClient:
|
|
|
51
50
|
|
|
52
51
|
Returns
|
|
53
52
|
-------
|
|
54
|
-
HttpResponse[
|
|
53
|
+
HttpResponse[typing.Optional[typing.Any]]
|
|
55
54
|
Successful Response
|
|
56
55
|
"""
|
|
57
56
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -67,11 +66,13 @@ class RawToolsClient:
|
|
|
67
66
|
omit=OMIT,
|
|
68
67
|
)
|
|
69
68
|
try:
|
|
69
|
+
if _response is None or not _response.text.strip():
|
|
70
|
+
return HttpResponse(response=_response, data=None)
|
|
70
71
|
if 200 <= _response.status_code < 300:
|
|
71
72
|
_data = typing.cast(
|
|
72
|
-
|
|
73
|
+
typing.Optional[typing.Any],
|
|
73
74
|
parse_obj_as(
|
|
74
|
-
type_=
|
|
75
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
75
76
|
object_=_response.json(),
|
|
76
77
|
),
|
|
77
78
|
)
|
|
@@ -684,7 +685,7 @@ class AsyncRawToolsClient:
|
|
|
684
685
|
|
|
685
686
|
async def get_asset_chunks(
|
|
686
687
|
self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
687
|
-
) -> AsyncHttpResponse[
|
|
688
|
+
) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
|
|
688
689
|
"""
|
|
689
690
|
Get the chunks of a file.
|
|
690
691
|
|
|
@@ -698,7 +699,7 @@ class AsyncRawToolsClient:
|
|
|
698
699
|
|
|
699
700
|
Returns
|
|
700
701
|
-------
|
|
701
|
-
AsyncHttpResponse[
|
|
702
|
+
AsyncHttpResponse[typing.Optional[typing.Any]]
|
|
702
703
|
Successful Response
|
|
703
704
|
"""
|
|
704
705
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -714,11 +715,13 @@ class AsyncRawToolsClient:
|
|
|
714
715
|
omit=OMIT,
|
|
715
716
|
)
|
|
716
717
|
try:
|
|
718
|
+
if _response is None or not _response.text.strip():
|
|
719
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
717
720
|
if 200 <= _response.status_code < 300:
|
|
718
721
|
_data = typing.cast(
|
|
719
|
-
|
|
722
|
+
typing.Optional[typing.Any],
|
|
720
723
|
parse_obj_as(
|
|
721
|
-
type_=
|
|
724
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
722
725
|
object_=_response.json(),
|
|
723
726
|
),
|
|
724
727
|
)
|