aisbf 0.2.4__py3-none-any.whl → 0.2.6__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.
- aisbf/__init__.py +1 -1
- aisbf/handlers.py +6 -0
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/aisbf/__init__.py +1 -1
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/aisbf/handlers.py +6 -0
- {aisbf-0.2.4.dist-info → aisbf-0.2.6.dist-info}/METADATA +18 -4
- aisbf-0.2.6.dist-info/RECORD +24 -0
- aisbf-0.2.4.dist-info/RECORD +0 -24
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/aisbf/config.py +0 -0
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/aisbf/models.py +0 -0
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/aisbf/providers.py +0 -0
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/aisbf.sh +0 -0
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/autoselect.json +0 -0
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/autoselect.md +0 -0
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/main.py +0 -0
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/providers.json +0 -0
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/requirements.txt +0 -0
- {aisbf-0.2.4.data → aisbf-0.2.6.data}/data/share/aisbf/rotations.json +0 -0
- {aisbf-0.2.4.dist-info → aisbf-0.2.6.dist-info}/WHEEL +0 -0
- {aisbf-0.2.4.dist-info → aisbf-0.2.6.dist-info}/entry_points.txt +0 -0
- {aisbf-0.2.4.dist-info → aisbf-0.2.6.dist-info}/licenses/LICENSE.txt +0 -0
- {aisbf-0.2.4.dist-info → aisbf-0.2.6.dist-info}/top_level.txt +0 -0
aisbf/__init__.py
CHANGED
aisbf/handlers.py
CHANGED
|
@@ -275,6 +275,7 @@ class RotationHandler:
|
|
|
275
275
|
max_retries = 2
|
|
276
276
|
tried_models = []
|
|
277
277
|
last_error = None
|
|
278
|
+
successful_model = None
|
|
278
279
|
|
|
279
280
|
for attempt in range(max_retries):
|
|
280
281
|
logger.info(f"")
|
|
@@ -332,8 +333,13 @@ class RotationHandler:
|
|
|
332
333
|
)
|
|
333
334
|
logger.info(f"Response received from provider")
|
|
334
335
|
handler.record_success()
|
|
336
|
+
|
|
337
|
+
# Update successful_model to the one that worked
|
|
338
|
+
successful_model = current_model
|
|
339
|
+
|
|
335
340
|
logger.info(f"=== RotationHandler.handle_rotation_request END ===")
|
|
336
341
|
logger.info(f"Request succeeded on attempt {attempt + 1}")
|
|
342
|
+
logger.info(f"Successfully used model: {successful_model['name']} (provider: {successful_model['provider_id']})")
|
|
337
343
|
return response
|
|
338
344
|
except Exception as e:
|
|
339
345
|
last_error = str(e)
|
|
@@ -275,6 +275,7 @@ class RotationHandler:
|
|
|
275
275
|
max_retries = 2
|
|
276
276
|
tried_models = []
|
|
277
277
|
last_error = None
|
|
278
|
+
successful_model = None
|
|
278
279
|
|
|
279
280
|
for attempt in range(max_retries):
|
|
280
281
|
logger.info(f"")
|
|
@@ -332,8 +333,13 @@ class RotationHandler:
|
|
|
332
333
|
)
|
|
333
334
|
logger.info(f"Response received from provider")
|
|
334
335
|
handler.record_success()
|
|
336
|
+
|
|
337
|
+
# Update successful_model to the one that worked
|
|
338
|
+
successful_model = current_model
|
|
339
|
+
|
|
335
340
|
logger.info(f"=== RotationHandler.handle_rotation_request END ===")
|
|
336
341
|
logger.info(f"Request succeeded on attempt {attempt + 1}")
|
|
342
|
+
logger.info(f"Successfully used model: {successful_model['name']} (provider: {successful_model['provider_id']})")
|
|
337
343
|
return response
|
|
338
344
|
except Exception as e:
|
|
339
345
|
last_error = str(e)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aisbf
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: AISBF - AI Service Broker Framework || AI Should Be Free - A modular proxy server for managing multiple AI provider integrations
|
|
5
5
|
Home-page: https://git.nexlab.net/nexlab/aisbf.git
|
|
6
6
|
Author: AISBF Contributors
|
|
@@ -109,9 +109,23 @@ See [`PYPI.md`](PYPI.md) for detailed instructions on publishing to PyPI.
|
|
|
109
109
|
See `config/providers.json` and `config/rotations.json` for configuration examples.
|
|
110
110
|
|
|
111
111
|
## API Endpoints
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
- `GET
|
|
112
|
+
|
|
113
|
+
### General Endpoints
|
|
114
|
+
- `GET /` - Server status and provider list (includes providers, rotations, and autoselect)
|
|
115
|
+
|
|
116
|
+
### Provider Endpoints
|
|
117
|
+
- `POST /api/{provider_id}/chat/completions` - Chat completions for a specific provider
|
|
118
|
+
- `GET /api/{provider_id}/models` - List available models for a specific provider
|
|
119
|
+
|
|
120
|
+
### Rotation Endpoints
|
|
121
|
+
- `GET /api/rotations` - List all available rotation configurations
|
|
122
|
+
- `POST /api/rotations/chat/completions` - Chat completions using rotation (load balancing across providers)
|
|
123
|
+
- `GET /api/rotations/models` - List all models across all rotation configurations
|
|
124
|
+
|
|
125
|
+
### Autoselect Endpoints
|
|
126
|
+
- `GET /api/autoselect` - List all available autoselect configurations
|
|
127
|
+
- `POST /api/autoselect/chat/completions` - Chat completions using AI-assisted selection based on content analysis
|
|
128
|
+
- `GET /api/autoselect/models` - List all models across all autoselect configurations
|
|
115
129
|
|
|
116
130
|
## Error Handling
|
|
117
131
|
- Rate limiting for failed requests
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
cli.py,sha256=SpjVC1iBdDhQXuhJcjVFkODu4BH-nj_1hNFD_d8wPbw,2503
|
|
2
|
+
aisbf/__init__.py,sha256=aZQTT9EZ25hSzSp4DOUXD7PmvhSfuoOY0zrEv9QD18k,2156
|
|
3
|
+
aisbf/config.py,sha256=xXcUQG3OcteCi8__qm6-yEnwjwFVpLBYLrs-zMnDfl0,9643
|
|
4
|
+
aisbf/handlers.py,sha256=SEuOP9IxxcHIXQyWcTcEZcQNujnq64jWqAvUTUvQ3lY,31867
|
|
5
|
+
aisbf/models.py,sha256=LT1NaQVAw0VWXL-j3hdfNlXCA9HeiET_O3GDj3t9XC4,1883
|
|
6
|
+
aisbf/providers.py,sha256=gh3qe-bthAxb-hRPPpp_YLgGzbdTKRN5HKVjf-Yvnp0,19920
|
|
7
|
+
aisbf-0.2.6.data/data/share/aisbf/aisbf.sh,sha256=ntI4UPefBtU2jrTwMR3hddHEPG_pDyJyO0J3SD7e5PA,4574
|
|
8
|
+
aisbf-0.2.6.data/data/share/aisbf/autoselect.json,sha256=Anud0hTE1mehonmMmhOTPK2ANUxfruE2yMdLqiEkEUA,659
|
|
9
|
+
aisbf-0.2.6.data/data/share/aisbf/autoselect.md,sha256=F8PilhaYBs0qdpIxIkokrjtIOdhAx5Bi1tA0hyfnqps,4301
|
|
10
|
+
aisbf-0.2.6.data/data/share/aisbf/main.py,sha256=hCTxLA-txJpSpMTE5mV1XG_j8Kn17ZTHJsnx59nKscg,17241
|
|
11
|
+
aisbf-0.2.6.data/data/share/aisbf/providers.json,sha256=9L5GO6sQ2Z6zndGed0AckvYNV1DMr9r7tSdZ9fJxYlA,3934
|
|
12
|
+
aisbf-0.2.6.data/data/share/aisbf/requirements.txt,sha256=lp6cPakAO3lpTCwQ27THf-PNz_HIpzCELrtpdgo6-2o,133
|
|
13
|
+
aisbf-0.2.6.data/data/share/aisbf/rotations.json,sha256=SzbmMeTRR0vVTrYTMwxSPxjXLVr8zxjaI4HYRxjyExQ,2123
|
|
14
|
+
aisbf-0.2.6.data/data/share/aisbf/aisbf/__init__.py,sha256=aZQTT9EZ25hSzSp4DOUXD7PmvhSfuoOY0zrEv9QD18k,2156
|
|
15
|
+
aisbf-0.2.6.data/data/share/aisbf/aisbf/config.py,sha256=xXcUQG3OcteCi8__qm6-yEnwjwFVpLBYLrs-zMnDfl0,9643
|
|
16
|
+
aisbf-0.2.6.data/data/share/aisbf/aisbf/handlers.py,sha256=SEuOP9IxxcHIXQyWcTcEZcQNujnq64jWqAvUTUvQ3lY,31867
|
|
17
|
+
aisbf-0.2.6.data/data/share/aisbf/aisbf/models.py,sha256=LT1NaQVAw0VWXL-j3hdfNlXCA9HeiET_O3GDj3t9XC4,1883
|
|
18
|
+
aisbf-0.2.6.data/data/share/aisbf/aisbf/providers.py,sha256=gh3qe-bthAxb-hRPPpp_YLgGzbdTKRN5HKVjf-Yvnp0,19920
|
|
19
|
+
aisbf-0.2.6.dist-info/licenses/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
20
|
+
aisbf-0.2.6.dist-info/METADATA,sha256=34e3r8jaGys19EVKYHH4sZknDompzYP0KWJDC_ynbyw,4915
|
|
21
|
+
aisbf-0.2.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
22
|
+
aisbf-0.2.6.dist-info/entry_points.txt,sha256=dV_E5f6UvgSe9AoyPTzGxBK8IYaIeLR8yTe7EwBZ3F8,35
|
|
23
|
+
aisbf-0.2.6.dist-info/top_level.txt,sha256=odXp1LYymu31EdVSmMGCg3ZYAI5HeB8tZkaXh9Pw3kE,10
|
|
24
|
+
aisbf-0.2.6.dist-info/RECORD,,
|
aisbf-0.2.4.dist-info/RECORD
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
cli.py,sha256=SpjVC1iBdDhQXuhJcjVFkODu4BH-nj_1hNFD_d8wPbw,2503
|
|
2
|
-
aisbf/__init__.py,sha256=D3-tZRWCu31CltN_pjx8IikwPl0OGEJkvoASm8QjvcQ,2156
|
|
3
|
-
aisbf/config.py,sha256=xXcUQG3OcteCi8__qm6-yEnwjwFVpLBYLrs-zMnDfl0,9643
|
|
4
|
-
aisbf/handlers.py,sha256=tXYOQYkhIK6X1EmgivVyO6fElkrRj1cqNQfQ5KGldO8,31557
|
|
5
|
-
aisbf/models.py,sha256=LT1NaQVAw0VWXL-j3hdfNlXCA9HeiET_O3GDj3t9XC4,1883
|
|
6
|
-
aisbf/providers.py,sha256=gh3qe-bthAxb-hRPPpp_YLgGzbdTKRN5HKVjf-Yvnp0,19920
|
|
7
|
-
aisbf-0.2.4.data/data/share/aisbf/aisbf.sh,sha256=ntI4UPefBtU2jrTwMR3hddHEPG_pDyJyO0J3SD7e5PA,4574
|
|
8
|
-
aisbf-0.2.4.data/data/share/aisbf/autoselect.json,sha256=Anud0hTE1mehonmMmhOTPK2ANUxfruE2yMdLqiEkEUA,659
|
|
9
|
-
aisbf-0.2.4.data/data/share/aisbf/autoselect.md,sha256=F8PilhaYBs0qdpIxIkokrjtIOdhAx5Bi1tA0hyfnqps,4301
|
|
10
|
-
aisbf-0.2.4.data/data/share/aisbf/main.py,sha256=hCTxLA-txJpSpMTE5mV1XG_j8Kn17ZTHJsnx59nKscg,17241
|
|
11
|
-
aisbf-0.2.4.data/data/share/aisbf/providers.json,sha256=9L5GO6sQ2Z6zndGed0AckvYNV1DMr9r7tSdZ9fJxYlA,3934
|
|
12
|
-
aisbf-0.2.4.data/data/share/aisbf/requirements.txt,sha256=lp6cPakAO3lpTCwQ27THf-PNz_HIpzCELrtpdgo6-2o,133
|
|
13
|
-
aisbf-0.2.4.data/data/share/aisbf/rotations.json,sha256=SzbmMeTRR0vVTrYTMwxSPxjXLVr8zxjaI4HYRxjyExQ,2123
|
|
14
|
-
aisbf-0.2.4.data/data/share/aisbf/aisbf/__init__.py,sha256=D3-tZRWCu31CltN_pjx8IikwPl0OGEJkvoASm8QjvcQ,2156
|
|
15
|
-
aisbf-0.2.4.data/data/share/aisbf/aisbf/config.py,sha256=xXcUQG3OcteCi8__qm6-yEnwjwFVpLBYLrs-zMnDfl0,9643
|
|
16
|
-
aisbf-0.2.4.data/data/share/aisbf/aisbf/handlers.py,sha256=tXYOQYkhIK6X1EmgivVyO6fElkrRj1cqNQfQ5KGldO8,31557
|
|
17
|
-
aisbf-0.2.4.data/data/share/aisbf/aisbf/models.py,sha256=LT1NaQVAw0VWXL-j3hdfNlXCA9HeiET_O3GDj3t9XC4,1883
|
|
18
|
-
aisbf-0.2.4.data/data/share/aisbf/aisbf/providers.py,sha256=gh3qe-bthAxb-hRPPpp_YLgGzbdTKRN5HKVjf-Yvnp0,19920
|
|
19
|
-
aisbf-0.2.4.dist-info/licenses/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
20
|
-
aisbf-0.2.4.dist-info/METADATA,sha256=A_x1Mb5ryEHXXCKpdzfFz8Pgdn7FKgR4POzRKAmbdZU,4190
|
|
21
|
-
aisbf-0.2.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
22
|
-
aisbf-0.2.4.dist-info/entry_points.txt,sha256=dV_E5f6UvgSe9AoyPTzGxBK8IYaIeLR8yTe7EwBZ3F8,35
|
|
23
|
-
aisbf-0.2.4.dist-info/top_level.txt,sha256=odXp1LYymu31EdVSmMGCg3ZYAI5HeB8tZkaXh9Pw3kE,10
|
|
24
|
-
aisbf-0.2.4.dist-info/RECORD,,
|
|
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
|