rasa-pro 3.10.13__py3-none-any.whl → 3.10.13a1__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/cli/studio/studio.py CHANGED
@@ -1,5 +1,5 @@
1
1
  import argparse
2
- from typing import List, Optional, Tuple
2
+ from typing import List, Optional
3
3
  from urllib.parse import ParseResult, urlparse
4
4
 
5
5
  import questionary
@@ -149,7 +149,7 @@ def _configure_studio_url() -> Optional[str]:
149
149
  return studio_url
150
150
 
151
151
 
152
- def _get_advanced_config(studio_url: str) -> Tuple:
152
+ def _get_advanced_config(studio_url: str) -> tuple:
153
153
  """Get the advanced configuration values for Rasa Studio."""
154
154
  keycloak_url = questionary.text(
155
155
  "Please provide your Rasa Studio Keycloak URL",
@@ -167,7 +167,7 @@ def _get_advanced_config(studio_url: str) -> Tuple:
167
167
  return keycloak_url, realm_name, client_id
168
168
 
169
169
 
170
- def _get_default_config(studio_url: str) -> Tuple:
170
+ def _get_default_config(studio_url: str) -> tuple:
171
171
  """Get the default configuration values for Rasa Studio."""
172
172
  keycloak_url = studio_url + "auth/"
173
173
  realm_name = DEFAULT_REALM_NAME
@@ -178,7 +178,6 @@ def _get_default_config(studio_url: str) -> Tuple:
178
178
  f"Keycloak URL: {keycloak_url}, "
179
179
  f"Realm Name: '{realm_name}', "
180
180
  f"Client ID: '{client_id}'. "
181
- f"SSL verification is enabled."
182
181
  f"You can use '--advanced' to configure these settings."
183
182
  )
184
183
 
@@ -186,11 +185,7 @@ def _get_default_config(studio_url: str) -> Tuple:
186
185
 
187
186
 
188
187
  def _create_studio_config(
189
- studio_url: str,
190
- keycloak_url: str,
191
- realm_name: str,
192
- client_id: str,
193
- disable_verify: bool = False,
188
+ studio_url: str, keycloak_url: str, realm_name: str, client_id: str
194
189
  ) -> StudioConfig:
195
190
  """Create a StudioConfig object with the provided parameters."""
