rasa-pro 3.14.0a20__py3-none-any.whl → 3.14.0a23__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 +15 -3
- rasa/agents/__init__.py +0 -0
- rasa/agents/agent_factory.py +122 -0
- rasa/agents/agent_manager.py +211 -0
- rasa/agents/constants.py +43 -0
- rasa/agents/core/__init__.py +0 -0
- rasa/agents/core/agent_protocol.py +107 -0
- rasa/agents/core/types.py +81 -0
- rasa/agents/exceptions.py +38 -0
- rasa/agents/protocol/__init__.py +5 -0
- rasa/agents/protocol/a2a/__init__.py +0 -0
- rasa/agents/protocol/a2a/a2a_agent.py +879 -0
- rasa/agents/protocol/mcp/__init__.py +0 -0
- rasa/agents/protocol/mcp/mcp_base_agent.py +726 -0
- rasa/agents/protocol/mcp/mcp_open_agent.py +327 -0
- rasa/agents/protocol/mcp/mcp_task_agent.py +522 -0
- rasa/agents/schemas/__init__.py +13 -0
- rasa/agents/schemas/agent_input.py +38 -0
- rasa/agents/schemas/agent_output.py +26 -0
- rasa/agents/schemas/agent_tool_result.py +65 -0
- rasa/agents/schemas/agent_tool_schema.py +186 -0
- rasa/agents/templates/__init__.py +0 -0
- rasa/agents/templates/mcp_open_agent_prompt_template.jinja2 +20 -0
- rasa/agents/templates/mcp_task_agent_prompt_template.jinja2 +22 -0
- rasa/agents/utils.py +206 -0
- rasa/agents/validation.py +485 -0
- rasa/api.py +24 -9
- rasa/builder/config.py +6 -2
- rasa/builder/guardrails/{lakera.py → clients.py} +55 -5
- rasa/builder/guardrails/constants.py +3 -0
- rasa/builder/guardrails/models.py +45 -10
- rasa/builder/guardrails/policy_checker.py +324 -0
- rasa/builder/guardrails/utils.py +42 -276
- rasa/builder/llm_service.py +32 -5
- rasa/builder/models.py +1 -0
- rasa/builder/project_generator.py +6 -1
- rasa/builder/service.py +16 -13
- rasa/builder/training_service.py +18 -24
- rasa/builder/validation_service.py +1 -1
- rasa/cli/arguments/default_arguments.py +12 -0
- rasa/cli/arguments/run.py +2 -0
- rasa/cli/arguments/train.py +2 -0
- rasa/cli/data.py +10 -8
- rasa/cli/dialogue_understanding_test.py +10 -7
- rasa/cli/e2e_test.py +9 -6
- rasa/cli/evaluate.py +4 -2
- rasa/cli/export.py +5 -2
- rasa/cli/inspect.py +8 -4
- rasa/cli/interactive.py +5 -4
- rasa/cli/llm_fine_tuning.py +11 -6
- rasa/cli/project_templates/finance/actions/general/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/general/action_human_handoff.py +49 -0
- rasa/cli/project_templates/finance/data/general/bot_challenge.yml +6 -0
- rasa/cli/project_templates/finance/data/general/goodbye.yml +1 -1
- rasa/cli/project_templates/finance/data/general/human_handoff.yml +1 -1
- rasa/cli/project_templates/finance/data/system/patterns/pattern_session_start.yml +1 -1
- rasa/cli/project_templates/finance/domain/general/_shared.yml +0 -14
- rasa/cli/project_templates/finance/domain/general/bot_challenge.yml +4 -0
- rasa/cli/project_templates/finance/domain/general/goodbye.yml +7 -0
- rasa/cli/project_templates/finance/domain/general/human_handoff.yml +3 -6
- rasa/cli/project_templates/finance/domain/general/welcome.yml +29 -1
- rasa/cli/project_templates/finance/tests/e2e_test_cases/accounts/check_balance.yml +9 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/accounts/download_statements.yml +43 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/cards/block_card.yml +55 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/bot_challenge.yml +8 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/feedback.yml +46 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/goodbye.yml +9 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/hello.yml +8 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/human_handoff.yml +35 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/general/patterns.yml +22 -0
- rasa/cli/project_templates/finance/tests/e2e_test_cases/transfers/transfer_money.yml +56 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/feedback.yml +1 -1
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/hello.yml +1 -1
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/human_handoff.yml +1 -1
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/patterns.yml +1 -1
- rasa/cli/project_templates/tutorial/credentials.yml +10 -0
- rasa/cli/run.py +12 -10
- rasa/cli/scaffold.py +4 -4
- rasa/cli/shell.py +9 -5
- rasa/cli/studio/studio.py +1 -1
- rasa/cli/test.py +34 -14
- rasa/cli/train.py +41 -28
- rasa/cli/utils.py +1 -393
- rasa/cli/validation/__init__.py +0 -0
- rasa/cli/validation/bot_config.py +223 -0
- rasa/cli/validation/config_path_validation.py +257 -0
- rasa/cli/x.py +8 -4
- rasa/constants.py +7 -1
- rasa/core/actions/action.py +51 -10
- rasa/core/actions/action_run_slot_rejections.py +1 -1
- rasa/core/actions/direct_custom_actions_executor.py +9 -2
- rasa/core/actions/grpc_custom_action_executor.py +1 -1
- rasa/core/agent.py +19 -2
- rasa/core/available_agents.py +229 -0
- rasa/core/brokers/kafka.py +1 -1
- rasa/core/channels/__init__.py +82 -35
- rasa/core/channels/development_inspector.py +3 -3
- rasa/core/channels/inspector/README.md +25 -13
- rasa/core/channels/inspector/dist/assets/{arc-35222594.js → arc-6177260a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-a0efbfd3.js → blockDiagram-38ab4fdb-b054f038.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-0584c0f2.js → c4Diagram-3d4e48cf-f25427d5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-bf9cbb34.js +1 -0
- rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-39f40dbe.js → classDiagram-70f12bd4-c7a2af53.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-1ad755f3.js → classDiagram-v2-f2320105-58db65c0.js} +1 -1
- rasa/core/channels/inspector/dist/assets/clone-8f9083bb.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-b0f4f0fe.js → createText-2e5e7dd3-088372e2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-9039bff9.js → edges-e0da2a9e-58676240.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-65c9b127.js → erDiagram-9861fffd-0c14d7c6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-4f08b38e.js → flowDb-956e92f1-ea63f85c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-e95c362a.js → flowDiagram-66a62f08-a2af48cd.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-9ecd5b59.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-703c3015.js → flowchart-elk-definition-4a651766-6937abe7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-699328ea.js → ganttDiagram-c361ad54-7473f357.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-04cf4b05.js → gitGraphDiagram-72cf32ee-d0c9405e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-ee94449e.js → graph-0a6f8466.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-940162b4.js → index-3862675e-7610671a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/index-74e01d94.js +1354 -0
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-c79c2866.js → infoDiagram-f8f76790-be397dc7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-84489d30.js → journeyDiagram-49397b02-4cefbf62.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-a9aa9858.js → layout-e7fbc2bf.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-eb73cf26.js → line-a8aa457c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-b3399f9a.js → linear-3351e0d2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-b095bf1a.js → mindmap-definition-fc14e90a-b8cbf605.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-07644b66.js → pieDiagram-8a3498a8-f327f774.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-573a3f9c.js → quadrantDiagram-120e2f19-2854c591.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-d457e1e1.js → requirementDiagram-deff3bca-964985d5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-9d26e1a2.js → sankeyDiagram-04a897e0-edeb4f33.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-3a9cde10.js → sequenceDiagram-704730f1-fcf70125.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-4f3e8cec.js → stateDiagram-587899a1-0e770395.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-e617e5bf.js → stateDiagram-v2-d93cdb3a-af8dcd22.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-eab30d2f.js → styles-6aaf32cf-36a9e70d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-09994be2.js → styles-9a916d00-884a8b5b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-b7110364.js → styles-c10674c1-dc097813.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-3ebc92ad.js → svgDrawCommon-08f97a94-5a2c7eed.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-7d13d2f2.js → timeline-definition-85554ec2-e89c4f6e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-488385e1.js → xychartDiagram-e933f94c-afb6fe56.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +1 -1
- rasa/core/channels/inspector/package.json +18 -18
- rasa/core/channels/inspector/src/App.tsx +29 -4
- rasa/core/channels/inspector/src/components/DialogueAgentStack.tsx +108 -0
- rasa/core/channels/inspector/src/components/{DialogueStack.tsx → DialogueHistoryStack.tsx} +4 -2
- rasa/core/channels/inspector/src/helpers/audio/audiostream.ts +7 -4
- rasa/core/channels/inspector/src/helpers/formatters.test.ts +4 -0
- rasa/core/channels/inspector/src/helpers/formatters.ts +24 -3
- rasa/core/channels/inspector/src/helpers/utils.test.ts +127 -0
- rasa/core/channels/inspector/src/helpers/utils.ts +66 -1
- rasa/core/channels/inspector/src/theme/base/styles.ts +19 -1
- rasa/core/channels/inspector/src/types.ts +21 -0
- rasa/core/channels/inspector/yarn.lock +336 -189
- rasa/core/channels/studio_chat.py +6 -6
- rasa/core/channels/telegram.py +4 -9
- rasa/core/channels/voice_stream/browser_audio.py +2 -0
- rasa/core/channels/voice_stream/genesys.py +1 -1
- rasa/core/channels/voice_stream/tts/deepgram.py +140 -0
- rasa/core/channels/voice_stream/twilio_media_streams.py +5 -1
- rasa/core/channels/voice_stream/voice_channel.py +3 -0
- rasa/core/config/__init__.py +0 -0
- rasa/core/{available_endpoints.py → config/available_endpoints.py} +51 -16
- rasa/core/config/configuration.py +260 -0
- rasa/core/config/credentials.py +19 -0
- rasa/core/config/message_procesing_config.py +34 -0
- rasa/core/constants.py +5 -0
- rasa/core/iam_credentials_providers/aws_iam_credentials_providers.py +88 -3
- rasa/core/iam_credentials_providers/credentials_provider_protocol.py +2 -1
- rasa/core/lock_store.py +6 -4
- rasa/core/nlg/generator.py +1 -1
- rasa/core/policies/enterprise_search_policy.py +5 -3
- rasa/core/policies/flow_policy.py +4 -4
- rasa/core/policies/flows/agent_executor.py +632 -0
- rasa/core/policies/flows/flow_executor.py +137 -76
- rasa/core/policies/flows/mcp_tool_executor.py +298 -0
- rasa/core/policies/intentless_policy.py +1 -1
- rasa/core/policies/ted_policy.py +20 -12
- rasa/core/policies/unexpected_intent_policy.py +6 -0
- rasa/core/processor.py +68 -44
- rasa/core/redis_connection_factory.py +78 -20
- rasa/core/run.py +37 -8
- rasa/core/test.py +4 -0
- rasa/core/tracker_stores/sql_tracker_store.py +1 -1
- rasa/core/tracker_stores/tracker_store.py +3 -7
- rasa/core/train.py +1 -1
- rasa/core/training/interactive.py +20 -18
- rasa/core/training/story_conflict.py +5 -5
- rasa/core/utils.py +22 -23
- rasa/dialogue_understanding/commands/__init__.py +8 -0
- rasa/dialogue_understanding/commands/cancel_flow_command.py +19 -5
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +21 -2
- rasa/dialogue_understanding/commands/clarify_command.py +20 -2
- rasa/dialogue_understanding/commands/continue_agent_command.py +91 -0
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +21 -2
- rasa/dialogue_understanding/commands/restart_agent_command.py +162 -0
- rasa/dialogue_understanding/commands/start_flow_command.py +68 -7
- rasa/dialogue_understanding/commands/utils.py +124 -2
- rasa/dialogue_understanding/generator/command_parser.py +4 -0
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +50 -12
- rasa/dialogue_understanding/generator/llm_command_generator.py +1 -1
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +1 -1
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_claude_3_5_sonnet_20240620_template.jinja2 +66 -0
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_gpt_4o_2024_11_20_template.jinja2 +66 -0
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_claude_3_5_sonnet_20240620_template.jinja2 +89 -0
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_gpt_4o_2024_11_20_template.jinja2 +88 -0
- rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +42 -7
- rasa/dialogue_understanding/generator/single_step/search_ready_llm_command_generator.py +40 -3
- rasa/dialogue_understanding/generator/single_step/single_step_based_llm_command_generator.py +20 -3
- rasa/dialogue_understanding/patterns/cancel.py +27 -6
- rasa/dialogue_understanding/patterns/clarify.py +3 -14
- rasa/dialogue_understanding/patterns/continue_interrupted.py +239 -6
- rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +46 -8
- rasa/dialogue_understanding/processor/command_processor.py +136 -15
- rasa/dialogue_understanding/stack/dialogue_stack.py +98 -2
- rasa/dialogue_understanding/stack/frames/flow_stack_frame.py +57 -0
- rasa/dialogue_understanding/stack/utils.py +57 -3
- rasa/dialogue_understanding/utils.py +24 -4
- rasa/dialogue_understanding_test/du_test_runner.py +8 -3
- rasa/e2e_test/e2e_test_runner.py +13 -3
- rasa/engine/caching.py +2 -2
- rasa/engine/constants.py +1 -1
- rasa/engine/loader.py +12 -0
- rasa/engine/recipes/default_components.py +138 -49
- rasa/engine/recipes/default_recipe.py +108 -11
- rasa/engine/runner/dask.py +8 -5
- rasa/engine/validation.py +19 -6
- rasa/graph_components/validators/default_recipe_validator.py +86 -28
- rasa/hooks.py +5 -5
- rasa/llm_fine_tuning/utils.py +2 -2
- rasa/model_training.py +60 -47
- rasa/nlu/classifiers/diet_classifier.py +198 -98
- rasa/nlu/classifiers/logistic_regression_classifier.py +1 -4
- rasa/nlu/classifiers/mitie_intent_classifier.py +3 -0
- rasa/nlu/classifiers/sklearn_intent_classifier.py +1 -3
- rasa/nlu/extractors/crf_entity_extractor.py +9 -10
- rasa/nlu/extractors/mitie_entity_extractor.py +3 -0
- rasa/nlu/extractors/spacy_entity_extractor.py +3 -0
- rasa/nlu/featurizers/dense_featurizer/convert_featurizer.py +4 -0
- rasa/nlu/featurizers/dense_featurizer/lm_featurizer.py +5 -0
- rasa/nlu/featurizers/dense_featurizer/mitie_featurizer.py +2 -0
- rasa/nlu/featurizers/dense_featurizer/spacy_featurizer.py +3 -0
- rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.py +4 -2
- rasa/nlu/featurizers/sparse_featurizer/lexical_syntactic_featurizer.py +4 -0
- rasa/nlu/selectors/response_selector.py +10 -2
- rasa/nlu/tokenizers/jieba_tokenizer.py +3 -4
- rasa/nlu/tokenizers/mitie_tokenizer.py +3 -2
- rasa/nlu/tokenizers/spacy_tokenizer.py +3 -2
- rasa/nlu/utils/mitie_utils.py +3 -0
- rasa/nlu/utils/spacy_utils.py +3 -2
- rasa/plugin.py +8 -8
- rasa/privacy/privacy_manager.py +12 -3
- rasa/server.py +15 -3
- rasa/shared/agents/__init__.py +0 -0
- rasa/shared/agents/auth/__init__.py +0 -0
- rasa/shared/agents/auth/agent_auth_factory.py +105 -0
- rasa/shared/agents/auth/agent_auth_manager.py +92 -0
- rasa/shared/agents/auth/auth_strategy/__init__.py +19 -0
- rasa/shared/agents/auth/auth_strategy/agent_auth_strategy.py +52 -0
- rasa/shared/agents/auth/auth_strategy/api_key_auth_strategy.py +42 -0
- rasa/shared/agents/auth/auth_strategy/bearer_token_auth_strategy.py +28 -0
- rasa/shared/agents/auth/auth_strategy/oauth2_auth_strategy.py +167 -0
- rasa/shared/agents/auth/constants.py +12 -0
- rasa/shared/agents/auth/types.py +12 -0
- rasa/shared/agents/utils.py +35 -0
- rasa/shared/constants.py +8 -0
- rasa/shared/core/constants.py +16 -1
- rasa/shared/core/domain.py +0 -7
- rasa/shared/core/events.py +327 -0
- rasa/shared/core/flows/constants.py +5 -0
- rasa/shared/core/flows/flow.py +1 -1
- rasa/shared/core/flows/flows_list.py +21 -5
- rasa/shared/core/flows/flows_yaml_schema.json +119 -184
- rasa/shared/core/flows/steps/call.py +49 -5
- rasa/shared/core/flows/steps/collect.py +98 -13
- rasa/shared/core/flows/validation.py +372 -8
- rasa/shared/core/flows/yaml_flows_io.py +3 -2
- rasa/shared/core/slots.py +2 -2
- rasa/shared/core/trackers.py +5 -2
- rasa/shared/exceptions.py +16 -0
- rasa/shared/importers/rasa.py +1 -1
- rasa/shared/importers/utils.py +9 -3
- rasa/shared/providers/llm/_base_litellm_client.py +41 -9
- rasa/shared/providers/llm/litellm_router_llm_client.py +8 -4
- rasa/shared/providers/llm/llm_client.py +7 -3
- rasa/shared/providers/llm/llm_response.py +66 -0
- rasa/shared/providers/llm/self_hosted_llm_client.py +8 -4
- rasa/shared/utils/common.py +24 -0
- rasa/shared/utils/health_check/health_check.py +7 -3
- rasa/shared/utils/llm.py +39 -16
- rasa/shared/utils/mcp/__init__.py +0 -0
- rasa/shared/utils/mcp/server_connection.py +247 -0
- rasa/shared/utils/mcp/utils.py +20 -0
- rasa/shared/utils/schemas/events.py +42 -0
- rasa/shared/utils/yaml.py +3 -1
- rasa/studio/pull/pull.py +3 -2
- rasa/studio/train.py +8 -7
- rasa/studio/upload.py +3 -6
- rasa/telemetry.py +69 -5
- rasa/tracing/config.py +45 -12
- rasa/tracing/constants.py +14 -0
- rasa/tracing/instrumentation/attribute_extractors.py +142 -9
- rasa/tracing/instrumentation/instrumentation.py +626 -21
- rasa/tracing/instrumentation/intentless_policy_instrumentation.py +4 -4
- rasa/tracing/instrumentation/metrics.py +32 -0
- rasa/tracing/metric_instrument_provider.py +68 -0
- rasa/utils/common.py +92 -1
- rasa/utils/endpoints.py +11 -2
- rasa/utils/log_utils.py +96 -5
- rasa/utils/ml_utils.py +1 -1
- rasa/utils/pypred.py +38 -0
- rasa/utils/tensorflow/__init__.py +7 -0
- rasa/utils/tensorflow/callback.py +136 -101
- rasa/utils/tensorflow/crf.py +1 -1
- rasa/utils/tensorflow/data_generator.py +21 -8
- rasa/utils/tensorflow/layers.py +21 -11
- rasa/utils/tensorflow/metrics.py +7 -3
- rasa/utils/tensorflow/models.py +56 -8
- rasa/utils/tensorflow/rasa_layers.py +8 -6
- rasa/utils/tensorflow/transformer.py +2 -3
- rasa/utils/train_utils.py +54 -24
- rasa/validator.py +17 -13
- rasa/version.py +1 -1
- {rasa_pro-3.14.0a20.dist-info → rasa_pro-3.14.0a23.dist-info}/METADATA +48 -42
- {rasa_pro-3.14.0a20.dist-info → rasa_pro-3.14.0a23.dist-info}/RECORD +323 -251
- rasa/builder/scrape_rasa_docs.py +0 -97
- rasa/cli/project_templates/finance/data/general/agent_details.yml +0 -6
- rasa/cli/project_templates/finance/domain/_system/patterns/pattern_session_start.yml +0 -11
- rasa/cli/project_templates/finance/domain/general/agent_details.yml +0 -31
- rasa/core/channels/inspector/dist/assets/channel-8e08bed9.js +0 -1
- rasa/core/channels/inspector/dist/assets/clone-78c82dea.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-2b08f601.js +0 -1
- rasa/core/channels/inspector/dist/assets/index-c941dcb3.js +0 -1336
- {rasa_pro-3.14.0a20.dist-info → rasa_pro-3.14.0a23.dist-info}/NOTICE +0 -0
- {rasa_pro-3.14.0a20.dist-info → rasa_pro-3.14.0a23.dist-info}/WHEEL +0 -0
- {rasa_pro-3.14.0a20.dist-info → rasa_pro-3.14.0a23.dist-info}/entry_points.txt +0 -0
|
@@ -5,6 +5,7 @@ import dataclasses
|
|
|
5
5
|
import enum
|
|
6
6
|
import logging
|
|
7
7
|
import math
|
|
8
|
+
import sys
|
|
8
9
|
from enum import Enum
|
|
9
10
|
from typing import Any, Callable, Dict, List, Optional, Set, Text, Tuple, Type, Union
|
|
10
11
|
|
|
@@ -180,7 +181,28 @@ class DefaultV1Recipe(Recipe):
|
|
|
180
181
|
@classmethod
|
|
181
182
|
def _from_registry(cls, name: Text) -> RegisteredComponent:
|
|
182
183
|
# Importing all the default Rasa components will automatically register them
|
|
183
|
-
from rasa.engine.recipes.default_components import
|
|
184
|
+
from rasa.engine.recipes.default_components import (
|
|
185
|
+
CONVERT_FEATURIZER_AVAILABLE,
|
|
186
|
+
CRF_ENTITY_EXTRACTOR_AVAILABLE,
|
|
187
|
+
DIET_CLASSIFIER_AVAILABLE,
|
|
188
|
+
JIEBA_TOKENIZER_AVAILABLE,
|
|
189
|
+
LANGUAGE_MODEL_FEATURIZER_AVAILABLE,
|
|
190
|
+
LEXICAL_SYNTACTIC_FEATURIZER_AVAILABLE,
|
|
191
|
+
LOGISTIC_REGRESSION_CLASSIFIER_AVAILABLE,
|
|
192
|
+
MITIE_ENTITY_EXTRACTOR_AVAILABLE,
|
|
193
|
+
MITIE_FEATURIZER_AVAILABLE,
|
|
194
|
+
MITIE_INTENT_CLASSIFIER_AVAILABLE,
|
|
195
|
+
MITIE_NLP_AVAILABLE,
|
|
196
|
+
MITIE_TOKENIZER_AVAILABLE,
|
|
197
|
+
RESPONSE_SELECTOR_AVAILABLE,
|
|
198
|
+
SKLEARN_INTENT_CLASSIFIER_AVAILABLE,
|
|
199
|
+
SPACY_ENTITY_EXTRACTOR_AVAILABLE,
|
|
200
|
+
SPACY_FEATURIZER_AVAILABLE,
|
|
201
|
+
SPACY_NLP_AVAILABLE,
|
|
202
|
+
SPACY_TOKENIZER_AVAILABLE,
|
|
203
|
+
TED_POLICY_AVAILABLE,
|
|
204
|
+
UNEXPECTED_INTENT_POLICY_AVAILABLE,
|
|
205
|
+
)
|
|
184
206
|
|
|
185
207
|
if name in cls._registered_components:
|
|
186
208
|
return cls._registered_components[name]
|
|
@@ -190,6 +212,56 @@ class DefaultV1Recipe(Recipe):
|
|
|
190
212
|
if clazz.__name__ in cls._registered_components:
|
|
191
213
|
return cls._registered_components[clazz.__name__]
|
|
192
214
|
|
|
215
|
+
# Check Python version compatibility for TensorFlow components
|
|
216
|
+
# TensorFlow support was removed for Python 3.12+ due to compatibility issues
|
|
217
|
+
if sys.version_info >= (3, 12):
|
|
218
|
+
raise InvalidConfigException(
|
|
219
|
+
f"{name} is not available on Python 3.12+. "
|
|
220
|
+
"TensorFlow support has been removed for Python 3.12+ versions. "
|
|
221
|
+
"Please use Python 3.11 or earlier for TensorFlow-based components. "
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
# Check for nlu components that failed to load
|
|
225
|
+
# because conditional module import of those components did not succeed
|
|
226
|
+
nlu_components = {
|
|
227
|
+
# tensorflow-dependent components
|
|
228
|
+
"DIETClassifier": DIET_CLASSIFIER_AVAILABLE,
|
|
229
|
+
"TEDPolicy": TED_POLICY_AVAILABLE,
|
|
230
|
+
"UnexpecTEDIntentPolicy": UNEXPECTED_INTENT_POLICY_AVAILABLE,
|
|
231
|
+
"ResponseSelector": RESPONSE_SELECTOR_AVAILABLE,
|
|
232
|
+
"ConveRTFeaturizer": CONVERT_FEATURIZER_AVAILABLE,
|
|
233
|
+
"LanguageModelFeaturizer": LANGUAGE_MODEL_FEATURIZER_AVAILABLE,
|
|
234
|
+
# nlu components dependent on other dependencies than tensorflow
|
|
235
|
+
"LogisticRegressionClassifier": LOGISTIC_REGRESSION_CLASSIFIER_AVAILABLE,
|
|
236
|
+
"SklearnIntentClassifier": SKLEARN_INTENT_CLASSIFIER_AVAILABLE,
|
|
237
|
+
"LexicalSyntacticFeaturizer": LEXICAL_SYNTACTIC_FEATURIZER_AVAILABLE,
|
|
238
|
+
"MitieFeaturizer": MITIE_FEATURIZER_AVAILABLE,
|
|
239
|
+
"SpacyFeaturizer": SPACY_FEATURIZER_AVAILABLE,
|
|
240
|
+
"JiebaTokenizer": JIEBA_TOKENIZER_AVAILABLE,
|
|
241
|
+
"MitieTokenizer": MITIE_TOKENIZER_AVAILABLE,
|
|
242
|
+
"SpacyTokenizer": SPACY_TOKENIZER_AVAILABLE,
|
|
243
|
+
"MitieIntentClassifier": MITIE_INTENT_CLASSIFIER_AVAILABLE,
|
|
244
|
+
"MitieEntityExtractor": MITIE_ENTITY_EXTRACTOR_AVAILABLE,
|
|
245
|
+
"SpacyEntityExtractor": SPACY_ENTITY_EXTRACTOR_AVAILABLE,
|
|
246
|
+
"MitieNLP": MITIE_NLP_AVAILABLE,
|
|
247
|
+
"SpacyNLP": SPACY_NLP_AVAILABLE,
|
|
248
|
+
"CRFEntityExtractor": CRF_ENTITY_EXTRACTOR_AVAILABLE,
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if name in nlu_components:
|
|
252
|
+
# nlu-dependent component failed to load
|
|
253
|
+
# because nlu dependency group not installed
|
|
254
|
+
if not nlu_components[name]:
|
|
255
|
+
from rasa.exceptions import MissingDependencyException
|
|
256
|
+
|
|
257
|
+
raise MissingDependencyException(
|
|
258
|
+
f"The {name} component requires additional dependencies "
|
|
259
|
+
f"which are not installed. "
|
|
260
|
+
f"Please install the required extra by running: "
|
|
261
|
+
f"pip install 'rasa-pro[nlu]' OR "
|
|
262
|
+
f"poetry add 'rasa-pro[nlu]'"
|
|
263
|
+
)
|
|
264
|
+
|
|
193
265
|
raise InvalidConfigException(
|
|
194
266
|
f"Can't load class for name '{name}'. Please make sure to provide "
|
|
195
267
|
f"a valid name or module path and to register it using the "
|
|
@@ -485,17 +557,42 @@ class DefaultV1Recipe(Recipe):
|
|
|
485
557
|
component: Type[GraphComponent],
|
|
486
558
|
component_config: Dict[Text, Any],
|
|
487
559
|
) -> Dict[Text, Any]:
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
560
|
+
# Try to import MitieIntentClassifier, but handle ImportError gracefully
|
|
561
|
+
# since the dependencies for it may not be installed
|
|
562
|
+
try:
|
|
563
|
+
from rasa.nlu.classifiers.mitie_intent_classifier import (
|
|
564
|
+
MitieIntentClassifier,
|
|
565
|
+
)
|
|
566
|
+
except ImportError:
|
|
567
|
+
MitieIntentClassifier = None # type: ignore
|
|
493
568
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
569
|
+
# Try to import MitieEntityExtractor, but handle ImportError gracefully
|
|
570
|
+
# since the dependencies for it may not be installed
|
|
571
|
+
try:
|
|
572
|
+
from rasa.nlu.extractors.mitie_entity_extractor import MitieEntityExtractor
|
|
573
|
+
except ImportError:
|
|
574
|
+
MitieEntityExtractor = None # type: ignore
|
|
575
|
+
|
|
576
|
+
# Try to import SklearnIntentClassifier, but handle ImportError gracefully
|
|
577
|
+
# since the dependencies for it may not be installed
|
|
578
|
+
try:
|
|
579
|
+
from rasa.nlu.classifiers.sklearn_intent_classifier import (
|
|
580
|
+
SklearnIntentClassifier,
|
|
581
|
+
)
|
|
582
|
+
except ImportError:
|
|
583
|
+
SklearnIntentClassifier = None # type: ignore
|
|
584
|
+
|
|
585
|
+
cli_args_mapping: Dict[Type[GraphComponent], List[Text]] = {}
|
|
586
|
+
|
|
587
|
+
# Only add components if they were successfully imported
|
|
588
|
+
if MitieIntentClassifier is not None:
|
|
589
|
+
cli_args_mapping[MitieIntentClassifier] = ["num_threads"]
|
|
590
|
+
|
|
591
|
+
if MitieEntityExtractor is not None:
|
|
592
|
+
cli_args_mapping[MitieEntityExtractor] = ["num_threads"]
|
|
593
|
+
|
|
594
|
+
if SklearnIntentClassifier is not None:
|
|
595
|
+
cli_args_mapping[SklearnIntentClassifier] = ["num_threads"]
|
|
499
596
|
|
|
500
597
|
config_from_cli = {
|
|
501
598
|
param: cli_parameters[param]
|
rasa/engine/runner/dask.py
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
|
-
import logging
|
|
5
4
|
from typing import Any, Dict, List, Optional, Text
|
|
6
5
|
|
|
7
6
|
import dask.core
|
|
8
7
|
import dask.local
|
|
8
|
+
import structlog
|
|
9
9
|
|
|
10
10
|
from rasa.engine.exceptions import GraphRunError
|
|
11
11
|
from rasa.engine.graph import ExecutionContext, GraphNode, GraphNodeHook, GraphSchema
|
|
12
12
|
from rasa.engine.runner.interface import GraphRunner
|
|
13
13
|
from rasa.engine.storage.storage import ModelStorage
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
structlogger = structlog.get_logger()
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class DaskGraphRunner(GraphRunner):
|
|
@@ -94,9 +94,12 @@ class DaskGraphRunner(GraphRunner):
|
|
|
94
94
|
if inputs:
|
|
95
95
|
self._add_inputs_to_graph(inputs, run_graph)
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
structlogger.debug(
|
|
98
|
+
"rasa.engine.runner.dask.run",
|
|
99
|
+
event_info="Running graph with inputs, targets and execution context.",
|
|
100
|
+
inputs=inputs,
|
|
101
|
+
targets=targets,
|
|
102
|
+
execution_context=self._execution_context,
|
|
100
103
|
)
|
|
101
104
|
|
|
102
105
|
try:
|
rasa/engine/validation.py
CHANGED
|
@@ -23,7 +23,8 @@ import structlog
|
|
|
23
23
|
import typing_utils
|
|
24
24
|
|
|
25
25
|
import rasa.utils.common
|
|
26
|
-
from rasa.core.available_endpoints import AvailableEndpoints
|
|
26
|
+
from rasa.core.config.available_endpoints import AvailableEndpoints
|
|
27
|
+
from rasa.core.config.configuration import Configuration
|
|
27
28
|
from rasa.core.nlg.contextual_response_rephraser import ContextualResponseRephraser
|
|
28
29
|
from rasa.core.policies.intentless_policy import IntentlessPolicy
|
|
29
30
|
from rasa.core.policies.policy import PolicyPrediction
|
|
@@ -1039,7 +1040,7 @@ def validate_model_client_configuration_setup_during_training_time(
|
|
|
1039
1040
|
)
|
|
1040
1041
|
|
|
1041
1042
|
# also include the ContextualResponseRephraser component
|
|
1042
|
-
endpoints =
|
|
1043
|
+
endpoints = Configuration.get_instance().endpoints
|
|
1043
1044
|
if endpoints.nlg is not None:
|
|
1044
1045
|
_validate_component_model_client_config(
|
|
1045
1046
|
endpoints.nlg.kwargs,
|
|
@@ -1075,7 +1076,7 @@ def validate_model_client_configuration_setup_during_training_time(
|
|
|
1075
1076
|
),
|
|
1076
1077
|
)
|
|
1077
1078
|
|
|
1078
|
-
endpoints =
|
|
1079
|
+
endpoints = Configuration.get_instance().endpoints
|
|
1079
1080
|
if len(model_group_ids) > 0 and endpoints.model_groups is None:
|
|
1080
1081
|
raise ValidationError(
|
|
1081
1082
|
code="engine.validation.validate_model_client_configuration_setup"
|
|
@@ -1138,7 +1139,7 @@ def _validate_component_model_client_config_has_references_to_endpoints(
|
|
|
1138
1139
|
# no llm/embeddings configuration present
|
|
1139
1140
|
return
|
|
1140
1141
|
|
|
1141
|
-
endpoints =
|
|
1142
|
+
endpoints = Configuration.get_instance().endpoints
|
|
1142
1143
|
|
|
1143
1144
|
if MODEL_GROUP_CONFIG_KEY in component_config[key]:
|
|
1144
1145
|
referencing_model_group_id = component_config[key][MODEL_GROUP_CONFIG_KEY]
|
|
@@ -1213,7 +1214,7 @@ def validate_model_client_configuration_setup_during_inference_time(
|
|
|
1213
1214
|
)
|
|
1214
1215
|
|
|
1215
1216
|
# also include the ContextualResponseRephraser component
|
|
1216
|
-
endpoints =
|
|
1217
|
+
endpoints = Configuration.get_instance().endpoints
|
|
1217
1218
|
if endpoints.nlg is not None:
|
|
1218
1219
|
_validate_component_model_client_config_has_references_to_endpoints(
|
|
1219
1220
|
component_config=endpoints.nlg.kwargs,
|
|
@@ -1224,6 +1225,12 @@ def validate_model_client_configuration_setup_during_inference_time(
|
|
|
1224
1225
|
|
|
1225
1226
|
def _validate_unique_model_group_ids(model_groups: List[Dict[str, Any]]) -> None:
|
|
1226
1227
|
# Each model id must be unique within the model_groups
|
|
1228
|
+
structlogger.debug(
|
|
1229
|
+
"engine.validation.validate_unique_model_group_ids",
|
|
1230
|
+
event_info="Validating that model group IDs are unique.",
|
|
1231
|
+
model_groups=model_groups,
|
|
1232
|
+
)
|
|
1233
|
+
|
|
1227
1234
|
model_ids = [model_group[MODEL_GROUP_ID_CONFIG_KEY] for model_group in model_groups]
|
|
1228
1235
|
if len(model_ids) != len(set(model_ids)):
|
|
1229
1236
|
counts = Counter(model_ids)
|
|
@@ -1410,11 +1417,17 @@ def _validate_sensitive_keys_are_an_environment_variables_for_model_groups(
|
|
|
1410
1417
|
|
|
1411
1418
|
def validate_model_group_configuration_setup() -> None:
|
|
1412
1419
|
"""Validates the model group configuration setup in endpoints.yml."""
|
|
1413
|
-
endpoints =
|
|
1420
|
+
endpoints = Configuration.get_instance().endpoints
|
|
1414
1421
|
|
|
1415
1422
|
if endpoints.model_groups is None:
|
|
1416
1423
|
return
|
|
1417
1424
|
|
|
1425
|
+
structlogger.debug(
|
|
1426
|
+
"engine.validation.validate_model_group_configuration_setup",
|
|
1427
|
+
event_info="Validating the model group configuration setup.",
|
|
1428
|
+
model_groups=endpoints.model_groups,
|
|
1429
|
+
path=endpoints.config_file_path,
|
|
1430
|
+
)
|
|
1418
1431
|
_validate_unique_model_group_ids(endpoints.model_groups)
|
|
1419
1432
|
_validate_model_group_with_multiple_models(endpoints.model_groups)
|
|
1420
1433
|
_validate_usage_of_environment_variables_in_model_group_config(
|
|
@@ -10,22 +10,13 @@ from rasa.core.policies.flow_policy import FlowPolicy
|
|
|
10
10
|
from rasa.core.policies.memoization import AugmentedMemoizationPolicy, MemoizationPolicy
|
|
11
11
|
from rasa.core.policies.policy import Policy, SupportedData
|
|
12
12
|
from rasa.core.policies.rule_policy import RulePolicy
|
|
13
|
-
from rasa.core.policies.ted_policy import TEDPolicy
|
|
14
|
-
from rasa.core.policies.unexpected_intent_policy import UnexpecTEDIntentPolicy
|
|
15
13
|
from rasa.engine.graph import ExecutionContext, GraphComponent, GraphSchema, SchemaNode
|
|
16
14
|
from rasa.engine.storage.resource import Resource
|
|
17
15
|
from rasa.engine.storage.storage import ModelStorage
|
|
18
|
-
from rasa.nlu.classifiers.diet_classifier import DIETClassifier
|
|
19
|
-
from rasa.nlu.extractors.crf_entity_extractor import (
|
|
20
|
-
CRFEntityExtractor,
|
|
21
|
-
CRFEntityExtractorOptions,
|
|
22
|
-
)
|
|
23
16
|
from rasa.nlu.extractors.entity_synonyms import EntitySynonymMapper
|
|
24
|
-
from rasa.nlu.extractors.mitie_entity_extractor import MitieEntityExtractor
|
|
25
17
|
from rasa.nlu.extractors.regex_entity_extractor import RegexEntityExtractor
|
|
26
18
|
from rasa.nlu.featurizers.featurizer import Featurizer
|
|
27
19
|
from rasa.nlu.featurizers.sparse_featurizer.regex_featurizer import RegexFeaturizer
|
|
28
|
-
from rasa.nlu.selectors.response_selector import ResponseSelector
|
|
29
20
|
from rasa.nlu.tokenizers.tokenizer import Tokenizer
|
|
30
21
|
from rasa.shared.constants import (
|
|
31
22
|
DEFAULT_CONFIG_PATH,
|
|
@@ -45,11 +36,45 @@ from rasa.shared.core.training_data.structures import RuleStep, StoryGraph
|
|
|
45
36
|
from rasa.shared.exceptions import InvalidConfigException
|
|
46
37
|
from rasa.shared.importers.importer import TrainingDataImporter
|
|
47
38
|
from rasa.shared.nlu.training_data.training_data import TrainingData
|
|
39
|
+
from rasa.shared.utils.common import conditional_import
|
|
48
40
|
|
|
49
|
-
#
|
|
50
|
-
|
|
41
|
+
# Conditional imports for TensorFlow-dependent components
|
|
42
|
+
TEDPolicy, TED_POLICY_AVAILABLE = conditional_import(
|
|
43
|
+
"rasa.core.policies.ted_policy", "TEDPolicy"
|
|
44
|
+
)
|
|
45
|
+
UnexpecTEDIntentPolicy, UNEXPECTED_INTENT_POLICY_AVAILABLE = conditional_import(
|
|
46
|
+
"rasa.core.policies.unexpected_intent_policy", "UnexpecTEDIntentPolicy"
|
|
47
|
+
)
|
|
48
|
+
DIETClassifier, DIET_CLASSIFIER_AVAILABLE = conditional_import(
|
|
49
|
+
"rasa.nlu.classifiers.diet_classifier", "DIETClassifier"
|
|
50
|
+
)
|
|
51
|
+
ResponseSelector, RESPONSE_SELECTOR_AVAILABLE = conditional_import(
|
|
52
|
+
"rasa.nlu.selectors.response_selector", "ResponseSelector"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Conditional imports for nlu components requiring other dependencies than tensorflow
|
|
56
|
+
MitieEntityExtractor, MITIE_ENTITY_EXTRACTOR_AVAILABLE = conditional_import(
|
|
57
|
+
"rasa.nlu.extractors.mitie_entity_extractor", "MitieEntityExtractor"
|
|
58
|
+
)
|
|
59
|
+
CRFEntityExtractor, CRF_ENTITY_EXTRACTOR_AVAILABLE = conditional_import(
|
|
60
|
+
"rasa.nlu.extractors.crf_entity_extractor", "CRFEntityExtractor"
|
|
61
|
+
)
|
|
62
|
+
CRFEntityExtractorOptions, _ = conditional_import(
|
|
63
|
+
"rasa.nlu.extractors.crf_entity_extractor", "CRFEntityExtractorOptions"
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# TODO: Can we replace this with the registered types from the registry?
|
|
67
|
+
TRAINABLE_EXTRACTORS = []
|
|
68
|
+
if CRF_ENTITY_EXTRACTOR_AVAILABLE:
|
|
69
|
+
TRAINABLE_EXTRACTORS.append(CRFEntityExtractor)
|
|
70
|
+
if MITIE_ENTITY_EXTRACTOR_AVAILABLE:
|
|
71
|
+
TRAINABLE_EXTRACTORS.append(MitieEntityExtractor)
|
|
72
|
+
if DIET_CLASSIFIER_AVAILABLE:
|
|
73
|
+
TRAINABLE_EXTRACTORS.append(DIETClassifier)
|
|
51
74
|
# TODO: replace these once the Recipe is merged (used in tests)
|
|
52
|
-
POLICY_CLASSSES = {
|
|
75
|
+
POLICY_CLASSSES = {MemoizationPolicy, RulePolicy}
|
|
76
|
+
if TED_POLICY_AVAILABLE:
|
|
77
|
+
POLICY_CLASSSES.add(TEDPolicy)
|
|
53
78
|
|
|
54
79
|
|
|
55
80
|
def _types_to_str(types: Iterable[Type]) -> Text:
|
|
@@ -158,18 +183,27 @@ class DefaultV1RecipeValidator(GraphComponent):
|
|
|
158
183
|
docs=DOCS_URL_COMPONENTS,
|
|
159
184
|
)
|
|
160
185
|
|
|
186
|
+
available_extractors = {DIETClassifier}
|
|
187
|
+
if CRF_ENTITY_EXTRACTOR_AVAILABLE:
|
|
188
|
+
available_extractors.add(CRFEntityExtractor)
|
|
189
|
+
|
|
161
190
|
if training_data.entity_examples and self._component_types.isdisjoint(
|
|
162
|
-
|
|
191
|
+
available_extractors
|
|
163
192
|
):
|
|
164
193
|
if training_data.entity_roles_groups_used():
|
|
194
|
+
crf_name = (
|
|
195
|
+
CRFEntityExtractor.__name__
|
|
196
|
+
if CRFEntityExtractor
|
|
197
|
+
else "CRFEntityExtractor"
|
|
198
|
+
)
|
|
165
199
|
rasa.shared.utils.io.raise_warning(
|
|
166
200
|
f"You have defined training data with entities that "
|
|
167
201
|
f"have roles/groups, but your NLU configuration does not "
|
|
168
202
|
f"include a '{DIETClassifier.__name__}' "
|
|
169
|
-
f"or a '{
|
|
203
|
+
f"or a '{crf_name}'. "
|
|
170
204
|
f"To train entities that have roles/groups, "
|
|
171
205
|
f"add either '{DIETClassifier.__name__}' "
|
|
172
|
-
f"or '{
|
|
206
|
+
f"or '{crf_name}' to your "
|
|
173
207
|
f"configuration.",
|
|
174
208
|
docs=DOCS_URL_COMPONENTS,
|
|
175
209
|
)
|
|
@@ -203,7 +237,16 @@ class DefaultV1RecipeValidator(GraphComponent):
|
|
|
203
237
|
)
|
|
204
238
|
|
|
205
239
|
if training_data.lookup_tables:
|
|
206
|
-
|
|
240
|
+
lookup_extractors = [DIETClassifier]
|
|
241
|
+
if CRF_ENTITY_EXTRACTOR_AVAILABLE:
|
|
242
|
+
lookup_extractors.append(CRFEntityExtractor)
|
|
243
|
+
|
|
244
|
+
if self._component_types.isdisjoint(lookup_extractors):
|
|
245
|
+
crf_name = (
|
|
246
|
+
CRFEntityExtractor.__name__
|
|
247
|
+
if CRFEntityExtractor
|
|
248
|
+
else "CRFEntityExtractor"
|
|
249
|
+
)
|
|
207
250
|
rasa.shared.utils.io.raise_warning(
|
|
208
251
|
f"You have defined training data consisting of lookup tables, but "
|
|
209
252
|
f"your NLU configuration does not include any components "
|
|
@@ -211,33 +254,45 @@ class DefaultV1RecipeValidator(GraphComponent):
|
|
|
211
254
|
f"To make use of the features that are created with the "
|
|
212
255
|
f"help of the lookup tables, "
|
|
213
256
|
f"add a '{DIETClassifier.__name__}' or a "
|
|
214
|
-
f"'{
|
|
257
|
+
f"'{crf_name}' "
|
|
215
258
|
f"with the 'pattern' feature "
|
|
216
259
|
f"to your configuration.",
|
|
217
260
|
docs=DOCS_URL_COMPONENTS,
|
|
218
261
|
)
|
|
219
262
|
|
|
220
|
-
elif
|
|
263
|
+
elif (
|
|
264
|
+
CRF_ENTITY_EXTRACTOR_AVAILABLE
|
|
265
|
+
and CRFEntityExtractor in self._component_types
|
|
266
|
+
):
|
|
221
267
|
crf_schema_nodes = [
|
|
222
268
|
schema_node
|
|
223
269
|
for schema_node in self._graph_schema.nodes.values()
|
|
224
270
|
if schema_node.uses == CRFEntityExtractor
|
|
225
271
|
]
|
|
226
|
-
has_pattern_feature =
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
272
|
+
has_pattern_feature = (
|
|
273
|
+
any(
|
|
274
|
+
CRFEntityExtractorOptions.PATTERN in feature_list
|
|
275
|
+
for crf in crf_schema_nodes
|
|
276
|
+
for feature_list in crf.config.get("features", [])
|
|
277
|
+
)
|
|
278
|
+
if CRFEntityExtractorOptions
|
|
279
|
+
else False
|
|
230
280
|
)
|
|
231
281
|
|
|
232
282
|
if not has_pattern_feature:
|
|
283
|
+
crf_name = (
|
|
284
|
+
CRFEntityExtractor.__name__
|
|
285
|
+
if CRFEntityExtractor
|
|
286
|
+
else "CRFEntityExtractor"
|
|
287
|
+
)
|
|
233
288
|
rasa.shared.utils.io.raise_warning(
|
|
234
289
|
f"You have defined training data consisting of "
|
|
235
290
|
f"lookup tables, but your NLU configuration's "
|
|
236
|
-
f"'{
|
|
291
|
+
f"'{crf_name}' "
|
|
237
292
|
f"does not include the "
|
|
238
293
|
f"'pattern' feature. To featurize lookup tables, "
|
|
239
294
|
f"add the 'pattern' feature to the "
|
|
240
|
-
f"'{
|
|
295
|
+
f"'{crf_name}' "
|
|
241
296
|
"in your configuration.",
|
|
242
297
|
docs=DOCS_URL_COMPONENTS,
|
|
243
298
|
)
|
|
@@ -446,13 +501,16 @@ class DefaultV1RecipeValidator(GraphComponent):
|
|
|
446
501
|
return
|
|
447
502
|
|
|
448
503
|
# if we are using a flow policy, there shouldn't be any dm1 policies
|
|
449
|
-
|
|
504
|
+
dm1_policies_list = [
|
|
450
505
|
RulePolicy,
|
|
451
|
-
TEDPolicy,
|
|
452
506
|
MemoizationPolicy,
|
|
453
507
|
AugmentedMemoizationPolicy,
|
|
454
|
-
|
|
455
|
-
|
|
508
|
+
]
|
|
509
|
+
if TED_POLICY_AVAILABLE:
|
|
510
|
+
dm1_policies_list.append(TEDPolicy)
|
|
511
|
+
if UNEXPECTED_INTENT_POLICY_AVAILABLE:
|
|
512
|
+
dm1_policies_list.append(UnexpecTEDIntentPolicy)
|
|
513
|
+
dm1_policies = tuple(dm1_policies_list)
|
|
456
514
|
|
|
457
515
|
for schema_node in self._graph_schema.nodes.values():
|
|
458
516
|
if issubclass(schema_node.uses, dm1_policies):
|
rasa/hooks.py
CHANGED
|
@@ -19,7 +19,7 @@ hookimpl = pluggy.HookimplMarker("rasa")
|
|
|
19
19
|
logger = logging.getLogger(__name__)
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
@hookimpl
|
|
22
|
+
@hookimpl
|
|
23
23
|
def refine_cli(
|
|
24
24
|
subparsers: "SubParsersAction",
|
|
25
25
|
parent_parsers: List[argparse.ArgumentParser],
|
|
@@ -37,7 +37,7 @@ def refine_cli(
|
|
|
37
37
|
return None
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
@hookimpl
|
|
40
|
+
@hookimpl
|
|
41
41
|
def configure_commandline(cmdline_arguments: argparse.Namespace) -> Optional[Text]:
|
|
42
42
|
from rasa.cli import x as rasa_x
|
|
43
43
|
from rasa.tracing import config
|
|
@@ -59,21 +59,21 @@ def configure_commandline(cmdline_arguments: argparse.Namespace) -> Optional[Tex
|
|
|
59
59
|
return endpoints_file
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
@hookimpl
|
|
62
|
+
@hookimpl
|
|
63
63
|
def init_telemetry(endpoints_file: Optional[Text]) -> None:
|
|
64
64
|
import rasa.telemetry
|
|
65
65
|
|
|
66
66
|
rasa.telemetry.identify_endpoint_config_traits(endpoints_file)
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
@hookimpl
|
|
69
|
+
@hookimpl
|
|
70
70
|
def init_managers(endpoints_file: Optional[Text]) -> None:
|
|
71
71
|
from rasa.core.secrets_manager.factory import load_secret_manager
|
|
72
72
|
|
|
73
73
|
load_secret_manager(endpoints_file)
|
|
74
74
|
|
|
75
75
|
|
|
76
|
-
@hookimpl
|
|
76
|
+
@hookimpl
|
|
77
77
|
def create_tracker_store(
|
|
78
78
|
endpoint_config: Union["TrackerStore", "EndpointConfig"],
|
|
79
79
|
domain: "Domain",
|
rasa/llm_fine_tuning/utils.py
CHANGED
|
@@ -61,9 +61,9 @@ def patch_invoke_llm_in_generators(mock_impl: Callable) -> Generator:
|
|
|
61
61
|
try:
|
|
62
62
|
# apply the monkey-patch everywhere
|
|
63
63
|
for cls in originals:
|
|
64
|
-
cls.invoke_llm = mock_impl # type: ignore[
|
|
64
|
+
cls.invoke_llm = mock_impl # type: ignore[method-assign]
|
|
65
65
|
yield
|
|
66
66
|
finally:
|
|
67
67
|
# restore originals (even if an exception happened)
|
|
68
68
|
for cls, orig in originals.items():
|
|
69
|
-
cls.invoke_llm = orig # type: ignore[
|
|
69
|
+
cls.invoke_llm = orig # type: ignore[method-assign]
|