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

[PY] fix: StreamingResponse attributes shared between different StreamingResponse instances #2321

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

daniel-ideable
Copy link

@daniel-ideable daniel-ideable commented Feb 24, 2025

[PY] fix: StreamingResponse attributes shared between different StreamingResponse instances

Linked issues

closes: #2320

Details

Initializes StreamingResponse attributes for instance instead of class. Each StreamingResponse will handle its own attributes, hence, sequence number, queue and stream id.

Change details

code snippets:

    def __init__(self, context: TurnContext) -> None:
        """
        Initializes a new instance of the `StreamingResponse` class.
        :param context: The turn context.
        """
        self._context = context
        self._next_sequence = 1
        self._stream_id = ""
        self._message = ""
        self._attachments = []
        self._ended = False
        self._citations = []
        self._sensitivity_label = None
        self._enable_feedback_loop = False
        self._feedback_loop_type = None
        self._enable_generated_by_ai_label = False
        self._queue = []
        self._queue_sync = None
        self._chunk_queued = False

Attestation Checklist

  • My code follows the style guidelines of this project

  • I have checked for/fixed spelling, linting, and other errors

  • I have commented my code for clarity

  • I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient)

  • My changes generate no new warnings

  • I have added tests that validates my changes, and provides sufficient test coverage. I have tested with:

    • Local testing
    • E2E testing in Teams
  • New and existing unit tests pass locally with my changes

Additional information

Feel free to add other relevant information below

@daniel-ideable daniel-ideable changed the title [PY] fix: StreamingResponse attributes shared between different Strea… [PY] fix: StreamingResponse attributes shared between different StreamingResponse instances Feb 24, 2025
@daniel-ideable
Copy link
Author

daniel-ideable commented Feb 24, 2025

@microsoft-github-policy-service agree company="Ideable"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: StreamingResponse attributes shared between different StreamingResponse instances
1 participant