This repository contains a Jupyter Notebook titled api_integration.ipynb
which demonstrates the integration of OpenAI's API using Python. The notebook provides a step-by-step guide on how to effectively use OpenAI's API for prompt engineering.
The notebook covers the following key topics:
- Installation: Instructions on how to install the OpenAI library.
- API Key Integration: Steps to integrate the OpenAI API key for authenticating API requests.
- Function Definitions: Multiple functions are defined for interacting with the API, including sending requests and handling responses depending on the models used. For instance, o1, o1-mini, o1-preview, GPT-3.5-turbo, GPT-4, and GPT-4o.
- Prompt Engineering: Examples of simple prompt engineering techniques to demonstrate how to construct queries for AI models.
To use the notebook, you'll need to have Python installed along with Jupyter Notebook or JupyterLab. Follow these steps to set up your environment:
- Clone this repository to your local machine.
git clone https://github.com/rishabh-panda/applied-openai-llms.git
- Navigate to the cloned directory.
cd applied-openai-llms
- Install the required Python packages.
pip install jupyter notebook openai
- Open the
api_integration.ipynb
notebook.
You need to have an OpenAI API key to execute the API calls in the notebook.
Ensure that your API key is securely stored and not exposed in the notebook.