13P by xguru 2023-03-05 | favorite | 댓글과 토론

openai 모듈 import 후 쉽게 이용 가능

def query_gpt_35_turbo(query):  
  response = openai.ChatCompletion.create(  
    model="gpt-3.5-turbo"  
    messages=[{"role": "system", "content":"You are a helpful assistant that helps users generate ..."},  
    {"role":"user", "content": query}]  
  )  
  return response.choices[0].message.content