Refactor code to improve readability and maintainability

This commit is contained in:
Mert Cobanov 2024-05-01 20:08:29 +03:00
parent d9de8deab6
commit a45c7c9e09
2 changed files with 1 additions and 2 deletions

View File

@ -57,8 +57,6 @@ def main():
llm_chain = setup_summarization_chain()
result = llm_chain.run(docs)
print(result)
if __name__ == "__main__":
main()

View File

@ -8,6 +8,7 @@ from langchain_core.prompts import PromptTemplate
def check_link(link):
"""The function `check_link` uses a regular expression to check if a given link is a valid YouTube video link."""
yt_regex = r"^(?:https?:\/\/)?(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]+)(?:\?.*)?$"
return re.match(yt_regex, link) is not None