docs = text_splitter.split_documents([data], metadatas = [{'"user_id"' :  user_id}] )

The above should do the job

Refer Split by character | 🦜️🔗 Langchain (Look for the metadata section)

1 Like