sonIA / utils.py
Davide Fiocco
Make isort/black happy
4bed6fd
raw
history blame
346 Bytes
import datetime
import json
def get_answer(input, context, engine):
answer = engine({"question": input, "context": context})
return answer["answer"]
def get_context():
now = datetime.datetime.now()
with open("context.json") as f:
context = json.load(f)["info"].replace("[YEAR]", str(now.year))
return context