Skip to content

Update to Rasa 3.x and Action code updates - #3

Open
rgstephens wants to merge 12 commits into
deepset-ai:mainfrom
rgstephens:rasa-3.0
Open

Update to Rasa 3.x and Action code updates#3
rgstephens wants to merge 12 commits into
deepset-ai:mainfrom
rgstephens:rasa-3.0

Conversation

@rgstephens

@rgstephens rgstephens commented Nov 20, 2022

Copy link
Copy Markdown

@tholor & @wochinge This PR updates the Rasa bot to 3.x and adds action server code error handling.

@tholor

tholor commented Nov 21, 2022

Copy link
Copy Markdown
Member

Great! Thanks for upgrading this @rgstephens!

@tholor
tholor requested a review from julian-risch November 21, 2022 09:10

@wochinge wochinge left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for updating this, Greg! Left a few small comments.

Comment thread actions/actions.py Outdated
Comment thread actions/actions.py Outdated
Comment thread domain.yml Outdated
rgstephens and others added 3 commits December 8, 2022 09:59
Co-authored-by: Tobias Wochinger <mail@tobias-wochinger.de>
@rgstephens
rgstephens requested review from wochinge and removed request for julian-risch December 8, 2022 18:28
@julian-risch

Copy link
Copy Markdown
Member

@wochinge What's the current situation here? 🙂 Ready to merge?

@wochinge wochinge left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry for the late review. Do have time to wrap up these last comments? Otherwise I'm happy to do so. Thanks for the work 💯

Comment thread actions/requirements.txt Outdated
Comment thread actions/actions.py Outdated
Comment thread actions/actions.py Outdated
Comment thread Dockerfile Outdated
Comment thread .gitignore Outdated
Comment thread Dockerfile Outdated
Comment thread actions/actions.py Outdated
Comment thread build.sh Outdated
rgstephens and others added 7 commits March 30, 2023 13:50
Co-authored-by: Tobias Wochinger <mail@tobias-wochinger.de>
Co-authored-by: Tobias Wochinger <mail@tobias-wochinger.de>
Co-authored-by: Tobias Wochinger <mail@tobias-wochinger.de>
Co-authored-by: Tobias Wochinger <mail@tobias-wochinger.de>
Co-authored-by: Tobias Wochinger <mail@tobias-wochinger.de>
@rgstephens

Copy link
Copy Markdown
Author

Sorry for the slow response and thanks for all the fixes.

@wochinge wochinge left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the wrap up. Tried it out and works. Only added one fix for an edge condition.
@julian-risch Can you maybe merge this (I don't have write permissions in this repo) and apply the change manually as I also can't write to Greg's repo.

Comment thread actions/actions.py
Comment on lines 45 to 52
if response["answers"]:
logger.debug(f"Answers returned by haystack:\n{response}")
answer = response["answers"][0]["answer"]
if not answer:
answer = response["answers"][1]["answer"]
logger.debug(f"selected answer: {answer}")
else:
answer = "No Answer Found!"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the answer = response["answers"][1]["answer"] might cause an index error if there are no answers at all or less than 2 answers

Suggested change
if response["answers"]:
logger.debug(f"Answers returned by haystack:\n{response}")
answer = response["answers"][0]["answer"]
if not answer:
answer = response["answers"][1]["answer"]
logger.debug(f"selected answer: {answer}")
else:
answer = "No Answer Found!"
answer = "No Answer Found!"
for answer_object in response.get("answers") or []:
current_answer = answer_object["answer"]
if current_answer:
answer = current_answer
logger.debug(f"selected answer: {answer}")
break

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.

4 participants