rasa-sdk 3.15.0.dev1__tar.gz → 3.16.0__tar.gz
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.
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/PKG-INFO +2 -2
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/README.md +1 -1
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/pyproject.toml +2 -2
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/events.py +13 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/executor.py +28 -7
- rasa_sdk-3.16.0/rasa_sdk/grpc_py/action_webhook_pb2.py +59 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/grpc_py/action_webhook_pb2.pyi +4 -2
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/interfaces.py +6 -1
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/types.py +2 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/version.py +1 -1
- rasa_sdk-3.15.0.dev1/rasa_sdk/grpc_py/action_webhook_pb2.py +0 -59
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/LICENSE.txt +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/__init__.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/__main__.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/cli/__init__.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/cli/arguments.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/constants.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/endpoint.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/exceptions.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/forms.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/grpc_errors.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/grpc_py/__init__.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/grpc_py/action_webhook_pb2_grpc.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/grpc_server.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/knowledge_base/__init__.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/knowledge_base/actions.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/knowledge_base/storage.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/knowledge_base/utils.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/plugin.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/slots.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/tracing/config.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/tracing/endpoints.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/tracing/instrumentation/attribute_extractors.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/tracing/instrumentation/instrumentation.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/tracing/tracer_register.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/tracing/utils.py +0 -0
- {rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: rasa-sdk
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.16.0
|
|
4
4
|
Summary: Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
|
|
@@ -83,7 +83,7 @@ old `rasa_core_sdk` package:
|
|
|
83
83
|
## Usage
|
|
84
84
|
|
|
85
85
|
Detailed instructions can be found in the Rasa Documentation about
|
|
86
|
-
[Custom Actions](https://rasa.com/docs/
|
|
86
|
+
[Custom Actions](https://rasa.com/docs/pro/build/custom-actions).
|
|
87
87
|
|
|
88
88
|
## Docker
|
|
89
89
|
|
|
@@ -43,7 +43,7 @@ old `rasa_core_sdk` package:
|
|
|
43
43
|
## Usage
|
|
44
44
|
|
|
45
45
|
Detailed instructions can be found in the Rasa Documentation about
|
|
46
|
-
[Custom Actions](https://rasa.com/docs/
|
|
46
|
+
[Custom Actions](https://rasa.com/docs/pro/build/custom-actions).
|
|
47
47
|
|
|
48
48
|
## Docker
|
|
49
49
|
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "rasa-sdk"
|
|
7
|
-
version = "3.
|
|
7
|
+
version = "3.16.0"
|
|
8
8
|
description = "Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants"
|
|
9
9
|
authors = [ "Rasa Technologies GmbH <hi@rasa.com>",]
|
|
10
10
|
maintainers = [ "Tom Bocklisch <tom@rasa.com>",]
|
|
@@ -102,7 +102,7 @@ asyncio_mode = "auto"
|
|
|
102
102
|
convention = "google"
|
|
103
103
|
|
|
104
104
|
[tool.poetry.group.dev.dependencies]
|
|
105
|
-
pytest-cov = "
|
|
105
|
+
pytest-cov = "~5.0.0"
|
|
106
106
|
coveralls = "^3.0.1"
|
|
107
107
|
pytest = "^7.4.0"
|
|
108
108
|
questionary = ">=1.5.1,<2.1.0"
|
|
@@ -57,6 +57,19 @@ def SessionStarted(timestamp: Optional[float] = None) -> EventType:
|
|
|
57
57
|
return {"event": "session_started", "timestamp": timestamp}
|
|
58
58
|
|
|
59
59
|
|
|
60
|
+
# noinspection PyPep8Naming
|
|
61
|
+
def SessionEnded(
|
|
62
|
+
timestamp: Optional[float] = None,
|
|
63
|
+
metadata: Optional[Dict[Text, Any]] = None,
|
|
64
|
+
) -> EventType:
|
|
65
|
+
"""Mark the end of a conversation session.
|
|
66
|
+
|
|
67
|
+
Return this from a custom action to manually end the session. The conversation
|
|
68
|
+
becomes terminated and non-resumable. No further events can be appended.
|
|
69
|
+
"""
|
|
70
|
+
return {"event": "session_ended", "timestamp": timestamp, "metadata": metadata}
|
|
71
|
+
|
|
72
|
+
|
|
60
73
|
# noinspection PyPep8Naming
|
|
61
74
|
def UserUtteranceReverted(timestamp: Optional[float] = None) -> EventType:
|
|
62
75
|
return {"event": "rewind", "timestamp": timestamp}
|
|
@@ -184,7 +184,7 @@ class ActionExecutor:
|
|
|
184
184
|
"""Initializes the `ActionExecutor`."""
|
|
185
185
|
self.actions: Dict[Text, Callable] = {}
|
|
186
186
|
self._modules: Dict[Text, TimestampModule] = {}
|
|
187
|
-
self.
|
|
187
|
+
self._registered_packages: Set[Text] = set()
|
|
188
188
|
self.domain: Optional[Dict[Text, Any]] = None
|
|
189
189
|
self.domain_digest: Optional[Text] = None
|
|
190
190
|
|
|
@@ -201,12 +201,6 @@ class ActionExecutor:
|
|
|
201
201
|
logger.warning(f"Skipping built in Action {action}.")
|
|
202
202
|
return
|
|
203
203
|
else:
|
|
204
|
-
# Check if this class has already been loaded in the past.
|
|
205
|
-
if action in self._loaded:
|
|
206
|
-
return
|
|
207
|
-
|
|
208
|
-
# Mark the class as "loaded"
|
|
209
|
-
self._loaded.add(action)
|
|
210
204
|
action = action()
|
|
211
205
|
|
|
212
206
|
if isinstance(action, Action):
|
|
@@ -297,6 +291,10 @@ class ActionExecutor:
|
|
|
297
291
|
"""
|
|
298
292
|
try:
|
|
299
293
|
self._import_submodules(package)
|
|
294
|
+
# Track the package name for reloading
|
|
295
|
+
if package is not None:
|
|
296
|
+
package_name = package if isinstance(package, str) else package.__name__
|
|
297
|
+
self._registered_packages.add(package_name)
|
|
300
298
|
except ImportError:
|
|
301
299
|
logger.exception(f"Failed to register package '{package}'.")
|
|
302
300
|
sys.exit(1)
|
|
@@ -350,6 +348,9 @@ class ActionExecutor:
|
|
|
350
348
|
is larger than the previous one, the module is re-imported using
|
|
351
349
|
`importlib.reload`.
|
|
352
350
|
|
|
351
|
+
Additionally, re-scans registered packages to discover and import any
|
|
352
|
+
newly created modules.
|
|
353
|
+
|
|
353
354
|
If one or more modules are reloaded during this process, the entire
|
|
354
355
|
`Action` class hierarchy is scanned again to see what new classes can
|
|
355
356
|
be registered.
|
|
@@ -357,6 +358,7 @@ class ActionExecutor:
|
|
|
357
358
|
to_reload = self._find_modules_to_reload()
|
|
358
359
|
any_module_reloaded = False
|
|
359
360
|
|
|
361
|
+
# Reload modified modules
|
|
360
362
|
for path, (timestamp, module) in to_reload.items():
|
|
361
363
|
try:
|
|
362
364
|
new_module = importlib.reload(module)
|
|
@@ -372,6 +374,25 @@ class ActionExecutor:
|
|
|
372
374
|
)
|
|
373
375
|
logger.info("Please fix the error(s) in the Python file and try again.")
|
|
374
376
|
|
|
377
|
+
# Re-scan registered packages to discover new modules
|
|
378
|
+
for package_name in self._registered_packages:
|
|
379
|
+
try:
|
|
380
|
+
# Get current module files before re-import
|
|
381
|
+
old_module_files = set(self._modules.keys())
|
|
382
|
+
self._import_submodules(package_name)
|
|
383
|
+
# Check if any new modules were imported
|
|
384
|
+
new_module_files = set(self._modules.keys())
|
|
385
|
+
if new_module_files != old_module_files:
|
|
386
|
+
newly_imported = new_module_files - old_module_files
|
|
387
|
+
for module_file in newly_imported:
|
|
388
|
+
logger.info(f"Discovered new module: '{module_file}'")
|
|
389
|
+
any_module_reloaded = True
|
|
390
|
+
except ImportError:
|
|
391
|
+
logger.exception(
|
|
392
|
+
f"Error while scanning package "
|
|
393
|
+
f"'{package_name}' for new modules:"
|
|
394
|
+
)
|
|
395
|
+
|
|
375
396
|
if any_module_reloaded:
|
|
376
397
|
self._register_all_actions()
|
|
377
398
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: rasa_sdk/grpc_py/action_webhook.proto
|
|
5
|
+
# Protobuf Python Version: 5.27.2
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
5,
|
|
15
|
+
27,
|
|
16
|
+
2,
|
|
17
|
+
'',
|
|
18
|
+
'rasa_sdk/grpc_py/action_webhook.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
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\"\x10\n\x0e\x41\x63tionsRequest\";\n\x0f\x41\x63tionsResponse\x12(\n\x07\x61\x63tions\x18\x01 \x03(\x0b\x32\x17.google.protobuf.Struct\"\xda\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\x12\x14\n\x07user_id\x18\n \x01(\tH\x02\x88\x01\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\x42\x12\n\x10_followup_actionB\x15\n\x13_latest_action_nameB\n\n\x08_user_id\"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.Struct2\xc3\x01\n\rActionService\x12X\n\x07Webhook\x12%.action_server_webhook.WebhookRequest\x1a&.action_server_webhook.WebhookResponse\x12X\n\x07\x41\x63tions\x12%.action_server_webhook.ActionsRequest\x1a&.action_server_webhook.ActionsResponseb\x06proto3')
|
|
29
|
+
|
|
30
|
+
_globals = globals()
|
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'rasa_sdk.grpc_py.action_webhook_pb2', _globals)
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
DESCRIPTOR._loaded_options = None
|
|
35
|
+
_globals['_TRACKER_ACTIVELOOPENTRY']._loaded_options = None
|
|
36
|
+
_globals['_TRACKER_ACTIVELOOPENTRY']._serialized_options = b'8\001'
|
|
37
|
+
_globals['_ACTIONSREQUEST']._serialized_start=94
|
|
38
|
+
_globals['_ACTIONSREQUEST']._serialized_end=110
|
|
39
|
+
_globals['_ACTIONSRESPONSE']._serialized_start=112
|
|
40
|
+
_globals['_ACTIONSRESPONSE']._serialized_end=171
|
|
41
|
+
_globals['_TRACKER']._serialized_start=174
|
|
42
|
+
_globals['_TRACKER']._serialized_end=648
|
|
43
|
+
_globals['_TRACKER_ACTIVELOOPENTRY']._serialized_start=544
|
|
44
|
+
_globals['_TRACKER_ACTIVELOOPENTRY']._serialized_end=593
|
|
45
|
+
_globals['_INTENT']._serialized_start=650
|
|
46
|
+
_globals['_INTENT']._serialized_end=725
|
|
47
|
+
_globals['_ENTITY']._serialized_start=727
|
|
48
|
+
_globals['_ENTITY']._serialized_end=802
|
|
49
|
+
_globals['_ACTION']._serialized_start=804
|
|
50
|
+
_globals['_ACTION']._serialized_end=879
|
|
51
|
+
_globals['_DOMAIN']._serialized_start=882
|
|
52
|
+
_globals['_DOMAIN']._serialized_end=1295
|
|
53
|
+
_globals['_WEBHOOKREQUEST']._serialized_start=1298
|
|
54
|
+
_globals['_WEBHOOKREQUEST']._serialized_end=1513
|
|
55
|
+
_globals['_WEBHOOKRESPONSE']._serialized_start=1515
|
|
56
|
+
_globals['_WEBHOOKRESPONSE']._serialized_end=1617
|
|
57
|
+
_globals['_ACTIONSERVICE']._serialized_start=1620
|
|
58
|
+
_globals['_ACTIONSERVICE']._serialized_end=1815
|
|
59
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -17,7 +17,7 @@ class ActionsResponse(_message.Message):
|
|
|
17
17
|
def __init__(self, actions: _Optional[_Iterable[_Union[_struct_pb2.Struct, _Mapping]]] = ...) -> None: ...
|
|
18
18
|
|
|
19
19
|
class Tracker(_message.Message):
|
|
20
|
-
__slots__ = ("sender_id", "slots", "latest_message", "events", "paused", "followup_action", "active_loop", "latest_action_name", "stack")
|
|
20
|
+
__slots__ = ("sender_id", "slots", "latest_message", "events", "paused", "followup_action", "active_loop", "latest_action_name", "stack", "user_id")
|
|
21
21
|
class ActiveLoopEntry(_message.Message):
|
|
22
22
|
__slots__ = ("key", "value")
|
|
23
23
|
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
@@ -34,6 +34,7 @@ class Tracker(_message.Message):
|
|
|
34
34
|
ACTIVE_LOOP_FIELD_NUMBER: _ClassVar[int]
|
|
35
35
|
LATEST_ACTION_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
36
36
|
STACK_FIELD_NUMBER: _ClassVar[int]
|
|
37
|
+
USER_ID_FIELD_NUMBER: _ClassVar[int]
|
|
37
38
|
sender_id: str
|
|
38
39
|
slots: _struct_pb2.Struct
|
|
39
40
|
latest_message: _struct_pb2.Struct
|
|
@@ -43,7 +44,8 @@ class Tracker(_message.Message):
|
|
|
43
44
|
active_loop: _containers.ScalarMap[str, str]
|
|
44
45
|
latest_action_name: str
|
|
45
46
|
stack: _containers.RepeatedCompositeFieldContainer[_struct_pb2.Struct]
|
|
46
|
-
|
|
47
|
+
user_id: str
|
|
48
|
+
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]]] = ..., user_id: _Optional[str] = ...) -> None: ...
|
|
47
49
|
|
|
48
50
|
class Intent(_message.Message):
|
|
49
51
|
__slots__ = ("string_value", "dict_value")
|
|
@@ -33,6 +33,7 @@ class Tracker:
|
|
|
33
33
|
state.get("active_loop", state.get("active_form", {})),
|
|
34
34
|
state.get("latest_action_name"),
|
|
35
35
|
state.get("stack", []),
|
|
36
|
+
state.get("user_id"),
|
|
36
37
|
)
|
|
37
38
|
|
|
38
39
|
def __init__(
|
|
@@ -46,6 +47,7 @@ class Tracker:
|
|
|
46
47
|
active_loop: Dict[Text, Any],
|
|
47
48
|
latest_action_name: Optional[Text],
|
|
48
49
|
stack: Optional[List[Dict[Text, Any]]] = None,
|
|
50
|
+
user_id: Optional[Text] = None,
|
|
49
51
|
) -> None:
|
|
50
52
|
"""Initialize the tracker."""
|
|
51
53
|
# list of previously seen events
|
|
@@ -67,6 +69,7 @@ class Tracker:
|
|
|
67
69
|
self.active_loop = active_loop
|
|
68
70
|
self.latest_action_name = latest_action_name
|
|
69
71
|
self.stack = stack if stack else []
|
|
72
|
+
self.user_id = user_id
|
|
70
73
|
|
|
71
74
|
@property
|
|
72
75
|
def active_form(self) -> Dict[Text, Any]:
|
|
@@ -95,6 +98,7 @@ class Tracker:
|
|
|
95
98
|
"active_loop": self.active_loop,
|
|
96
99
|
"latest_action_name": self.latest_action_name,
|
|
97
100
|
"stack": self.stack,
|
|
101
|
+
"user_id": self.user_id,
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
def current_slot_values(self) -> Dict[Text, Any]:
|
|
@@ -197,6 +201,7 @@ class Tracker:
|
|
|
197
201
|
self.active_loop,
|
|
198
202
|
self.latest_action_name,
|
|
199
203
|
self.stack,
|
|
204
|
+
self.user_id,
|
|
200
205
|
)
|
|
201
206
|
|
|
202
207
|
def last_executed_action_has(self, name: Text, skip: int = 0) -> bool:
|
|
@@ -406,7 +411,7 @@ class ActionMissingDomainException(Exception):
|
|
|
406
411
|
message
|
|
407
412
|
or "Missing domain context, assistant will retry the request and include "
|
|
408
413
|
"the domain in the request payload. For more information please see "
|
|
409
|
-
"https://rasa.com/docs/
|
|
414
|
+
"https://rasa.com/docs/action-server/"
|
|
410
415
|
)
|
|
411
416
|
|
|
412
417
|
def __str__(self) -> Text:
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
-
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
-
# source: rasa_sdk/grpc_py/action_webhook.proto
|
|
5
|
-
# Protobuf Python Version: 5.27.2
|
|
6
|
-
"""Generated protocol buffer code."""
|
|
7
|
-
from google.protobuf import descriptor as _descriptor
|
|
8
|
-
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
-
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
-
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
-
from google.protobuf.internal import builder as _builder
|
|
12
|
-
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
-
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
5,
|
|
15
|
-
27,
|
|
16
|
-
2,
|
|
17
|
-
'',
|
|
18
|
-
'rasa_sdk/grpc_py/action_webhook.proto'
|
|
19
|
-
)
|
|
20
|
-
# @@protoc_insertion_point(imports)
|
|
21
|
-
|
|
22
|
-
_sym_db = _symbol_database.Default()
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
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\"\x10\n\x0e\x41\x63tionsRequest\";\n\x0f\x41\x63tionsResponse\x12(\n\x07\x61\x63tions\x18\x01 \x03(\x0b\x32\x17.google.protobuf.Struct\"\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.Struct2\xc3\x01\n\rActionService\x12X\n\x07Webhook\x12%.action_server_webhook.WebhookRequest\x1a&.action_server_webhook.WebhookResponse\x12X\n\x07\x41\x63tions\x12%.action_server_webhook.ActionsRequest\x1a&.action_server_webhook.ActionsResponseb\x06proto3')
|
|
29
|
-
|
|
30
|
-
_globals = globals()
|
|
31
|
-
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'rasa_sdk.grpc_py.action_webhook_pb2', _globals)
|
|
33
|
-
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
-
DESCRIPTOR._loaded_options = None
|
|
35
|
-
_globals['_TRACKER_ACTIVELOOPENTRY']._loaded_options = None
|
|
36
|
-
_globals['_TRACKER_ACTIVELOOPENTRY']._serialized_options = b'8\001'
|
|
37
|
-
_globals['_ACTIONSREQUEST']._serialized_start=94
|
|
38
|
-
_globals['_ACTIONSREQUEST']._serialized_end=110
|
|
39
|
-
_globals['_ACTIONSRESPONSE']._serialized_start=112
|
|
40
|
-
_globals['_ACTIONSRESPONSE']._serialized_end=171
|
|
41
|
-
_globals['_TRACKER']._serialized_start=174
|
|
42
|
-
_globals['_TRACKER']._serialized_end=614
|
|
43
|
-
_globals['_TRACKER_ACTIVELOOPENTRY']._serialized_start=522
|
|
44
|
-
_globals['_TRACKER_ACTIVELOOPENTRY']._serialized_end=571
|
|
45
|
-
_globals['_INTENT']._serialized_start=616
|
|
46
|
-
_globals['_INTENT']._serialized_end=691
|
|
47
|
-
_globals['_ENTITY']._serialized_start=693
|
|
48
|
-
_globals['_ENTITY']._serialized_end=768
|
|
49
|
-
_globals['_ACTION']._serialized_start=770
|
|
50
|
-
_globals['_ACTION']._serialized_end=845
|
|
51
|
-
_globals['_DOMAIN']._serialized_start=848
|
|
52
|
-
_globals['_DOMAIN']._serialized_end=1261
|
|
53
|
-
_globals['_WEBHOOKREQUEST']._serialized_start=1264
|
|
54
|
-
_globals['_WEBHOOKREQUEST']._serialized_end=1479
|
|
55
|
-
_globals['_WEBHOOKRESPONSE']._serialized_start=1481
|
|
56
|
-
_globals['_WEBHOOKRESPONSE']._serialized_end=1583
|
|
57
|
-
_globals['_ACTIONSERVICE']._serialized_start=1586
|
|
58
|
-
_globals['_ACTIONSERVICE']._serialized_end=1781
|
|
59
|
-
# @@protoc_insertion_point(module_scope)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/tracing/instrumentation/attribute_extractors.py
RENAMED
|
File without changes
|
{rasa_sdk-3.15.0.dev1 → rasa_sdk-3.16.0}/rasa_sdk/tracing/instrumentation/instrumentation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|