American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

7 PM – AI Agent – Gamas

April 13 @ 7:00 pm - 8:00 pm

Today We Did
  1. We learned how to create Open AI API Key.
  2. We learned where in https://platform.openai.com website we can keep track of usage and billing.
  3. We learned about 122 different types of OpenAI models.
  4. We learned how to connect to OpenAI server using OpenAI python client SDK.
Homework
  1. Create Token Usage and Summary sections in your  “main.py” so it can keep track of the following tokens
    1. Total input_tokens
    2. Total output_tokens
    3. Total total_tokens
  2. So if you asked the OpenAI 4 questions, each of those question will use input_token, output_tokens and total tokens. Cumulate these 3 tokens individually and print the total tokens used so far. So every time you ask questions
  3. For example:
  4. AI Chat Bot - Token Counter
    Track how many tokens you use in your conversation!
    ============================================================
    
    Enter your question ('exit' to quit): What is the capital of Las Vegas state?
    
    [Question #1]
    Thinking...
    
    --- Token Usage ---
    Input tokens: 16, Output tokens: 30
    This request: 46 tokens
    
    SUMMARY
    Session input_tokens: 16, output_tokens: 30
    Session total: 46 tokens
    -------------------
    
    Answer: Las Vegas is a city, not a state. Las Vegas is located in the state of Nevada, and the capital of Nevada is Carson City.
    
    Enter your question ('exit' to quit): Who invented computer?
    
    [Question #2]
    Thinking...
    
    --- Token Usage ---
    Input tokens: 11, Output tokens: 100
    This request: 111 tokens
    
    SUMMARY
    Session input_tokens: 27, output_tokens: 130
    Session total: 157 tokens
    -------------------
    
    Answer: The modern computer as we know it was not invented by a single person, but rather evolved over time through the work of many innovators and inventors. However, one of the earliest forms of a programmable computer is attributed to Charles Babbage, an English mathematician and inventor, who designed the Analytical Engine in the 1830s. This early mechanical computer laid the foundation for the development of the modern computer. Other key figures in the history of computer development include Alan Turing, John von
    
    Enter your question ('exit' to quit):

Details

Date:
April 13
Time:
7:00 pm - 8:00 pm