Skip to main content
Version: 1.4.x

AIPlayer API Method

1 AIPlayer.generateToken(json)

Get JWT Verified Token

  • Parameter

    ParamTypeDescription
    jsonObjectparameters of the generateToken function
    json.appIdStringAppId
    json.tokenStringJWT Client Token
  • Return Parameter

    ParamTypeDescription
    returnObjectgenerateToken return
    return.succeedBooleantrue: Success, false: Fail
    return.defaultAIObjectdefault AI({ "ai_name": "..." })
    return.tokenStringJWT Verified Token
    return.tokenExpireNumberJWT Verified Token Expire
  • Example

  const result = await AI_PLAYER.generateToken({ appId: "...", token: "..." });

2. AIPlayer.getAIList()

Get a list of available AI models

  • Return Parameter

    ParamTypeDescription
    returnObjectgetAIList return
    return.succeedBooleanTrue: Success, False: Fail
    return.aiArray<AIModel>AI Model List
  • Example

  const result = await AI_PLAYER.getAIList();

3. AIPlayer.getSampleTextList()

Gets the sample text list of AI's default language or set voice language

  • Return Parameter: Array<String>

  • Examples

  const texts = await AI_PLAYER.getSampleTextList();