MCPcopy Create free account
hub / github.com/microsoft/fara / log_long_command_as_params

Function log_long_command_as_params

webeval/scripts/eval_exp.py:361–377  ·  view source on GitHub ↗
(cmd_string, max_param_length=450)

Source from the content-addressed store, hash-verified

359
360
361def log_long_command_as_params(cmd_string, max_param_length=450): # Conservative limit
362 if len(cmd_string) <= max_param_length:
363 mlflow.log_param('cmd', cmd_string)
364 else:
365 # Split into chunks
366 chunks = []
367 start = 0
368 while start < len(cmd_string):
369 end = start + max_param_length
370 chunks.append(cmd_string[start:end])
371 start = end
372
373 mlflow.log_param('cmd_total_parts', len(chunks))
374 mlflow.log_param('cmd_full_length', len(cmd_string))
375
376 for i, chunk in enumerate(chunks):
377 mlflow.log_param(f'cmd_part_{i:02d}', chunk)
378
379
380

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected