rasa-pro 3.11.0__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 (220) hide show
  1. README.md +396 -17
  2. rasa/__main__.py +15 -31
  3. rasa/api.py +1 -5
  4. rasa/cli/arguments/default_arguments.py +2 -1
  5. rasa/cli/arguments/shell.py +1 -5
  6. rasa/cli/arguments/train.py +0 -14
  7. rasa/cli/e2e_test.py +1 -1
  8. rasa/cli/evaluate.py +8 -8
  9. rasa/cli/inspect.py +7 -15
  10. rasa/cli/interactive.py +0 -1
  11. rasa/cli/llm_fine_tuning.py +1 -1
  12. rasa/cli/project_templates/calm/config.yml +7 -5
  13. rasa/cli/project_templates/calm/endpoints.yml +2 -15
  14. rasa/cli/project_templates/tutorial/config.yml +5 -8
  15. rasa/cli/project_templates/tutorial/data/flows.yml +1 -1
  16. rasa/cli/project_templates/tutorial/data/patterns.yml +0 -5
  17. rasa/cli/project_templates/tutorial/domain.yml +0 -14
  18. rasa/cli/project_templates/tutorial/endpoints.yml +0 -5
  19. rasa/cli/run.py +1 -1
  20. rasa/cli/scaffold.py +2 -4
  21. rasa/cli/studio/studio.py +8 -18
  22. rasa/cli/studio/upload.py +15 -0
  23. rasa/cli/train.py +0 -3
  24. rasa/cli/utils.py +1 -6
  25. rasa/cli/x.py +8 -8
  26. rasa/constants.py +1 -3
  27. rasa/core/actions/action.py +33 -75
  28. rasa/core/actions/e2e_stub_custom_action_executor.py +1 -5
  29. rasa/core/actions/http_custom_action_executor.py +0 -4
  30. rasa/core/channels/__init__.py +0 -2
  31. rasa/core/channels/channel.py +0 -20
  32. rasa/core/channels/development_inspector.py +3 -10
  33. rasa/core/channels/inspector/dist/assets/{arc-bc141fb2.js → arc-86942a71.js} +1 -1
  34. rasa/core/channels/inspector/dist/assets/{c4Diagram-d0fbc5ce-be2db283.js → c4Diagram-d0fbc5ce-b0290676.js} +1 -1
  35. rasa/core/channels/inspector/dist/assets/{classDiagram-936ed81e-55366915.js → classDiagram-936ed81e-f6405f6e.js} +1 -1
  36. rasa/core/channels/inspector/dist/assets/{classDiagram-v2-c3cb15f1-bb529518.js → classDiagram-v2-c3cb15f1-ef61ac77.js} +1 -1
  37. rasa/core/channels/inspector/dist/assets/{createText-62fc7601-b0ec81d6.js → createText-62fc7601-f0411e58.js} +1 -1
  38. rasa/core/channels/inspector/dist/assets/{edges-f2ad444c-6166330c.js → edges-f2ad444c-7dcc4f3b.js} +1 -1
  39. rasa/core/channels/inspector/dist/assets/{erDiagram-9d236eb7-5ccc6a8e.js → erDiagram-9d236eb7-e0c092d7.js} +1 -1
  40. rasa/core/channels/inspector/dist/assets/{flowDb-1972c806-fca3bfe4.js → flowDb-1972c806-fba2e3ce.js} +1 -1
  41. rasa/core/channels/inspector/dist/assets/{flowDiagram-7ea5b25a-4739080f.js → flowDiagram-7ea5b25a-7a70b71a.js} +1 -1
  42. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-24a5f41a.js +1 -0
  43. rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-abe16c3d-7c1b0e0f.js → flowchart-elk-definition-abe16c3d-00a59b68.js} +1 -1
  44. rasa/core/channels/inspector/dist/assets/{ganttDiagram-9b5ea136-772fd050.js → ganttDiagram-9b5ea136-293c91fa.js} +1 -1
  45. rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-99d0ae7c-8eae1dc9.js → gitGraphDiagram-99d0ae7c-07b2d68c.js} +1 -1
  46. rasa/core/channels/inspector/dist/assets/{index-2c4b9a3b-f55afcdf.js → index-2c4b9a3b-bc959fbd.js} +1 -1
  47. rasa/core/channels/inspector/dist/assets/{index-e7cef9de.js → index-3a8a5a28.js} +143 -143
  48. rasa/core/channels/inspector/dist/assets/{infoDiagram-736b4530-124d4a14.js → infoDiagram-736b4530-4a350f72.js} +1 -1
  49. rasa/core/channels/inspector/dist/assets/{journeyDiagram-df861f2b-7c4fae44.js → journeyDiagram-df861f2b-af464fb7.js} +1 -1
  50. rasa/core/channels/inspector/dist/assets/{layout-b9885fb6.js → layout-0071f036.js} +1 -1
  51. rasa/core/channels/inspector/dist/assets/{line-7c59abb6.js → line-2f73cc83.js} +1 -1
  52. rasa/core/channels/inspector/dist/assets/{linear-4776f780.js → linear-f014b4cc.js} +1 -1
  53. rasa/core/channels/inspector/dist/assets/{mindmap-definition-beec6740-2332c46c.js → mindmap-definition-beec6740-d2426fb6.js} +1 -1
  54. rasa/core/channels/inspector/dist/assets/{pieDiagram-dbbf0591-8fb39303.js → pieDiagram-dbbf0591-776f01a2.js} +1 -1
  55. rasa/core/channels/inspector/dist/assets/{quadrantDiagram-4d7f4fd6-3c7180a2.js → quadrantDiagram-4d7f4fd6-82e00b57.js} +1 -1
  56. rasa/core/channels/inspector/dist/assets/{requirementDiagram-6fc4c22a-e910bcb8.js → requirementDiagram-6fc4c22a-ea13c6bb.js} +1 -1
  57. rasa/core/channels/inspector/dist/assets/{sankeyDiagram-8f13d901-ead16c89.js → sankeyDiagram-8f13d901-1feca7e9.js} +1 -1
  58. rasa/core/channels/inspector/dist/assets/{sequenceDiagram-b655622a-29a02a19.js → sequenceDiagram-b655622a-070c61d2.js} +1 -1
  59. rasa/core/channels/inspector/dist/assets/{stateDiagram-59f0c015-042b3137.js → stateDiagram-59f0c015-24f46263.js} +1 -1
  60. rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-2b26beab-2178c0f3.js → stateDiagram-v2-2b26beab-c9056051.js} +1 -1
  61. rasa/core/channels/inspector/dist/assets/{styles-080da4f6-23ffa4fc.js → styles-080da4f6-08abc34a.js} +1 -1
  62. rasa/core/channels/inspector/dist/assets/{styles-3dcbcfbf-94f59763.js → styles-3dcbcfbf-bc74c25a.js} +1 -1
  63. rasa/core/channels/inspector/dist/assets/{styles-9c745c82-78a6bebc.js → styles-9c745c82-4e5d66de.js} +1 -1
  64. rasa/core/channels/inspector/dist/assets/{svgDrawCommon-4835440b-eae2a6f6.js → svgDrawCommon-4835440b-849c4517.js} +1 -1
  65. rasa/core/channels/inspector/dist/assets/{timeline-definition-5b62e21b-5c968d92.js → timeline-definition-5b62e21b-d0fb1598.js} +1 -1
  66. rasa/core/channels/inspector/dist/assets/{xychartDiagram-2b33534f-fd3db0d5.js → xychartDiagram-2b33534f-04d115e2.js} +1 -1
  67. rasa/core/channels/inspector/dist/index.html +1 -1
  68. rasa/core/channels/inspector/src/App.tsx +1 -1
  69. rasa/core/channels/inspector/src/components/LoadingSpinner.tsx +3 -6
  70. rasa/core/channels/socketio.py +2 -7
  71. rasa/core/channels/telegram.py +1 -1
  72. rasa/core/channels/twilio.py +1 -1
  73. rasa/core/channels/voice_ready/audiocodes.py +4 -15
  74. rasa/core/channels/voice_ready/jambonz.py +4 -15
  75. rasa/core/channels/voice_ready/twilio_voice.py +21 -6
  76. rasa/core/channels/voice_ready/utils.py +5 -6
  77. rasa/core/channels/voice_stream/asr/asr_engine.py +1 -19
  78. rasa/core/channels/voice_stream/asr/asr_event.py +0 -5
  79. rasa/core/channels/voice_stream/asr/deepgram.py +15 -28
  80. rasa/core/channels/voice_stream/audio_bytes.py +0 -1
  81. rasa/core/channels/voice_stream/tts/azure.py +3 -9
  82. rasa/core/channels/voice_stream/tts/cartesia.py +8 -12
  83. rasa/core/channels/voice_stream/tts/tts_engine.py +1 -11
  84. rasa/core/channels/voice_stream/twilio_media_streams.py +19 -28
  85. rasa/core/channels/voice_stream/util.py +4 -4
  86. rasa/core/channels/voice_stream/voice_channel.py +42 -222
  87. rasa/core/featurizers/single_state_featurizer.py +1 -22
  88. rasa/core/featurizers/tracker_featurizers.py +18 -115
  89. rasa/core/information_retrieval/qdrant.py +0 -1
  90. rasa/core/nlg/contextual_response_rephraser.py +25 -44
  91. rasa/core/persistor.py +34 -191
  92. rasa/core/policies/enterprise_search_policy.py +60 -119
  93. rasa/core/policies/flows/flow_executor.py +4 -7
  94. rasa/core/policies/intentless_policy.py +22 -82
  95. rasa/core/policies/ted_policy.py +33 -58
  96. rasa/core/policies/unexpected_intent_policy.py +7 -15
  97. rasa/core/processor.py +13 -89
  98. rasa/core/run.py +2 -2
  99. rasa/core/training/interactive.py +35 -34
  100. rasa/core/utils.py +22 -58
  101. rasa/dialogue_understanding/coexistence/llm_based_router.py +12 -39
  102. rasa/dialogue_understanding/commands/__init__.py +0 -4
  103. rasa/dialogue_understanding/commands/change_flow_command.py +0 -6
  104. rasa/dialogue_understanding/commands/utils.py +0 -5
  105. rasa/dialogue_understanding/generator/constants.py +0 -2
  106. rasa/dialogue_understanding/generator/flow_retrieval.py +4 -49
  107. rasa/dialogue_understanding/generator/llm_based_command_generator.py +23 -37
  108. rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +10 -57
  109. rasa/dialogue_understanding/generator/nlu_command_adapter.py +1 -19
  110. rasa/dialogue_understanding/generator/single_step/command_prompt_template.jinja2 +0 -3
  111. rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +10 -90
  112. rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +0 -53
  113. rasa/dialogue_understanding/processor/command_processor.py +1 -21
  114. rasa/e2e_test/assertions.py +16 -133
  115. rasa/e2e_test/assertions_schema.yml +0 -23
  116. rasa/e2e_test/e2e_test_case.py +6 -85
  117. rasa/e2e_test/e2e_test_runner.py +4 -6
  118. rasa/e2e_test/utils/io.py +1 -3
  119. rasa/engine/loader.py +0 -12
  120. rasa/engine/validation.py +11 -541
  121. rasa/keys +1 -0
  122. rasa/llm_fine_tuning/notebooks/unsloth_finetuning.ipynb +407 -0
  123. rasa/model_training.py +7 -29
  124. rasa/nlu/classifiers/diet_classifier.py +25 -38
  125. rasa/nlu/classifiers/logistic_regression_classifier.py +9 -22
  126. rasa/nlu/classifiers/sklearn_intent_classifier.py +16 -37
  127. rasa/nlu/extractors/crf_entity_extractor.py +50 -93
  128. rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.py +16 -45
  129. rasa/nlu/featurizers/sparse_featurizer/lexical_syntactic_featurizer.py +17 -52
  130. rasa/nlu/featurizers/sparse_featurizer/regex_featurizer.py +3 -5
  131. rasa/nlu/tokenizers/whitespace_tokenizer.py +14 -3
  132. rasa/server.py +1 -3
  133. rasa/shared/constants.py +0 -61
  134. rasa/shared/core/constants.py +0 -9
  135. rasa/shared/core/domain.py +5 -8
  136. rasa/shared/core/flows/flow.py +0 -5
  137. rasa/shared/core/flows/flows_list.py +1 -5
  138. rasa/shared/core/flows/flows_yaml_schema.json +0 -10
  139. rasa/shared/core/flows/validation.py +0 -96
  140. rasa/shared/core/flows/yaml_flows_io.py +4 -13
  141. rasa/shared/core/slots.py +0 -5
  142. rasa/shared/importers/importer.py +2 -19
  143. rasa/shared/importers/rasa.py +1 -5
  144. rasa/shared/nlu/training_data/features.py +2 -120
  145. rasa/shared/nlu/training_data/formats/rasa_yaml.py +3 -18
  146. rasa/shared/providers/_configs/azure_openai_client_config.py +3 -5
  147. rasa/shared/providers/_configs/openai_client_config.py +1 -1
  148. rasa/shared/providers/_configs/self_hosted_llm_client_config.py +0 -1
  149. rasa/shared/providers/_configs/utils.py +0 -16
  150. rasa/shared/providers/embedding/_base_litellm_embedding_client.py +29 -18
  151. rasa/shared/providers/embedding/azure_openai_embedding_client.py +21 -54
  152. rasa/shared/providers/embedding/default_litellm_embedding_client.py +0 -24
  153. rasa/shared/providers/llm/_base_litellm_client.py +31 -63
  154. rasa/shared/providers/llm/azure_openai_llm_client.py +29 -50
  155. rasa/shared/providers/llm/default_litellm_llm_client.py +0 -24
  156. rasa/shared/providers/llm/self_hosted_llm_client.py +29 -17
  157. rasa/shared/providers/mappings.py +0 -19
  158. rasa/shared/utils/common.py +2 -37
  159. rasa/shared/utils/io.py +6 -28
  160. rasa/shared/utils/llm.py +46 -353
  161. rasa/shared/utils/yaml.py +82 -181
  162. rasa/studio/auth.py +5 -3
  163. rasa/studio/config.py +4 -13
  164. rasa/studio/constants.py +0 -1
  165. rasa/studio/data_handler.py +4 -13
  166. rasa/studio/upload.py +80 -175
  167. rasa/telemetry.py +17 -94
  168. rasa/tracing/config.py +1 -3
  169. rasa/tracing/instrumentation/attribute_extractors.py +17 -94
  170. rasa/tracing/instrumentation/instrumentation.py +0 -121
  171. rasa/utils/common.py +0 -5
  172. rasa/utils/endpoints.py +1 -27
  173. rasa/utils/io.py +81 -7
  174. rasa/utils/log_utils.py +2 -9
  175. rasa/utils/tensorflow/model_data.py +193 -2
  176. rasa/validator.py +4 -110
  177. rasa/version.py +1 -1
  178. rasa_pro-3.11.0a1.dist-info/METADATA +576 -0
  179. {rasa_pro-3.11.0.dist-info → rasa_pro-3.11.0a1.dist-info}/RECORD +182 -216
  180. rasa/core/actions/action_repeat_bot_messages.py +0 -89
  181. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-736177bf.js +0 -1
  182. rasa/core/channels/inspector/src/helpers/audiostream.ts +0 -165
  183. rasa/core/channels/voice_stream/asr/azure.py +0 -129
  184. rasa/core/channels/voice_stream/browser_audio.py +0 -107
  185. rasa/core/channels/voice_stream/call_state.py +0 -23
  186. rasa/dialogue_understanding/commands/repeat_bot_messages_command.py +0 -60
  187. rasa/dialogue_understanding/commands/user_silence_command.py +0 -59
  188. rasa/dialogue_understanding/patterns/repeat.py +0 -37
  189. rasa/dialogue_understanding/patterns/user_silence.py +0 -37
  190. rasa/model_manager/__init__.py +0 -0
  191. rasa/model_manager/config.py +0 -40
  192. rasa/model_manager/model_api.py +0 -559
  193. rasa/model_manager/runner_service.py +0 -286
  194. rasa/model_manager/socket_bridge.py +0 -146
  195. rasa/model_manager/studio_jwt_auth.py +0 -86
  196. rasa/model_manager/trainer_service.py +0 -325
  197. rasa/model_manager/utils.py +0 -87
  198. rasa/model_manager/warm_rasa_process.py +0 -187
  199. rasa/model_service.py +0 -112
  200. rasa/shared/core/flows/utils.py +0 -39
  201. rasa/shared/providers/_configs/litellm_router_client_config.py +0 -220
  202. rasa/shared/providers/_configs/model_group_config.py +0 -167
  203. rasa/shared/providers/_configs/rasa_llm_client_config.py +0 -73
  204. rasa/shared/providers/_utils.py +0 -79
  205. rasa/shared/providers/embedding/litellm_router_embedding_client.py +0 -135
  206. rasa/shared/providers/llm/litellm_router_llm_client.py +0 -182
  207. rasa/shared/providers/llm/rasa_llm_client.py +0 -112
  208. rasa/shared/providers/router/__init__.py +0 -0
  209. rasa/shared/providers/router/_base_litellm_router_client.py +0 -183
  210. rasa/shared/providers/router/router_client.py +0 -73
  211. rasa/shared/utils/health_check/__init__.py +0 -0
  212. rasa/shared/utils/health_check/embeddings_health_check_mixin.py +0 -31
  213. rasa/shared/utils/health_check/health_check.py +0 -258
  214. rasa/shared/utils/health_check/llm_health_check_mixin.py +0 -31
  215. rasa/utils/sanic_error_handler.py +0 -32
  216. rasa/utils/tensorflow/feature_array.py +0 -366
  217. rasa_pro-3.11.0.dist-info/METADATA +0 -198
  218. {rasa_pro-3.11.0.dist-info → rasa_pro-3.11.0a1.dist-info}/NOTICE +0 -0
  219. {rasa_pro-3.11.0.dist-info → rasa_pro-3.11.0a1.dist-info}/WHEEL +0 -0
  220. {rasa_pro-3.11.0.dist-info → rasa_pro-3.11.0a1.dist-info}/entry_points.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{Z as zt,$ as ot,X as wt,W as Ft,s as Nt,g as Xt,B as Yt,D as St,a as Ht,b as $t,E as Ut,l as Ct,U as qt,i as jt,d as Gt}from"./index-e7cef9de.js";import{c as Qt}from"./createText-62fc7601-b0ec81d6.js";import{i as Kt}from"./init-77b53fdd.js";import{o as Zt}from"./ordinal-ba9b4969.js";import{l as ft}from"./linear-4776f780.js";import{l as pt}from"./line-7c59abb6.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";function Jt(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function st(){var e=Zt().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,c,f=!1,d=0,R=0,_=.5;delete e.unknown;function A(){var m=t().length,T=n<s,S=T?n:s,P=T?s:n;o=(P-S)/Math.max(1,m-d+R*2),f&&(o=Math.floor(o)),S+=(P-S-o*(m-d))*_,c=o*(1-d),f&&(S=Math.round(S),c=Math.round(c));var p=Jt(m).map(function(C){return S+o*C});return i(T?p.reverse():p)}return e.domain=function(m){return arguments.length?(t(m),A()):t()},e.range=function(m){return arguments.length?([s,n]=m,s=+s,n=+n,A()):[s,n]},e.rangeRound=function(m){return[s,n]=m,s=+s,n=+n,f=!0,A()},e.bandwidth=function(){return c},e.step=function(){return o},e.round=function(m){return arguments.length?(f=!!m,A()):f},e.padding=function(m){return arguments.length?(d=Math.min(1,R=+m),A()):d},e.paddingInner=function(m){return arguments.length?(d=Math.min(1,m),A()):d},e.paddingOuter=function(m){return arguments.length?(R=+m,A()):R},e.align=function(m){return arguments.length?(_=Math.max(0,Math.min(1,m)),A()):_},e.copy=function(){return st(t(),[s,n]).round(f).paddingInner(d).paddingOuter(R).align(_)},Kt.apply(A(),arguments)}var nt=function(){var e=function(V,r,l,u){for(l=l||{},u=V.length;u--;l[V[u]]=r);return l},t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],c=[1,7],f=[1,5,10,12,14,16,18,19,21,23,34,35,36],d=[1,25],R=[1,26],_=[1,28],A=[1,29],m=[1,30],T=[1,31],S=[1,32],P=[1,33],p=[1,34],C=[1,35],h=[1,36],L=[1,37],z=[1,43],lt=[1,42],ct=[1,47],$=[1,50],w=[1,10,12,14,16,18,19,21,23,34,35,36],Q=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],E=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],ut=[1,64],K={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:function(r,l,u,g,b,a,F){var x=a.length-1;switch(b){case 5:g.setOrientation(a[x]);break;case 9:g.setDiagramTitle(a[x].text.trim());break;case 12:g.setLineData({text:"",type:"text"},a[x]);break;case 13:g.setLineData(a[x-1],a[x]);break;case 14:g.setBarData({text:"",type:"text"},a[x]);break;case 15:g.setBarData(a[x-1],a[x]);break;case 16:this.$=a[x].trim(),g.setAccTitle(this.$);break;case 17:case 18:this.$=a[x].trim(),g.setAccDescription(this.$);break;case 19:this.$=a[x-1];break;case 20:this.$=[Number(a[x-2]),...a[x]];break;case 21:this.$=[Number(a[x])];break;case 22:g.setXAxisTitle(a[x]);break;case 23:g.setXAxisTitle(a[x-1]);break;case 24:g.setXAxisTitle({type:"text",text:""});break;case 25:g.setXAxisBand(a[x]);break;case 26:g.setXAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 27:this.$=a[x-1];break;case 28:this.$=[a[x-2],...a[x]];break;case 29:this.$=[a[x]];break;case 30:g.setYAxisTitle(a[x]);break;case 31:g.setYAxisTitle(a[x-1]);break;case 32:g.setYAxisTitle({type:"text",text:""});break;case 33:g.setYAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 37:this.$={text:a[x],type:"text"};break;case 38:this.$={text:a[x],type:"text"};break;case 39:this.$={text:a[x],type:"markdown"};break;case 40:this.$=a[x];break;case 41:this.$=a[x-1]+""+a[x];break}},table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:o,36:c}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:o,36:c}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:o,36:c}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(f,[2,34]),e(f,[2,35]),e(f,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:o,36:c}),{1:[2,3]},e(f,[2,5]),e(t,[2,7],{4:22,34:n,35:o,36:c}),{11:23,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:39,13:38,24:z,27:lt,29:40,30:41,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:45,15:44,27:ct,33:46,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:49,17:48,24:$,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:52,17:51,24:$,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{20:[1,53]},{22:[1,54]},e(w,[2,18]),{1:[2,2]},e(w,[2,8]),e(w,[2,9]),e(Q,[2,37],{40:55,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L}),e(Q,[2,38]),e(Q,[2,39]),e(E,[2,40]),e(E,[2,42]),e(E,[2,43]),e(E,[2,44]),e(E,[2,45]),e(E,[2,46]),e(E,[2,47]),e(E,[2,48]),e(E,[2,49]),e(E,[2,50]),e(E,[2,51]),e(w,[2,10]),e(w,[2,22],{30:41,29:56,24:z,27:lt}),e(w,[2,24]),e(w,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},e(w,[2,11]),e(w,[2,30],{33:60,27:ct}),e(w,[2,32]),{31:[1,61]},e(w,[2,12]),{17:62,24:$},{25:63,27:ut},e(w,[2,14]),{17:65,24:$},e(w,[2,16]),e(w,[2,17]),e(E,[2,41]),e(w,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(w,[2,31]),{27:[1,69]},e(w,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(w,[2,15]),e(w,[2,26]),e(w,[2,27]),{11:59,32:72,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},e(w,[2,33]),e(w,[2,19]),{25:73,27:ut},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:function(r,l){if(l.recoverable)this.trace(r);else{var u=new Error(r);throw u.hash=l,u}},parse:function(r){var l=this,u=[0],g=[],b=[null],a=[],F=this.table,x="",U=0,gt=0,Vt=2,xt=1,Bt=a.slice.call(arguments,1),k=Object.create(this.lexer),B={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(B.yy[J]=this.yy[J]);k.setInput(r,B.yy),B.yy.lexer=k,B.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var tt=k.yylloc;a.push(tt);var Wt=k.options&&k.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ot(){var I;return I=g.pop()||k.lex()||xt,typeof I!="number"&&(I instanceof Array&&(g=I,I=g.pop()),I=l.symbols_[I]||I),I}for(var D,W,v,it,O={},q,M,dt,j;;){if(W=u[u.length-1],this.defaultActions[W]?v=this.defaultActions[W]:((D===null||typeof D>"u")&&(D=Ot()),v=F[W]&&F[W][D]),typeof v>"u"||!v.length||!v[0]){var et="";j=[];for(q in F[W])this.terminals_[q]&&q>Vt&&j.push("'"+this.terminals_[q]+"'");k.showPosition?et="Parse error on line "+(U+1)+`:
1
+ import{Z as zt,$ as ot,X as wt,W as Ft,s as Nt,g as Xt,B as Yt,D as St,a as Ht,b as $t,E as Ut,l as Ct,U as qt,i as jt,d as Gt}from"./index-3a8a5a28.js";import{c as Qt}from"./createText-62fc7601-f0411e58.js";import{i as Kt}from"./init-77b53fdd.js";import{o as Zt}from"./ordinal-ba9b4969.js";import{l as ft}from"./linear-f014b4cc.js";import{l as pt}from"./line-2f73cc83.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";function Jt(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function st(){var e=Zt().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,c,f=!1,d=0,R=0,_=.5;delete e.unknown;function A(){var m=t().length,T=n<s,S=T?n:s,P=T?s:n;o=(P-S)/Math.max(1,m-d+R*2),f&&(o=Math.floor(o)),S+=(P-S-o*(m-d))*_,c=o*(1-d),f&&(S=Math.round(S),c=Math.round(c));var p=Jt(m).map(function(C){return S+o*C});return i(T?p.reverse():p)}return e.domain=function(m){return arguments.length?(t(m),A()):t()},e.range=function(m){return arguments.length?([s,n]=m,s=+s,n=+n,A()):[s,n]},e.rangeRound=function(m){return[s,n]=m,s=+s,n=+n,f=!0,A()},e.bandwidth=function(){return c},e.step=function(){return o},e.round=function(m){return arguments.length?(f=!!m,A()):f},e.padding=function(m){return arguments.length?(d=Math.min(1,R=+m),A()):d},e.paddingInner=function(m){return arguments.length?(d=Math.min(1,m),A()):d},e.paddingOuter=function(m){return arguments.length?(R=+m,A()):R},e.align=function(m){return arguments.length?(_=Math.max(0,Math.min(1,m)),A()):_},e.copy=function(){return st(t(),[s,n]).round(f).paddingInner(d).paddingOuter(R).align(_)},Kt.apply(A(),arguments)}var nt=function(){var e=function(V,r,l,u){for(l=l||{},u=V.length;u--;l[V[u]]=r);return l},t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],c=[1,7],f=[1,5,10,12,14,16,18,19,21,23,34,35,36],d=[1,25],R=[1,26],_=[1,28],A=[1,29],m=[1,30],T=[1,31],S=[1,32],P=[1,33],p=[1,34],C=[1,35],h=[1,36],L=[1,37],z=[1,43],lt=[1,42],ct=[1,47],$=[1,50],w=[1,10,12,14,16,18,19,21,23,34,35,36],Q=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],E=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],ut=[1,64],K={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:function(r,l,u,g,b,a,F){var x=a.length-1;switch(b){case 5:g.setOrientation(a[x]);break;case 9:g.setDiagramTitle(a[x].text.trim());break;case 12:g.setLineData({text:"",type:"text"},a[x]);break;case 13:g.setLineData(a[x-1],a[x]);break;case 14:g.setBarData({text:"",type:"text"},a[x]);break;case 15:g.setBarData(a[x-1],a[x]);break;case 16:this.$=a[x].trim(),g.setAccTitle(this.$);break;case 17:case 18:this.$=a[x].trim(),g.setAccDescription(this.$);break;case 19:this.$=a[x-1];break;case 20:this.$=[Number(a[x-2]),...a[x]];break;case 21:this.$=[Number(a[x])];break;case 22:g.setXAxisTitle(a[x]);break;case 23:g.setXAxisTitle(a[x-1]);break;case 24:g.setXAxisTitle({type:"text",text:""});break;case 25:g.setXAxisBand(a[x]);break;case 26:g.setXAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 27:this.$=a[x-1];break;case 28:this.$=[a[x-2],...a[x]];break;case 29:this.$=[a[x]];break;case 30:g.setYAxisTitle(a[x]);break;case 31:g.setYAxisTitle(a[x-1]);break;case 32:g.setYAxisTitle({type:"text",text:""});break;case 33:g.setYAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 37:this.$={text:a[x],type:"text"};break;case 38:this.$={text:a[x],type:"text"};break;case 39:this.$={text:a[x],type:"markdown"};break;case 40:this.$=a[x];break;case 41:this.$=a[x-1]+""+a[x];break}},table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:o,36:c}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:o,36:c}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:o,36:c}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(f,[2,34]),e(f,[2,35]),e(f,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:o,36:c}),{1:[2,3]},e(f,[2,5]),e(t,[2,7],{4:22,34:n,35:o,36:c}),{11:23,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:39,13:38,24:z,27:lt,29:40,30:41,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:45,15:44,27:ct,33:46,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:49,17:48,24:$,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:52,17:51,24:$,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{20:[1,53]},{22:[1,54]},e(w,[2,18]),{1:[2,2]},e(w,[2,8]),e(w,[2,9]),e(Q,[2,37],{40:55,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L}),e(Q,[2,38]),e(Q,[2,39]),e(E,[2,40]),e(E,[2,42]),e(E,[2,43]),e(E,[2,44]),e(E,[2,45]),e(E,[2,46]),e(E,[2,47]),e(E,[2,48]),e(E,[2,49]),e(E,[2,50]),e(E,[2,51]),e(w,[2,10]),e(w,[2,22],{30:41,29:56,24:z,27:lt}),e(w,[2,24]),e(w,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},e(w,[2,11]),e(w,[2,30],{33:60,27:ct}),e(w,[2,32]),{31:[1,61]},e(w,[2,12]),{17:62,24:$},{25:63,27:ut},e(w,[2,14]),{17:65,24:$},e(w,[2,16]),e(w,[2,17]),e(E,[2,41]),e(w,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(w,[2,31]),{27:[1,69]},e(w,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(w,[2,15]),e(w,[2,26]),e(w,[2,27]),{11:59,32:72,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},e(w,[2,33]),e(w,[2,19]),{25:73,27:ut},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:function(r,l){if(l.recoverable)this.trace(r);else{var u=new Error(r);throw u.hash=l,u}},parse:function(r){var l=this,u=[0],g=[],b=[null],a=[],F=this.table,x="",U=0,gt=0,Vt=2,xt=1,Bt=a.slice.call(arguments,1),k=Object.create(this.lexer),B={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(B.yy[J]=this.yy[J]);k.setInput(r,B.yy),B.yy.lexer=k,B.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var tt=k.yylloc;a.push(tt);var Wt=k.options&&k.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ot(){var I;return I=g.pop()||k.lex()||xt,typeof I!="number"&&(I instanceof Array&&(g=I,I=g.pop()),I=l.symbols_[I]||I),I}for(var D,W,v,it,O={},q,M,dt,j;;){if(W=u[u.length-1],this.defaultActions[W]?v=this.defaultActions[W]:((D===null||typeof D>"u")&&(D=Ot()),v=F[W]&&F[W][D]),typeof v>"u"||!v.length||!v[0]){var et="";j=[];for(q in F[W])this.terminals_[q]&&q>Vt&&j.push("'"+this.terminals_[q]+"'");k.showPosition?et="Parse error on line "+(U+1)+`:
2
2
  `+k.showPosition()+`
3
3
  Expecting `+j.join(", ")+", got '"+(this.terminals_[D]||D)+"'":et="Parse error on line "+(U+1)+": Unexpected "+(D==xt?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(et,{text:k.match,token:this.terminals_[D]||D,line:k.yylineno,loc:tt,expected:j})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+D);switch(v[0]){case 1:u.push(D),b.push(k.yytext),a.push(k.yylloc),u.push(v[1]),D=null,gt=k.yyleng,x=k.yytext,U=k.yylineno,tt=k.yylloc;break;case 2:if(M=this.productions_[v[1]][1],O.$=b[b.length-M],O._$={first_line:a[a.length-(M||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(M||1)].first_column,last_column:a[a.length-1].last_column},Wt&&(O._$.range=[a[a.length-(M||1)].range[0],a[a.length-1].range[1]]),it=this.performAction.apply(O,[x,gt,U,B.yy,v[1],b,a].concat(Bt)),typeof it<"u")return it;M&&(u=u.slice(0,-1*M*2),b=b.slice(0,-1*M),a=a.slice(0,-1*M)),u.push(this.productions_[v[1]][0]),b.push(O.$),a.push(O._$),dt=F[u[u.length-2]][u[u.length-1]],u.push(dt);break;case 3:return!0}}return!0}},It=function(){var V={EOF:1,parseError:function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},setInput:function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},unput:function(r){var l=r.length,u=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var b=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===g.length?this.yylloc.first_column:0)+g[g.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[b[0],b[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(r){this.unput(this.match.slice(r))},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -6,7 +6,7 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <link rel="icon" href="data:image/x-icon;base64,AAABAAEAICAQAAEABADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAOwAAADsAAAAEAAAABAAAABxaUwAwoyZAMOJmADBi5kAwoyZAMKMmQDCjJkAwoyZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAAAAAAAAAAAAAAACV3AAAAAAAAAAAAAAAAAAYXdwAAAAAAAAAAAAAAAANHd3cAAAAAAAEREREREREXd3d3ERAAAAAHd3d3d3d3d3FXd3dwAAAAB3d3d3d3d3dDB3d3cAAAAAd3IiIiIiIiAAIid3AAAAAHdwAAAAAAAAAAAHdwAAAAB3cAAAAAAAAAAAB3cAAAAAd3AAd3AABnd0AAd3AAAAAHdwAHdwADF3QgAHdwAAAAB3cAB3dTMXcSAAB3cAAAAAd3AAd3dxdxMAAAd3AAAAAHdwAHd3d3dGAAAHdwAAAAB3cAB3dHd3dxUAB3cAAAAAd3AAd3A1F3d3AAd3AAAAAHdwAHdwAANXdwAHdwAAAAB3cAB3cAAAAXcAB3cAAAAAd3AAd3d3d3d3AAd3AAAAAHdwAHd3d3d3dwAHdwAAAAB3cAB3d3d3d3cAB3cAAAAAd3AAAAAAAAAAAAd3AAAAAHdwAAAAAAAAAAAHdwAAAAB3cAAAAAAAAAAAB3cAAAAAd3d3d3d3d3d3d3d3AAAAAHd3d3d3d3d3d3d3dwAAAAB3d3d3d3d3d3d3d3cAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///5////4f///8H///8B/8AAAD/AAAA/wAAQP8AAcD/H//4/x//+P8ceDj/HHA4/xwAeP8cAPj/HAD4/xwAOP8cQDj/HHg4/xx+OP8cADj/HAA4/xwAOP8f//j/H//4/x//+P8AAAD/AAAA/wAAAP/////////////////////w==" sizes="32x32">
8
8
  <title>Rasa inspector</title>
9
- <script type="module" crossorigin src="./assets/index-e7cef9de.js"></script>
9
+ <script type="module" crossorigin src="./assets/index-3a8a5a28.js"></script>
10
10
  <link rel="stylesheet" href="./assets/index-3ee28881.css">
11
11
  </head>
12
12
 
@@ -180,7 +180,7 @@ export function App() {
180
180
  });
181
181
  };
182
182
 
183
- if (!rasaChatSessionId && !window.location.href.includes("socketio")) return <LoadingSpinner />;
183
+ if (!rasaChatSessionId) return <LoadingSpinner />;
184
184
 
185
185
  return (
186
186
  <Grid sx={gridSx}>
@@ -1,11 +1,9 @@
1
- import { Center, Spinner, Text, Button, useColorModeValue } from "@chakra-ui/react";
1
+ import { Center, Spinner, Text, useColorModeValue } from "@chakra-ui/react";
2
2
  import { useOurTheme } from "../theme";
3
- import {createAudioConnection} from "../helpers/audiostream.ts";
4
3
 
5
4
  export const LoadingSpinner = () => {
6
5
  const { rasaSpace } = useOurTheme();
7
- const isVoice = window.location.href.includes("browser_audio");
8
- const text = isVoice ? "Start a new conversation" : "Waiting for a new conversation"
6
+
9
7
  return (
10
8
  <Center height={"100vh"} flexDirection="column">
11
9
  <Spinner
@@ -15,8 +13,7 @@ export const LoadingSpinner = () => {
15
13
  size="lg"
16
14
  mb={rasaSpace[1]}
17
15
  />
18
- <Text fontSize="lg">{text}</Text>
19
- {isVoice ? <Button onClick={createAudioConnection}>Go</Button> : null}
16
+ <Text fontSize="lg">waiting for a new conversation</Text>
20
17
  </Center>
21
18
  );
22
19
  };
@@ -37,11 +37,7 @@ class SocketBlueprint(Blueprint):
37
37
  :param options: Options to be used while registering the
38
38
  blueprint into the app.
39
39
  """
40
- if self.ctx.socketio_path:
41
- path = self.ctx.socketio_path
42
- else:
43
- path = options.get("url_prefix", "/socket.io")
44
- self.ctx.sio.attach(app, path)
40
+ self.ctx.sio.attach(app, self.ctx.socketio_path)
45
41
  super().register(app, options)
46
42
 
47
43
 
@@ -51,7 +47,6 @@ class SocketIOOutput(OutputChannel):
51
47
  return "socketio"
52
48
 
53
49
  def __init__(self, sio: AsyncServer, bot_message_evt: Text) -> None:
54
- super().__init__()
55
50
  self.sio = sio
56
51
  self.bot_message_evt = bot_message_evt
57
52
  self.last_event_timestamp = (
@@ -60,7 +55,7 @@ class SocketIOOutput(OutputChannel):
60
55
 
61
56
  def _get_new_events(self) -> List[Dict[Text, Any]]:
62
57
  """Get events that are newer than the last sent event."""
63
- events = self.tracker_state.get("events", []) if self.tracker_state else []
58
+ events = self.tracker_state.get("events", [])
64
59
  new_events = [
65
60
  event for event in events if event["timestamp"] > self.last_event_timestamp
66
61
  ]
@@ -34,7 +34,7 @@ class TelegramOutput(Bot, OutputChannel):
34
34
  return "telegram"
35
35
 
36
36
  def __init__(self, access_token: Optional[Text]) -> None:
37
- Bot.__init__(self, access_token)
37
+ super().__init__(access_token)
38
38
 
39
39
  async def send_text_message(
40
40
  self, recipient_id: Text, text: Text, **kwargs: Any
@@ -28,7 +28,7 @@ class TwilioOutput(Client, OutputChannel):
28
28
  auth_token: Optional[Text],
29
29
  twilio_number: Optional[Text],
30
30
  ) -> None:
31
- Client.__init__(self, account_sid, auth_token)
31
+ super().__init__(account_sid, auth_token)
32
32
  self.twilio_number = twilio_number
33
33
  self.send_retry = 0
34
34
  self.max_retry = 5
@@ -21,7 +21,6 @@ from sanic.exceptions import NotFound, SanicException, ServerError
21
21
  from sanic.request import Request
22
22
  from sanic.response import HTTPResponse
23
23
 
24
- from rasa.utils.io import remove_emojis
25
24
 
26
25
  structlogger = structlog.get_logger()
27
26
 
@@ -74,7 +73,7 @@ class Conversation:
74
73
  @staticmethod
75
74
  def get_metadata(activity: Dict[Text, Any]) -> Optional[Dict[Text, Any]]:
76
75
  """Get metadata from the activity."""
77
- return asdict(map_call_params(activity["parameters"]))
76
+ return activity.get("parameters")
78
77
 
79
78
  @staticmethod
80
79
  def _handle_event(event: Dict[Text, Any]) -> Text:
@@ -88,16 +87,17 @@ class Conversation:
88
87
 
89
88
  if event["name"] == EVENT_START:
90
89
  text = f"{INTENT_MESSAGE_PREFIX}{USER_INTENT_SESSION_START}"
90
+ event_params = asdict(map_call_params(event["parameters"]))
91
91
  elif event["name"] == EVENT_DTMF:
92
92
  text = f"{INTENT_MESSAGE_PREFIX}vaig_event_DTMF"
93
93
  event_params = {"value": event["value"]}
94
- text += json.dumps(event_params)
95
94
  else:
96
95
  structlogger.warning(
97
96
  "audiocodes.handle.event.unknown_event", event_payload=event
98
97
  )
99
98
  return ""
100
99
 
100
+ text += json.dumps(event_params)
101
101
  return text
102
102
 
103
103
  def is_active_conversation(self, now: datetime, delta: timedelta) -> bool:
@@ -383,7 +383,7 @@ class AudiocodesInput(InputChannel):
383
383
  {"conversation": <conversation_id>, "reason": Optional[Text]}.
384
384
  """
385
385
  self._get_conversation(request.token, conversation_id)
386
- reason = {"reason": request.json.get("reason")}
386
+ reason = json.dumps({"reason": request.json.get("reason")})
387
387
  await on_new_message(
388
388
  UserMessage(
389
389
  text=f"{INTENT_MESSAGE_PREFIX}session_end",
@@ -449,7 +449,6 @@ class AudiocodesOutput(OutputChannel):
449
449
  self, recipient_id: Text, text: Text, **kwargs: Any
450
450
  ) -> None:
451
451
  """Send a text message."""
452
- text = remove_emojis(text)
453
452
  await self.add_message({"type": "message", "text": text})
454
453
 
455
454
  async def send_image_url(
@@ -472,16 +471,6 @@ class AudiocodesOutput(OutputChannel):
472
471
  """Indicate that the conversation should be ended."""
473
472
  await self.add_message({"type": "event", "name": "hangup"})
474
473
 
475
- async def send_text_with_buttons(
476
- self,
477
- recipient_id: str,
478
- text: str,
479
- buttons: List[Dict[str, Any]],
480
- **kwargs: Any,
481
- ) -> None:
482
- """Uses the concise button output format for voice channels."""
483
- await self.send_text_with_buttons_concise(recipient_id, text, buttons, **kwargs)
484
-
485
474
 
486
475
  class WebsocketOutput(AudiocodesOutput):
487
476
  def __init__(self, ws: Any, conversation_id: Text) -> None:
@@ -1,4 +1,4 @@
1
- from typing import Any, Awaitable, Callable, Dict, List, Optional, Text
1
+ from typing import Any, Awaitable, Callable, Dict, Optional, Text
2
2
 
3
3
  import structlog
4
4
  from rasa.core.channels.channel import InputChannel, OutputChannel, UserMessage
@@ -13,8 +13,8 @@ from sanic import Blueprint, response, Websocket # type: ignore[attr-defined]
13
13
  from sanic.request import Request
14
14
  from sanic.response import HTTPResponse
15
15
 
16
- from rasa.shared.utils.common import mark_as_beta_feature
17
- from rasa.utils.io import remove_emojis
16
+ from rasa.shared.utils.common import mark_as_experimental_feature
17
+
18
18
 
19
19
  structlogger = structlog.get_logger()
20
20
 
@@ -36,7 +36,7 @@ class JambonzVoiceReadyInput(InputChannel):
36
36
 
37
37
  def __init__(self) -> None:
38
38
  """Initializes the JambonzVoiceReadyInput channel."""
39
- mark_as_beta_feature("Jambonz Channel")
39
+ mark_as_experimental_feature("Jambonz Channel")
40
40
  validate_voice_license_scope()
41
41
 
42
42
  def blueprint(
@@ -87,7 +87,6 @@ class JambonzWebsocketOutput(OutputChannel):
87
87
  self, recipient_id: Text, text: Text, **kwargs: Any
88
88
  ) -> None:
89
89
  """Send a text message."""
90
- text = remove_emojis(text)
91
90
  await self.add_message({"type": "message", "text": text})
92
91
 
93
92
  async def send_image_url(
@@ -109,13 +108,3 @@ class JambonzWebsocketOutput(OutputChannel):
109
108
  async def hangup(self, recipient_id: Text, **kwargs: Any) -> None:
110
109
  """Indicate that the conversation should be ended."""
111
110
  await send_ws_hangup_message(DEFAULT_HANGUP_DELAY_SECONDS, self.ws)
112
-
113
- async def send_text_with_buttons(
114
- self,
115
- recipient_id: str,
116
- text: str,
117
- buttons: List[Dict[str, Any]],
118
- **kwargs: Any,
119
- ) -> None:
120
- """Uses the concise button output format for voice channels."""
121
- await self.send_text_with_buttons_concise(recipient_id, text, buttons, **kwargs)
@@ -358,23 +358,38 @@ class TwilioVoiceCollectingOutputChannel(CollectingOutputChannel):
358
358
  """Name of the output channel."""
359
359
  return "twilio_voice"
360
360
 
361
+ @staticmethod
362
+ def _emoji_warning(text: Text) -> None:
363
+ """Raises a warning if text contains an emoji."""
364
+ emoji_regex = rasa.utils.io.get_emoji_regex()
365
+ if emoji_regex.findall(text):
366
+ rasa.shared.utils.io.raise_warning(
367
+ "Text contains an emoji in a voice response. "
368
+ "Review responses to provide a voice-friendly alternative."
369
+ )
370
+
361
371
  async def send_text_message(
362
372
  self, recipient_id: Text, text: Text, **kwargs: Any
363
373
  ) -> None:
364
374
  """Sends the text message after removing emojis."""
365
- text = rasa.utils.io.remove_emojis(text)
375
+ self._emoji_warning(text)
366
376
  for message_part in text.strip().split("\n\n"):
367
377
  await self._persist_message(self._message(recipient_id, text=message_part))
368
378
 
369
379
  async def send_text_with_buttons(
370
380
  self,
371
- recipient_id: str,
372
- text: str,
373
- buttons: List[Dict[str, Any]],
381
+ recipient_id: Text,
382
+ text: Text,
383
+ buttons: List[Dict[Text, Any]],
374
384
  **kwargs: Any,
375
385
  ) -> None:
376
- """Uses the concise button output format for voice channels."""
377
- await self.send_text_with_buttons_concise(recipient_id, text, buttons, **kwargs)
386
+ """Convert buttons into a voice representation."""
387
+ self._emoji_warning(text)
388
+ await self._persist_message(self._message(recipient_id, text=text))
389
+
390
+ for b in buttons:
391
+ self._emoji_warning(b["title"])
392
+ await self._persist_message(self._message(recipient_id, text=b["title"]))
378
393
 
379
394
  async def send_image_url(
380
395
  self, recipient_id: Text, image: Text, **kwargs: Any
@@ -2,17 +2,16 @@ import structlog
2
2
  from dataclasses import dataclass
3
3
  from typing import Optional
4
4
 
5
+ from rasa.utils.licensing import (
6
+ PRODUCT_AREA,
7
+ VOICE_SCOPE,
8
+ validate_license_from_env,
9
+ )
5
10
 
6
11
  structlogger = structlog.get_logger()
7
12
 
8
13
 
9
14
  def validate_voice_license_scope() -> None:
10
- from rasa.utils.licensing import (
11
- PRODUCT_AREA,
12
- VOICE_SCOPE,
13
- validate_license_from_env,
14
- )
15
-
16
15
  """Validate that the correct license scope is present."""
17
16
  structlogger.info(
18
17
  f"Validating current Rasa Pro license scope which must include "
@@ -1,14 +1,5 @@
1
1
  from dataclasses import dataclass
2
- from typing import (
3
- Dict,
4
- AsyncIterator,
5
- Any,
6
- Generic,
7
- Optional,
8
- Tuple,
9
- Type,
10
- TypeVar,
11
- )
2
+ from typing import Dict, AsyncIterator, Any, Generic, Optional, Type, TypeVar
12
3
 
13
4
  from websockets.legacy.client import WebSocketClientProtocol
14
5
 
@@ -16,7 +7,6 @@ from rasa.core.channels.voice_stream.asr.asr_event import ASREvent
16
7
  from rasa.core.channels.voice_stream.audio_bytes import RasaAudioBytes
17
8
  from rasa.core.channels.voice_stream.util import MergeableConfig
18
9
  from rasa.shared.exceptions import ConnectionException
19
- from rasa.shared.utils.common import validate_environment
20
10
 
21
11
  T = TypeVar("T", bound="ASREngineConfig")
22
12
  E = TypeVar("E", bound="ASREngine")
@@ -28,17 +18,9 @@ class ASREngineConfig(MergeableConfig):
28
18
 
29
19
 
30
20
  class ASREngine(Generic[T]):
31
- required_env_vars: Tuple[str, ...] = ()
32
- required_packages: Tuple[str, ...] = ()
33
-
34
21
  def __init__(self, config: Optional[T] = None):
35
22
  self.config = self.get_default_config().merge(config)
36
23
  self.asr_socket: Optional[WebSocketClientProtocol] = None
37
- validate_environment(
38
- self.required_env_vars,
39
- self.required_packages,
40
- f"ASR Engine {self.__class__.__name__}",
41
- )
42
24
 
43
25
  async def connect(self) -> None:
44
26
  self.asr_socket = await self.open_websocket_connection()
@@ -11,8 +11,3 @@ class ASREvent:
11
11
  @dataclass
12
12
  class NewTranscript(ASREvent):
13
13
  text: str
14
-
15
-
16
- @dataclass
17
- class UserIsSpeaking(ASREvent):
18
- pass
@@ -7,13 +7,10 @@ import websockets
7
7
  from websockets.legacy.client import WebSocketClientProtocol
8
8
 
9
9
  from rasa.core.channels.voice_stream.asr.asr_engine import ASREngine, ASREngineConfig
10
- from rasa.core.channels.voice_stream.asr.asr_event import (
11
- ASREvent,
12
- NewTranscript,
13
- UserIsSpeaking,
14
- )
15
- from rasa.core.channels.voice_stream.audio_bytes import HERTZ, RasaAudioBytes
16
- from rasa.shared.constants import DEEPGRAM_API_KEY_ENV_VAR
10
+ from rasa.core.channels.voice_stream.asr.asr_event import ASREvent, NewTranscript
11
+ from rasa.core.channels.voice_stream.audio_bytes import RasaAudioBytes
12
+
13
+ DEEPGRAM_API_KEY = "DEEPGRAM_API_KEY"
17
14
 
18
15
 
19
16
  @dataclass
@@ -21,21 +18,16 @@ class DeepgramASRConfig(ASREngineConfig):
21
18
  endpoint: Optional[str] = None
22
19
  # number of miliseconds of silence to determine end of speech
23
20
  endpointing: Optional[int] = None
24
- language: Optional[str] = None
25
- model: Optional[str] = None
26
- smart_format: Optional[bool] = None
27
21
 
28
22
 
29
23
  class DeepgramASR(ASREngine[DeepgramASRConfig]):
30
- required_env_vars = (DEEPGRAM_API_KEY_ENV_VAR,)
31
-
32
24
  def __init__(self, config: Optional[DeepgramASRConfig] = None):
33
25
  super().__init__(config)
34
26
  self.accumulated_transcript = ""
35
27
 
36
28
  async def open_websocket_connection(self) -> WebSocketClientProtocol:
37
29
  """Connect to the ASR system."""
38
- deepgram_api_key = os.environ[DEEPGRAM_API_KEY_ENV_VAR]
30
+ deepgram_api_key = os.environ.get(DEEPGRAM_API_KEY)
39
31
  extra_headers = {"Authorization": f"Token {deepgram_api_key}"}
40
32
  api_url = self._get_api_url()
41
33
  query_params = self._get_query_params()
@@ -49,9 +41,8 @@ class DeepgramASR(ASREngine[DeepgramASRConfig]):
49
41
 
50
42
  def _get_query_params(self) -> str:
51
43
  return (
52
- f"encoding=mulaw&sample_rate={HERTZ}&endpointing={self.config.endpointing}"
53
- f"&vad_events=true&language={self.config.language}&interim_results=true"
54
- f"&model={self.config.model}&smart_format={str(self.config.smart_format).lower()}"
44
+ f"encoding=mulaw&sample_rate=8000&endpointing={self.config.endpointing}"
45
+ f"&vad_events=true"
55
46
  )
56
47
 
57
48
  async def signal_audio_done(self) -> None:
@@ -67,23 +58,19 @@ class DeepgramASR(ASREngine[DeepgramASRConfig]):
67
58
  def engine_event_to_asr_event(self, e: Any) -> Optional[ASREvent]:
68
59
  """Translate an engine event to a common ASREvent."""
69
60
  data = json.loads(e)
70
- if "is_final" in data:
61
+ if data.get("is_final"):
71
62
  transcript = data["channel"]["alternatives"][0]["transcript"]
72
- if data["is_final"]:
73
- if data.get("speech_final"):
74
- full_transcript = self.accumulated_transcript + transcript
75
- self.accumulated_transcript = ""
76
- if full_transcript:
77
- return NewTranscript(full_transcript)
78
- else:
79
- self.accumulated_transcript += transcript
80
- elif transcript:
81
- return UserIsSpeaking()
63
+ if data.get("speech_final"):
64
+ full_transcript = self.accumulated_transcript + transcript
65
+ self.accumulated_transcript = ""
66
+ return NewTranscript(full_transcript)
67
+ else:
68
+ self.accumulated_transcript += transcript
82
69
  return None
83
70
 
84
71
  @staticmethod
85
72
  def get_default_config() -> DeepgramASRConfig:
86
- return DeepgramASRConfig("api.deepgram.com", 400, "en", "nova-2-general", True)
73
+ return DeepgramASRConfig("api.deepgram.com", 400)
87
74
 
88
75
  @classmethod
89
76
  def from_config_dict(cls, config: Dict) -> "DeepgramASR":
@@ -5,4 +5,3 @@ from typing import NewType
5
5
  # and tts engines
6
6
  # currently corresponds to raw wave, 8khz, 8bit, mono channel, mulaw encoding
7
7
  RasaAudioBytes = NewType("RasaAudioBytes", bytes)
8
- HERTZ = 8000
@@ -4,7 +4,7 @@ from dataclasses import dataclass
4
4
 
5
5
  import aiohttp
6
6
  import structlog
7
- from aiohttp import ClientConnectorError, ClientTimeout
7
+ from aiohttp import ClientConnectorError
8
8
 
9
9
  from rasa.core.channels.voice_stream.audio_bytes import RasaAudioBytes
10
10
  from rasa.core.channels.voice_stream.tts.tts_engine import (
@@ -12,7 +12,6 @@ from rasa.core.channels.voice_stream.tts.tts_engine import (
12
12
  TTSEngineConfig,
13
13
  TTSError,
14
14
  )
15
- from rasa.shared.constants import AZURE_SPEECH_API_KEY_ENV_VAR
16
15
  from rasa.shared.exceptions import ConnectionException
17
16
 
18
17
 
@@ -26,15 +25,13 @@ class AzureTTSConfig(TTSEngineConfig):
26
25
 
27
26
  class AzureTTS(TTSEngine[AzureTTSConfig]):
28
27
  session: Optional[aiohttp.ClientSession] = None
29
- required_env_vars = (AZURE_SPEECH_API_KEY_ENV_VAR,)
30
28
 
31
29
  def __init__(self, config: Optional[AzureTTSConfig] = None):
32
30
  super().__init__(config)
33
- timeout = ClientTimeout(total=self.config.timeout)
34
31
  # Have to create this class-shared session lazily at run time otherwise
35
32
  # the async event loop doesn't work
36
33
  if self.__class__.session is None or self.__class__.session.closed:
37
- self.__class__.session = aiohttp.ClientSession(timeout=timeout)
34
+ self.__class__.session = aiohttp.ClientSession()
38
35
 
39
36
  async def synthesize(
40
37
  self, text: str, config: Optional[AzureTTSConfig] = None
@@ -63,12 +60,10 @@ class AzureTTS(TTSEngine[AzureTTSConfig]):
63
60
  raise TTSError(f"TTS failed: {response.text()}")
64
61
  except ClientConnectorError as e:
65
62
  raise TTSError(e)
66
- except TimeoutError as e:
67
- raise TTSError(e)
68
63
 
69
64
  @staticmethod
70
65
  def get_request_headers() -> dict[str, str]:
71
- azure_speech_api_key = os.environ[AZURE_SPEECH_API_KEY_ENV_VAR]
66
+ azure_speech_api_key = os.environ["AZURE_SPEECH_API_KEY"]
72
67
  return {
73
68
  "Ocp-Apim-Subscription-Key": azure_speech_api_key,
74
69
  "Content-Type": "application/ssml+xml",
@@ -97,7 +92,6 @@ class AzureTTS(TTSEngine[AzureTTSConfig]):
97
92
  return AzureTTSConfig(
98
93
  language="en-US",
99
94
  voice="en-US-JennyNeural",
100
- timeout=10,
101
95
  speech_region="germanywestcentral",
102
96
  )
103
97
 
@@ -3,19 +3,20 @@ from typing import AsyncIterator, Dict, Optional
3
3
  import os
4
4
  import aiohttp
5
5
  import structlog
6
- from aiohttp import ClientConnectorError, ClientTimeout
6
+ from aiohttp import ClientConnectorError
7
7
 
8
8
  from rasa.core.channels.voice_stream.tts.tts_engine import (
9
9
  TTSEngineConfig,
10
10
  )
11
11
 
12
- from rasa.core.channels.voice_stream.audio_bytes import HERTZ, RasaAudioBytes
12
+ from rasa.core.channels.voice_stream.audio_bytes import RasaAudioBytes
13
13
  from rasa.core.channels.voice_stream.tts.tts_engine import TTSEngine, TTSError
14
- from rasa.shared.constants import CARTESIA_API_KEY_ENV_VAR
15
14
  from rasa.shared.exceptions import ConnectionException
16
15
 
17
16
  structlogger = structlog.get_logger()
18
17
 
18
+ CARTESIA_API_KEY = "CARTESIA_API_KEY"
19
+
19
20
 
20
21
  @dataclass
21
22
  class CartesiaTTSConfig(TTSEngineConfig):
@@ -25,15 +26,13 @@ class CartesiaTTSConfig(TTSEngineConfig):
25
26
 
26
27
  class CartesiaTTS(TTSEngine[CartesiaTTSConfig]):
27
28
  session: Optional[aiohttp.ClientSession] = None
28
- required_env_vars = (CARTESIA_API_KEY_ENV_VAR,)
29
29
 
30
30
  def __init__(self, config: Optional[CartesiaTTSConfig] = None):
31
31
  super().__init__(config)
32
- timeout = ClientTimeout(total=self.config.timeout)
33
32
  # Have to create this class-shared session lazily at run time otherwise
34
33
  # the async event loop doesn't work
35
34
  if self.__class__.session is None or self.__class__.session.closed:
36
- self.__class__.session = aiohttp.ClientSession(timeout=timeout)
35
+ self.__class__.session = aiohttp.ClientSession()
37
36
 
38
37
  @staticmethod
39
38
  def get_tts_endpoint() -> str:
@@ -56,13 +55,13 @@ class CartesiaTTS(TTSEngine[CartesiaTTSConfig]):
56
55
  "output_format": {
57
56
  "container": "raw",
58
57
  "encoding": "pcm_mulaw",
59
- "sample_rate": HERTZ,
58
+ "sample_rate": 8000,
60
59
  },
61
60
  }
62
61
 
63
62
  @staticmethod
64
63
  def get_request_headers(config: CartesiaTTSConfig) -> dict[str, str]:
65
- cartesia_api_key = os.environ[CARTESIA_API_KEY_ENV_VAR]
64
+ cartesia_api_key = os.environ.get(CARTESIA_API_KEY)
66
65
  return {
67
66
  "Cartesia-Version": str(config.version),
68
67
  "Content-Type": "application/json",
@@ -89,15 +88,13 @@ class CartesiaTTS(TTSEngine[CartesiaTTSConfig]):
89
88
  return
90
89
  else:
91
90
  structlogger.error(
92
- "cartesia.synthesize.rest.failed",
91
+ "azure.synthesize.rest.failed",
93
92
  status_code=response.status,
94
93
  msg=response.text(),
95
94
  )
96
95
  raise TTSError(f"TTS failed: {response.text()}")
97
96
  except ClientConnectorError as e:
98
97
  raise TTSError(e)
99
- except TimeoutError as e:
100
- raise TTSError(e)
101
98
 
102
99
  def engine_bytes_to_rasa_audio_bytes(self, chunk: bytes) -> RasaAudioBytes:
103
100
  """Convert the generated tts audio bytes into rasa audio bytes."""
@@ -108,7 +105,6 @@ class CartesiaTTS(TTSEngine[CartesiaTTSConfig]):
108
105
  return CartesiaTTSConfig(
109
106
  language="en",
110
107
  voice="248be419-c632-4f23-adf1-5324ed7dbf1d",
111
- timeout=10,
112
108
  model_id="sonic-english",
113
109
  version="2024-06-10",
114
110
  )
@@ -1,10 +1,9 @@
1
- from typing import AsyncIterator, Dict, Generic, Optional, Tuple, Type, TypeVar
1
+ from typing import AsyncIterator, Dict, Generic, Optional, Type, TypeVar
2
2
  from dataclasses import dataclass
3
3
 
4
4
  from rasa.core.channels.voice_stream.audio_bytes import RasaAudioBytes
5
5
  from rasa.core.channels.voice_stream.util import MergeableConfig
6
6
  from rasa.shared.exceptions import RasaException
7
- from rasa.shared.utils.common import validate_environment
8
7
 
9
8
 
10
9
  class TTSError(RasaException):
@@ -19,20 +18,11 @@ E = TypeVar("E", bound="TTSEngine")
19
18
  class TTSEngineConfig(MergeableConfig):
20
19
  language: Optional[str] = None
21
20
  voice: Optional[str] = None
22
- timeout: Optional[int] = None
23
21
 
24
22
 
25
23
  class TTSEngine(Generic[T]):
26
- required_env_vars: Tuple[str, ...] = ()
27
- required_packages: Tuple[str, ...] = ()
28
-
29
24
  def __init__(self, config: Optional[T] = None):
30
25
  self.config = self.get_default_config().merge(config)
31
- validate_environment(
32
- self.required_env_vars,
33
- self.required_packages,
34
- f"TTS Engine {self.__class__.__name__}",
35
- )
36
26
 
37
27
  async def close_connection(self) -> None:
38
28
  """Cleanup the connection if necessary."""