MCPcopy Create free account
hub / github.com/bterwijn/memory_graph / limit_string

Function limit_string

memory_graph/utils.py:29–33  ·  view source on GitHub ↗

Limit the length of a string s to the 'max_string_length' in the config.

(s)

Source from the content-addressed store, hash-verified

27 pass
28
29def limit_string(s):
30 """ Limit the length of a string s to the 'max_string_length' in the config. """
31 if len(s) > config.max_string_length:
32 return s[:config.max_string_length] + '...'
33 return s
34
35def html_escape(s):
36 """ Escape HTML characters in 's' for safe display in the graph. """

Callers 1

prep_strFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected