@@ -4810,6 +4810,96 @@ paths:
48104810 - 语言检测
48114811 - 内容分析
48124812 - 文本工具
4813+ /translate/stream :
4814+ post :
4815+ description : |-
4816+ 想让翻译结果像打字机一样逐字显示出来?这个流式翻译接口能实现这种效果。
4817+
4818+ ## 功能概述
4819+ 不同于传统翻译API一次性返回完整结果,这个接口会实时地、一个字一个字地把翻译内容推给你(就像ChatGPT回复消息那样),非常适合用在聊天应用、直播字幕等需要即时反馈的场景。
4820+
4821+ ## 它能做什么
4822+ - **中英互译**:支持中文和英文之间的双向翻译
4823+ - **自动识别**:不确定源语言?设置为 `auto` 让我们自动检测
4824+ - **逐字返回**:翻译结果会像打字机一样逐字流式返回,用户体验更流畅
4825+ - **音频朗读**:部分翻译结果会附带音频链接,方便朗读
4826+
4827+ ## 支持的语言
4828+ 目前专注于中英互译,支持以下选项:
4829+ - `中文`(简体/繁体)
4830+ - `英文`
4831+ - `auto`(自动检测)
4832+ operationId : post-translate-stream
4833+ requestBody :
4834+ content :
4835+ application/json :
4836+ schema :
4837+ $ref : " #/components/schemas/post_translate_stream_request"
4838+ description : 包含翻译参数的JSON对象
4839+ required : true
4840+ responses :
4841+ " 200 " :
4842+ content :
4843+ text/event-stream :
4844+ schema :
4845+ example : |
4846+ event: start
4847+ data: ok
4848+
4849+ event: message
4850+ data: {"content":"Hello"}
4851+
4852+ event: audio
4853+ data: {"speak_url":"https://fanyi.so.com/audio?from=zh&to=en&voice=2&cate=speakUrl&key=7eca689f0d3389d9dea66ae112e5cfd7&query=你好","tSpeak_url":"/audio?from=zh&to=en&voice=2&cate=tSpeakUrl&key=8b1a9953c4611296a827abf8c47804d7&query=Hello","美":"/audio?from=zh&to=en&voice=6&cate=us-speech&key=7eca689f0d3389d9dea66ae112e5cfd7&query=你好","英":"/audio?from=zh&to=en&voice=5&cate=uk-speech&key=7eca689f0d3389d9dea66ae112e5cfd7&query=你好"}
4854+
4855+ event: end
4856+ data: ok
4857+ type : string
4858+ description : SSE流式响应。Content-Type为text/event-stream
4859+ " 400 " :
4860+ content :
4861+ application/json :
4862+ schema :
4863+ $ref : " #/components/schemas/post_translate_stream_400_response"
4864+ description : 请求参数错误
4865+ " 500 " :
4866+ content :
4867+ application/json :
4868+ schema :
4869+ $ref : " #/components/schemas/post_translate_stream_500_response"
4870+ description : 翻译服务错误
4871+ summary : 流式翻译(中英互译)
4872+ tags :
4873+ - Translate
4874+ x-search-words :
4875+ - 流式翻译
4876+ - SSE翻译
4877+ - 实时翻译
4878+ - 中译英
4879+ - 英译中
4880+ - 打字机效果
4881+ - 流式响应
4882+ - Server-Sent Events
4883+ - stream translate
4884+ - 实时
4885+ - 逐字翻译
4886+ x-seo-optimized-text : 免费流式翻译API接口,支持中文和英文之间的实时流式翻译。采用Server-Sent Events(SSE)技术,提供打字机效果的翻译体验。适用于实时翻译应用、聊天翻译、直播字幕、即时通讯翻译等场景。
4887+ x-seo-keywords :
4888+ - 流式翻译API
4889+ - SSE翻译接口
4890+ - 实时翻译API
4891+ - 中英互译
4892+ - 打字机翻译
4893+ - Server-Sent Events
4894+ - 流式响应翻译
4895+ - 实时翻译服务
4896+ x-seo-title : 免费流式翻译API接口 - SSE实时中英互译服务
4897+ x-seo-usage-scenarios : 适用于实时聊天翻译、直播字幕翻译、即时通讯应用、AI对话翻译、语音识别翻译、在线教育、跨境沟通等场景
4898+ x-seo-related-apis :
4899+ - 多语言文本翻译
4900+ - AI智能翻译
4901+ - 文本处理
4902+ - 实时通信
48134903 /ai/translate :
48144904 post :
48154905 description : |-
@@ -5003,6 +5093,7 @@ paths:
50035093 - 文学翻译
50045094 - 学术翻译
50055095 - 快速翻译
5096+ - 快速翻译
50065097 /ai/translate/languages :
50075098 get :
50085099 description : 获取AI智能翻译服务支持的完整语言列表、翻译风格选项、上下文场景选项以及性能指标信息。这个接口对于需要在前端动态展示翻译配置选项的应用非常有用,它会返回当前AI翻译服务所支持的所有语言代码、原生名称、翻译风格说明、上下文场景描述,以及服务的性能特征和限制信息。通过此接口,开发者可以构建用户友好的翻译界面,让用户选择合适的翻译参数。
@@ -5018,16 +5109,6 @@ paths:
50185109 summary : 获取AI翻译支持的语言和配置
50195110 tags :
50205111 - Translate
5021- x-search-words :
5022- - 支持语言
5023- - 翻译配置
5024- - 语言列表
5025- - 翻译风格
5026- - 上下文选项
5027- - supported languages
5028- - translation config
5029- - language list
5030- - AI翻译配置
50315112 /webparse/extractimages :
50325113 get :
50335114 description : |-
@@ -5943,6 +6024,19 @@ components:
59436024 example : 5
59446025 type : integer
59456026 type : object
6027+ post_translate_stream_500_response :
6028+ example :
6029+ code : SERVICE_ERROR
6030+ error : Translation service unavailable
6031+ properties :
6032+ error :
6033+ description : 错误描述
6034+ example : Translation service unavailable
6035+ type : string
6036+ code :
6037+ example : SERVICE_ERROR
6038+ type : string
6039+ type : object
59466040 get_misc_hotboard_200_response_list_inner :
59476041 example :
59486042 hot_value : " 1234567"
@@ -6804,6 +6898,24 @@ components:
68046898 example : aK3fP7bQ9zRjT1vN
68056899 type : string
68066900 type : object
6901+ post_translate_stream_400_response :
6902+ example :
6903+ code : MISSING_QUERY
6904+ error : Missing required parameter
6905+ properties :
6906+ error :
6907+ description : 错误描述
6908+ example : Missing required parameter
6909+ type : string
6910+ code :
6911+ description : 错误码
6912+ enum :
6913+ - INVALID_REQUEST
6914+ - MISSING_QUERY
6915+ - MISSING_TARGET_LANG
6916+ example : MISSING_QUERY
6917+ type : string
6918+ type : object
68076919 get_social_qq_groupinfo_404_response :
68086920 example :
68096921 code : NOT_FOUND
@@ -8797,6 +8909,36 @@ components:
87978909 example : 2023-10-27 12:00:00
87988910 type : string
87998911 type : object
8912+ post_translate_stream_request :
8913+ properties :
8914+ query :
8915+ description : 待翻译的文本内容
8916+ example : " Hello, how are you?"
8917+ type : string
8918+ to_lang :
8919+ description : 目标语言,支持:中文、英文
8920+ enum :
8921+ - 中文
8922+ - 英文
8923+ example : 中文
8924+ type : string
8925+ from_lang :
8926+ default : auto
8927+ description : 源语言,支持:中文、英文、auto(自动检测)。默认为auto
8928+ enum :
8929+ - 中文
8930+ - 英文
8931+ - auto
8932+ example : 英文
8933+ type : string
8934+ tone :
8935+ description : 语气参数,可选
8936+ example : " "
8937+ type : string
8938+ required :
8939+ - query
8940+ - to_lang
8941+ type : object
88008942 get_misc_weather_200_response :
88018943 example :
88028944 province : 北京
0 commit comments