Skip to content

Commit

Permalink
Merge branch 'main' into ATO-2564-Change-missing-domain-log-level-in-…
Browse files Browse the repository at this point in the history
…rasa-sdk-from-ERROR-to-DEBUG
  • Loading branch information
aleksandarmijat committed Jun 27, 2024
2 parents 6785065 + bb4ba0d commit 8686cfe
Show file tree
Hide file tree
Showing 8 changed files with 297 additions and 40 deletions.
2 changes: 1 addition & 1 deletion proto/action_webhook.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ service ActionService {
message ActionsRequest {}

message ActionsResponse {
map<string, string> actions = 1;
repeated google.protobuf.Struct actions = 1;
}

message Tracker {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exclude = "((.eggs | .git | .mypy_cache | .pytest_cache | build | dist ))"

[tool.poetry]
name = "rasa-sdk"
version = "3.9.0rc1"
version = "3.9.0rc2"
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"
authors = [ "Rasa Technologies GmbH <[email protected]>",]
maintainers = [ "Tom Bocklisch <[email protected]>",]
Expand Down
46 changes: 21 additions & 25 deletions rasa_sdk/grpc_py/action_webhook_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions rasa_sdk/grpc_py/action_webhook_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,9 @@ class ActionsRequest(_message.Message):

class ActionsResponse(_message.Message):
__slots__ = ["actions"]
class ActionsEntry(_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: ...
ACTIONS_FIELD_NUMBER: _ClassVar[int]
actions: _containers.ScalarMap[str, str]
def __init__(self, actions: _Optional[_Mapping[str, str]] = ...) -> None: ...
actions: _containers.RepeatedCompositeFieldContainer[_struct_pb2.Struct]
def __init__(self, actions: _Optional[_Iterable[_Union[_struct_pb2.Struct, _Mapping]]] = ...) -> None: ...

class Tracker(_message.Message):
__slots__ = ["sender_id", "slots", "latest_message", "events", "paused", "followup_action", "active_loop", "latest_action_name", "stack"]
Expand Down
15 changes: 12 additions & 3 deletions rasa_sdk/grpc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ def __init__(
self.auto_reload = auto_reload
self.executor = executor

async def Actions(self, request: ActionsRequest, context) -> ActionsResponse:
async def Actions(
self,
request: ActionsRequest,
context: grpc.aio.ServicerContext,
) -> ActionsResponse:
"""Handle RPC request for the actions.
Args:
Expand All @@ -107,9 +111,14 @@ async def Actions(self, request: ActionsRequest, context) -> ActionsResponse:
if self.auto_reload:
self.executor.reload()

actions = self.executor.list_actions()
actions = [action.model_dump() for action in self.executor.list_actions()]
response = ActionsResponse()
return ParseDict(actions, response)
return ParseDict(
{
"actions": actions,
},
response,
)

async def Webhook(
self,
Expand Down
2 changes: 1 addition & 1 deletion rasa_sdk/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# this file will automatically be changed,
# do not add anything but the version number here!
__version__ = "3.9.0rc1"
__version__ = "3.9.0rc2"
14 changes: 14 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytest

import rasa_sdk
from rasa_sdk import Action, FormValidationAction, Tracker, ValidationAction
from rasa_sdk.events import SlotSet
from rasa_sdk.executor import CollectingDispatcher
Expand All @@ -13,6 +14,7 @@


def get_stack():
"""Return a dialogue stack."""
dialogue_stack = [
{
"frame_id": "CP6JP9GQ",
Expand Down Expand Up @@ -147,3 +149,15 @@ def name(self):
class SubclassTestActionB(SubclassTestActionA):
def name(self):
return "subclass_test_action_b"


@pytest.fixture
def current_rasa_version() -> str:
"""Return current Rasa version."""
return rasa_sdk.__version__


@pytest.fixture
def previous_rasa_version() -> str:
"""Return previous Rasa version."""
return "1.0.0"
Loading

0 comments on commit 8686cfe

Please sign in to comment.