UNPKG

tencentcloud-sdk-nodejs-intl-en

Version:
1,255 lines (1,064 loc) 352 kB
/* * Copyright (c) 2018 Tencent. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const AbstractModel = require("../../common/abstract_model"); /** * ModifyCloudSliceTask response structure. * @class */ class ModifyCloudSliceTaskResponse extends AbstractModel { constructor(){ super(); /** * Unique ID of the slicing task, which is returned after the task is started. * @type {string || null} */ this.TaskId = null; /** * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.TaskId = 'TaskId' in params ? params.TaskId : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * DescribeCloudModeration response structure. * @class */ class DescribeCloudModerationResponse extends AbstractModel { constructor(){ super(); /** * Unique ID of the moderation task, which is returned after the task is started. * @type {string || null} */ this.TaskId = null; /** * Information about the status of the cloud moderation task. Idle: indicates the current task is idle; InProgress: indicates the current task is in progress; Exited: indicates the current task is being exited. * @type {string || null} */ this.Status = null; /** * Subscription blocklist and allowlist. * @type {SubscribeModerationUserIds || null} */ this.SubscribeStreamUserIds = null; /** * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.TaskId = 'TaskId' in params ? params.TaskId : null; this.Status = 'Status' in params ? params.Status : null; if (params.SubscribeStreamUserIds) { let obj = new SubscribeModerationUserIds(); obj.deserialize(params.SubscribeStreamUserIds) this.SubscribeStreamUserIds = obj; } this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * Bot parameters. * @class */ class AgentConfig extends AbstractModel { constructor(){ super(); /** * The robot's UserId is used to enter a room and initiate a task. note that this UserId cannot be duplicated with the host or audience [UserId](https://www.tencentcloud.com/document/product/647/46351?from_cn_redirect=1#UserId) in the current room. if multiple tasks are initiated in a room, the robot's UserId cannot be mutually duplicated. otherwise, the previous task will be interrupted. ensure the robot's UserId is unique in the room. * @type {string || null} */ this.UserId = null; /** * Signature verification corresponding to the chatbot's UserId, namely, the UserId and UserSig serve as the login password for the chatbot to enter the room. for specific calculation methods, see TRTC solution for calculating. * @type {string || null} */ this.UserSig = null; /** * UserId for robot stream pulling. after fill, the robot performs stream pulling and processes in real time. * @type {string || null} */ this.TargetUserId = null; /** * Exceeding MaxIdleTime in the room with no streaming automatically shuts down the backend task. default value is 60s. * @type {number || null} */ this.MaxIdleTime = null; /** * Robot'S greeting. * @type {string || null} */ this.WelcomeMessage = null; /** * Intelligent interruption mode, defaults to 0. 0 means server-side automatic interruption. 1 means the server does not interrupt, and the client sends an interruption signal to perform interruption. * @type {number || null} */ this.InterruptMode = null; /** * Used when InterruptMode is 0, in milliseconds, defaults to 500ms. indicates the server will interrupt when it detects continuous voice for InterruptSpeechDuration milliseconds. * @type {number || null} */ this.InterruptSpeechDuration = null; /** * Controls the trigger mode for a new dialogue. default is 0. -0 means a new dialogue is automatically triggered when the server detects a complete sentence through automatic speech recognition. -1 indicates the client determines whether to manually send a chat signaling trigger for a new dialogue upon receiving the caption message. * @type {number || null} */ this.TurnDetectionMode = null; /** * Whether to filter out sentences where the user only says one word. true indicates filtering, false indicates no filtering. default value is true. * @type {boolean || null} */ this.FilterOneWord = null; /** * Welcome message priority. valid values: 0 (default), 1 (high priority). high priority messages cannot be interrupted. * @type {number || null} */ this.WelcomeMessagePriority = null; /** * For filtering LLM return content, do not play the content in brackets. Chinese bracket (). 2: english parentheses. 3: chinese square brackets []. 4: english square brackets []. 5: english curly braces {}. Empty by default, means no filtering. * @type {number || null} */ this.FilterBracketsContent = null; /** * Ambient sound settings. * @type {AmbientSound || null} */ this.AmbientSound = null; /** * Voiceprint configuration. * @type {VoicePrint || null} */ this.VoicePrint = null; /** * Semantic sentence segmentation detection. * @type {TurnDetection || null} */ this.TurnDetection = null; /** * Robot subtitle display mode. -0 means display as soon as possible without synchronizing with audio playback. at this point, subtitles are fully delivered, and subsequent subtitles will include previous ones. -1 indicates sentence-level real-time display, which synchronizes with audio playback. only when the current sentence's corresponding audio playback is complete will the next subtitle be delivered. at this point, subtitles are delivered incrementally, and the terminal needs to concatenate the leading and trailing subtitles to form a complete subtitle. * @type {number || null} */ this.SubtitleMode = null; /** * Interruption word list. during AI speaking, only speak words in the list to interrupt AI speaking. Note: interrupt words avoid triggering AI reply. * @type {Array.<string> || null} */ this.InterruptWordList = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.UserId = 'UserId' in params ? params.UserId : null; this.UserSig = 'UserSig' in params ? params.UserSig : null; this.TargetUserId = 'TargetUserId' in params ? params.TargetUserId : null; this.MaxIdleTime = 'MaxIdleTime' in params ? params.MaxIdleTime : null; this.WelcomeMessage = 'WelcomeMessage' in params ? params.WelcomeMessage : null; this.InterruptMode = 'InterruptMode' in params ? params.InterruptMode : null; this.InterruptSpeechDuration = 'InterruptSpeechDuration' in params ? params.InterruptSpeechDuration : null; this.TurnDetectionMode = 'TurnDetectionMode' in params ? params.TurnDetectionMode : null; this.FilterOneWord = 'FilterOneWord' in params ? params.FilterOneWord : null; this.WelcomeMessagePriority = 'WelcomeMessagePriority' in params ? params.WelcomeMessagePriority : null; this.FilterBracketsContent = 'FilterBracketsContent' in params ? params.FilterBracketsContent : null; if (params.AmbientSound) { let obj = new AmbientSound(); obj.deserialize(params.AmbientSound) this.AmbientSound = obj; } if (params.VoicePrint) { let obj = new VoicePrint(); obj.deserialize(params.VoicePrint) this.VoicePrint = obj; } if (params.TurnDetection) { let obj = new TurnDetection(); obj.deserialize(params.TurnDetection) this.TurnDetection = obj; } this.SubtitleMode = 'SubtitleMode' in params ? params.SubtitleMode : null; this.InterruptWordList = 'InterruptWordList' in params ? params.InterruptWordList : null; } } /** * Transcription companion terminology table entry * @class */ class TerminologyItem extends AbstractModel { constructor(){ super(); /** * <p>Target language.</p> * @type {string || null} */ this.TargetLang = null; /** * <p>Terminology configuration.</p> * @type {Array.<TermPair> || null} */ this.Terminology = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.TargetLang = 'TargetLang' in params ? params.TargetLang : null; if (params.Terminology) { this.Terminology = new Array(); for (let z in params.Terminology) { let obj = new TermPair(); obj.deserialize(params.Terminology[z]); this.Terminology.push(obj); } } } } /** * The layout parameters. * @class */ class McuLayout extends AbstractModel { constructor(){ super(); /** * User media stream parameters. if left blank, tencent cloud backend fills them automatically by the room entry sequence of the uplink host. * @type {UserMediaStream || null} */ this.UserMediaStream = null; /** * The width of the sub-screen in the output, unit: pixel value. defaults to 0 if left blank. * @type {number || null} */ this.ImageWidth = null; /** * The height of the sub-screen in the output, in pixel values. default is 0. * @type {number || null} */ this.ImageHeight = null; /** * The X-axis offset of the sub-screen in the output, unit: pixel value. the sum of LocationX and ImageWidth must not exceed the total width of the mixed stream output. default is 0. * @type {number || null} */ this.LocationX = null; /** * The Y-axis offset of the sub-screen in the output, unit: pixel value. the sum of LocationY and ImageHeight must not exceed the total height of the mixed stream output. default is 0 if left blank. * @type {number || null} */ this.LocationY = null; /** * The hierarchy of the sub-screen in the output. default is 0. * @type {number || null} */ this.ZOrder = null; /** * The display mode of the sub-screen in the output: 0 for crop, 1 for scale and display background, 2 for scale and display black background. defaults to 0 if left blank. * @type {number || null} */ this.RenderMode = null; /** * [This parameter configuration is invalid and not currently supported] the background color of the sub-picture. commonly used colors are:. Red: 0xcc0033. Yellow: 0xcc9900. Green: 0xcccc33. Blue: 0x99CCFF. Black: 0x000000. White: 0xFFFFFF. Gray: 0x999999. * @type {string || null} */ this.BackGroundColor = null; /** * The url of the placeholder image for the sub-window. fill in this parameter to specify the image displayed in the layout position when the user turns the camera off or has not joined the TRTC room. if the specified image has a different size ratio from the layout position, it will be stretched. this parameter has a higher priority than BackGroundColor. supported formats include png, jpg, jpeg, bmp, gif, and webm. the image size limit is no more than 5MB. Note:. 1. make sure the image link is accessible. the backend single download timeout period is 10 seconds with a maximum of 3 retries. if the image download fails eventually, the placeholder image will not take effect. 2. supported character sets for urls: ['0-9', 'a-z', 'a-z', '-', '.', '_', '~', ':', '/', '?', '#', '[', ']', '@', '!', '&', '(', ')', '*', '+', ',', '%', '=', ';', '|']. make sure url characters are within the supported character sets. if characters outside the supported character sets exist, the placeholder image will not take effect. * @type {string || null} */ this.BackgroundImageUrl = null; /** * Customer custom crop, targeting the input stream. * @type {McuCustomCrop || null} */ this.CustomCrop = null; /** * The display mode of the sub-background image in the output: 0 for crop, 1 for scale and display background, 2 for scale and display black background, 3 for variable-scale scaling, 4 for custom rendering. defaults to 3 if left blank. * @type {number || null} */ this.BackgroundRenderMode = null; /** * The sub-screen template url points to a template image with an alpha channel. fill in this parameter, and the backend will extract the alpha channel of the template image during compositing, scale it as the alpha channel of the target frame, and mix it with other frames. you can use the transparent template to achieve a semi-transparent effect and arbitrary shape cropping (such as rounded corners, stars, hearts) for the target frame. png format is supported. the image size limit is no more than 5MB. Note:. 1. the image aspect ratio of the template should be close to the target frame aspect ratio to avoid deformation of the template effect when scaling to fit the target frame. 2. the transparent template only takes effect when RenderMode is 0 (crop). 3. make sure the image link is accessible. the backend single download timeout period is 10 seconds with a maximum of 3 retries. if the image download fails eventually, the transparent template will not take effect. 2. url supported character sets: ['0-9','a-z','a-z','-', '.', '_', '~', ':', '/', '?', '#', '[', ']','@', '!', '&', '(', ')', '*', '+', ',', '%', '=', ';', '|']. make sure url characters are within the supported character sets. if characters outside the supported character sets exist, the transparent template will not take effect. * @type {string || null} */ this.TransparentUrl = null; /** * * @type {McuBackgroundCustomRender || null} */ this.BackgroundCustomRender = null; /** * Sub-Background color effective mode. default value 0 means disabled. bit0 specifies whether placeholder image scaling takes effect. bit1 specifies whether upstream flow scaling takes effect. You can set the corresponding bit position to 1 to start up and take effect, such as:. 0(00) means the sub background color is disabled. 1(01) indicates the sub-background color is valid only when placeholder image scaling is enabled. 2(10) means the sub background color is valid only when upstream flow scaling. 3(11) indicates the sub-background color takes effect in both placeholder image scaling and upstream flow scaling. * @type {number || null} */ this.BackGroundColorMode = null; } /** * @private */ deserialize(params) { if (!params) { return; } if (params.UserMediaStream) { let obj = new UserMediaStream(); obj.deserialize(params.UserMediaStream) this.UserMediaStream = obj; } this.ImageWidth = 'ImageWidth' in params ? params.ImageWidth : null; this.ImageHeight = 'ImageHeight' in params ? params.ImageHeight : null; this.LocationX = 'LocationX' in params ? params.LocationX : null; this.LocationY = 'LocationY' in params ? params.LocationY : null; this.ZOrder = 'ZOrder' in params ? params.ZOrder : null; this.RenderMode = 'RenderMode' in params ? params.RenderMode : null; this.BackGroundColor = 'BackGroundColor' in params ? params.BackGroundColor : null; this.BackgroundImageUrl = 'BackgroundImageUrl' in params ? params.BackgroundImageUrl : null; if (params.CustomCrop) { let obj = new McuCustomCrop(); obj.deserialize(params.CustomCrop) this.CustomCrop = obj; } this.BackgroundRenderMode = 'BackgroundRenderMode' in params ? params.BackgroundRenderMode : null; this.TransparentUrl = 'TransparentUrl' in params ? params.TransparentUrl : null; if (params.BackgroundCustomRender) { let obj = new McuBackgroundCustomRender(); obj.deserialize(params.BackgroundCustomRender) this.BackgroundCustomRender = obj; } this.BackGroundColorMode = 'BackGroundColorMode' in params ? params.BackGroundColorMode : null; } } /** * Specifies the subscription stream allowlist or blocklist. The audio allowlist and blocklist cannot be set simultaneously, and this also applies to video. Additionally, up to 25 concurrently subscribed media streams are supported, and up to 24 video screens are supported in mixed stream scenarios. It is also supported to use the ".*$" wildcard for prefix matching of UserId in the blocklist and allowlist. Note that if there are user IDs in the room that match the wildcard rule, specific users are subscribed, causing the prefix rule to become ineffective. * @class */ class SubscribeModerationUserIds extends AbstractModel { constructor(){ super(); /** * Subscription audio stream allowlist. It specifies which UserIds' audio streams to subscribe to, for example, ["1", "2", "3"] indicates subscriptions to the audio streams of UserId 1, 2, and 3; ["1.*$"] indicates subscription to audio streams with UserId prefixes starting with 1. If this parameter is left unspecified, all audio streams in the room are subscribed to by default. The number of users in the subscription list should not exceed 32. Note: This field may return null, indicating that no valid values can be obtained. * @type {Array.<string> || null} */ this.SubscribeAudioUserIds = null; /** * Subscription audio stream blocklist. It specifies which UserIds' audio streams not to subscribe to, for example, ["1", "2", "3"] indicates that the audio streams of UserId 1, 2, and 3 are not subscribed to; ["1.*$"] indicates that audio streams with UserId prefixes starting with 1 are not subscribed to. If this parameter is left unspecified, all audio streams in the room are subscribed to by default. The number of users in the subscription list should not exceed 32. Note: This field may return null, indicating that no valid values can be obtained. * @type {Array.<string> || null} */ this.UnSubscribeAudioUserIds = null; /** * Subscription video stream allowlist. It specifies which UserIds' video streams to subscribe to, for example, ["1", "2", "3"] indicates subscriptions to the video streams of UserId 1, 2, and 3; ["1.*$"] indicates subscription to video streams with UserId prefixes starting with 1. If this parameter is left unspecified, all video streams in the room are subscribed to by default. The number of users in the subscription list should not exceed 32. Note: This field may return null, indicating that no valid values can be obtained. * @type {Array.<string> || null} */ this.SubscribeVideoUserIds = null; /** * Subscription video stream blocklist. It specifies which UserIds' video streams not to subscribe to, for example, ["1", "2", "3"] indicates that the video streams of UserId 1, 2, and 3 are not subscribed to; ["1.*$"] indicates that video streams with UserId prefixes starting with 1 are not subscribed to. If this parameter is left unspecified, all video streams in the room are subscribed to by default. The number of users in the subscription list should not exceed 32. Note: This field may return null, indicating that no valid values can be obtained. * @type {Array.<string> || null} */ this.UnSubscribeVideoUserIds = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.SubscribeAudioUserIds = 'SubscribeAudioUserIds' in params ? params.SubscribeAudioUserIds : null; this.UnSubscribeAudioUserIds = 'UnSubscribeAudioUserIds' in params ? params.UnSubscribeAudioUserIds : null; this.SubscribeVideoUserIds = 'SubscribeVideoUserIds' in params ? params.SubscribeVideoUserIds : null; this.UnSubscribeVideoUserIds = 'UnSubscribeVideoUserIds' in params ? params.UnSubscribeVideoUserIds : null; } } /** * Audio transcoding parameters * @class */ class AudioEncodeParams extends AbstractModel { constructor(){ super(); /** * Audio Sample rate, Value range [48000, 44100], unit is Hz. * @type {number || null} */ this.SampleRate = null; /** * Audio Channel number, Value range [1,2], 1 means Audio is Mono-channel, 2 means Audio is Dual-channel. * @type {number || null} */ this.Channel = null; /** * Audio Bitrate, Value range [8,500], unit is kbps. * @type {number || null} */ this.BitRate = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.SampleRate = 'SampleRate' in params ? params.SampleRate : null; this.Channel = 'Channel' in params ? params.Channel : null; this.BitRate = 'BitRate' in params ? params.BitRate : null; } } /** * The server controls the chatbot to broadcast the specified text. * @class */ class ServerPushText extends AbstractModel { constructor(){ super(); /** * Server push broadcast text. * @type {string || null} */ this.Text = null; /** * Whether to allow the text to interrupt the robot's speaking. * @type {boolean || null} */ this.Interrupt = null; /** * Broadcast the text and automatically close the dialogue task. * @type {boolean || null} */ this.StopAfterPlay = null; /** * Server push broadcast audio. Format description: audio must be mono, sampling rate must be consistent with the corresponding TTS sampling rate, and coded as a Base64 string. Input rule: when the Audio field is provided, the system will not accept user-submitted input in the Text field. the system will play the Audio content in the Audio field directly. * @type {string || null} */ this.Audio = null; /** * Defaults to 0. valid at that time only when Interrupt is false. -0 means drop messages with Interrupt set to false during the occurrence of interaction. -1 indicates that during the occurrence of an interaction, messages with Interrupt as false will not be dropped but cached, waiting to be processed when finished. Note: if DropMode is 1, multiple messages can be cached. if an interruption occurs subsequently, the cache of messages will be cleared. * @type {number || null} */ this.DropMode = null; /** * The message priority of ServerPushText. 0 means interruptible, 1 means not interruptible. currently only support 0. if you need to input 1, submit a ticket to contact us to grant permission. Note: after receiving a message with Priority=1, any other messages will be ignored (including messages with Priority=1) until the message processing of Priority=1 is complete. this field can be used together with the Interrupt and DropMode fields. Example:. -Priority=1, Interrupt=true, interrupts existing interaction and broadcasts immediately. the broadcast will not be interrupted during the process. -Priority=1, Interrupt=false, DropMode=1. wait for the current interaction to complete before broadcasting. the broadcast will not be interrupted during the process. * @type {number || null} */ this.Priority = null; /** * Whether to add the text to the llm history context. * @type {boolean || null} */ this.AddHistory = null; /** * If filled, it will be bound to the subtitle and sent to the terminal. note that the content must be a json string. * @type {string || null} */ this.MetaInfo = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Text = 'Text' in params ? params.Text : null; this.Interrupt = 'Interrupt' in params ? params.Interrupt : null; this.StopAfterPlay = 'StopAfterPlay' in params ? params.StopAfterPlay : null; this.Audio = 'Audio' in params ? params.Audio : null; this.DropMode = 'DropMode' in params ? params.DropMode : null; this.Priority = 'Priority' in params ? params.Priority : null; this.AddHistory = 'AddHistory' in params ? params.AddHistory : null; this.MetaInfo = 'MetaInfo' in params ? params.MetaInfo : null; } } /** * Relay recording parameters. * @class */ class McuRecordParams extends AbstractModel { constructor(){ super(); /** * Retweet recording mode. 0/Leave blank: not currently supported; behavior is undefined. 1: disable recording. 2: enable recording (via console automatic recording template parameters. 3: enable recording (use API to specify parameter). * @type {number || null} */ this.UniRecord = null; /** * Recording task key, identifies a recording task. you can record multiple relay tasks into a file by specifying this parameter. if this parameter is not specified, only the current relay task is recorded. Limit length to 128 bytes, only allow a combination of uppercase and lowercase letters (a-zA-Z), digits (0-9), underscores (_), and hyphens (-). * @type {string || null} */ this.RecordKey = null; /** * [Valid only when UniRecord=3.]. Resume recording waiting time, corresponding to the "wait time for resumption" in the recording template, unit: seconds. the value must be greater than or equal to 5 and less than or equal to 86400 (24 hours), with a default value of 30. when resumption is enabled, the recording task ends automatically if idle for a duration exceeding RecordWaitTime. * @type {number || null} */ this.RecordWaitTime = null; /** * [Valid only when UniRecord=3.]. The list of output file formats for recording corresponds to the "file format" in the recording template. it supports three formats: "hls", "mp4", and "aac". the default value is "mp4". among them, "mp4" and "aac" formats cannot be specified simultaneously. Record only the mp4 format, example value: ["mp4"]. record both mp4 and HLS formats simultaneously, example value: ["mp4","HLS"]. * @type {Array.<string> || null} */ this.RecordFormat = null; /** * [Valid only when UniRecord=3.]. Single file recording duration, corresponding to the "max recording time per file" in the recording template, unit: minutes. the value must be greater than or equal to 1 and less than or equal to 1440 (24 hours), with a default value of 1440. it only takes effect for "mp4" or "aac" format. the actual single file recording duration is also limited by the file size not exceeding 2G. if it exceeds 2G, the file will be forcibly split. * @type {number || null} */ this.MaxMediaFileDuration = null; /** * [Valid only when UniRecord=3.]. The audio and video type of the recording corresponds to the "recording format" in the recording template. valid values: 0 (audio and video), 1 (pure audio), 2 (video only). the final recording file content is the intersection of the specified type and the relayed content. * @type {number || null} */ this.StreamType = null; /** * Recording file name prefix, no more than 64 characters. this parameter is valid only when store is vod. Limit length to 64 bytes, only allow a combination of uppercase and lowercase letters (a-zA-Z), digits (0-9), underscores (_), and hyphens (-). * @type {string || null} */ this.UserDefineRecordPrefix = null; /** * [Valid only when UniRecord=3.]. Recording files storage parameters, corresponding console "storage location" and related parameters. currently supports VOD and COS storage methods. only one can be filled. * @type {McuStorageParams || null} */ this.McuStorageParams = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.UniRecord = 'UniRecord' in params ? params.UniRecord : null; this.RecordKey = 'RecordKey' in params ? params.RecordKey : null; this.RecordWaitTime = 'RecordWaitTime' in params ? params.RecordWaitTime : null; this.RecordFormat = 'RecordFormat' in params ? params.RecordFormat : null; this.MaxMediaFileDuration = 'MaxMediaFileDuration' in params ? params.MaxMediaFileDuration : null; this.StreamType = 'StreamType' in params ? params.StreamType : null; this.UserDefineRecordPrefix = 'UserDefineRecordPrefix' in params ? params.UserDefineRecordPrefix : null; if (params.McuStorageParams) { let obj = new McuStorageParams(); obj.deserialize(params.McuStorageParams) this.McuStorageParams = obj; } } } /** * The custom layout parameters. * @class */ class MixLayout extends AbstractModel { constructor(){ super(); /** * The Y axis of the window’s top-left corner. Value range: [0, 1920]. The value cannot be larger than the canvas height. * @type {number || null} */ this.Top = null; /** * The X axis of the window’s top-left corner. Value range: [0, 1920]. The value cannot be larger than the canvas width. * @type {number || null} */ this.Left = null; /** * The relative width of the window. Value range: [0, 1920]. The sum of the values of this parameter and `Left` cannot exceed the canvas width. * @type {number || null} */ this.Width = null; /** * The relative height of the window. Value range: [0, 1920]. The sum of the values of this parameter and `Top` cannot exceed the canvas height. * @type {number || null} */ this.Height = null; /** * The user ID (string) of the anchor whose video is shown in the window. If you do not set this parameter, anchors’ videos will be shown in their room entry sequence. * @type {string || null} */ this.UserId = null; /** * The degree of transparency of the canvas. Value range: [0, 255]. 0 means fully opaque, and 255 means fully transparent. * @type {number || null} */ this.Alpha = null; /** * 0: Stretch. In this mode, the image is stretched to fill the space available. The whole image is visible after scaling. However, if the original aspect ratio is different from the target, the image may be distorted. 1: Crop (default). In this mode, if the original aspect ratio is different from the target, the image will be cropped according to the target before being stretched to fill the space available. The image will not be distorted. 2: Blank. This mode stretches the image while keeping its original aspect ratio. If the original aspect ratio is different from the target, there may be blank spaces to the top and bottom or to the left and right of the window. 3: Smart stretch. This mode is similar to the crop mode, except that it restricts cropping to 20% of the image’s width or height at most. * @type {number || null} */ this.RenderMode = null; /** * The type of the stream subscribed to. 0: Primary stream (default) 1: Substream * @type {number || null} */ this.MediaId = null; /** * The image layer. 0 is the default value and means the bottommost layer. * @type {number || null} */ this.ImageLayer = null; /** * The image url supports only jpg, png, and jpeg formats. the resolution limitation is no more than 2K, and the image size limit is no more than 5MB. note that the url must carry the format extension. the url supports only specific strings within the range of a-z, a-z, 0-9, '-', '.', '_', '~', ':', '/', '?', '#', '[', ']', '@', '!', '&', '(', ')', '*', '+', ',', '%', and '='. * @type {string || null} */ this.SubBackgroundImage = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Top = 'Top' in params ? params.Top : null; this.Left = 'Left' in params ? params.Left : null; this.Width = 'Width' in params ? params.Width : null; this.Height = 'Height' in params ? params.Height : null; this.UserId = 'UserId' in params ? params.UserId : null; this.Alpha = 'Alpha' in params ? params.Alpha : null; this.RenderMode = 'RenderMode' in params ? params.RenderMode : null; this.MediaId = 'MediaId' in params ? params.MediaId : null; this.ImageLayer = 'ImageLayer' in params ? params.ImageLayer : null; this.SubBackgroundImage = 'SubBackgroundImage' in params ? params.SubBackgroundImage : null; } } /** * The video parameters for relaying. * @class */ class McuVideoParams extends AbstractModel { constructor(){ super(); /** * Video encoding parameter for the output stream. * @type {VideoEncode || null} */ this.VideoEncode = null; /** * Stream mixing layout parameter. * @type {McuLayoutParams || null} */ this.LayoutParams = null; /** * The entire canvas background color. commonly used colors:. Red: 0xcc0033. Yellow: 0xcc9900. Green: 0xcccc33. Blue: 0x99CCFF. Black: 0x000000. White: 0xFFFFFF. Gray: 0x999999. * @type {string || null} */ this.BackGroundColor = null; /** * The url of the background image for the entire canvas. priority is higher than BackGroundColor. supports png, jpg, and jpeg formats. image size limit is not more than 5MB. Note:. 1. make sure the image link is accessible. the backend download timeout is 10 seconds with a maximum of 3 retries. if the image download fails eventually, the background image will not take effect. 2. url supported character sets: ['0-9','a-z','a-z','-', '.', '_', '~', ':', '/', '?', '#', '[', ']','@', '!', '&', '(', ')', '*', '+', ',', '%', '=', ';', '|']. make sure url characters are within the supported character sets. if any character outside the supported character sets exists, the background image will not take effect. * @type {string || null} */ this.BackgroundImageUrl = null; /** * Watermark parameters for the stream mixing layout. * @type {Array.<McuWaterMarkParams> || null} */ this.WaterMarkList = null; /** * The display mode of the background image in the output: 0 for crop, 1 for scale and display black background, 2 for variable-scale scaling. the backend defaults to variable-scale scaling. * @type {number || null} */ this.BackgroundRenderMode = null; } /** * @private */ deserialize(params) { if (!params) { return; } if (params.VideoEncode) { let obj = new VideoEncode(); obj.deserialize(params.VideoEncode) this.VideoEncode = obj; } if (params.LayoutParams) { let obj = new McuLayoutParams(); obj.deserialize(params.LayoutParams) this.LayoutParams = obj; } this.BackGroundColor = 'BackGroundColor' in params ? params.BackGroundColor : null; this.BackgroundImageUrl = 'BackgroundImageUrl' in params ? params.BackgroundImageUrl : null; if (params.WaterMarkList) { this.WaterMarkList = new Array(); for (let z in params.WaterMarkList) { let obj = new McuWaterMarkParams(); obj.deserialize(params.WaterMarkList[z]); this.WaterMarkList.push(obj); } } this.BackgroundRenderMode = 'BackgroundRenderMode' in params ? params.BackgroundRenderMode : null; } } /** * DescribeTRTCRealTimeScaleData request structure. * @class */ class DescribeTRTCRealTimeScaleDataRequest extends AbstractModel { constructor(){ super(); /** * User SDKAppId (e.g., 1400xxxxxx) * @type {string || null} */ this.SdkAppId = null; /** * Start time, unix timestamp, Unit: seconds (Query time range depends on the function version of the monitoring dashboard, premium edition can query up to 1 hours) * @type {number || null} */ this.StartTime = null; /** * End time, unix timestamp, Unit: seconds * @type {number || null} */ this.EndTime = null; /** * Room ID * @type {string || null} */ this.RoomId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.SdkAppId = 'SdkAppId' in params ? params.SdkAppId : null; this.StartTime = 'StartTime' in params ? params.StartTime : null; this.EndTime = 'EndTime' in params ? params.EndTime : null; this.RoomId = 'RoomId' in params ? params.RoomId : null; } } /** * StartAIConversation response structure. * @class */ class StartAIConversationResponse extends AbstractModel { constructor(){ super(); /** * For uniquely identifying a conversation task. * @type {string || null} */ this.TaskId = null; /** * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.TaskId = 'TaskId' in params ? params.TaskId : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * StartAIConversation request structure. * @class */ class StartAIConversationRequest extends AbstractModel { constructor(){ super(); /** * [SdkAppId](https://www.tencentcloud.com/document/product/647/46351?from_cn_redirect=1#SdkAppId) of TRTC, which is the same as the SdkAppId used by the room with transcription task enabled. * @type {number || null} */ this.SdkAppId = null; /** * [RoomId](https://www.tencentcloud.com/document/product/647/46351?from_cn_redirect=1#RoomId) of TRTC refers to the room number that enables the conversation task. * @type {string || null} */ this.RoomId = null; /** * Bot parameters. * @type {AgentConfig || null} */ this.AgentConfig = null; /** * The unique Id passed by the caller can be used to prevent duplication of task initiation on the client side as well as query task status through this field. * @type {string || null} */ this.SessionId = null; /** * Type of the TRTC room number. 0 indicates digit room number, 1 indicates string room number. by default if left blank, it is digit room number. * @type {number || null} */ this.RoomIdType = null; /** * Speech recognition configuration. * @type {STTConfig || null} */ this.STTConfig = null; /** * Required parameter, LLM configuration. it must comply with the openai standard and be a JSON String. example: <pre> { <br> &emsp; "LLMType": "Model type", // String required, for example: "openai" <br> &emsp; "Model": "your Model name", // String required, specifies the Model to be used<br> "APIKey": "your LLM API key", // String required <br> &emsp; "APIUrl": "https://API.xxx.com/chat/completions", // String required, the URL for LLM API access<br> &emsp; "History": 10, // Integer optional, sets the context rounds for LLM, default value is 0, maximum value is 50<br> &emsp; "HistoryMode": 1, // Integer optional, 1 means the content in the LLM context will synchronize with playback audio, and text corresponding to unplayed audio will not appear in the context. 0 means no synchronization, default value is 0<br> &emsp; "Streaming": true // Boolean optional, whether to use Streaming<br> &emsp;} </pre>. * @type {string || null} */ this.LLMConfig = null; /** * Required parameter, TTS configuration. it is a JSON string: TRTC TTS configuration as follows:. <pre> { <br> &emsp; "TTSType": "flow", // [required] fixed to this value. <br> &emsp; "VoiceId": "v-female-R2s4N9qJ", // [required] premium timbre ID/clone voice ID. selectable different timbres. refer to the following timbre list for ID library. <br> &emsp; "Model": "flow_01_turbo", // (required) current default TTS Model version (corresponds to Flash version). <br> &emsp; "Speed": 1.0, // [option] adjust the speaking rate. value range [0.5-2.0]. default 1.0. the larger the value, the faster the speech speed. <br> &emsp; "Volume": 1.0, // [optional] adjust volume [0,10]. default: 1.0. a larger value indicates higher volume. <br> &emsp; "Pitch": 0, // [optional] adjusts the tone [-12,12]. default value is 0. among them, 0 outputs the original voice type. <br> &emsp; "Language": "zh" // [optional] recommend filling in. currently supports filling in chinese: zh, english: en, cantonese dialect: yue. parameter reference: (ISO 639-1). <br> &emsp;} </pre> * @type {string || null} */ this.TTSConfig = null; /** * Experimental parameter, contact for background usage. * @type {string || null} */ this.ExperimentalParams = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.SdkAppId = 'SdkAppId' in params ? params.SdkAppId : null; this.RoomId = 'RoomId' in params ? params.RoomId : null; if (params.AgentConfig) { let obj = new AgentConfig(); obj.deserialize(params.AgentConfig) this.AgentConfig = obj; } this.SessionId = 'SessionId' in params ? params.SessionId : null; this.RoomIdType = 'RoomIdType' in params ? params.RoomIdType : null; if (params.STTConfig) { let obj = new STTConfig(); obj.deserialize(params.STTConfig) this.STTConfig = obj; } this.LLMConfig = 'LLMConfig' in params ? params.LLMConfig : null; this.TTSConfig = 'TTSConfig' in params ? params.TTSConfig : null; this.ExperimentalParams = 'ExperimentalParams' in params ? params.ExperimentalParams : null; } } /** * TTS sound parameter configuration. * @class */ class Voice extends AbstractModel { constructor(){ super(); /** * Voice ID, can be obtained from the timbre list or use a custom voice ID generated by sound clone. * @type {string || null} */ this.VoiceId = null; /** * Speech speed adjustment. 0.5 for half speed, 2.0 for 2x speed, and 1.0 for normal speed. value range: [0.5, 2.0]. default: 1.0. * @type {number || null} */ this.Speed = null; /** * Audio volume adjustment, where 0 indicates mute and 10 indicates maximum volume. recommended to keep the default value of 1.0. value range: [0,10]. default: 1.0. * @type {number || null} */ this.Volume = null; /** * Pitch adjustment. negative value makes the sound deeper, positive value makes the sound sharper. 0 indicates the original pitch. value range: [-12, 12]. default: 0. * @type {number || null} */ this.Pitch = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.VoiceId = 'VoiceId' in params ? params.VoiceId : null; this.Speed = 'Speed' in params ? params.Speed : null; this.Volume = 'Volume' in params ? params.Volume : null; this.Pitch = 'Pitch' in params ? params.Pitch : null; } } /** * DescribeTRTCMarketScaleData request structure. * @class */ class DescribeTRTCMarketScaleDataRequest extends AbstractModel { constructor(){ super(); /** * User SDKAppId * @type {string || null} */ this.SdkAppId = null; /** * Query start time, format is YYYY-MM-DD. (The query time range depends on the monitoring dashboard function version, the premium edition can query up to 60 days) * @type {string || null} */ this.StartTime = null; /** * Query end time, format is YYYY-MM-DD. * @type {string || null} */ this.EndTime = null; /** * The granularity of the returned data, which can be set to the following values: d: by day. This returns data for the entire UTC day of the query time range. h: by hour. This returns data for the entire UTC hour of the query time range. * @type {string || null} */ this.Period = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.SdkAppId = 'SdkAppId' in params ? params.SdkAppId : null; this.StartTime = 'StartTime' in params ? params.StartTime : null; this.EndTime = 'EndTime' in params ? params.EndTime : null; this.Period = 'Period' in params ? params.Period : null; } } /** * The SEI parameters for audio volume layout. You can specify the `AppData` and `PayloadType`. This parameter may be empty, in which case the default SEI parameters for audio volume layout will be used. * @class */ class McuLayoutVolume extends AbstractModel { constructor(){ super(); /** * The application data, which will be embedded in the `app_data` field of the custom SEI. It must be shorter than 4,096 characters. * @type {string || null} */ this.AppData = null; /** * The payload type of the SEI message. The default is 100. Value range: 100-254 (244 is used internally by Tencent Cloud for timestamps). * @type {number || null} */ this.PayloadType = null; /** * The SEI sending interval (milliseconds). The default value is 1000. * @type {number || null} */ this.Interval = null; /** * Valid values: `1`: SEI is guaranteed when keyframes are sent; `0` (default): SEI is not guaranteed when keyframes are sent. * @type {number || null} */ this.FollowIdr = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.AppData = 'AppData' in params ? params.AppData : null; this.PayloadType = 'PayloadType' in params ? params.PayloadType : null; this.Interval =