View Source AI.Util (fnord v0.4.25)

Summary

Functions

Creates an assistant message object, representing the assistant's response.

This is the tool call message, which must come immediately before the tool_msg/3 message with the same tool_call_id (id).

Creates a system message object, used to define the assistant's behavior for the conversation.

This is the tool outputs message, which must come immediately after the assistant_tool_msg/3 message with the same tool_call_id (id).

Creates a user message object, representing the user's input prompt.

Types

@type model() :: %{name: String.t(), context_window: non_neg_integer()}
@type msg() :: %{
  :content => String.t(),
  :role => String.t(),
  optional(:name) => String.t(),
  optional(:tool_call_id) => String.t()
}

Functions

Creates an assistant message object, representing the assistant's response.

Link to this function

assistant_tool_msg(id, func, args)

View Source

This is the tool call message, which must come immediately before the tool_msg/3 message with the same tool_call_id (id).

Link to this function

split_text(input, max_tokens)

View Source

Creates a system message object, used to define the assistant's behavior for the conversation.

Link to this function

tool_msg(id, func, output)

View Source

This is the tool outputs message, which must come immediately after the assistant_tool_msg/3 message with the same tool_call_id (id).

Link to this function

truncate_text(text, max_tokens)

View Source

Creates a user message object, representing the user's input prompt.