sanatan_ai / modules /config /yt_metadata.py
vikramvasudevan's picture
Upload folder using huggingface_hub
cc0b1f9 verified
from modules.config.categories import ScriptureCategoryConstants
yt_metadata_config = {
"name": "yt_metadata",
"title": "Sampradayam in YouTube",
"category" : ScriptureCategoryConstants.SOCIAL_MEDIA,
"output_dir": "./output/yt_metadata",
"collection_name": "yt_metadata",
"collection_embedding_fn": "openai",
"unit": "video",
"field_mapping": {
"text": "description",
"relative_path": "video_title",
"author": "channel_title",
"reference_link": lambda doc: f"https://www.youtube.com/watch?v={doc.get('video_id','')}",
},
"metadata_fields": [
{
"name": "video_id",
"label": "Video ID",
"datatype": "str",
"description": "The video id as in YouTube",
"show_as_filter": True,
"is_unique": True,
},
{
"name": "video_title",
"label": "Video Title",
"datatype": "str",
"description": "The title of the video as in YouTube",
"show_as_filter": True,
},
{
"name": "description",
"label": "Video Description",
"datatype": "str",
"description": "Description as in YouTube",
"show_as_filter": True,
},
{
"name": "channel_url",
"label": "Channel URL",
"datatype": "str",
"description": "URL of the YouTube Channel",
},
{
"name": "channel_title",
"label": "Channel Title",
"datatype": "str",
"description": "Title of the YouTube Channel",
"show_as_filter": True,
},
],
"pdf_path": "./data/none.pdf",
"source": "https://youtube.com",
"language": "san+eng+tam",
"example_labels": ["Srirangam", "Pasuram video"],
"examples": [
"Show me YouTube videos that talk about Srirangam",
"Show me lyrics of 1st pasuram of 1st decade in the 4st Thiruvaimozhi. Also show the related youtube videos.",
],
"llm_hints": [
"if the user asks for YouTube videos, DO NOT do a web search, instead do a search on this collection."
],
}