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

Function cut_tool_stream_events

tests/test_open_telemetry.py:781–784  ·  view source on GitHub ↗

The events of `tool_stream_events` up to a delta that leaves the input of its `tool_use` block open.

()

Source from the content-addressed store, hash-verified

779
780
781def cut_tool_stream_events() -> list[dict[str, Any]]:
782 """The events of `tool_stream_events` up to a delta that leaves the input of its `tool_use` block open."""
783 delta = {"type": "input_json_delta", "partial_json": '{"city": "SF", "days": '}
784 return [*tool_stream_events()[:5], {"type": "content_block_delta", "index": 1, "delta": delta}]
785
786
787# The events of a stream that ends before `message_stop`, and the parts that a stream helper has accumulated by then.

Calls 1

tool_stream_eventsFunction · 0.85

Tested by

no test coverage detected