I am using the DialogFlow CX python library for an agent integration. Once I send a request through detect_intent
, I want to be able to check in the response for a flag that determines if the interaction with the agent has ended.
For this, I found a property within the ResponseMessage
data type response called end_interaction
. I tested this with one of my agents, and effectively once the interaction ends, I can see the end_interaction
within the array of response messages:
# inspecting query_result.response_messages
[
text {
text: "Goodbye."
},
end_interaction {
}
]
Now, the problem is that I want to trigger some actions whenever we receive the signal, but since the end_interaction
field is being sent empty whenever I try to check it returns me False
:
# Both response messages from the example above return False under a bool
bool(query_result.response_messages[0].end_interaction) == False # text message response
bool(query_result.response_messages[1].end_interaction) == False # end_interaction signal
I have tried many things, such as checking with isinstance
and hasattr
, but they return True
for all scenarios since the ResponseMessage
data type always has an end_interaction
attr.
Any help for finding how to detect and check for this signal is highly appreciated! Thanks!