Skip to content

Feedback-Loop buttons and Generated-by-AI label not showing when ending a streaming #587

Description

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.

Image

There are two bugs causing this issue:

  1. 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
}
  1. AI metadata requires citations

Activity.add_ai_metadata() currently wraps the entire operation in:

if citations:

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions