rasa-pro 3.9.18__py3-none-any.whl → 3.10.16__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 (183) hide show
  1. README.md +0 -374
  2. rasa/__init__.py +1 -2
  3. rasa/__main__.py +5 -0
  4. rasa/anonymization/anonymization_rule_executor.py +2 -2
  5. rasa/api.py +27 -23
  6. rasa/cli/arguments/data.py +27 -2
  7. rasa/cli/arguments/default_arguments.py +25 -3
  8. rasa/cli/arguments/run.py +9 -9
  9. rasa/cli/arguments/train.py +11 -3
  10. rasa/cli/data.py +70 -8
  11. rasa/cli/e2e_test.py +104 -431
  12. rasa/cli/evaluate.py +1 -1
  13. rasa/cli/interactive.py +1 -0
  14. rasa/cli/llm_fine_tuning.py +398 -0
  15. rasa/cli/project_templates/calm/endpoints.yml +1 -1
  16. rasa/cli/project_templates/tutorial/endpoints.yml +1 -1
  17. rasa/cli/run.py +15 -14
  18. rasa/cli/scaffold.py +10 -8
  19. rasa/cli/studio/studio.py +35 -5
  20. rasa/cli/train.py +56 -8
  21. rasa/cli/utils.py +22 -5
  22. rasa/cli/x.py +1 -1
  23. rasa/constants.py +7 -1
  24. rasa/core/actions/action.py +98 -49
  25. rasa/core/actions/action_run_slot_rejections.py +4 -1
  26. rasa/core/actions/custom_action_executor.py +9 -6
  27. rasa/core/actions/direct_custom_actions_executor.py +80 -0
  28. rasa/core/actions/e2e_stub_custom_action_executor.py +68 -0
  29. rasa/core/actions/grpc_custom_action_executor.py +2 -2
  30. rasa/core/actions/http_custom_action_executor.py +6 -5
  31. rasa/core/agent.py +21 -17
  32. rasa/core/channels/__init__.py +2 -0
  33. rasa/core/channels/audiocodes.py +1 -16
  34. rasa/core/channels/voice_aware/__init__.py +0 -0
  35. rasa/core/channels/voice_aware/jambonz.py +103 -0
  36. rasa/core/channels/voice_aware/jambonz_protocol.py +344 -0
  37. rasa/core/channels/voice_aware/utils.py +20 -0
  38. rasa/core/channels/voice_native/__init__.py +0 -0
  39. rasa/core/constants.py +6 -1
  40. rasa/core/information_retrieval/faiss.py +7 -4
  41. rasa/core/information_retrieval/information_retrieval.py +8 -0
  42. rasa/core/information_retrieval/milvus.py +9 -2
  43. rasa/core/information_retrieval/qdrant.py +1 -1
  44. rasa/core/nlg/contextual_response_rephraser.py +32 -10
  45. rasa/core/nlg/summarize.py +4 -3
  46. rasa/core/policies/enterprise_search_policy.py +113 -45
  47. rasa/core/policies/flows/flow_executor.py +122 -76
  48. rasa/core/policies/intentless_policy.py +83 -29
  49. rasa/core/processor.py +72 -54
  50. rasa/core/run.py +5 -4
  51. rasa/core/tracker_store.py +8 -4
  52. rasa/core/training/interactive.py +1 -1
  53. rasa/core/utils.py +56 -57
  54. rasa/dialogue_understanding/coexistence/llm_based_router.py +53 -13
  55. rasa/dialogue_understanding/commands/__init__.py +6 -0
  56. rasa/dialogue_understanding/commands/restart_command.py +58 -0
  57. rasa/dialogue_understanding/commands/session_start_command.py +59 -0
  58. rasa/dialogue_understanding/commands/utils.py +40 -0
  59. rasa/dialogue_understanding/generator/constants.py +10 -3
  60. rasa/dialogue_understanding/generator/flow_retrieval.py +21 -5
  61. rasa/dialogue_understanding/generator/llm_based_command_generator.py +13 -3
  62. rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +134 -90
  63. rasa/dialogue_understanding/generator/nlu_command_adapter.py +47 -7
  64. rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +127 -41
  65. rasa/dialogue_understanding/patterns/restart.py +37 -0
  66. rasa/dialogue_understanding/patterns/session_start.py +37 -0
  67. rasa/dialogue_understanding/processor/command_processor.py +16 -3
  68. rasa/dialogue_understanding/processor/command_processor_component.py +6 -2
  69. rasa/e2e_test/aggregate_test_stats_calculator.py +134 -0
  70. rasa/e2e_test/assertions.py +1223 -0
  71. rasa/e2e_test/assertions_schema.yml +106 -0
  72. rasa/e2e_test/constants.py +20 -0
  73. rasa/e2e_test/e2e_config.py +220 -0
  74. rasa/e2e_test/e2e_config_schema.yml +26 -0
  75. rasa/e2e_test/e2e_test_case.py +131 -8
  76. rasa/e2e_test/e2e_test_converter.py +363 -0
  77. rasa/e2e_test/e2e_test_converter_prompt.jinja2 +70 -0
  78. rasa/e2e_test/e2e_test_coverage_report.py +364 -0
  79. rasa/e2e_test/e2e_test_result.py +26 -6
  80. rasa/e2e_test/e2e_test_runner.py +493 -71
  81. rasa/e2e_test/e2e_test_schema.yml +96 -0
  82. rasa/e2e_test/pykwalify_extensions.py +39 -0
  83. rasa/e2e_test/stub_custom_action.py +70 -0
  84. rasa/e2e_test/utils/__init__.py +0 -0
  85. rasa/e2e_test/utils/e2e_yaml_utils.py +55 -0
  86. rasa/e2e_test/utils/io.py +598 -0
  87. rasa/e2e_test/utils/validation.py +80 -0
  88. rasa/engine/graph.py +9 -3
  89. rasa/engine/recipes/default_components.py +0 -2
  90. rasa/engine/recipes/default_recipe.py +10 -2
  91. rasa/engine/storage/local_model_storage.py +40 -12
  92. rasa/engine/validation.py +78 -1
  93. rasa/env.py +9 -0
  94. rasa/graph_components/providers/story_graph_provider.py +59 -6
  95. rasa/llm_fine_tuning/__init__.py +0 -0
  96. rasa/llm_fine_tuning/annotation_module.py +241 -0
  97. rasa/llm_fine_tuning/conversations.py +144 -0
  98. rasa/llm_fine_tuning/llm_data_preparation_module.py +178 -0
  99. rasa/llm_fine_tuning/notebooks/unsloth_finetuning.ipynb +407 -0
  100. rasa/llm_fine_tuning/paraphrasing/__init__.py +0 -0
  101. rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +281 -0
  102. rasa/llm_fine_tuning/paraphrasing/default_rephrase_prompt_template.jina2 +44 -0
  103. rasa/llm_fine_tuning/paraphrasing/rephrase_validator.py +121 -0
  104. rasa/llm_fine_tuning/paraphrasing/rephrased_user_message.py +10 -0
  105. rasa/llm_fine_tuning/paraphrasing_module.py +128 -0
  106. rasa/llm_fine_tuning/storage.py +174 -0
  107. rasa/llm_fine_tuning/train_test_split_module.py +441 -0
  108. rasa/model_training.py +56 -16
  109. rasa/nlu/persistor.py +157 -36
  110. rasa/server.py +45 -10
  111. rasa/shared/constants.py +76 -16
  112. rasa/shared/core/domain.py +27 -19
  113. rasa/shared/core/events.py +28 -2
  114. rasa/shared/core/flows/flow.py +208 -13
  115. rasa/shared/core/flows/flow_path.py +84 -0
  116. rasa/shared/core/flows/flows_list.py +33 -11
  117. rasa/shared/core/flows/flows_yaml_schema.json +269 -193
  118. rasa/shared/core/flows/validation.py +112 -25
  119. rasa/shared/core/flows/yaml_flows_io.py +149 -10
  120. rasa/shared/core/trackers.py +6 -0
  121. rasa/shared/core/training_data/structures.py +20 -0
  122. rasa/shared/core/training_data/visualization.html +2 -2
  123. rasa/shared/exceptions.py +4 -0
  124. rasa/shared/importers/importer.py +64 -16
  125. rasa/shared/nlu/constants.py +2 -0
  126. rasa/shared/providers/_configs/__init__.py +0 -0
  127. rasa/shared/providers/_configs/azure_openai_client_config.py +183 -0
  128. rasa/shared/providers/_configs/client_config.py +57 -0
  129. rasa/shared/providers/_configs/default_litellm_client_config.py +130 -0
  130. rasa/shared/providers/_configs/huggingface_local_embedding_client_config.py +234 -0
  131. rasa/shared/providers/_configs/openai_client_config.py +175 -0
  132. rasa/shared/providers/_configs/self_hosted_llm_client_config.py +176 -0
  133. rasa/shared/providers/_configs/utils.py +101 -0
  134. rasa/shared/providers/_ssl_verification_utils.py +124 -0
  135. rasa/shared/providers/embedding/__init__.py +0 -0
  136. rasa/shared/providers/embedding/_base_litellm_embedding_client.py +259 -0
  137. rasa/shared/providers/embedding/_langchain_embedding_client_adapter.py +74 -0
  138. rasa/shared/providers/embedding/azure_openai_embedding_client.py +277 -0
  139. rasa/shared/providers/embedding/default_litellm_embedding_client.py +102 -0
  140. rasa/shared/providers/embedding/embedding_client.py +90 -0
  141. rasa/shared/providers/embedding/embedding_response.py +41 -0
  142. rasa/shared/providers/embedding/huggingface_local_embedding_client.py +191 -0
  143. rasa/shared/providers/embedding/openai_embedding_client.py +172 -0
  144. rasa/shared/providers/llm/__init__.py +0 -0
  145. rasa/shared/providers/llm/_base_litellm_client.py +251 -0
  146. rasa/shared/providers/llm/azure_openai_llm_client.py +338 -0
  147. rasa/shared/providers/llm/default_litellm_llm_client.py +84 -0
  148. rasa/shared/providers/llm/llm_client.py +76 -0
  149. rasa/shared/providers/llm/llm_response.py +50 -0
  150. rasa/shared/providers/llm/openai_llm_client.py +155 -0
  151. rasa/shared/providers/llm/self_hosted_llm_client.py +293 -0
  152. rasa/shared/providers/mappings.py +75 -0
  153. rasa/shared/utils/cli.py +30 -0
  154. rasa/shared/utils/io.py +65 -2
  155. rasa/shared/utils/llm.py +246 -200
  156. rasa/shared/utils/yaml.py +121 -15
  157. rasa/studio/auth.py +6 -4
  158. rasa/studio/config.py +13 -4
  159. rasa/studio/constants.py +1 -0
  160. rasa/studio/data_handler.py +10 -3
  161. rasa/studio/download.py +19 -13
  162. rasa/studio/train.py +2 -3
  163. rasa/studio/upload.py +19 -11
  164. rasa/telemetry.py +113 -58
  165. rasa/tracing/instrumentation/attribute_extractors.py +32 -17
  166. rasa/utils/common.py +18 -19
  167. rasa/utils/endpoints.py +7 -4
  168. rasa/utils/json_utils.py +60 -0
  169. rasa/utils/licensing.py +9 -1
  170. rasa/utils/ml_utils.py +4 -2
  171. rasa/validator.py +213 -3
  172. rasa/version.py +1 -1
  173. rasa_pro-3.10.16.dist-info/METADATA +196 -0
  174. {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/RECORD +179 -113
  175. rasa/nlu/classifiers/llm_intent_classifier.py +0 -519
  176. rasa/shared/providers/openai/clients.py +0 -43
  177. rasa/shared/providers/openai/session_handler.py +0 -110
  178. rasa_pro-3.9.18.dist-info/METADATA +0 -563
  179. /rasa/{shared/providers/openai → cli/project_templates/tutorial/actions}/__init__.py +0 -0
  180. /rasa/cli/project_templates/tutorial/{actions.py → actions/actions.py} +0 -0
  181. {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/NOTICE +0 -0
  182. {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/WHEEL +0 -0
  183. {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/entry_points.txt +0 -0
@@ -1,217 +1,293 @@
1
1
  {
2
- "type": "object",
3
- "required": ["flows"],
4
- "properties": {
5
- "version": {
6
- "type": "string"
7
- },
8
- "flows": {
9
- "type": "object",
10
- "schema_name": "dictionary of flows",
11
- "patternProperties": {
12
- "^[A-Za-z_][A-Za-z0-9_]*$": {
13
- "$ref": "#/$defs/flow"
14
- }
15
- }
16
- }
17
- },
18
- "$defs": {
19
- "nlu_trigger": {
20
- "type": "array",
21
- "schema_name": "list of nlu triggers",
22
- "minItems": 1,
23
- "items": {
24
- "type": "object",
25
- "oneOf": [
26
- {
27
- "schema_name": "intent trigger",
2
+ "type": "object",
3
+ "required": [
4
+ "flows"
5
+ ],
6
+ "properties": {
7
+ "version": {
8
+ "type": "string"
9
+ },
10
+ "flows": {
28
11
  "type": "object",
29
- "required": ["intent"],
30
- "additionalProperties": false,
31
- "properties": {
32
- "intent": {
12
+ "schema_name": "dictionary of flows",
13
+ "patternProperties": {
14
+ "^[A-Za-z_][A-Za-z0-9_]*$": {
15
+ "$ref": "#/$defs/flow"
16
+ }
17
+ }
18
+ }
19
+ },
20
+ "$defs": {
21
+ "nlu_trigger": {
22
+ "type": "array",
23
+ "schema_name": "list of nlu triggers",
24
+ "minItems": 1,
25
+ "items": {
26
+ "type": "object",
27
+ "oneOf": [
28
+ {
29
+ "schema_name": "intent trigger",
30
+ "type": "object",
31
+ "required": [
32
+ "intent"
33
+ ],
34
+ "additionalProperties": false,
35
+ "properties": {
36
+ "intent": {
37
+ "type": "object",
38
+ "properties": {
39
+ "confidence_threshold": {
40
+ "type": "number"
41
+ },
42
+ "name": {
43
+ "type": "string"
44
+ }
45
+ },
46
+ "required": [
47
+ "name"
48
+ ]
49
+ }
50
+ }
51
+ },
52
+ {
53
+ "schema_name": "simple intent trigger",
54
+ "properties": {
55
+ "intent": {
56
+ "type": "string"
57
+ }
58
+ }
59
+ }
60
+ ]
61
+ }
62
+ },
63
+ "steps": {
64
+ "type": "array",
65
+ "schema_name": "list of steps",
66
+ "items": {
33
67
  "type": "object",
34
68
  "properties": {
35
- "confidence_threshold": {
36
- "type": "number"
37
- },
38
- "name": {
39
- "type": "string"
40
- }
69
+ "id": {
70
+ "type": "string"
71
+ },
72
+ "next": {
73
+ "anyOf": [
74
+ {
75
+ "schema_name": "list of conditions",
76
+ "type": "array",
77
+ "items": {
78
+ "type": "object",
79
+ "oneOf": [
80
+ {
81
+ "schema_name": "if-then block",
82
+ "required": [
83
+ "if",
84
+ "then"
85
+ ]
86
+ },
87
+ {
88
+ "schema_name": "else block",
89
+ "required": [
90
+ "else"
91
+ ]
92
+ }
93
+ ],
94
+ "properties": {
95
+ "else": {
96
+ "oneOf": [
97
+ {
98
+ "type": "string",
99
+ "schema_name": "step id"
100
+ },
101
+ {
102
+ "$ref": "#/$defs/steps",
103
+ "schema_name": "list of steps"
104
+ }
105
+ ]
106
+ },
107
+ "if": {
108
+ "type": [
109
+ "boolean",
110
+ "string"
111
+ ]
112
+ },
113
+ "then": {
114
+ "oneOf": [
115
+ {
116
+ "$ref": "#/$defs/steps",
117
+ "schema_name": "list of steps"
118
+ },
119
+ {
120
+ "type": "string",
121
+ "schema_name": "step id"
122
+ }
123
+ ]
124
+ }
125
+ }
126
+ }
127
+ },
128
+ {
129
+ "type": "string",
130
+ "schema_name": "step id"
131
+ }
132
+ ]
133
+ },
134
+ "action": {
135
+ "type": "string"
136
+ },
137
+ "collect": {
138
+ "type": "string"
139
+ },
140
+ "link": {
141
+ "type": "string"
142
+ },
143
+ "call": {
144
+ "type": "string"
145
+ },
146
+ "set_slots": {
147
+ "$ref": "#/$defs/set_slots",
148
+ "schema_name": "slot set"
149
+ }
41
150
  },
42
- "required": ["name"]
43
- }
44
- }
45
- },
46
- {
47
- "schema_name": "simple intent trigger",
48
- "properties": {
49
- "intent": {
50
- "type": "string"
51
- }
52
- }
53
- }
54
- ]
55
- }
56
- },
57
- "steps": {
58
- "type": "array",
59
- "schema_name": "list of steps",
60
- "items": {
61
- "type": "object",
62
- "properties": {
63
- "id": { "type": "string" },
64
- "next": {
65
- "anyOf": [
66
- {
67
- "schema_name": "list of conditions",
68
- "type": "array",
69
- "items": {
70
- "type": "object",
71
- "oneOf": [
151
+ "oneOf": [
72
152
  {
73
- "schema_name": "if-then block",
74
- "required": ["if", "then"]
153
+ "required": [
154
+ "action"
155
+ ],
156
+ "schema_name": "action step"
75
157
  },
76
158
  {
77
- "schema_name": "else block",
78
- "required": ["else"]
159
+ "required": [
160
+ "collect"
161
+ ],
162
+ "schema_name": "collect step"
163
+ },
164
+ {
165
+ "required": [
166
+ "link"
167
+ ],
168
+ "schema_name": "link step"
169
+ },
170
+ {
171
+ "required": [
172
+ "call"
173
+ ],
174
+ "schema_name": "call step"
175
+ },
176
+ {
177
+ "required": [
178
+ "set_slots"
179
+ ],
180
+ "schema_name": "slot set step"
181
+ },
182
+ {
183
+ "required": [
184
+ "noop"
185
+ ],
186
+ "schema_name": ""
79
187
  }
80
- ],
81
- "properties": {
82
- "else": {
83
- "oneOf": [
84
- {
85
- "type": "string",
86
- "schema_name": "step id"
87
- },
88
- {
89
- "$ref": "#/$defs/steps",
90
- "schema_name": "list of steps"
188
+ ],
189
+ "dependentSchemas": {
190
+ "action": {
191
+ "additionalProperties": false,
192
+ "properties": {
193
+ "id": {},
194
+ "next": {},
195
+ "action": {},
196
+ "metadata": {}
91
197
  }
92
- ]
93
198
  },
94
- "if": {
95
- "type": ["boolean", "string"]
199
+ "noop": {
200
+ "required": [
201
+ "next"
202
+ ]
96
203
  },
97
- "then": {
98
- "oneOf": [
99
- {
100
- "$ref": "#/$defs/steps",
101
- "schema_name": "list of steps"
102
- },
103
- {
104
- "type": "string",
105
- "schema_name": "step id"
204
+ "collect": {
205
+ "additionalProperties": false,
206
+ "properties": {
207
+ "collect": {},
208
+ "id": {},
209
+ "next": {},
210
+ "metadata": {},
211
+ "description": {
212
+ "type": "string"
213
+ },
214
+ "ask_before_filling": {
215
+ "type": "boolean"
216
+ },
217
+ "reset_after_flow_ends": {
218
+ "type": "boolean"
219
+ },
220
+ "utter": {
221
+ "type": "string"
222
+ },
223
+ "rejections": {
224
+ "type": "array",
225
+ "schema_name": "list of rejections",
226
+ "items": {
227
+ "type": "object",
228
+ "required": [
229
+ "if",
230
+ "utter"
231
+ ],
232
+ "properties": {
233
+ "if": {
234
+ "type": [
235
+ "boolean",
236
+ "string"
237
+ ]
238
+ },
239
+ "utter": {
240
+ "type": "string"
241
+ }
242
+ }
243
+ }
244
+ }
106
245
  }
107
- ]
108
246
  }
109
- }
110
247
  }
111
- },
112
- {
113
- "type": "string",
114
- "schema_name": "step id"
115
- }
116
- ]
117
- },
118
- "action": { "type": "string" },
119
- "collect": { "type": "string" },
120
- "link": { "type": "string" },
121
- "call": { "type": "string" },
122
- "set_slots": { "$ref": "#/$defs/set_slots", "schema_name": "slot set" }
123
- },
124
- "oneOf": [
125
- { "required": ["action"], "schema_name": "action step" },
126
- { "required": ["collect"], "schema_name": "collect step" },
127
- { "required": ["link"], "schema_name": "link step" },
128
- { "required": ["call"], "schema_name": "call step" },
129
- { "required": ["set_slots"], "schema_name": "slot set step" },
130
- { "required": ["noop"], "schema_name": "" }
131
- ],
132
- "dependentSchemas": {
133
- "action": {
134
- "additionalProperties": false,
135
- "properties": {
136
- "id": {},
137
- "next": {},
138
- "action": {}
139
248
  }
140
- },
141
- "noop": {
142
- "required": ["next"]
143
- },
144
- "collect": {
249
+ },
250
+ "flow": {
251
+ "required": [
252
+ "steps",
253
+ "description"
254
+ ],
255
+ "type": "object",
145
256
  "additionalProperties": false,
257
+ "schema_name": "dictionary with flow properties",
146
258
  "properties": {
147
- "collect": {},
148
- "id": {},
149
- "next": {},
150
- "description": {
151
- "type": "string"
152
- },
153
- "ask_before_filling": {
154
- "type": "boolean"
155
- },
156
- "reset_after_flow_ends": {
157
- "type": "boolean"
158
- },
159
- "utter": {
160
- "type": "string"
161
- },
162
- "rejections": {
163
- "type": "array",
164
- "schema_name": "list of rejections",
165
- "items": {
166
- "type": "object",
167
- "required": ["if", "utter"],
168
- "properties": {
169
- "if": {
170
- "type": ["boolean", "string"]
171
- },
172
- "utter": {
173
- "type": "string"
174
- }
175
- }
259
+ "description": {
260
+ "type": "string"
261
+ },
262
+ "if": {
263
+ "type": [
264
+ "string",
265
+ "boolean"
266
+ ]
267
+ },
268
+ "always_include_in_prompt": {
269
+ "type": "boolean"
270
+ },
271
+ "name": {
272
+ "type": "string"
273
+ },
274
+ "nlu_trigger": {
275
+ "$ref": "#/$defs/nlu_trigger"
276
+ },
277
+ "file_path": {
278
+ "type": "string"
279
+ },
280
+ "steps": {
281
+ "$ref": "#/$defs/steps"
176
282
  }
177
- }
178
283
  }
179
- }
180
- }
181
- }
182
- },
183
- "flow": {
184
- "required": ["steps", "description"],
185
- "type": "object",
186
- "additionalProperties": false,
187
- "schema_name": "dictionary with flow properties",
188
- "properties": {
189
- "description": {
190
- "type": "string"
191
284
  },
192
- "if": {
193
- "type": ["string", "boolean"]
194
- },
195
- "always_include_in_prompt": {
196
- "type": "boolean"
197
- },
198
- "name": {
199
- "type": "string"
200
- },
201
- "nlu_trigger": {
202
- "$ref": "#/$defs/nlu_trigger"
203
- },
204
- "steps": {
205
- "$ref": "#/$defs/steps"
285
+ "set_slots": {
286
+ "type": "array",
287
+ "schema_name": "list of slot sets",
288
+ "items": {
289
+ "type": "object"
290
+ }
206
291
  }
207
- }
208
- },
209
- "set_slots": {
210
- "type": "array",
211
- "schema_name": "list of slot sets",
212
- "items": {
213
- "type": "object"
214
- }
215
292
  }
216
- }
217
293
  }