Description
The feedback buttons and AI-Generated label are not shown in a streaming message even when context.streaming_response.set_feedback_loop(True) and context.streaming_response.set_generated_by_ai_label(True) are set.
There are two bugs causing this issue:
- Feedback metadata remains contradictory
In StreamingResponse._send_activity(), setting both the feedback loop and its type enters this branch:
if self._enable_feedback_loop and self._feedback_loop_type:
streaminfo_entity.feedback_loop = {"type": self._feedback_loop_type}
else:
streaminfo_entity.feedback_loop_enabled = self._enable_feedback_loop
Because the else is skipped, feedback_loop_enabled retains the StreamInfo default of False, producing:
{
"feedbackLoop": {
"type": "default"
},
"feedbackLoopEnabled": false
}
- AI metadata requires citations
Activity.add_ai_metadata() currently wraps the entire operation in:
Consequently, it never adds an AIEntity when the message has no citations—even when set_generated_by_ai_label(True) and a sensitivity label are configured.
Description
The feedback buttons and AI-Generated label are not shown in a streaming message even when
context.streaming_response.set_feedback_loop(True)andcontext.streaming_response.set_generated_by_ai_label(True)are set.There are two bugs causing this issue:
In StreamingResponse._send_activity(), setting both the feedback loop and its type enters this branch:
Because the else is skipped, feedback_loop_enabled retains the StreamInfo default of False, producing:
{ "feedbackLoop": { "type": "default" }, "feedbackLoopEnabled": false }Activity.add_ai_metadata() currently wraps the entire operation in:
Consequently, it never adds an AIEntity when the message has no citations—even when
set_generated_by_ai_label(True)and a sensitivity label are configured.