Send various types of events to channels, including streaming text messages and custom events
0 - Do not force end1 - Force end existing streams1 - Person channel2 - Group channel"ok" on success| Status Code | Description |
|---|---|
| 200 | Event sent successfully |
| 400 | Bad request - invalid parameters or event data |
| 500 | Internal server error |
___TextMessageStart event to initiate a stream___TextMessageContent events with message chunks___TextMessageEnd event to close the streamclient_msg_no must be used for all events in a streaming sessionforce=1 is used| Event Type | Purpose | Data Format |
|---|---|---|
___TextMessageStart | Initiates a streaming text message session | Initial content or metadata |
___TextMessageContent | Sends content chunks during streaming | Text chunk content |
___TextMessageEnd | Terminates a streaming text message session | Completion marker |
___ToolCallStart | Begins a tool/function call event | Tool name or metadata |
___ToolCallArgs | Sends arguments for tool calls | JSON formatted arguments |
___ToolCallEnd | Ends a tool call event | Completion status |
___ToolCallResult | Returns results from tool execution | JSON formatted results |
___ is treated as a custom event, useful for:
client_msg_no to ensure uniqueness| Error | Cause | Solution |
|---|---|---|
| Event type cannot be empty | No event.type provided | Ensure valid event type is provided |
| Stream already running in channel | Trying to start new stream when one is active | Use force=1 or wait for existing stream to end |
| Stream does not exist | Trying to send content to non-existent stream | Check if stream was created correctly |
| Stream is already closed | Sending content to closed stream | Start a new stream |