Skip to content

Commit 48deaaa

Browse files
authored
Merge branch 'main' into test
2 parents a3b6bc8 + edaac86 commit 48deaaa

File tree

23 files changed

+565
-290
lines changed

23 files changed

+565
-290
lines changed

docs/api-reference/python/aixplain/decorators/api_key_checker.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ sidebar_label: api_key_checker
33
title: aixplain.decorators.api_key_checker
44
---
55

6+
API key validation decorator for aiXplain SDK.
7+
68
#### check\_api\_key
79

810
```python
911
def check_api_key(method)
1012
```
1113

12-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/decorators/api_key_checker.py#L4)
14+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/decorators/api_key_checker.py#L6)
1315

1416
Decorator to verify that an API key is set before executing the method.
1517

16-
This decorator checks if either TEAM_API_KEY or AIXPLAIN_API_KEY is set in the
17-
configuration. If neither key is set, it raises an exception.
18+
This decorator uses the centralized API key validation logic from config.py
19+
to ensure consistent behavior across the entire SDK.
1820

1921
**Arguments**:
2022

docs/api-reference/python/aixplain/exceptions/init.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ def get_error_from_status_code(status_code: int,
1616
) -> AixplainBaseException
1717
```
1818

19-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/__init__.py#L21)
19+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/__init__.py#L35)
2020

2121
Map HTTP status codes to appropriate exception types.
2222

2323
**Arguments**:
2424

2525
- `status_code` _int_ - The HTTP status code to map.
26-
- `default_message` _str, optional_ - The default message to use if no specific message is available.
26+
- `error_details` _str, optional_ - Additional error details to include in the message.
2727

2828

2929
**Returns**:

docs/api-reference/python/aixplain/exceptions/types.md

Lines changed: 198 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ sidebar_label: types
33
title: aixplain.exceptions.types
44
---
55

6+
Exception types and error handling for the aiXplain SDK.
7+
68
### ErrorSeverity Objects
79

810
```python
911
class ErrorSeverity(str, Enum)
1012
```
1113

12-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L5)
14+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L7)
1315

1416
Enumeration of error severity levels in the aiXplain system.
1517

@@ -45,7 +47,7 @@ System stability might be compromised
4547
class ErrorCategory(Enum)
4648
```
4749

48-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L24)
50+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L26)
4951

5052
Enumeration of error categories in the aiXplain system.
5153

@@ -111,7 +113,7 @@ Uncategorized errors
111113
class ErrorCode(str, Enum)
112114
```
113115

114-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L55)
116+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L57)
115117

116118
Standard error codes for aiXplain exceptions.
117119

@@ -173,7 +175,7 @@ General internal error. Use for unexpected server-side errors that are not cover
173175
def __str__() -> str
174176
```
175177

176-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L88)
178+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L90)
177179

178180
Return the string representation of the error code.
179181

@@ -187,7 +189,7 @@ Return the string representation of the error code.
187189
class AixplainBaseException(Exception)
188190
```
189191

190-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L97)
192+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L99)
191193

192194
Base exception class for all aiXplain exceptions.
193195

@@ -205,13 +207,39 @@ severity, and additional context.
205207
- `retry_recommended` _bool_ - Whether retrying the operation might succeed.
206208
- `error_code` _Optional[ErrorCode]_ - Standardized error code.
207209

210+
#### \_\_init\_\_
211+
212+
```python
213+
def __init__(message: str,
214+
category: ErrorCategory = ErrorCategory.UNKNOWN,
215+
severity: ErrorSeverity = ErrorSeverity.ERROR,
216+
status_code: Optional[int] = None,
217+
details: Optional[Dict[str, Any]] = None,
218+
retry_recommended: bool = False,
219+
error_code: Optional[ErrorCode] = None)
220+
```
221+
222+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L116)
223+
224+
Initialize the base exception with structured error information.
225+
226+
**Arguments**:
227+
228+
- `message` - Error message describing the issue.
229+
- `category` - Category of the error (default: UNKNOWN).
230+
- `severity` - Severity level of the error (default: ERROR).
231+
- `status_code` - HTTP status code if applicable.
232+
- `details` - Additional error context and details.
233+
- `retry_recommended` - Whether retrying the operation might succeed.
234+
- `error_code` - Standardized error code for the exception.
235+
208236
#### \_\_str\_\_
209237

210238
```python
211239
def __str__() -> str
212240
```
213241

214-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L133)
242+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L146)
215243

216244
Return a string representation of the exception.
217245

@@ -226,7 +254,7 @@ Return a string representation of the exception.
226254
def to_dict() -> Dict[str, Any]
227255
```
228256

229-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L143)
257+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L156)
230258

231259
Convert the exception to a dictionary for serialization.
232260

