Files
ragflow/conf/models/openai.json
bitloi 432e966414 fix(go): support OpenAI audio endpoints (#15104)
### What problem does this PR solve?

Closes #15102.

OpenAI's Go provider config advertises `whisper-1` as ASR and `tts-1` as
TTS, but the Go driver returned `openai, no such method` for both audio
paths and did not define `url_suffix.asr` / `url_suffix.tts`.

This PR:

- adds OpenAI audio URL suffixes for `audio/transcriptions` and
`audio/speech`
- implements non-streaming `TranscribeAudio` using multipart form
uploads
- implements non-streaming `AudioSpeech` using the OpenAI speech JSON
request shape
- keeps streaming TTS explicitly unsupported instead of sending binary
audio through the text SSE sender
- adds focused tests for config coverage, ASR/TTS request shape,
required TTS voice validation, and unsupported streaming TTS


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

---------

Co-authored-by: Jin Hai <haijin.chn@gmail.com>
2026-05-25 10:25:53 +08:00

230 lines
3.8 KiB
JSON

{
"name": "OpenAI",
"url": {
"default": "https://api.openai.com/v1"
},
"url_suffix": {
"chat": "chat/completions",
"models": "models",
"embedding": "embeddings",
"asr": "audio/transcriptions",
"tts": "audio/speech"
},
"class": "gpt",
"models": [
{
"name": "gpt-5.5",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5.4",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5.4-mini",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5.4-nano",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5.2-pro",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5.2",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5.1",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5.1-chat-latest",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5-mini",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5-nano",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-5-chat-latest",
"max_tokens": 400000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-4.1",
"max_tokens": 1047576,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-4.1-mini",
"max_tokens": 1047576,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-4.1-nano",
"max_tokens": 1047576,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-4.5-preview",
"max_tokens": 128000,
"model_types": [
"chat"
]
},
{
"name": "gpt-4o-mini",
"max_tokens": 128000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-4o",
"max_tokens": 128000,
"model_types": [
"chat",
"vision"
]
},
{
"name": "gpt-3.5-turbo",
"max_tokens": 4096,
"model_types": [
"chat"
]
},
{
"name": "gpt-3.5-turbo-16k-0613",
"max_tokens": 16385,
"model_types": [
"chat"
]
},
{
"name": "text-embedding-ada-002",
"max_tokens": 8191,
"model_types": [
"embedding"
]
},
{
"name": "text-embedding-3-small",
"max_tokens": 8191,
"model_types": [
"embedding"
]
},
{
"name": "text-embedding-3-large",
"max_tokens": 8191,
"model_types": [
"embedding"
]
},
{
"name": "whisper-1",
"max_tokens": 26214400,
"model_types": [
"asr"
]
},
{
"name": "gpt-4",
"max_tokens": 8191,
"model_types": [
"chat"
]
},
{
"name": "gpt-4-turbo",
"max_tokens": 8191,
"model_types": [
"chat"
]
},
{
"name": "gpt-4-32k",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "tts-1",
"max_tokens": 2048,
"model_types": [
"tts"
]
}
]
}