> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rtvi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Messages

## Messages

Clients can send and receive arbitrary data messages to a bot.

Messages differ from [actions](./actions) in that they are not associated with a specific service and do not return a Promise.

Messages are used by a voice client for passing an instruction to a bot that typical results in a [callback or event](./callbacks).

Examples of messages include:

* `updateConfig`
* `describeConfig`
* `describeActions`

Developers can build their own messages and create handlers to respond to messages received from a bot either by extending `VoiceClient` with their own class or by building a [helper](./helpers/introduction).

### sendMessage()

This is a "fire and forget" function to send an arbitrary message to a bot. It does not wait for a response, so nothing is returned.

Most clients will not use this function directly. They will use [actions](./client-methods#action) and [helper methods](./helpers), instead.

It is up to the transport layer to pack and unpack messages, send messages over the wire, and deliver messages to the SDK so that events can be emitted.

```typescript
voiceClient.sendMessage(message);
```

### Anatomy of a message

```typescript
{
  label: "rtvi-ai",
  type: "EVENT_TYPE",
  data: { EVENT_TYPE_DATA }
}

// example message dispatch
voiceClient.sendMessage({
	label: "rtvi-ai",
	type: "myMessage",
	data: {
		"hello": "world"
  	}
});
```
