indoxrouter 0.1.25__py3-none-any.whl → 0.1.27__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.
- indoxrouter/__init__.py +67 -67
- indoxrouter/client.py +1212 -1160
- indoxrouter/constants.py +38 -38
- indoxrouter/exceptions.py +86 -86
- {indoxrouter-0.1.25.dist-info → indoxrouter-0.1.27.dist-info}/METADATA +208 -179
- indoxrouter-0.1.27.dist-info/RECORD +9 -0
- {indoxrouter-0.1.25.dist-info → indoxrouter-0.1.27.dist-info}/licenses/LICENSE +344 -344
- indoxrouter-0.1.25.dist-info/RECORD +0 -9
- {indoxrouter-0.1.25.dist-info → indoxrouter-0.1.27.dist-info}/WHEEL +0 -0
- {indoxrouter-0.1.25.dist-info → indoxrouter-0.1.27.dist-info}/top_level.txt +0 -0
indoxrouter/__init__.py
CHANGED
@@ -1,67 +1,67 @@
|
|
1
|
-
"""
|
2
|
-
IndoxRouter: A unified client for various AI providers.
|
3
|
-
|
4
|
-
This package provides a client for interacting with the IndoxRouter server,
|
5
|
-
which serves as a unified interface to multiple AI providers and models.
|
6
|
-
|
7
|
-
Example:
|
8
|
-
```python
|
9
|
-
from indoxrouter import Client
|
10
|
-
|
11
|
-
# Initialize client with API key
|
12
|
-
client = Client(api_key="your_api_key")
|
13
|
-
|
14
|
-
# Generate a chat completion
|
15
|
-
response = client.chat([
|
16
|
-
{"role": "system", "content": "You are a helpful assistant."},
|
17
|
-
{"role": "user", "content": "Tell me a joke."}
|
18
|
-
], model="openai/gpt-4o-mini")
|
19
|
-
|
20
|
-
print(response["data"])
|
21
|
-
```
|
22
|
-
|
23
|
-
For custom server URLs:
|
24
|
-
```python
|
25
|
-
# Connect to a specific server
|
26
|
-
client = Client(
|
27
|
-
api_key="your_api_key",
|
28
|
-
base_url="http://your-custom-server:8000"
|
29
|
-
)
|
30
|
-
```
|
31
|
-
"""
|
32
|
-
|
33
|
-
from .client import Client, IndoxRouter
|
34
|
-
from .exceptions import (
|
35
|
-
IndoxRouterError,
|
36
|
-
AuthenticationError,
|
37
|
-
NetworkError,
|
38
|
-
RateLimitError,
|
39
|
-
ProviderError,
|
40
|
-
ModelNotFoundError,
|
41
|
-
ProviderNotFoundError,
|
42
|
-
ModelNotAvailableError,
|
43
|
-
InvalidParametersError,
|
44
|
-
RequestError,
|
45
|
-
InsufficientCreditsError,
|
46
|
-
ValidationError,
|
47
|
-
APIError,
|
48
|
-
)
|
49
|
-
|
50
|
-
__version__ = "0.
|
51
|
-
__all__ = [
|
52
|
-
"Client",
|
53
|
-
"IndoxRouter",
|
54
|
-
"IndoxRouterError",
|
55
|
-
"AuthenticationError",
|
56
|
-
"NetworkError",
|
57
|
-
"RateLimitError",
|
58
|
-
"ProviderError",
|
59
|
-
"ModelNotFoundError",
|
60
|
-
"ProviderNotFoundError",
|
61
|
-
"ModelNotAvailableError",
|
62
|
-
"InvalidParametersError",
|
63
|
-
"RequestError",
|
64
|
-
"InsufficientCreditsError",
|
65
|
-
"ValidationError",
|
66
|
-
"APIError",
|
67
|
-
]
|
1
|
+
"""
|
2
|
+
IndoxRouter: A unified client for various AI providers.
|
3
|
+
|
4
|
+
This package provides a client for interacting with the IndoxRouter server,
|
5
|
+
which serves as a unified interface to multiple AI providers and models.
|
6
|
+
|
7
|
+
Example:
|
8
|
+
```python
|
9
|
+
from indoxrouter import Client
|
10
|
+
|
11
|
+
# Initialize client with API key
|
12
|
+
client = Client(api_key="your_api_key")
|
13
|
+
|
14
|
+
# Generate a chat completion
|
15
|
+
response = client.chat([
|
16
|
+
{"role": "system", "content": "You are a helpful assistant."},
|
17
|
+
{"role": "user", "content": "Tell me a joke."}
|
18
|
+
], model="openai/gpt-4o-mini")
|
19
|
+
|
20
|
+
print(response["data"])
|
21
|
+
```
|
22
|
+
|
23
|
+
For custom server URLs:
|
24
|
+
```python
|
25
|
+
# Connect to a specific server
|
26
|
+
client = Client(
|
27
|
+
api_key="your_api_key",
|
28
|
+
base_url="http://your-custom-server:8000"
|
29
|
+
)
|
30
|
+
```
|
31
|
+
"""
|
32
|
+
|
33
|
+
from .client import Client, IndoxRouter
|
34
|
+
from .exceptions import (
|
35
|
+
IndoxRouterError,
|
36
|
+
AuthenticationError,
|
37
|
+
NetworkError,
|
38
|
+
RateLimitError,
|
39
|
+
ProviderError,
|
40
|
+
ModelNotFoundError,
|
41
|
+
ProviderNotFoundError,
|
42
|
+
ModelNotAvailableError,
|
43
|
+
InvalidParametersError,
|
44
|
+
RequestError,
|
45
|
+
InsufficientCreditsError,
|
46
|
+
ValidationError,
|
47
|
+
APIError,
|
48
|
+
)
|
49
|
+
|
50
|
+
__version__ = "0.1.27"
|
51
|
+
__all__ = [
|
52
|
+
"Client",
|
53
|
+
"IndoxRouter",
|
54
|
+
"IndoxRouterError",
|
55
|
+
"AuthenticationError",
|
56
|
+
"NetworkError",
|
57
|
+
"RateLimitError",
|
58
|
+
"ProviderError",
|
59
|
+
"ModelNotFoundError",
|
60
|
+
"ProviderNotFoundError",
|
61
|
+
"ModelNotAvailableError",
|
62
|
+
"InvalidParametersError",
|
63
|
+
"RequestError",
|
64
|
+
"InsufficientCreditsError",
|
65
|
+
"ValidationError",
|
66
|
+
"APIError",
|
67
|
+
]
|