Ask a question to get started
Enter to sendā¢Shift+Enter new line
max_tokens_for_prompt( self, prompt: str, ) -> int
prompt
str
The prompt to pass into the model.
Calculate the maximum number of tokens possible to generate for a prompt.
Example:
.. code-block:: python
max_tokens = openai.max_tokens_for_prompt("Tell me a joke.")