rasa-pro 3.12.1.dev2__py3-none-any.whl → 3.12.2.dev2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rasa-pro might be problematic. Click here for more details.

@@ -12,6 +12,9 @@ from rasa.dialogue_understanding.commands import (
12
12
  SetSlotCommand,
13
13
  StartFlowCommand,
14
14
  )
15
+ from rasa.dialogue_understanding.commands.handle_digressions_command import (
16
+ HandleDigressionsCommand,
17
+ )
15
18
  from rasa.dialogue_understanding.constants import KEY_MINIMIZE_NUM_CALLS
16
19
  from rasa.dialogue_understanding.generator import CommandGenerator
17
20
  from rasa.dialogue_understanding.generator.constants import (
@@ -584,6 +587,24 @@ class LLMBasedCommandGenerator(
584
587
 
585
588
  return filtered_commands
586
589
 
590
+ def _should_merge_llm_commands(
591
+ self,
592
+ prior_commands: List[Command],
593
+ prior_start_flow_names: Set[str],
594
+ ) -> bool:
595
+ """Check if the LLM current commands should be merged with the prior commands.
596
+
597
+ This can be done if there are no prior start flow commands and
598
+ no prior handle digressions commands.
599
+ """
600
+ prior_handle_digressions = [
601
+ command
602
+ for command in prior_commands
603
+ if isinstance(command, HandleDigressionsCommand)
604
+ ]
605
+
606
+ return not prior_start_flow_names and not prior_handle_digressions
607
+
587
608
  def _check_start_flow_command_overlap(
588
609
  self,
589
610
  prior_commands: List[Command],
@@ -596,7 +617,9 @@ class LLMBasedCommandGenerator(
596
617
  prior_start_flow_names
597
618
  )
598
619
 
599
- if not different_flow_names:
620
+ if not different_flow_names or self._should_merge_llm_commands(
621
+ prior_commands, prior_start_flow_names
622
+ ):
600
623
  return prior_commands + commands
601
624
 
602
625
  # discard the flow names that are different to prior start flow commands
@@ -447,7 +447,14 @@ def clean_up_commands(
447
447
  continue
448
448
 
449
449
  if should_add_handle_digressions_command(tracker, all_flows, top_flow_id):
450
- clean_commands.append(HandleDigressionsCommand(flow=command.flow))
450
+ handle_digression_command = HandleDigressionsCommand(flow=command.flow)
451
+ if handle_digression_command in clean_commands:
452
+ structlogger.debug(
453
+ "command_processor.clean_up_commands.skip_handle_digressions.command_already_present",
454
+ command=handle_digression_command,
455
+ )
456
+ continue
457
+ clean_commands.append(handle_digression_command)
451
458
  structlogger.debug(
452
459
  "command_processor.clean_up_commands.push_handle_digressions",
453
460
  command=command,
@@ -487,6 +494,18 @@ def clean_up_commands(
487
494
  elif not tracker.has_coexistence_routing_slot and len(clean_commands) > 1:
488
495
  clean_commands = filter_cannot_handle_command_for_skipped_slots(clean_commands)
489
496
 
497
+ # remove cancel flow when there is a handle digression command
498
+ # otherwise the cancel command will cancel the active flow which defined a specific
499
+ # behavior for the digression
500
+ if contains_command(clean_commands, HandleDigressionsCommand) and contains_command(
501
+ clean_commands, CancelFlowCommand
502
+ ):
503
+ clean_commands = [
504
+ command
505
+ for command in clean_commands
506
+ if not isinstance(command, CancelFlowCommand)
507
+ ]
508
+
490
509
  clean_commands = ensure_max_number_of_command_type(
491
510
  clean_commands, RepeatBotMessagesCommand, 1
492
511
  )
rasa/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  # this file will automatically be changed,
2
2
  # do not add anything but the version number here!
3
- __version__ = "3.12.0"
3
+ __version__ = "3.12.2dev2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rasa-pro
3
- Version: 3.12.1.dev2
3
+ Version: 3.12.2.dev2
4
4
  Summary: State-of-the-art open-core Conversational AI framework for Enterprises that natively leverages generative AI for effortless assistant development.
5
5
  Home-page: https://rasa.com
6
6
  Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
@@ -119,7 +119,6 @@ Requires-Dist: scikit-learn (>=1.5.1,<1.6.0)
119
119
  Requires-Dist: scipy (>=1.13.1,<1.14.0)
120
120
  Requires-Dist: sentencepiece[sentencepiece] (>=0.1.99,<0.2.0) ; extra == "transformers" or extra == "full"
121
121
  Requires-Dist: sentry-sdk (>=1.14.0,<1.15.0)
122
- Requires-Dist: setuptools (>=70.0.0,<70.1.0)
123
122
  Requires-Dist: sklearn-crfsuite (>=0.3.6,<0.4.0)
124
123
  Requires-Dist: skops (>=0.10.0,<0.11.0)
125
124
  Requires-Dist: slack-sdk (>=3.27.1,<3.28.0)
@@ -149,7 +148,6 @@ Requires-Dist: typing-utils (>=0.1.0,<0.2.0)
149
148
  Requires-Dist: ujson (>=5.8,<6.0)
150
149
  Requires-Dist: webexteamssdk (>=1.6.1,<1.7.0)
151
150
  Requires-Dist: websockets (>=10.4,<11.0)
152
- Requires-Dist: wheel (>=0.40.0)
153
151
  Project-URL: Documentation, https://rasa.com/docs
154
152
  Project-URL: Repository, https://github.com/rasahq/rasa
155
153
  Description-Content-Type: text/markdown
@@ -401,7 +401,7 @@ rasa/dialogue_understanding/generator/command_parser.py,sha256=wf6FSgqBw5F0legg0
401
401
  rasa/dialogue_understanding/generator/constants.py,sha256=nA184YgNRaoA9Q0XlLp7VKxGCX4nN_b3zLyDaL22rQw,1018
402
402
  rasa/dialogue_understanding/generator/flow_document_template.jinja2,sha256=f4H6vVd-_nX_RtutMh1xD3ZQE_J2OyuPHAtiltfiAPY,253
403
403
  rasa/dialogue_understanding/generator/flow_retrieval.py,sha256=wlGnMj17-X1-siQmdSvOd7K61sRzBf82MQEL2pqDQMI,17891
404
- rasa/dialogue_understanding/generator/llm_based_command_generator.py,sha256=SA7SG1TIgDImlOsX-9wUHQB2rOLs8zqZ7XP9Qtb7Gec,22420
404
+ rasa/dialogue_understanding/generator/llm_based_command_generator.py,sha256=CksE7iUchYuKwCJBYhLhEaf4kMLtAOyUFBJOxYj_FFU,23237
405
405
  rasa/dialogue_understanding/generator/llm_command_generator.py,sha256=z7jhIJ3W_5GFH-p15kVoWbigMIoY8fIJjc_j_uX7yxw,2581
406
406
  rasa/dialogue_understanding/generator/multi_step/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
407
407
  rasa/dialogue_understanding/generator/multi_step/fill_slots_prompt.jinja2,sha256=Y0m673tAML3cFPaLM-urMXDsBYUUcXIw9YUpkAhGUuA,2933
@@ -438,7 +438,7 @@ rasa/dialogue_understanding/patterns/skip_question.py,sha256=fJ1MC0WEEtS-BpnGJEf
438
438
  rasa/dialogue_understanding/patterns/user_silence.py,sha256=xP-QMnd-MsybH5z4g01hBv4OLOHcw6m3rc26LQfe2zo,1140
439
439
  rasa/dialogue_understanding/patterns/validate_slot.py,sha256=hqd5AEGT3M3HLNhMwuI9W9kZNCvgU6GyI-2xc2b4kz8,2085
440
440
  rasa/dialogue_understanding/processor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
441
- rasa/dialogue_understanding/processor/command_processor.py,sha256=s1zPmOfuP5bkus1spgjqN3f4HP2fXpW118zx-txlIYQ,31005
441
+ rasa/dialogue_understanding/processor/command_processor.py,sha256=-uOr7z4EhIQl1ffD-q2xoTYA0qiFSDArdgdyo7kJHOA,31884
442
442
  rasa/dialogue_understanding/processor/command_processor_component.py,sha256=9NWJxMibKeaOBLDRT9lcylJr0ki5sQ0hJRtLlKHIlnI,1526
443
443
  rasa/dialogue_understanding/stack/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
444
444
  rasa/dialogue_understanding/stack/dialogue_stack.py,sha256=cYV6aQeh0EuOJHODDqK3biqXozYTX8baPgLwHhPxFqs,5244
@@ -821,9 +821,9 @@ rasa/utils/train_utils.py,sha256=ClJx-6x3-h3Vt6mskacgkcCUJTMXjFPe3zAcy_DfmaU,212
821
821
  rasa/utils/url_tools.py,sha256=dZ1HGkVdWTJB7zYEdwoDIrEuyX9HE5WsxKKFVsXBLE0,1218
822
822
  rasa/utils/yaml.py,sha256=KjbZq5C94ZP7Jdsw8bYYF7HASI6K4-C_kdHfrnPLpSI,2000
823
823
  rasa/validator.py,sha256=tAFzUKVbCPRPx0LjCUKY0zSCaX2hgINuaMfK123FCyc,88716
824
- rasa/version.py,sha256=xYQiV7i-4METOg7vg-CXdisxr-btULn10tq5mFoKb9E,117
825
- rasa_pro-3.12.1.dev2.dist-info/METADATA,sha256=ktHA_kAd6m1EugdZAZBGIZm7GkFtdl9ip0Up6-VhKfE,10693
826
- rasa_pro-3.12.1.dev2.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
827
- rasa_pro-3.12.1.dev2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
828
- rasa_pro-3.12.1.dev2.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
829
- rasa_pro-3.12.1.dev2.dist-info/RECORD,,
824
+ rasa/version.py,sha256=mXtcMs01zL6RdfVACJkEMbwc6jCCCtpB-89Bvf_CO2A,121
825
+ rasa_pro-3.12.2.dev2.dist-info/METADATA,sha256=FRYwV6dc69kkIfB2eSxunkXff9mZ3hZNa0b8nrvWY4M,10616
826
+ rasa_pro-3.12.2.dev2.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
827
+ rasa_pro-3.12.2.dev2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
828
+ rasa_pro-3.12.2.dev2.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
829
+ rasa_pro-3.12.2.dev2.dist-info/RECORD,,