rasa-pro 3.10.16__py3-none-any.whl → 3.11.0a1__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.

Files changed (185) hide show
  1. README.md +396 -17
  2. rasa/api.py +9 -3
  3. rasa/cli/arguments/default_arguments.py +23 -2
  4. rasa/cli/arguments/run.py +15 -0
  5. rasa/cli/arguments/train.py +3 -9
  6. rasa/cli/e2e_test.py +1 -1
  7. rasa/cli/evaluate.py +1 -1
  8. rasa/cli/inspect.py +8 -4
  9. rasa/cli/llm_fine_tuning.py +12 -15
  10. rasa/cli/run.py +8 -1
  11. rasa/cli/studio/studio.py +8 -18
  12. rasa/cli/train.py +11 -53
  13. rasa/cli/utils.py +8 -10
  14. rasa/cli/x.py +1 -1
  15. rasa/constants.py +1 -1
  16. rasa/core/actions/action.py +2 -0
  17. rasa/core/actions/action_hangup.py +29 -0
  18. rasa/core/agent.py +2 -2
  19. rasa/core/brokers/kafka.py +3 -1
  20. rasa/core/brokers/pika.py +3 -1
  21. rasa/core/channels/__init__.py +8 -6
  22. rasa/core/channels/channel.py +21 -4
  23. rasa/core/channels/development_inspector.py +143 -46
  24. rasa/core/channels/inspector/README.md +1 -1
  25. rasa/core/channels/inspector/dist/assets/{arc-b6e548fe.js → arc-86942a71.js} +1 -1
  26. rasa/core/channels/inspector/dist/assets/{c4Diagram-d0fbc5ce-fa03ac9e.js → c4Diagram-d0fbc5ce-b0290676.js} +1 -1
  27. rasa/core/channels/inspector/dist/assets/{classDiagram-936ed81e-ee67392a.js → classDiagram-936ed81e-f6405f6e.js} +1 -1
  28. rasa/core/channels/inspector/dist/assets/{classDiagram-v2-c3cb15f1-9b283fae.js → classDiagram-v2-c3cb15f1-ef61ac77.js} +1 -1
  29. rasa/core/channels/inspector/dist/assets/{createText-62fc7601-8b6fcc2a.js → createText-62fc7601-f0411e58.js} +1 -1
  30. rasa/core/channels/inspector/dist/assets/{edges-f2ad444c-22e77f4f.js → edges-f2ad444c-7dcc4f3b.js} +1 -1
  31. rasa/core/channels/inspector/dist/assets/{erDiagram-9d236eb7-60ffc87f.js → erDiagram-9d236eb7-e0c092d7.js} +1 -1
  32. rasa/core/channels/inspector/dist/assets/{flowDb-1972c806-9dd802e4.js → flowDb-1972c806-fba2e3ce.js} +1 -1
  33. rasa/core/channels/inspector/dist/assets/{flowDiagram-7ea5b25a-5fa1912f.js → flowDiagram-7ea5b25a-7a70b71a.js} +1 -1
  34. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-24a5f41a.js +1 -0
  35. rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-abe16c3d-622a1fd2.js → flowchart-elk-definition-abe16c3d-00a59b68.js} +1 -1
  36. rasa/core/channels/inspector/dist/assets/{ganttDiagram-9b5ea136-e285a63a.js → ganttDiagram-9b5ea136-293c91fa.js} +1 -1
  37. rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-99d0ae7c-f237bdca.js → gitGraphDiagram-99d0ae7c-07b2d68c.js} +1 -1
  38. rasa/core/channels/inspector/dist/assets/{index-2c4b9a3b-4b03d70e.js → index-2c4b9a3b-bc959fbd.js} +1 -1
  39. rasa/core/channels/inspector/dist/assets/index-3a8a5a28.js +1317 -0
  40. rasa/core/channels/inspector/dist/assets/{infoDiagram-736b4530-72a0fa5f.js → infoDiagram-736b4530-4a350f72.js} +1 -1
  41. rasa/core/channels/inspector/dist/assets/{journeyDiagram-df861f2b-82218c41.js → journeyDiagram-df861f2b-af464fb7.js} +1 -1
  42. rasa/core/channels/inspector/dist/assets/{layout-78cff630.js → layout-0071f036.js} +1 -1
  43. rasa/core/channels/inspector/dist/assets/{line-5038b469.js → line-2f73cc83.js} +1 -1
  44. rasa/core/channels/inspector/dist/assets/{linear-c4fc4098.js → linear-f014b4cc.js} +1 -1
  45. rasa/core/channels/inspector/dist/assets/{mindmap-definition-beec6740-c33c8ea6.js → mindmap-definition-beec6740-d2426fb6.js} +1 -1
  46. rasa/core/channels/inspector/dist/assets/{pieDiagram-dbbf0591-a8d03059.js → pieDiagram-dbbf0591-776f01a2.js} +1 -1
  47. rasa/core/channels/inspector/dist/assets/{quadrantDiagram-4d7f4fd6-6a0e56b2.js → quadrantDiagram-4d7f4fd6-82e00b57.js} +1 -1
  48. rasa/core/channels/inspector/dist/assets/{requirementDiagram-6fc4c22a-2dc7c7bd.js → requirementDiagram-6fc4c22a-ea13c6bb.js} +1 -1
  49. rasa/core/channels/inspector/dist/assets/{sankeyDiagram-8f13d901-2360fe39.js → sankeyDiagram-8f13d901-1feca7e9.js} +1 -1
  50. rasa/core/channels/inspector/dist/assets/{sequenceDiagram-b655622a-41b9f9ad.js → sequenceDiagram-b655622a-070c61d2.js} +1 -1
  51. rasa/core/channels/inspector/dist/assets/{stateDiagram-59f0c015-0aad326f.js → stateDiagram-59f0c015-24f46263.js} +1 -1
  52. rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-2b26beab-9847d984.js → stateDiagram-v2-2b26beab-c9056051.js} +1 -1
  53. rasa/core/channels/inspector/dist/assets/{styles-080da4f6-564d890e.js → styles-080da4f6-08abc34a.js} +1 -1
  54. rasa/core/channels/inspector/dist/assets/{styles-3dcbcfbf-38957613.js → styles-3dcbcfbf-bc74c25a.js} +1 -1
  55. rasa/core/channels/inspector/dist/assets/{styles-9c745c82-f0fc6921.js → styles-9c745c82-4e5d66de.js} +1 -1
  56. rasa/core/channels/inspector/dist/assets/{svgDrawCommon-4835440b-ef3c5a77.js → svgDrawCommon-4835440b-849c4517.js} +1 -1
  57. rasa/core/channels/inspector/dist/assets/{timeline-definition-5b62e21b-bf3e91c1.js → timeline-definition-5b62e21b-d0fb1598.js} +1 -1
  58. rasa/core/channels/inspector/dist/assets/{xychartDiagram-2b33534f-4d4026c0.js → xychartDiagram-2b33534f-04d115e2.js} +1 -1
  59. rasa/core/channels/inspector/dist/index.html +18 -17
  60. rasa/core/channels/inspector/index.html +17 -16
  61. rasa/core/channels/inspector/package.json +5 -1
  62. rasa/core/channels/inspector/src/App.tsx +117 -67
  63. rasa/core/channels/inspector/src/components/Chat.tsx +95 -0
  64. rasa/core/channels/inspector/src/components/DiagramFlow.tsx +11 -10
  65. rasa/core/channels/inspector/src/components/DialogueStack.tsx +10 -25
  66. rasa/core/channels/inspector/src/components/LoadingSpinner.tsx +1 -1
  67. rasa/core/channels/inspector/src/helpers/formatters.test.ts +10 -0
  68. rasa/core/channels/inspector/src/helpers/formatters.ts +107 -41
  69. rasa/core/channels/inspector/src/helpers/utils.ts +92 -7
  70. rasa/core/channels/inspector/src/types.ts +21 -1
  71. rasa/core/channels/inspector/yarn.lock +94 -1
  72. rasa/core/channels/rest.py +51 -46
  73. rasa/core/channels/socketio.py +22 -0
  74. rasa/core/channels/{audiocodes.py → voice_ready/audiocodes.py} +110 -68
  75. rasa/core/channels/{voice_aware → voice_ready}/jambonz.py +11 -4
  76. rasa/core/channels/{voice_aware → voice_ready}/jambonz_protocol.py +57 -5
  77. rasa/core/channels/{twilio_voice.py → voice_ready/twilio_voice.py} +58 -7
  78. rasa/core/channels/{voice_aware → voice_ready}/utils.py +16 -0
  79. rasa/core/channels/voice_stream/asr/__init__.py +0 -0
  80. rasa/core/channels/voice_stream/asr/asr_engine.py +71 -0
  81. rasa/core/channels/voice_stream/asr/asr_event.py +13 -0
  82. rasa/core/channels/voice_stream/asr/deepgram.py +77 -0
  83. rasa/core/channels/voice_stream/audio_bytes.py +7 -0
  84. rasa/core/channels/voice_stream/tts/__init__.py +0 -0
  85. rasa/core/channels/voice_stream/tts/azure.py +100 -0
  86. rasa/core/channels/voice_stream/tts/cartesia.py +114 -0
  87. rasa/core/channels/voice_stream/tts/tts_cache.py +27 -0
  88. rasa/core/channels/voice_stream/tts/tts_engine.py +48 -0
  89. rasa/core/channels/voice_stream/twilio_media_streams.py +164 -0
  90. rasa/core/channels/voice_stream/util.py +57 -0
  91. rasa/core/channels/voice_stream/voice_channel.py +247 -0
  92. rasa/core/featurizers/single_state_featurizer.py +1 -22
  93. rasa/core/featurizers/tracker_featurizers.py +18 -115
  94. rasa/core/nlg/contextual_response_rephraser.py +11 -2
  95. rasa/{nlu → core}/persistor.py +16 -38
  96. rasa/core/policies/enterprise_search_policy.py +12 -15
  97. rasa/core/policies/flows/flow_executor.py +8 -18
  98. rasa/core/policies/intentless_policy.py +10 -15
  99. rasa/core/policies/ted_policy.py +33 -58
  100. rasa/core/policies/unexpected_intent_policy.py +7 -15
  101. rasa/core/processor.py +13 -64
  102. rasa/core/run.py +11 -1
  103. rasa/core/secrets_manager/constants.py +4 -0
  104. rasa/core/secrets_manager/factory.py +8 -0
  105. rasa/core/secrets_manager/vault.py +11 -1
  106. rasa/core/training/interactive.py +1 -1
  107. rasa/core/utils.py +1 -11
  108. rasa/dialogue_understanding/coexistence/llm_based_router.py +10 -10
  109. rasa/dialogue_understanding/commands/__init__.py +2 -0
  110. rasa/dialogue_understanding/commands/change_flow_command.py +0 -6
  111. rasa/dialogue_understanding/commands/session_end_command.py +61 -0
  112. rasa/dialogue_understanding/generator/flow_retrieval.py +0 -7
  113. rasa/dialogue_understanding/generator/llm_based_command_generator.py +12 -3
  114. rasa/dialogue_understanding/generator/llm_command_generator.py +1 -1
  115. rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +3 -28
  116. rasa/dialogue_understanding/generator/nlu_command_adapter.py +1 -19
  117. rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +4 -37
  118. rasa/e2e_test/aggregate_test_stats_calculator.py +1 -11
  119. rasa/e2e_test/assertions.py +6 -48
  120. rasa/e2e_test/e2e_test_runner.py +6 -9
  121. rasa/e2e_test/utils/e2e_yaml_utils.py +1 -1
  122. rasa/e2e_test/utils/io.py +1 -3
  123. rasa/engine/graph.py +3 -10
  124. rasa/engine/recipes/config_files/default_config.yml +0 -3
  125. rasa/engine/recipes/default_recipe.py +0 -1
  126. rasa/engine/recipes/graph_recipe.py +0 -1
  127. rasa/engine/runner/dask.py +2 -2
  128. rasa/engine/storage/local_model_storage.py +12 -42
  129. rasa/engine/storage/storage.py +1 -5
  130. rasa/engine/validation.py +1 -78
  131. rasa/keys +1 -0
  132. rasa/model_training.py +13 -16
  133. rasa/nlu/classifiers/diet_classifier.py +25 -38
  134. rasa/nlu/classifiers/logistic_regression_classifier.py +9 -22
  135. rasa/nlu/classifiers/sklearn_intent_classifier.py +16 -37
  136. rasa/nlu/extractors/crf_entity_extractor.py +50 -93
  137. rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.py +16 -45
  138. rasa/nlu/featurizers/sparse_featurizer/lexical_syntactic_featurizer.py +17 -52
  139. rasa/nlu/featurizers/sparse_featurizer/regex_featurizer.py +3 -5
  140. rasa/server.py +1 -1
  141. rasa/shared/constants.py +3 -12
  142. rasa/shared/core/constants.py +4 -0
  143. rasa/shared/core/domain.py +101 -47
  144. rasa/shared/core/events.py +29 -0
  145. rasa/shared/core/flows/flows_list.py +20 -11
  146. rasa/shared/core/flows/validation.py +25 -0
  147. rasa/shared/core/flows/yaml_flows_io.py +3 -24
  148. rasa/shared/importers/importer.py +40 -39
  149. rasa/shared/importers/multi_project.py +23 -11
  150. rasa/shared/importers/rasa.py +7 -2
  151. rasa/shared/importers/remote_importer.py +196 -0
  152. rasa/shared/importers/utils.py +3 -1
  153. rasa/shared/nlu/training_data/features.py +2 -120
  154. rasa/shared/nlu/training_data/training_data.py +18 -19
  155. rasa/shared/providers/_configs/azure_openai_client_config.py +3 -5
  156. rasa/shared/providers/embedding/_base_litellm_embedding_client.py +1 -6
  157. rasa/shared/providers/llm/_base_litellm_client.py +11 -31
  158. rasa/shared/providers/llm/self_hosted_llm_client.py +3 -15
  159. rasa/shared/utils/common.py +3 -22
  160. rasa/shared/utils/io.py +0 -1
  161. rasa/shared/utils/llm.py +30 -27
  162. rasa/shared/utils/schemas/events.py +2 -0
  163. rasa/shared/utils/schemas/model_config.yml +0 -10
  164. rasa/shared/utils/yaml.py +44 -0
  165. rasa/studio/auth.py +5 -3
  166. rasa/studio/config.py +4 -13
  167. rasa/studio/constants.py +0 -1
  168. rasa/studio/data_handler.py +3 -10
  169. rasa/studio/upload.py +8 -17
  170. rasa/tracing/instrumentation/attribute_extractors.py +1 -1
  171. rasa/utils/io.py +66 -0
  172. rasa/utils/tensorflow/model_data.py +193 -2
  173. rasa/validator.py +0 -12
  174. rasa/version.py +1 -1
  175. rasa_pro-3.11.0a1.dist-info/METADATA +576 -0
  176. {rasa_pro-3.10.16.dist-info → rasa_pro-3.11.0a1.dist-info}/RECORD +181 -164
  177. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-1844e5a5.js +0 -1
  178. rasa/core/channels/inspector/dist/assets/index-a5d3e69d.js +0 -1040
  179. rasa/utils/tensorflow/feature_array.py +0 -366
  180. rasa_pro-3.10.16.dist-info/METADATA +0 -196
  181. /rasa/core/channels/{voice_aware → voice_ready}/__init__.py +0 -0
  182. /rasa/core/channels/{voice_native → voice_stream}/__init__.py +0 -0
  183. {rasa_pro-3.10.16.dist-info → rasa_pro-3.11.0a1.dist-info}/NOTICE +0 -0
  184. {rasa_pro-3.10.16.dist-info → rasa_pro-3.11.0a1.dist-info}/WHEEL +0 -0
  185. {rasa_pro-3.10.16.dist-info → rasa_pro-3.11.0a1.dist-info}/entry_points.txt +0 -0
