MCPcopy Create free account
hub / github.com/AMAP-ML/Thinking-with-Map / truncate

Method truncate

demo/qwen_agent/tools/python_executor.py:183–187  ·  view source on GitHub ↗
(s, max_length=256)

Source from the content-addressed store, hash-verified

181
182 @staticmethod
183 def truncate(s, max_length=256):
184 half = max_length // 2
185 if len(s) > max_length:
186 s = s[:half] + '...' + s[-half:]
187 return s
188
189 def batch_apply(self, batch_code: List[str]) -> list:
190 from pebble import ProcessPool

Callers 5

batch_applyMethod · 0.95
get_topkMethod · 0.45
_get_the_front_partMethod · 0.45
_truncate_messageFunction · 0.45
_runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected