@@ -4961,6 +4961,100 @@ paths:
49614961 x-content-type : application/json
49624962 x-accepts :
49634963 - application/json
4964+ /translate/stream :
4965+ post :
4966+ description : |-
4967+ 想让翻译结果像打字机一样逐字显示出来?这个流式翻译接口能实现这种效果。
4968+
4969+ ## 功能概述
4970+ 不同于传统翻译API一次性返回完整结果,这个接口会实时地、一个字一个字地把翻译内容推给你(就像ChatGPT回复消息那样),非常适合用在聊天应用、直播字幕等需要即时反馈的场景。
4971+
4972+ ## 它能做什么
4973+ - **中英互译**:支持中文和英文之间的双向翻译
4974+ - **自动识别**:不确定源语言?设置为 `auto` 让我们自动检测
4975+ - **逐字返回**:翻译结果会像打字机一样逐字流式返回,用户体验更流畅
4976+ - **音频朗读**:部分翻译结果会附带音频链接,方便朗读
4977+
4978+ ## 支持的语言
4979+ 目前专注于中英互译,支持以下选项:
4980+ - `中文`(简体/繁体)
4981+ - `英文`
4982+ - `auto`(自动检测)
4983+ operationId : post-translate-stream
4984+ requestBody :
4985+ content :
4986+ application/json :
4987+ schema :
4988+ $ref : " #/components/schemas/post_translate_stream_request"
4989+ description : 包含翻译参数的JSON对象
4990+ required : true
4991+ responses :
4992+ " 200 " :
4993+ content :
4994+ text/event-stream :
4995+ schema :
4996+ example : |
4997+ event: start
4998+ data: ok
4999+
5000+ event: message
5001+ data: {"content":"Hello"}
5002+
5003+ event: audio
5004+ 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=你好"}
5005+
5006+ event: end
5007+ data: ok
5008+ type : string
5009+ description : SSE流式响应。Content-Type为text/event-stream
5010+ " 400 " :
5011+ content :
5012+ application/json :
5013+ schema :
5014+ $ref : " #/components/schemas/post_translate_stream_400_response"
5015+ description : 请求参数错误
5016+ " 500 " :
5017+ content :
5018+ application/json :
5019+ schema :
5020+ $ref : " #/components/schemas/post_translate_stream_500_response"
5021+ description : 翻译服务错误
5022+ summary : 流式翻译(中英互译)
5023+ tags :
5024+ - Translate
5025+ x-search-words :
5026+ - 流式翻译
5027+ - SSE翻译
5028+ - 实时翻译
5029+ - 中译英
5030+ - 英译中
5031+ - 打字机效果
5032+ - 流式响应
5033+ - Server-Sent Events
5034+ - stream translate
5035+ - 实时
5036+ - 逐字翻译
5037+ x-seo-optimized-text : 免费流式翻译API接口,支持中文和英文之间的实时流式翻译。采用Server-Sent Events(SSE)技术,提供打字机效果的翻译体验。适用于实时翻译应用、聊天翻译、直播字幕、即时通讯翻译等场景。
5038+ x-seo-keywords :
5039+ - 流式翻译API
5040+ - SSE翻译接口
5041+ - 实时翻译API
5042+ - 中英互译
5043+ - 打字机翻译
5044+ - Server-Sent Events
5045+ - 流式响应翻译
5046+ - 实时翻译服务
5047+ x-seo-title : 免费流式翻译API接口 - SSE实时中英互译服务
5048+ x-seo-usage-scenarios : 适用于实时聊天翻译、直播字幕翻译、即时通讯应用、AI对话翻译、语音识别翻译、在线教育、跨境沟通等场景
5049+ x-seo-related-apis :
5050+ - 多语言文本翻译
5051+ - AI智能翻译
5052+ - 文本处理
5053+ - 实时通信
5054+ x-content-type : application/json
5055+ x-accepts :
5056+ - application/json
5057+ - text/event-stream
49645058 /ai/translate :
49655059 post :
49665060 description : |-
@@ -5154,6 +5248,7 @@ paths:
51545248 - 文学翻译
51555249 - 学术翻译
51565250 - 快速翻译
5251+ - 快速翻译
51575252 x-content-type : application/json
51585253 x-accepts :
51595254 - application/json
@@ -5172,16 +5267,6 @@ paths:
51725267 summary : 获取AI翻译支持的语言和配置
51735268 tags :
51745269 - Translate
5175- x-search-words :
5176- - 支持语言
5177- - 翻译配置
5178- - 语言列表
5179- - 翻译风格
5180- - 上下文选项
5181- - supported languages
5182- - translation config
5183- - language list
5184- - AI翻译配置
51855270 x-accepts :
51865271 - application/json
51875272 /webparse/extractimages :
@@ -6128,6 +6213,19 @@ components:
61286213 example : 5
61296214 type : integer
61306215 type : object
6216+ post_translate_stream_500_response :
6217+ example :
6218+ code : SERVICE_ERROR
6219+ error : Translation service unavailable
6220+ properties :
6221+ error :
6222+ description : 错误描述
6223+ example : Translation service unavailable
6224+ type : string
6225+ code :
6226+ example : SERVICE_ERROR
6227+ type : string
6228+ type : object
61316229 get_misc_hotboard_200_response_list_inner :
61326230 example :
61336231 hot_value : " 1234567"
@@ -6989,6 +7087,24 @@ components:
69897087 example : aK3fP7bQ9zRjT1vN
69907088 type : string
69917089 type : object
7090+ post_translate_stream_400_response :
7091+ example :
7092+ code : MISSING_QUERY
7093+ error : Missing required parameter
7094+ properties :
7095+ error :
7096+ description : 错误描述
7097+ example : Missing required parameter
7098+ type : string
7099+ code :
7100+ description : 错误码
7101+ enum :
7102+ - INVALID_REQUEST
7103+ - MISSING_QUERY
7104+ - MISSING_TARGET_LANG
7105+ example : MISSING_QUERY
7106+ type : string
7107+ type : object
69927108 get_social_qq_groupinfo_404_response :
69937109 example :
69947110 code : NOT_FOUND
@@ -8982,6 +9098,36 @@ components:
89829098 example : 2023-10-27 12:00:00
89839099 type : string
89849100 type : object
9101+ post_translate_stream_request :
9102+ properties :
9103+ query :
9104+ description : 待翻译的文本内容
9105+ example : " Hello, how are you?"
9106+ type : string
9107+ to_lang :
9108+ description : 目标语言,支持:中文、英文
9109+ enum :
9110+ - 中文
9111+ - 英文
9112+ example : 中文
9113+ type : string
9114+ from_lang :
9115+ default : auto
9116+ description : 源语言,支持:中文、英文、auto(自动检测)。默认为auto
9117+ enum :
9118+ - 中文
9119+ - 英文
9120+ - auto
9121+ example : 英文
9122+ type : string
9123+ tone :
9124+ description : 语气参数,可选
9125+ example : " "
9126+ type : string
9127+ required :
9128+ - query
9129+ - to_lang
9130+ type : object
89859131 get_misc_weather_200_response :
89869132 example :
89879133 province : 北京
0 commit comments