question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `sender_id` argument shell and interactive command line tools

See original GitHub issue

Description of Problem:

Both rasa shell and rasa interactive do not support the ability to set the sender_id field. Instead for shell, the sender_id is just set to the default value of default, where as for interactive, the field is set to a uuid. To test stories/run interactive learning with custom actions that rely on the sender_id field value, the current tools lack the ability to customize this field.

Overview of the Solution:

A straightforward solution would be to add a --sender_id command line argument to rasa shell and rasa interactive. This argument would then be passed to the respective record_messages function, which already supports the sender_id parameter.

Furthermore, the default value for this argument should not change the functionality of the current implementation (shell defaults to default and interactive defaults to a uuid).

Examples (if relevant):

An example of a custom action that would rely on the value of the sender_id is as follows.

import logging

from rasa_sdk import Action

logger = logging.getLogger(__name__)

class ActionLogSenderId(Action):

  def name(self):
    return "action_log_sender_id"

  def run(self, dispatcher, tracker, domain):
    logger.info("Sender id: {}".format(tracker.sender_id))

Currently, when running rasa shell, the logged value would be Sender id: default, whereas when running rasa interactive, the logged value would be Sender id: {some random uuid.uuid4().hex}.

With the proposed change, when the user runs rasa shell --sender_id unique123 or rasa interactive --sender_id unique123, the logged value would be Sender id: unique123

Blockers (if relevant):

None

Definition of Done:

  • Tests are implemented for shell and interactive.
  • The --sender_id argument is implemented and meets tests.
  • The --sender_id argument is added to the Command Line Interface docs for both shell and interactive.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:22 (16 by maintainers)

github_iconTop GitHub Comments

8reactions
sjtilneycommented, Jul 16, 2019

Not having the ability to set the sender_id at run time has also caused a lot of headache for our team. Our Rasa actions interact with many different REST services. Many of those services require a valid user id (sender_id) in order to get a successful response. Furthermore, we expect different responses depending on the region that the user is in or preferences they may have set. It’s impossible to test these cases without being able to change the sender_id on the go.

For example, if someone asks a bot, “when is the next holiday?” we would expect a different response for a user in Germany versus a user in the United States. The only way to test that these cases are working properly during interactive training is to change the sender_id to one associated with a user in the various countries.

1reaction
chkosscommented, Feb 18, 2020

The rasa interactive part is done now (#5243)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add `sender_id` argument shell and interactive command line ...
To test stories/run interactive learning with custom actions that rely on the sender_id field value, the current tools lack the ability to ...
Read more >
Chapter 1, The Windows PowerShell Interactive Shell - O'Reilly
You want to define a default value for a parameter in a PowerShell command. Solution. Add an entry to the PSDefaultParameterValues hashtable. PS...
Read more >
Adding arguments and options to your Bash scripts - Red Hat
Enter the following code at the CLI and press Enter. Then enter hw as you would any other shell command. [student@testvm1 ~]$ hw(){...
Read more >
Passing arguments to an interactive program non-interactively
Just want to add one more way. Found it elsewhere, and is quite simple. Say I want to pass yes for all the...
Read more >
Tutorial - The LLDB Debugger
Options can be placed anywhere on the command line, but if the arguments begin ... By default, the breakpoint command add command takes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found