Skip to content

Commit

Permalink
docs(helpers): mention inputJson event
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCraigie authored and stainless-app[bot] committed May 30, 2024
1 parent a1c2fbd commit e991c62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ returns an accumulated `Message` which is progressively built-up over events.
The event fired when a text delta is sent by the API. The second parameter returns a `textSnapshot`.
#### `.on('inputJson', (patialJson: string, jsonSnapshot: unknown) => …)`
The event fired when a json delta is sent by the API. The second parameter returns a `jsonSnapshot`.
#### `.on('message', (message: Message) => …)`
The event fired when a message is done being streamed by the API. Corresponds to the `message_stop` SSE event.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/MessageStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface MessageStreamEvents {
connect: () => void;
streamEvent: (event: MessageStreamEvent, snapshot: Message) => void;
text: (textDelta: string, textSnapshot: string) => void;
inputJson: (jsonDelta: string, jsonSnapshot: unknown) => void;
inputJson: (partialJson: string, jsonSnapshot: unknown) => void;
message: (message: Message) => void;
contentBlock: (content: ContentBlock) => void;
finalMessage: (message: Message) => void;
Expand Down

0 comments on commit e991c62

Please sign in to comment.