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

Reworked on DialogflowConversation class #223

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jkshj21
Copy link
Collaborator

@jkshj21 jkshj21 commented Aug 27, 2024

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.

@jkshj21 jkshj21 requested a review from kmaphoenix August 27, 2024 01:59
@jkshj21 jkshj21 self-assigned this Aug 27, 2024
Copy link
Member

@kmaphoenix kmaphoenix left a 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.

@kmaphoenix kmaphoenix marked this pull request as draft August 27, 2024 15:24
Copy link
Member

@kmaphoenix kmaphoenix left a 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!

src/dfcx_scrapi/core/conversation.py Show resolved Hide resolved
src/dfcx_scrapi/core/conversation.py Outdated Show resolved Hide resolved
src/dfcx_scrapi/core/conversation.py Show resolved Hide resolved
src/dfcx_scrapi/core/conversation.py Show resolved Hide resolved
src/dfcx_scrapi/core/conversation.py Show resolved Hide resolved
src/dfcx_scrapi/core/conversation.py Show resolved Hide resolved
src/dfcx_scrapi/core/conversation.py Outdated Show resolved Hide resolved
src/dfcx_scrapi/core/conversation.py Outdated Show resolved Hide resolved
src/dfcx_scrapi/core/conversation.py Outdated Show resolved Hide resolved
@kmaphoenix kmaphoenix force-pushed the feature/reworked_DialogflowConversation branch from 0ce3bad to 5221fa0 Compare September 30, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants