View Source LangChain.Utils (LangChain v0.1.6)
Collection of helpful utilities mostly for internal use.
Summary
Functions
Return changeset errors as text with comma separated description.
Only add the key to the map if the value is present. When the value is a list,
the key will not be added when the list is empty. If the value is nil
, it
will not be added.
Translates an error message using gettext.
Translates the errors for a field from a keyword list of errors.
Functions
Return changeset errors as text with comma separated description.
@spec conditionally_add_to_map( %{required(any()) => any()}, key :: any(), value :: nil | list() ) :: %{ required(any()) => any() }
Only add the key to the map if the value is present. When the value is a list,
the key will not be added when the list is empty. If the value is nil
, it
will not be added.
Translates an error message using gettext.
Translates the errors for a field from a keyword list of errors.