# `Urchin.Prompt`
[🔗](https://github.com/urth-inc/urchin/blob/v0.4.0/lib/urchin/prompt.ex#L1)

A prompt definition advertised via `prompts/list`, plus helpers for building the
`PromptMessage` list returned by `prompts/get`.

Mirrors the `Prompt`, `PromptArgument` and `PromptMessage` types from the schema.

# `t`

```elixir
@type t() :: %Urchin.Prompt{
  arguments: [Urchin.Prompt.Argument.t()] | nil,
  description: String.t() | nil,
  icons: [map()] | nil,
  meta: map() | nil,
  name: String.t(),
  title: String.t() | nil
}
```

# `assistant_message`

```elixir
@spec assistant_message(Urchin.Content.block()) :: map()
```

Builds a `PromptMessage` with the `assistant` role.

# `message`

```elixir
@spec message(String.t(), Urchin.Content.block()) :: map()
```

Builds a `PromptMessage` with an explicit role (`"user"` or `"assistant"`).

# `new`

```elixir
@spec new(keyword() | map()) :: t()
```

Builds a prompt from a keyword list or map of attributes.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Serializes the prompt to its JSON-RPC wire shape.

# `user_message`

```elixir
@spec user_message(Urchin.Content.block()) :: map()
```

Builds a `PromptMessage` with the `user` role.

---

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