17 lines
430 B
Python
17 lines
430 B
Python
import discord
|
|
import os
|
|
|
|
import openai
|
|
|
|
|
|
def answer_question(prompt, user):
|
|
bots_context = "You are located in zipcode 94549. You are a chatbot written in python and you are answering questions for me"
|
|
|
|
openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
|
|
completion = openai.ChatCompletion.create(
|
|
model="gpt-3.5-turbo", messages=[{"role": user, "content": prompt}]
|
|
)
|
|
|
|
return completion.choices[0].message
|