196
191
  return StudioConfig(
@@ -198,7 +193,6 @@ def _create_studio_config(
198
193
  studio_url=studio_url + "api/graphql/",
199
194
  client_id=client_id,
200
195
  realm_name=realm_name,
201
- disable_verify=disable_verify,
202
196
  )
203
197
 
204
198
 
@@ -233,23 +227,19 @@ def _configure_studio_config(args: argparse.Namespace) -> StudioConfig:
233
227
 
234
228
  # create a configuration and auth object to try to reach the studio
235
229
  studio_config = _create_studio_config(
236
- studio_url,
237
- keycloak_url,
238
- realm_name,
239
- client_id,
240
- disable_verify=args.disable_verify,
230
+ studio_url, keycloak_url, realm_name, client_id
241
231
  )
242
232
 
243
- if studio_config.disable_verify:
233
+ if args.disable_verify:
244
234
  rasa.shared.utils.cli.print_info(
245
235
  "Disabling SSL verification for the Rasa Studio authentication server."
246
236
  )
237
+ studio_auth = StudioAuth(studio_config, verify=False)
247
238
  else:
248
239
  rasa.shared.utils.cli.print_info(
249
240
  "Enabling SSL verification for the Rasa Studio authentication server."
250
241
  )
251
-
252
- studio_auth = StudioAuth(studio_config)
242
+ studio_auth = StudioAuth(studio_config, verify=True)
253
243
 
254
244
  if _check_studio_auth(studio_auth):
255
245
  return studio_config
rasa/studio/auth.py CHANGED
@@ -23,10 +23,12 @@ from rasa.studio.results_logger import with_studio_error_handler, StudioResult
23
23
  class StudioAuth:
24
24
  """Handles the authentication with the Rasa Studio authentication server."""
25
25
 
26
- def __init__(self, studio_config: StudioConfig) -> None:
26
+ def __init__(
27
+ self,
28
+ studio_config: StudioConfig,
29
+ verify: bool = True,
30
+ ) -> None:
27
31
  self.config = studio_config
28
- verify = not studio_config.disable_verify
29
-
30
32
  self.keycloak_openid = KeycloakOpenID(
31
33
  server_url=studio_config.authentication_server_url,
32
34
  client_id=studio_config.client_id,
rasa/studio/config.py CHANGED
@@ -2,14 +2,13 @@ from __future__ import annotations
2
2
 
3
3
  import os
4
4
  from dataclasses import dataclass
5
- from typing import Any, Dict, Optional, Text
5
+ from typing import Dict, Optional, Text
6
6
 
7
7
  from rasa.utils.common import read_global_config_value, write_global_config_value
8
8
 
9
9
  from rasa.studio.constants import (
10
10
  RASA_STUDIO_AUTH_SERVER_URL_ENV,
11
11
  RASA_STUDIO_CLI_CLIENT_ID_KEY_ENV,
12
- RASA_STUDIO_CLI_DISABLE_VERIFY_KEY_ENV,
13
12
  RASA_STUDIO_CLI_REALM_NAME_KEY_ENV,
14
13
  RASA_STUDIO_CLI_STUDIO_URL_ENV,
15
14
  STUDIO_CONFIG_KEY,
@@ -20,7 +19,6 @@ STUDIO_URL_KEY = "studio_url"
20
19
  CLIENT_ID_KEY = "client_id"
21
20
  REALM_NAME_KEY = "realm_name"
22
21
  CLIENT_SECRET_KEY = "client_secret"
23
- DISABLE_VERIFY = "disable_verify"
24
22
 
25
23
 
26
24
  @dataclass
@@ -29,15 +27,13 @@ class StudioConfig:
29
27
  studio_url: Optional[Text]
30
28
  client_id: Optional[Text]
31
29
  realm_name: Optional[Text]
32
- disable_verify: bool = False
33
30
 
34
- def to_dict(self) -> Dict[Text, Optional[Any]]:
31
+ def to_dict(self) -> Dict[Text, Optional[Text]]:
35
32
  return {
36
33
  AUTH_SERVER_URL_KEY: self.authentication_server_url,
37
34
  STUDIO_URL_KEY: self.studio_url,
38
35
  CLIENT_ID_KEY: self.client_id,
39
36
  REALM_NAME_KEY: self.realm_name,
40
- DISABLE_VERIFY: self.disable_verify,
41
37
  }
42
38
 
43
39
  @classmethod
@@ -47,7 +43,6 @@ class StudioConfig:
47
43
  studio_url=data[STUDIO_URL_KEY],
48
44
  client_id=data[CLIENT_ID_KEY],
49
45
  realm_name=data[REALM_NAME_KEY],
50
- disable_verify=data.get(DISABLE_VERIFY, False),
51
46
  )
52
47
 
53
48
  def write_config(self) -> None:
@@ -78,7 +73,7 @@ class StudioConfig:
78
73
  config = read_global_config_value(STUDIO_CONFIG_KEY, unavailable_ok=True)
79
74
 
80
75
  if config is None:
81
- return StudioConfig(None, None, None, None, False)
76
+ return StudioConfig(None, None, None, None)
82
77
 
83
78
  if not isinstance(config, dict):
84
79
  raise ValueError(
@@ -88,7 +83,7 @@ class StudioConfig:
88
83
  )
89
84
 
90
85
  for key in config:
91
- if not isinstance(config[key], str) and key != DISABLE_VERIFY:
86
+ if not isinstance(config[key], str):
92
87
  raise ValueError(
93
88
  "Invalid config file format. "
94
89
  f"Key '{key}' is not a text value."
@@ -107,9 +102,6 @@ class StudioConfig:
107
102
  studio_url=StudioConfig._read_env_value(RASA_STUDIO_CLI_STUDIO_URL_ENV),
108
103
  client_id=StudioConfig._read_env_value(RASA_STUDIO_CLI_CLIENT_ID_KEY_ENV),
109
104
  realm_name=StudioConfig._read_env_value(RASA_STUDIO_CLI_REALM_NAME_KEY_ENV),
110
- disable_verify=bool(
111
- os.getenv(RASA_STUDIO_CLI_DISABLE_VERIFY_KEY_ENV, False)
112
- ),
113
105
  )
114
106
 
115
107
  @staticmethod
@@ -132,5 +124,4 @@ class StudioConfig:
132
124
  studio_url=self.studio_url or other.studio_url,
133
125
  client_id=self.client_id or other.client_id,
134
126
  realm_name=self.realm_name or other.realm_name,
135
- disable_verify=self.disable_verify or other.disable_verify,
136
127
  )
rasa/studio/constants.py CHANGED
@@ -10,7 +10,6 @@ RASA_STUDIO_AUTH_SERVER_URL_ENV = "RASA_STUDIO_AUTH_SERVER_URL"
10
10
  RASA_STUDIO_CLI_STUDIO_URL_ENV = "RASA_STUDIO_CLI_STUDIO_URL"
11
11
  RASA_STUDIO_CLI_REALM_NAME_KEY_ENV = "RASA_STUDIO_CLI_REALM_NAME_KEY"
12
12
  RASA_STUDIO_CLI_CLIENT_ID_KEY_ENV = "RASA_STUDIO_CLI_CLIENT_ID_KEY"
13
- RASA_STUDIO_CLI_DISABLE_VERIFY_KEY_ENV = "RASA_STUDIO_CLI_DISABLE_VERIFY_KEY"
14
13
 
15
14
  STUDIO_NLU_FILENAME = "studio_nlu.yml"
16
15
  STUDIO_DOMAIN_FILENAME = "studio_domain.yml"
@@ -76,9 +76,7 @@ class StudioDataHandler:
76
76
 
77
77
  return request
78
78
 
79
- def _make_request(
80
- self, GQL_req: Dict[Any, Any], verify: bool = True
81
- ) -> Dict[Any, Any]:
79
+ def _make_request(self, GQL_req: Dict[Any, Any]) -> Dict[Any, Any]:
82
80
  token = KeycloakTokenReader().get_token()
83
81
  if token.is_expired():
84
82
  token = self.refresh_token(token)
@@ -95,7 +93,6 @@ class StudioDataHandler:
95
93
  "Authorization": f"{token.token_type} {token.access_token}",
96
94
  "Content-Type": "application/json",
97
95
  },
