keycycle 0.2.0__tar.gz → 0.2.2__tar.gz
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.
- {keycycle-0.2.0 → keycycle-0.2.2}/PKG-INFO +1 -1
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/__init__.py +0 -3
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/adapters/__init__.py +0 -4
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/key_rotation/rotating_mixin.py +2 -2
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/legacy_multi_provider_wrapper.py +1 -1
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/multi_client_wrapper.py +8 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle.egg-info/PKG-INFO +1 -1
- {keycycle-0.2.0 → keycycle-0.2.2}/pyproject.toml +1 -1
- {keycycle-0.2.0 → keycycle-0.2.2}/MANIFEST.in +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/adapters/generic_adapter.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/adapters/openai_adapter.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/__init__.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/constants.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/dataclasses.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/enums.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/loader.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/log_config.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/models/cerebras.yaml +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/models/cohere.yaml +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/models/gemini.yaml +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/models/groq.yaml +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/models/openrouter.yaml +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/models/openrouter_models.yaml +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/config/models.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/core/__init__.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/core/backoff.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/core/exceptions.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/core/utils.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/key_rotation/__init__.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/key_rotation/rotation_manager.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/py.typed +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/usage/__init__.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/usage/db_logic.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/usage/usage_logger.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle/utils.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle.egg-info/SOURCES.txt +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle.egg-info/dependency_links.txt +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle.egg-info/requires.txt +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/keycycle.egg-info/top_level.txt +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/setup.cfg +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/tests/test_api_key_pinning.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/tests/test_api_key_retrieval.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/tests/test_cerebras_direct.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/tests/test_custom_key_limits.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/tests/test_multi_client_wrapper.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/tests/test_rate_limit_logic.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/tests/test_specific_key_retrieval.py +0 -0
- {keycycle-0.2.0 → keycycle-0.2.2}/tests/test_streams_recording.py +0 -0
|
@@ -19,7 +19,6 @@ from .adapters.generic_adapter import (
|
|
|
19
19
|
SyncGenericRotatingClient,
|
|
20
20
|
AsyncGenericRotatingClient,
|
|
21
21
|
)
|
|
22
|
-
from .adapters.openai_adapter import RotatingAsyncOpenAIClient, RotatingOpenAIClient
|
|
23
22
|
|
|
24
23
|
__all__ = [
|
|
25
24
|
# New primary wrapper (multi-provider support)
|
|
@@ -32,8 +31,6 @@ __all__ = [
|
|
|
32
31
|
"KeyLimitOverride",
|
|
33
32
|
"KeyEntry",
|
|
34
33
|
"RotatingKeyManager",
|
|
35
|
-
"RotatingAsyncOpenAIClient",
|
|
36
|
-
"RotatingOpenAIClient",
|
|
37
34
|
# Generic rotating client
|
|
38
35
|
"create_rotating_client",
|
|
39
36
|
"detect_async_client",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from .openai_adapter import RotatingOpenAIClient, RotatingAsyncOpenAIClient
|
|
2
1
|
from .generic_adapter import (
|
|
3
2
|
create_rotating_client,
|
|
4
3
|
detect_async_client,
|
|
@@ -11,9 +10,6 @@ from .generic_adapter import (
|
|
|
11
10
|
)
|
|
12
11
|
|
|
13
12
|
__all__ = [
|
|
14
|
-
# OpenAI-specific
|
|
15
|
-
"RotatingOpenAIClient",
|
|
16
|
-
"RotatingAsyncOpenAIClient",
|
|
17
13
|
# Generic adapter
|
|
18
14
|
"create_rotating_client",
|
|
19
15
|
"detect_async_client",
|
|
@@ -109,8 +109,8 @@ class RotatingCredentialsMixin:
|
|
|
109
109
|
return
|
|
110
110
|
|
|
111
111
|
actual_tokens = 0
|
|
112
|
-
|
|
113
|
-
if response:
|
|
112
|
+
|
|
113
|
+
if response and response.response_usage:
|
|
114
114
|
actual_tokens = response.response_usage.total_tokens
|
|
115
115
|
|
|
116
116
|
# Fallback: If no usage found (or streaming), use the estimate
|
|
@@ -31,7 +31,7 @@ from .core.exceptions import NoAvailableKeyError, KeyNotFoundError
|
|
|
31
31
|
from .core.backoff import ExponentialBackoff, BackoffConfig
|
|
32
32
|
from .usage.db_logic import UsageDatabase
|
|
33
33
|
from .config.log_config import default_logger
|
|
34
|
-
from .adapters import RotatingOpenAIClient, RotatingAsyncOpenAIClient
|
|
34
|
+
from .adapters.openai_adapter import RotatingOpenAIClient, RotatingAsyncOpenAIClient
|
|
35
35
|
from .adapters.generic_adapter import (
|
|
36
36
|
create_rotating_client,
|
|
37
37
|
SyncGenericRotatingClient,
|
|
@@ -39,6 +39,7 @@ class ProviderConfig:
|
|
|
39
39
|
"""Internal config for a registered provider."""
|
|
40
40
|
default_model: Optional[str] = None
|
|
41
41
|
limits: Optional[Dict[str, RateLimits]] = None
|
|
42
|
+
excluded_kwargs: Optional[List[str]] = None
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
@dataclass
|
|
@@ -252,6 +253,10 @@ class MultiClientWrapper:
|
|
|
252
253
|
if api_key_param is None:
|
|
253
254
|
api_key_param = manager.api_key_param
|
|
254
255
|
|
|
256
|
+
# Use config's excluded_kwargs as default if not specified
|
|
257
|
+
if excluded_kwargs is None:
|
|
258
|
+
excluded_kwargs = config.excluded_kwargs
|
|
259
|
+
|
|
255
260
|
return create_rotating_client(
|
|
256
261
|
client_class=client_class,
|
|
257
262
|
manager=manager,
|
|
@@ -330,6 +335,9 @@ class MultiClientWrapper:
|
|
|
330
335
|
limits=config.limits,
|
|
331
336
|
api_key_param=config.api_key_param,
|
|
332
337
|
)
|
|
338
|
+
# Store excluded_kwargs from env config
|
|
339
|
+
if config.excluded_kwargs:
|
|
340
|
+
instance._configs[provider.lower()].excluded_kwargs = config.excluded_kwargs
|
|
333
341
|
return instance
|
|
334
342
|
|
|
335
343
|
@staticmethod
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|