@@ -242,77 +270,232 @@ Convert the exception to a dictionary for serialization.
242270
class AuthenticationError(AixplainBaseException)
243271
```
244272

245-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L162)
273+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L175)
246274

247275
Raised when authentication fails.
248276

277+
#### \_\_init\_\_
278+
279+
```python
280+
def __init__(message: str, **kwargs)
281+
```
282+
283+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L178)
284+
285+
Initialize authentication error.
286+
287+
**Arguments**:
288+
289+
- `message` - Error message describing the authentication issue.
290+
- `**kwargs` - Additional keyword arguments passed to parent class.
291+
249292
### ValidationError Objects
250293

251294
```python
252295
class ValidationError(AixplainBaseException)
253296
```
254297

255-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L176)
298+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L195)
256299

257300
Raised when input validation fails.
258301

302+
#### \_\_init\_\_
303+
304+
```python
305+
def __init__(message: str, **kwargs)
306+
```
307+
308+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L198)
309+
310+
Initialize validation error.
311+
312+
**Arguments**:
313+
314+
- `message` - Error message describing the validation issue.
315+
- `**kwargs` - Additional keyword arguments passed to parent class.
316+
317+
### AlreadyDeployedError Objects
318+
319+
```python
320+
class AlreadyDeployedError(AixplainBaseException)
321+
```
322+
323+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L215)
324+
325+
Raised when attempting to deploy an asset that is already deployed.
326+
327+
#### \_\_init\_\_
328+
329+
```python
330+
def __init__(message: str, **kwargs)
331+
```
332+
333+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L218)
334+
335+
Initialize already deployed error.
336+
337+
**Arguments**:
338+
339+
- `message` - Error message describing the deployment state conflict.
340+
- `**kwargs` - Additional keyword arguments passed to parent class.
341+
259342
### ResourceError Objects
260343

261344
```python
262345
class ResourceError(AixplainBaseException)
263346
```
264347

265-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L190)
348+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L233)
266349

267350
Raised when a resource is unavailable.
268351

352+
#### \_\_init\_\_
353+
354+
```python
355+
def __init__(message: str, **kwargs)
356+
```
357+
358+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L236)
359+
360+
Initialize resource error.
361+
362+
**Arguments**:
363+
364+
- `message` - Error message describing the resource issue.
365+
- `**kwargs` - Additional keyword arguments passed to parent class.
366+
269367
### BillingError Objects
270368

271369
```python
272370
class BillingError(AixplainBaseException)
273371
```
274372

275-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L204)
373+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L253)
276374

277375
Raised when there are billing issues.
278376

377+
#### \_\_init\_\_
378+
379+
```python
380+
def __init__(message: str, **kwargs)
381+
```
382+
383+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L256)
384+
385+
Initialize billing error.
386+
387+
**Arguments**:
388+
389+
- `message` - Error message describing the billing issue.
390+
- `**kwargs` - Additional keyword arguments passed to parent class.
391+
279392
### SupplierError Objects
280393

281394
```python
282395
class SupplierError(AixplainBaseException)
283396
```
284397

285-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L218)
398+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L273)
286399

287400
Raised when there are issues with external suppliers.
288401

402+
#### \_\_init\_\_
403+
404+
```python
405+
def __init__(message: str, **kwargs)
406+
```
407+
408+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L276)
409+
410+
Initialize supplier error.
411+
412+
**Arguments**:
413+
414+
- `message` - Error message describing the supplier issue.
415+
- `**kwargs` - Additional keyword arguments passed to parent class.
416+
289417
### NetworkError Objects
290418

291419
```python
292420
class NetworkError(AixplainBaseException)
293421
```
294422

295-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L232)
423+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L293)
296424

297425
Raised when there are network connectivity issues.
298426

427+
#### \_\_init\_\_
428+
429+
```python
430+
def __init__(message: str, **kwargs)
431+
```
432+
433+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L296)
434+
435+
Initialize network error.
436+
437+
**Arguments**:
438+
439+
- `message` - Error message describing the network issue.
440+
- `**kwargs` - Additional keyword arguments passed to parent class.
441+
299442
### ServiceError Objects
300443

301444
```python
302445
class ServiceError(AixplainBaseException)
303446
```
304447

305-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L246)
448+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L313)
306449

307450
Raised when a service is unavailable.
308451

452+
#### \_\_init\_\_
453+
454+
```python
455+
def __init__(message: str, **kwargs)
456+
```
457+
458+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L316)
459+
460+
Initialize service error.
461+
462+
**Arguments**:
463+
464+
- `message` - Error message describing the service issue.
465+
- `**kwargs` - Additional keyword arguments passed to parent class.
466+
309467
### InternalError Objects
310468

311469
```python
312470
class InternalError(AixplainBaseException)
313471
```
314472

315-
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L260)
473+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L333)
316474

317475
Raised when there is an internal system error.
318476

477+
#### \_\_init\_\_
478+
479+
```python
480+
def __init__(message: str, **kwargs)
481+
```
482+
483+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L336)
484+
485+
Initialize internal error.
486+
487+
**Arguments**:
488+
489+
- `message` - Error message describing the internal issue.
490+
- `**kwargs` - Additional keyword arguments passed to parent class.
491+
492+
### AlreadyDeployedError Objects
493+
494+
```python
495+
class AlreadyDeployedError(AixplainBaseException)
496+
```
497+
498+
[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/exceptions/types.py#L359)
499+
500+
Raised when an asset is already deployed.
501+

0 commit comments

Comments
 (0)