community[patch]: docstrings update (#20301)

Added missed docstrings. Format docstings to the consistent form.
This commit is contained in:
Leonid Ganeline
2024-04-11 13:23:27 -07:00
committed by GitHub
parent 2900720cd3
commit 7cf2d2759d
77 changed files with 162 additions and 125 deletions

View File

@@ -14,6 +14,8 @@ if TYPE_CHECKING:
class SetupMode(Enum):
"""Setup mode for AstraDBEnvironment as enumerator."""
SYNC = 1
ASYNC = 2
OFF = 3

View File

@@ -62,7 +62,7 @@ logger = logging.getLogger(__name__)
class Runtime(BaseModel):
"""This class represents a Runtime.
"""Pebblo Runtime.
Args:
type (Optional[str]): Runtime type. Defaults to ""
@@ -90,7 +90,7 @@ class Runtime(BaseModel):
class Framework(BaseModel):
"""This class represents a Framework instance.
"""Pebblo Framework instance.
Args:
name (str): Name of the Framework.
@@ -102,7 +102,7 @@ class Framework(BaseModel):
class App(BaseModel):
"""This class represents an AI application.
"""Pebblo AI application.
Args:
name (str): Name of the app.
@@ -124,7 +124,7 @@ class App(BaseModel):
class Doc(BaseModel):
"""This class represents a pebblo document.
"""Pebblo document.
Args:
name (str): Name of app originating this document.
@@ -148,8 +148,8 @@ class Doc(BaseModel):
def get_full_path(path: str) -> str:
"""Return absolute local path for a local file/directory,
for network related path, return as is.
"""Return an absolute local path for a local file/directory,
for a network related path, return as is.
Args:
path (str): Relative path to be resolved.
@@ -184,7 +184,7 @@ def get_loader_type(loader: str) -> str:
def get_loader_full_path(loader: BaseLoader) -> str:
"""Return absolute source path of source of loader based on the
"""Return an absolute source path of source of loader based on the
keys present in Document object from loader.
Args:
@@ -266,7 +266,7 @@ def get_runtime() -> Tuple[Framework, Runtime]:
def get_ip() -> str:
"""Fetch local runtime ip address
"""Fetch local runtime ip address.
Returns:
str: IP address

View File

@@ -22,7 +22,7 @@ def create_retry_decorator(
Union[AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun]
] = None,
) -> Callable[[Any], Any]:
"""Creates a retry decorator for Vertex / Palm LLMs."""
"""Create a retry decorator for Vertex / Palm LLMs."""
import google.api_core
errors = [
@@ -82,7 +82,7 @@ def init_vertexai(
def get_client_info(module: Optional[str] = None) -> "ClientInfo":
r"""Returns a custom user agent header.
r"""Return a custom user agent header.
Args:
module (Optional[str]):
@@ -109,7 +109,7 @@ def get_client_info(module: Optional[str] = None) -> "ClientInfo":
def load_image_from_gcs(path: str, project: Optional[str] = None) -> "Image":
"""Loads im Image from GCS."""
"""Load an image from Google Cloud Storage."""
try:
from google.cloud import storage
except ImportError:

View File

@@ -29,7 +29,7 @@ class YouHit(YouHitMetadata):
class YouAPIOutput(BaseModel):
"""The output from you.com api"""
"""Output from you.com API."""
hits: List[YouHit] = Field(
description="A list of dictionaries containing the results"
@@ -37,7 +37,7 @@ class YouAPIOutput(BaseModel):
class YouDocument(BaseModel):
"""The output of parsing one snippet"""
"""Output of parsing one snippet."""
page_content: str = Field(description="One snippet of text")
metadata: YouHitMetadata