Tune.Adapter.JSON (Tune v0.5.0)

Copy Markdown View Source

DSPy-style JSON format: marked inputs and a JSON object reply.

Options:

  • :mode - required, :text or :structured. Text mode requests plain text and decodes the reply as one JSON object, optionally inside a single Markdown code fence. Structured mode requests a ReqLLM object output with the signature's output schema, validated strictly by ReqLLM.

Both modes take only declared output keys from the object; extra keys are ignored and missing keys are errors. There is no JSON repair and no automatic switch between modes. Structured provider support belongs to ReqLLM.

Differences from DSPy 3.5: no json_repair, no automatic structured-to-text fallback, and JSON type descriptions instead of Python annotations.