@@ -168,7 +168,7 @@ async def _get_contents_with_browser(self, url: str, browser: Browser) -> str:
168168 await page .close ()
169169
170170 def cast [T : msgspec .Struct ](
171- self , typ : type [T ], url : str , * , browser : Browser | None = None , extra_detail : str | None = None
171+ self , typ : type [T ], url : str , * , browser : Browser | None = None , details : str | None = None
172172 ) -> T :
173173 """
174174 Synchronously casts a webpage's content into a structured output.
@@ -191,10 +191,10 @@ def cast[T: msgspec.Struct](
191191 >>> data = webson.cast("https://example.com", to=PageData)
192192 >>> print(data.title)
193193 """
194- return run_sync (self .cast_async , typ , url , browser = browser , extra_detail = extra_detail )
194+ return run_sync (self .cast_async , typ , url , browser = browser , details = details )
195195
196196 async def cast_async [T : msgspec .Struct ](
197- self , typ : type [T ], url : str , * , browser : Browser | None = None , extra_detail : str | None = None
197+ self , typ : type [T ], url : str , * , browser : Browser | None = None , details : str | None = None
198198 ) -> T :
199199 """
200200 Asynchronously casts a webpage's content into a structured output.
@@ -221,7 +221,7 @@ async def cast_async[T: msgspec.Struct](
221221 # Convert the HTML to markdown for easier parsing.
222222 page_md = cast (str , md (page_contents ))
223223
224- extra = f"## Extra details: \n \n { extra_detail } " if extra_detail else ""
224+ extra = f"## Extra details: \n \n { details } " if details else ""
225225
226226 # Use the LLM to generate a structured response based on the markdown.
227227 completion = await self .llm .complete_async (
0 commit comments