AshAi.Actions.Prompt.Adapter.RequestJson (ash_ai v0.2.2)
View SourceAn adapter for prompt-backed actions that requests JSON output directly in the prompt.
This adapter is designed for LLMs that don't support native tool calling or structured outputs. It embeds the JSON schema in the system prompt and uses LangChain's JsonProcessor to extract the JSON response from markdown code blocks.
Adapter Options
:max_retries
- Maximum number of retry attempts for invalid JSON (default: 3):json_format
- Format to request JSON in (:markdown, :xml) (default: :markdown):include_examples
- Examples to include in prompt. Options:true
- Generate examples using Ash.Type.generator (default)false
- No examples%{"result" => example_data}
- Use provided example data[%{"result" => example1}, %{"result" => example2}]
- Multiple examples
Summary
Functions
Callback implementation for AshAi.Actions.Prompt.Adapter.run/2
.
Functions
Callback implementation for AshAi.Actions.Prompt.Adapter.run/2
.