Troubleshooting of OpenAI API: Difference between revisions
Jump to navigation
Jump to search
→How to fix 'messages' is a required property
(Created page with " === How to fix "The message you submitted was too long" === * Error message: "The message you submitted was too long, please reload the conversation and submit something shor...") |
|||
| Line 9: | Line 9: | ||
=== How to fix 'messages' is a required property === | === How to fix 'messages' is a required property === | ||
* Error message: 'messages' is a required property | |||
* Solution: Check the payload data if the messages property is exists | * Solution: Check the payload data if the messages property is exists | ||
=== How to fix None is not of type 'string' - 'messages.1.content' === | |||
* Error message: None is not of type 'string' - 'messages.1.content' | |||
* Example Input | |||
<pre> | |||
{ | |||
"model": "gpt-4", | |||
"max_tokens": 1000, | |||
"temperature": 0.9, | |||
"messages": [ | |||
{"role": "system", "content": "#zh-TW You are a helpful assistant. Help me to summarize the article"}, | |||
{"role": "user", "content": null} | |||
] | |||
} | |||
</pre> | |||
* Solution: The property messages.1.content should not be null e.g. | |||
<pre> | |||
{ | |||
"model": "gpt-4", | |||
"max_tokens": 1000, | |||
"temperature": 0.9, | |||
"messages": [ | |||
{"role": "system", "content": "#zh-TW You are a helpful assistant. Help me to summarize the article"}, | |||
{"role": "user", "content": "YOUR ARTICLE ... ..."} | |||
] | |||
} | |||
</pre> | |||
=== How to fix "The model `gtp-4` does not exist" === | === How to fix "The model `gtp-4` does not exist" === | ||