rasa-pro 3.11.0a4.dev1__py3-none-any.whl → 3.11.0a4.dev2__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.
Potentially problematic release.
This version of rasa-pro might be problematic. Click here for more details.
- rasa/model_manager/model_api.py +16 -39
- rasa/model_service.py +1 -1
- rasa/version.py +1 -1
- {rasa_pro-3.11.0a4.dev1.dist-info → rasa_pro-3.11.0a4.dev2.dist-info}/METADATA +1 -1
- {rasa_pro-3.11.0a4.dev1.dist-info → rasa_pro-3.11.0a4.dev2.dist-info}/RECORD +8 -8
- {rasa_pro-3.11.0a4.dev1.dist-info → rasa_pro-3.11.0a4.dev2.dist-info}/NOTICE +0 -0
- {rasa_pro-3.11.0a4.dev1.dist-info → rasa_pro-3.11.0a4.dev2.dist-info}/WHEEL +0 -0
- {rasa_pro-3.11.0a4.dev1.dist-info → rasa_pro-3.11.0a4.dev2.dist-info}/entry_points.txt +0 -0
rasa/model_manager/model_api.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
from functools import wraps
|
|
3
2
|
import os
|
|
4
3
|
from http import HTTPStatus
|
|
5
|
-
from typing import Any, Dict, Optional
|
|
4
|
+
from typing import Any, Dict, Optional
|
|
6
5
|
import dotenv
|
|
7
6
|
from sanic import Blueprint, Sanic, response
|
|
8
7
|
from sanic.response import json
|
|
@@ -12,7 +11,7 @@ import structlog
|
|
|
12
11
|
from socketio import AsyncServer
|
|
13
12
|
|
|
14
13
|
from rasa.exceptions import ModelNotFound
|
|
15
|
-
from rasa.model_manager import config
|
|
14
|
+
from rasa.model_manager import config
|
|
16
15
|
from rasa.model_manager.config import SERVER_BASE_URL
|
|
17
16
|
from rasa.constants import MODEL_ARCHIVE_EXTENSION
|
|
18
17
|
from rasa.model_manager.runner_service import (
|
|
@@ -112,27 +111,6 @@ async def continuously_update_process_status() -> None:
|
|
|
112
111
|
await asyncio.sleep(1)
|
|
113
112
|
|
|
114
113
|
|
|
115
|
-
def requires_studio_auth() -> Callable:
|
|
116
|
-
"""Wraps a request handler with token authentication."""
|
|
117
|
-
|
|
118
|
-
def decorator(f: Callable) -> Callable:
|
|
119
|
-
@wraps(f)
|
|
120
|
-
async def decorated(
|
|
121
|
-
request: Request, *args: Any, **kwargs: Any
|
|
122
|
-
) -> response.HTTPResponse:
|
|
123
|
-
# get token from bearer in auth header
|
|
124
|
-
provided = request.headers.get("Authorization", "").split("Bearer ")[-1]
|
|
125
|
-
try:
|
|
126
|
-
studio_jwt_auth.authenticate_user_to_service(provided)
|
|
127
|
-
return await f(request, *args, **kwargs)
|
|
128
|
-
except studio_jwt_auth.UserToServiceAuthenticationError:
|
|
129
|
-
return response.json({"message": "User not authenticated."}, status=401)
|
|
130
|
-
|
|
131
|
-
return decorated
|
|
132
|
-
|
|
133
|
-
return decorator
|
|
134
|
-
|
|
135
|
-
|
|
136
114
|
def internal_blueprint() -> Blueprint:
|
|
137
115
|
"""Create a blueprint for the model manager API."""
|
|
138
116
|
bp = Blueprint("model_api_internal")
|
|
@@ -390,6 +368,20 @@ def internal_blueprint() -> Blueprint:
|
|
|
390
368
|
]
|
|
391
369
|
return json({"deployment_sessions": bots, "total_number": len(bots)})
|
|
392
370
|
|
|
371
|
+
@bp.route("/models/<model_name>")
|
|
372
|
+
async def send_model(request: Request, model_name: str) -> response.HTTPResponse:
|
|
373
|
+
try:
|
|
374
|
+
model_path = path_to_model(model_name)
|
|
375
|
+
|
|
376
|
+
if not model_path:
|
|
377
|
+
return json({"message": "Model not found"}, status=404)
|
|
378
|
+
|
|
379
|
+
return await response.file(model_path)
|
|
380
|
+
except NotFound:
|
|
381
|
+
return json({"message": "Model not found"}, status=404)
|
|
382
|
+
except ModelNotFound:
|
|
383
|
+
return json({"message": "Model not found"}, status=404)
|
|
384
|
+
|
|
393
385
|
return bp
|
|
394
386
|
|
|
395
387
|
|
|
@@ -429,21 +421,6 @@ def external_blueprint() -> Blueprint:
|
|
|
429
421
|
}
|
|
430
422
|
)
|
|
431
423
|
|
|
432
|
-
@bp.route("/models/<model_name>")
|
|
433
|
-
@requires_studio_auth()
|
|
434
|
-
async def send_model(request: Request, model_name: str) -> response.HTTPResponse:
|
|
435
|
-
try:
|
|
436
|
-
model_path = path_to_model(model_name)
|
|
437
|
-
|
|
438
|
-
if not model_path:
|
|
439
|
-
return json({"message": "Model not found"}, status=404)
|
|
440
|
-
|
|
441
|
-
return await response.file(model_path)
|
|
442
|
-
except NotFound:
|
|
443
|
-
return json({"message": "Model not found"}, status=404)
|
|
444
|
-
except ModelNotFound:
|
|
445
|
-
return json({"message": "Model not found"}, status=404)
|
|
446
|
-
|
|
447
424
|
return bp
|
|
448
425
|
|
|
449
426
|
|
rasa/model_service.py
CHANGED
rasa/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rasa-pro
|
|
3
|
-
Version: 3.11.0a4.
|
|
3
|
+
Version: 3.11.0a4.dev2
|
|
4
4
|
Summary: State-of-the-art open-core Conversational AI framework for Enterprises that natively leverages generative AI for effortless assistant development.
|
|
5
5
|
Home-page: https://rasa.com
|
|
6
6
|
Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
|
|
@@ -505,13 +505,13 @@ rasa/markers/validate.py,sha256=YypXKRS87xxrMMEz9HpAQzYJUwg0OPbczMXBRNjlJq4,709
|
|
|
505
505
|
rasa/model.py,sha256=GH1-N6Po3gL3nwfa9eGoN2bMRNMrn4f3mi17-osW3T0,3491
|
|
506
506
|
rasa/model_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
507
507
|
rasa/model_manager/config.py,sha256=7UQgLHlbOSq8NpOlhoVGaL4zS96g5GPOe-DvPDeTmVc,595
|
|
508
|
-
rasa/model_manager/model_api.py,sha256=
|
|
508
|
+
rasa/model_manager/model_api.py,sha256=47LWMdEUuINvQDFqvL3TemHXCJbL62IgEdZWWtGhoYU,15617
|
|
509
509
|
rasa/model_manager/runner_service.py,sha256=9rfgfxYYTb032x-KquYauPtWz4ndQbIMI_toZI2X2ow,8231
|
|
510
510
|
rasa/model_manager/socket_bridge.py,sha256=2Rm3dYJma7Axf_ns8C87iY2GgJKnJRLt8v2g-Q9ppm4,4685
|
|
511
511
|
rasa/model_manager/studio_jwt_auth.py,sha256=eZ_srnbL2sKIKgx0OZIp29NbIrH2J8PlI8Or0lLg_Xo,2644
|
|
512
512
|
rasa/model_manager/trainer_service.py,sha256=1wzXif1zwVSkVF-iv_0Tza2eEEWz1asKQwAAZnZn384,10404
|
|
513
513
|
rasa/model_manager/utils.py,sha256=OgxhKm4T9Iv_Qd8G9E74c-oNsBy4CD5cD0wPHFuKE3w,1918
|
|
514
|
-
rasa/model_service.py,sha256=
|
|
514
|
+
rasa/model_service.py,sha256=y5QTuaq30zeOJZRFdg72Q_L0wNN0RNeeGP12B5tOOI8,3540
|
|
515
515
|
rasa/model_testing.py,sha256=h0QUpJu6p_TDse3aHjCfYwI6OGH47b3Iuo5Ot0HQADM,14959
|
|
516
516
|
rasa/model_training.py,sha256=TCGQgmYym3AM4NDGpzaSVQabvBeS74nPt3DhCIC5mqg,21444
|
|
517
517
|
rasa/nlu/__init__.py,sha256=D0IYuTK_ZQ_F_9xsy0bXxVCAtU62Fzvp8S7J9tmfI_c,123
|
|
@@ -749,9 +749,9 @@ rasa/utils/train_utils.py,sha256=f1NWpp5y6al0dzoQyyio4hc4Nf73DRoRSHDzEK6-C4E,212
|
|
|
749
749
|
rasa/utils/url_tools.py,sha256=JQcHL2aLqLHu82k7_d9imUoETCm2bmlHaDpOJ-dKqBc,1218
|
|
750
750
|
rasa/utils/yaml.py,sha256=KjbZq5C94ZP7Jdsw8bYYF7HASI6K4-C_kdHfrnPLpSI,2000
|
|
751
751
|
rasa/validator.py,sha256=ToRaa4dS859CJO3H2VGqS943O5qWOg45ypbDfFMKECU,62699
|
|
752
|
-
rasa/version.py,sha256=
|
|
753
|
-
rasa_pro-3.11.0a4.
|
|
754
|
-
rasa_pro-3.11.0a4.
|
|
755
|
-
rasa_pro-3.11.0a4.
|
|
756
|
-
rasa_pro-3.11.0a4.
|
|
757
|
-
rasa_pro-3.11.0a4.
|
|
752
|
+
rasa/version.py,sha256=HerBDfMpn5O4XP8SganFCKwhz_o2yUboy5IcezOmIs8,124
|
|
753
|
+
rasa_pro-3.11.0a4.dev2.dist-info/METADATA,sha256=wLRdOO00v_9psQJGtneVG8UQfpMq27qOsDLepCniUGM,10920
|
|
754
|
+
rasa_pro-3.11.0a4.dev2.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
|
|
755
|
+
rasa_pro-3.11.0a4.dev2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
756
|
+
rasa_pro-3.11.0a4.dev2.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
|
|
757
|
+
rasa_pro-3.11.0a4.dev2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|