rasa-pro 3.13.0.dev5__py3-none-any.whl → 3.13.0.dev8__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.
- rasa/__main__.py +0 -3
- rasa/api.py +5 -1
- rasa/cli/arguments/default_arguments.py +13 -1
- rasa/cli/arguments/train.py +2 -0
- rasa/cli/dialogue_understanding_test.py +1 -1
- rasa/cli/e2e_test.py +1 -1
- rasa/cli/evaluate.py +2 -2
- rasa/cli/export.py +3 -3
- rasa/cli/llm_fine_tuning.py +12 -11
- rasa/cli/project_templates/defaults.py +133 -0
- rasa/cli/run.py +1 -1
- rasa/cli/studio/link.py +53 -0
- rasa/cli/studio/pull.py +78 -0
- rasa/cli/studio/push.py +78 -0
- rasa/cli/studio/studio.py +12 -0
- rasa/cli/studio/upload.py +8 -0
- rasa/cli/train.py +2 -1
- rasa/cli/utils.py +1 -1
- rasa/cli/x.py +1 -1
- rasa/constants.py +4 -0
- rasa/core/__init__.py +0 -16
- rasa/core/actions/action.py +5 -1
- rasa/core/actions/action_repeat_bot_messages.py +18 -22
- rasa/core/actions/action_run_slot_rejections.py +0 -1
- rasa/core/agent.py +18 -3
- rasa/core/available_endpoints.py +146 -0
- rasa/core/brokers/kafka.py +4 -0
- rasa/core/brokers/pika.py +5 -2
- rasa/core/brokers/sql.py +1 -1
- rasa/core/channels/botframework.py +2 -2
- rasa/core/channels/channel.py +2 -2
- rasa/core/channels/hangouts.py +8 -5
- rasa/core/channels/inspector/.eslintrc.cjs +12 -6
- rasa/core/channels/inspector/.prettierrc +5 -0
- rasa/core/channels/inspector/README.md +10 -4
- rasa/core/channels/inspector/dist/assets/{arc-9f75cc3b.js → arc-c4b064fc.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-7f34db23.js → blockDiagram-38ab4fdb-215b5026.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-948bab2c.js → c4Diagram-3d4e48cf-2b54a0a3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-3730f5fd.js +1 -0
- rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-53b0dd0e.js → classDiagram-70f12bd4-daacea5f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-fdf789e7.js → classDiagram-v2-f2320105-930d4dc2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/clone-e847561e.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-87c4ece5.js → createText-2e5e7dd3-83c206ba.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-5a8b0749.js → edges-e0da2a9e-b0eb01d0.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-66da90e2.js → erDiagram-9861fffd-17586500.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-10044f05.js → flowDb-956e92f1-be2a1776.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-f338f66a.js → flowDiagram-66a62f08-c2120ebd.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-efbbfe00.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-b13140aa.js → flowchart-elk-definition-4a651766-a6ab5c48.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-f2b4a55a.js → ganttDiagram-c361ad54-ef613457.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-dedc298d.js → gitGraphDiagram-72cf32ee-d59185b3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-4ede11ff.js → graph-0f155405.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-65549d37.js → index-3862675e-d5f1d1b7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3a23e736.js → index-47737d3a.js} +123 -123
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-65439671.js → infoDiagram-f8f76790-b07d141f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-56d03d98.js → journeyDiagram-49397b02-1936d429.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-dd48f7f4.js → layout-dde8d0f3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-1569ad2c.js → line-0c2c7ee0.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-48bf4935.js → linear-35dd89a4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-688504c1.js → mindmap-definition-fc14e90a-56192851.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-78b6d7e6.js → pieDiagram-8a3498a8-fc21ed78.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-048b84b3.js → quadrantDiagram-120e2f19-25e98518.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-dd67f107.js → requirementDiagram-deff3bca-546ff1f5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-8128436e.js → sankeyDiagram-04a897e0-02d8b82d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-1a0d1461.js → sequenceDiagram-704730f1-3ca5a92e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-46d388ed.js → stateDiagram-587899a1-128ea07c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-ea42951a.js → stateDiagram-v2-d93cdb3a-95f290af.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-7427ed0c.js → styles-6aaf32cf-4984898a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-ff5e5a16.js → styles-9a916d00-1bf266ba.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-7b3680cf.js → styles-c10674c1-60521c63.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-f860f2ad.js → svgDrawCommon-08f97a94-a25b6e12.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-2eebf0c8.js → timeline-definition-85554ec2-0fc086bf.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-5d7f4e96.js → xychartDiagram-e933f94c-44ee592e.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +1 -1
- rasa/core/channels/inspector/package.json +3 -1
- rasa/core/channels/inspector/src/App.tsx +91 -90
- rasa/core/channels/inspector/src/components/Chat.tsx +45 -41
- rasa/core/channels/inspector/src/components/DiagramFlow.tsx +40 -40
- rasa/core/channels/inspector/src/components/DialogueInformation.tsx +57 -57
- rasa/core/channels/inspector/src/components/DialogueStack.tsx +36 -27
- rasa/core/channels/inspector/src/components/ExpandIcon.tsx +4 -4
- rasa/core/channels/inspector/src/components/FullscreenButton.tsx +7 -7
- rasa/core/channels/inspector/src/components/LoadingSpinner.tsx +28 -12
- rasa/core/channels/inspector/src/components/NoActiveFlow.tsx +9 -9
- rasa/core/channels/inspector/src/components/RasaLogo.tsx +5 -5
- rasa/core/channels/inspector/src/components/RecruitmentPanel.tsx +55 -60
- rasa/core/channels/inspector/src/components/SaraDiagrams.tsx +5 -5
- rasa/core/channels/inspector/src/components/Slots.tsx +22 -22
- rasa/core/channels/inspector/src/components/Welcome.tsx +28 -31
- rasa/core/channels/inspector/src/helpers/audio/audiostream.ts +245 -0
- rasa/core/channels/inspector/src/helpers/audio/microphone-processor.js +12 -0
- rasa/core/channels/inspector/src/helpers/audio/playback-processor.js +36 -0
- rasa/core/channels/inspector/src/helpers/conversation.ts +7 -7
- rasa/core/channels/inspector/src/helpers/formatters.test.ts +181 -181
- rasa/core/channels/inspector/src/helpers/formatters.ts +111 -111
- rasa/core/channels/inspector/src/helpers/utils.ts +78 -61
- rasa/core/channels/inspector/src/main.tsx +8 -8
- rasa/core/channels/inspector/src/theme/Button/Button.ts +8 -8
- rasa/core/channels/inspector/src/theme/Heading/Heading.ts +7 -7
- rasa/core/channels/inspector/src/theme/Input/Input.ts +9 -9
- rasa/core/channels/inspector/src/theme/Link/Link.ts +6 -6
- rasa/core/channels/inspector/src/theme/Modal/Modal.ts +13 -13
- rasa/core/channels/inspector/src/theme/Table/Table.tsx +10 -10
- rasa/core/channels/inspector/src/theme/Tooltip/Tooltip.ts +5 -5
- rasa/core/channels/inspector/src/theme/base/breakpoints.ts +7 -7
- rasa/core/channels/inspector/src/theme/base/colors.ts +64 -64
- rasa/core/channels/inspector/src/theme/base/fonts/fontFaces.css +21 -18
- rasa/core/channels/inspector/src/theme/base/radii.ts +8 -8
- rasa/core/channels/inspector/src/theme/base/shadows.ts +5 -5
- rasa/core/channels/inspector/src/theme/base/sizes.ts +5 -5
- rasa/core/channels/inspector/src/theme/base/space.ts +12 -12
- rasa/core/channels/inspector/src/theme/base/styles.ts +5 -5
- rasa/core/channels/inspector/src/theme/base/typography.ts +12 -12
- rasa/core/channels/inspector/src/theme/base/zIndices.ts +3 -3
- rasa/core/channels/inspector/src/theme/index.ts +38 -38
- rasa/core/channels/inspector/src/types.ts +56 -50
- rasa/core/channels/inspector/yarn.lock +5 -0
- rasa/core/channels/mattermost.py +1 -1
- rasa/core/channels/rasa_chat.py +2 -4
- rasa/core/channels/rest.py +5 -4
- rasa/core/channels/studio_chat.py +3 -2
- rasa/core/channels/vier_cvg.py +1 -2
- rasa/core/channels/voice_ready/audiocodes.py +35 -25
- rasa/core/channels/voice_stream/audiocodes.py +7 -4
- rasa/core/channels/voice_stream/genesys.py +2 -2
- rasa/core/channels/voice_stream/twilio_media_streams.py +10 -5
- rasa/core/channels/voice_stream/voice_channel.py +33 -22
- rasa/core/evaluation/marker_tracker_loader.py +1 -1
- rasa/core/exporter.py +1 -1
- rasa/core/http_interpreter.py +3 -7
- rasa/core/jobs.py +2 -1
- rasa/core/nlg/contextual_response_rephraser.py +38 -11
- rasa/core/nlg/generator.py +0 -1
- rasa/core/nlg/interpolator.py +2 -3
- rasa/core/nlg/summarize.py +40 -6
- rasa/core/persistor.py +55 -20
- rasa/core/policies/enterprise_search_policy.py +290 -66
- rasa/core/policies/enterprise_search_prompt_with_relevancy_check_and_citation_template.jinja2 +63 -0
- rasa/core/policies/flow_policy.py +1 -1
- rasa/core/policies/flows/flow_executor.py +96 -17
- rasa/core/policies/intentless_policy.py +24 -16
- rasa/core/processor.py +106 -53
- rasa/core/run.py +40 -13
- rasa/core/tracker_stores/__init__.py +0 -0
- rasa/core/{auth_retry_tracker_store.py → tracker_stores/auth_retry_tracker_store.py} +5 -1
- rasa/core/tracker_stores/dynamo_tracker_store.py +218 -0
- rasa/core/tracker_stores/mongo_tracker_store.py +206 -0
- rasa/core/tracker_stores/redis_tracker_store.py +219 -0
- rasa/core/tracker_stores/sql_tracker_store.py +555 -0
- rasa/core/tracker_stores/tracker_store.py +805 -0
- rasa/core/training/interactive.py +1 -1
- rasa/core/utils.py +24 -91
- rasa/dialogue_understanding/coexistence/intent_based_router.py +2 -1
- rasa/dialogue_understanding/coexistence/llm_based_router.py +8 -3
- rasa/dialogue_understanding/commands/can_not_handle_command.py +2 -0
- rasa/dialogue_understanding/commands/cancel_flow_command.py +2 -0
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +2 -0
- rasa/dialogue_understanding/commands/clarify_command.py +6 -2
- rasa/dialogue_understanding/commands/command_syntax_manager.py +1 -0
- rasa/dialogue_understanding/commands/human_handoff_command.py +2 -0
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +2 -0
- rasa/dialogue_understanding/commands/repeat_bot_messages_command.py +2 -0
- rasa/dialogue_understanding/commands/set_slot_command.py +11 -1
- rasa/dialogue_understanding/commands/skip_question_command.py +2 -0
- rasa/dialogue_understanding/commands/start_flow_command.py +4 -0
- rasa/dialogue_understanding/commands/utils.py +26 -2
- rasa/dialogue_understanding/generator/__init__.py +7 -1
- rasa/dialogue_understanding/generator/command_generator.py +4 -2
- rasa/dialogue_understanding/generator/command_parser.py +2 -2
- rasa/dialogue_understanding/generator/command_parser_validator.py +63 -0
- rasa/dialogue_understanding/generator/constants.py +2 -2
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +1 -1
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v3_gpt_4o_2024_11_20_template.jinja2 +78 -0
- rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +28 -463
- rasa/dialogue_understanding/generator/single_step/search_ready_llm_command_generator.py +147 -0
- rasa/dialogue_understanding/generator/single_step/single_step_based_llm_command_generator.py +477 -0
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +8 -58
- rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +37 -25
- rasa/dialogue_understanding/patterns/domain_for_patterns.py +190 -0
- rasa/dialogue_understanding/processor/command_processor.py +3 -3
- rasa/dialogue_understanding/processor/command_processor_component.py +3 -3
- rasa/dialogue_understanding/stack/frames/flow_stack_frame.py +17 -4
- rasa/dialogue_understanding/utils.py +68 -12
- rasa/dialogue_understanding_test/du_test_case.py +1 -1
- rasa/dialogue_understanding_test/du_test_runner.py +4 -22
- rasa/dialogue_understanding_test/test_case_simulation/test_case_tracker_simulator.py +2 -6
- rasa/e2e_test/e2e_test_runner.py +1 -1
- rasa/engine/constants.py +1 -1
- rasa/engine/recipes/default_recipe.py +26 -2
- rasa/engine/validation.py +3 -2
- rasa/hooks.py +2 -30
- rasa/keys +1 -0
- rasa/llm_fine_tuning/annotation_module.py +39 -9
- rasa/llm_fine_tuning/conversations.py +3 -0
- rasa/llm_fine_tuning/llm_data_preparation_module.py +66 -49
- rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +4 -2
- rasa/llm_fine_tuning/paraphrasing/rephrase_validator.py +52 -44
- rasa/llm_fine_tuning/paraphrasing_module.py +10 -12
- rasa/llm_fine_tuning/storage.py +4 -4
- rasa/llm_fine_tuning/utils.py +63 -1
- rasa/model_manager/config.py +3 -1
- rasa/model_manager/model_api.py +89 -2
- rasa/model_manager/runner_service.py +8 -4
- rasa/model_manager/trainer_service.py +5 -4
- rasa/model_training.py +12 -3
- rasa/nlu/extractors/crf_entity_extractor.py +66 -16
- rasa/plugin.py +2 -12
- rasa/privacy/__init__.py +0 -0
- rasa/privacy/constants.py +83 -0
- rasa/privacy/event_broker_utils.py +77 -0
- rasa/privacy/privacy_config.py +281 -0
- rasa/privacy/privacy_config_schema.json +86 -0
- rasa/privacy/privacy_filter.py +340 -0
- rasa/privacy/privacy_manager.py +576 -0
- rasa/server.py +29 -4
- rasa/shared/constants.py +6 -0
- rasa/shared/core/constants.py +4 -3
- rasa/shared/core/domain.py +7 -0
- rasa/shared/core/events.py +99 -3
- rasa/shared/core/flows/flow.py +1 -2
- rasa/shared/core/flows/flows_yaml_schema.json +3 -0
- rasa/shared/core/flows/steps/collect.py +46 -2
- rasa/shared/core/slots.py +28 -0
- rasa/shared/exceptions.py +4 -0
- rasa/shared/providers/_configs/azure_openai_client_config.py +4 -0
- rasa/shared/providers/_configs/openai_client_config.py +4 -0
- rasa/shared/providers/embedding/_base_litellm_embedding_client.py +3 -0
- rasa/shared/providers/llm/_base_litellm_client.py +5 -2
- rasa/shared/utils/llm.py +161 -6
- rasa/shared/utils/yaml.py +32 -0
- rasa/studio/data_handler.py +3 -3
- rasa/studio/download/download.py +37 -60
- rasa/studio/download/flows.py +23 -31
- rasa/studio/link.py +200 -0
- rasa/studio/pull.py +94 -0
- rasa/studio/push.py +131 -0
- rasa/studio/upload.py +117 -67
- rasa/telemetry.py +84 -27
- rasa/tracing/config.py +4 -5
- rasa/tracing/constants.py +19 -1
- rasa/tracing/instrumentation/attribute_extractors.py +11 -3
- rasa/tracing/instrumentation/instrumentation.py +54 -3
- rasa/tracing/instrumentation/metrics.py +98 -15
- rasa/tracing/metric_instrument_provider.py +75 -3
- rasa/utils/common.py +1 -27
- rasa/utils/licensing.py +1 -2
- rasa/utils/log_utils.py +1 -45
- rasa/validator.py +2 -8
- rasa/version.py +1 -1
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev8.dist-info}/METADATA +8 -9
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev8.dist-info}/RECORD +254 -231
- rasa/anonymization/__init__.py +0 -2
- rasa/anonymization/anonymisation_rule_yaml_reader.py +0 -91
- rasa/anonymization/anonymization_pipeline.py +0 -286
- rasa/anonymization/anonymization_rule_executor.py +0 -266
- rasa/anonymization/anonymization_rule_orchestrator.py +0 -119
- rasa/anonymization/schemas/config.yml +0 -47
- rasa/anonymization/utils.py +0 -118
- rasa/core/channels/inspector/dist/assets/channel-dfa68278.js +0 -1
- rasa/core/channels/inspector/dist/assets/clone-edb7f119.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-65e7c670.js +0 -1
- rasa/core/channels/inspector/src/helpers/audiostream.ts +0 -191
- rasa/core/tracker_store.py +0 -1792
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev8.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev8.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev8.dist-info}/entry_points.txt +0 -0
|
@@ -4,61 +4,61 @@ import {
|
|
|
4
4
|
useTheme,
|
|
5
5
|
ChakraTheme,
|
|
6
6
|
type ThemeConfig,
|
|
7
|
-
} from
|
|
8
|
-
import { breakpoints, Breakpoints } from
|
|
9
|
-
import { rasaColors, RasaColors } from
|
|
10
|
-
import { rasaRadii, RasaRadii } from
|
|
11
|
-
import { rasaShadows, RasaShadows } from
|
|
12
|
-
import { rasaSizes, RasaSizes } from
|
|
13
|
-
import { rasaSpace, RasaSpace } from
|
|
14
|
-
import { rasaZIndices, RasaZIndices } from
|
|
15
|
-
import { styles } from
|
|
7
|
+
} from '@chakra-ui/react'
|
|
8
|
+
import { breakpoints, Breakpoints } from './base/breakpoints'
|
|
9
|
+
import { rasaColors, RasaColors } from './base/colors'
|
|
10
|
+
import { rasaRadii, RasaRadii } from './base/radii'
|
|
11
|
+
import { rasaShadows, RasaShadows } from './base/shadows'
|
|
12
|
+
import { rasaSizes, RasaSizes } from './base/sizes'
|
|
13
|
+
import { rasaSpace, RasaSpace } from './base/space'
|
|
14
|
+
import { rasaZIndices, RasaZIndices } from './base/zIndices'
|
|
15
|
+
import { styles } from './base/styles'
|
|
16
16
|
import {
|
|
17
17
|
fonts,
|
|
18
18
|
rasaFontSizes,
|
|
19
19
|
rasaFontWeights,
|
|
20
20
|
RasaFontSizes,
|
|
21
21
|
RasaFontWeights,
|
|
22
|
-
} from
|
|
22
|
+
} from './base/typography'
|
|
23
23
|
|
|
24
24
|
// Custom components
|
|
25
|
-
import { Button } from
|
|
26
|
-
import { Heading } from
|
|
27
|
-
import { Input } from
|
|
28
|
-
import { Link } from
|
|
29
|
-
import { Table } from
|
|
30
|
-
import { Modal } from
|
|
31
|
-
import { Tooltip } from
|
|
25
|
+
import { Button } from './Button/Button'
|
|
26
|
+
import { Heading } from './Heading/Heading'
|
|
27
|
+
import { Input } from './Input/Input'
|
|
28
|
+
import { Link } from './Link/Link'
|
|
29
|
+
import { Table } from './Table/Table'
|
|
30
|
+
import { Modal } from './Modal/Modal'
|
|
31
|
+
import { Tooltip } from './Tooltip/Tooltip'
|
|
32
32
|
|
|
33
33
|
export interface CustomTheme {
|
|
34
34
|
// default types
|
|
35
|
-
config: ThemeConfig
|
|
36
|
-
semanticTokens: ChakraTheme[
|
|
37
|
-
direction: ChakraTheme[
|
|
38
|
-
transition: ChakraTheme[
|
|
35
|
+
config: ThemeConfig
|
|
36
|
+
semanticTokens: ChakraTheme['semanticTokens']
|
|
37
|
+
direction: ChakraTheme['direction']
|
|
38
|
+
transition: ChakraTheme['transition']
|
|
39
39
|
|
|
40
40
|
// we merge & override
|
|
41
|
-
styles: ChakraTheme[
|
|
42
|
-
fonts: RasaFontSizes
|
|
43
|
-
breakpoints: Breakpoints
|
|
41
|
+
styles: ChakraTheme['styles']
|
|
42
|
+
fonts: RasaFontSizes
|
|
43
|
+
breakpoints: Breakpoints
|
|
44
44
|
|
|
45
45
|
// we also merge & override, but use custom color names
|
|
46
|
-
colors: RasaColors
|
|
46
|
+
colors: RasaColors
|
|
47
47
|
|
|
48
48
|
// custom key & types
|
|
49
|
-
rasaFontSizes: RasaFontSizes
|
|
50
|
-
rasaFontWeights: RasaFontWeights
|
|
51
|
-
rasaRadii: RasaRadii
|
|
52
|
-
rasaSpace: RasaSpace
|
|
53
|
-
rasaShadows: RasaShadows
|
|
54
|
-
rasaSizes: RasaSizes
|
|
55
|
-
zIndices: ChakraTheme[
|
|
49
|
+
rasaFontSizes: RasaFontSizes
|
|
50
|
+
rasaFontWeights: RasaFontWeights
|
|
51
|
+
rasaRadii: RasaRadii
|
|
52
|
+
rasaSpace: RasaSpace
|
|
53
|
+
rasaShadows: RasaShadows
|
|
54
|
+
rasaSizes: RasaSizes
|
|
55
|
+
zIndices: ChakraTheme['zIndices'] & RasaZIndices
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
const config: ThemeConfig = {
|
|
59
|
-
initialColorMode:
|
|
59
|
+
initialColorMode: 'light',
|
|
60
60
|
useSystemColorMode: false,
|
|
61
|
-
}
|
|
61
|
+
}
|
|
62
62
|
|
|
63
63
|
// Extend theme deep merges with the default Chakra theme.
|
|
64
64
|
// We try to keep many defaults in tact to support
|
|
@@ -93,9 +93,9 @@ export const theme = extendTheme(
|
|
|
93
93
|
rasaSizes,
|
|
94
94
|
zIndices: rasaZIndices,
|
|
95
95
|
},
|
|
96
|
-
withDefaultColorScheme({ colorScheme:
|
|
97
|
-
)
|
|
96
|
+
withDefaultColorScheme({ colorScheme: 'rasaPurple' }),
|
|
97
|
+
)
|
|
98
98
|
|
|
99
99
|
export const useOurTheme = () => {
|
|
100
|
-
return useTheme<CustomTheme>()
|
|
101
|
-
}
|
|
100
|
+
return useTheme<CustomTheme>()
|
|
101
|
+
}
|
|
@@ -1,84 +1,90 @@
|
|
|
1
1
|
export interface Slot {
|
|
2
|
-
name: string
|
|
2
|
+
name: string
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
-
value: any
|
|
4
|
+
value: any
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export interface Event {
|
|
8
|
-
event:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
event:
|
|
9
|
+
| 'user'
|
|
10
|
+
| 'bot'
|
|
11
|
+
| 'flow_completed'
|
|
12
|
+
| 'flow_started'
|
|
13
|
+
| 'stack'
|
|
14
|
+
| 'restart'
|
|
15
|
+
| 'session_ended'
|
|
16
|
+
text?: string
|
|
17
|
+
timestamp: string
|
|
18
|
+
update?: string
|
|
19
|
+
parse_data?: { commands: Command[] }
|
|
20
|
+
metadata?: { utter_action?: string }
|
|
14
21
|
}
|
|
15
22
|
|
|
16
23
|
export interface Command {
|
|
17
|
-
command: string
|
|
18
|
-
flow?: string
|
|
19
|
-
name?: string
|
|
20
|
-
value?: string
|
|
24
|
+
command: string
|
|
25
|
+
flow?: string
|
|
26
|
+
name?: string
|
|
27
|
+
value?: string
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
export interface SelectedStack {
|
|
24
|
-
stack: Stack
|
|
25
|
-
activatedSteps: string[]
|
|
26
|
-
isUserSelected: boolean
|
|
31
|
+
stack: Stack
|
|
32
|
+
activatedSteps: string[]
|
|
33
|
+
isUserSelected: boolean
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
export interface Stack {
|
|
30
|
-
frame_id: string
|
|
31
|
-
flow_id: string
|
|
32
|
-
step_id: string
|
|
33
|
-
collect?: string
|
|
34
|
-
utter?: string
|
|
35
|
-
ended: boolean
|
|
37
|
+
frame_id: string
|
|
38
|
+
flow_id: string
|
|
39
|
+
step_id: string
|
|
40
|
+
collect?: string
|
|
41
|
+
utter?: string
|
|
42
|
+
ended: boolean
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
export interface Tracker {
|
|
39
|
-
sender_id: string
|
|
40
|
-
slots: { [key: string]: unknown }
|
|
41
|
-
events: Event[]
|
|
42
|
-
stack: Stack[]
|
|
46
|
+
sender_id: string
|
|
47
|
+
slots: { [key: string]: unknown }
|
|
48
|
+
events: Event[]
|
|
49
|
+
stack: Stack[]
|
|
43
50
|
}
|
|
44
51
|
|
|
45
|
-
|
|
46
52
|
export interface Flow {
|
|
47
|
-
id: string
|
|
48
|
-
description: string
|
|
49
|
-
name: string
|
|
50
|
-
steps: Step[]
|
|
53
|
+
id: string
|
|
54
|
+
description: string
|
|
55
|
+
name: string
|
|
56
|
+
steps: Step[]
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
interface NextStepThen {
|
|
54
|
-
action: string
|
|
55
|
-
id: string
|
|
56
|
-
next: string
|
|
57
|
-
set_slots: unknown[]
|
|
60
|
+
action: string
|
|
61
|
+
id: string
|
|
62
|
+
next: string
|
|
63
|
+
set_slots: unknown[]
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
interface NextStepIf {
|
|
61
|
-
if: string
|
|
62
|
-
then: NextStepThen[]
|
|
67
|
+
if: string
|
|
68
|
+
then: NextStepThen[]
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
interface NextStepElse {
|
|
66
|
-
if: string
|
|
67
|
-
then: NextStepThen[]
|
|
68
|
-
else: string
|
|
72
|
+
if: string
|
|
73
|
+
then: NextStepThen[]
|
|
74
|
+
else: string
|
|
69
75
|
}
|
|
70
76
|
|
|
71
|
-
export type NextStep = NextStepIf | NextStepElse
|
|
77
|
+
export type NextStep = NextStepIf | NextStepElse
|
|
72
78
|
|
|
73
79
|
interface Step {
|
|
74
|
-
ask_before_filling: boolean
|
|
75
|
-
collect: string
|
|
76
|
-
action: string
|
|
77
|
-
link: string
|
|
78
|
-
description: string
|
|
79
|
-
id: string
|
|
80
|
-
next: string | NextStep[]
|
|
81
|
-
reset_after_flow_ends: boolean
|
|
82
|
-
utter: string
|
|
83
|
-
set_slots?: unknown
|
|
80
|
+
ask_before_filling: boolean
|
|
81
|
+
collect: string
|
|
82
|
+
action: string
|
|
83
|
+
link: string
|
|
84
|
+
description: string
|
|
85
|
+
id: string
|
|
86
|
+
next: string | NextStep[]
|
|
87
|
+
reset_after_flow_ends: boolean
|
|
88
|
+
utter: string
|
|
89
|
+
set_slots?: unknown
|
|
84
90
|
}
|
|
@@ -5280,6 +5280,11 @@ prelude-ls@^1.2.1:
|
|
|
5280
5280
|
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
|
|
5281
5281
|
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
|
|
5282
5282
|
|
|
5283
|
+
prettier@^3.5.3:
|
|
5284
|
+
version "3.5.3"
|
|
5285
|
+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.5.3.tgz#4fc2ce0d657e7a02e602549f053b239cb7dfe1b5"
|
|
5286
|
+
integrity sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==
|
|
5287
|
+
|
|
5283
5288
|
pretty-format@^27.0.2:
|
|
5284
5289
|
version "27.5.1"
|
|
5285
5290
|
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e"
|
rasa/core/channels/mattermost.py
CHANGED
|
@@ -28,7 +28,7 @@ class MattermostBot(OutputChannel):
|
|
|
28
28
|
if r.status_code == 200:
|
|
29
29
|
return r.headers["Token"]
|
|
30
30
|
else:
|
|
31
|
-
logger.error(f"Failed to login mattermost user
|
|
31
|
+
logger.error(f"Failed to login mattermost user. Response: {r}")
|
|
32
32
|
return None
|
|
33
33
|
|
|
34
34
|
def __init__(
|
rasa/core/channels/rasa_chat.py
CHANGED
|
@@ -107,10 +107,8 @@ class RasaChatInput(RestInput):
|
|
|
107
107
|
return req.json[CONVERSATION_ID_KEY]
|
|
108
108
|
else:
|
|
109
109
|
logger.error(
|
|
110
|
-
"User
|
|
111
|
-
"conversation '{}'.".format(
|
|
112
|
-
jwt_payload[JWT_USERNAME_KEY], req.json[CONVERSATION_ID_KEY]
|
|
113
|
-
)
|
|
110
|
+
"User does not have permissions to send messages to "
|
|
111
|
+
"conversation '{}'.".format(req.json[CONVERSATION_ID_KEY])
|
|
114
112
|
)
|
|
115
113
|
raise SanicException(status_code=401)
|
|
116
114
|
|
rasa/core/channels/rest.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
import copy
|
|
3
2
|
import inspect
|
|
4
3
|
import json
|
|
5
4
|
import logging
|
|
@@ -166,11 +165,13 @@ class RestInput(InputChannel):
|
|
|
166
165
|
)
|
|
167
166
|
except CancelledError:
|
|
168
167
|
structlogger.error(
|
|
169
|
-
"rest.message.received.timeout",
|
|
168
|
+
"rest.message.received.timeout",
|
|
169
|
+
event_info="Message processing was cancelled.",
|
|
170
170
|
)
|
|
171
|
-
except Exception:
|
|
171
|
+
except Exception as e:
|
|
172
172
|
structlogger.exception(
|
|
173
|
-
"rest.message.received.failure",
|
|
173
|
+
"rest.message.received.failure",
|
|
174
|
+
event_info=f"Message processing failed. Error: {e}",
|
|
174
175
|
)
|
|
175
176
|
|
|
176
177
|
return response.json(collector.messages)
|
|
@@ -83,7 +83,9 @@ class StudioTrackerUpdatePlugin:
|
|
|
83
83
|
|
|
84
84
|
def handle_tracker_update(self, tracker: "DialogueStateTracker") -> None:
|
|
85
85
|
"""Handles a tracker update when triggered by a hook."""
|
|
86
|
-
structlogger.info(
|
|
86
|
+
structlogger.info(
|
|
87
|
+
"studio_chat.after_tracker_update", sender_id=tracker.sender_id
|
|
88
|
+
)
|
|
87
89
|
# directly create a dump to avoid the tracker getting modified by another
|
|
88
90
|
# function before it gets published (since the publishing is scheduled
|
|
89
91
|
# as an async task)
|
|
@@ -185,7 +187,6 @@ class StudioChatInput(SocketIOInput):
|
|
|
185
187
|
output_channel = self.get_output_channel()
|
|
186
188
|
|
|
187
189
|
await processor._run_prediction_loop(output_channel, tracker)
|
|
188
|
-
await processor.run_anonymization_pipeline(tracker)
|
|
189
190
|
await self.agent.tracker_store.save(tracker)
|
|
190
191
|
|
|
191
192
|
await self.on_tracker_updated(tracker)
|
rasa/core/channels/vier_cvg.py
CHANGED
|
@@ -129,9 +129,8 @@ class CVGOutput(OutputChannel):
|
|
|
129
129
|
)
|
|
130
130
|
|
|
131
131
|
logger.info(
|
|
132
|
-
"Creating incoming UserMessage: {
|
|
132
|
+
"Creating incoming UserMessage: {output_channel=%s, sender_id=%s, metadata=%s}" # noqa: E501
|
|
133
133
|
% (
|
|
134
|
-
user_message.text,
|
|
135
134
|
user_message.output_channel,
|
|
136
135
|
user_message.sender_id,
|
|
137
136
|
user_message.metadata,
|
|
@@ -160,6 +160,12 @@ class Conversation:
|
|
|
160
160
|
structlogger.warning(
|
|
161
161
|
"audiocodes.handle.activities.duplicate_activity",
|
|
162
162
|
activity_id=activity[ACTIVITY_ID_KEY],
|
|
163
|
+
event_info=(
|
|
164
|
+
"Audiocodes might send duplicate activities if the bot has not "
|
|
165
|
+
"responded to the previous one or responded too late. Please "
|
|
166
|
+
"consider enabling the `use_websocket` option to use"
|
|
167
|
+
" Audiocodes Asynchronous API."
|
|
168
|
+
),
|
|
163
169
|
)
|
|
164
170
|
continue
|
|
165
171
|
self.activity_ids.append(activity[ACTIVITY_ID_KEY])
|
|
@@ -187,16 +193,9 @@ class Conversation:
|
|
|
187
193
|
try:
|
|
188
194
|
await on_new_message(user_msg)
|
|
189
195
|
except Exception as e: # skipcq: PYL-W0703
|
|
190
|
-
if isinstance(user_msg.text, dict):
|
|
191
|
-
anonymized_info = json.dumps(user_msg.text)
|
|
192
|
-
elif isinstance(user_msg.text, str):
|
|
193
|
-
anonymized_info = user_msg.text
|
|
194
|
-
else:
|
|
195
|
-
anonymized_info = INFO_UNKNOWN
|
|
196
|
-
|
|
197
196
|
structlogger.exception(
|
|
198
197
|
"audiocodes.handle.activities.failure",
|
|
199
|
-
|
|
198
|
+
sender_id=self.conversation_id,
|
|
200
199
|
error=e,
|
|
201
200
|
exc_info=True,
|
|
202
201
|
)
|
|
@@ -415,30 +414,41 @@ class AudiocodesInput(InputChannel):
|
|
|
415
414
|
"audiocodes.on_activities.no_conversation", request=request.json
|
|
416
415
|
)
|
|
417
416
|
return response.json({})
|
|
418
|
-
|
|
417
|
+
|
|
418
|
+
if self.use_websocket:
|
|
419
|
+
# send an empty response for this request
|
|
420
|
+
# activities are processed in the background
|
|
421
|
+
# chat response is sent via the websocket
|
|
419
422
|
ac_output: Union[WebsocketOutput, AudiocodesOutput] = WebsocketOutput(
|
|
420
423
|
conversation.ws, conversation_id
|
|
421
424
|
)
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
self._create_task(
|
|
426
|
+
conversation_id,
|
|
427
|
+
conversation.handle_activities(
|
|
428
|
+
request.json,
|
|
429
|
+
input_channel_name=self.name(),
|
|
430
|
+
output_channel=ac_output,
|
|
431
|
+
on_new_message=on_new_message,
|
|
432
|
+
),
|
|
433
|
+
)
|
|
434
|
+
return response.json({})
|
|
435
|
+
|
|
436
|
+
# without websockets, this becomes a blocking call
|
|
437
|
+
# and the response is sent back to the Audiocodes server
|
|
438
|
+
# after the activities are processed
|
|
439
|
+
ac_output = AudiocodesOutput()
|
|
440
|
+
await conversation.handle_activities(
|
|
441
|
+
request.json,
|
|
442
|
+
input_channel_name=self.name(),
|
|
443
|
+
output_channel=ac_output,
|
|
444
|
+
on_new_message=on_new_message,
|
|
445
|
+
)
|
|
446
|
+
return response.json(
|
|
447
|
+
{
|
|
427
448
|
"conversation": conversation_id,
|
|
428
449
|
"activities": ac_output.messages,
|
|
429
450
|
}
|
|
430
|
-
|
|
431
|
-
# start a background task to handle activities
|
|
432
|
-
self._create_task(
|
|
433
|
-
conversation_id,
|
|
434
|
-
conversation.handle_activities(
|
|
435
|
-
request.json,
|
|
436
|
-
input_channel_name=self.name(),
|
|
437
|
-
output_channel=ac_output,
|
|
438
|
-
on_new_message=on_new_message,
|
|
439
|
-
),
|
|
440
451
|
)
|
|
441
|
-
return response.json(response_json)
|
|
442
452
|
|
|
443
453
|
@ac_webhook.route(
|
|
444
454
|
"/conversation/<conversation_id>/disconnect", methods=["POST"]
|
|
@@ -108,15 +108,19 @@ class AudiocodesVoiceInputChannel(VoiceInputChannel):
|
|
|
108
108
|
server_url: str,
|
|
109
109
|
asr_config: Dict,
|
|
110
110
|
tts_config: Dict,
|
|
111
|
-
monitor_silence: bool = False,
|
|
112
111
|
):
|
|
113
112
|
mark_as_beta_feature("Audiocodes (audiocodes_stream) Channel")
|
|
114
|
-
super().__init__(
|
|
113
|
+
super().__init__(
|
|
114
|
+
server_url=server_url,
|
|
115
|
+
asr_config=asr_config,
|
|
116
|
+
tts_config=tts_config,
|
|
117
|
+
)
|
|
115
118
|
self.token = token
|
|
116
119
|
|
|
117
120
|
@classmethod
|
|
118
121
|
def from_credentials(
|
|
119
|
-
cls,
|
|
122
|
+
cls,
|
|
123
|
+
credentials: Optional[Dict[str, Any]],
|
|
120
124
|
) -> VoiceInputChannel:
|
|
121
125
|
if not credentials:
|
|
122
126
|
raise ValueError("No credentials given for Audiocodes voice channel.")
|
|
@@ -126,7 +130,6 @@ class AudiocodesVoiceInputChannel(VoiceInputChannel):
|
|
|
126
130
|
server_url=credentials["server_url"],
|
|
127
131
|
asr_config=credentials["asr"],
|
|
128
132
|
tts_config=credentials["tts"],
|
|
129
|
-
monitor_silence=credentials.get("monitor_silence", False),
|
|
130
133
|
)
|
|
131
134
|
|
|
132
135
|
def channel_bytes_to_rasa_audio_bytes(self, input_bytes: bytes) -> RasaAudioBytes:
|
|
@@ -99,7 +99,8 @@ class GenesysInputChannel(VoiceInputChannel):
|
|
|
99
99
|
|
|
100
100
|
@classmethod
|
|
101
101
|
def from_credentials(
|
|
102
|
-
cls,
|
|
102
|
+
cls,
|
|
103
|
+
credentials: Optional[Dict[str, Any]],
|
|
103
104
|
) -> VoiceInputChannel:
|
|
104
105
|
if not credentials:
|
|
105
106
|
raise ValueError("No credentials given for Genesys voice channel.")
|
|
@@ -113,7 +114,6 @@ class GenesysInputChannel(VoiceInputChannel):
|
|
|
113
114
|
server_url=credentials["server_url"],
|
|
114
115
|
asr_config=credentials["asr"],
|
|
115
116
|
tts_config=credentials["tts"],
|
|
116
|
-
monitor_silence=credentials.get("monitor_silence", False),
|
|
117
117
|
)
|
|
118
118
|
|
|
119
119
|
def _ensure_channel_data_initialized(self) -> None:
|
|
@@ -14,7 +14,7 @@ from sanic import ( # type: ignore[attr-defined]
|
|
|
14
14
|
response,
|
|
15
15
|
)
|
|
16
16
|
|
|
17
|
-
from rasa.core.channels import
|
|
17
|
+
from rasa.core.channels import UserMessage
|
|
18
18
|
from rasa.core.channels.channel import (
|
|
19
19
|
create_auth_requested_response_provider,
|
|
20
20
|
requires_basic_auth,
|
|
@@ -102,16 +102,22 @@ class TwilioMediaStreamsInputChannel(VoiceInputChannel):
|
|
|
102
102
|
server_url: str,
|
|
103
103
|
asr_config: Dict,
|
|
104
104
|
tts_config: Dict,
|
|
105
|
-
monitor_silence: bool = False,
|
|
106
105
|
username: Optional[Text] = None,
|
|
107
106
|
password: Optional[Text] = None,
|
|
108
107
|
):
|
|
109
|
-
super().__init__(
|
|
108
|
+
super().__init__(
|
|
109
|
+
server_url=server_url,
|
|
110
|
+
asr_config=asr_config,
|
|
111
|
+
tts_config=tts_config,
|
|
112
|
+
)
|
|
110
113
|
self.username = username
|
|
111
114
|
self.password = password
|
|
112
115
|
|
|
113
116
|
@classmethod
|
|
114
|
-
def from_credentials(
|
|
117
|
+
def from_credentials(
|
|
118
|
+
cls,
|
|
119
|
+
credentials: Optional[Dict[str, Any]],
|
|
120
|
+
) -> VoiceInputChannel:
|
|
115
121
|
credentials = credentials or {}
|
|
116
122
|
|
|
117
123
|
username = credentials.get("username")
|
|
@@ -126,7 +132,6 @@ class TwilioMediaStreamsInputChannel(VoiceInputChannel):
|
|
|
126
132
|
credentials["server_url"],
|
|
127
133
|
credentials["asr"],
|
|
128
134
|
credentials["tts"],
|
|
129
|
-
credentials.get("monitor_silence", False),
|
|
130
135
|
username=username,
|
|
131
136
|
password=password,
|
|
132
137
|
)
|
|
@@ -31,8 +31,10 @@ from rasa.core.channels.voice_stream.tts.azure import AzureTTS
|
|
|
31
31
|
from rasa.core.channels.voice_stream.tts.cartesia import CartesiaTTS
|
|
32
32
|
from rasa.core.channels.voice_stream.tts.tts_cache import TTSCache
|
|
33
33
|
from rasa.core.channels.voice_stream.tts.tts_engine import TTSEngine, TTSError
|
|
34
|
-
from rasa.core.channels.voice_stream.util import
|
|
35
|
-
|
|
34
|
+
from rasa.core.channels.voice_stream.util import (
|
|
35
|
+
generate_silence,
|
|
36
|
+
)
|
|
37
|
+
from rasa.shared.core.constants import SILENCE_TIMEOUT_SLOT
|
|
36
38
|
from rasa.shared.utils.cli import print_error_and_exit
|
|
37
39
|
from rasa.shared.utils.common import (
|
|
38
40
|
class_from_module_path,
|
|
@@ -171,8 +173,12 @@ class VoiceOutputChannel(OutputChannel):
|
|
|
171
173
|
def update_silence_timeout(self) -> None:
|
|
172
174
|
"""Updates the silence timeout for the session."""
|
|
173
175
|
if self.tracker_state:
|
|
174
|
-
call_state.silence_timeout =
|
|
175
|
-
|
|
176
|
+
call_state.silence_timeout = self.tracker_state["slots"][ # type: ignore[attr-defined]
|
|
177
|
+
SILENCE_TIMEOUT_SLOT
|
|
178
|
+
]
|
|
179
|
+
logger.debug(
|
|
180
|
+
"voice_channel.silence_timeout_updated",
|
|
181
|
+
silence_timeout=call_state.silence_timeout,
|
|
176
182
|
)
|
|
177
183
|
|
|
178
184
|
async def send_text_with_buttons(
|
|
@@ -285,21 +291,24 @@ class VoiceInputChannel(InputChannel):
|
|
|
285
291
|
server_url: str,
|
|
286
292
|
asr_config: Dict,
|
|
287
293
|
tts_config: Dict,
|
|
288
|
-
monitor_silence: bool = False,
|
|
289
294
|
):
|
|
290
295
|
validate_voice_license_scope()
|
|
291
296
|
self.server_url = server_url
|
|
292
297
|
self.asr_config = asr_config
|
|
293
298
|
self.tts_config = tts_config
|
|
294
|
-
self.monitor_silence = monitor_silence
|
|
295
299
|
self.tts_cache = TTSCache(tts_config.get("cache_size", 1000))
|
|
296
300
|
|
|
301
|
+
logger.info(
|
|
302
|
+
"voice_channel.initialized",
|
|
303
|
+
server_url=self.server_url,
|
|
304
|
+
asr_config=self.asr_config,
|
|
305
|
+
tts_config=self.tts_config,
|
|
306
|
+
)
|
|
307
|
+
|
|
297
308
|
async def monitor_silence_timeout(self, asr_event_queue: asyncio.Queue) -> None:
|
|
298
309
|
timeout = call_state.silence_timeout
|
|
299
310
|
if not timeout:
|
|
300
311
|
return
|
|
301
|
-
if not self.monitor_silence:
|
|
302
|
-
return
|
|
303
312
|
logger.debug("voice_channel.silence_timeout_watch_started", timeout=timeout)
|
|
304
313
|
await asyncio.sleep(timeout)
|
|
305
314
|
await asr_event_queue.put(UserSilence())
|
|
@@ -314,13 +323,15 @@ class VoiceInputChannel(InputChannel):
|
|
|
314
323
|
call_state.silence_timeout_watcher = None # type: ignore[attr-defined]
|
|
315
324
|
|
|
316
325
|
@classmethod
|
|
317
|
-
def from_credentials(
|
|
326
|
+
def from_credentials(
|
|
327
|
+
cls,
|
|
328
|
+
credentials: Optional[Dict[str, Any]],
|
|
329
|
+
) -> InputChannel:
|
|
318
330
|
credentials = credentials or {}
|
|
319
331
|
return cls(
|
|
320
332
|
credentials["server_url"],
|
|
321
333
|
credentials["asr"],
|
|
322
334
|
credentials["tts"],
|
|
323
|
-
credentials.get("monitor_silence", False),
|
|
324
335
|
)
|
|
325
336
|
|
|
326
337
|
def channel_bytes_to_rasa_audio_bytes(self, input_bytes: bytes) -> RasaAudioBytes:
|
|
@@ -340,9 +351,9 @@ class VoiceInputChannel(InputChannel):
|
|
|
340
351
|
) -> None:
|
|
341
352
|
output_channel = self.create_output_channel(channel_websocket, tts_engine)
|
|
342
353
|
message = UserMessage(
|
|
343
|
-
USER_CONVERSATION_SESSION_START,
|
|
344
|
-
output_channel,
|
|
345
|
-
call_parameters.stream_id,
|
|
354
|
+
text=USER_CONVERSATION_SESSION_START,
|
|
355
|
+
output_channel=output_channel,
|
|
356
|
+
sender_id=call_parameters.stream_id,
|
|
346
357
|
input_channel=self.name(),
|
|
347
358
|
metadata=asdict(call_parameters),
|
|
348
359
|
)
|
|
@@ -377,17 +388,17 @@ class VoiceInputChannel(InputChannel):
|
|
|
377
388
|
|
|
378
389
|
async def consume_audio_bytes() -> None:
|
|
379
390
|
async for message in channel_websocket:
|
|
380
|
-
|
|
391
|
+
was_bot_speaking_before = call_state.is_bot_speaking
|
|
381
392
|
channel_action = self.map_input_message(message, channel_websocket)
|
|
382
393
|
is_bot_speaking_after = call_state.is_bot_speaking
|
|
383
394
|
|
|
384
|
-
if not
|
|
395
|
+
if not was_bot_speaking_before and is_bot_speaking_after:
|
|
385
396
|
logger.debug("voice_channel.bot_started_speaking")
|
|
386
397
|
# relevant when the bot speaks multiple messages in one turn
|
|
387
398
|
self._cancel_silence_timeout_watcher()
|
|
388
399
|
|
|
389
400
|
# we just stopped speaking, starting a watcher for silence timeout
|
|
390
|
-
if
|
|
401
|
+
if was_bot_speaking_before and not is_bot_speaking_after:
|
|
391
402
|
logger.debug("voice_channel.bot_stopped_speaking")
|
|
392
403
|
self._cancel_silence_timeout_watcher()
|
|
393
404
|
call_state.silence_timeout_watcher = ( # type: ignore[attr-defined]
|
|
@@ -458,9 +469,9 @@ class VoiceInputChannel(InputChannel):
|
|
|
458
469
|
call_state.is_user_speaking = False # type: ignore[attr-defined]
|
|
459
470
|
output_channel = self.create_output_channel(voice_websocket, tts_engine)
|
|
460
471
|
message = UserMessage(
|
|
461
|
-
e.text,
|
|
462
|
-
output_channel,
|
|
463
|
-
call_parameters.stream_id,
|
|
472
|
+
text=e.text,
|
|
473
|
+
output_channel=output_channel,
|
|
474
|
+
sender_id=call_parameters.stream_id,
|
|
464
475
|
input_channel=self.name(),
|
|
465
476
|
metadata=asdict(call_parameters),
|
|
466
477
|
)
|
|
@@ -471,9 +482,9 @@ class VoiceInputChannel(InputChannel):
|
|
|
471
482
|
elif isinstance(e, UserSilence):
|
|
472
483
|
output_channel = self.create_output_channel(voice_websocket, tts_engine)
|
|
473
484
|
message = UserMessage(
|
|
474
|
-
USER_CONVERSATION_SILENCE_TIMEOUT,
|
|
475
|
-
output_channel,
|
|
476
|
-
call_parameters.stream_id,
|
|
485
|
+
text=USER_CONVERSATION_SILENCE_TIMEOUT,
|
|
486
|
+
output_channel=output_channel,
|
|
487
|
+
sender_id=call_parameters.stream_id,
|
|
477
488
|
input_channel=self.name(),
|
|
478
489
|
metadata=asdict(call_parameters),
|
|
479
490
|
)
|
|
@@ -2,7 +2,7 @@ import random
|
|
|
2
2
|
from typing import Any, AsyncIterator, Iterable, List, Optional, Text
|
|
3
3
|
|
|
4
4
|
import rasa.shared.utils.io
|
|
5
|
-
from rasa.core.tracker_store import TrackerStore
|
|
5
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
6
6
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
7
7
|
from rasa.shared.exceptions import RasaException
|
|
8
8
|
|