Skip to content

Function to calculate number of tokens #412

Open
@rmilkowski

Description

@rmilkowski

Describe the feature or improvement you're requesting

It would be useful if the module provided a function to calculate number of token in a given prompt for a given model, without having to use another 3rd party modules to do so.

One examle when it would be useful is to trim fed history if the entire prompt (+max_tokens) is above a given model limit, before sending the query.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions