{"openapi":"3.1.0","info":{"title":"iMeeting 语音识别模型服务","description":"高性能语音识别服务,为 iMeeting 会议系统提供实时语音转写、声纹识别和离线文件分析功能。","version":"2.0.0"},"paths":{"/api/docs/websocket":{"post":{"tags":["WebSocket文档"],"summary":"Websocket Protocol Doc","description":"WebSocket 协议文档 (仅用于 Swagger UI 展示)。\n\n该接口定义了 WebSocket 通信的 JSON 数据结构。\n实际的 WebSocket 连接地址为 `ws:///`。\n\n**客户端消息字段 (输入):**\n- `mode`: 控制模式 (2pass, online, register, 等)\n- `is_speaking`: VAD 状态标记\n- `hotwords`: 更新热词\n- `use_spk_id`: 开启/关闭声纹识别\n\n**服务端响应字段 (输出):**\n- `text`: 语音识别结果\n- `timestamp`: 词/句时间戳\n- `speaker`: 识别到的说话人\n- `is_final`: 识别状态标识 (True: 最终结果/句尾, False: 正在识别/中间结果)\n- `status`: 任务状态 (processing/completed/failed)","operationId":"websocket_protocol_doc_api_docs_websocket_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WSClientMessage"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WSServerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/speakers":{"get":{"tags":["声纹管理"],"summary":"Get Speakers","description":"获取已注册声纹列表 (支持分页)。\nGet list of registered speakers (supports pagination).","operationId":"get_speakers_api_speakers_get","parameters":[{"name":"pageNum","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"页码 (默认 1)","default":1,"title":"Pagenum"},"description":"页码 (默认 1)"},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"description":"每页数量 (默认 20)","default":20,"title":"Pagesize"},"description":"每页数量 (默认 20)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["声纹管理"],"summary":"Register Speaker","description":"注册新声纹 (通过上传文件)。\nRegister a new speaker (via file upload).","operationId":"register_speaker_api_speakers_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeakerRegisterRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["声纹管理"],"summary":"Remove Speaker","description":"删除已注册的声纹。\nDelete a registered speaker.","operationId":"remove_speaker_api_speakers_delete","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","description":"要删除的说话人名称","title":"Name"},"description":"要删除的说话人名称"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/speakers/{name}":{"put":{"tags":["声纹管理"],"summary":"Update Speaker","description":"更新已存在的声纹 (重新录入)。\nUpdate an existing speaker (re-recording).","operationId":"update_speaker_api_speakers__name__put","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeakerRegisterRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/asrconfig":{"get":{"tags":["系统配置"],"summary":"Get Asr Config","description":"获取 ASR 系统配置。\nGet ASR system configuration.","operationId":"get_asr_config_api_asrconfig_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["系统配置"],"summary":"Update Asr Config","description":"更新 ASR 系统配置 (切换模型)。\nUpdate ASR system configuration (switch model).","operationId":"update_asr_config_api_asrconfig_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsrConfigUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/svconfig":{"get":{"tags":["系统配置"],"summary":"Get Sv Config","description":"获取声纹识别配置。\nGet Speaker Verification configuration.","operationId":"get_sv_config_api_svconfig_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["系统配置"],"summary":"Update Sv Config","description":"更新声纹识别配置 (设置阈值)。\nUpdate Speaker Verification configuration (set threshold).","operationId":"update_sv_config_api_svconfig_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SvConfigUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audioconfig":{"get":{"tags":["系统配置"],"summary":"Get Audio Config","description":"获取音频保存配置。\nGet Audio Saving configuration.","operationId":"get_audio_config_api_audioconfig_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["系统配置"],"summary":"Update Audio Config","description":"更新音频保存配置。\nUpdate Audio Saving configuration.","operationId":"update_audio_config_api_audioconfig_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudioConfigUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/files/upload":{"post":{"tags":["文件管理"],"summary":"Upload File","description":"上传音频文件。\nUpload audio file.","operationId":"upload_file_api_files_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_api_files_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/recognition":{"post":{"tags":["任务管理"],"summary":"Create Recognition Task","description":"创建异步 ASR 识别任务。\nCreate an asynchronous ASR recognition task.","operationId":"create_recognition_task_api_tasks_recognition_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}":{"get":{"tags":["任务管理"],"summary":"Get Task Status","description":"查询任务状态及结果。\nQuery task status and result.","operationId":"get_task_status_api_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AsrConfigUpdateRequest":{"properties":{"asr_model_type":{"type":"string","title":"Asr Model Type","description":"ASR 模型类型: 'FunASRNano', 'SenseVoiceSmall', 'ParaformerLarge'"}},"type":"object","required":["asr_model_type"],"title":"AsrConfigUpdateRequest"},"AudioConfigUpdateRequest":{"properties":{"save_audio":{"type":"boolean","title":"Save Audio","description":"是否合并保存会议音频"}},"type":"object","required":["save_audio"],"title":"AudioConfigUpdateRequest"},"Body_upload_file_api_files_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_file_api_files_upload_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SpeakerRegisterRequest":{"properties":{"name":{"type":"string","title":"Name","description":"说话人名称"},"file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Id","description":"上传的文件ID (与 file_path 二选一)"},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Path","description":"音频文件绝对路径 (与 file_id 二选一)"}},"type":"object","required":["name"],"title":"SpeakerRegisterRequest","description":"声纹注册请求参数"},"SvConfigUpdateRequest":{"properties":{"sv_threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Sv Threshold","description":"声纹识别阈值 (0.0 - 1.0)"}},"type":"object","required":["sv_threshold"],"title":"SvConfigUpdateRequest"},"TaskCreateRequest":{"properties":{"file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Id","description":"上传的文件ID (与 file_path 二选一)"},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Path","description":"音频文件绝对路径 (与 file_id 二选一)"},"hotwords":{"items":{"type":"string"},"type":"array","title":"Hotwords","description":"本次任务的热词列表"},"use_spk_id":{"type":"boolean","title":"Use Spk Id","description":"是否启用声纹识别 (默认为 True)","default":true}},"type":"object","title":"TaskCreateRequest","description":"ASR 任务创建请求参数"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WSClientMessage":{"properties":{"is_speaking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Speaking","description":"是否正在说话 (VAD状态标记)"},"chunk_interval":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chunk Interval","description":"处理间隔 (默认值: 5)"},"wav_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wav Name","description":"音频流名称 (例如: microphone)"},"chunk_size":{"anyOf":[{"type":"string"},{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Chunk Size","description":"分块大小配置"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode","description":"运行模式: 2pass(实时), online(在线), file_upload(文件上传), register(注册声纹), get_hotwords(获取热词), save_hotwords(保存热词), get_speakers(获取声纹列表), delete_speaker(删除声纹)"},"hotwords":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Hotwords","description":"热词列表 (支持字符串或列表)"},"use_spk_id":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Spk Id","description":"是否启用声纹识别 (True/False)"},"speaker_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Speaker Name","description":"说话人名称 (注册/删除时使用)"},"sv_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sv Threshold","description":"声纹识别阈值"},"unknown_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unknown Id","description":"未知说话人起始ID"},"encoder_chunk_look_back":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Encoder Chunk Look Back","description":"ASR Encoder 回溯帧数"},"decoder_chunk_look_back":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Decoder Chunk Look Back","description":"ASR Decoder 回溯帧数"}},"type":"object","title":"WSClientMessage","description":"WebSocket Client Message Schema.\nClients can send a JSON object with one or more of these fields to control the session."},"WSServerResponse":{"properties":{"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode","description":"当前运行模式"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"识别结果文本"},"wav_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wav Name","description":"音频流名称"},"is_final":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Final","description":"识别状态标识 (True: 最终结果, False: 正在识别中)"},"timestamp":{"anyOf":[{"items":{"items":{"type":"integer"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Timestamp","description":"时间戳列表 [[开始, 结束], ...]"},"speaker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Speaker","description":"识别到的说话人"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"状态消息 (success/failed/processing)"},"hotwords":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Hotwords","description":"热词列表 (get_hotwords 响应)"},"speakers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Speakers","description":"声纹列表 (get_speakers 响应)"},"msg":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Msg","description":"错误或提示信息"}},"type":"object","title":"WSServerResponse","description":"WebSocket 服务端响应结构。\n服务端将返回包含以下字段的 JSON 对象。"}}}}