Troubleshooting of OpenAI API: Difference between revisions
Jump to navigation
Jump to search
→How to fix "" is not of type 'array' - 'messages'
mNo edit summary |
|||
| Line 92: | Line 92: | ||
{"role": "user", "content": "YOUR ARTICLE ... ..."} | {"role": "user", "content": "YOUR ARTICLE ... ..."} | ||
] | ] | ||
} | |||
</pre> | |||
=== How to fix '2000' is not of type 'integer' - 'max_tokens' === | |||
* Error message: | |||
<pre> | |||
{ | |||
"error": { | |||
"message": "'2000' is not of type 'integer' - 'max_tokens'", | |||
"type": "invalid_request_error", | |||
"param": null, | |||
"code": null | |||
} | |||
} | |||
</pre> | |||
Solution: Modify the "max_tokens" parameter to an integer, rather than a string. | |||
<pre> | |||
{ | |||
"model": "gpt-4", | |||
"max_tokens": 1000, | |||
"temperature": 0.9, | |||
"messages": "" | |||
} | } | ||
</pre> | </pre> | ||