Skip to content

Instantly share code, notes, and snippets.

@EnkrateiaLucca
Last active December 11, 2023 14:39
Show Gist options
  • Save EnkrateiaLucca/9e6d6abe51b1748ca831185d209e0d9f to your computer and use it in GitHub Desktop.
Save EnkrateiaLucca/9e6d6abe51b1748ca831185d209e0d9f to your computer and use it in GitHub Desktop.
Call to chatgpt
from openai import OpenAI
client = OpenAI()
def get_response(prompt_question):
response = client.chat.completions.create(
model="gpt-3.5-turbo-16k",
messages=[{"role": "system", "content": "You are a helpful research and\
programming assistant"},
{"role": "user", "content": prompt_question}]
)
return response.choices[0].message.content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment