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

Function close_stream

tests/test_open_telemetry.py:3727–3732  ·  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

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

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected