Skip to content

Commit be67d03

Browse files
authored
style: refs work (#379)
1 parent d259483 commit be67d03

22 files changed

+59
-65
lines changed

libs/community/langchain_community/callbacks/clearml_callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def analyze_text(self, text: str) -> dict:
323323
text (str): The text to analyze.
324324
325325
Returns:
326-
(dict): A dictionary containing the complexity metrics.
326+
`dict` containing the complexity metrics.
327327
"""
328328
resp = {}
329329
textstat = import_textstat()

libs/community/langchain_community/callbacks/comet_ml_callback.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def _get_complexity_metrics(self, text: str) -> dict:
377377
text (str): The text to analyze.
378378
379379
Returns:
380-
(dict): A dictionary containing the complexity metrics.
380+
`dict` containing the complexity metrics.
381381
"""
382382
resp = {}
383383
if self.complexity_metrics:
@@ -397,7 +397,7 @@ def _get_custom_metrics(
397397
gen_idx (int): List index of the generated output
398398
399399
Returns:
400-
dict: A dictionary containing the custom metrics.
400+
dict: `dict` containing the custom metrics.
401401
"""
402402

403403
resp = {}

libs/community/langchain_community/callbacks/flyte_callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def analyze_text(
4848
nlp (spacy.lang): The spacy language model to use for visualization.
4949
5050
Returns:
51-
(dict): A dictionary containing the complexity metrics and visualization
51+
`dict` containing the complexity metrics and visualization
5252
files serialized to HTML string.
5353
"""
5454
resp: Dict[str, Any] = {}

libs/community/langchain_community/callbacks/mlflow_callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def analyze_text(
8787
textstat: The textstat library to use for complexity metrics calculation.
8888
8989
Returns:
90-
(dict): A dictionary containing the complexity metrics and visualization
90+
`dict` containing the complexity metrics and visualization
9191
files serialized to HTML string.
9292
"""
9393
resp: Dict[str, Any] = {}

libs/community/langchain_community/callbacks/tracers/wandb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ def create_trace(
424424
If provided, the created trace is added as a child to the parent trace.
425425
426426
Returns:
427-
Optional[Trace]: The created trace.
428-
If an error occurs during the creation of the trace, None is returned.
427+
The created trace. If an error occurs during the creation of the trace,
428+
None is returned.
429429
430430
Raises:
431431
Exception: If an error occurs during the creation of the trace,
@@ -443,7 +443,7 @@ def get_metadata_dict(r: "Run") -> Dict[str, Any]:
443443
r (Run): The run from which to extract metadata.
444444
445445
Returns:
446-
Dict[str, Any]: A dictionary containing the extracted metadata.
446+
`dict` containing the extracted metadata.
447447
"""
448448
run_dict = json.loads(r.json())
449449
metadata_dict = run_dict.get("metadata", {})

libs/community/langchain_community/callbacks/wandb_callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def analyze_text(
5656
output_dir (str): The directory to save the visualization files to.
5757
5858
Returns:
59-
(dict): A dictionary containing the complexity metrics and visualization
59+
`dict` containing the complexity metrics and visualization
6060
files serialized in a wandb.Html element.
6161
"""
6262
resp = {}

libs/community/langchain_community/chat_models/baidu_qianfan_endpoint.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ class Joke(BaseModel):
343343
""" # noqa: E501
344344

345345
init_kwargs: Dict[str, Any] = Field(default_factory=dict)
346-
"""init kwargs for qianfan client init, such as `query_per_second` which is
346+
"""init kwargs for qianfan client init, such as `query_per_second` which is
347347
associated with qianfan resource object to limit QPS"""
348348

349349
model_kwargs: Dict[str, Any] = Field(default_factory=dict)
@@ -375,7 +375,7 @@ class Joke(BaseModel):
375375
model: Optional[str] = Field(default=None)
376376
"""Model name.
377377
you could get from https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu
378-
378+
379379
preset models are mapping to an endpoint.
380380
`model` will be ignored if `endpoint` is set.
381381
Default is set by `qianfan` SDK, not here
@@ -475,8 +475,7 @@ def _convert_prompt_msg_params(
475475
resulting dictionary.
476476
477477
Returns:
478-
Dict[str, Any]: A dictionary containing the message content and default
479-
parameters.
478+
`dict` containing the message content and default parameters.
480479
481480
"""
482481
messages_dict: Dict[str, Any] = {

libs/community/langchain_community/chat_models/oci_data_science.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def _headers(
319319
the request is asynchronous.
320320
321321
Returns:
322-
Dict: A dictionary containing the appropriate headers for the request.
322+
`dict` containing the appropriate headers for the request.
323323
"""
324324
return {
325325
"route": DEFAULT_INFERENCE_ENDPOINT_CHAT,
@@ -829,7 +829,7 @@ class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):
829829
"""Number of most likely tokens to consider at each step."""
830830

831831
min_p: Optional[float] = 0.0
832-
"""Float that represents the minimum probability for a token to be considered.
832+
"""Float that represents the minimum probability for a token to be considered.
833833
Must be in [0,1]. 0 to disable this."""
834834

835835
repetition_penalty: Optional[float] = 1.0
@@ -853,7 +853,7 @@ class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):
853853
the EOS token is generated."""
854854

855855
min_tokens: Optional[int] = 0
856-
"""Minimum number of tokens to generate per output sequence before
856+
"""Minimum number of tokens to generate per output sequence before
857857
EOS or stop_token_ids can be generated"""
858858

859859
stop_token_ids: Optional[List[int]] = None
@@ -871,7 +871,7 @@ class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):
871871
tool_choice: Optional[str] = None
872872
"""Whether to use tool calling.
873873
Defaults to None, tool calling is disabled.
874-
Tool calling requires model support and the vLLM to be configured
874+
Tool calling requires model support and the vLLM to be configured
875875
with `--tool-call-parser`.
876876
Set this to `auto` for the model to make tool calls automatically.
877877
Set this to `required` to force the model to always call one or more tools.
@@ -991,9 +991,9 @@ class ChatOCIModelDeploymentTGI(ChatOCIModelDeployment):
991991
"""Total probability mass of tokens to consider at each step."""
992992

993993
top_logprobs: Optional[int] = None
994-
"""An integer between 0 and 5 specifying the number of most
995-
likely tokens to return at each token position, each with an
996-
associated log probability. logprobs must be set to true if
994+
"""An integer between 0 and 5 specifying the number of most
995+
likely tokens to return at each token position, each with an
996+
associated log probability. logprobs must be set to true if
997997
this parameter is used."""
998998

999999
@property

libs/community/langchain_community/document_loaders/csv_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
class CSVLoader(BaseLoader):
17-
"""Load a `CSV` file into a list of Documents.
17+
"""Load a `CSV` file into a list of `Document` objects.
1818
1919
Each document represents one row of the CSV file. Every row is converted
2020
into a key/value pair and outputted to a new line in the document's

libs/community/langchain_community/document_loaders/datadog_logs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def load(self) -> List[Document]:
8080
Get logs from Datadog.
8181
8282
Returns:
83-
A list of Document objects.
83+
A list of `Document` objects.
8484
- page_content
8585
- metadata
8686
- id

0 commit comments

Comments
 (0)