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

Upgrade prompt-toolkit to 3.0 #11426

Merged
merged 14 commits into from
Aug 11, 2022

Conversation

ancalita
Copy link
Member

@ancalita ancalita commented Aug 9, 2022

Proposed changes:

  1. rasa/core/channels/console.py::_get_user_input()
  2. rasa/cli/utils.py::payload_from_button_question()
  3. rasa/core/training/interactive.py::_ask_questions()
  4. rasa/core/training/interactive.py::_retry_on_error()
  5. rasa/core/training/interactive.py::_ask_if_quit()
  6. rasa/core/training/interactive.py::_request_export_info()
  7. rasa/core/training/interactive.py::_get_button_choice()

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@ancalita ancalita requested a review from tmbo August 9, 2022 15:35
@ancalita ancalita marked this pull request as ready for review August 9, 2022 15:35
@ancalita ancalita requested a review from a team as a code owner August 9, 2022 15:35
@ancalita ancalita requested review from losterloh and removed request for a team August 9, 2022 15:35
@ancalita
Copy link
Member Author

@losterloh This is now ready for review after a great troubleshooting round with @tmbo 🥳

@ancalita ancalita removed the request for review from tmbo August 10, 2022 18:43
@tmbo
Copy link
Member

tmbo commented Aug 11, 2022

@ancalita do you mind linking the ticket you created on the prompt-toolkit repo here so that we have a reference to it if / when we need to get back to this pr in the future?

@ancalita
Copy link
Member Author

@ancalita do you mind linking the ticket you created on the prompt-toolkit repo here so that we have a reference to it if / when we need to get back to this pr in the future?

@tmbo I've just linked to it in the PR description. I also just noticed that prompt-toolkit version is still at 3.0.3 in poetry.lock, I'll update now and push the change.

Copy link
Contributor

@losterloh losterloh left a comment

Choose a reason for hiding this comment

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

🚀 💯

@ancalita
Copy link
Member Author

@tmbo I just ran a sanity check with rasa interactive on a rasa init project and everything works fine up until a point 😅
I tried this conversation:

- Hi # correct prediction
- Hey! How are you? # correct action
- fANTASTIC # here i have to correct intent to `mood_great`
- Great, carry on! # correct predicted action

After the last predicted action action_listen, I get an error, with this stacktrace:

 ERROR    rasa.core.training.interactive  - An exception occurred while recording messages.
Traceback (most recent call last):
  File "/Users/ancalita/rasa-projects/rasa/rasa/core/training/interactive.py", line 1504, in record_messages
    await _predict_till_next_listen(
  File "/Users/ancalita/rasa-projects/rasa/rasa/core/training/interactive.py", line 978, in _predict_till_next_listen
    await _print_history(conversation_id, endpoint)
  File "/Users/ancalita/rasa-projects/rasa/rasa/core/training/interactive.py", line 483, in _print_history
    print(table)
BlockingIOError: [Errno 35] write could not complete without blocking
2022-08-11 10:34:33 ERROR    asyncio  - Task exception was never retrieved
future: <Task finished name='Task-6' coro=<SignalRouter._dispatch() done, defined at /Users/ancalita/rasa-projects/oss-0908-3.2.x/lib/python3.9/site-packages/sanic/signals.py:121> exception=BlockingIOError(35, 'write could not complete without blocking', 0)>
Traceback (most recent call last):
  File "/Users/ancalita/rasa-projects/oss-0908-3.2.x/lib/python3.9/site-packages/sanic/signals.py", line 161, in _dispatch
    retval = await maybe_coroutine
  File "/Users/ancalita/rasa-projects/oss-0908-3.2.x/lib/python3.9/site-packages/sanic/app.py", line 1581, in run_delayed_task
    await prepped
  File "/Users/ancalita/rasa-projects/rasa/rasa/core/training/interactive.py", line 1596, in run_interactive_io
    await record_messages(
  File "/Users/ancalita/rasa-projects/rasa/rasa/core/training/interactive.py", line 1504, in record_messages
    await _predict_till_next_listen(
  File "/Users/ancalita/rasa-projects/rasa/rasa/core/training/interactive.py", line 978, in _predict_till_next_listen
    await _print_history(conversation_id, endpoint)
  File "/Users/ancalita/rasa-projects/rasa/rasa/core/training/interactive.py", line 483, in _print_history
    print(table)
BlockingIOError: [Errno 35] write could not complete without blocking

I've tried amending print(table, flush=True), but it didn't help.
I also double-checked this is not an error dating before this PR, so I tested with rasa 3.2.5 on 3.2.x branch and no errors were triggered. Any ideas? 🆘

@github-actions
Copy link
Contributor

🚀 A preview of the docs have been deployed at the following URL: https://11426--rasahq-docs-rasa-v2.netlify.app/docs/rasa

@ancalita ancalita merged commit f0bb41d into 3.2.x Aug 11, 2022
@ancalita ancalita deleted the ATO-234-bump-prompt-toolkit-to-a-3-x-version branch August 11, 2022 12:50
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.

None yet

3 participants