File size: 1,490 Bytes
0827183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from typing import Iterable

from botbuilder.core import ComponentRegistration

from botbuilder.dialogs.memory import (
    ComponentMemoryScopesBase,
    ComponentPathResolversBase,
    PathResolverBase,
)
from botbuilder.dialogs.memory.scopes import (
    TurnMemoryScope,
    SettingsMemoryScope,
    DialogMemoryScope,
    DialogContextMemoryScope,
    DialogClassMemoryScope,
    ClassMemoryScope,
    MemoryScope,
    ThisMemoryScope,
    ConversationMemoryScope,
    UserMemoryScope,
)

from botbuilder.dialogs.memory.path_resolvers import (
    AtAtPathResolver,
    AtPathResolver,
    DollarPathResolver,
    HashPathResolver,
    PercentPathResolver,
)


class DialogsComponentRegistration(
    ComponentRegistration, ComponentMemoryScopesBase, ComponentPathResolversBase
):
    def get_memory_scopes(self) -> Iterable[MemoryScope]:
        yield TurnMemoryScope()
        yield SettingsMemoryScope()
        yield DialogMemoryScope()
        yield DialogContextMemoryScope()
        yield DialogClassMemoryScope()
        yield ClassMemoryScope()
        yield ThisMemoryScope()
        yield ConversationMemoryScope()
        yield UserMemoryScope()

    def get_path_resolvers(self) -> Iterable[PathResolverBase]:
        yield AtAtPathResolver()
        yield AtPathResolver()
        yield DollarPathResolver()
        yield HashPathResolver()
        yield PercentPathResolver()