Immutable STT result object with success flag, text, language, and error message.
// Source: https://github.com/mateaix/mateclaw | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package vip.mate.stt;
import lombok.Builder;
import lombok.Data;
/**
* STT 语音识别结果
*/
@Data
@Builder
public class SttResult {
private boolean success;
private String text;
private String language;
private String errorMessage;
public static SttResult success(String text) {
return SttResult.builder().success(true).text(text).build();
}
public static SttResult success(String text, String language) {
return SttResult.builder().success(true).text(text).language(language).build();
}
public static SttResult failure(String errorMessage) {
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key