Created
December 1, 2023 15:12
-
-
Save youtube-jocoding/3f32ffdc22809845ff0e449e71f0a202 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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