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

# Data Events

> Data events allow a developer to specify and package multimodal sensor data as input and/or output of a lens.

Data events allow a developer to package and combine multimodal sensor so it can be used as real-time inputs to an active lens or to build offline datasets for fine-tuning and evaluating models.

Each data event has a type (e.g. data.text, data.json, data.base64\_img) that identifies the category of multimodal data, with the event\_data containing the associated payload (e.g. the text data, the json data, the base64 image).

The current data events are:

* [data.text](#data.text)
* [data.json](#data.json)
* [data.base64\_img](#data.base64_img)

# data.text

The **data.text** event can be used to embed textual data within an event message as part of a multimodal message.

## data.text parameters

<ParamField body="type: data.text" type="string" required>
  The data.text key identifies that this event is a text event.
</ParamField>

<ParamField path="event_data" type="object" required>
  Contains the text payload and associated metadata.

  <Accordion title="event_data parameters">
    <ParamField path="contents" type="str" required>
      The contents key contains the main body of the text data.
    </ParamField>
  </Accordion>
</ParamField>

## data.text example

```yaml theme={"system"}
type: data.text
event_data:
  contents: "Far out in the uncharted backwaters of the unfashionable end of the Western Spiral arm of the Galaxy lies a small unregarded yellow sun."
```

# data.json

The **data.json** event can be used to embed a base64 encoded image directly into an event message.

The **data.json** event is used to send images directly as input to a lens.

## data.json parameters

<ParamField body="type: data.json" type="string" required>
  The data.json key identifies that this event is a json dictonary.
</ParamField>

<ParamField path="event_data" type="object" required>
  Contains the JSON payload.
</ParamField>

## data.json example

```yaml theme={"system"}
type: data.json
event_data:
  some_key: some_value
  another_key: another_value
```

# data.base64\_img

The **data.base64\_img** event can be used to embed a base64 encoded image directly into an event message.

The **data.base64\_img** event is used to send images directly as input to a lens.

## data.base64\_img parameters

<ParamField body="type: data.base64_img" type="string" required>
  The data.base64\_img key identifies that this event is a base64 image event.
</ParamField>

<ParamField path="event_data" type="object" required>
  Contains the image payload and associated metadata.

  <Accordion title="event_data parameters">
    <ParamField path="contents" type="str" required>
      The base64 encoded image as a byte string.
    </ParamField>
  </Accordion>
</ParamField>

## data.base64\_img example

```yaml theme={"system"}
type: data.base64_img
event_data:
  contents: iVBORw0KGgoAAAANSUhEUgAAAAUAAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==
```
