The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
[Docs] add docs for youtube channel (#1072)
Deven Patel12e6eaf80231
diff --git a/docs/components/data-sources/overview.mdx b/docs/components/data-sources/overview.mdxindex 515f864c9..385ce7e98 100644--- a/docs/components/data-sources/overview.mdx+++ b/docs/components/data-sources/overview.mdx@@ -8,6 +8,7 @@ Embedchain comes with built-in support for various data sources. We handle the c<Card title="π° PDF file" href="/components/data-sources/pdf-file"></Card><Card title="π CSV file" href="/components/data-sources/csv"></Card><Card title="π JSON file" href="/components/data-sources/json"></Card>+ <Card title="π½οΈ Youtube Channel" href="/components/data-sources/youtube-channel"></Card><Card title="πΊ Youtube" href="/components/data-sources/youtube-video"></Card><Card title="π Text" href="/components/data-sources/text"></Card><Card title="π Documentation website" href="/components/data-sources/docs-site"></Card>diff --git a/docs/components/data-sources/youtube-channel.mdx b/docs/components/data-sources/youtube-channel.mdxnew file mode 100644index 000000000..4f54046c7--- /dev/null+++ b/docs/components/data-sources/youtube-channel.mdx@@ -0,0 +1,20 @@+---+title: 'π½οΈ Youtube Channel'+---++To add all the videos from a youtube channel to your app, use the data_type as `youtube_channel`.++<Note>+Make sure you have all the required packages installed before using this data type. You can install them by running the following command in your terminal.++```bash+pip install -u "embedchain[youtube]"+```+</Note>++```python+from embedchain import Pipeline as App++app = App()+app.add("@channel_name", data_type="youtube_channel")+```diff --git a/docs/components/data-sources/youtube-video.mdx b/docs/components/data-sources/youtube-video.mdxindex e5e70c803..2c2ffe6b9 100644--- a/docs/components/data-sources/youtube-video.mdx+++ b/docs/components/data-sources/youtube-video.mdx@@ -2,8 +2,7 @@title: 'πΊ Youtube'-----To add any youtube video to your app, use the data_type (first argument to `.add()` method) as `youtube_video`. Eg:+To add any youtube video to your app, use the data_type as `youtube_video`. Eg:```pythonfrom embedchain import Pipeline as Appdiff --git a/embedchain/embedchain.py b/embedchain/embedchain.pyindex e4144545f..cada461d4 100644--- a/embedchain/embedchain.py+++ b/embedchain/embedchain.py@@ -189,8 +189,7 @@ class EmbedChain(JSONSerializable):data_type = detect_datatype(source)# `source_hash` is the md5 hash of the source argument- hash_object = hashlib.md5(str(source).encode("utf-8"))- source_hash = hash_object.hexdigest()+ source_hash = hashlib.md5(str(source).encode("utf-8")).hexdigest()self.user_asks.append([source, data_type.value, metadata])diff --git a/embedchain/loaders/directory_loader.py b/embedchain/loaders/directory_loader.pyindex 72953f75b..bcc225f50 100644--- a/embedchain/loaders/directory_loader.py+++ b/embedchain/loaders/directory_loader.py@@ -27,6 +27,7 @@ class DirectoryLoader(BaseLoader):if not directory_path.is_dir():raise ValueError(f"Invalid path: {path}")+ logging.info(f"Loading data from directory: {path}")data_list = self._process_directory(directory_path)doc_id = hashlib.sha256((str(data_list) + str(directory_path)).encode()).hexdigest()@@ -44,6 +45,8 @@ class DirectoryLoader(BaseLoader):if file_path.is_file() and (not self.extensions or any(file_path.suffix == ext for ext in self.extensions)):loader = self._predict_loader(file_path)data_list.extend(loader.load_data(str(file_path))["data"])+ elif file_path.is_dir():+ logging.info(f"Loading data from directory: {file_path}")return data_listdef _predict_loader(self, file_path: Path) -> BaseLoader:diff --git a/embedchain/utils.py b/embedchain/utils.pyindex 9a149a878..b41030f30 100644--- a/embedchain/utils.py+++ b/embedchain/utils.py@@ -358,10 +358,6 @@ def is_valid_json_string(source: str):_ = json.loads(source)return Trueexcept json.JSONDecodeError:- logging.error(- "Insert valid string format of JSON. \- Check the docs to see the supported formats - `https://docs.embedchain.ai/data-sources/json`"- )return False