feat: add local qna pair

This commit is contained in:
cachho
2023-06-23 11:43:33 +02:00
committed by Taranjeet Singh
parent df7614d349
commit ff2d5ce7fa
4 changed files with 52 additions and 2 deletions

View File

View File

@@ -0,0 +1,16 @@
from embedchain.utils import markdown_to_plaintext
class QnaPairLoader:
def load_data(self, content):
question, answer = content
answer = markdown_to_plaintext(answer)
content = f"Q: {question}\nA: {answer}"
meta_data = {
"url": "local",
}
return [{
"content": content,
"meta_data": meta_data,
}]