Module strings

Module strings 

Source
Expand description

String utilities.

Adapted from langchain_core/utils/strings.py

Functionsยง

comma_list
Convert a list to a comma-separated string.
comma_list_display
Convert items that implement Display to a comma-separated string.
indent
Indent each line of text.
sanitize_for_postgres
Sanitize text by removing NUL bytes that are incompatible with PostgreSQL.
stringify_dict
Stringify a dictionary.
stringify_json_dict
Stringify a JSON object.
stringify_value
Stringify a value.
strip_lines
Remove leading and trailing whitespace from each line.
truncate
Truncate a string to a maximum length.