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

Method size

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

Source from the content-addressed store, hash-verified

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