Jido.Chat.UserInfo (Jido Chat v1.2.0)

Copy Markdown View Source

Normalized provider user information.

The id is the user identifier from one adapter. It is not a cross-platform identity. Adapters and runtimes can cache this data, but jido_chat does not provide a global user cache.

Summary

Functions

Builds user information from serialized map data.

Creates normalized user information from atom-keyed or string-keyed input.

Returns the Zoi schema for UserInfo.

Serializes user information into a plain map with a type marker.

Types

t()

@type t() :: %Jido.Chat.UserInfo{
  avatar_url: nil | nil | binary(),
  display_name: nil | nil | binary(),
  email: nil | nil | binary(),
  id: binary(),
  is_bot: boolean(),
  metadata: map(),
  username: nil | nil | binary()
}

Functions

from_map(map)

@spec from_map(map()) :: t()

Builds user information from serialized map data.

new(attrs)

@spec new(map()) :: t()

Creates normalized user information from atom-keyed or string-keyed input.

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for UserInfo.

to_map(user)

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

Serializes user information into a plain map with a type marker.