This project provides OpenAI related slots for Magic. More specifically, it provides the following slots.

  • [openai.tokenize] - Returns how many tokens the specified text will consume from OpenAI

The above slot will calculate how many tokens the specified input requires from the OpenAI endpoints.

openai.tokenize:This is some query


Thx to Devis Lucato for publishing the original work under CC0 here.