Skip to content

Commit

Permalink
docs(helpers): mention input json event
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCraigie committed May 30, 2024
1 parent 9f00950 commit 02d482c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,24 @@ 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":
event.text # " there"
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.
Expand Down

0 comments on commit 02d482c

Please sign in to comment.