Skip to content

Commit bc8d3d7

Browse files
committed
Fix example notebook if playwright is not installed yet
1 parent 2e69143 commit bc8d3d7

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

examples/01_basics_notebook.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
},
3535
"outputs": [],
3636
"source": [
37-
"!pip install --upgrade neuralnoise"
37+
"!pip install --upgrade neuralnoise\n",
38+
"!playwright install --with-deps"
3839
]
3940
},
4041
{

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "neuralnoise"
3-
version = "1.3.0"
3+
version = "1.3.1"
44
description = "An AI-powered podcast studio that uses multiple AI agents working together."
55
authors = [
66
{ name = "Leonardo Piñeyro", email = "[email protected]" }

src/neuralnoise/extract.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
from pathlib import Path
55
from tempfile import NamedTemporaryFile
66
from textwrap import dedent
7-
from typing import AsyncIterator, Iterator
7+
from typing import AsyncIterator
88

99
import requests # type: ignore
10-
from crawl4ai import AsyncWebCrawler, CrawlResult
1110
from langchain_community.document_loaders import (
1211
BSHTMLLoader,
1312
PyMuPDFLoader,
@@ -30,6 +29,8 @@ def __init__(
3029
self.css_selector = css_selector
3130

3231
async def crawl(self, url: str, css_selector: str | None = None):
32+
from crawl4ai import AsyncWebCrawler
33+
3334
async with AsyncWebCrawler(verbose=True) as crawler:
3435
result = await crawler.arun(
3536
url,
@@ -38,11 +39,11 @@ async def crawl(self, url: str, css_selector: str | None = None):
3839

3940
return result
4041

41-
def _process_result(self, result: CrawlResult):
42+
def _process_result(self, result):
4243
if result.markdown is None:
4344
raise ValueError(f"No valid content found at {self.url}")
4445

45-
metadata: dict[str, str | None] = {
46+
metadata: dict[str, str | None] = { # type: ignore
4647
**(result.metadata or {}),
4748
"source": self.url,
4849
}

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)