Ask a question to get started
Enter to sendā¢Shift+Enter new line
Calculate num tokens for gpt-3.5-turbo and gpt-4 with tiktoken package.
Official documentation: https://github.com/openai/openai-cookbook/blob/ main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb
get_num_tokens_from_messages( self, messages: List[BaseMessage], tools: Optional[Sequence[Union[Dict[str, Any], Type, Callable, BaseTool]]] = None ) -> int