Formatting utilities for the ReAct pattern implementation.
This module provides helper functions for formatting context and tool information into human-readable strings for LLM prompts.
Summary
Functions
Formats the available tools into a readable list.
Formats the current context into a readable string.
Functions
Formats the available tools into a readable list.
Parameters
tools: A list of tool modules
Returns
A formatted string listing available tools and their descriptions.
Examples
iex> tools = [Mojentic.LLM.Tools.DateResolver]
iex> Formatters.format_available_tools(tools)
"Tools available:\n- resolve_date: Take text that specifies a relative date, and output an absolute date\n..."
Formats the current context into a readable string.
Parameters
context: The current context containing query, plan, and history
Returns
A formatted multi-line string describing the current context.
Examples
iex> context = CurrentContext.new("What is the date next Friday?")
iex> Formatters.format_current_context(context)
"Current Context:\nThe user has asked us to answer the following query:\n> What is the date next Friday?\n..."