mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 12:07:36 +00:00
community[patch]: docstrings (#16810)
- added missed docstrings - formated docstrings to the consistent form
This commit is contained in:
@@ -40,25 +40,33 @@ async def aenumerate(
|
||||
|
||||
|
||||
class IndexableBaseModel(BaseModel):
|
||||
"""Allows a BaseModel to return its fields by string variable indexing"""
|
||||
"""Allows a BaseModel to return its fields by string variable indexing."""
|
||||
|
||||
def __getitem__(self, item: str) -> Any:
|
||||
return getattr(self, item)
|
||||
|
||||
|
||||
class Choice(IndexableBaseModel):
|
||||
"""Choice."""
|
||||
|
||||
message: dict
|
||||
|
||||
|
||||
class ChatCompletions(IndexableBaseModel):
|
||||
"""Chat completions."""
|
||||
|
||||
choices: List[Choice]
|
||||
|
||||
|
||||
class ChoiceChunk(IndexableBaseModel):
|
||||
"""Choice chunk."""
|
||||
|
||||
delta: dict
|
||||
|
||||
|
||||
class ChatCompletionChunk(IndexableBaseModel):
|
||||
"""Chat completion chunk."""
|
||||
|
||||
choices: List[ChoiceChunk]
|
||||
|
||||
|
||||
@@ -301,7 +309,7 @@ def convert_messages_for_finetuning(
|
||||
|
||||
|
||||
class Completions:
|
||||
"""Completion."""
|
||||
"""Completions."""
|
||||
|
||||
@overload
|
||||
@staticmethod
|
||||
@@ -399,6 +407,8 @@ class Completions:
|
||||
|
||||
|
||||
class Chat:
|
||||
"""Chat."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.completions = Completions()
|
||||
|
||||
|
Reference in New Issue
Block a user