From 02d482c03c039bc635c4d35e04cebe4670e1762c Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Thu, 30 May 2024 15:51:22 +0100 Subject: [PATCH] docs(helpers): mention input json event --- helpers.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/helpers.md b/helpers.md index 399a9bba..55c249a2 100644 --- a/helpers.md +++ b/helpers.md @@ -79,7 +79,7 @@ print("accumulated message: ", accumulated.to_json()) #### `text` -This event is yielded whenever a `content_block_delta` event is returned by the API & includes the delta and the accumulated snapshot, e.g. +This event is yielded whenever a text `content_block_delta` event is returned by the API & includes the delta and the accumulated snapshot, e.g. ```py if event.type == "text": @@ -87,6 +87,16 @@ if event.type == "text": event.snapshot # "Hello, there" ``` +#### `input_json` + +This event is yielded whenever a JSON `content_block_delta` event is returned by the API & includes the delta and the accumulated snapshot, e.g. + +```py +if event.type == "input_json": + event.partial_json # ' there"' + event.snapshot # '{"message": "Hello, there"' +``` + #### `message_stop` The event is fired when a full Message object has been accumulated.