Commit 727f84f
committed
Fix Python Voyage AI error handling to use SDK exception types
- Remove accidentally added .python-version file
- Update get_embedding() to catch specific voyageai.error exceptions:
- AuthenticationError (401) -> VoyageAuthError
- InvalidRequestError (400) -> VoyageAPIError
- RateLimitError (429) -> VoyageAPIError
- ServiceUnavailableError (503) -> VoyageAPIError
- VoyageError (other) -> VoyageAPIError
- Import VoyageAuthError and VoyageAPIError in tests for future use
This fixes the issue where authentication errors were not being properly
detected because the code was relying on string matching instead of
catching the SDK's specific exception types.1 parent 695161c commit 727f84f
3 files changed
Lines changed: 18 additions & 12 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
1380 | 1381 | | |
1381 | 1382 | | |
1382 | 1383 | | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
1383 | 1399 | | |
1384 | | - | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
| 1400 | + | |
1395 | 1401 | | |
1396 | 1402 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
0 commit comments