# `LangchainPrompt.Message`
[🔗](https://github.com/exfoundry/langchain_prompt/blob/v0.1.0/lib/langchain_prompt/message.ex#L1)

A single message in a conversation with an LLM.

`content` is either a plain string or a list of content parts for multimodal
messages (text + images/files).

## Plain text message

    %Message{role: :user, content: "Hello"}

## Multimodal message (text + image)

    %Message{role: :user, content: [
      %{type: :text, content: "Describe this image"},
      %{type: :image, content: "base64...", media: :jpg}
    ]}

Multimodal messages are built automatically by `LangchainPrompt.execute/4`
when you pass `attachments`.

# `content_part`

```elixir
@type content_part() :: %{
  type: :text | :image | :file,
  content: String.t(),
  media: atom() | String.t() | nil
}
```

# `t`

```elixir
@type t() :: %LangchainPrompt.Message{
  content: String.t() | [content_part()],
  role: :system | :user | :assistant
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
