Integrated a Marvin AI function to allow the bot to predict whether its response does not already contain a feedback inquiry message when it detects negative sentiment. This is to avoid duplicative messages that ask the user for feedback about its response. Leveraged descriptive docstring text to guide the AI model.
@ai_fn
def is_feedback_inquiry_present(bot_text: str) -> bool:
"""
Analyzes the bot's response to determine if it contains a feedback inquiry.
The function leverages natural language understanding to interpret the text and
identify feedback-related phrases, taking into account the context and subtleties
of the conversation. It examines the text of a chatbot's response to detect if
it includes phrases or questions that are seeking feedback from the user. Common
examples of feedback inquiries might include direct questions like "Did that help
you?" or "Do you want to know more?" as well as subtle cues such as the presence
of a question mark (?) at the end of a statement.
Args:
bot_text: The text of the response provided by the chatbot. This can range
from answers and statements to jokes or informational content.
Returns:
bool: Indicates whether the bot's response includes a feedback inquiry.
- True: If phrases or questions seeking feedback are found, indicating
an active attempt by the bot to engage with the user or confirm
understanding.
- False: If no feedback-seeking phrases or questions are detected,
suggesting a straightforward response without solicitation for feedback.
"""
return False # Dummy return value for type checking
Implementation of https://github.com/vnoelifant/cozmo-companion/issues/30.