File size: 329 Bytes
e27c97c
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from langchain_core.documents import Document


# Raw Documents to Langchain Documents
def get_langchain_docs(docs:str):
    lc_docs = []
    for doc in docs:
        document = Document(
            page_content=doc['content'],
            metadata=doc['metadata']
        )
        lc_docs.append(document)
    return lc_docs