MCPcopy
hub / github.com/mudler/LocalAI / TruncateString

Function TruncateString

core/trace/backend_trace.go:210–215  ·  view source on GitHub ↗
(s string, maxLen int)

Source from the content-addressed store, hash-verified

208}
209
210func TruncateString(s string, maxLen int) string {
211 if len(s) <= maxLen {
212 return s
213 }
214 return s[:maxLen] + "..."
215}
216
217// TruncateToBytes caps a string at exactly maxBytes, preserving the leading
218// content and appending a marker so the UI knows the value was clipped.

Callers 15

DetectionFunction · 0.92
ModelScoreFunction · 0.92
ModelAudioTransformFunction · 0.92
ImageGenerationFunction · 0.92
SoundGenerationFunction · 0.92
recordMethod · 0.92
RerankFunction · 0.92
ModelTTSFunction · 0.92
ModelTTSStreamFunction · 0.92
tokenClassifyTraceFunction · 0.92
DepthFunction · 0.92
ModelTokenizeFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected