View Source LangChain.ChatModels.ChatModel behaviour (LangChain v0.3.3)

Summary

Functions

Restore a ChatModel from a serialized config map.

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

Types

Callbacks

@callback call(
  t(),
  String.t() | [LangChain.Message.t()],
  [LangChain.Function.t()]
) :: call_response()
@callback restore_from_map(%{required(String.t()) => any()}) ::
  {:ok, struct()} | {:error, String.t()}
@callback serialize_config(t()) :: %{required(String.t()) => any()}

Functions

@spec restore_from_map(nil | %{required(String.t()) => any()}) ::
  {:ok, struct()} | {:error, String.t()}

Restore a ChatModel from a serialized config map.

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