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

Function close_stream

tests/test_open_telemetry.py:3726–3731  ·  view source on GitHub ↗

Closes `result` when it is a stream, which ends the span of its call.

(result: object)

Source from the content-addressed store, hash-verified

3724
3725
3726async def close_stream(result: object) -> None:
3727 """Closes `result` when it is a stream, which ends the span of its call."""
3728 if isinstance(result, Stream):
3729 result.close()
3730 elif isinstance(result, AsyncStream):
3731 await result.close()
3732
3733
3734def test_option_types_are_exported() -> None:

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected