On this page

getAI2AgentConfigLangList

Retrieve the language list.

Import

Available in @ray-js/ray^1.7.24 and base library version 2.27.0 or above

import { getAI2AgentConfigLangList } from '@ray-js/ray';

Parameters

GetAI2AgentConfigLangList

PropertyTypeRequiredDescription
devIdstringYesDevice ID

Response

GetAI2AgentConfigLangListResult

PropertyTypeDescription
langCodestringLanguage code
langNamestringLanguage name
hasDefaultbooleanWhether it is the default language

Function definition

/**
 * Retrieve the language list
 * @param data Interface parameters
 * @returns Promise<GetAI2AgentConfigLangListResult>
 */
export function getAI2AgentConfigLangList(data: GetAI2AgentConfigLangList): Promise<GetAI2AgentConfigLangListResult>;

Request example

import { getAI2AgentConfigLangList } from '@ray-js/ray';

const params = {
  devId: '12345'
};

getAI2AgentConfigLangList(params)
  .then((result) => {
    console.log('Language list:', result);
  })
  .catch((error) => {
    console.error('Error:', error);
  });

Success example

[
  {
    "langCode": "en",
    "langName": "English",
    "hasDefault": true
  },
  {
    "langCode": "zh",
    "langName": "Chinese",
    "hasDefault": false
  }
]