How to calculate the tokens when using function call

"Under the hood, functions are injected into the system message in a syntax the model has been trained on. This means functions count against the model’s context limit and are billed as input tokens. "

So we “jailbreak”, and here’s what the function looks like when handed to the bot:

namespace functions {
    type x = (_: {
        location: string,
        unit?: \"celsius\" | \"fahrenheit\",
    }) => any;
} // namespace functions

I named the weather example function “x”.

(I don’t want to completely give up how to exploit any bot on the planet though.)

4 Likes