diff --git a/proto/action_webhook.proto b/proto/action_webhook.proto index 19ce1d979..9cae517b1 100644 --- a/proto/action_webhook.proto +++ b/proto/action_webhook.proto @@ -1,35 +1,49 @@ syntax = "proto3"; package action_server_webhook; -import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; service ActionServerWebhook { rpc webhook (WebhookRequest) returns (WebhookResponse); } message Tracker { - string conversation_id = 1; - map slots = 2; - map latest_message = 3; - double latest_event_time = 4; - string followup_action = 5; - bool paused = 6; - repeated string events = 7; - string latest_input_channel = 8; - map active_loop = 9; - map latest_action = 10; + string sender_id = 1; + google.protobuf.Struct slots = 2; + google.protobuf.Struct latest_message = 3; + repeated google.protobuf.Struct events = 4; + bool paused = 5; + optional string followup_action = 6; + map active_loop = 7; + optional string latest_action_name = 8; + repeated google.protobuf.Struct stack = 9; +} + +message Intent { + string string_value = 1; + google.protobuf.Struct dict_value = 2; +} + +message Entity { + string string_value = 1; + google.protobuf.Struct dict_value = 2; +} + +message Action { + string string_value = 1; + google.protobuf.Struct dict_value = 2; } message Domain { - map config = 1; - map session_config = 2; - repeated string intents = 3; - repeated string entities = 4; - map slots = 5; - map responses = 6; - repeated string actions = 7; - map forms = 8; - repeated string e2e_actions = 9; + google.protobuf.Struct config = 1; + google.protobuf.Struct session_config = 2; + repeated Intent intents = 3; + repeated Entity entities = 4; + google.protobuf.Struct slots = 5; + google.protobuf.Struct responses = 6; + repeated Action actions = 7; + google.protobuf.Struct forms = 8; + repeated google.protobuf.Struct e2e_actions = 9; } message WebhookRequest { @@ -38,9 +52,10 @@ message WebhookRequest { Tracker tracker = 3; Domain domain = 4; string version = 5; + optional string domain_digest = 6; } message WebhookResponse { - repeated google.protobuf.Any events = 1; - repeated google.protobuf.Any responses = 2; + repeated google.protobuf.Struct events = 1; + repeated google.protobuf.Struct responses = 2; } \ No newline at end of file diff --git a/rasa_sdk/grpc_py/action_webhook_pb2.py b/rasa_sdk/grpc_py/action_webhook_pb2.py index 9bb03ad36..b8b7b1101 100644 --- a/rasa_sdk/grpc_py/action_webhook_pb2.py +++ b/rasa_sdk/grpc_py/action_webhook_pb2.py @@ -11,10 +11,10 @@ _sym_db = _symbol_database.Default() -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%rasa_sdk/grpc_py/action_webhook.proto\x12\x15\x61\x63tion_server_webhook\x1a\x19google/protobuf/any.proto\"\xf3\x04\n\x07Tracker\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x38\n\x05slots\x18\x02 \x03(\x0b\x32).action_server_webhook.Tracker.SlotsEntry\x12I\n\x0elatest_message\x18\x03 \x03(\x0b\x32\x31.action_server_webhook.Tracker.LatestMessageEntry\x12\x19\n\x11latest_event_time\x18\x04 \x01(\x01\x12\x17\n\x0f\x66ollowup_action\x18\x05 \x01(\t\x12\x0e\n\x06paused\x18\x06 \x01(\x08\x12\x0e\n\x06\x65vents\x18\x07 \x03(\t\x12\x1c\n\x14latest_input_channel\x18\x08 \x01(\t\x12\x43\n\x0b\x61\x63tive_loop\x18\t \x03(\x0b\x32..action_server_webhook.Tracker.ActiveLoopEntry\x12G\n\rlatest_action\x18\n \x03(\x0b\x32\x30.action_server_webhook.Tracker.LatestActionEntry\x1a,\n\nSlotsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12LatestMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0f\x41\x63tiveLoopEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11LatestActionEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xfc\x04\n\x06\x44omain\x12\x39\n\x06\x63onfig\x18\x01 \x03(\x0b\x32).action_server_webhook.Domain.ConfigEntry\x12H\n\x0esession_config\x18\x02 \x03(\x0b\x32\x30.action_server_webhook.Domain.SessionConfigEntry\x12\x0f\n\x07intents\x18\x03 \x03(\t\x12\x10\n\x08\x65ntities\x18\x04 \x03(\t\x12\x37\n\x05slots\x18\x05 \x03(\x0b\x32(.action_server_webhook.Domain.SlotsEntry\x12?\n\tresponses\x18\x06 \x03(\x0b\x32,.action_server_webhook.Domain.ResponsesEntry\x12\x0f\n\x07\x61\x63tions\x18\x07 \x03(\t\x12\x37\n\x05\x66orms\x18\x08 \x03(\x0b\x32(.action_server_webhook.Domain.FormsEntry\x12\x13\n\x0b\x65\x32\x65_actions\x18\t \x03(\t\x1a-\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12SessionConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a,\n\nSlotsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x30\n\x0eResponsesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a,\n\nFormsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa9\x01\n\x0eWebhookRequest\x12\x13\n\x0bnext_action\x18\x01 \x01(\t\x12\x11\n\tsender_id\x18\x02 \x01(\t\x12/\n\x07tracker\x18\x03 \x01(\x0b\x32\x1e.action_server_webhook.Tracker\x12-\n\x06\x64omain\x18\x04 \x01(\x0b\x32\x1d.action_server_webhook.Domain\x12\x0f\n\x07version\x18\x05 \x01(\t\"`\n\x0fWebhookResponse\x12$\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x14.google.protobuf.Any\x12\'\n\tresponses\x18\x02 \x03(\x0b\x32\x14.google.protobuf.Any2o\n\x13\x41\x63tionServerWebhook\x12X\n\x07webhook\x12%.action_server_webhook.WebhookRequest\x1a&.action_server_webhook.WebhookResponseb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%rasa_sdk/grpc_py/action_webhook.proto\x12\x15\x61\x63tion_server_webhook\x1a\x1cgoogle/protobuf/struct.proto\"\xb8\x03\n\x07Tracker\x12\x11\n\tsender_id\x18\x01 \x01(\t\x12&\n\x05slots\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12/\n\x0elatest_message\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\'\n\x06\x65vents\x18\x04 \x03(\x0b\x32\x17.google.protobuf.Struct\x12\x0e\n\x06paused\x18\x05 \x01(\x08\x12\x1c\n\x0f\x66ollowup_action\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x43\n\x0b\x61\x63tive_loop\x18\x07 \x03(\x0b\x32..action_server_webhook.Tracker.ActiveLoopEntry\x12\x1f\n\x12latest_action_name\x18\x08 \x01(\tH\x01\x88\x01\x01\x12&\n\x05stack\x18\t \x03(\x0b\x32\x17.google.protobuf.Struct\x1a\x31\n\x0f\x41\x63tiveLoopEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x12\n\x10_followup_actionB\x15\n\x13_latest_action_name\"K\n\x06Intent\x12\x14\n\x0cstring_value\x18\x01 \x01(\t\x12+\n\ndict_value\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"K\n\x06\x45ntity\x12\x14\n\x0cstring_value\x18\x01 \x01(\t\x12+\n\ndict_value\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"K\n\x06\x41\x63tion\x12\x14\n\x0cstring_value\x18\x01 \x01(\t\x12+\n\ndict_value\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"\x9d\x03\n\x06\x44omain\x12\'\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12/\n\x0esession_config\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12.\n\x07intents\x18\x03 \x03(\x0b\x32\x1d.action_server_webhook.Intent\x12/\n\x08\x65ntities\x18\x04 \x03(\x0b\x32\x1d.action_server_webhook.Entity\x12&\n\x05slots\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12*\n\tresponses\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x12.\n\x07\x61\x63tions\x18\x07 \x03(\x0b\x32\x1d.action_server_webhook.Action\x12&\n\x05\x66orms\x18\x08 \x01(\x0b\x32\x17.google.protobuf.Struct\x12,\n\x0b\x65\x32\x65_actions\x18\t \x03(\x0b\x32\x17.google.protobuf.Struct\"\xd7\x01\n\x0eWebhookRequest\x12\x13\n\x0bnext_action\x18\x01 \x01(\t\x12\x11\n\tsender_id\x18\x02 \x01(\t\x12/\n\x07tracker\x18\x03 \x01(\x0b\x32\x1e.action_server_webhook.Tracker\x12-\n\x06\x64omain\x18\x04 \x01(\x0b\x32\x1d.action_server_webhook.Domain\x12\x0f\n\x07version\x18\x05 \x01(\t\x12\x1a\n\rdomain_digest\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x10\n\x0e_domain_digest\"f\n\x0fWebhookResponse\x12\'\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x17.google.protobuf.Struct\x12*\n\tresponses\x18\x02 \x03(\x0b\x32\x17.google.protobuf.Struct2o\n\x13\x41\x63tionServerWebhook\x12X\n\x07webhook\x12%.action_server_webhook.WebhookRequest\x1a&.action_server_webhook.WebhookResponseb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -22,50 +22,24 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _TRACKER_SLOTSENTRY._options = None - _TRACKER_SLOTSENTRY._serialized_options = b'8\001' - _TRACKER_LATESTMESSAGEENTRY._options = None - _TRACKER_LATESTMESSAGEENTRY._serialized_options = b'8\001' _TRACKER_ACTIVELOOPENTRY._options = None _TRACKER_ACTIVELOOPENTRY._serialized_options = b'8\001' - _TRACKER_LATESTACTIONENTRY._options = None - _TRACKER_LATESTACTIONENTRY._serialized_options = b'8\001' - _DOMAIN_CONFIGENTRY._options = None - _DOMAIN_CONFIGENTRY._serialized_options = b'8\001' - _DOMAIN_SESSIONCONFIGENTRY._options = None - _DOMAIN_SESSIONCONFIGENTRY._serialized_options = b'8\001' - _DOMAIN_SLOTSENTRY._options = None - _DOMAIN_SLOTSENTRY._serialized_options = b'8\001' - _DOMAIN_RESPONSESENTRY._options = None - _DOMAIN_RESPONSESENTRY._serialized_options = b'8\001' - _DOMAIN_FORMSENTRY._options = None - _DOMAIN_FORMSENTRY._serialized_options = b'8\001' - _globals['_TRACKER']._serialized_start=92 - _globals['_TRACKER']._serialized_end=719 - _globals['_TRACKER_SLOTSENTRY']._serialized_start=517 - _globals['_TRACKER_SLOTSENTRY']._serialized_end=561 - _globals['_TRACKER_LATESTMESSAGEENTRY']._serialized_start=563 - _globals['_TRACKER_LATESTMESSAGEENTRY']._serialized_end=615 - _globals['_TRACKER_ACTIVELOOPENTRY']._serialized_start=617 - _globals['_TRACKER_ACTIVELOOPENTRY']._serialized_end=666 - _globals['_TRACKER_LATESTACTIONENTRY']._serialized_start=668 - _globals['_TRACKER_LATESTACTIONENTRY']._serialized_end=719 - _globals['_DOMAIN']._serialized_start=722 - _globals['_DOMAIN']._serialized_end=1358 - _globals['_DOMAIN_CONFIGENTRY']._serialized_start=1117 - _globals['_DOMAIN_CONFIGENTRY']._serialized_end=1162 - _globals['_DOMAIN_SESSIONCONFIGENTRY']._serialized_start=1164 - _globals['_DOMAIN_SESSIONCONFIGENTRY']._serialized_end=1216 - _globals['_DOMAIN_SLOTSENTRY']._serialized_start=517 - _globals['_DOMAIN_SLOTSENTRY']._serialized_end=561 - _globals['_DOMAIN_RESPONSESENTRY']._serialized_start=1264 - _globals['_DOMAIN_RESPONSESENTRY']._serialized_end=1312 - _globals['_DOMAIN_FORMSENTRY']._serialized_start=1314 - _globals['_DOMAIN_FORMSENTRY']._serialized_end=1358 - _globals['_WEBHOOKREQUEST']._serialized_start=1361 - _globals['_WEBHOOKREQUEST']._serialized_end=1530 - _globals['_WEBHOOKRESPONSE']._serialized_start=1532 - _globals['_WEBHOOKRESPONSE']._serialized_end=1628 - _globals['_ACTIONSERVERWEBHOOK']._serialized_start=1630 - _globals['_ACTIONSERVERWEBHOOK']._serialized_end=1741 + _globals['_TRACKER']._serialized_start=95 + _globals['_TRACKER']._serialized_end=535 + _globals['_TRACKER_ACTIVELOOPENTRY']._serialized_start=443 + _globals['_TRACKER_ACTIVELOOPENTRY']._serialized_end=492 + _globals['_INTENT']._serialized_start=537 + _globals['_INTENT']._serialized_end=612 + _globals['_ENTITY']._serialized_start=614 + _globals['_ENTITY']._serialized_end=689 + _globals['_ACTION']._serialized_start=691 + _globals['_ACTION']._serialized_end=766 + _globals['_DOMAIN']._serialized_start=769 + _globals['_DOMAIN']._serialized_end=1182 + _globals['_WEBHOOKREQUEST']._serialized_start=1185 + _globals['_WEBHOOKREQUEST']._serialized_end=1400 + _globals['_WEBHOOKRESPONSE']._serialized_start=1402 + _globals['_WEBHOOKRESPONSE']._serialized_end=1504 + _globals['_ACTIONSERVERWEBHOOK']._serialized_start=1506 + _globals['_ACTIONSERVERWEBHOOK']._serialized_end=1617 # @@protoc_insertion_point(module_scope) diff --git a/rasa_sdk/grpc_py/action_webhook_pb2.pyi b/rasa_sdk/grpc_py/action_webhook_pb2.pyi index 23caab556..566596e3b 100644 --- a/rasa_sdk/grpc_py/action_webhook_pb2.pyi +++ b/rasa_sdk/grpc_py/action_webhook_pb2.pyi @@ -1,4 +1,4 @@ -from google.protobuf import any_pb2 as _any_pb2 +from google.protobuf import struct_pb2 as _struct_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -7,21 +7,7 @@ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Map DESCRIPTOR: _descriptor.FileDescriptor class Tracker(_message.Message): - __slots__ = ["conversation_id", "slots", "latest_message", "latest_event_time", "followup_action", "paused", "events", "latest_input_channel", "active_loop", "latest_action"] - class SlotsEntry(_message.Message): - __slots__ = ["key", "value"] - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - class LatestMessageEntry(_message.Message): - __slots__ = ["key", "value"] - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + __slots__ = ["sender_id", "slots", "latest_message", "events", "paused", "followup_action", "active_loop", "latest_action_name", "stack"] class ActiveLoopEntry(_message.Message): __slots__ = ["key", "value"] KEY_FIELD_NUMBER: _ClassVar[int] @@ -29,72 +15,52 @@ class Tracker(_message.Message): key: str value: str def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - class LatestActionEntry(_message.Message): - __slots__ = ["key", "value"] - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - CONVERSATION_ID_FIELD_NUMBER: _ClassVar[int] + SENDER_ID_FIELD_NUMBER: _ClassVar[int] SLOTS_FIELD_NUMBER: _ClassVar[int] LATEST_MESSAGE_FIELD_NUMBER: _ClassVar[int] - LATEST_EVENT_TIME_FIELD_NUMBER: _ClassVar[int] - FOLLOWUP_ACTION_FIELD_NUMBER: _ClassVar[int] - PAUSED_FIELD_NUMBER: _ClassVar[int] EVENTS_FIELD_NUMBER: _ClassVar[int] - LATEST_INPUT_CHANNEL_FIELD_NUMBER: _ClassVar[int] + PAUSED_FIELD_NUMBER: _ClassVar[int] + FOLLOWUP_ACTION_FIELD_NUMBER: _ClassVar[int] ACTIVE_LOOP_FIELD_NUMBER: _ClassVar[int] - LATEST_ACTION_FIELD_NUMBER: _ClassVar[int] - conversation_id: str - slots: _containers.ScalarMap[str, str] - latest_message: _containers.ScalarMap[str, str] - latest_event_time: float - followup_action: str + LATEST_ACTION_NAME_FIELD_NUMBER: _ClassVar[int] + STACK_FIELD_NUMBER: _ClassVar[int] + sender_id: str + slots: _struct_pb2.Struct + latest_message: _struct_pb2.Struct + events: _containers.RepeatedCompositeFieldContainer[_struct_pb2.Struct] paused: bool - events: _containers.RepeatedScalarFieldContainer[str] - latest_input_channel: str + followup_action: str active_loop: _containers.ScalarMap[str, str] - latest_action: _containers.ScalarMap[str, str] - def __init__(self, conversation_id: _Optional[str] = ..., slots: _Optional[_Mapping[str, str]] = ..., latest_message: _Optional[_Mapping[str, str]] = ..., latest_event_time: _Optional[float] = ..., followup_action: _Optional[str] = ..., paused: bool = ..., events: _Optional[_Iterable[str]] = ..., latest_input_channel: _Optional[str] = ..., active_loop: _Optional[_Mapping[str, str]] = ..., latest_action: _Optional[_Mapping[str, str]] = ...) -> None: ... + latest_action_name: str + stack: _containers.RepeatedCompositeFieldContainer[_struct_pb2.Struct] + def __init__(self, sender_id: _Optional[str] = ..., slots: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., latest_message: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., events: _Optional[_Iterable[_Union[_struct_pb2.Struct, _Mapping]]] = ..., paused: bool = ..., followup_action: _Optional[str] = ..., active_loop: _Optional[_Mapping[str, str]] = ..., latest_action_name: _Optional[str] = ..., stack: _Optional[_Iterable[_Union[_struct_pb2.Struct, _Mapping]]] = ...) -> None: ... + +class Intent(_message.Message): + __slots__ = ["string_value", "dict_value"] + STRING_VALUE_FIELD_NUMBER: _ClassVar[int] + DICT_VALUE_FIELD_NUMBER: _ClassVar[int] + string_value: str + dict_value: _struct_pb2.Struct + def __init__(self, string_value: _Optional[str] = ..., dict_value: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ... + +class Entity(_message.Message): + __slots__ = ["string_value", "dict_value"] + STRING_VALUE_FIELD_NUMBER: _ClassVar[int] + DICT_VALUE_FIELD_NUMBER: _ClassVar[int] + string_value: str + dict_value: _struct_pb2.Struct + def __init__(self, string_value: _Optional[str] = ..., dict_value: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ... + +class Action(_message.Message): + __slots__ = ["string_value", "dict_value"] + STRING_VALUE_FIELD_NUMBER: _ClassVar[int] + DICT_VALUE_FIELD_NUMBER: _ClassVar[int] + string_value: str + dict_value: _struct_pb2.Struct + def __init__(self, string_value: _Optional[str] = ..., dict_value: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ... class Domain(_message.Message): __slots__ = ["config", "session_config", "intents", "entities", "slots", "responses", "actions", "forms", "e2e_actions"] - class ConfigEntry(_message.Message): - __slots__ = ["key", "value"] - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - class SessionConfigEntry(_message.Message): - __slots__ = ["key", "value"] - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - class SlotsEntry(_message.Message): - __slots__ = ["key", "value"] - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - class ResponsesEntry(_message.Message): - __slots__ = ["key", "value"] - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - class FormsEntry(_message.Message): - __slots__ = ["key", "value"] - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... CONFIG_FIELD_NUMBER: _ClassVar[int] SESSION_CONFIG_FIELD_NUMBER: _ClassVar[int] INTENTS_FIELD_NUMBER: _ClassVar[int] @@ -104,35 +70,37 @@ class Domain(_message.Message): ACTIONS_FIELD_NUMBER: _ClassVar[int] FORMS_FIELD_NUMBER: _ClassVar[int] E2E_ACTIONS_FIELD_NUMBER: _ClassVar[int] - config: _containers.ScalarMap[str, str] - session_config: _containers.ScalarMap[str, str] - intents: _containers.RepeatedScalarFieldContainer[str] - entities: _containers.RepeatedScalarFieldContainer[str] - slots: _containers.ScalarMap[str, str] - responses: _containers.ScalarMap[str, str] - actions: _containers.RepeatedScalarFieldContainer[str] - forms: _containers.ScalarMap[str, str] - e2e_actions: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, config: _Optional[_Mapping[str, str]] = ..., session_config: _Optional[_Mapping[str, str]] = ..., intents: _Optional[_Iterable[str]] = ..., entities: _Optional[_Iterable[str]] = ..., slots: _Optional[_Mapping[str, str]] = ..., responses: _Optional[_Mapping[str, str]] = ..., actions: _Optional[_Iterable[str]] = ..., forms: _Optional[_Mapping[str, str]] = ..., e2e_actions: _Optional[_Iterable[str]] = ...) -> None: ... + config: _struct_pb2.Struct + session_config: _struct_pb2.Struct + intents: _containers.RepeatedCompositeFieldContainer[Intent] + entities: _containers.RepeatedCompositeFieldContainer[Entity] + slots: _struct_pb2.Struct + responses: _struct_pb2.Struct + actions: _containers.RepeatedCompositeFieldContainer[Action] + forms: _struct_pb2.Struct + e2e_actions: _containers.RepeatedCompositeFieldContainer[_struct_pb2.Struct] + def __init__(self, config: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., session_config: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., intents: _Optional[_Iterable[_Union[Intent, _Mapping]]] = ..., entities: _Optional[_Iterable[_Union[Entity, _Mapping]]] = ..., slots: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., responses: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., actions: _Optional[_Iterable[_Union[Action, _Mapping]]] = ..., forms: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., e2e_actions: _Optional[_Iterable[_Union[_struct_pb2.Struct, _Mapping]]] = ...) -> None: ... class WebhookRequest(_message.Message): - __slots__ = ["next_action", "sender_id", "tracker", "domain", "version"] + __slots__ = ["next_action", "sender_id", "tracker", "domain", "version", "domain_digest"] NEXT_ACTION_FIELD_NUMBER: _ClassVar[int] SENDER_ID_FIELD_NUMBER: _ClassVar[int] TRACKER_FIELD_NUMBER: _ClassVar[int] DOMAIN_FIELD_NUMBER: _ClassVar[int] VERSION_FIELD_NUMBER: _ClassVar[int] + DOMAIN_DIGEST_FIELD_NUMBER: _ClassVar[int] next_action: str sender_id: str tracker: Tracker domain: Domain version: str - def __init__(self, next_action: _Optional[str] = ..., sender_id: _Optional[str] = ..., tracker: _Optional[_Union[Tracker, _Mapping]] = ..., domain: _Optional[_Union[Domain, _Mapping]] = ..., version: _Optional[str] = ...) -> None: ... + domain_digest: str + def __init__(self, next_action: _Optional[str] = ..., sender_id: _Optional[str] = ..., tracker: _Optional[_Union[Tracker, _Mapping]] = ..., domain: _Optional[_Union[Domain, _Mapping]] = ..., version: _Optional[str] = ..., domain_digest: _Optional[str] = ...) -> None: ... class WebhookResponse(_message.Message): __slots__ = ["events", "responses"] EVENTS_FIELD_NUMBER: _ClassVar[int] RESPONSES_FIELD_NUMBER: _ClassVar[int] - events: _containers.RepeatedCompositeFieldContainer[_any_pb2.Any] - responses: _containers.RepeatedCompositeFieldContainer[_any_pb2.Any] - def __init__(self, events: _Optional[_Iterable[_Union[_any_pb2.Any, _Mapping]]] = ..., responses: _Optional[_Iterable[_Union[_any_pb2.Any, _Mapping]]] = ...) -> None: ... + events: _containers.RepeatedCompositeFieldContainer[_struct_pb2.Struct] + responses: _containers.RepeatedCompositeFieldContainer[_struct_pb2.Struct] + def __init__(self, events: _Optional[_Iterable[_Union[_struct_pb2.Struct, _Mapping]]] = ..., responses: _Optional[_Iterable[_Union[_struct_pb2.Struct, _Mapping]]] = ...) -> None: ... diff --git a/rasa_sdk/grpc_server.py b/rasa_sdk/grpc_server.py index 78b015de4..a2ff8ecea 100644 --- a/rasa_sdk/grpc_server.py +++ b/rasa_sdk/grpc_server.py @@ -45,7 +45,9 @@ async def webhook(self, request: WebhookRequest, context): utils.check_version_compatibility(request.version) try: action_call = MessageToDict(request) - result = await self.executor.run(action_call) + logger.info(f"Received request to run action '{action_call.get('next_action')}'.") + result = None + # result = await self.executor.run(action_call) except ActionExecutionRejection as e: logger.debug(e) body = {"error": e.message, "action_name": e.action_name} diff --git a/rasa_sdk/interfaces.py b/rasa_sdk/interfaces.py index 454ad24b7..e21462e46 100644 --- a/rasa_sdk/interfaces.py +++ b/rasa_sdk/interfaces.py @@ -46,7 +46,7 @@ def __init__( followup_action: Optional[Text], active_loop: Dict[Text, Any], latest_action_name: Optional[Text], - stack: List[Dict[Text, Any]] = [], + stack: Optional[List[Dict[Text, Any]]] = None, ) -> None: """Initialize the tracker.""" @@ -68,7 +68,7 @@ def __init__( self.latest_message = latest_message if latest_message else {} self.active_loop = active_loop self.latest_action_name = latest_action_name - self.stack = stack + self.stack = stack if stack else [] @property def active_form(self) -> Dict[Text, Any]: