rasa-pro 3.13.0.dev5__py3-none-any.whl → 3.13.0.dev20250612__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/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/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/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/voice_ready/audiocodes.py +34 -17
- rasa/core/evaluation/marker_tracker_loader.py +1 -1
- rasa/core/exporter.py +1 -1
- rasa/core/nlg/summarize.py +1 -1
- rasa/core/persistor.py +55 -20
- rasa/core/processor.py +2 -2
- rasa/core/run.py +7 -2
- 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/utils.py +6 -0
- rasa/dialogue_understanding/commands/clarify_command.py +2 -2
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +1 -1
- rasa/hooks.py +2 -2
- rasa/keys +1 -0
- 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 -1
- rasa/server.py +6 -2
- rasa/shared/core/events.py +68 -2
- 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/licensing.py +1 -2
- rasa/version.py +1 -1
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev20250612.dist-info}/METADATA +4 -4
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev20250612.dist-info}/RECORD +135 -126
- 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.dev20250612.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev20250612.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev20250612.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"
|
|
@@ -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])
|
|
@@ -415,30 +421,41 @@ class AudiocodesInput(InputChannel):
|
|
|
415
421
|
"audiocodes.on_activities.no_conversation", request=request.json
|
|
416
422
|
)
|
|
417
423
|
return response.json({})
|
|
418
|
-
|
|
424
|
+
|
|
425
|
+
if self.use_websocket:
|
|
426
|
+
# send an empty response for this request
|
|
427
|
+
# activities are processed in the background
|
|
428
|
+
# chat response is sent via the websocket
|
|
419
429
|
ac_output: Union[WebsocketOutput, AudiocodesOutput] = WebsocketOutput(
|
|
420
430
|
conversation.ws, conversation_id
|
|
421
431
|
)
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
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
|
+
)
|
|
441
|
+
return response.json({})
|
|
442
|
+
|
|
443
|
+
# without websockets, this becomes a blocking call
|
|
444
|
+
# and the response is sent back to the Audiocodes server
|
|
445
|
+
# after the activities are processed
|
|
446
|
+
ac_output = AudiocodesOutput()
|
|
447
|
+
await conversation.handle_activities(
|
|
448
|
+
request.json,
|
|
449
|
+
input_channel_name=self.name(),
|
|
450
|
+
output_channel=ac_output,
|
|
451
|
+
on_new_message=on_new_message,
|
|
452
|
+
)
|
|
453
|
+
return response.json(
|
|
454
|
+
{
|
|
427
455
|
"conversation": conversation_id,
|
|
428
456
|
"activities": ac_output.messages,
|
|
429
457
|
}
|
|
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
458
|
)
|
|
441
|
-
return response.json(response_json)
|
|
442
459
|
|
|
443
460
|
@ac_webhook.route(
|
|
444
461
|
"/conversation/<conversation_id>/disconnect", methods=["POST"]
|
|
@@ -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
|
|
rasa/core/exporter.py
CHANGED
|
@@ -10,7 +10,7 @@ import rasa.shared.utils.io
|
|
|
10
10
|
from rasa.core.brokers.broker import EventBroker
|
|
11
11
|
from rasa.core.brokers.pika import PikaEventBroker
|
|
12
12
|
from rasa.core.constants import RASA_EXPORT_PROCESS_ID_HEADER_NAME
|
|
13
|
-
from rasa.core.tracker_store import TrackerStore
|
|
13
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
14
14
|
from rasa.exceptions import (
|
|
15
15
|
NoConversationsInTrackerStoreError,
|
|
16
16
|
NoEventsToMigrateError,
|
rasa/core/nlg/summarize.py
CHANGED
|
@@ -3,7 +3,7 @@ from typing import Optional
|
|
|
3
3
|
import structlog
|
|
4
4
|
from jinja2 import Template
|
|
5
5
|
|
|
6
|
-
from rasa.core.
|
|
6
|
+
from rasa.shared.core.trackers import DialogueStateTracker
|
|
7
7
|
from rasa.shared.providers.llm.llm_client import LLMClient
|
|
8
8
|
from rasa.shared.utils.llm import (
|
|
9
9
|
tracker_as_readable_transcript,
|
rasa/core/persistor.py
CHANGED
|
@@ -121,10 +121,12 @@ def get_persistor(storage: StorageType) -> Optional[Persistor]:
|
|
|
121
121
|
class Persistor(abc.ABC):
|
|
122
122
|
"""Store models in cloud and fetch them when needed."""
|
|
123
123
|
|
|
124
|
-
def persist(self, trained_model: str) -> None:
|
|
124
|
+
def persist(self, trained_model: str, remote_root_only: bool = False) -> None:
|
|
125
125
|
"""Uploads a trained model persisted in the `target_dir` to cloud storage."""
|
|
126
126
|
absolute_file_key = self._create_file_key(trained_model)
|
|
127
|
-
file_key =
|
|
127
|
+
file_key = (
|
|
128
|
+
Path(absolute_file_key).name if remote_root_only else absolute_file_key
|
|
129
|
+
)
|
|
128
130
|
self._persist_tar(file_key, trained_model)
|
|
129
131
|
|
|
130
132
|
def retrieve(self, model_name: Text, target_path: Text) -> Text:
|
|
@@ -143,30 +145,32 @@ class Persistor(abc.ABC):
|
|
|
143
145
|
# ensure backward compatibility
|
|
144
146
|
tar_name = self._tar_name(model_name)
|
|
145
147
|
tar_name = self._create_file_key(tar_name)
|
|
146
|
-
|
|
147
|
-
self._retrieve_tar(target_filename)
|
|
148
|
-
self._copy(os.path.basename(tar_name), target_path)
|
|
148
|
+
self._retrieve_tar(tar_name, target_path)
|
|
149
149
|
|
|
150
150
|
if os.path.isdir(target_path):
|
|
151
151
|
return os.path.join(target_path, model_name)
|
|
152
152
|
|
|
153
153
|
return target_path
|
|
154
154
|
|
|
155
|
-
def size_of_persisted_model(
|
|
155
|
+
def size_of_persisted_model(
|
|
156
|
+
self, model_name: Text, target_path: Optional[str] = None
|
|
157
|
+
) -> int:
|
|
156
158
|
"""Returns the size of the model that has been persisted to cloud storage.
|
|
157
159
|
|
|
158
160
|
Args:
|
|
159
161
|
model_name: The name of the model to retrieve.
|
|
162
|
+
target_path: The path to which the model should be saved.
|
|
160
163
|
"""
|
|
161
164
|
tar_name = model_name
|
|
162
165
|
if not model_name.endswith(MODEL_ARCHIVE_EXTENSION):
|
|
163
166
|
# ensure backward compatibility
|
|
164
167
|
tar_name = self._tar_name(model_name)
|
|
165
168
|
tar_name = self._create_file_key(tar_name)
|
|
166
|
-
|
|
167
|
-
return self._retrieve_tar_size(target_filename)
|
|
169
|
+
return self._retrieve_tar_size(tar_name, target_path)
|
|
168
170
|
|
|
169
|
-
def _retrieve_tar_size(
|
|
171
|
+
def _retrieve_tar_size(
|
|
172
|
+
self, filename: Text, target_path: Optional[str] = None
|
|
173
|
+
) -> int:
|
|
170
174
|
"""Returns the size of the model that has been persisted to cloud storage."""
|
|
171
175
|
structlogger.warning(
|
|
172
176
|
"persistor.retrieve_tar_size.not_implemented",
|
|
@@ -179,11 +183,11 @@ class Persistor(abc.ABC):
|
|
|
179
183
|
"size directly from the cloud storage."
|
|
180
184
|
),
|
|
181
185
|
)
|
|
182
|
-
self._retrieve_tar(filename)
|
|
186
|
+
self._retrieve_tar(filename, target_path)
|
|
183
187
|
return os.path.getsize(os.path.basename(filename))
|
|
184
188
|
|
|
185
189
|
@abc.abstractmethod
|
|
186
|
-
def _retrieve_tar(self, filename:
|
|
190
|
+
def _retrieve_tar(self, filename: str, target_path: Optional[str] = None) -> None:
|
|
187
191
|
"""Downloads a model previously persisted to cloud storage."""
|
|
188
192
|
raise NotImplementedError
|
|
189
193
|
|
|
@@ -302,7 +306,9 @@ class AWSPersistor(Persistor):
|
|
|
302
306
|
with open(tar_path, "rb") as f:
|
|
303
307
|
self.s3.Object(self.bucket_name, file_key).put(Body=f)
|
|
304
308
|
|
|
305
|
-
def _retrieve_tar_size(
|
|
309
|
+
def _retrieve_tar_size(
|
|
310
|
+
self, model_path: Text, target_path: Optional[str] = None
|
|
311
|
+
) -> int:
|
|
306
312
|
"""Returns the size of the model that has been persisted to s3."""
|
|
307
313
|
try:
|
|
308
314
|
obj = self.s3.Object(self.bucket_name, model_path)
|
|
@@ -310,7 +316,9 @@ class AWSPersistor(Persistor):
|
|
|
310
316
|
except Exception:
|
|
311
317
|
raise ModelNotFound()
|
|
312
318
|
|
|
313
|
-
def _retrieve_tar(
|
|
319
|
+
def _retrieve_tar(
|
|
320
|
+
self, target_filename: str, target_path: Optional[str] = None
|
|
321
|
+
) -> None:
|
|
314
322
|
"""Downloads a model that has previously been persisted to s3."""
|
|
315
323
|
from botocore import exceptions
|
|
316
324
|
|
|
@@ -320,8 +328,14 @@ class AWSPersistor(Persistor):
|
|
|
320
328
|
f"in the bucket."
|
|
321
329
|
)
|
|
322
330
|
|
|
331
|
+
tar_name = (
|
|
332
|
+
os.path.join(target_path, os.path.basename(target_filename))
|
|
333
|
+
if target_path
|
|
334
|
+
else os.path.basename(target_filename)
|
|
335
|
+
)
|
|
336
|
+
|
|
323
337
|
try:
|
|
324
|
-
with open(
|
|
338
|
+
with open(tar_name, "wb") as f:
|
|
325
339
|
self.bucket.download_fileobj(target_filename, f)
|
|
326
340
|
|
|
327
341
|
structlogger.debug(
|
|
@@ -425,7 +439,9 @@ class GCSPersistor(Persistor):
|
|
|
425
439
|
blob = self.bucket.blob(file_key)
|
|
426
440
|
blob.upload_from_filename(tar_path)
|
|
427
441
|
|
|
428
|
-
def _retrieve_tar_size(
|
|
442
|
+
def _retrieve_tar_size(
|
|
443
|
+
self, target_filename: Text, target_path: Optional[str] = None
|
|
444
|
+
) -> int:
|
|
429
445
|
"""Returns the size of the model that has been persisted to GCS."""
|
|
430
446
|
try:
|
|
431
447
|
blob = self.bucket.blob(target_filename)
|
|
@@ -433,13 +449,22 @@ class GCSPersistor(Persistor):
|
|
|
433
449
|
except Exception:
|
|
434
450
|
raise ModelNotFound()
|
|
435
451
|
|
|
436
|
-
def _retrieve_tar(
|
|
452
|
+
def _retrieve_tar(
|
|
453
|
+
self, target_filename: str, target_path: Optional[str] = None
|
|
454
|
+
) -> None:
|
|
437
455
|
"""Downloads a model that has previously been persisted to GCS."""
|
|
438
456
|
from google.api_core import exceptions
|
|
439
457
|
|
|
440
458
|
blob = self.bucket.blob(target_filename)
|
|
459
|
+
|
|
460
|
+
destination = (
|
|
461
|
+
os.path.join(target_path, os.path.basename(target_filename))
|
|
462
|
+
if target_path
|
|
463
|
+
else target_filename
|
|
464
|
+
)
|
|
465
|
+
|
|
441
466
|
try:
|
|
442
|
-
blob.download_to_filename(
|
|
467
|
+
blob.download_to_filename(destination)
|
|
443
468
|
|
|
444
469
|
structlogger.debug(
|
|
445
470
|
"gcs_persistor.retrieve_tar.object_found", object_key=target_filename
|
|
@@ -500,7 +525,9 @@ class AzurePersistor(Persistor):
|
|
|
500
525
|
with open(tar_path, "rb") as data:
|
|
501
526
|
self._container_client().upload_blob(name=file_key, data=data)
|
|
502
527
|
|
|
503
|
-
def _retrieve_tar_size(
|
|
528
|
+
def _retrieve_tar_size(
|
|
529
|
+
self, target_filename: Text, target_path: Optional[str] = None
|
|
530
|
+
) -> int:
|
|
504
531
|
"""Returns the size of the model that has been persisted to Azure."""
|
|
505
532
|
try:
|
|
506
533
|
blob_client = self._container_client().get_blob_client(target_filename)
|
|
@@ -509,12 +536,20 @@ class AzurePersistor(Persistor):
|
|
|
509
536
|
except Exception:
|
|
510
537
|
raise ModelNotFound()
|
|
511
538
|
|
|
512
|
-
def _retrieve_tar(
|
|
539
|
+
def _retrieve_tar(
|
|
540
|
+
self, target_filename: Text, target_path: Optional[str] = None
|
|
541
|
+
) -> None:
|
|
513
542
|
"""Downloads a model that has previously been persisted to Azure."""
|
|
514
543
|
from azure.core.exceptions import AzureError
|
|
515
544
|
|
|
545
|
+
destination = (
|
|
546
|
+
os.path.join(target_path, os.path.basename(target_filename))
|
|
547
|
+
if target_path
|
|
548
|
+
else target_filename
|
|
549
|
+
)
|
|
550
|
+
|
|
516
551
|
try:
|
|
517
|
-
with open(
|
|
552
|
+
with open(destination, "wb") as model_file:
|
|
518
553
|
blob_client = self._container_client().get_blob_client(target_filename)
|
|
519
554
|
download_stream = blob_client.download_blob()
|
|
520
555
|
model_file.write(download_stream.readall())
|
rasa/core/processor.py
CHANGED
|
@@ -12,7 +12,7 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Text, Tuple, Union
|
|
|
12
12
|
import structlog
|
|
13
13
|
|
|
14
14
|
import rasa.core.actions.action
|
|
15
|
-
import rasa.core.tracker_store
|
|
15
|
+
import rasa.core.tracker_stores.tracker_store
|
|
16
16
|
import rasa.core.utils
|
|
17
17
|
import rasa.shared.core.trackers
|
|
18
18
|
import rasa.shared.utils.io
|
|
@@ -126,7 +126,7 @@ class MessageProcessor:
|
|
|
126
126
|
def __init__(
|
|
127
127
|
self,
|
|
128
128
|
model_path: Union[Text, Path],
|
|
129
|
-
tracker_store: rasa.core.tracker_store.TrackerStore,
|
|
129
|
+
tracker_store: rasa.core.tracker_stores.tracker_store.TrackerStore,
|
|
130
130
|
lock_store: LockStore,
|
|
131
131
|
generator: NaturalLanguageGenerator,
|
|
132
132
|
action_endpoint: Optional[EndpointConfig] = None,
|
rasa/core/run.py
CHANGED
|
@@ -86,13 +86,15 @@ def _create_single_channel(channel: Text, credentials: Dict[Text, Any]) -> Any:
|
|
|
86
86
|
)
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
def _create_app_without_api(
|
|
89
|
+
def _create_app_without_api(
|
|
90
|
+
cors: Optional[Union[Text, List[Text]]] = None, is_inspector_enabled: bool = False
|
|
91
|
+
) -> Sanic:
|
|
90
92
|
app = Sanic("rasa_core_no_api", configure_logging=False)
|
|
91
93
|
|
|
92
94
|
# Reset Sanic warnings filter that allows the triggering of Sanic warnings
|
|
93
95
|
warnings.filterwarnings("ignore", category=DeprecationWarning, module=r"sanic.*")
|
|
94
96
|
|
|
95
|
-
server.add_root_route(app)
|
|
97
|
+
server.add_root_route(app, is_inspector_enabled)
|
|
96
98
|
server.configure_cors(app, cors)
|
|
97
99
|
return app
|
|
98
100
|
|
|
@@ -127,6 +129,7 @@ def configure_app(
|
|
|
127
129
|
server_listeners: Optional[List[Tuple[Callable, Text]]] = None,
|
|
128
130
|
use_uvloop: Optional[bool] = True,
|
|
129
131
|
keep_alive_timeout: int = constants.DEFAULT_KEEP_ALIVE_TIMEOUT,
|
|
132
|
+
is_inspector_enabled: bool = False,
|
|
130
133
|
) -> Sanic:
|
|
131
134
|
"""Run the agent."""
|
|
132
135
|
rasa.core.utils.configure_file_logging(
|
|
@@ -144,6 +147,7 @@ def configure_app(
|
|
|
144
147
|
jwt_private_key=jwt_private_key,
|
|
145
148
|
jwt_method=jwt_method,
|
|
146
149
|
endpoints=endpoints,
|
|
150
|
+
is_inspector_enabled=is_inspector_enabled,
|
|
147
151
|
)
|
|
148
152
|
)
|
|
149
153
|
else:
|
|
@@ -259,6 +263,7 @@ def serve_application(
|
|
|
259
263
|
syslog_protocol=syslog_protocol,
|
|
260
264
|
request_timeout=request_timeout,
|
|
261
265
|
server_listeners=server_listeners,
|
|
266
|
+
is_inspector_enabled=inspect,
|
|
262
267
|
)
|
|
263
268
|
|
|
264
269
|
ssl_context = server.create_ssl_context(
|
|
File without changes
|
|
@@ -3,7 +3,7 @@ from typing import Iterable, Optional, Text
|
|
|
3
3
|
|
|
4
4
|
from rasa.core.brokers.broker import EventBroker
|
|
5
5
|
from rasa.core.secrets_manager.secret_manager import EndpointResolver
|
|
6
|
-
from rasa.core.tracker_store import TrackerStore, create_tracker_store
|
|
6
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore, create_tracker_store
|
|
7
7
|
from rasa.shared.core.domain import Domain
|
|
8
8
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
9
9
|
from rasa.utils.endpoints import EndpointConfig
|
|
@@ -119,3 +119,7 @@ class AuthRetryTrackerStore(TrackerStore):
|
|
|
119
119
|
"""Recreate tracker store with updated credentials."""
|
|
120
120
|
endpoint_config = EndpointResolver.update_config(self.endpoint_config)
|
|
121
121
|
return create_tracker_store(endpoint_config, domain, event_broker)
|
|
122
|
+
|
|
123
|
+
async def delete(self, sender_id: Text) -> None:
|
|
124
|
+
"""Delete tracker for the given sender_id."""
|
|
125
|
+
await self._tracker_store.delete(sender_id)
|