convert_to_secret_str#

langchain_core.utils.utils.convert_to_secret_str(value: SecretStr | str) SecretStr[source]#

Convert a string to a SecretStr if needed.

Parameters:

value (Union[SecretStr, str]) – The value to convert.

Returns:

The SecretStr value.

Return type:

SecretStr