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