INNER CODE UNIT · Python

__print_usage

adamyodinsky/TerminalGPT · terminalgpt/chat.py:63

    def __print_usage(self):
        """Prints the total usage"""
        print(
            Fore.LIGHTBLUE_EX
            + f"\nAPI Total Usage: {str(self.__total_usage)} tokens"
            + Style.RESET_ALL
        )
        print(
            Fore.LIGHTCYAN_EX
            + f"Counter Total Usage: {str(self.num_tokens_from_messages())} tokens"
            + Style.RESET_ALL
        )

    def chat_loop(self):
        """Main chat loop."""

        while True:
            # flush stdin

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…