Skip to content

Commit e636bd4

Browse files
lilyydulilydu
andauthored
[JS] fix: remove properties nesting for streaming entities object (#2173)
## Linked issues closes: #minor ## Details schema was updated, no longer nesting data inside `properties` param ## 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 <[email protected]>
1 parent b34bbd1 commit e636bd4

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

js/packages/teams-ai/src/StreamingResponse.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ describe('StreamingResponse', function () {
211211
assert.equal(activities[0].entities!.length, 1, 'length of first activity entities should be 1');
212212
assert.deepEqual(
213213
activities[0].entities,
214-
[{ type: 'streaminfo', properties: { ...activities[0].channelData } }],
214+
[{ type: 'streaminfo', ...activities[0].channelData }],
215215
'first activity entities should match'
216216
);
217217
assert.equal(activities[1].channelData.streamSequence, 2, 'second activity streamSequence should be 2');
218218
assert.equal(activities[1].entities!.length, 1, 'length of second activity entities should be 1');
219219
assert.deepEqual(
220220
activities[1].entities,
221-
[{ type: 'streaminfo', properties: { ...activities[1].channelData } }],
221+
[{ type: 'streaminfo', ...activities[1].channelData }],
222222
'second activity entities should match'
223223
);
224224
assert.equal(activities[2].type, 'message', 'final activity type should be "message"');
@@ -232,7 +232,7 @@ describe('StreamingResponse', function () {
232232
assert.deepEqual(
233233
activities[2].entities,
234234
[
235-
{ type: 'streaminfo', properties: { streamType: 'final', streamId: response.streamId } },
235+
{ type: 'streaminfo', streamType: 'final', streamId: response.streamId },
236236
{
237237
type: 'https://schema.org/Message',
238238
'@type': 'Message',

js/packages/teams-ai/src/StreamingResponse.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,7 @@ export class StreamingResponse {
307307
activity.entities = [
308308
{
309309
type: 'streaminfo',
310-
properties: {
311-
...activity.channelData
312-
}
310+
...activity.channelData
313311
} as Entity
314312
];
315313

0 commit comments

Comments
 (0)