-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PY] fix: streaming - citations & pyproject.toml updates (#2205)
## Linked issues closes: #minor ## Details match with #2185 and #2202, ![image](https://github.com/user-attachments/assets/06846624-0b4b-4913-9177-10016ec9b108) - citations is now enabled during streaming, and for the final message - updated colour/outline pngs for sample to adhere to manifest validation - fixed indexing for citations `position` - added `StreamingEntity` class to fix serialization on `streaminfo` object - version 2 of poetry was released which led to a few scripts failing ## Attestation Checklist - [x] 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 --------- Co-authored-by: lilydu <lilydu+odspmdb@microsoft.com>
- Loading branch information
Showing
10 changed files
with
780 additions
and
691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the MIT License. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass | ||
from typing import Optional | ||
|
||
from botbuilder.schema import Entity | ||
|
||
|
||
@dataclass | ||
class StreamingEntity(Entity): | ||
""" | ||
Child class of BotBuilder's Entity class. Temporarily needed for mapping until the oficial | ||
version of their SDK releases a StreamingEntity class. | ||
""" | ||
|
||
_attribute_map = { | ||
"type": {"key": "type", "type": "str"}, | ||
"stream_id": {"key": "streamId", "type": "str"}, | ||
"stream_type": {"key": "streamType", "type": "str"}, | ||
"stream_sequence": {"key": "streamSequence", "type": "int"}, | ||
} | ||
|
||
stream_type: str | ||
stream_sequence: Optional[int] | ||
stream_id: Optional[str] | ||
type: str = "streaminfo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
python/samples/04.ai.f.dataSource.azureOpenAI/appPackage/color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
python/samples/04.ai.f.dataSource.azureOpenAI/appPackage/outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.