indoxrouter 0.1.12__py3-none-any.whl → 0.1.15__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/constants.py +1 -1
- {indoxrouter-0.1.12.dist-info → indoxrouter-0.1.15.dist-info}/METADATA +5 -24
- indoxrouter-0.1.15.dist-info/RECORD +8 -0
- {indoxrouter-0.1.12.dist-info → indoxrouter-0.1.15.dist-info}/WHEEL +1 -1
- indoxrouter/test_api_key.py +0 -98
- indoxrouter-0.1.12.dist-info/RECORD +0 -9
- {indoxrouter-0.1.12.dist-info → indoxrouter-0.1.15.dist-info}/top_level.txt +0 -0
indoxrouter/constants.py
CHANGED
@@ -4,7 +4,7 @@ Constants for the IndoxRouter client.
|
|
4
4
|
|
5
5
|
# API settings
|
6
6
|
DEFAULT_API_VERSION = "v1"
|
7
|
-
DEFAULT_BASE_URL = "https://api.
|
7
|
+
DEFAULT_BASE_URL = "https://api.indoxrouter.com" # Production server URL with HTTPS
|
8
8
|
# DEFAULT_BASE_URL = "http://localhost:8000" # Local development server
|
9
9
|
DEFAULT_TIMEOUT = 60
|
10
10
|
USE_COOKIES = True # Always use cookie-based authentication
|
@@ -1,13 +1,11 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: indoxrouter
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.15
|
4
4
|
Summary: A unified client for various AI providers
|
5
|
-
|
6
|
-
|
7
|
-
Author-email: ashkan.eskandari.dev@gmail.com
|
5
|
+
Author-email: indoxRouter Team <ashkan.eskandari.dev@gmail.com>
|
6
|
+
Project-URL: Homepage, https://github.com/indoxrouter/indoxrouter
|
8
7
|
Classifier: Development Status :: 3 - Alpha
|
9
8
|
Classifier: Intended Audience :: Developers
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
11
9
|
Classifier: Programming Language :: Python :: 3
|
12
10
|
Classifier: Programming Language :: Python :: 3.8
|
13
11
|
Classifier: Programming Language :: Python :: 3.9
|
@@ -18,27 +16,10 @@ Requires-Python: >=3.8
|
|
18
16
|
Description-Content-Type: text/markdown
|
19
17
|
Requires-Dist: requests>=2.25.0
|
20
18
|
Requires-Dist: python-dotenv>=1.0.0
|
21
|
-
Provides-Extra: dev
|
22
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
23
|
-
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
24
|
-
Requires-Dist: black>=23.0.0; extra == "dev"
|
25
|
-
Requires-Dist: isort>=5.0.0; extra == "dev"
|
26
|
-
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
27
|
-
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
28
|
-
Dynamic: author
|
29
|
-
Dynamic: author-email
|
30
|
-
Dynamic: classifier
|
31
|
-
Dynamic: description
|
32
|
-
Dynamic: description-content-type
|
33
|
-
Dynamic: home-page
|
34
|
-
Dynamic: provides-extra
|
35
|
-
Dynamic: requires-dist
|
36
|
-
Dynamic: requires-python
|
37
|
-
Dynamic: summary
|
38
19
|
|
39
20
|
# IndoxRouter Client
|
40
21
|
|
41
|
-
A unified client for various AI providers, including OpenAI,
|
22
|
+
A unified client for various AI providers, including OpenAI, anthropic, Google, and Mistral.
|
42
23
|
|
43
24
|
## Features
|
44
25
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
indoxrouter/__init__.py,sha256=28pdx482uGFF_S1msov0LTTGsFTvVBKRqMkDmoXWUBY,1416
|
2
|
+
indoxrouter/client.py,sha256=ixzCJP28ddYFQxwRiqdY5Fp1CB978DJpI4yCiOI3s4o,28898
|
3
|
+
indoxrouter/constants.py,sha256=tEmfhfCpuKVos1TxVhJfPlv1P0ePWnjnwso4ZHJ0VhM,1190
|
4
|
+
indoxrouter/exceptions.py,sha256=0ULxtK9va4718PGTO5VoClXYEJeojpiM-7AganeiZZ4,1263
|
5
|
+
indoxrouter-0.1.15.dist-info/METADATA,sha256=CeJbcb4OaBKSTWJjsGl4wOulialexUJN6MDLYniQj-g,5428
|
6
|
+
indoxrouter-0.1.15.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
7
|
+
indoxrouter-0.1.15.dist-info/top_level.txt,sha256=v6FGWkw0QAnXhyYtnXLI1cxzna0iveNvZUotVzCWabM,12
|
8
|
+
indoxrouter-0.1.15.dist-info/RECORD,,
|
indoxrouter/test_api_key.py
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
"""
|
3
|
-
Test script for the IndoxRouter client.
|
4
|
-
This script tests authentication and basic functionality of the client.
|
5
|
-
"""
|
6
|
-
|
7
|
-
import os
|
8
|
-
import sys
|
9
|
-
import logging
|
10
|
-
from indoxrouter import Client, AuthenticationError, NetworkError
|
11
|
-
|
12
|
-
# Set up logging
|
13
|
-
logging.basicConfig(
|
14
|
-
level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
15
|
-
)
|
16
|
-
logger = logging.getLogger("indoxrouter_test")
|
17
|
-
|
18
|
-
|
19
|
-
def test_client(api_key=None, debug=False):
|
20
|
-
"""
|
21
|
-
Test the IndoxRouter client with the provided API key.
|
22
|
-
|
23
|
-
Args:
|
24
|
-
api_key: API key to use for authentication
|
25
|
-
debug: Whether to enable debug logging
|
26
|
-
"""
|
27
|
-
if debug:
|
28
|
-
logging.getLogger("indoxrouter").setLevel(logging.DEBUG)
|
29
|
-
|
30
|
-
logger.info("Testing IndoxRouter client...")
|
31
|
-
|
32
|
-
# If no API key is provided, try to get it from environment variable
|
33
|
-
if not api_key:
|
34
|
-
api_key = os.environ.get("INDOX_ROUTER_API_KEY")
|
35
|
-
if not api_key:
|
36
|
-
logger.error(
|
37
|
-
"No API key provided. Please provide an API key as an argument or set the INDOX_ROUTER_API_KEY environment variable."
|
38
|
-
)
|
39
|
-
sys.exit(1)
|
40
|
-
|
41
|
-
try:
|
42
|
-
# Initialize client
|
43
|
-
logger.info("Initializing client...")
|
44
|
-
client = Client(api_key=api_key)
|
45
|
-
|
46
|
-
# Test connection
|
47
|
-
logger.info("Testing connection...")
|
48
|
-
connection_info = client.test_connection()
|
49
|
-
logger.info(f"Connection test: {connection_info['status']}")
|
50
|
-
|
51
|
-
# Try to get available models
|
52
|
-
logger.info("Fetching available models...")
|
53
|
-
models = client.models()
|
54
|
-
|
55
|
-
# Display some models
|
56
|
-
providers = [p.get("name") for p in models]
|
57
|
-
logger.info(f"Available providers: {', '.join(providers)}")
|
58
|
-
|
59
|
-
# Try a simple chat completion
|
60
|
-
logger.info("Testing chat completion...")
|
61
|
-
response = client.chat(
|
62
|
-
messages=[{"role": "user", "content": "Hello, who are you?"}],
|
63
|
-
model="openai/gpt-3.5-turbo",
|
64
|
-
max_tokens=30,
|
65
|
-
)
|
66
|
-
|
67
|
-
logger.info("Chat completion successful!")
|
68
|
-
logger.info(f"Response: {response['choices'][0]['message']['content']}")
|
69
|
-
|
70
|
-
logger.info("All tests passed! The client is working correctly.")
|
71
|
-
|
72
|
-
except AuthenticationError as e:
|
73
|
-
logger.error(f"Authentication error: {e}")
|
74
|
-
logger.error("Please check that your API key is correct.")
|
75
|
-
sys.exit(1)
|
76
|
-
except NetworkError as e:
|
77
|
-
logger.error(f"Network error: {e}")
|
78
|
-
logger.error(
|
79
|
-
"Please check your internet connection and that the IndoxRouter server is accessible."
|
80
|
-
)
|
81
|
-
sys.exit(1)
|
82
|
-
except Exception as e:
|
83
|
-
logger.error(f"Unexpected error: {e}")
|
84
|
-
sys.exit(1)
|
85
|
-
|
86
|
-
|
87
|
-
if __name__ == "__main__":
|
88
|
-
import argparse
|
89
|
-
|
90
|
-
parser = argparse.ArgumentParser(description="Test the IndoxRouter client")
|
91
|
-
parser.add_argument("--api-key", "-k", help="API key to use for authentication")
|
92
|
-
parser.add_argument(
|
93
|
-
"--debug", "-d", action="store_true", help="Enable debug logging"
|
94
|
-
)
|
95
|
-
|
96
|
-
args = parser.parse_args()
|
97
|
-
|
98
|
-
test_client(api_key=args.api_key, debug=args.debug)
|
@@ -1,9 +0,0 @@
|
|
1
|
-
indoxrouter/__init__.py,sha256=28pdx482uGFF_S1msov0LTTGsFTvVBKRqMkDmoXWUBY,1416
|
2
|
-
indoxrouter/client.py,sha256=ixzCJP28ddYFQxwRiqdY5Fp1CB978DJpI4yCiOI3s4o,28898
|
3
|
-
indoxrouter/constants.py,sha256=D-l5qhEmeDIXOEfogvf6lJI1Sw_fXSKZy-Nj_l_MV7E,1184
|
4
|
-
indoxrouter/exceptions.py,sha256=0ULxtK9va4718PGTO5VoClXYEJeojpiM-7AganeiZZ4,1263
|
5
|
-
indoxrouter/test_api_key.py,sha256=u4fUTJwxC7-kTrLdCq8u5a1Mx66jeExfsBlHLhyzNmA,3229
|
6
|
-
indoxrouter-0.1.12.dist-info/METADATA,sha256=pRupY-6V6GrozkXidKGm_qf6fBY2clAqYwgKAU5OJww,6004
|
7
|
-
indoxrouter-0.1.12.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
8
|
-
indoxrouter-0.1.12.dist-info/top_level.txt,sha256=v6FGWkw0QAnXhyYtnXLI1cxzna0iveNvZUotVzCWabM,12
|
9
|
-
indoxrouter-0.1.12.dist-info/RECORD,,
|
File without changes
|