INNER CODE UNIT · Python

client

adamyodinsky/TerminalGPT · terminalgpt/chat.py:56

    def client(self):
        return self.__client

    @client.setter
    def client(self, client: OpenAI):
        self.__client = client

    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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…