mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-08 22:42:05 +00:00
docs: community docstring updates (#21040)
Added missed docstrings. Updated docstrings to consistent format.
This commit is contained in:
@@ -196,12 +196,15 @@ def extract_dict_elements_from_component_fields(
|
||||
def load_query(
|
||||
query: str, fault_tolerant: bool = False
|
||||
) -> Tuple[Optional[Dict], Optional[str]]:
|
||||
"""Attempts to parse a JSON string and return the parsed object.
|
||||
"""Parse a JSON string and return the parsed object.
|
||||
|
||||
If parsing fails, returns an error message.
|
||||
|
||||
:param query: The JSON string to parse.
|
||||
:return: A tuple containing the parsed object or None and an error message or None.
|
||||
|
||||
Exceptions:
|
||||
json.JSONDecodeError: If the input is not a valid JSON string.
|
||||
"""
|
||||
try:
|
||||
return json.loads(query), None
|
||||
|
Reference in New Issue
Block a user