@microsoft/agents-hosting 1.0.13-gef996e80de → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@microsoft/agents-hosting",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.14",
|
|
5
5
|
"homepage": "https://github.com/microsoft/Agents-for-js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@azure/core-auth": "^1.10.0",
|
|
23
23
|
"@azure/msal-node": "^3.7.0",
|
|
24
|
-
"@microsoft/agents-activity": "1.0.
|
|
24
|
+
"@microsoft/agents-activity": "1.0.14",
|
|
25
25
|
"axios": "^1.11.0",
|
|
26
26
|
"jsonwebtoken": "^9.0.2",
|
|
27
27
|
"jwks-rsa": "^3.2.0"
|
|
@@ -23,6 +23,7 @@ export declare class StreamingResponse {
|
|
|
23
23
|
private _message;
|
|
24
24
|
private _attachments?;
|
|
25
25
|
private _ended;
|
|
26
|
+
private _delayInMs;
|
|
26
27
|
private _queue;
|
|
27
28
|
private _queueSync;
|
|
28
29
|
private _chunkQueued;
|
|
@@ -57,6 +58,10 @@ export declare class StreamingResponse {
|
|
|
57
58
|
* @returns {number} - The number of updates sent for the stream.
|
|
58
59
|
*/
|
|
59
60
|
get updatesSent(): number;
|
|
61
|
+
/**
|
|
62
|
+
* Gets the delay in milliseconds between chunks.
|
|
63
|
+
*/
|
|
64
|
+
get delayInMs(): number;
|
|
60
65
|
/**
|
|
61
66
|
* Queues an informative update to be sent to the client.
|
|
62
67
|
*
|
|
@@ -120,6 +125,11 @@ export declare class StreamingResponse {
|
|
|
120
125
|
* @param enableGeneratedByAILabel If true, the label is added.
|
|
121
126
|
*/
|
|
122
127
|
setGeneratedByAILabel(enableGeneratedByAILabel: boolean): void;
|
|
128
|
+
/**
|
|
129
|
+
* Sets the delay in milliseconds between chunks.
|
|
130
|
+
* @param delayInMs The delay in milliseconds.
|
|
131
|
+
*/
|
|
132
|
+
setDelayInMs(delayInMs: number): void;
|
|
123
133
|
/**
|
|
124
134
|
* Returns the most recently streamed message.
|
|
125
135
|
*
|
|
@@ -131,7 +141,7 @@ export declare class StreamingResponse {
|
|
|
131
141
|
*
|
|
132
142
|
* @returns {Promise<void>} - A promise representing the async operation.
|
|
133
143
|
*/
|
|
134
|
-
waitForQueue
|
|
144
|
+
private waitForQueue;
|
|
135
145
|
/**
|
|
136
146
|
* Queues the next chunk of text to be sent to the client.
|
|
137
147
|
*
|
|
@@ -31,6 +31,7 @@ class StreamingResponse {
|
|
|
31
31
|
this._nextSequence = 1;
|
|
32
32
|
this._message = '';
|
|
33
33
|
this._ended = false;
|
|
34
|
+
this._delayInMs = 1500;
|
|
34
35
|
// Queue for outgoing activities
|
|
35
36
|
this._queue = [];
|
|
36
37
|
this._chunkQueued = false;
|
|
@@ -65,6 +66,12 @@ class StreamingResponse {
|
|
|
65
66
|
get updatesSent() {
|
|
66
67
|
return this._nextSequence - 1;
|
|
67
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Gets the delay in milliseconds between chunks.
|
|
71
|
+
*/
|
|
72
|
+
get delayInMs() {
|
|
73
|
+
return this._delayInMs;
|
|
74
|
+
}
|
|
68
75
|
/**
|
|
69
76
|
* Queues an informative update to be sent to the client.
|
|
70
77
|
*
|
|
@@ -156,7 +163,8 @@ class StreamingResponse {
|
|
|
156
163
|
appearance: {
|
|
157
164
|
'@type': 'DigitalDocument',
|
|
158
165
|
name: citation.title || `Document #${currPos + 1}`,
|
|
159
|
-
abstract: citationUtil_1.CitationUtil.snippet(citation.content, 477)
|
|
166
|
+
abstract: citationUtil_1.CitationUtil.snippet(citation.content, 477),
|
|
167
|
+
url: citation.url
|
|
160
168
|
}
|
|
161
169
|
};
|
|
162
170
|
currPos++;
|
|
@@ -191,6 +199,13 @@ class StreamingResponse {
|
|
|
191
199
|
setGeneratedByAILabel(enableGeneratedByAILabel) {
|
|
192
200
|
this._enableGeneratedByAILabel = enableGeneratedByAILabel;
|
|
193
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* Sets the delay in milliseconds between chunks.
|
|
204
|
+
* @param delayInMs The delay in milliseconds.
|
|
205
|
+
*/
|
|
206
|
+
setDelayInMs(delayInMs) {
|
|
207
|
+
this._delayInMs = delayInMs;
|
|
208
|
+
}
|
|
194
209
|
/**
|
|
195
210
|
* Returns the most recently streamed message.
|
|
196
211
|
*
|
|
@@ -331,7 +346,7 @@ class StreamingResponse {
|
|
|
331
346
|
}
|
|
332
347
|
// Send activity
|
|
333
348
|
const response = await this._context.sendActivity(activity);
|
|
334
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
349
|
+
await new Promise((resolve) => setTimeout(resolve, this.delayInMs));
|
|
335
350
|
// Save assigned stream ID
|
|
336
351
|
if (!this._streamId) {
|
|
337
352
|
this._streamId = response === null || response === void 0 ? void 0 : response.id;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamingResponse.js","sourceRoot":"","sources":["../../../../src/app/streaming/streamingResponse.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gEAAgI;AAGhI,iDAA6C;AAC7C,8DAAyD;AAEzD,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,0BAA0B,CAAC,CAAA;AAEhD;;;;;;;;;;GAUG;AACH,MAAa,iBAAiB;
|
|
1
|
+
{"version":3,"file":"streamingResponse.js","sourceRoot":"","sources":["../../../../src/app/streaming/streamingResponse.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gEAAgI;AAGhI,iDAA6C;AAC7C,8DAAyD;AAEzD,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,0BAA0B,CAAC,CAAA;AAEhD;;;;;;;;;;GAUG;AACH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@@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@microsoft/agents-hosting",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.14",
|
|
5
5
|
"homepage": "https://github.com/microsoft/Agents-for-js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@azure/core-auth": "^1.10.0",
|
|
23
23
|
"@azure/msal-node": "^3.7.0",
|
|
24
|
-
"@microsoft/agents-activity": "1.0.
|
|
24
|
+
"@microsoft/agents-activity": "1.0.14",
|
|
25
25
|
"axios": "^1.11.0",
|
|
26
26
|
"jsonwebtoken": "^9.0.2",
|
|
27
27
|
"jwks-rsa": "^3.2.0"
|
|
@@ -29,6 +29,7 @@ export class StreamingResponse {
|
|
|
29
29
|
private _message: string = ''
|
|
30
30
|
private _attachments?: Attachment[]
|
|
31
31
|
private _ended = false
|
|
32
|
+
private _delayInMs = 1500
|
|
32
33
|
|
|
33
34
|
// Queue for outgoing activities
|
|
34
35
|
private _queue: Array<() => Activity> = []
|
|
@@ -80,6 +81,13 @@ export class StreamingResponse {
|
|
|
80
81
|
return this._nextSequence - 1
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Gets the delay in milliseconds between chunks.
|
|
86
|
+
*/
|
|
87
|
+
public get delayInMs (): number {
|
|
88
|
+
return this._delayInMs
|
|
89
|
+
}
|
|
90
|
+
|
|
83
91
|
/**
|
|
84
92
|
* Queues an informative update to be sent to the client.
|
|
85
93
|
*
|
|
@@ -183,7 +191,8 @@ export class StreamingResponse {
|
|
|
183
191
|
appearance: {
|
|
184
192
|
'@type': 'DigitalDocument',
|
|
185
193
|
name: citation.title || `Document #${currPos + 1}`,
|
|
186
|
-
abstract: CitationUtil.snippet(citation.content, 477)
|
|
194
|
+
abstract: CitationUtil.snippet(citation.content, 477),
|
|
195
|
+
url: citation.url!
|
|
187
196
|
}
|
|
188
197
|
}
|
|
189
198
|
currPos++
|
|
@@ -222,6 +231,14 @@ export class StreamingResponse {
|
|
|
222
231
|
this._enableGeneratedByAILabel = enableGeneratedByAILabel
|
|
223
232
|
}
|
|
224
233
|
|
|
234
|
+
/**
|
|
235
|
+
* Sets the delay in milliseconds between chunks.
|
|
236
|
+
* @param delayInMs The delay in milliseconds.
|
|
237
|
+
*/
|
|
238
|
+
public setDelayInMs (delayInMs: number): void {
|
|
239
|
+
this._delayInMs = delayInMs
|
|
240
|
+
}
|
|
241
|
+
|
|
225
242
|
/**
|
|
226
243
|
* Returns the most recently streamed message.
|
|
227
244
|
*
|
|
@@ -236,7 +253,7 @@ export class StreamingResponse {
|
|
|
236
253
|
*
|
|
237
254
|
* @returns {Promise<void>} - A promise representing the async operation.
|
|
238
255
|
*/
|
|
239
|
-
|
|
256
|
+
private waitForQueue (): Promise<void> {
|
|
240
257
|
return this._queueSync || Promise.resolve()
|
|
241
258
|
}
|
|
242
259
|
|
|
@@ -370,7 +387,7 @@ export class StreamingResponse {
|
|
|
370
387
|
|
|
371
388
|
// Send activity
|
|
372
389
|
const response = await this._context.sendActivity(activity)
|
|
373
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
390
|
+
await new Promise((resolve) => setTimeout(resolve, this.delayInMs))
|
|
374
391
|
|
|
375
392
|
// Save assigned stream ID
|
|
376
393
|
if (!this._streamId) {
|