-
Notifications
You must be signed in to change notification settings - Fork 64
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
Reworked on DialogflowConversation class #223
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkshj21 sent you a DM.
Will discuss offline on how we can accomplish the changes you want to add.
Moving this to DRAFT for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make changes per discussion. thanks!
0ce3bad
to
5221fa0
Compare
Hello, Pat
I sent you an email about this PR with the notes and a Colab. Let me know what you think about the new changes in core.conversation.py. Thank you!
New Features in DialogflowConversation.reply():
a) End-User Metadata: Users can now pass end_user_metadata within send_obj to provide additional context for generative AI responses.
b) Error Handling: The function no longer returns an empty dictionary in case of client or internal errors. Instead, it returns a dictionary containing an error response message. This enables teams to capture and analyze errors effectively during NLU testing, entity regression testing, and end-to-end testing.
c) Retry Mechanism Removal: The previous retry mechanism with a maximum of 3 attempts has been removed due to its potential for inaccurate results. In some cases, the bot would escalate the user to the End Session without providing an error message after multiple retries.
New Features in DialogflowConversation.run_intent_detection():
a) DialogflowConversation.run_intent_detection() function now supports the optional inclusion of inject_parameters and end_user_metadata in the test_set DataFrame.
Reason: This enhancement is crucial for the VZW team, who heavily rely on this function for NLU, entity regression testing, and other generative AI tasks. These additional parameters provide the flexibility needed to perform specific use cases
b) The _extract_send_objs function is used to create a list of send_obj objects, which contain inject_parameters, end_user_metadata, and utterance. These objects are then passed to _get_reply_results.
Reason: Grouping input variables into send_obj before calling _get_reply_results improves code readability and maintainability.
c) In _get_reply_results,the results variable stores the “response_messages” from the reply() response.
Reason: Accessing response_messages is essential for analyzing bot responses, especially when working with generative AI.
d) In _unpack_match, the match object is checked for None. If a match is None, indicating an error, it is assigned an empty string.
Reason: In the original version, the script would pause due to an error when the match was None. The revised approach allows the script to continue running and output the error for analysis.