strawberry/strawberry.py
somewheresy f7e632551b
Update strawberry.py
Implement dotenv for better secrets management
2024-08-12 13:05:13 -04:00

22 lines
512 B
Python

import os
from openai import OpenAI
from dotenv import load_dotenv
load_dotenv()
beta_headers = {
"authorization": f"Bearer {os.environ['OPENAI_API_KEY']}",
"openai-beta": "early-access-strawberry"
}
client = OpenAI(default_headers=beta_headers)
completion = client.chat.completions.create(
model="gpt-4o-large-2024-08-13",
messages=[
{"role": "system", "content": "use your level two capabilities"},
{"role": "user", "content": "give us ubi"}
]
)
print(completion.choices[0].message)