feat: 补充 ASR/OCR 识别接口封装
语音优先走 /chat 实时分片,/health/ai/asr 作为分片缺失或链路失败时的整段兜底;识别链路最长可到 60s,单独放宽超时到 90s。
This commit is contained in:
@@ -42,6 +42,12 @@ const API = {
|
||||
|
||||
ai: {
|
||||
chat: (data) => request.post('/ai/chat', data),
|
||||
// 语音 / 图片都只做识别并返回文本,不在服务端自动投递(见 api/health/handler/ai_media.js)。
|
||||
// 语音优先走 /chat 的实时分片链路(asr_start/asr_chunk/asr_stop),
|
||||
// 这里的整段接口是分片缺失或链路失败时的兜底;图片由客户端先上屏,识别文本直接落成 AI 回复。
|
||||
// 识别链路最长可到 60s,单独放宽超时,避免网络稍慢就整单失败
|
||||
asr: (data) => request.post('/health/ai/asr', data, { timeout: 90000 }),
|
||||
ocr: (data) => request.post('/health/ai/ocr', data, { timeout: 90000 }),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user