tencent cloud

Feedback

Streaming Text-driven Instructions

Last updated: 2024-07-19 10:13:04
    After you Create a Long Connection Channel, you can use a WebSocket persistent connection to send streaming text to drive the digital human.
    

    Request Parameters

    Parameter name
    Type
    Required
    Description
    ReqId
    String
    Yes
    A unique identifier for a single drive. Each segment of streaming text is assigned a UUID value.
    SessionId
    String
    Yes
    Unique identifier for the session.
    Command
    String
    Yes
    SEND_STREAMTEXT; send streaming text.
    Data
    Yes
    Data Object
    Data
    Name
    Type
    Required
    Description
    Text
    string
    Yes
    Streaming text content only requires incremental text transmission, with each fragment packet string limited to 1000 bytes in length.
    Seq
    int
    Yes
    Sequence number of the streaming text fragment packet. The sequence must start from 1.
    IsFinal
    bool
    No
    The default value is false.
    Interrupt
    bool
    No
    Forced interruption marker. The default value is false. Passing in true and an empty Text means interrupting the streaming text.
    SmartActionEnabled
    bool
    No
    Whether smart actions are enabled; the default value is false. When it is set to true and the input text or enhanced text lacks action tags, smart actions will be generated.
    IsSentence
    bool
    No
    Whether it is in clause mode; the default value is false. When it is set to true the server will not rearrange sentences.
    IsInsertSentence
    bool
    No
    Indicating whether it is an inserted clause. The default value is false. When it is set to true and in clause mode, it indicates that the current segment needs to be inserted.
    

    Request Sample

    //Normal streaming text fragment packet{
    "Header": {},
    "Payload": {
    "ReqId": "d7aa08da33dd4a662ad5be508c5b77cf",
    "SessionId": "m123adfafvbadsafd",
    "Command": "SEND_STREAMTEXT",
    "Data": {
    "Text": "Streaming Text Content",
    "Seq": 1,
    "IsFinal": false
    }
    }
    }//Streaming text final packet{
    "Header": {},
    "Payload": {
    "ReqId": "d7aa08da33dd4a662ad5be508c5b77cf",
    "SessionId": "m123adfafvbadsafd",
    "Command": "SEND_STREAMTEXT",
    "Data": {
    "Text": "The streaming text has ended.",
    "Seq": 59,
    "IsFinal": true
    }
    }
    }//Interrupt the currently broadcasting streaming text or streaming text in clause mode{
    "Header": {},
    "Payload": {
    "ReqId": "d7aa08da33dd4a662ad5be508c5b77cf",
    "SessionId": "m123adfafvbadsafd",
    "Command": "SEND_STREAMTEXT",
    "Data": {
    "Text": "",
    "Seq": 59,
    "IsFinal": true,
    "Interrupt": true
    }
    }
    }//Normal streaming text clause mode fragment packet{
    "Header": {},
    "Payload": {
    "ReqId": "d7aa08da33dd4a662ad5be508c5b77cf",
    "SessionId": "m123adfafvbadsafd",
    "Command": "SEND_STREAMTEXT",
    "Data": {
    "Text": "Streaming text clause mode content",
    "Seq": 1,
    "IsFinal": false,
    //Streaming text in clause mode does not require sending a final packet. "IsSentence": true,
    "IsInsertSentence": false//Set this value to true if it is an inserted clause.
    }
    }
    }
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support