Skip to content

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

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

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

Conversation

@rgstephens
Copy link

@rgstephens rgstephens commented Nov 20, 2022

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

@tholor
Copy link
Member

tholor commented Nov 21, 2022

Great! Thanks for upgrading this @rgstephens!

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

@wochinge wochinge left a comment

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.

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
Member

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

Copy link

@wochinge wochinge left a comment

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 💯

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
Author

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

Copy link

@wochinge wochinge left a comment

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 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!"

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