sweta-techie / OpenAI-API-Explorer

Beginner's guide to the OpenAI API: learn text generation, chat completions, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenAI API Explorer

Welcome to the OpenAI API Explorer repository!

Note : This is still a WIP repository, Don't forget to star ⭐ and follow this repository for new notebooks every week!

This repository attempts to become a gateway to mastering the OpenAI APIs for natural language processing and artificial intelligence tasks. This is a work-in-progress bootcamp designed to provide you with the knowledge and skills you need to harness the full potential of the OpenAI models through their APIs.

Through this repository, we will use available OpenAI models to explore -

  • Large Language Models like GPT 3.5
  • Multimodal Models like GPT 4
  • Text Embeddings Models and their application
  • Image generation diffusion models like DALL-E
  • Text to Speech Models
  • Audio to Text Models like Whisper

Through these models, we will attempt to understand concepts of -

  • Prompt Engineering
  • Supervised Fine Tuning (SFT)
  • Retrieval Augmented Generation (RAG)
  • AI Agents (OpenAI Assitants API)

... and more

Prerequisites

Before you begin, make sure you have the following:

  • An OpenAI API key: To access the OpenAI API, sign up for an API on www.openai.com

    You can also refer to the Day 0 Notebook for steps to create an OpenAI account and get an API key. OpenAI charges for the API calls. However, you receive credits from OpenAI for the first time sign up. For the purpose of the code here, the credits will be more than enough.

  • Python: Ensure that Python >=3.10.0 is installed on your system and that you can create a virtual environment for a safer and cleaner project setup.

  • Jupyter Notebooks: Install Jupyter Notebooks using Anaconda or pip

Getting Started

  1. Clone this repository to your local machine:

    git clone https://github.com/your-username/openai-api-bootcamp.git
    
  2. Navigate to the cloned repository:

    cd openai-api-bootcamp
    
  3. It's recommended to use a virtual environment to avoid conflicts with other projects or system-wide Python packages.

    Run the following command to create a virtual environment named venv (you can name it anything you like):

    python3 -m venv ./venv
    

    Activate the Virtual Environment:

    • On Windows, activate the virtual environment by running:

      venv\Scripts\activate.bat
      
    • On macOS and Linux, activate it with:

      source venv/bin/activate
      
  4. Install required Python packages:

    pip install -r requirements.txt
    
  5. Store your OpenAI API key in a .env file in the Notebooks folder:

    OPENAI_API_KEY=<YOUR API KEY>
    
    ### You can also look at the Notebooks\example_dot_env file in this repo for the structure. Remeber to rename to .env
    

Notebook Contents

/Notebooks/

Day 0 - Getting Started.ipynb

[Released : 28/APR/2024]

Go to Notebook

  • Installing the OpenAI python library
  • Creating an OpenAI account
  • Getting an API key
  • Setting up OpenAI Client
  • Making the first API Call

Day 1 - Text Generation with Chat Completions API

[Released : 28/APR/2024]

Go to Notebook

  • Introduction to LLMs
  • Understanding the available OpenAI LLMs
  • Looking at the OpenAI Chat Messages (Prompt) Structure
  • Studying Chat Completions API Parameters
  • Decoding the Chat Completions Response Object
  • Learning how to Stream responses
  • Looking at JSON Response format
  • Understanding Reproducibility
  • Learning about managing Tokens

Day 2 - Basic Prompt Engineering

[To be Released : 05/MAY/2024]

  • What is a prompt?
  • Writing Simple Prompts
  • Writing Clear Instructions
  • Zero/One/Few Shot Learning
  • Prompt Management

Day 3 - OpenAI Text Embeddings

[To be Released : TBD]

  • Brief Introduction to Embeddings
  • Embeddings API
  • Text Search with Embeddings
  • Clustering with Embeddings

Day 4 - Retrieval Augmented Generation with OpenAI & LangChain

[To be Released : TBD]

Day 5 - Supervised Fine-Tuning of OpenAI Models

To be Released : TBD]

Day 6 - AI Agents with OpenAI Assistants API

[To be Released : TBD]

Day 7 - Advanced Prompt Engineering

[To be Decided]

Day 8 onwards - TTS, Image, STT Models and beyond

[To be Decided]

Assets

Data : Data for the notebooks can be found in the Assets/Data directory.

Images : All explainer images used in the notebooks are stored in the Assets/Images directory.

Contributing

If you find any issues or have suggestions for improvement, feel free to open an issue or submit a pull request. Contributions from the community are highly encouraged and appreciated!

I'm also eager to hear back from you to guide this bootcamp. Please email me your suggestions at abhinav.kimothi.ds@gmail.com

License

This repository is licensed under the MIT LICENSE. See the LICENSE file for details.

Connect with Abhinav

Hi! I'm Abhinav, a data science and AI professional with over 15 years in the industry. Passionate about AI advancements, I constantly explore emerging technologies to push the boundaries and create positive impacts in the world. Let’s build the future, together!

Connect with me!

GitHub followers LinkedIn Medium Insta Mail X Linktree Gumroad

You can also book a time-slot with me

Static Badge Static Badge Static Badge

Also, read my ebooks for more on Generative AI!

About

Beginner's guide to the OpenAI API: learn text generation, chat completions, and more.

License:MIT License


Languages

Language:Jupyter Notebook 100.0%