rasa-pro 3.12.18.dev1__py3-none-any.whl → 3.12.20__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 (45) hide show
  1. rasa/__init__.py +0 -6
  2. rasa/core/actions/action.py +1 -4
  3. rasa/core/channels/voice_stream/asr/azure.py +9 -0
  4. rasa/core/channels/voice_stream/twilio_media_streams.py +7 -0
  5. rasa/core/channels/voice_stream/voice_channel.py +40 -9
  6. rasa/core/policies/intentless_policy.py +1 -3
  7. rasa/core/processor.py +50 -5
  8. rasa/core/utils.py +11 -2
  9. rasa/dialogue_understanding/coexistence/llm_based_router.py +1 -0
  10. rasa/dialogue_understanding/commands/__init__.py +4 -0
  11. rasa/dialogue_understanding/commands/cancel_flow_command.py +3 -1
  12. rasa/dialogue_understanding/commands/set_slot_command.py +6 -0
  13. rasa/dialogue_understanding/commands/utils.py +26 -2
  14. rasa/dialogue_understanding/generator/command_generator.py +11 -1
  15. rasa/dialogue_understanding/generator/llm_based_command_generator.py +4 -15
  16. rasa/dialogue_understanding/generator/llm_command_generator.py +1 -3
  17. rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +4 -44
  18. rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +1 -14
  19. rasa/dialogue_understanding/processor/command_processor.py +5 -5
  20. rasa/dialogue_understanding/stack/frames/flow_stack_frame.py +17 -4
  21. rasa/dialogue_understanding/stack/utils.py +3 -1
  22. rasa/dialogue_understanding/utils.py +68 -12
  23. rasa/dialogue_understanding_test/du_test_schema.yml +3 -3
  24. rasa/e2e_test/e2e_test_coverage_report.py +1 -1
  25. rasa/e2e_test/e2e_test_schema.yml +3 -3
  26. rasa/hooks.py +0 -55
  27. rasa/llm_fine_tuning/utils.py +2 -4
  28. rasa/shared/constants.py +0 -5
  29. rasa/shared/core/flows/constants.py +2 -0
  30. rasa/shared/core/flows/flow.py +129 -13
  31. rasa/shared/core/flows/flows_list.py +18 -1
  32. rasa/shared/core/flows/steps/link.py +7 -2
  33. rasa/shared/providers/constants.py +0 -9
  34. rasa/shared/providers/llm/_base_litellm_client.py +4 -14
  35. rasa/shared/providers/llm/litellm_router_llm_client.py +7 -17
  36. rasa/shared/providers/llm/llm_client.py +15 -24
  37. rasa/shared/providers/llm/self_hosted_llm_client.py +2 -10
  38. rasa/tracing/instrumentation/attribute_extractors.py +2 -2
  39. rasa/version.py +1 -1
  40. {rasa_pro-3.12.18.dev1.dist-info → rasa_pro-3.12.20.dist-info}/METADATA +1 -2
  41. {rasa_pro-3.12.18.dev1.dist-info → rasa_pro-3.12.20.dist-info}/RECORD +44 -45
  42. rasa/monkey_patches.py +0 -91
  43. {rasa_pro-3.12.18.dev1.dist-info → rasa_pro-3.12.20.dist-info}/NOTICE +0 -0
  44. {rasa_pro-3.12.18.dev1.dist-info → rasa_pro-3.12.20.dist-info}/WHEEL +0 -0
  45. {rasa_pro-3.12.18.dev1.dist-info → rasa_pro-3.12.20.dist-info}/entry_points.txt +0 -0
