WplAi.Decompiler (WPL-AI v1.6.6)

Copy Markdown View Source

Decompiles WPL JSON to WPL-AI text format.

This enables round-trip transformation and allows LLMs to edit existing plans in the more readable WPL-AI format.

Example

iex> json = %{"plan" => %{"name" => "Test", "type" => "workout", ...}}
iex> {:ok, text} = Decompiler.decompile(json)
iex> text
"""
PLAN "Test"
TYPE workout
...
"""

Summary

Functions

Decompile WPL JSON to WPL-AI text.

Decompile WPL JSON to WPL-AI text, raising on error.

Functions

decompile(json)

@spec decompile(map()) :: {:ok, String.t()} | {:error, term()}

Decompile WPL JSON to WPL-AI text.

Returns {:ok, text} on success, or {:error, reason} on failure.

decompile!(json)

@spec decompile!(map()) :: String.t()

Decompile WPL JSON to WPL-AI text, raising on error.