INNER CODE UNIT · Python
total_usage
adamyodinsky/TerminalGPT · terminalgpt/chat.py:52
def total_usage(self, total_usage: int):
self.__total_usage = total_usage
@property
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
)