问题描述
使用自定义服务商连接 New API 中转站(基于 Go)时,请求自动附加了 response_format: "b64_json",导致中转站返回错误:
json: cannot unmarshal string into Go struct field GeneralOpenAIRequest.response_format of type ***.ResponseFormat
复现步骤
- 添加自定义服务商,接口类型为
chat/completions
- 发起图片生成请求
- 在浏览器 Network 中抓包,发现请求体包含:
{
"model": "gpt-image-2",
"messages": [...],
"response_format": "b64_json"
}
问题描述
使用自定义服务商连接 New API 中转站(基于 Go)时,请求自动附加了
response_format: "b64_json",导致中转站返回错误:json: cannot unmarshal string into Go struct field GeneralOpenAIRequest.response_format of type ***.ResponseFormat复现步骤
chat/completions{ "model": "gpt-image-2", "messages": [...], "response_format": "b64_json" }