Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjusted speed to message length #102

Merged
merged 4 commits into from
Jun 16, 2023
Merged

adjusted speed to message length #102

merged 4 commits into from
Jun 16, 2023

Conversation

wbaccinelli
Copy link
Contributor

@wbaccinelli wbaccinelli commented Jun 14, 2023

Fixes: PerfectFit-project/virtual-coach-issues#360
Fixes: PerfectFit-project/testing-tickets#3

The messages sending thorough the API happens when the dialogs are externally triggered. The response is sent to the API through the custom_channels.py. A delay between one message and the other has been added there.

@wbaccinelli wbaccinelli requested a review from raar1 June 14, 2023 14:48
Rasa_Bot/custom_channels.py Outdated Show resolved Hide resolved
@@ -13,6 +14,11 @@


NICEDAY_API_URL = os.getenv('NICEDAY_API_ENDPOINT')
# proportional factor between the number of words in a message and the time to wait before the
# newt message is delivered
WORDS_PER_SECOND = 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, ok, so this is the fix for the PF app spamming users with 6000 messages a minute like a deranged stalker?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahahah yes, now it should be less annoying (if possible).

# newt message is delivered
WORDS_PER_SECOND = 5
# maximum delay between a message and the next one
MAX_DELAY = 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also units of seconds, I assume?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I'm updating the definition

wbaccinelli and others added 2 commits June 16, 2023 11:16
Co-authored-by: Robin Richardson <raar1@users.noreply.github.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@wbaccinelli wbaccinelli merged commit d7c6d84 into main Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjust messages speed General: change message speed
2 participants