import openai
openai.api_key = "YOUR-KEY-HERE"
english_prompt = "Please answer only to the following question without any further explanations unless asked so. Question:"
def call_chatgpt_api(question: str):
messages = [{"role": "user", "content": f"{english_prompt} {question}"}]
chat = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=messages
)
reply = chat.choices[0].message.content
return reply
pip install deeppavlov==1.0.1
from deeppavlov import build_model, configs
model = build_model('kbqa_lcquad', download=True, install=True)
model(["Who is the director of Forrest Gump?”])
# ('Robert Zemeckis', ['Robert_Zemeckis'], ['SELECT ?uri WHERE { dbr:Forrest_Gump dbp:director ?uri. }'])