rasa-pro 3.13.0.dev5__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/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/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/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/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/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 -1
- rasa/server.py +6 -2
- rasa/shared/constants.py +3 -0
- rasa/shared/core/events.py +68 -2
- rasa/shared/providers/_configs/azure_openai_client_config.py +4 -0
- rasa/shared/providers/_configs/openai_client_config.py +4 -0
- rasa/shared/providers/embedding/_base_litellm_embedding_client.py +3 -0
- rasa/shared/providers/llm/_base_litellm_client.py +5 -2
- rasa/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.dev7.dist-info}/METADATA +4 -4
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev7.dist-info}/RECORD +149 -140
- 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.dev7.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev7.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev7.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,
|
|
@@ -8,12 +8,14 @@ from rasa.core.nlg.response import TemplatedNaturalLanguageGenerator
|
|
|
8
8
|
from rasa.core.nlg.summarize import summarize_conversation
|
|
9
9
|
from rasa.shared.constants import (
|
|
10
10
|
LLM_CONFIG_KEY,
|
|
11
|
+
MAX_COMPLETION_TOKENS_CONFIG_KEY,
|
|
11
12
|
MODEL_CONFIG_KEY,
|
|
12
13
|
MODEL_GROUP_ID_CONFIG_KEY,
|
|
13
14
|
MODEL_NAME_CONFIG_KEY,
|
|
14
15
|
OPENAI_PROVIDER,
|
|
15
16
|
PROMPT_CONFIG_KEY,
|
|
16
17
|
PROVIDER_CONFIG_KEY,
|
|
18
|
+
TEMPERATURE_CONFIG_KEY,
|
|
17
19
|
TIMEOUT_CONFIG_KEY,
|
|
18
20
|
)
|
|
19
21
|
from rasa.shared.core.domain import KEY_RESPONSES_TEXT, Domain
|
|
@@ -57,8 +59,8 @@ DEFAULT_MAX_HISTORICAL_TURNS = 5
|
|
|
57
59
|
DEFAULT_LLM_CONFIG = {
|
|
58
60
|
PROVIDER_CONFIG_KEY: OPENAI_PROVIDER,
|
|
59
61
|
MODEL_CONFIG_KEY: DEFAULT_OPENAI_GENERATE_MODEL_NAME,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
TEMPERATURE_CONFIG_KEY: 0.3,
|
|
63
|
+
MAX_COMPLETION_TOKENS_CONFIG_KEY: DEFAULT_OPENAI_MAX_GENERATED_TOKENS,
|
|
62
64
|
TIMEOUT_CONFIG_KEY: 5,
|
|
63
65
|
}
|
|
64
66
|
|
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())
|
|
@@ -46,12 +46,15 @@ from rasa.graph_components.providers.forms_provider import Forms
|
|
|
46
46
|
from rasa.graph_components.providers.responses_provider import Responses
|
|
47
47
|
from rasa.shared.constants import (
|
|
48
48
|
EMBEDDINGS_CONFIG_KEY,
|
|
49
|
+
MAX_COMPLETION_TOKENS_CONFIG_KEY,
|
|
50
|
+
MAX_RETRIES_CONFIG_KEY,
|
|
49
51
|
MODEL_CONFIG_KEY,
|
|
50
52
|
MODEL_GROUP_ID_CONFIG_KEY,
|
|
51
53
|
MODEL_NAME_CONFIG_KEY,
|
|
52
54
|
OPENAI_PROVIDER,
|
|
53
55
|
PROMPT_CONFIG_KEY,
|
|
54
56
|
PROVIDER_CONFIG_KEY,
|
|
57
|
+
TEMPERATURE_CONFIG_KEY,
|
|
55
58
|
TIMEOUT_CONFIG_KEY,
|
|
56
59
|
)
|
|
57
60
|
from rasa.shared.core.constants import (
|
|
@@ -135,14 +138,14 @@ DEFAULT_LLM_CONFIG = {
|
|
|
135
138
|
PROVIDER_CONFIG_KEY: OPENAI_PROVIDER,
|
|
136
139
|
MODEL_CONFIG_KEY: DEFAULT_OPENAI_CHAT_MODEL_NAME,
|
|
137
140
|
TIMEOUT_CONFIG_KEY: 10,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
TEMPERATURE_CONFIG_KEY: 0.0,
|
|
142
|
+
MAX_COMPLETION_TOKENS_CONFIG_KEY: 256,
|
|
143
|
+
MAX_RETRIES_CONFIG_KEY: 1,
|
|
141
144
|
}
|
|
142
145
|
|
|
143
146
|
DEFAULT_EMBEDDINGS_CONFIG = {
|
|
144
147
|
PROVIDER_CONFIG_KEY: OPENAI_PROVIDER,
|
|
145
|
-
|
|
148
|
+
MODEL_CONFIG_KEY: DEFAULT_OPENAI_EMBEDDING_MODEL_NAME,
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
ENTERPRISE_SEARCH_PROMPT_FILE_NAME = "enterprise_search_policy_prompt.jinja2"
|
|
@@ -31,12 +31,14 @@ from rasa.graph_components.providers.responses_provider import Responses
|
|
|
31
31
|
from rasa.shared.constants import (
|
|
32
32
|
EMBEDDINGS_CONFIG_KEY,
|
|
33
33
|
LLM_CONFIG_KEY,
|
|
34
|
+
MAX_COMPLETION_TOKENS_CONFIG_KEY,
|
|
34
35
|
MODEL_CONFIG_KEY,
|
|
35
36
|
MODEL_GROUP_ID_CONFIG_KEY,
|
|
36
37
|
MODEL_NAME_CONFIG_KEY,
|
|
37
38
|
OPENAI_PROVIDER,
|
|
38
39
|
PROMPT_CONFIG_KEY,
|
|
39
40
|
PROVIDER_CONFIG_KEY,
|
|
41
|
+
TEMPERATURE_CONFIG_KEY,
|
|
40
42
|
TIMEOUT_CONFIG_KEY,
|
|
41
43
|
)
|
|
42
44
|
from rasa.shared.core.constants import ACTION_LISTEN_NAME
|
|
@@ -111,14 +113,14 @@ NLU_ABSTENTION_THRESHOLD = "nlu_abstention_threshold"
|
|
|
111
113
|
DEFAULT_LLM_CONFIG = {
|
|
112
114
|
PROVIDER_CONFIG_KEY: OPENAI_PROVIDER,
|
|
113
115
|
MODEL_CONFIG_KEY: DEFAULT_OPENAI_CHAT_MODEL_NAME,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
TEMPERATURE_CONFIG_KEY: 0.0,
|
|
117
|
+
MAX_COMPLETION_TOKENS_CONFIG_KEY: DEFAULT_OPENAI_MAX_GENERATED_TOKENS,
|
|
116
118
|
TIMEOUT_CONFIG_KEY: 5,
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
DEFAULT_EMBEDDINGS_CONFIG = {
|
|
120
122
|
PROVIDER_CONFIG_KEY: OPENAI_PROVIDER,
|
|
121
|
-
|
|
123
|
+
MODEL_CONFIG_KEY: DEFAULT_OPENAI_EMBEDDING_MODEL_NAME,
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
DEFAULT_INTENTLESS_PROMPT_TEMPLATE = importlib.resources.open_text(
|
|
@@ -344,8 +346,6 @@ class IntentlessPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Policy):
|
|
|
344
346
|
# ensures that the policy will not override a deterministic policy
|
|
345
347
|
# which utilizes the nlu predictions confidence (e.g. Memoization).
|
|
346
348
|
NLU_ABSTENTION_THRESHOLD: 0.9,
|
|
347
|
-
LLM_CONFIG_KEY: DEFAULT_LLM_CONFIG,
|
|
348
|
-
EMBEDDINGS_CONFIG_KEY: DEFAULT_EMBEDDINGS_CONFIG,
|
|
349
349
|
PROMPT_CONFIG_KEY: DEFAULT_INTENTLESS_PROMPT_TEMPLATE,
|
|
350
350
|
}
|
|
351
351
|
|
|
@@ -381,13 +381,19 @@ class IntentlessPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Policy):
|
|
|
381
381
|
super().__init__(config, model_storage, resource, execution_context, featurizer)
|
|
382
382
|
|
|
383
383
|
# Resolve LLM config
|
|
384
|
-
self.config[LLM_CONFIG_KEY] =
|
|
385
|
-
|
|
384
|
+
self.config[LLM_CONFIG_KEY] = combine_custom_and_default_config(
|
|
385
|
+
resolve_model_client_config(
|
|
386
|
+
self.config.get(LLM_CONFIG_KEY), IntentlessPolicy.__name__
|
|
387
|
+
),
|
|
388
|
+
DEFAULT_LLM_CONFIG,
|
|
386
389
|
)
|
|
387
390
|
|
|
388
391
|
# Resolve embeddings config
|
|
389
|
-
self.config[EMBEDDINGS_CONFIG_KEY] =
|
|
390
|
-
|
|
392
|
+
self.config[EMBEDDINGS_CONFIG_KEY] = combine_custom_and_default_config(
|
|
393
|
+
resolve_model_client_config(
|
|
394
|
+
self.config.get(EMBEDDINGS_CONFIG_KEY), IntentlessPolicy.__name__
|
|
395
|
+
),
|
|
396
|
+
DEFAULT_EMBEDDINGS_CONFIG,
|
|
391
397
|
)
|
|
392
398
|
|
|
393
399
|
self.nlu_abstention_threshold: float = self.config[NLU_ABSTENTION_THRESHOLD]
|