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

Function iteration

tests/test_open_telemetry.py:725–735  ·  view source on GitHub ↗

An entry of a response's `usage.iterations`.

(
    type: str, input_tokens: int = 10, output_tokens: int = 5, cache_read: int = 0, cache_creation: int = 0
)

Source from the content-addressed store, hash-verified

723
724
725def iteration(
726 type: str, input_tokens: int = 10, output_tokens: int = 5, cache_read: int = 0, cache_creation: int = 0
727) -> dict[str, Any]:
728 """An entry of a response's `usage.iterations`."""
729 return {
730 "type": type,
731 "input_tokens": input_tokens,
732 "output_tokens": output_tokens,
733 "cache_read_input_tokens": cache_read,
734 "cache_creation_input_tokens": cache_creation,
735 }
736
737
738def message_with(iterations: list[dict[str, Any]] | None) -> dict[str, Any]:

Calls

no outgoing calls

Tested by

no test coverage detected