rasa-pro 3.12.0.dev13__py3-none-any.whl → 3.12.0rc2__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.
- README.md +10 -13
- rasa/anonymization/anonymization_rule_executor.py +16 -10
- rasa/cli/data.py +16 -0
- rasa/cli/project_templates/calm/config.yml +2 -2
- rasa/cli/project_templates/calm/domain/list_contacts.yml +1 -2
- rasa/cli/project_templates/calm/domain/remove_contact.yml +1 -2
- rasa/cli/project_templates/calm/domain/shared.yml +1 -4
- rasa/cli/project_templates/calm/endpoints.yml +2 -2
- rasa/cli/utils.py +12 -0
- rasa/core/actions/action.py +84 -191
- rasa/core/actions/action_handle_digressions.py +35 -13
- rasa/core/actions/action_run_slot_rejections.py +16 -4
- rasa/core/channels/__init__.py +2 -0
- rasa/core/channels/studio_chat.py +19 -0
- rasa/core/channels/telegram.py +42 -24
- rasa/core/channels/voice_ready/utils.py +1 -1
- rasa/core/channels/voice_stream/asr/asr_engine.py +10 -4
- rasa/core/channels/voice_stream/asr/azure.py +14 -1
- rasa/core/channels/voice_stream/asr/deepgram.py +20 -4
- rasa/core/channels/voice_stream/audiocodes.py +264 -0
- rasa/core/channels/voice_stream/browser_audio.py +4 -1
- rasa/core/channels/voice_stream/call_state.py +3 -0
- rasa/core/channels/voice_stream/genesys.py +6 -2
- rasa/core/channels/voice_stream/tts/azure.py +9 -1
- rasa/core/channels/voice_stream/tts/cartesia.py +14 -8
- rasa/core/channels/voice_stream/voice_channel.py +23 -2
- rasa/core/constants.py +2 -0
- rasa/core/nlg/contextual_response_rephraser.py +18 -1
- rasa/core/nlg/generator.py +83 -15
- rasa/core/nlg/response.py +6 -3
- rasa/core/nlg/translate.py +55 -0
- rasa/core/policies/enterprise_search_prompt_with_citation_template.jinja2 +1 -1
- rasa/core/policies/flows/flow_executor.py +19 -7
- rasa/core/processor.py +71 -9
- rasa/dialogue_understanding/commands/can_not_handle_command.py +20 -2
- rasa/dialogue_understanding/commands/cancel_flow_command.py +24 -6
- rasa/dialogue_understanding/commands/change_flow_command.py +20 -2
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +20 -2
- rasa/dialogue_understanding/commands/clarify_command.py +29 -3
- rasa/dialogue_understanding/commands/command.py +1 -16
- rasa/dialogue_understanding/commands/command_syntax_manager.py +55 -0
- rasa/dialogue_understanding/commands/handle_digressions_command.py +1 -7
- rasa/dialogue_understanding/commands/human_handoff_command.py +20 -2
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +20 -2
- rasa/dialogue_understanding/commands/prompt_command.py +94 -0
- rasa/dialogue_understanding/commands/repeat_bot_messages_command.py +20 -2
- rasa/dialogue_understanding/commands/set_slot_command.py +24 -2
- rasa/dialogue_understanding/commands/skip_question_command.py +20 -2
- rasa/dialogue_understanding/commands/start_flow_command.py +22 -2
- rasa/dialogue_understanding/commands/utils.py +71 -4
- rasa/dialogue_understanding/generator/__init__.py +2 -0
- rasa/dialogue_understanding/generator/command_parser.py +15 -12
- rasa/dialogue_understanding/generator/constants.py +3 -0
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +12 -5
- rasa/dialogue_understanding/generator/llm_command_generator.py +5 -3
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +17 -3
- rasa/dialogue_understanding/generator/prompt_templates/__init__.py +0 -0
- rasa/dialogue_understanding/generator/{single_step → prompt_templates}/command_prompt_template.jinja2 +2 -0
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v2_claude_3_5_sonnet_20240620_template.jinja2 +77 -0
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v2_default.jinja2 +68 -0
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v2_gpt_4o_2024_11_20_template.jinja2 +84 -0
- rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +522 -0
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +12 -310
- rasa/dialogue_understanding/patterns/collect_information.py +1 -1
- rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +16 -0
- rasa/dialogue_understanding/patterns/validate_slot.py +65 -0
- rasa/dialogue_understanding/processor/command_processor.py +39 -0
- rasa/dialogue_understanding/stack/utils.py +38 -0
- rasa/dialogue_understanding_test/du_test_case.py +58 -18
- rasa/dialogue_understanding_test/du_test_result.py +14 -10
- rasa/dialogue_understanding_test/io.py +14 -0
- rasa/e2e_test/assertions.py +6 -8
- rasa/e2e_test/llm_judge_prompts/answer_relevance_prompt_template.jinja2 +5 -1
- rasa/e2e_test/llm_judge_prompts/groundedness_prompt_template.jinja2 +4 -0
- rasa/e2e_test/utils/io.py +0 -37
- rasa/engine/graph.py +1 -0
- rasa/engine/language.py +140 -0
- rasa/engine/recipes/config_files/default_config.yml +4 -0
- rasa/engine/recipes/default_recipe.py +2 -0
- rasa/engine/recipes/graph_recipe.py +2 -0
- rasa/engine/storage/local_model_storage.py +1 -0
- rasa/engine/storage/storage.py +4 -1
- rasa/llm_fine_tuning/conversations.py +1 -1
- rasa/model_manager/runner_service.py +7 -4
- rasa/model_manager/socket_bridge.py +7 -6
- rasa/shared/constants.py +15 -13
- rasa/shared/core/constants.py +2 -0
- rasa/shared/core/flows/constants.py +11 -0
- rasa/shared/core/flows/flow.py +83 -19
- rasa/shared/core/flows/flows_yaml_schema.json +31 -3
- rasa/shared/core/flows/steps/collect.py +1 -36
- rasa/shared/core/flows/utils.py +28 -4
- rasa/shared/core/flows/validation.py +1 -1
- rasa/shared/core/slot_mappings.py +208 -5
- rasa/shared/core/slots.py +137 -1
- rasa/shared/core/trackers.py +74 -1
- rasa/shared/importers/importer.py +50 -2
- rasa/shared/nlu/training_data/schemas/responses.yml +19 -12
- rasa/shared/providers/_configs/azure_entra_id_config.py +541 -0
- rasa/shared/providers/_configs/azure_openai_client_config.py +138 -3
- rasa/shared/providers/_configs/client_config.py +3 -1
- rasa/shared/providers/_configs/default_litellm_client_config.py +3 -1
- rasa/shared/providers/_configs/huggingface_local_embedding_client_config.py +3 -1
- rasa/shared/providers/_configs/litellm_router_client_config.py +3 -1
- rasa/shared/providers/_configs/model_group_config.py +4 -2
- rasa/shared/providers/_configs/oauth_config.py +33 -0
- rasa/shared/providers/_configs/openai_client_config.py +3 -1
- rasa/shared/providers/_configs/rasa_llm_client_config.py +3 -1
- rasa/shared/providers/_configs/self_hosted_llm_client_config.py +3 -1
- rasa/shared/providers/constants.py +6 -0
- rasa/shared/providers/embedding/azure_openai_embedding_client.py +28 -3
- rasa/shared/providers/embedding/litellm_router_embedding_client.py +3 -1
- rasa/shared/providers/llm/_base_litellm_client.py +42 -17
- rasa/shared/providers/llm/azure_openai_llm_client.py +81 -25
- rasa/shared/providers/llm/default_litellm_llm_client.py +3 -1
- rasa/shared/providers/llm/litellm_router_llm_client.py +29 -8
- rasa/shared/providers/llm/llm_client.py +23 -7
- rasa/shared/providers/llm/openai_llm_client.py +9 -3
- rasa/shared/providers/llm/rasa_llm_client.py +11 -2
- rasa/shared/providers/llm/self_hosted_llm_client.py +30 -11
- rasa/shared/providers/router/_base_litellm_router_client.py +3 -1
- rasa/shared/providers/router/router_client.py +3 -1
- rasa/shared/utils/constants.py +3 -0
- rasa/shared/utils/llm.py +33 -7
- rasa/shared/utils/pykwalify_extensions.py +24 -0
- rasa/shared/utils/schemas/domain.yml +26 -0
- rasa/telemetry.py +2 -1
- rasa/tracing/config.py +2 -0
- rasa/tracing/constants.py +12 -0
- rasa/tracing/instrumentation/instrumentation.py +36 -0
- rasa/tracing/instrumentation/metrics.py +41 -0
- rasa/tracing/metric_instrument_provider.py +40 -0
- rasa/validator.py +372 -7
- rasa/version.py +1 -1
- {rasa_pro-3.12.0.dev13.dist-info → rasa_pro-3.12.0rc2.dist-info}/METADATA +13 -14
- {rasa_pro-3.12.0.dev13.dist-info → rasa_pro-3.12.0rc2.dist-info}/RECORD +139 -124
- {rasa_pro-3.12.0.dev13.dist-info → rasa_pro-3.12.0rc2.dist-info}/NOTICE +0 -0
- {rasa_pro-3.12.0.dev13.dist-info → rasa_pro-3.12.0rc2.dist-info}/WHEEL +0 -0
- {rasa_pro-3.12.0.dev13.dist-info → rasa_pro-3.12.0rc2.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
Your task is to analyze the current conversation context and generate a list of actions to start new business processes that we call flows, to extract slots, or respond to small talk and knowledge requests.
|
|
2
|
+
|
|
3
|
+
## Available Actions:
|
|
4
|
+
* `start flow flow_name`: Starting a flow. For example, `start flow transfer_money` or `start flow list_contacts`
|
|
5
|
+
* `set slot slot_name slot_value`: Slot setting. For example, `set slot transfer_money_recipient Freddy`. Can be used to correct and change previously set values
|
|
6
|
+
* `cancel flow`: Cancelling the current flow
|
|
7
|
+
* `disambiguate flows flow_name1 flow_name2 ... flow_name_n`: Disambiguate which flow should be started when user input is ambiguous by listing the potential flows as options. For example, `disambiguate flows list_contacts add_contact remove_contact ...` if the user just wrote "contacts".
|
|
8
|
+
* `provide info`: Responding to the user's questions by supplying relevant information, such as answering FAQs or explaining services
|
|
9
|
+
* `offtopic reply`: Responding to casual or social user messages that are unrelated to any flows, engaging in friendly conversation and addressing off-topic remarks.
|
|
10
|
+
* `hand over`: Handing over to a human, in case the user seems frustrated or explicitly asks to speak to one
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## General Tips
|
|
14
|
+
* Do not fill slots with abstract values or placeholders.
|
|
15
|
+
* Only use information provided by the user.
|
|
16
|
+
* Use clarification in ambiguous cases.
|
|
17
|
+
* Multiple flows can be started. If a user wants to digress into a second flow, you do not need to cancel the current flow.
|
|
18
|
+
* Strictly adhere to the provided action format.
|
|
19
|
+
* For categorical slots try to match the user message with potential slot values. Use "other" if you cannot match it
|
|
20
|
+
* Focus on the last message and take it one step at a time.
|
|
21
|
+
* Use the previous conversation steps only to aid understanding.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Available Flows:
|
|
25
|
+
Use the following structured date:
|
|
26
|
+
```xml
|
|
27
|
+
<flows>
|
|
28
|
+
{% for flow in available_flows %}<flow>
|
|
29
|
+
<name>{{ flow.name }}</name>
|
|
30
|
+
<description>{{ flow.description }}</description>
|
|
31
|
+
<slots>{% for slot in flow.slots %}
|
|
32
|
+
<slot>
|
|
33
|
+
<name>{{ slot.name }}</name>
|
|
34
|
+
<description>{{ slot.description }}</description>
|
|
35
|
+
<allowed_values>{{ slot.allowed_values }}</allowed_values>
|
|
36
|
+
</slot>{% endfor %}
|
|
37
|
+
</slots>
|
|
38
|
+
</flow>
|
|
39
|
+
{% endfor %}
|
|
40
|
+
</flows>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Current State
|
|
44
|
+
{% if current_flow != None %}
|
|
45
|
+
Use the following structured date:
|
|
46
|
+
```xml
|
|
47
|
+
<current_state>
|
|
48
|
+
<active_flow>{{ current_flow }}</active_flow>
|
|
49
|
+
<current_step>
|
|
50
|
+
<requested_slot>{{ current_slot }}</requested_slot>
|
|
51
|
+
<requested_slot_description>{{ current_slot_description }}</requested_slot_description>
|
|
52
|
+
</current_step>
|
|
53
|
+
<slots>
|
|
54
|
+
{% for slot in flow_slots %}<slot>
|
|
55
|
+
<name>{{ slot.name }}</name>
|
|
56
|
+
<value>{{ slot.value }}</value>
|
|
57
|
+
<type>{{ slot.type }}</type>
|
|
58
|
+
<description>{{ slot.description }}</description>{% if slot.allowed_values %}
|
|
59
|
+
<allowed_values>{{ slot.allowed_values }}</allowed_values>{% endif %}
|
|
60
|
+
</slot>
|
|
61
|
+
{% endfor %}
|
|
62
|
+
</slots>
|
|
63
|
+
</current_state>
|
|
64
|
+
```
|
|
65
|
+
{% else %}
|
|
66
|
+
You are currently not inside any flow.
|
|
67
|
+
{% endif %}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## Conversation History
|
|
71
|
+
{{ current_conversation }}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## Task
|
|
75
|
+
Create an action list with one action per line in response to the users last message: """{{ user_message }}""".
|
|
76
|
+
|
|
77
|
+
Your action list:
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
## Task Description
|
|
2
|
+
Your task is to analyze the current conversation context and generate a list of actions to start new business processes that we call flows, to extract slots, or respond to small talk and knowledge requests.
|
|
3
|
+
|
|
4
|
+
--
|
|
5
|
+
|
|
6
|
+
## Available Actions:
|
|
7
|
+
* `start flow flow_name`: Starting a flow. For example, `start flow transfer_money` or `start flow list_contacts`
|
|
8
|
+
* `set slot slot_name slot_value`: Slot setting. For example, `set slot transfer_money_recipient Freddy`. Can be used to correct and change previously set values
|
|
9
|
+
* `cancel flow`: Cancelling the current flow
|
|
10
|
+
* `disambiguate flows flow_name1 flow_name2 ... flow_name_n`: Disambiguate which flow should be started when user input is ambiguous by listing the potential flows as options. For example, `disambiguate flows list_contacts add_contact remove_contact ...` if the user just wrote "contacts".
|
|
11
|
+
* `provide info`: Responding to the user's questions by supplying relevant information, such as answering FAQs or explaining services
|
|
12
|
+
* `offtopic reply`: Responding to casual or social user messages that are unrelated to any flows, engaging in friendly conversation and addressing off-topic remarks.
|
|
13
|
+
* `hand over`: Handing over to a human, in case the user seems frustrated or explicitly asks to speak to one
|
|
14
|
+
|
|
15
|
+
--
|
|
16
|
+
|
|
17
|
+
## General Tips
|
|
18
|
+
* Do not fill slots with abstract values or placeholders.
|
|
19
|
+
* Only use information provided by the user.
|
|
20
|
+
* Use clarification in ambiguous cases.
|
|
21
|
+
* Multiple flows can be started. If a user wants to digress into a second flow, you do not need to cancel the current flow.
|
|
22
|
+
* Strictly adhere to the provided action format.
|
|
23
|
+
* For categorical slots try to match the user message with potential slot values. Use "other" if you cannot match it
|
|
24
|
+
* Focus on the last message and take it one step at a time.
|
|
25
|
+
* Use the previous conversation steps only to aid understanding.
|
|
26
|
+
|
|
27
|
+
--
|
|
28
|
+
|
|
29
|
+
## Available Flows and Slots
|
|
30
|
+
{% for flow in available_flows %}
|
|
31
|
+
* `{{ flow.name }}`: {{ flow.description }}
|
|
32
|
+
{% for slot in flow.slots -%}
|
|
33
|
+
* `{{ slot.name }}`{% if slot.description %} ({{ slot.description }}){% endif %}{% if slot.allowed_values %}, allowed values: `{{ slot.allowed_values }}`{% endif %}
|
|
34
|
+
{% endfor %}
|
|
35
|
+
{%- endfor %}
|
|
36
|
+
|
|
37
|
+
--
|
|
38
|
+
|
|
39
|
+
## Current State
|
|
40
|
+
{% if current_flow != None %}
|
|
41
|
+
You are currently in the flow `{{ current_flow }}`.
|
|
42
|
+
You have just asked the user for the slot `{{ current_slot }}`{% if current_slot_description %} ({{ current_slot_description }}){% endif %}.
|
|
43
|
+
|
|
44
|
+
{% if flow_slots|length > 0 %}
|
|
45
|
+
Here are the slots of the flow `{{ current_flow }}`:
|
|
46
|
+
{% for slot in flow_slots -%}
|
|
47
|
+
* `{{ slot.name }}`
|
|
48
|
+
- value: "{{ slot.value }}"
|
|
49
|
+
- type: {{ slot.type }}
|
|
50
|
+
- description: {{ slot.description}}
|
|
51
|
+
{% if slot.allowed_values %} - allowed values: {{ slot.allowed_values }}{% endif %}
|
|
52
|
+
{% endfor %}
|
|
53
|
+
{% endif %}
|
|
54
|
+
{% else %}
|
|
55
|
+
You are currently not inside any flow.
|
|
56
|
+
{% endif %}
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Conversation History
|
|
61
|
+
{{ current_conversation }}
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Task
|
|
66
|
+
Create an action list with one action per line in response to the users last message: """{{ user_message }}""".
|
|
67
|
+
|
|
68
|
+
Your action list:
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
## Task Description
|
|
2
|
+
Your task is to analyze the current conversation context and generate a list of actions to start new business processes that we call flows, to extract slots, or respond to small talk and knowledge requests.
|
|
3
|
+
|
|
4
|
+
--
|
|
5
|
+
|
|
6
|
+
## Available Actions:
|
|
7
|
+
* `start flow flow_name`: Starting a flow. For example, `start flow transfer_money` or `start flow list_contacts`
|
|
8
|
+
* `set slot slot_name slot_value`: Slot setting. For example, `set slot transfer_money_recipient Freddy`. Can be used to correct and change previously set values
|
|
9
|
+
* `cancel flow`: Cancelling the current flow
|
|
10
|
+
* `disambiguate flows flow_name1 flow_name2 ... flow_name_n`: Disambiguate which flow should be started when user input is ambiguous by listing the potential flows as options. For example, `disambiguate flows list_contacts add_contact remove_contact ...` if the user just wrote "contacts".
|
|
11
|
+
* `provide info`: Responding to the user's questions by supplying relevant information, such as answering FAQs or explaining services
|
|
12
|
+
* `offtopic reply`: Responding to casual or social user messages that are unrelated to any flows, engaging in friendly conversation and addressing off-topic remarks.
|
|
13
|
+
* `hand over`: Handing over to a human, in case the user seems frustrated or explicitly asks to speak to one
|
|
14
|
+
|
|
15
|
+
--
|
|
16
|
+
|
|
17
|
+
## General Tips
|
|
18
|
+
* Do not fill slots with abstract values or placeholders.
|
|
19
|
+
* Only use information provided by the user.
|
|
20
|
+
* Use clarification in ambiguous cases.
|
|
21
|
+
* Multiple flows can be started. If a user wants to digress into a second flow, you do not need to cancel the current flow.
|
|
22
|
+
* Strictly adhere to the provided action format.
|
|
23
|
+
* For categorical slots try to match the user message with potential slot values. Use "other" if you cannot match it
|
|
24
|
+
* Focus on the last message and take it one step at a time.
|
|
25
|
+
* Use the previous conversation steps only to aid understanding.
|
|
26
|
+
|
|
27
|
+
--
|
|
28
|
+
|
|
29
|
+
## Available Flows and Slots
|
|
30
|
+
Use the following structured date:
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"flows": [
|
|
34
|
+
{% for flow in available_flows %}{
|
|
35
|
+
"name": "{{ flow.name }}",
|
|
36
|
+
"description": "{{ flow.description }}"{% if flow.slots %},
|
|
37
|
+
"slots": [{% for slot in flow.slots %}
|
|
38
|
+
{
|
|
39
|
+
"name": "{{ slot.name }}"{% if slot.description %},
|
|
40
|
+
"description": "{{ slot.description }}"{% endif %}{% if slot.allowed_values %},
|
|
41
|
+
"allowed_values": {{ slot.allowed_values }}{% endif %}
|
|
42
|
+
}{% if not loop.last %},{% endif %}{% endfor %}
|
|
43
|
+
]{% endif %}
|
|
44
|
+
}{% if not loop.last %},
|
|
45
|
+
{% endif %}{% endfor %}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
--
|
|
51
|
+
|
|
52
|
+
## Current State
|
|
53
|
+
{% if current_flow != None %}Use the following structured date:
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"active_flow": "{{ current_flow }}",
|
|
57
|
+
"current_step": {
|
|
58
|
+
"requested_slot": "{{ current_slot }}",
|
|
59
|
+
"requested_slot_description": "{{ current_slot_description }}"
|
|
60
|
+
},
|
|
61
|
+
"slots": [{% for slot in flow_slots %}
|
|
62
|
+
{
|
|
63
|
+
"name": "{{ slot.name }}",
|
|
64
|
+
"value": "{{ slot.value }}",
|
|
65
|
+
"type": "{{ slot.type }}"{% if slot.description %},
|
|
66
|
+
"description": "{{ slot.description }}"{% endif %}{% if slot.allowed_values %},
|
|
67
|
+
"allowed_values": "{{ slot.allowed_values }}"{% endif %}
|
|
68
|
+
}{% if not loop.last %},{% endif %}{% endfor %}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
```{% else %}
|
|
72
|
+
You are currently not inside any flow.{% endif %}
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Conversation History
|
|
77
|
+
{{ current_conversation }}
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Task
|
|
82
|
+
Create an action list with one action per line in response to the users last message: """{{ user_message }}""".
|
|
83
|
+
|
|
84
|
+
Your action list:
|