Mojentic.Examples.React.ToolCallAgent (Mojentic v1.2.0)

Copy Markdown View Source

Tool execution agent for the ReAct pattern.

This agent handles the actual execution of tools and captures the results, updating the context history with observations.

Summary

Functions

Receives and processes an InvokeToolCall event.

Functions

receive_event_async(broker, event)

Receives and processes an InvokeToolCall event.

Executes the specified tool with the provided arguments and updates the context with the results.

Parameters

  • _broker: LLM broker (unused by this agent)
  • event: InvokeToolCall event containing tool and arguments

Returns

  • {:ok, [InvokeDecisioning.t()]} with updated context
  • {:ok, [FailureOccurred.t()]} on error