Calcium-Ion / new-api

AI模型接口管理与分发系统,支持将多种大模型转为OpenAI格式调用、支持Midjourney Proxy、Suno、Rerank,兼容易支付协议,可供个人或者企业内部管理与分发渠道使用,本项目基于One API二次开发。
https://nekoapi.com
Apache License 2.0
3.52k stars 817 forks source link

TTS bug #155

Open yuanjie-ai opened 7 months ago

yuanjie-ai commented 7 months ago

我写的服务tts返回 @router.post("/audio/speech") async def create_speech(request: SpeechCreateRequest): stream = ...

    return StreamingResponse(stream, media_type="text/event-stream")

用openai-sdk直接请求是ok的openai_client.audio.speech.create 但是把服务放进 openai中转 就出问题了 openai.InternalServerError: Error code: 500 - {'error': {'message': "invalid character 'ÿ' looking for beginning of value (request id: 20240327141142148666233MDtYBLb0)", 'type': 'new_api_error', 'param': '', 'code': 'unmarshal_response_body_failed'}}

yuanjie-ai commented 7 months ago

好像是不兼容其他tts模型,我把模型重定向为

image

就正常返回了

yuanjie-ai commented 7 months ago

如何兼容tts-xx其他自定义或者外部模型的名称呢

yuanjie-ai commented 7 months ago

{'error': {'message': 'voice must be one of alloy, echo, fable, onyx, nova, shimmer (request id: 202403271429209790993106t2rwL7q)', 'type': 'new_api_error', 'param': '', 'code': 'invalid_field_value'}}

这些限制去了吧