← Lesson
Observations and Truncation
Joeven
Run
Reset
Python loads on first run
LIMIT = 80 def pack(tool, result): raw = str(result) if len(raw) <= LIMIT: return {"tool": tool, "result": result, "truncated": False} preview = raw[:LIMIT] return { "tool": tool, "result": preview, "truncated": True, "hint": "call get_more with the same id", } print(pack("get_job", {"status": "ok"})) big = {"log": "x" * 200} obs = pack("get_logs", big) print("truncated", obs["truncated"], "len", len(str(obs["result"]))) print("small stays full", pack("ping", "pong")["truncated"]) print("hint present", "hint" in obs)
Run to execute this in your browser. Nothing is sent to a server.