community: toolkits docstrings (#23286)

Added missed docstrings. Formatted docstrings to the consistent form.

---------

Co-authored-by: ccurme <chester.curme@gmail.com>
This commit is contained in:
Leonid Ganeline
2024-06-22 07:37:52 -07:00
committed by GitHub
parent 0cd3f93361
commit 987099cfcd
38 changed files with 387 additions and 30 deletions

View File

@@ -1,4 +1,5 @@
"""Playwright web browser toolkit."""
from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Type, cast
@@ -58,6 +59,10 @@ class PlayWrightBrowserToolkit(BaseToolkit):
tools.
See https://python.langchain.com/docs/security for more information.
Parameters:
sync_browser: Optional. The sync browser. Default is None.
async_browser: Optional. The async browser. Default is None.
"""
sync_browser: Optional["SyncBrowser"] = None
@@ -103,7 +108,15 @@ class PlayWrightBrowserToolkit(BaseToolkit):
sync_browser: Optional[SyncBrowser] = None,
async_browser: Optional[AsyncBrowser] = None,
) -> PlayWrightBrowserToolkit:
"""Instantiate the toolkit."""
"""Instantiate the toolkit.
Args:
sync_browser: Optional. The sync browser. Default is None.
async_browser: Optional. The async browser. Default is None.
Returns:
The toolkit.
"""
# This is to raise a better error than the forward ref ones Pydantic would have
lazy_import_playwright_browsers()
return cls(sync_browser=sync_browser, async_browser=async_browser)