Last active
November 21, 2023 01:59
-
-
Save itrobotics/4839a002eb514285a82453aa1815de57 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
os.environ['OPENAI_API_KEY'] = "your_openai_api_key" | |
from openai import OpenAI | |
client = OpenAI() | |
completion = client.chat.completions.create( | |
model="gpt-3.5-turbo", | |
messages=[ | |
{"role": "system", "content": "You are a poetic assistant, skilled in explaining complex programming concepts with creative flair."}, | |
{"role": "user", "content": "Compose a poem that explains the concept of recursion in programming."} | |
] | |
) | |
print(completion.choices[0].message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment