
Master the fundamentals of generative AI and the OpenAI API, set up an account and API key, and build your first Python program with text completion and sentiment analysis.
Discover how this course is organized into short, hands-on lectures with quizzes and assignments, guiding you to set up Python, an IDE, and an OpenAI account and API key.
Download the zip from the lecture resources, unzip it, and access the openaiapidemo project with all completed scripts for hands-on practice throughout the course.
Download the lecture resources zip to access the slides, including a keynote file for Mac and a PowerPoint file for Windows. Use them and share the knowledge with peers.
Explore what artificial intelligence is by comparing human intelligence—reasoning, planning, abstract thinking, and problem solving—with how machines simulate thinking through data, machine learning algorithms, and models.
Learn what generative AI is, how it differs from traditional ML and deep learning, and how models like GPT generate new content using transformer networks.
Understand what OpenAI is and why the OpenAI API matters, enabling developers to use models for text, images, and more via a restful API with Python or JavaScript libraries.
Learn what ChatGPT is and how it uses OpenAI GPT-3.5 or GPT-4 models to answer questions, generate campaigns, and summarize text, while recognizing its limitations, biases, and occasional hallucinations.
Learn to set up and use ChatGPT, choose between GPT-3.5 and GPT-4, explore prompts and examples, and tailor responses with custom instructions.
Master prompt engineering by using action verbs and precise instructions to guide the model. Follow four guidelines—provide context, audience, style and format, and length—for clear, targeted outputs.
Learn to use ChatGPT for text summarization by applying prompt engineering, setting output limits and structure, and focusing on key areas to transform customer feedback into actionable insights.
Learn how text expansion boosts productivity by expanding brief prompts into detailed job descriptions and professional emails, using prompt engineering to control tone, length, structure, and audience.
Explore how ChatGPT can research and plan trips, use a travel planner role, apply prompt engineering and multi-step prompting to generate and update an eight-day Europe itinerary with budget estimates.
Learn how ChatGPT acts as a universal programmer across languages, generating, documenting, explaining, and debugging code—from Python to Java and C#—with practical prompts and examples.
Classify customer service tickets with chatgpt by routing them into technical issue, billing query, or product feedback categories using a role and context in prompts.
Explore how ChatGPT fuels marketing campaigns, crafting teaser and full trailers, social media buzz, and influencer partnerships for a crime comedy film launching December 7, 2023.
Discover how ChatGPT translates across languages using prompts in a dedicated translation window. Learn handling multilingual text, including Hindi, and translating quickly into English or any language.
Learn to use conditional prompting to generate a title only for English text, with language checks. Apply multi-condition prompts that rely on keywords like technology and translations in APIs context.
Learn to control output structure with prompts in ChatGPT, generating numbered or unordered lists, tables with columns, and structured paragraphs with clear headings for diverse use cases.
Generate sample data for testing by creating a CSV with ten customers (id, name, age, email, phone), then convert to a JSON array for a RESTful API.
Learn how to set up an OpenAI API account, manage billing and tokens, explore models from chat to codex, and secure API keys with reference to the API Platform docs.
Create a new python project in your IDE, name it openaiapidemo, and configure the interpreter. Install the official openai library to connect to OpenAI from your Python programs.
Learn to use the OpenAI API in action by creating a chat demo with a system prompt, user message, and assistant response using GPT 3.5 turbo.
Learn sentiment analysis with a Python-based sentiment_analyzer that classifies two reviews from reviews.txt, showing the first as positive and the second as slightly negative.
Learn to implement a text classification use case by preparing a list of companies and a simple categorize prompt to classify them into technology, pharmaceutical, and finance and banking sectors.
Explore how to prompt a model to explain Python code in one sentence using a code_explainer workflow and a system message 'you are a Python tutor', with a prime-checking example.
Learn how providing context to the model alters its responses through in-context training, using a Python tutoring example to explain the sum function and its syntax.
Build a chatbot and learn how ChatGPT-like applications maintain context using in-context learning, system and user messages, and iterative model responses.
Learn how text moderation identifies inappropriate content in online communities and chat bots, using OpenAI moderation models to flag text, identify categories, and tune policy-based thresholds.
Learn to moderate text with OpenAI's text-moderation-006 model via Moderations.create, pass inputs, inspect results, flagged status, categories, and category_scores for safe applications.
Enable streaming with the OpenAI chat completions API by setting stream to true, receive token chunks as deltas, and render them in real time in the UI.
Identify and handle common OpenAI Python library errors, including API, timeout, rate limit, API connection, invalid request, authorization, and service unavailable, using try/except and graceful retries.
practice error handling for openai api calls by wrapping requests in try blocks and catching authentication, bad request, api error, api connection, timeout, internal server error, and rate limit errors.
Explore Whisper, an OpenAI audio model that transcribes and translates speech to text, used in Python via the Transcribe method with optional language and json or text outputs.
Transcribe audio with the Whisper model via the OpenAI API using a Python example that downloads sample_english.m4a and prints the transcribed text.
Translate a French audio file to English using the whisper model via the OpenAI API, automatically detecting language and returning translated text for review.
Mix multiple models to transcribe audio and summarize content using whisper and GPT models. Transcribe aws_lambda.mp3, pass the text to the GPT model, and generate five bullet-point insights.
Learn to process lengthy audio by breaking it into chunks with pi dub's audio segment, create mp3 files, and transcribe each chunk with the api to assemble a complete transcript.
Install pyDub in your IDE and set up Python interpreter in PyCharm. Install ffmpeg via choco or brew and add its bin path to system path to enable audio manipulation.
Learn to chunk a large mp3 into two-second pieces using pydub, save each chunk as mp3, send them to whisper-1 for transcription, and concatenate the transcripts into a final output.
Explore text embeddings and vector representations that capture word and sentence meaning, and compare them with cosine similarity for applications in search, recommendations, and translation using OpenAI embeddings ada 002.
Learn to retrieve word and sentence embeddings with the embedding API using text-embedding-ada-002, by running a Python workflow that outputs numeric embedding data.
Learn to measure similarity between words and sentences using embeddings and cosine similarity with numpy in python, comparing hot and cold and you are good versus you are awesome.
Learn to compare multiple sentences dynamically by generating embeddings, iterating with nested loops, and computing similarity scores to reveal text similarity.
Learn to generate and edit images with GPT image models, using prompts, image size, and masking to guide edits, including an example of adding a tube to a pool.
Show how to edit images with GPT image models using a complete image and a masked version from the edit folder. Update image_editor.py and prompt to generate an edited image.
Explore function calling with the OpenAI chart completion API, define and pass functions like get stock price, and orchestrate model-driven calls to fetch stock data.
The lecture introduces function calling by building a stock_price_fetcher, illustrating how to fetch stock data with a function when the model lacks internet access.
Learn to implement function calling with the OpenAI API, define a get_stock_price function, pass parameters like symbol via JSON, and handle function calls and responses in Python.
Parse the model's response, check for a function_call, deserialize the function arguments from json, and invoke get_stock_price with the symbol. The result shows the stock price example for AAPL.
Validate function names and parameters in function calling with the OpenAI API, enforce least privilege, and confirm necessity to protect databases and messaging systems.
Learn to use the gpt-4-vision-preview model from Python to send text and image in a single request, using the prepared messages.txt, an image_url, and an explanation of the image.
OpenAI's GPT series of language models have created headlines the world over.This course equips learners with the tools and expertise needed to develop AI-powered solutions, enabling them to leverage OpenAI's state-of-the-art models for various real-world applications, including chatbots, content generation, translation, and more, making it an invaluable resource for those seeking to stay at the forefront of AI innovation. Enroll now and embark on your journey into the realm of OpenAI using Python!
This course is for Beginners and Experienced Programmers with knowledge of python who wants to use OpenAI Models in their applications.
Course Highlights:
Demystifying OpenAI: Gain a clear understanding of what OpenAI is, how it works, and why it's revolutionizing the AI landscape.
Getting Started with APIs: Explore the fundamentals of APIs and learn how to interact with OpenAI's API to access powerful AI models.
Exploring Use Cases: Discover a wide range of practical applications for OpenAI API across industries like content creation, chatbots, language translation, and more.
Hands-On Projects: Dive into real-world projects that will guide you through implementing OpenAI API in various scenarios, building your confidence with each exercise.
Creating Chatbots: Develop your very own chatbot using OpenAI's API, enhancing your understanding of natural language processing and conversation generation.
Content Generation: Learn how to generate creative and informative content with the help of AI models, giving your projects a competitive edge.
Language Translation: Explore the capabilities of language translation using OpenAI API and create a multilingual experience for your applications.
You will:
Understand the fundamentals of AI,Generative AI and OpenAI API
Setup OpenAI account and Key
Create and run your first OpenAI API Python Program
Learn how to process the JSON Response
Control the model behaviour by passing in different parameters
Use the Text Completion Model to do Sentimental Analysis
Use the Text Completion Model to classify text, generate code and more
Learn what roles are and how to use them in the request
Maintain the context across requests
Moderate text using the Text Moderation AI Model
Receive and Handle Multiple Responses
Handle errors gracefully
Control the quality of the response
Use Whisper AI model to generate text from audio
Translate audio from other languages to english
Use audio and text models together
Generate Images using GPT Image Models
Edit Images using GPT Image Models
Understand what text embeddings are
Work on various use-cases using the Open AI Embedding Models
Master Open AI API in simple steps
What are the requirements?
Python,PyCharm Community Edition or Any other IDE