rasa/monkey_patches.py DELETED
@@ -1,91 +0,0 @@
1
- import os
2
- import traceback
3
- from typing import Any, Optional
4
-
5
- from litellm.secret_managers.main import str_to_bool
6
- from packaging.version import Version
7
-
8
-
9
- def litellm_langfuse_logger_init_fixed(
10
- self: Any, # we should not import LangfuseLogger class before we patch it
11
- langfuse_public_key: Optional[str] = None,
12
- langfuse_secret: Optional[str] = None,
13
- langfuse_host: str = "https://cloud.langfuse.com",
14
- flush_interval: int = 1,
15
- ) -> None:
16
- """Monkeypatched version of LangfuseLogger.__init__ from the LiteLLM library.
17
-
18
- This patched version removes a call that fetched the `project_id` from
19
- Langfuse Cloud even when it was already set via environment variables.
20
- In the original implementation, this call was made *before* initializing
21
- the LangfuseClient, which caused the application to freeze for up to 60 seconds.
22
-
23
- By removing this premature call, the monkeypatch avoids the unnecessary network
24
- request and prevents the timeout/freeze issue.
25
-
26
- This workaround can be removed once the underlying bug is resolved in LiteLLM:
27
- https://github.com/BerriAI/litellm/issues/7732
28
- """
29
- try:
30
- import langfuse
31
- from langfuse import Langfuse
32
- except Exception as e:
33
- raise Exception(
34
- f"\033[91mLangfuse not installed, try running 'pip install langfuse' "
35
- f"to fix this error: {e}\n{traceback.format_exc()}\033[0m"
36
- )
37
- # Instance variables
38
- self.secret_key = langfuse_secret or os.getenv("LANGFUSE_SECRET_KEY", "")
39
- self.public_key = langfuse_public_key or os.getenv("LANGFUSE_PUBLIC_KEY", "")
40
-
41
- self.langfuse_host = langfuse_host or os.getenv(
42
- "LANGFUSE_HOST", "https://cloud.langfuse.com"
43
- )
44
- self.langfuse_host.replace("http://", "https://")
45
- if not self.langfuse_host.startswith("https://"):
46
- self.langfuse_host = "https://" + self.langfuse_host
47
-
48
- self.langfuse_release = os.getenv("LANGFUSE_RELEASE")
49
- self.langfuse_debug = os.getenv("LANGFUSE_DEBUG")
50
- self.langfuse_flush_interval = (
51
- os.getenv("LANGFUSE_FLUSH_INTERVAL") or flush_interval
52
- )
53
-
54
- parameters = {
55
- "public_key": self.public_key,
56
- "secret_key": self.secret_key,
57
- "host": self.langfuse_host,
58
- "release": self.langfuse_release,
59
- "debug": self.langfuse_debug,
60
- "flush_interval": self.langfuse_flush_interval, # flush interval in seconds
61
- }
62
-
63
- if Version(langfuse.version.__version__) >= Version("2.6.0"):
64
- parameters["sdk_integration"] = "litellm"
65
-
66
- self.Langfuse = Langfuse(**parameters)
67
-
68
- if os.getenv("UPSTREAM_LANGFUSE_SECRET_KEY") is not None:
69
- upstream_langfuse_debug = (
70
- str_to_bool(self.upstream_langfuse_debug)
71
- if self.upstream_langfuse_debug is not None
72
- else None
73
- )
74
- self.upstream_langfuse_secret_key = os.getenv("UPSTREAM_LANGFUSE_SECRET_KEY")
75
- self.upstream_langfuse_public_key = os.getenv("UPSTREAM_LANGFUSE_PUBLIC_KEY")
76
- self.upstream_langfuse_host = os.getenv("UPSTREAM_LANGFUSE_HOST")
77
- self.upstream_langfuse_release = os.getenv("UPSTREAM_LANGFUSE_RELEASE")
78
- self.upstream_langfuse_debug = os.getenv("UPSTREAM_LANGFUSE_DEBUG")
79
- self.upstream_langfuse = Langfuse(
80
- public_key=self.upstream_langfuse_public_key,
81
- secret_key=self.upstream_langfuse_secret_key,
82
- host=self.upstream_langfuse_host,
83
- release=self.upstream_langfuse_release,
84
- debug=(
85
- upstream_langfuse_debug
86
- if upstream_langfuse_debug is not None
87
- else False
88
- ),
89
- )
90
- else:
91
- self.upstream_langfuse = None