Skip to content

Adding a feature: token info flag option #7

@arilloid

Description

@arilloid

Description

Adding a new command-line flag --token-usage/-t to be able to quickly check the amount of tokens that have been sent with the prompt and received from the LLM in completion object.

This can help you manage the costs of the API requests, and improve the efficiency of interactions with a LLM.

Implementation

Implementing this feature would require:

  • Adding the code for parsing the --token-usage/-t option flag argument from the command line in codeMage.py.
  • Modifying translator.py to check if the flag was provided and, if present, output the token usage information to stderr. (Information about the token usage can be found inside the completion object).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions