microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.0.8

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

core/src/Microsoft.Teams.Apps/Schema/StreamingActivity.cs

36lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using System.Text.Json.Serialization;
5using Microsoft.Teams.Apps.Schema.Entities;
6
7namespace Microsoft.Teams.Apps.Schema;
8
9/// <summary>
10/// Represents a streaming activity chunk. Has type "typing" to satisfy the Teams
11/// streaming API, but carries text content that accumulates into the final response.
12/// </summary>
13public class StreamingActivity : TeamsActivity
14{
15 /// <summary>
16 /// Initializes a new instance of the <see cref="StreamingActivity"/> class with the specified text.
17 /// </summary>
18 /// <param name="text"></param>
19 [JsonConstructor]
20 public StreamingActivity(string text) : base(TeamsActivityType.Typing)
21 {
22 Text = text;
23 StreamInfo = StreamInfoEntityExtensions.AddToActivity(this, StreamType.Streaming);
24 }
25
26 /// <summary>
27 /// Gets or sets the text content of the streaming chunk.
28 /// </summary>
29 [JsonPropertyName("text")]
30 public string Text { get; set; }
31
32 /// <summary>
33 /// Gets the stream info entity for this streaming activity.
34 /// </summary>
35 public StreamInfoEntity StreamInfo { get; }
36}
37