rasa-pro 3.13.0.dev3__py3-none-any.whl → 3.13.0.dev7__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 +3 -1
- rasa/api.py +4 -0
- rasa/cli/arguments/default_arguments.py +13 -1
- rasa/cli/arguments/train.py +2 -0
- rasa/cli/evaluate.py +1 -1
- rasa/cli/export.py +2 -2
- rasa/cli/inspect.py +8 -4
- rasa/cli/project_templates/default/config.yml +5 -32
- rasa/cli/project_templates/{calm → default}/e2e_tests/cancelations/user_cancels_during_a_correction.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/cancelations/user_changes_mind_on_a_whim.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/corrections/user_corrects_contact_handle.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/corrections/user_corrects_contact_name.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_adds_contact_to_their_list.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_lists_contacts.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_removes_contact.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_removes_contact_from_list.yml +1 -1
- rasa/cli/project_templates/default/endpoints.yml +18 -2
- rasa/cli/scaffold.py +3 -4
- rasa/cli/studio/download.py +1 -1
- rasa/cli/studio/upload.py +0 -6
- rasa/cli/train.py +1 -0
- rasa/constants.py +2 -0
- rasa/core/agent.py +2 -2
- rasa/core/brokers/kafka.py +4 -0
- rasa/core/brokers/pika.py +4 -0
- rasa/core/brokers/sql.py +1 -1
- rasa/core/channels/channel.py +68 -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-c7691751.js → arc-c4b064fc.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-ab99dff7.js → blockDiagram-38ab4fdb-215b5026.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-08c35a6b.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-9e9c71c9.js → classDiagram-70f12bd4-daacea5f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-15e7e2bf.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-9c105cb1.js → createText-2e5e7dd3-83c206ba.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-77e89e48.js → edges-e0da2a9e-b0eb01d0.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-7a011646.js → erDiagram-9861fffd-17586500.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-b6f105ac.js → flowDb-956e92f1-be2a1776.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-ce4f18c2.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-cb5f6da4.js → flowchart-elk-definition-4a651766-a6ab5c48.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-e4d19e28.js → ganttDiagram-c361ad54-ef613457.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-727b1c33.js → gitGraphDiagram-72cf32ee-d59185b3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-6e2ab9a7.js → graph-0f155405.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-84ec700f.js → index-3862675e-d5f1d1b7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-098a1a24.js → index-47737d3a.js} +162 -149
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-78dda442.js → infoDiagram-f8f76790-b07d141f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-f1cc6dd1.js → journeyDiagram-49397b02-1936d429.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-d98dcd0c.js → layout-dde8d0f3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-838e3d82.js → line-0c2c7ee0.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-eae72406.js → linear-35dd89a4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-c96fd84b.js → mindmap-definition-fc14e90a-56192851.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-c936d4e2.js → pieDiagram-8a3498a8-fc21ed78.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-b338eb8f.js → quadrantDiagram-120e2f19-25e98518.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-c6b6c0d5.js → requirementDiagram-deff3bca-546ff1f5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-b9372e19.js → sankeyDiagram-04a897e0-02d8b82d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-479e0a3f.js → sequenceDiagram-704730f1-3ca5a92e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-fd26eebc.js → stateDiagram-587899a1-128ea07c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-3233e0ae.js → stateDiagram-v2-d93cdb3a-95f290af.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-1fdd392b.js → styles-6aaf32cf-4984898a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-6d7bfa1b.js → styles-9a916d00-1bf266ba.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-f86aab11.js → styles-c10674c1-60521c63.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-e3e49d7a.js → svgDrawCommon-08f97a94-a25b6e12.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-6fe08b4d.js → timeline-definition-85554ec2-0fc086bf.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-c2e06fd6.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 +92 -90
- rasa/core/channels/inspector/src/components/Chat.tsx +61 -36
- rasa/core/channels/inspector/src/components/DiagramFlow.tsx +40 -43
- 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 +16 -0
- 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/voice_ready/audiocodes.py +75 -32
- rasa/core/channels/voice_ready/twilio_voice.py +48 -1
- rasa/core/channels/voice_stream/tts/azure.py +11 -2
- rasa/core/channels/voice_stream/twilio_media_streams.py +101 -26
- rasa/core/channels/voice_stream/voice_channel.py +28 -2
- rasa/core/concurrent_lock_store.py +24 -10
- rasa/core/evaluation/marker_tracker_loader.py +1 -1
- rasa/core/exporter.py +1 -1
- rasa/core/lock_store.py +151 -60
- rasa/core/nlg/contextual_response_rephraser.py +4 -2
- rasa/core/nlg/summarize.py +1 -1
- rasa/core/persistor.py +55 -20
- rasa/core/policies/enterprise_search_policy.py +7 -4
- rasa/core/policies/intentless_policy.py +15 -9
- rasa/core/processor.py +2 -2
- rasa/core/run.py +7 -2
- 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/utils.py +6 -0
- rasa/dialogue_understanding/coexistence/llm_based_router.py +8 -3
- rasa/dialogue_understanding/commands/clarify_command.py +2 -2
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +2 -2
- 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_v2_gpt_4o_2024_11_20_template.jinja2 +33 -12
- rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +2 -2
- rasa/dialogue_understanding_test/du_test_case.py +16 -8
- rasa/hooks.py +2 -2
- rasa/keys +1 -0
- rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +4 -2
- rasa/model_manager/config.py +3 -1
- rasa/model_manager/model_api.py +1 -2
- rasa/model_manager/runner_service.py +8 -4
- rasa/model_manager/trainer_service.py +1 -0
- rasa/model_training.py +12 -3
- rasa/nlu/extractors/crf_entity_extractor.py +66 -16
- rasa/plugin.py +1 -4
- rasa/server.py +6 -2
- rasa/shared/constants.py +4 -0
- rasa/shared/core/domain.py +165 -11
- rasa/shared/core/events.py +68 -2
- rasa/shared/core/flows/flow.py +155 -131
- rasa/shared/core/flows/flow_step.py +19 -3
- rasa/shared/core/flows/flow_step_links.py +15 -0
- rasa/shared/core/flows/flow_step_sequence.py +6 -0
- rasa/shared/core/flows/nlu_trigger.py +13 -0
- rasa/shared/core/flows/steps/action.py +7 -4
- rasa/shared/core/flows/steps/call.py +11 -4
- rasa/shared/core/flows/steps/collect.py +27 -6
- rasa/shared/core/flows/steps/internal.py +6 -1
- rasa/shared/core/flows/steps/link.py +7 -4
- rasa/shared/core/flows/steps/no_operation.py +7 -4
- rasa/shared/core/flows/steps/set_slots.py +8 -4
- rasa/shared/core/flows/yaml_flows_io.py +106 -5
- rasa/shared/importers/importer.py +8 -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/_utils.py +83 -0
- rasa/shared/providers/embedding/_base_litellm_embedding_client.py +3 -0
- rasa/shared/providers/llm/_base_litellm_client.py +11 -5
- rasa/shared/providers/llm/azure_openai_llm_client.py +6 -68
- rasa/shared/providers/router/_base_litellm_router_client.py +53 -1
- rasa/shared/utils/common.py +42 -0
- rasa/studio/download/__init__.py +0 -0
- rasa/studio/download/domains.py +49 -0
- rasa/studio/download/download.py +439 -0
- rasa/studio/download/flows.py +359 -0
- rasa/studio/results_logger.py +6 -1
- rasa/studio/upload.py +69 -5
- rasa/telemetry.py +2 -2
- rasa/tracing/config.py +1 -1
- rasa/tracing/instrumentation/attribute_extractors.py +1 -1
- rasa/tracing/instrumentation/instrumentation.py +1 -1
- rasa/utils/common.py +36 -0
- rasa/utils/endpoints.py +22 -1
- rasa/utils/licensing.py +2 -3
- rasa/validator.py +1 -2
- rasa/version.py +1 -1
- {rasa_pro-3.13.0.dev3.dist-info → rasa_pro-3.13.0.dev7.dist-info}/METADATA +10 -10
- {rasa_pro-3.13.0.dev3.dist-info → rasa_pro-3.13.0.dev7.dist-info}/RECORD +213 -210
- rasa/cli/project_templates/calm/config.yml +0 -10
- rasa/cli/project_templates/calm/credentials.yml +0 -33
- rasa/cli/project_templates/calm/endpoints.yml +0 -58
- rasa/cli/project_templates/default/actions/actions.py +0 -27
- rasa/cli/project_templates/default/data/nlu.yml +0 -91
- rasa/cli/project_templates/default/data/rules.yml +0 -13
- rasa/cli/project_templates/default/data/stories.yml +0 -30
- rasa/cli/project_templates/default/domain.yml +0 -34
- rasa/cli/project_templates/default/tests/test_stories.yml +0 -91
- rasa/core/channels/inspector/dist/assets/channel-11268142.js +0 -1
- rasa/core/channels/inspector/dist/assets/clone-ff7f2ce7.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-cba7ae20.js +0 -1
- rasa/core/channels/inspector/src/helpers/audiostream.ts +0 -191
- rasa/core/tracker_store.py +0 -1792
- rasa/studio/download.py +0 -489
- /rasa/cli/project_templates/{calm → default}/actions/action_template.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/add_contact.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/db.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/list_contacts.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/remove_contact.py +0 -0
- /rasa/cli/project_templates/{calm → default}/data/flows/add_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/data/flows/list_contacts.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/data/flows/remove_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/db/contacts.json +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/add_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/list_contacts.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/remove_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/shared.yml +0 -0
- /rasa/{cli/project_templates/calm/actions → core/tracker_stores}/__init__.py +0 -0
- {rasa_pro-3.13.0.dev3.dist-info → rasa_pro-3.13.0.dev7.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.0.dev3.dist-info → rasa_pro-3.13.0.dev7.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.0.dev3.dist-info → rasa_pro-3.13.0.dev7.dist-info}/entry_points.txt +0 -0
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# This file contains the credentials for the voice & chat platforms
|
|
2
|
-
# which your bot is using.
|
|
3
|
-
# https://rasa.com/docs/rasa-pro/connectors/messaging-and-voice-channels/
|
|
4
|
-
|
|
5
|
-
rest:
|
|
6
|
-
# # you don't need to provide anything here - this channel doesn't
|
|
7
|
-
# # require any credentials
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
#facebook:
|
|
11
|
-
# verify: "<verify>"
|
|
12
|
-
# secret: "<your secret>"
|
|
13
|
-
# page-access-token: "<your page access token>"
|
|
14
|
-
|
|
15
|
-
#slack:
|
|
16
|
-
# slack_token: "<your slack token>"
|
|
17
|
-
# slack_channel: "<the slack channel>"
|
|
18
|
-
# slack_signing_secret: "<your slack signing secret>"
|
|
19
|
-
|
|
20
|
-
#socketio:
|
|
21
|
-
# user_message_evt: <event name for user message>
|
|
22
|
-
# bot_message_evt: <event name for bot messages>
|
|
23
|
-
# session_persistence: <true/false>
|
|
24
|
-
|
|
25
|
-
#mattermost:
|
|
26
|
-
# url: "https://<mattermost instance>/api/v4"
|
|
27
|
-
# token: "<bot token>"
|
|
28
|
-
# webhook_url: "<callback URL>"
|
|
29
|
-
|
|
30
|
-
# This entry is needed if you are using Rasa Enterprise. The entry represents credentials
|
|
31
|
-
# for the Rasa Enterprise "channel", i.e. Talk to your bot and Share with guest testers.
|
|
32
|
-
rasa:
|
|
33
|
-
url: "http://localhost:5002/api"
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# This file contains the different endpoints your bot can use.
|
|
2
|
-
|
|
3
|
-
# Server where the models are pulled from.
|
|
4
|
-
# https://rasa.com/docs/rasa-pro/production/model-storage#fetching-models-from-a-server
|
|
5
|
-
|
|
6
|
-
#models:
|
|
7
|
-
# url: http://my-server.com/models/default_core@latest
|
|
8
|
-
# wait_time_between_pulls: 10 # [optional](default: 100)
|
|
9
|
-
|
|
10
|
-
# Server which runs your custom actions.
|
|
11
|
-
# https://rasa.com/docs/rasa-pro/concepts/custom-actions
|
|
12
|
-
|
|
13
|
-
action_endpoint:
|
|
14
|
-
actions_module: "actions"
|
|
15
|
-
|
|
16
|
-
# Tracker store which is used to store the conversations.
|
|
17
|
-
# By default the conversations are stored in memory.
|
|
18
|
-
# https://rasa.com/docs/rasa-pro/production/tracker-stores
|
|
19
|
-
|
|
20
|
-
#tracker_store:
|
|
21
|
-
# type: redis
|
|
22
|
-
# url: <host of the redis instance, e.g. localhost>
|
|
23
|
-
# port: <port of your redis instance, usually 6379>
|
|
24
|
-
# db: <number of your database within redis, e.g. 0>
|
|
25
|
-
# password: <password used for authentication>
|
|
26
|
-
# use_ssl: <whether or not the communication is encrypted, default false>
|
|
27
|
-
|
|
28
|
-
#tracker_store:
|
|
29
|
-
# type: mongod
|
|
30
|
-
# url: <url to your mongo instance, e.g. mongodb://localhost:27017>
|
|
31
|
-
# db: <name of the db within your mongo instance, e.g. rasa>
|
|
32
|
-
# username: <username used for authentication>
|
|
33
|
-
# password: <password used for authentication>
|
|
34
|
-
|
|
35
|
-
# Event broker which all conversation events should be streamed to.
|
|
36
|
-
# https://rasa.com/docs/rasa-pro/production/event-brokers
|
|
37
|
-
|
|
38
|
-
#event_broker:
|
|
39
|
-
# url: localhost
|
|
40
|
-
# username: username
|
|
41
|
-
# password: password
|
|
42
|
-
# queue: queue
|
|
43
|
-
|
|
44
|
-
# The lines below activate contextual rephrasing, using the default OpenAI language model.
|
|
45
|
-
# Ensure the OPENAI_API_KEY is set to prevent any missing API key errors.
|
|
46
|
-
# For more details, refer to the documentation:
|
|
47
|
-
# https://rasa.com/docs/rasa-pro/concepts/contextual-response-rephraser
|
|
48
|
-
# To enable the rephraser, remove the comment symbols in the lines below.
|
|
49
|
-
#nlg:
|
|
50
|
-
# type: rephrase
|
|
51
|
-
|
|
52
|
-
model_groups:
|
|
53
|
-
- id: openai-gpt-4o
|
|
54
|
-
models:
|
|
55
|
-
- provider: openai
|
|
56
|
-
model: gpt-4o-2024-11-20
|
|
57
|
-
request_timeout: 7
|
|
58
|
-
max_tokens: 256
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# This files contains your custom actions which can be used to run
|
|
2
|
-
# custom Python code.
|
|
3
|
-
#
|
|
4
|
-
# See this guide on how to implement these action:
|
|
5
|
-
# https://rasa.com/docs/rasa-pro/concepts/custom-actions
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# This is a simple example for a custom action which utters "Hello World!"
|
|
9
|
-
|
|
10
|
-
# from typing import Any, Text, Dict, List
|
|
11
|
-
#
|
|
12
|
-
# from rasa_sdk import Action, Tracker
|
|
13
|
-
# from rasa_sdk.executor import CollectingDispatcher
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
# class ActionHelloWorld(Action):
|
|
17
|
-
#
|
|
18
|
-
# def name(self) -> Text:
|
|
19
|
-
# return "action_hello_world"
|
|
20
|
-
#
|
|
21
|
-
# def run(self, dispatcher: CollectingDispatcher,
|
|
22
|
-
# tracker: Tracker,
|
|
23
|
-
# domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
|
|
24
|
-
#
|
|
25
|
-
# dispatcher.utter_message(text="Hello World!")
|
|
26
|
-
#
|
|
27
|
-
# return []
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
version: "3.1"
|
|
2
|
-
|
|
3
|
-
nlu:
|
|
4
|
-
- intent: greet
|
|
5
|
-
examples: |
|
|
6
|
-
- hey
|
|
7
|
-
- hello
|
|
8
|
-
- hi
|
|
9
|
-
- hello there
|
|
10
|
-
- good morning
|
|
11
|
-
- good evening
|
|
12
|
-
- moin
|
|
13
|
-
- hey there
|
|
14
|
-
- let's go
|
|
15
|
-
- hey dude
|
|
16
|
-
- goodmorning
|
|
17
|
-
- goodevening
|
|
18
|
-
- good afternoon
|
|
19
|
-
|
|
20
|
-
- intent: goodbye
|
|
21
|
-
examples: |
|
|
22
|
-
- cu
|
|
23
|
-
- good by
|
|
24
|
-
- cee you later
|
|
25
|
-
- good night
|
|
26
|
-
- bye
|
|
27
|
-
- goodbye
|
|
28
|
-
- have a nice day
|
|
29
|
-
- see you around
|
|
30
|
-
- bye bye
|
|
31
|
-
- see you later
|
|
32
|
-
|
|
33
|
-
- intent: affirm
|
|
34
|
-
examples: |
|
|
35
|
-
- yes
|
|
36
|
-
- y
|
|
37
|
-
- indeed
|
|
38
|
-
- of course
|
|
39
|
-
- that sounds good
|
|
40
|
-
- correct
|
|
41
|
-
|
|
42
|
-
- intent: deny
|
|
43
|
-
examples: |
|
|
44
|
-
- no
|
|
45
|
-
- n
|
|
46
|
-
- never
|
|
47
|
-
- I don't think so
|
|
48
|
-
- don't like that
|
|
49
|
-
- no way
|
|
50
|
-
- not really
|
|
51
|
-
|
|
52
|
-
- intent: mood_great
|
|
53
|
-
examples: |
|
|
54
|
-
- perfect
|
|
55
|
-
- great
|
|
56
|
-
- amazing
|
|
57
|
-
- feeling like a king
|
|
58
|
-
- wonderful
|
|
59
|
-
- I am feeling very good
|
|
60
|
-
- I am great
|
|
61
|
-
- I am amazing
|
|
62
|
-
- I am going to save the world
|
|
63
|
-
- super stoked
|
|
64
|
-
- extremely good
|
|
65
|
-
- so so perfect
|
|
66
|
-
- so good
|
|
67
|
-
- so perfect
|
|
68
|
-
|
|
69
|
-
- intent: mood_unhappy
|
|
70
|
-
examples: |
|
|
71
|
-
- my day was horrible
|
|
72
|
-
- I am sad
|
|
73
|
-
- I don't feel very well
|
|
74
|
-
- I am disappointed
|
|
75
|
-
- super sad
|
|
76
|
-
- I'm so sad
|
|
77
|
-
- sad
|
|
78
|
-
- very sad
|
|
79
|
-
- unhappy
|
|
80
|
-
- not good
|
|
81
|
-
- not very good
|
|
82
|
-
- extremly sad
|
|
83
|
-
- so saad
|
|
84
|
-
- so sad
|
|
85
|
-
|
|
86
|
-
- intent: bot_challenge
|
|
87
|
-
examples: |
|
|
88
|
-
- are you a bot?
|
|
89
|
-
- are you a human?
|
|
90
|
-
- am I talking to a bot?
|
|
91
|
-
- am I talking to a human?
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
version: "3.1"
|
|
2
|
-
|
|
3
|
-
rules:
|
|
4
|
-
|
|
5
|
-
- rule: Say goodbye anytime the user says goodbye
|
|
6
|
-
steps:
|
|
7
|
-
- intent: goodbye
|
|
8
|
-
- action: utter_goodbye
|
|
9
|
-
|
|
10
|
-
- rule: Say 'I am a bot' anytime the user challenges
|
|
11
|
-
steps:
|
|
12
|
-
- intent: bot_challenge
|
|
13
|
-
- action: utter_iamabot
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
version: "3.1"
|
|
2
|
-
|
|
3
|
-
stories:
|
|
4
|
-
|
|
5
|
-
- story: happy path
|
|
6
|
-
steps:
|
|
7
|
-
- intent: greet
|
|
8
|
-
- action: utter_greet
|
|
9
|
-
- intent: mood_great
|
|
10
|
-
- action: utter_happy
|
|
11
|
-
|
|
12
|
-
- story: sad path 1
|
|
13
|
-
steps:
|
|
14
|
-
- intent: greet
|
|
15
|
-
- action: utter_greet
|
|
16
|
-
- intent: mood_unhappy
|
|
17
|
-
- action: utter_cheer_up
|
|
18
|
-
- action: utter_did_that_help
|
|
19
|
-
- intent: affirm
|
|
20
|
-
- action: utter_happy
|
|
21
|
-
|
|
22
|
-
- story: sad path 2
|
|
23
|
-
steps:
|
|
24
|
-
- intent: greet
|
|
25
|
-
- action: utter_greet
|
|
26
|
-
- intent: mood_unhappy
|
|
27
|
-
- action: utter_cheer_up
|
|
28
|
-
- action: utter_did_that_help
|
|
29
|
-
- intent: deny
|
|
30
|
-
- action: utter_goodbye
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
version: "3.1"
|
|
2
|
-
|
|
3
|
-
intents:
|
|
4
|
-
- greet
|
|
5
|
-
- goodbye
|
|
6
|
-
- affirm
|
|
7
|
-
- deny
|
|
8
|
-
- mood_great
|
|
9
|
-
- mood_unhappy
|
|
10
|
-
- bot_challenge
|
|
11
|
-
|
|
12
|
-
responses:
|
|
13
|
-
utter_greet:
|
|
14
|
-
- text: "Hey! How are you?"
|
|
15
|
-
|
|
16
|
-
utter_cheer_up:
|
|
17
|
-
- text: "Here is something to cheer you up:"
|
|
18
|
-
image: "https://i.imgur.com/nGF1K8f.jpg"
|
|
19
|
-
|
|
20
|
-
utter_did_that_help:
|
|
21
|
-
- text: "Did that help you?"
|
|
22
|
-
|
|
23
|
-
utter_happy:
|
|
24
|
-
- text: "Great, carry on!"
|
|
25
|
-
|
|
26
|
-
utter_goodbye:
|
|
27
|
-
- text: "Bye"
|
|
28
|
-
|
|
29
|
-
utter_iamabot:
|
|
30
|
-
- text: "I am a bot, powered by Rasa."
|
|
31
|
-
|
|
32
|
-
session_config:
|
|
33
|
-
session_expiration_time: 60
|
|
34
|
-
carry_over_slots_to_new_session: true
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
#### This file contains tests to evaluate that your bot behaves as expected.
|
|
2
|
-
#### If you want to learn more, please see the docs: https://rasa.com/docs/rasa-pro/nlu-based-assistants/testing-your-assistant
|
|
3
|
-
|
|
4
|
-
stories:
|
|
5
|
-
- story: happy path 1
|
|
6
|
-
steps:
|
|
7
|
-
- user: |
|
|
8
|
-
hello there!
|
|
9
|
-
intent: greet
|
|
10
|
-
- action: utter_greet
|
|
11
|
-
- user: |
|
|
12
|
-
amazing
|
|
13
|
-
intent: mood_great
|
|
14
|
-
- action: utter_happy
|
|
15
|
-
|
|
16
|
-
- story: happy path 2
|
|
17
|
-
steps:
|
|
18
|
-
- user: |
|
|
19
|
-
hello there!
|
|
20
|
-
intent: greet
|
|
21
|
-
- action: utter_greet
|
|
22
|
-
- user: |
|
|
23
|
-
amazing
|
|
24
|
-
intent: mood_great
|
|
25
|
-
- action: utter_happy
|
|
26
|
-
- user: |
|
|
27
|
-
bye-bye!
|
|
28
|
-
intent: goodbye
|
|
29
|
-
- action: utter_goodbye
|
|
30
|
-
|
|
31
|
-
- story: sad path 1
|
|
32
|
-
steps:
|
|
33
|
-
- user: |
|
|
34
|
-
hello
|
|
35
|
-
intent: greet
|
|
36
|
-
- action: utter_greet
|
|
37
|
-
- user: |
|
|
38
|
-
not good
|
|
39
|
-
intent: mood_unhappy
|
|
40
|
-
- action: utter_cheer_up
|
|
41
|
-
- action: utter_did_that_help
|
|
42
|
-
- user: |
|
|
43
|
-
yes
|
|
44
|
-
intent: affirm
|
|
45
|
-
- action: utter_happy
|
|
46
|
-
|
|
47
|
-
- story: sad path 2
|
|
48
|
-
steps:
|
|
49
|
-
- user: |
|
|
50
|
-
hello
|
|
51
|
-
intent: greet
|
|
52
|
-
- action: utter_greet
|
|
53
|
-
- user: |
|
|
54
|
-
not good
|
|
55
|
-
intent: mood_unhappy
|
|
56
|
-
- action: utter_cheer_up
|
|
57
|
-
- action: utter_did_that_help
|
|
58
|
-
- user: |
|
|
59
|
-
not really
|
|
60
|
-
intent: deny
|
|
61
|
-
- action: utter_goodbye
|
|
62
|
-
|
|
63
|
-
- story: sad path 3
|
|
64
|
-
steps:
|
|
65
|
-
- user: |
|
|
66
|
-
hi
|
|
67
|
-
intent: greet
|
|
68
|
-
- action: utter_greet
|
|
69
|
-
- user: |
|
|
70
|
-
very terrible
|
|
71
|
-
intent: mood_unhappy
|
|
72
|
-
- action: utter_cheer_up
|
|
73
|
-
- action: utter_did_that_help
|
|
74
|
-
- user: |
|
|
75
|
-
no
|
|
76
|
-
intent: deny
|
|
77
|
-
- action: utter_goodbye
|
|
78
|
-
|
|
79
|
-
- story: say goodbye
|
|
80
|
-
steps:
|
|
81
|
-
- user: |
|
|
82
|
-
bye-bye!
|
|
83
|
-
intent: goodbye
|
|
84
|
-
- action: utter_goodbye
|
|
85
|
-
|
|
86
|
-
- story: bot challenge
|
|
87
|
-
steps:
|
|
88
|
-
- user: |
|
|
89
|
-
are you a bot?
|
|
90
|
-
intent: bot_challenge
|
|
91
|
-
- action: utter_iamabot
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aI as o,aJ as r}from"./index-098a1a24.js";const s=(a,n)=>o.lang.round(r.parse(a)[n]),e=s;export{e as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as r}from"./graph-6e2ab9a7.js";var e=4;function a(o){return r(o,e)}export{a as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,f as o}from"./flowDb-956e92f1-b6f105ac.js";import{f as t,g as a}from"./styles-c10674c1-f86aab11.js";import{u as i}from"./index-098a1a24.js";import"./graph-6e2ab9a7.js";import"./layout-d98dcd0c.js";import"./index-3862675e-84ec700f.js";import"./clone-ff7f2ce7.js";import"./edges-e0da2a9e-77e89e48.js";import"./createText-2e5e7dd3-9c105cb1.js";import"./line-838e3d82.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";import"./channel-11268142.js";const M={parser:e,db:o,renderer:t,styles:a,init:r=>{r.flowchart||(r.flowchart={}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,i({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}}),t.setConf(r.flowchart),o.clear(),o.setGen("gen-2")}};export{M as diagram};
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
const bufferSize = 4096
|
|
2
|
-
const sampleRate = 8000
|
|
3
|
-
const audioOptions = {
|
|
4
|
-
audio: {
|
|
5
|
-
echoCancellation: true,
|
|
6
|
-
noiseSuppression: true,
|
|
7
|
-
autoGainControl: true
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const arrayBufferToBase64 = ( buffer: ArrayBuffer ): string => {
|
|
12
|
-
let binary = '';
|
|
13
|
-
const bytes = new Uint8Array( buffer );
|
|
14
|
-
const len = bytes.byteLength;
|
|
15
|
-
for (let i = 0; i < len; i++) {
|
|
16
|
-
binary += String.fromCharCode( bytes[ i ] );
|
|
17
|
-
}
|
|
18
|
-
return window.btoa( binary );
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const base64ToArrayBuffer = ( s: string ): ArrayBuffer => {
|
|
22
|
-
const binary_string = window.atob(s);
|
|
23
|
-
const len = binary_string.length;
|
|
24
|
-
const bytes = new Uint8Array( len );
|
|
25
|
-
for (let i = 0; i < len; i++) {
|
|
26
|
-
bytes[i] = binary_string.charCodeAt(i);
|
|
27
|
-
}
|
|
28
|
-
return bytes.buffer;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const floatToIntArray = (arr: Float32Array): Int32Array => {
|
|
32
|
-
// Convert Float Array [-1, 1] to full range int array
|
|
33
|
-
return Int32Array.from(arr, x => x * 0x7fffffff)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const intToFloatArray = (arr: Int32Array): Float32Array => {
|
|
37
|
-
return Float32Array.from(arr, x => (x / 0x7fffffff))
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
interface Mark {
|
|
41
|
-
id: string
|
|
42
|
-
bytesToGo: number
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
interface AudioQueue {
|
|
46
|
-
buffer: Float32Array;
|
|
47
|
-
marks: Array<Mark>
|
|
48
|
-
socket: WebSocket,
|
|
49
|
-
write: (newAudio: Float32Array) => void;
|
|
50
|
-
read: (nSamples: number) => Float32Array;
|
|
51
|
-
length: () => number;
|
|
52
|
-
addMarker: (id: string) => void;
|
|
53
|
-
reduceMarkers: (bytesRead: number) => void;
|
|
54
|
-
popMarkers: () => void;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const createAudioQueue = (socket: WebSocket) : AudioQueue => {
|
|
59
|
-
return {
|
|
60
|
-
buffer: new Float32Array(0),
|
|
61
|
-
marks: new Array<Mark>(),
|
|
62
|
-
socket,
|
|
63
|
-
|
|
64
|
-
write: function(newAudio: Float32Array) {
|
|
65
|
-
const currentQLength = this.buffer.length;
|
|
66
|
-
const newBuffer = new Float32Array(currentQLength + newAudio.length);
|
|
67
|
-
newBuffer.set(this.buffer, 0);
|
|
68
|
-
newBuffer.set(newAudio, currentQLength);
|
|
69
|
-
this.buffer = newBuffer;
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
read: function(nSamples: number) {
|
|
73
|
-
const samplesToPlay = this.buffer.subarray(0, nSamples);
|
|
74
|
-
this.buffer = this.buffer.subarray(nSamples, this.buffer.length);
|
|
75
|
-
this.reduceMarkers(samplesToPlay.length)
|
|
76
|
-
this.popMarkers()
|
|
77
|
-
return samplesToPlay;
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
length: function() {
|
|
81
|
-
return this.buffer.length;
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
addMarker: function(id: string) {
|
|
85
|
-
this.marks.push({id, bytesToGo: this.length()})
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
reduceMarkers: function(bytesRead: number) {
|
|
89
|
-
this.marks = this.marks.map((m) => {
|
|
90
|
-
return {id: m.id, bytesToGo: m.bytesToGo - bytesRead}
|
|
91
|
-
})
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
popMarkers: function() {
|
|
95
|
-
// marks are ordered
|
|
96
|
-
let popUpTo = 0;
|
|
97
|
-
while (popUpTo < this.marks.length) {
|
|
98
|
-
if (this.marks[popUpTo].bytesToGo <= 0) {
|
|
99
|
-
popUpTo += 1
|
|
100
|
-
} else {
|
|
101
|
-
break
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
const marksToPop = this.marks.slice(0, popUpTo)
|
|
105
|
-
this.marks = this.marks.slice(popUpTo, this.marks.length)
|
|
106
|
-
marksToPop.forEach((m) => {
|
|
107
|
-
this.socket.send(JSON.stringify({marker: m.id}))
|
|
108
|
-
})
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const streamMicrophoneToServer = async (socket: WebSocket) => {
|
|
115
|
-
let audioStream = null;
|
|
116
|
-
const audioContext = new AudioContext({sampleRate});
|
|
117
|
-
|
|
118
|
-
try {
|
|
119
|
-
audioStream = await navigator.mediaDevices.getUserMedia(audioOptions);
|
|
120
|
-
const audioInput = audioContext.createMediaStreamSource(audioStream)
|
|
121
|
-
const sender = audioContext.createScriptProcessor(bufferSize, 1, 1)
|
|
122
|
-
sender.onaudioprocess = function(event) {
|
|
123
|
-
const message = JSON.stringify({
|
|
124
|
-
"audio": arrayBufferToBase64(floatToIntArray(event.inputBuffer.getChannelData(0)).buffer)
|
|
125
|
-
})
|
|
126
|
-
socket.send(message)
|
|
127
|
-
}
|
|
128
|
-
audioInput.connect(sender)
|
|
129
|
-
sender.connect(audioContext.destination)
|
|
130
|
-
} catch (err) {
|
|
131
|
-
console.error(err);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const setupAudioPlayback = (socket: WebSocket): AudioQueue => {
|
|
136
|
-
const audioQueue = createAudioQueue(socket)
|
|
137
|
-
const silence = new Float32Array(bufferSize)
|
|
138
|
-
const audioOutputContext = new AudioContext({sampleRate})
|
|
139
|
-
const scriptNode = audioOutputContext.createScriptProcessor(bufferSize, 1, 1);
|
|
140
|
-
scriptNode.onaudioprocess = function(e) {
|
|
141
|
-
const audioData = audioQueue.length() ? audioQueue.read(bufferSize) : silence
|
|
142
|
-
e.outputBuffer.getChannelData(0).set(audioData);
|
|
143
|
-
}
|
|
144
|
-
scriptNode.connect(audioOutputContext.destination)
|
|
145
|
-
return audioQueue
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const addDataToAudioQueue = (audioQueue: AudioQueue) => (message: MessageEvent<any>) => {
|
|
149
|
-
const data = JSON.parse(message.data.toString())
|
|
150
|
-
if (data["audio"]) {
|
|
151
|
-
const audioBytes = base64ToArrayBuffer(data["audio"])
|
|
152
|
-
const audioData = intToFloatArray(new Int32Array(audioBytes))
|
|
153
|
-
audioQueue.write(audioData);
|
|
154
|
-
} else if (data["marker"]) {
|
|
155
|
-
audioQueue.addMarker(data["marker"])
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Constructs a WebSocket URL for browser audio from a base HTTP/HTTPS URL
|
|
161
|
-
*
|
|
162
|
-
* @param baseUrl - The base URL (e.g., "https://example.com" or "http://localhost:5005")
|
|
163
|
-
* @returns WebSocket URL for browser audio endpoint
|
|
164
|
-
*
|
|
165
|
-
* @example
|
|
166
|
-
* getWebSocketUrl("https://example.com")
|
|
167
|
-
* // Returns: "wss://example.com/webhooks/browser_audio/websocket"
|
|
168
|
-
*
|
|
169
|
-
* getWebSocketUrl("http://localhost:5005")
|
|
170
|
-
* // Returns: "ws://localhost:5005/webhooks/browser_audio/websocket"
|
|
171
|
-
*
|
|
172
|
-
* @throws {TypeError} If baseUrl is not a valid URL
|
|
173
|
-
*/
|
|
174
|
-
export function getWebSocketUrl(baseUrl: string) {
|
|
175
|
-
const url = new URL(baseUrl);
|
|
176
|
-
const wsProtocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
177
|
-
return `${wsProtocol}//${url.host}/webhooks/browser_audio/websocket`;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Creates a WebSocket connection for browser audio and streams microphone input to the server
|
|
182
|
-
*
|
|
183
|
-
* @param baseUrl - The base URL (e.g., "https://example.com" or "http://localhost:5005")
|
|
184
|
-
*/
|
|
185
|
-
export async function createAudioConnection(baseUrl: string) {
|
|
186
|
-
const websocketURL = getWebSocketUrl(baseUrl)
|
|
187
|
-
const socket = new WebSocket(websocketURL)
|
|
188
|
-
socket.onopen = async () => { await streamMicrophoneToServer(socket)}
|
|
189
|
-
const audioQueue = setupAudioPlayback(socket)
|
|
190
|
-
socket.onmessage = addDataToAudioQueue(audioQueue)
|
|
191
|
-
}
|