Add simple app functionality
This commit enables anyone to create a app and add 3 types of data sources: * pdf file * youtube video * website It exposes a function called query which first gets similar docs from vector db and then passes it to LLM to get the final answer.
This commit is contained in:
10
embedchain/utils.py
Normal file
10
embedchain/utils.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import re
|
||||
|
||||
|
||||
def clean_string(text):
|
||||
text = text.replace('\n', ' ')
|
||||
cleaned_text = re.sub(r'\s+', ' ', text.strip())
|
||||
cleaned_text = cleaned_text.replace('\\', '')
|
||||
cleaned_text = cleaned_text.replace('#', ' ')
|
||||
cleaned_text = re.sub(r'([^\w\s])\1*', r'\1', cleaned_text)
|
||||
return cleaned_text
|
||||
Reference in New Issue
Block a user