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

# Messages and Parts

A message has a `role` (`user` or `assistant`) and a list of `parts`. Parts are the blocks your UI renders — text, an image the shopper sent, or product cards from a catalog tool.

## What the shopper sends

User parts are `text` and `image`. You can send either, or both.

<CodeGroup>
  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  // Text
  {
    role: "user",
    parts: [{ type: "text", text: "I need waterproof hiking boots for day hikes, under $200" }],
  }

  // Image search
  {
    role: "user",
    parts: [{ type: "image", url: "https://…/photo.jpg" }],
  }

  // Text + image
  {
    role: "user",
    parts: [
      { type: "text", text: "find boots like these" },
      { type: "image", url: "data:image/jpeg;base64,..." },
    ],
  }
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {"role": "user", "parts": [{"type": "text", "text": "I need waterproof hiking boots for day hikes, under $200"}]}

  {"role": "user", "parts": [{"type": "image", "url": "https://…/photo.jpg"}]}

  {
      "role": "user",
      "parts": [
          {"type": "text", "text": "find boots like these"},
          {"type": "image", "url": "data:image/jpeg;base64,..."},
      ],
  }
  ```

  ```json JSON theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "role": "user",
    "parts": [
      { "type": "text", "text": "find boots like these" },
      { "type": "image", "url": "data:image/jpeg;base64,..." }
    ]
  }
  ```
</CodeGroup>

`image.url` accepts a `data:` URL or a public `https://` URL. `data:` URIs are uploaded and rewritten server-side. If you send only an image, Channel3 searches for products matching it.

## What the agent sends

Assistant parts are `text` and `tool`. A tool part is one catalog call. Render `output.products` as product cards — same `Product` type as the [Search API](/guides/response-overview). Buy URLs already carry your affiliate tracking.

`tool_name` is `search_products`, `show_products`, or `compare_products`. The model may also run an internal lookup (`lookup_products`) that never appears in your UI.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "type": "tool",
  "tool_call_id": "call_1",
  "tool_name": "search_products",
  "input": { "query": "waterproof hiking boots for day hikes under $200" },
  "output": { "products": [ /* Product[] */ ], "next_page_token": "…" }
}
```

The assistant message may also include `suggestions`: tap-ready follow-ups for your UI, like "in brown instead".
