Last active
December 11, 2023 14:39
-
-
Save EnkrateiaLucca/9e6d6abe51b1748ca831185d209e0d9f to your computer and use it in GitHub Desktop.
Call to chatgpt
This file contains 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 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