98
- verify=verify,
99
96
  )
100
97
 
101
98
  if res.status_code != 200:
@@ -131,9 +128,7 @@ class StudioDataHandler:
131
128
  The data from Rasa Studio.
132
129
  """
133
130
  GQL_req = self._build_request()
134
- verify = not self.studio_config.disable_verify
135
-
136
- response = self._make_request(GQL_req, verify=verify)
131
+ response = self._make_request(GQL_req)
137
132
  self._extract_data(response)
138
133
 
139
134
  def request_data(
@@ -150,9 +145,7 @@ class StudioDataHandler:
150
145
  The data from Rasa Studio.
151
146
  """
152
147
  GQL_req = self._build_request(intent_names, entity_names)
153
- verify = not self.studio_config.disable_verify
154
-
155
- response = self._make_request(GQL_req, verify=verify)
148
+ response = self._make_request(GQL_req)
156
149
  self._extract_data(response)
157
150
 
158
151
  def get_config(self) -> Optional[str]:
rasa/studio/upload.py CHANGED
@@ -56,10 +56,7 @@ def _get_selected_entities_and_intents(
56
56
 
57
57
  def handle_upload(args: argparse.Namespace) -> None:
58
58
  """Uploads primitives to rasa studio."""
59
- studio_config = StudioConfig.read_config()
60
- endpoint = studio_config.studio_url
61
- verify = not studio_config.disable_verify
62
-
59
+ endpoint = StudioConfig.read_config().studio_url
63
60
  if not endpoint:
64
61
  rasa.shared.utils.cli.print_error_and_exit(
65
62
  "No GraphQL endpoint found in config. Please run `rasa studio config`."
@@ -79,9 +76,9 @@ def handle_upload(args: argparse.Namespace) -> None:
79
76
 
80
77
  # check safely if args.calm is set and not fail if not
81
78
  if hasattr(args, "calm") and args.calm:
82
- upload_calm_assistant(args, endpoint, verify=verify)
79
+ upload_calm_assistant(args, endpoint)
83
80
  else:
84
- upload_nlu_assistant(args, endpoint, verify=verify)
81
+ upload_nlu_assistant(args, endpoint)
85
82
 
86
83
 
87
84
  config_keys = [
@@ -129,9 +126,7 @@ def _get_assistant_name(config: Dict[Text, Any]) -> str:
129
126
 
130
127
 
131
128
  @with_studio_error_handler
132
- def upload_calm_assistant(
133
- args: argparse.Namespace, endpoint: str, verify: bool = True
134
- ) -> StudioResult:
129
+ def upload_calm_assistant(args: argparse.Namespace, endpoint: str) -> StudioResult:
135
130
  """Uploads the CALM assistant data to Rasa Studio.
136
131
 
137
132
  Args:
@@ -221,13 +216,11 @@ def upload_calm_assistant(
221
216
  )
222
217
 
223
218
  structlogger.info("Uploading to Rasa Studio...")
224
- return make_request(endpoint, graphql_req, verify)
219
+ return make_request(endpoint, graphql_req)
225
220
 
226
221
 
227
222
  @with_studio_error_handler
228
- def upload_nlu_assistant(
229
- args: argparse.Namespace, endpoint: str, verify: bool = True
230
- ) -> StudioResult:
223
+ def upload_nlu_assistant(args: argparse.Namespace, endpoint: str) -> StudioResult:
231
224
  """Uploads the classic (dm1) assistant data to Rasa Studio.
232
225
 
233
226
  Args:
@@ -275,16 +268,15 @@ def upload_nlu_assistant(
275
268
  graphql_req = build_request(assistant_name, nlu_examples_yaml, domain_yaml)
276
269
 
277
270
  structlogger.info("Uploading to Rasa Studio...")
278
- return make_request(endpoint, graphql_req, verify)
271
+ return make_request(endpoint, graphql_req)
279
272
 
280
273
 
281
- def make_request(endpoint: str, graphql_req: Dict, verify: bool = True) -> StudioResult:
274
+ def make_request(endpoint: str, graphql_req: Dict) -> StudioResult:
282
275
  """Makes a request to the studio endpoint to upload data.
283
276
 
284
277
  Args:
285
278
  endpoint: The studio endpoint
286
279
  graphql_req: The graphql request
287
- verify: Whether to verify SSL
288
280
  """
289
281
  token = KeycloakTokenReader().get_token()
290
282
  res = requests.post(
@@ -294,7 +286,6 @@ def make_request(endpoint: str, graphql_req: Dict, verify: bool = True) -> Studi
294
286
  "Authorization": f"{token.token_type} {token.access_token}",
295
287
  "Content-Type": "application/json",
296
288
  },
297
- verify=verify,
298
289
  )
299
290
 
300
291
  if results_logger.response_has_errors(res.json()):
rasa/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  # this file will automatically be changed,
2
2
  # do not add anything but the version number here!
3
- __version__ = "3.10.13"
3
+ __version__ = "3.10.13a1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rasa-pro
3
- Version: 3.10.13
3
+ Version: 3.10.13a1
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
@@ -80,7 +80,7 @@ rasa/cli/scaffold.py,sha256=Eqv44T7b5cOd2FKLU1tSrAVPKwMfoiUIjc43PtaxJGg,7988
80
80
  rasa/cli/shell.py,sha256=wymYOj6jdUON0y7pe-rpRqarWDGaDquU7PRp8knxqHk,4264
81
81
  rasa/cli/studio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
82
82
  rasa/cli/studio/download.py,sha256=r3UCbpD6-8GGKK47FqXTPI1hvYElADjgcdegG6B9XYg,1832
83
- rasa/cli/studio/studio.py,sha256=HJpxm2GmzD5nqbKenWUgE-luEOtJ5p2xv_bjzDzRS1c,9004
83
+ rasa/cli/studio/studio.py,sha256=fADCRFRyarZ4eU_frmNfgCoutdH7lLPRQBq4612Q_pA,8871
84
84
  rasa/cli/studio/train.py,sha256=ruXA5UkaRbO3femk8w3I2cXKs06-34FYtB_9MKdP6hw,1572
85
85
  rasa/cli/studio/upload.py,sha256=kdHqrVGsEbbqH5fz_HusWwJEycB31SHaPlXer8lXAE0,2069
86
86
  rasa/cli/telemetry.py,sha256=ZywhlOpp0l2Yz9oEcOGA2ej3SEkSTisKPpBhn_fS7tc,3538
@@ -667,14 +667,14 @@ rasa/shared/utils/schemas/model_config.yml,sha256=GU1lL_apXjJ3Xbd9Fj5jKm2h1HeB6V
667
667
  rasa/shared/utils/schemas/stories.yml,sha256=DV3wAFnv1leD7kV-FH-GQihF1QX5oKHc8Eb24mxjizc,4737
668
668
  rasa/shared/utils/yaml.py,sha256=poDOFJ4jU-hQG7XS7ozeFA8ec5L4NSUBiFvH-N5BuQc,31089
669
669
  rasa/studio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
670
- rasa/studio/auth.py,sha256=Lw0zkNhQx3pW8yANWAg9x1M4hXT4Jjpxcnjfw8LYFsA,9672
671
- rasa/studio/config.py,sha256=IGxMCpdE31PFms0hqYbT6GlAOS1w2L1wutnc8wQSO4s,4541
672
- rasa/studio/constants.py,sha256=SIpfW70P3OwoLU359BSXQ9fNEVLF6YTCnX6CVvsG0uo,810
673
- rasa/studio/data_handler.py,sha256=o6jDLE15SBtkBDv4n9RCG9spF0f9BCm0PmXU8jSOfik,12416
670
+ rasa/studio/auth.py,sha256=6Hk6aHpNNrFXpGygWVIF2V5FFyVpqEOyMX5fVU8bqxU,9673
671
+ rasa/studio/config.py,sha256=wqjvg_hARKG-6cV3JrhnP_ptZIq0VSFbdv-aWrH0u_Q,4091
672
+ rasa/studio/constants.py,sha256=7ixKE1kPw2OM0dWhnEHGSVtSwZ5h9cNL1TB6eExg0EA,732
673
+ rasa/studio/data_handler.py,sha256=oG2pLb7sJa2QO3h63PUIZU8DbiJO9B7FGx3pYrAsMjA,12212
674
674
  rasa/studio/download.py,sha256=9uE4KKaHnID_3-Tt_E5_D00XTwhLlj4oxORY8CZRrZc,17188
675
675
  rasa/studio/results_logger.py,sha256=0gCkEaZ1CeFmxRHArK5my_DsLYjApZrxfiRMT5asE6A,4963
676
676
  rasa/studio/train.py,sha256=gfPtirITzBDo9gV4hqDNSwPYtVp_22cq8OWI6YIBgyk,4243
677
- rasa/studio/upload.py,sha256=5hvj_DUzxq5JkZswro-KaLE4QAKwbMLGb8TakzS1etk,14290
677
+ rasa/studio/upload.py,sha256=3XqYyIZE1L3ohJtRcpf039IRc73A_rZ4KVWC32_dBo4,14027
678
678
  rasa/telemetry.py,sha256=Q6MQnDhOY6cKRVs3PayiM6WYWb8QJ_Hb3_eOm12n0tI,61093
679
679
  rasa/tracing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
680
680
  rasa/tracing/config.py,sha256=O4iHkE4kF6r4uVAt3JUb--TniK7pWD4j3d08Vf_GuYY,12736
@@ -720,9 +720,9 @@ rasa/utils/train_utils.py,sha256=f1NWpp5y6al0dzoQyyio4hc4Nf73DRoRSHDzEK6-C4E,212
720
720
  rasa/utils/url_tools.py,sha256=JQcHL2aLqLHu82k7_d9imUoETCm2bmlHaDpOJ-dKqBc,1218
721
721
  rasa/utils/yaml.py,sha256=KjbZq5C94ZP7Jdsw8bYYF7HASI6K4-C_kdHfrnPLpSI,2000
722
722
  rasa/validator.py,sha256=ToRaa4dS859CJO3H2VGqS943O5qWOg45ypbDfFMKECU,62699
723
- rasa/version.py,sha256=aji2ixgfN5o0Qbky9Ay-XdGG4bS_vwvrv5hZY9MWQR0,118
724
- rasa_pro-3.10.13.dist-info/METADATA,sha256=jRz-VIUgsUpiuvknI7kTqZZoRTQfJNlaMwIquWXNyzw,10919
725
- rasa_pro-3.10.13.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
726
- rasa_pro-3.10.13.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
727
- rasa_pro-3.10.13.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
728
- rasa_pro-3.10.13.dist-info/RECORD,,
723
+ rasa/version.py,sha256=XeYU5gF7m3YQ6D79cZdCdDxwmL4reMJlBtTt5PKs8BI,120
724
+ rasa_pro-3.10.13a1.dist-info/METADATA,sha256=X0kN_6S3XcNSWg1RyxSSf3WrT1YDi6Nf9Qj9JY8ZvAU,10921
725
+ rasa_pro-3.10.13a1.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
726
+ rasa_pro-3.10.13a1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
727
+ rasa_pro-3.10.13a1.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
728
+ rasa_pro-3.10.13a1.dist-info/RECORD,,