GenAI.Message (GenAI Core v0.2.0)

GenAI.Message is now a unified message structure. It's contents may include tool calls, results, images, audio, text blurbs, etc.

Depending on compatibility with providers a universal GenAI.Message may need to be converted into a sequence of messages or altered in other ways. A message with tool calls for example would need to be converted into a tool call format for openai

Link to this section Summary

Link to this section Types

@type t() :: %GenAI.Message{
  content: term(),
  description: GenAI.Types.description(),
  finger_print: GenAI.Types.finger_print(),
  handle: GenAI.Types.node_handle(),
  id: GenAI.Types.node_id(),
  inbound_links: GenAI.Types.link_map(),
  meta: nil | map() | keyword(),
  name: GenAI.Types.name(),
  outbound_links: GenAI.Types.link_map(),
  role: term(),
  user: nil,
  vsn: float()
}

Link to this section Functions

Link to this function

apply_node_directives(this, graph_link, graph_container, session, context, options)

Link to this function

assistant(message, options \\ nil)

Link to this function

description(graph)

Callback implementation for GenAI.Graph.NodeBehaviour.description/1.

Link to this function

description(graph, default)

Callback implementation for GenAI.Graph.NodeBehaviour.description/2.

Callback implementation for GenAI.Graph.NodeBehaviour.handle/1.

Link to this function

handle(graph, default)

Callback implementation for GenAI.Graph.NodeBehaviour.handle/2.

Callback implementation for GenAI.Graph.NodeBehaviour.id/1.

Link to this function

image(resource, options \\ nil)

Load image resource.

Link to this function

inspect_custom_details(subject, opts)

See GenAI.Graph.NodeProtocol.DefaultProvider.inspect_custom_details/2.

Link to this function

inspect_full_detail(subject, opts)

See GenAI.Graph.NodeProtocol.DefaultProvider.inspect_full_detail/2.

Link to this function

inspect_high_detail(subject, opts)

See GenAI.Graph.NodeProtocol.DefaultProvider.inspect_high_detail/2.

Link to this function

inspect_low_detail(subject, opts)

See GenAI.Graph.NodeProtocol.DefaultProvider.inspect_low_detail/2.

Link to this function

inspect_medium_detail(subject, opts)

See GenAI.Graph.NodeProtocol.DefaultProvider.inspect_medium_detail/2.

Link to this function

message(role, message, options \\ nil)

Callback implementation for GenAI.Graph.NodeBehaviour.name/1.

Link to this function

name(graph, default)

Callback implementation for GenAI.Graph.NodeBehaviour.name/2.

Link to this function

new(options \\ nil)

Callback implementation for GenAI.Graph.NodeBehaviour.new/1.

Link to this function

system(message, options \\ nil)

Link to this function

user(message, options \\ nil)