MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / size

Method size

tests/test_open_telemetry.py:6346–6347  ·  view source on GitHub ↗
(parts: list[Part])

Source from the content-addressed store, hash-verified

6344 return to_json(json.loads(values[OUTPUT])[0]["parts"]), truncated
6345
6346 def size(parts: list[Part]) -> int:
6347 return len(to_json([{"role": "assistant", "parts": parts}]))
6348
6349 assert fit([image, call, reasoning, text], size([image, call, reasoning, text])) == (
6350 to_json([image, call, reasoning, text]),

Callers

nothing calls this directly

Calls 2

to_jsonFunction · 0.90
utf8_sizeFunction · 0.70

Tested by

no test coverage detected