@@ -1,366 +0,0 @@
1
- from typing import Dict, Any, List, Tuple, Optional, Union
2
-
3
- from safetensors.numpy import save_file
4
- import numpy as np
5
- from safetensors.numpy import load_file
6
- import scipy.sparse
7
-
8
- import rasa.shared.utils.io
9
-
10
-
11
- def _recursive_serialize(
12
- array: Any, prefix: str, data_dict: Dict[str, Any], metadata: List[Dict[str, Any]]
13
- ) -> None:
14
- """Recursively serialize arrays and matrices for high dimensional data."""
15
- if isinstance(array, np.ndarray) and array.ndim <= 2:
16
- data_key = f"{prefix}_array"
17
- data_dict[data_key] = array
18
- metadata.append({"type": "dense", "key": data_key, "shape": array.shape})
19
-
20
- elif isinstance(array, list) and all([isinstance(v, float) for v in array]):
21
- data_key = f"{prefix}_list"
22
- data_dict[data_key] = np.array(array, dtype=np.float32)
23
- metadata.append({"type": "list", "key": data_key})
24
-
25
- elif isinstance(array, list) and all([isinstance(v, int) for v in array]):
26
- data_key = f"{prefix}_list"
27
- data_dict[data_key] = np.array(array, dtype=np.int64)
28
- metadata.append({"type": "list", "key": data_key})
29
-
30
- elif isinstance(array, scipy.sparse.spmatrix):
31
- data_key_data = f"{prefix}_data"
32
- data_key_row = f"{prefix}_row"
33
- data_key_col = f"{prefix}_col"
34
- array = array.tocoo()
35
- data_dict.update(
36
- {
37
- data_key_data: array.data,
38
- data_key_row: array.row,
39
- data_key_col: array.col,
40
- }
41
- )
42
- metadata.append({"type": "sparse", "key": prefix, "shape": array.shape})
43
-
44
- elif isinstance(array, list) or isinstance(array, np.ndarray):
45
- group_metadata = {"type": "group", "subcomponents": []}
46
- for idx, item in enumerate(array):
47
- new_prefix = f"{prefix}_{idx}"
48
- _recursive_serialize(
49
- item, new_prefix, data_dict, group_metadata["subcomponents"]
50
- )
51
- metadata.append(group_metadata)
52
-
53
-
54
- def _serialize_nested_data(
55
- nested_data: Dict[str, Dict[str, List["FeatureArray"]]],
56
- prefix: str,
57
- data_dict: Dict[str, np.ndarray],
58
- metadata: List[Dict[str, Union[str, List]]],
59
- ) -> None:
60
- """Handle serialization across dictionary and list levels."""
61
- for outer_key, inner_dict in nested_data.items():
62
- inner_metadata = {"key": outer_key, "components": []}
63
-
64
- for inner_key, feature_arrays in inner_dict.items():
65
- array_metadata = {
66
- "key": inner_key,
67
- "number_of_dimensions": feature_arrays[0].number_of_dimensions,
68
- "features": [],
69
- }
70
-
71
- for idx, feature_array in enumerate(feature_arrays):
72
- feature_prefix = f"{prefix}_{outer_key}_{inner_key}_{idx}"
73
- _recursive_serialize(
74
- feature_array.tolist(),
75
- feature_prefix,
76
- data_dict,
77
- array_metadata["features"],
78
- )
79
-
80
- inner_metadata["components"].append(array_metadata) # type:ignore[attr-defined]
81
-
82
- metadata.append(inner_metadata)
83
-
84
-
85
- def serialize_nested_feature_arrays(
86
- nested_feature_array: Dict[str, Dict[str, List["FeatureArray"]]],
87
- data_filename: str,
88
- metadata_filename: str,
89
- ) -> None:
90
- data_dict: Dict[str, np.ndarray] = {}
91
- metadata: List[Dict[str, Union[str, List]]] = []
92
-
93
- _serialize_nested_data(nested_feature_array, "component", data_dict, metadata)
94
-
95
- # Save serialized data and metadata
96
- save_file(data_dict, data_filename)
97
- rasa.shared.utils.io.dump_obj_as_json_to_file(metadata_filename, metadata)
98
-
99
-
100
- def _recursive_deserialize(
101
- metadata: List[Dict[str, Any]], data: Dict[str, Any]
102
- ) -> List[Any]:
103
- """Recursively deserialize arrays and matrices for high dimensional data."""
104
- result = []
105
-
106
- for item in metadata:
107
- if item["type"] == "dense":
108
- key = item["key"]
109
- array = np.asarray(data[key]).reshape(item["shape"])
110
- result.append(array)
111
-
112
- elif item["type"] == "list":
113
- key = item["key"]
114
- result.append(list(data[key]))
115
-
116
- elif item["type"] == "sparse":
117
- data_vals = data[f"{item['key']}_data"]
118
- row_vals = data[f"{item['key']}_row"]
119
- col_vals = data[f"{item['key']}_col"]
120
- sparse_matrix = scipy.sparse.coo_matrix(
121
- (data_vals, (row_vals, col_vals)), shape=item["shape"]
122
- )
123
- result.append(sparse_matrix)
124
- elif item["type"] == "group":
125
- sublist = _recursive_deserialize(item["subcomponents"], data)
126
- result.append(sublist)
127
-
128
- return result
129
-
130
-
131
- def _deserialize_nested_data(
132
- metadata: List[Dict[str, Any]], data_dict: Dict[str, Any]
133
- ) -> Dict[str, Dict[str, List["FeatureArray"]]]:
134
- """Handle deserialization across all dictionary and list levels."""
135
- result: Dict[str, Dict[str, List["FeatureArray"]]] = {}
136
-
137
- for outer_item in metadata:
138
- outer_key = outer_item["key"]
139
- result[outer_key] = {}
140
-
141
- for inner_item in outer_item["components"]:
142
- inner_key = inner_item["key"]
143
- feature_arrays = []
144
-
145
- # Reconstruct the list of FeatureArrays
146
- for feature_item in inner_item["features"]:
147
- # Reconstruct the list of FeatureArrays
148
- feature_array_data = _recursive_deserialize([feature_item], data_dict)
149
- # Prepare the input for the FeatureArray;
150
- # ensure it is np.ndarray compatible
151
- input_array = np.array(feature_array_data[0], dtype=object)
152
- feature_array = FeatureArray(
153
- input_array, inner_item["number_of_dimensions"]
154
- )
155
- feature_arrays.append(feature_array)
156
-
157
- result[outer_key][inner_key] = feature_arrays
158
-
159
- return result
160
-
161
-
162
- def deserialize_nested_feature_arrays(
163
- data_filename: str, metadata_filename: str
164
- ) -> Dict[str, Dict[str, List["FeatureArray"]]]:
165
- metadata = rasa.shared.utils.io.read_json_file(metadata_filename)
166
- data_dict = load_file(data_filename)
167
-
168
- return _deserialize_nested_data(metadata, data_dict)
169
-
170
-
171
- class FeatureArray(np.ndarray):
172
- """Stores any kind of features ready to be used by a RasaModel.
173
-
174
- Next to the input numpy array of features, it also received the number of
175
- dimensions of the features.
176
- As our features can have 1 to 4 dimensions we might have different number of numpy
177
- arrays stacked. The number of dimensions helps us to figure out how to handle this
178
- particular feature array. Also, it is automatically determined whether the feature
179
- array is sparse or not and the number of units is determined as well.
180
-
181
- Subclassing np.array: https://numpy.org/doc/stable/user/basics.subclassing.html
182
- """
183
-
184
- def __new__(
185
- cls, input_array: np.ndarray, number_of_dimensions: int
186
- ) -> "FeatureArray":
187
- """Create and return a new object. See help(type) for accurate signature."""
188
- FeatureArray._validate_number_of_dimensions(number_of_dimensions, input_array)
189
-
190
- feature_array = np.asarray(input_array).view(cls)
191
-
192
- if number_of_dimensions <= 2:
193
- feature_array.units = input_array.shape[-1]
194
- feature_array.is_sparse = isinstance(input_array[0], scipy.sparse.spmatrix)
195
- elif number_of_dimensions == 3:
196
- feature_array.units = input_array[0].shape[-1]
197
- feature_array.is_sparse = isinstance(input_array[0], scipy.sparse.spmatrix)
198
- elif number_of_dimensions == 4:
199
- feature_array.units = input_array[0][0].shape[-1]
200
- feature_array.is_sparse = isinstance(
201
- input_array[0][0], scipy.sparse.spmatrix
202
- )
203
- else:
204
- raise ValueError(
205
- f"Number of dimensions '{number_of_dimensions}' currently not "
206
- f"supported."
207
- )
208
-
209
- feature_array.number_of_dimensions = number_of_dimensions
210
-
211
- return feature_array
212
-
213
- def __init__(
214
- self, input_array: Any, number_of_dimensions: int, **kwargs: Any
215
- ) -> None:
216
- """Initialize. FeatureArray.
217
-
218
- Needed in order to avoid 'Invalid keyword argument number_of_dimensions
219
- to function FeatureArray.__init__ '
220
- Args:
221
- input_array: the array that contains features
222
- number_of_dimensions: number of dimensions in input_array
223
- """
224
- super().__init__(**kwargs)
225
- self.number_of_dimensions = number_of_dimensions
226
-
227
- def __array_finalize__(self, obj: Optional[np.ndarray]) -> None:
228
- """This method is called when the system allocates a new array from obj.
229
-
230
- Args:
231
- obj: A subclass (subtype) of ndarray.
232
- """
233
- if obj is None:
234
- return
235
-
236
- self.units = getattr(obj, "units", None)
237
- self.number_of_dimensions = getattr(obj, "number_of_dimensions", None) # type: ignore[assignment]
238
- self.is_sparse = getattr(obj, "is_sparse", None)
239
-
240
- default_attributes = {
241
- "units": self.units,
242
- "number_of_dimensions": self.number_of_dimensions,
243
- "is_spare": self.is_sparse,
244
- }
245
- self.__dict__.update(default_attributes)
246
-
247
- # pytype: disable=attribute-error
248
- def __array_ufunc__(
249
- self, ufunc: Any, method: str, *inputs: Any, **kwargs: Any
250
- ) -> Any:
251
- """Overwrite this method as we are subclassing numpy array.
252
-
253
- Args:
254
- ufunc: The ufunc object that was called.
255
- method: A string indicating which Ufunc method was called
256
- (one of "__call__", "reduce", "reduceat", "accumulate", "outer",
257
- "inner").
258
- *inputs: A tuple of the input arguments to the ufunc.
259
- **kwargs: Any additional arguments
260
-
261
- Returns:
262
- The result of the operation.
263
- """
264
- f = {
265
- "reduce": ufunc.reduce,
266
- "accumulate": ufunc.accumulate,
267
- "reduceat": ufunc.reduceat,
268
- "outer": ufunc.outer,
269
- "at": ufunc.at,
270
- "__call__": ufunc,
271
- }
272
- # convert the inputs to np.ndarray to prevent recursion, call the function,
273
- # then cast it back as FeatureArray
274
- output = FeatureArray(
275
- f[method](*(i.view(np.ndarray) for i in inputs), **kwargs),
276
- number_of_dimensions=kwargs["number_of_dimensions"],
277
- )
278
- output.__dict__ = self.__dict__ # carry forward attributes
279
- return output
280
-
281
- def __reduce__(self) -> Tuple[Any, Any, Any]:
282
- """Needed in order to pickle this object.
283
-
284
- Returns:
285
- A tuple.
286
- """
287
- pickled_state = super(FeatureArray, self).__reduce__()
288
- if isinstance(pickled_state, str):
289
- raise TypeError("np array __reduce__ returned string instead of tuple.")
290
- new_state = pickled_state[2] + (
291
- self.number_of_dimensions,
292
- self.is_sparse,
293
- self.units,
294
- )
295
- return pickled_state[0], pickled_state[1], new_state
296
-
297
- def __setstate__(self, state: Any, **kwargs: Any) -> None:
298
- """Sets the state.
299
-
300
- Args:
301
- state: The state argument must be a sequence that contains the following
302
- elements version, shape, dtype, isFortan, rawdata.
303
- **kwargs: Any additional parameter
304
- """
305
- # Needed in order to load the object
306
- self.number_of_dimensions = state[-3]
307
- self.is_sparse = state[-2]
308
- self.units = state[-1]
309
- super(FeatureArray, self).__setstate__(state[0:-3], **kwargs)
310
-
311
- # pytype: enable=attribute-error
312
-
313
- @staticmethod
314
- def _validate_number_of_dimensions(
315
- number_of_dimensions: int, input_array: np.ndarray
316
- ) -> None:
317
- """Validates if the input array has given number of dimensions.
318
-
319
- Args:
320
- number_of_dimensions: number of dimensions
321
- input_array: input array
322
-
323
- Raises: ValueError in case the dimensions do not match
324
- """
325
- # when loading the feature arrays from disk, the shape represents
326
- # the correct number of dimensions
327
- if len(input_array.shape) == number_of_dimensions:
328
- return
329
-
330
- _sub_array = input_array
331
- dim = 0
332
- # Go number_of_dimensions into the given input_array
333
- for i in range(1, number_of_dimensions + 1):
334
- _sub_array = _sub_array[0]
335
- if isinstance(_sub_array, scipy.sparse.spmatrix):
336
- dim = i
337
- break
338
- if isinstance(_sub_array, np.ndarray) and _sub_array.shape[0] == 0:
339
- # sequence dimension is 0, we are dealing with "fake" features
340
- dim = i
341
- break
342
-
343
- # If the resulting sub_array is sparse, the remaining number of dimensions
344
- # should be at least 2
345
- if isinstance(_sub_array, scipy.sparse.spmatrix):
346
- if dim > 2:
347
- raise ValueError(
348
- f"Given number of dimensions '{number_of_dimensions}' does not "
349
- f"match dimensions of given input array: {input_array}."
350
- )
351
- elif isinstance(_sub_array, np.ndarray) and _sub_array.shape[0] == 0:
352
- # sequence dimension is 0, we are dealing with "fake" features,
353
- # but they should be of dim 2
354
- if dim > 2:
355
- raise ValueError(
356
- f"Given number of dimensions '{number_of_dimensions}' does not "
357
- f"match dimensions of given input array: {input_array}."
358
- )
359
- # If the resulting sub_array is dense, the sub_array should be a single number
360
- elif not np.issubdtype(type(_sub_array), np.integer) and not isinstance(
361
- _sub_array, (np.float32, np.float64)
362
- ):
363
- raise ValueError(
364
- f"Given number of dimensions '{number_of_dimensions}' does not match "
365
- f"dimensions of given input array: {input_array}."
366
- )
@@ -1,196 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: rasa-pro
3
- Version: 3.10.16
4
- Summary: State-of-the-art open-core Conversational AI framework for Enterprises that natively leverages generative AI for effortless assistant development.
5
- Home-page: https://rasa.com
6
- Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
7
- Author: Rasa Technologies GmbH
8
- Author-email: hi@rasa.com
9
- Maintainer: Tom Bocklisch
10
- Maintainer-email: tom@rasa.com
11
- Requires-Python: >=3.9,<3.11
12
- Classifier: Development Status :: 5 - Production/Stable
13
- Classifier: Intended Audience :: Developers
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Topic :: Software Development :: Libraries
18
- Provides-Extra: full
19
- Provides-Extra: gh-release-notes
20
- Provides-Extra: jieba
21
- Provides-Extra: metal
22
- Provides-Extra: mlflow
23
- Provides-Extra: spacy
24
- Provides-Extra: transformers
25
- Requires-Dist: CacheControl (>=0.12.14,<0.13.0)
26
- Requires-Dist: PyJWT[crypto] (>=2.8.0,<3.0.0)
27
- Requires-Dist: SQLAlchemy (>=2.0.22,<2.1.0)
28
- Requires-Dist: absl-py (>=2.0,<2.1)
29
- Requires-Dist: aio-pika (>=8.2.3,<8.2.4)
30
- Requires-Dist: aiogram (>=2.15,<2.26)
31
- Requires-Dist: aiohttp (>=3.9.4,<3.10)
32
- Requires-Dist: apscheduler (>=3.10,<3.11)
33
- Requires-Dist: attrs (>=23.1,<23.2)
34
- Requires-Dist: azure-storage-blob (>=12.16.0,<12.17.0)
35
- Requires-Dist: boto3 (>=1.35.5,<1.36.0)
36
- Requires-Dist: certifi (>=2024.07.04)
37
- Requires-Dist: colorama (>=0.4.6,<0.5.0) ; sys_platform == "win32"
38
- Requires-Dist: colorclass (>=2.2,<2.3)
39
- Requires-Dist: coloredlogs (>=15,<16)
40
- Requires-Dist: colorhash (>=2.0,<2.1.0)
41
- Requires-Dist: confluent-kafka (>=2.3.0,<3.0.0)
42
- Requires-Dist: cryptography (>=42.0.5)
43
- Requires-Dist: cvg-python-sdk (>=0.5.1,<0.6.0)
44
- Requires-Dist: dask (==2022.10.2) ; python_version >= "3.9" and python_version < "3.11"
45
- Requires-Dist: diskcache (>=5.6.3,<5.7.0)
46
- Requires-Dist: dnspython (==2.6.1)
47
- Requires-Dist: faiss-cpu (>=1.7.4,<2.0.0)
48
- Requires-Dist: faker (>=26.0.0,<27.0.0)
49
- Requires-Dist: fbmessenger (>=6.0.0,<6.1.0)
50
- Requires-Dist: github3.py (>=3.2.0,<3.3.0) ; extra == "gh-release-notes"
51
- Requires-Dist: gitpython (>=3.1.41,<3.2.0) ; extra == "full"
52
- Requires-Dist: google-auth (>=2.23.4,<3)
53
- Requires-Dist: google-cloud-storage (>=2.14.0,<3.0.0)
54
- Requires-Dist: hvac (>=1.2.1,<2.0.0)
55
- Requires-Dist: importlib-metadata (>=8.5.0,<8.6.0)
56
- Requires-Dist: importlib-resources (==6.1.3)
57
- Requires-Dist: jieba (>=0.42.1,<0.43) ; extra == "jieba" or extra == "full"
58
- Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
59
- Requires-Dist: jsonpatch (>=1.33,<2.0)
60
- Requires-Dist: jsonpickle (>=3.3.0,<3.4)
61
- Requires-Dist: jsonschema (>=4.22)
62
- Requires-Dist: keras (==2.14.0)
63
- Requires-Dist: langchain (>=0.2.0,<0.3.0)
64
- Requires-Dist: langchain-community (>=0.2.0,<0.3.0)
65
- Requires-Dist: litellm (>=1.52.6,<1.53.0)
66
- Requires-Dist: matplotlib (>=3.7,<3.8)
67
- Requires-Dist: mattermostwrapper (>=2.2,<2.3)
68
- Requires-Dist: mlflow (>=2.15.1,<3.0.0) ; extra == "mlflow"
69
- Requires-Dist: networkx (>=3.1,<3.2)
70
- Requires-Dist: numpy (>=1.23.5,<1.25.0) ; python_version >= "3.9" and python_version < "3.11"
71
- Requires-Dist: openai (>=1.55.3,<1.56.0)
72
- Requires-Dist: openpyxl (>=3.1.5,<4.0.0)
73
- Requires-Dist: opentelemetry-api (>=1.16.0,<1.17.0)
74
- Requires-Dist: opentelemetry-exporter-jaeger (>=1.16.0,<1.17.0)
75
- Requires-Dist: opentelemetry-exporter-otlp (>=1.16.0,<1.17.0)
76
- Requires-Dist: opentelemetry-sdk (>=1.16.0,<1.17.0)
77
- Requires-Dist: packaging (>=23.2,<23.3)
78
- Requires-Dist: pep440-version-utils (>=1.1.0,<1.2.0)
79
- Requires-Dist: pluggy (>=1.2.0,<2.0.0)
80
- Requires-Dist: portalocker (>=2.7.0,<3.0.0)
81
- Requires-Dist: presidio-analyzer (>=2.2.33,<2.2.34)
82
- Requires-Dist: presidio-anonymizer (>=2.2.354,<3.0.0)
83
- Requires-Dist: prompt-toolkit (>=3.0.28,<3.0.29)
84
- Requires-Dist: protobuf (>=4.23.3,<4.25.4)
85
- Requires-Dist: psutil (>=5.9.5,<6.0.0)
86
- Requires-Dist: psycopg2-binary (>=2.9.9,<2.10.0)
87
- Requires-Dist: pycountry (>=22.3.5,<23.0.0)
88
- Requires-Dist: pydantic (>=2.0,<3.0)
89
- Requires-Dist: pydot (>=1.4,<1.5)
90
- Requires-Dist: pykwalify (>=1.8,<1.9)
91
- Requires-Dist: pymilvus (>=2.4.0,<2.4.2)
92
- Requires-Dist: pymongo[srv,tls] (>=4.6.3,<4.7)
93
- Requires-Dist: pypred (>=0.4.0,<0.5.0)
94
- Requires-Dist: python-dateutil (>=2.8.2,<2.9.0)
95
- Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
96
- Requires-Dist: python-engineio (>=4.5.1,<6,!=5.0.0)
97
- Requires-Dist: python-keycloak (>=3.12.0,<4.0.0)
98
- Requires-Dist: python-socketio (>=5.8,<6)
99
- Requires-Dist: pytz (>=2022.7.1,<2023.0)
100
- Requires-Dist: pyyaml (>=6.0)
101
- Requires-Dist: qdrant-client (>=1.9.0,<2.0.0)
102
- Requires-Dist: questionary (>=1.10.0,<2.1.0)
103
- Requires-Dist: randomname (>=0.2.1,<0.3.0)
104
- Requires-Dist: rasa-sdk (>=3.10.0,<3.11.0)
105
- Requires-Dist: redis (>=4.6.0,<6.0)
106
- Requires-Dist: regex (>=2022.10.31,<2022.11)
107
- Requires-Dist: requests (>=2.31.0,<2.32.0)
108
- Requires-Dist: rich (>=13.4.2,<14.0.0)
109
- Requires-Dist: rocketchat_API (>=1.30.0,<1.31.0)
110
- Requires-Dist: ruamel.yaml (>=0.17.21,<0.17.22)
111
- Requires-Dist: safetensors (>=0.4.5,<0.5.0)
112
- Requires-Dist: sanic (>=22.12,<22.13)
113
- Requires-Dist: sanic-cors (>=2.2.0,<2.3.0)
114
- Requires-Dist: sanic-jwt (>=1.8.0,<2.0.0)
115
- Requires-Dist: sanic-routing (>=22.8.0,<23.0.0)
116
- Requires-Dist: scikit-learn (>=1.1.3,<1.2) ; python_version >= "3.9" and python_version < "3.11"
117
- Requires-Dist: scipy (>=1.10.1,<1.11.0) ; python_version >= "3.9" and python_version < "3.11"
118
- Requires-Dist: sentencepiece[sentencepiece] (>=0.1.99,<0.2.0) ; extra == "transformers" or extra == "full"
119
- Requires-Dist: sentry-sdk (>=1.14.0,<1.15.0)
120
- Requires-Dist: setuptools (>=70.0.0,<70.1.0)
121
- Requires-Dist: sklearn-crfsuite (>=0.3.6,<0.4.0)
122
- Requires-Dist: skops (>=0.10.0,<0.11.0)
123
- Requires-Dist: slack-sdk (>=3.27.1,<4.0.0)
124
- Requires-Dist: spacy (>=3.5.4,<4.0.0) ; extra == "spacy" or extra == "full"
125
- Requires-Dist: structlog (>=23.1.0,<23.2.0)
126
- Requires-Dist: structlog-sentry (>=2.0.3,<3.0.0)
127
- Requires-Dist: tarsafe (>=0.0.5,<0.0.6)
128
- Requires-Dist: tenacity (>=8.4.1,<8.5.0)
129
- Requires-Dist: tensorflow (==2.14.1) ; sys_platform != "darwin" or platform_machine != "arm64"
130
- Requires-Dist: tensorflow-cpu-aws (==2.14.1) ; sys_platform == "linux" and (platform_machine == "arm64" or platform_machine == "aarch64")
131
- Requires-Dist: tensorflow-intel (==2.14.1) ; sys_platform == "win32"
132
- Requires-Dist: tensorflow-io-gcs-filesystem (==0.31) ; sys_platform == "win32"
133
- Requires-Dist: tensorflow-io-gcs-filesystem (==0.34) ; sys_platform == "darwin" and platform_machine != "arm64"
134
- Requires-Dist: tensorflow-io-gcs-filesystem (==0.34) ; sys_platform == "linux"
135
- Requires-Dist: tensorflow-macos (==2.14.1) ; sys_platform == "darwin" and platform_machine == "arm64"
136
- Requires-Dist: tensorflow-metal (==1.1.0) ; (sys_platform == "darwin" and platform_machine == "arm64") and (extra == "metal")
137
- Requires-Dist: tensorflow-text (==2.14.0) ; sys_platform != "win32" and (platform_machine != "arm64" and platform_machine != "aarch64")
138
- Requires-Dist: tensorflow_hub (>=0.13.0,<0.14.0)
139
- Requires-Dist: terminaltables (>=3.1.10,<3.2.0)
140
- Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
141
- Requires-Dist: tqdm (>=4.66.2,<5.0.0)
142
- Requires-Dist: transformers (>=4.36.2,<4.37.0) ; extra == "transformers" or extra == "full"
143
- Requires-Dist: twilio (>=8.4,<8.5)
144
- Requires-Dist: types-protobuf (==4.25.0.20240417)
145
- Requires-Dist: typing-extensions (>=4.7.1,<5.0.0)
146
- Requires-Dist: typing-utils (>=0.1.0,<0.2.0)
147
- Requires-Dist: ujson (>=5.8,<6.0)
148
- Requires-Dist: webexteamssdk (>=1.6.1,<1.7.0)
149
- Requires-Dist: websockets (>=10.4,<11.0)
150
- Requires-Dist: wheel (>=0.40.0)
151
- Project-URL: Documentation, https://rasa.com/docs
152
- Project-URL: Repository, https://github.com/rasahq/rasa
153
- Description-Content-Type: text/markdown
154
-
155
- <h1 align="center">Rasa Pro</h1>
156
-
157
- <div align="center">
158
-
159
- [![Build Status](https://github.com/RasaHQ/rasa-private/workflows/Continuous%20Integration/badge.svg)](https://github.com/RasaHQ/rasa-private/actions)
160
- [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=RasaHQ_rasa&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=RasaHQ_rasa)
161
- [![Documentation Status](https://img.shields.io/badge/docs-stable-brightgreen.svg)](https://rasa.com/docs/rasa-pro/)
162
-
163
- </div>
164
-
165
- <hr />
166
-
167
-
168
- Rasa Pro is a framework for building scalable, dynamic conversational AI assistants that integrate large language models (LLMs) to enable more contextually aware and agentic interactions. Whether you’re new to conversational AI or an experienced developer, Rasa Pro offers enhanced flexibility, control, and performance for mission-critical applications.
169
-
170
- Building on the foundation of Rasa Open Source, Rasa Pro adds advanced features like CALM (Conversational AI with Language Models) and Dialogue Understanding (DU), which enable developers to shift from traditional intent-driven systems to LLM-based agents. This allows for more robust, responsive interactions that adhere strictly to business logic, while reducing risks like prompt injection and minimizing hallucinations.
171
-
172
- **Key Features:**
173
-
174
- - **Flows for Business Logic:** Easily define business logic through Flows, a simplified way to describe how your AI assistant should handle conversations. Flows help streamline the development process, focusing on key tasks and reducing the complexity involved in managing conversations.
175
- - **Automatic Conversation Repair:** Ensure seamless interactions by automatically handling interruptions or unexpected inputs. Developers have full control to customize these repairs based on specific use cases.
176
- - **Customizable and Open:** Fully customizable code that allows developers to modify Rasa Pro to meet specific requirements, ensuring flexibility and adaptability to various conversational AI needs.
177
- - **Robustness and Control:** Maintain strict adherence to business logic, preventing unwanted behaviors like prompt injection and hallucinations, leading to more reliable responses and secure interactions.
178
- - **Built-in Security:** Safeguard sensitive data, control access, and ensure secure deployment, essential for production environments that demand high levels of security and compliance.
179
-
180
-
181
-
182
- A [free developer license](https://rasa.com/docs/rasa-pro/developer-edition/) is available so you can explore and get to know Rasa Pro. For small production deployments, the Extended Developer License allows you to take your assistant live in a limited capacity. A paid license is required for larger-scale production use, but all code is visible and can be customized as needed.
183
-
184
- To get started right now, you can
185
-
186
- `pip install rasa-pro`
187
-
188
- Check out our
189
-
190
- - [Rasa-pro Quickstart](https://rasa.com/docs/rasa-pro/installation/quickstart/),
191
- - [Conversational AI with Language Models (CALM) conceptual rundown](https://rasa.com/docs/rasa-pro/calm/),
192
- - [Rasa Pro / CALM tutorial](https://rasa.com/docs/rasa-pro/tutorial), and
193
- - [Rasa pro changelog](https://rasa.com/docs/rasa/rasa-pro-changelog/)
194
-
195
- for more. Also feel free to reach out to us on the [Rasa forum](https://forum.rasa.com/).
196
-