Skip to content

Commit 74d58df

Browse files
committed
.
1 parent 49355d3 commit 74d58df

File tree

3 files changed

+34
-13
lines changed

3 files changed

+34
-13
lines changed

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ version = "v0.1.4"
44
description = "Turn any webpage into structured outputs!"
55
readme = "README.md"
66
requires-python = ">=3.13"
7-
dependencies = ["architecture>=0.5.44", "intellibricks>=0.7.24", "markdownify>=0.14.1", "msgspec>=0.19.0", "playwright>=1.49.1", "requests>=2.32.3"]
7+
dependencies = [
8+
"architecture>=0.5.44",
9+
"intellibricks>=0.7.24",
10+
"markdownify>=0.14.1",
11+
"msgspec>=0.19.0",
12+
"playwright>=1.49.1",
13+
"requests>=2.32.3",
14+
]
815

916
[[project.authors]]
1017
name = "Arthur Brenno"

src/webson/_webson.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import msgspec
3838
from architecture import log
3939
from architecture.utils.functions import run_sync
40-
from intellibricks.llms import Synapse, SynapseCascade
40+
from intellibricks.llms import Synapse, SynapseCascade, SynapseProtocol
4141
from intellibricks.llms.util import get_struct_from_schema
4242
from markdownify import markdownify as md
4343
from playwright.async_api import async_playwright, Browser
@@ -59,28 +59,28 @@ class Webson(msgspec.Struct):
5959
A class for extracting webpage contents and converting them into structured data using an LLM.
6060
6161
Attributes:
62-
llm (Synapse | SynapseCascade):
62+
llm (SynapseProtocol):
6363
The underlying LLM interface used for generating structured outputs.
6464
timeout (int | None):
6565
Optional timeout (in milliseconds) for page loads in Playwright.
6666
"""
6767

68-
llm: Synapse | SynapseCascade
68+
llm: SynapseProtocol
6969
"""The synapse weaver used to perform its operations."""
7070

7171
timeout: int | None = None
7272
"""Timeout (in milliseconds) to use for page loads. If None, the default timeout is used."""
7373

7474
@classmethod
75-
def create(cls, llm: Synapse | SynapseCascade | OpenAI | None) -> Webson:
75+
def create(cls, llm: SynapseProtocol | OpenAI | None) -> Webson:
7676
"""
7777
Creates a Webson instance from an LLM instance.
7878
7979
This factory method accepts an instance of either Synapse, SynapseCascade, or OpenAI.
8080
When an OpenAI instance is provided, it wraps it as a Synapse using the 'gpt-4o' model.
8181
8282
Args:
83-
llm (Synapse | SynapseCascade | OpenAI): The LLM instance to be used.
83+
llm (SynapseProtocol | OpenAI): The LLM instance to be used.
8484
8585
Returns:
8686
Webson: A new instance of Webson configured with the appropriate llm.

uv.lock

Lines changed: 21 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)