processRecordTransferResult(params: Object)

Requires:
WearKit≥1.0.0@ray-js/ray≥1.7.14
Platforms:
iOSAndroid
import { wear } from '@ray-js/ray';

const { processRecordTransferResult } = wear;

// Promise usage
try {
  const res = await processRecordTransferResult({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Process recording transcription or summary result with SMART_MATCH or CUSTOM mode.

Parameters

PropertyTypeRequiredDescriptionWearKit Since
recordTransferIdnumberYesRecording transcription ID-
templatestringYesTemplate: Required in CUSTOM mode (e.g., general summary, meeting minutes); not required in SMART_MATCH mode (auto-matched by the cloud based on the audio content)-
languagestringYesLanguage: Source language of the audio (applies when taskType=0 (upload + transcription))-
taskTypenumberYesTask type: 0: Upload + transcription with summary, 1: Text-only summary (TTT), 2: Translationv1.2.2
transLangstringYesTarget language for summary output; if omitted, defaults to the transcription language - optionalv1.4.0
summaryLangstringYesTarget language for translation or summary: Optional in CUSTOM mode; not required in SMART_MATCH mode (the cloud automatically infers it from the transcription)v1.4.0
enableSpeakerbooleanYesEnable speaker diarization: In SMART_MATCH mode, it is recommended to let the cloud decide (blacklisted languages are auto-disabled); in CUSTOM mode, uses the specified boolean valuev1.4.0
generateModestringNoGeneration mode: SMART_MATCH (intelligent match) | CUSTOM (custom settings); defaults to CUSTOM if omittedv3.5.9
enableImageTextbooleanNoWhether to generate a text-and-image summary: true to enable, false to disable; if omitted, default rules apply (SMART_MATCH follows cloud decision; CUSTOM defaults to off)v3.5.9
complete() => voidNoCompletion callback (executed on both success and failure)-
success() => voidNoCallback on successful API call-
fail(params: Object) => voidNoFailure callback-
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Error Code

Error CodeError Message
10001Internal error
10011Network error
10012Record not found

Examples

SMART_MATCH mode (intelligent match)

import { wear } from '@ray-js/ray'

wear.processRecordTransferResult({
  recordTransferId: 1001,
  template: 'auto',
  language: 'zh',
  taskType: 1,
  transLang: 'en',
  summaryLang: 'zh',
  generateMode: 'SMART_MATCH',
  enableSpeaker: true,
  enableImageText: true,
  success: () => {
    console.log('processRecordTransferResult SMART_MATCH success');
  },
  fail: error => {
    console.error(error);
  },
});

CUSTOM mode (custom settings)

import { wear } from '@ray-js/ray'

wear.processRecordTransferResult({
  recordTransferId: 1001,
  template: 'meeting_summary',
  language: 'zh',
  taskType: 1,
  transLang: 'en',
  summaryLang: 'zh',
  enableSpeaker: true,
  generateMode: 'CUSTOM',
  enableImageText: false,
  success: () => {
    console.log('processRecordTransferResult CUSTOM success');
  },
  fail: error => {
    console.error(error);
  },
});