Skip to content

Instantly share code, notes, and snippets.

@youtube-jocoding
Created December 1, 2023 15:12
Show Gist options
  • Save youtube-jocoding/3f32ffdc22809845ff0e449e71f0a202 to your computer and use it in GitHub Desktop.
Save youtube-jocoding/3f32ffdc22809845ff0e449e71f0a202 to your computer and use it in GitHub Desktop.
from dotenv import load_dotenv
import os
from openai import OpenAI
load_dotenv()
API_KEY = os.environ['OPENAI_API_KEY']
client = OpenAI(api_key=API_KEY)
file = client.files.create(
file=open("unsu.pdf", "rb"),
purpose="assistants"
)
print(file)
# file-ZS4L6QQ4fmc37MRynXIBDZPj
files = client.files.list()
print(files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment