OpenAI GPT-3.5 “prompt“ argument not working

题意:"OpenAI GPT-3.5 的 `prompt` 参数不起作用"

问题背景:

I am trying to make a flutter app with the openAI api that works like a chatbot, and I want to add a prompt so that the responses are more specialized, like in the openAI playground on their website.

"我正在尝试使用 OpenAI API 制作一个类似聊天机器人的 Flutter 应用,并且我想添加一个提示,以便响应更加专业化,就像在他们网站上的 OpenAI Playground 一样。"

I am testing the API post function with postman and it worked perfectly fine for me before I tried adding a prompt. I assumed that to add a prompt you just have to add a "prompt": line in the body like when you work with the text-davinci model, but when I do that I get this message returned:

"我正在使用 Postman 测试 API 的 POST 功能,它在我尝试添加提示之前一直运行得非常好。我以为要添加提示,只需要像在使用 text-davinci 模型时那样在请求体中添加一行 `"prompt":` 即可,但当我这样做时,我收到了以下消息:"

复制代码
{
    "error": {
        "message": "Unrecognized request argument supplied: prompt",
        "type": "invalid_request_error",
        "param": null,
        "code": null
    }
}

Is there a different way you need to do this with the gpt models, or does the prompt argument just not exist for them?

"使用 GPT 模型时需要采用不同的方法吗,还是说这些模型根本不存在 `prompt` 参数?"

问题解决:

The OPEN AI 3.5-turbo model only supports the newer chat completion API which does not have a 'prompt' json body field.

"OPEN AI 3.5-turbo 模型仅支持较新的聊天完成 API,该 API 没有 `prompt` JSON 请求体字段。"

I would assume you are using the older competion API json body format aginst the newer chat completion API endpoint and that is the reason for your error.

"我认为你可能是使用了较旧的 completion API JSON 请求体格式来访问较新的聊天完成 API 端点,这就是你遇到错误的原因。"

--- update ---

I can reproduce your exact error response with:

"我可以通过以下方式重现你的确切错误响应:"

curl https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer $OPENAI_API_KEY" -d '{ "model": "gpt-3.5-turbo", "messages": {"role": "user", "content": "Hello!"}, "prompt": "testing" }'

This is just a modified example from the api link above. Removing the added "prompt" field from the json makes it work fine.

"这只是上述 API 链接中的一个修改示例。移除 JSON 中添加的 `prompt` 字段后,它就能正常工作了。"

So my advice in the comment stands. Figure out what you are sending in the body of your http GET request. It will have a "prompt" field, remove it and any other field that should not be there and it should work.

"所以我在评论中的建议仍然适用。查明你在 HTTP GET 请求的请求体中发送了什么内容。它会有一个 `prompt` 字段,移除它以及任何其他不应该存在的字段,然后它应该就能正常工作了。"

相关推荐
Dragon Wu15 分钟前
AI视频创作笔记(六)动画短片制作
ai
me83221 分钟前
【AI面试】小白理解大模型:自注意力机制如何使大模型能够捕捉长距离依赖关系,它跟RNN有什么区别?
人工智能·rnn·深度学习·ai
2601_9618451525 分钟前
专升本资料哪个好|教材+真题+网课对比推荐PDF
考研·http·微服务·容器·visual studio
人月神话-Lee36 分钟前
【WWDC】Core AI:iOS 端侧大模型新纪元
人工智能·ios·ai·swift·wwdc·core ai
一锅炖出任易仙36 分钟前
创梦汤锅学习日记day29
学习·ai·ue5·游戏引擎
刘大猫.1 小时前
宇树科技回应联合英伟达开发“H2+”人形机器人,预计今年下半年正式亮相
人工智能·科技·机器学习·ai·chatgpt·机器人·大模型
Sammyyyyy1 小时前
2026 Mac 本地大模型部署深度解析与混合架构指南
数据库·人工智能·macos·ai·架构·servbay
MicrosoftReactor2 小时前
技术速递|以 Token 经济学驱动的架构:混合模型、AI Runway、AKS Kata MicroVM 与 MCP
人工智能·ai·架构·copilot·mcp
蜂蜜黄油呀土豆2 小时前
Agent 循环:观察、思考、行动(ReAct 入门)
python·ai·大模型·react·js
财经资讯数据_灵砚智能2 小时前
基于全球经济类多源新闻的NLP情感分析与数据可视化(夜间-次晨)2026年6月8日
大数据·人工智能·python·ai·信息可视化·自然语言处理·灵砚智能