AshAi.Tool.Errors (ash_ai v0.6.1)

Copy Markdown View Source

Formats Ash errors as JSON:API error objects for tool responses.

This module handles error transformation to ensure that tool execution errors are returned in a consistent, parseable format that LLMs can understand and react to appropriately.

Summary

Functions

Formats an error as a JSON-encoded string of JSON:API errors.

Serializes a list of JSON:API error structs to maps.

Functions

format(domain, resource, error, action_type)

Formats an error as a JSON-encoded string of JSON:API errors.

serialize_errors(errors)

Serializes a list of JSON:API error structs to maps.