Skip to content
Creating AI Assistants with GPT-4o
Code-along | 2024-06-11 | Creating AI Assistants with GPT-4o | Richie Cotton
Create a GPT-4o file search assistant that summarizes and explains arxiv papers about AGI.
The flow of this session is largely taken from the DataCamp OpenAI Assistants API Tutorial and the OpenAI Assistants API documentation.
Notes
- OpenAI considers this much of this code experimental, so expect some changes in the coming months.
Before you begin
- Make sure you have an OpenAI developer account.
- Your OpenAI developer account has credit on it.
- Define an environment variable named
OPENAI_API_KEYcontaining the API key.
Task 0: Setup
First we need to make sure that we are using the latest version of the OpenAI API package.
# Run this to install the latest version of the OpenAI package
!piprt install openai==1.33.0Hidden output
We need the os, openai, and pandas packages.
Instructions
- Import the
osandopenaipackages without an alias. - Import the
pandaspackage with its usual alias.
# Import the os package
import os
# Import the openai package
import openai
# Import the pandas package with an alias
import pandas as pdWe need to define an OpenAI client.
Instructions
- Define an OpenAI client. Assign to
client.
# Define an OpenAI client. Assign to client.
client = openai.OpenAI(api_key='API_KEY')Task 1: Upload the Papers