# `LangChain.ChatModels.ChatModel`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L1)

# `call_response`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L9)

```elixir
@type call_response() ::
  {:ok,
   LangChain.Message.t()
   | [LangChain.Message.t()]
   | [LangChain.MessageDelta.t()]}
  | {:error, LangChain.LangChainError.t()}
```

# `t`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L15)

```elixir
@type t() :: Ecto.Schema.t()
```

# `tool`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L12)

```elixir
@type tool() :: LangChain.Function.t()
```

# `tools`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L13)

```elixir
@type tools() :: [tool()]
```

# `call`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L17)

```elixir
@callback call(
  t(),
  String.t() | [LangChain.Message.t()],
  [LangChain.Function.t()]
) :: call_response()
```

# `restore_from_map`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L27)

```elixir
@callback restore_from_map(%{required(String.t()) =&gt; any()}) ::
  {:ok, struct()} | {:error, String.t()}
```

# `retry_on_fallback?`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L23)

```elixir
@callback retry_on_fallback?(LangChain.LangChainError.t()) :: boolean()
```

# `serialize_config`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L25)

```elixir
@callback serialize_config(t()) :: %{required(String.t()) =&gt; any()}
```

# `restore_from_map`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L43)

```elixir
@spec restore_from_map(nil | %{required(String.t()) =&gt; any()}) ::
  {:ok, struct()} | {:error, String.t()}
```

Restore a ChatModel from a serialized config map.

# `serialize_config`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/chat_models/chat_model.ex#L33)

Create a serializable map from a ChatModel's current configuration that can
later be restored.

---

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