truncate_word#

langchain_community.utilities.sql_database.truncate_word(content: Any, *, length: int, suffix: str = '...') str[source]#

Truncate a string to a certain number of words, based on the max string length.

Parameters:
  • content (Any) –

  • length (int) –

  • suffix (str) –

Return type:

str