openai / openai-cookbook

Examples and guides for using the OpenAI API
https://cookbook.openai.com
MIT License
57.47k stars 9.07k forks source link

[PROBLEM] Tiktoken sample implementation missing latest models (since gpt-4-turbo) #1257

Open jalcantarab opened 1 week ago

jalcantarab commented 1 week ago

Identify the file to be fixed The name of the file containing the problem.

Describe the problem The current tiktoken sample implementation does not include the latest models released since gpt-4-turbo. These models, such as gpt-4o, gpt-4o-2024-05-13, and gpt-4-turbo-2024-04-09, have different token pricing and context limits that need to be accounted for.

Describe a solution Update the tiktoken sample implementation to include the latest models: