Skip to content

Instantly share code, notes, and snippets.

@jamesmurdza
Last active June 8, 2023 10:56
Show Gist options
  • Save jamesmurdza/12e016907a21f6ae991fb60896e88daf to your computer and use it in GitHub Desktop.
Save jamesmurdza/12e016907a21f6ae991fb60896e88daf to your computer and use it in GitHub Desktop.
import openai
import os
from dotenv import load_dotenv
load_dotenv()
openai.api_key = os.getenv("OPENAI_API_KEY")
messages = [
{"role": "user", "content": "Who won the world series in 2020?"}
];
response = openai.ChatCompletion.create(
model='gpt-3.5-turbo',
messages=messages,
max_tokens=193,
temperature=0,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment