README.md

# DotPrompt

A high-performance, native Elixir compiler for the DotPrompt language.

## Installation

The package can be installed by adding `dot_prompt` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:dot_prompt, "~> 1.0.0"}
  ]
end
```

## Usage

### Compilation

```elixir
{:ok, result} = DotPrompt.compile("my_prompt", %{name: "John"})
IO.puts(result.prompt)
```

### Rendering

```elixir
{:ok, result} = DotPrompt.render("my_prompt", %{name: "John"}, %{weather: "sunny"})
IO.puts(result.prompt)
```

### Schema Extraction

```elixir
{:ok, schema} = DotPrompt.schema("my_prompt")
```

## Configuration

You can configure the prompts directory in your `config/config.exs`:

```elixir
config :dot_prompt,
  prompts_dir: "priv/prompts"
```

## Features

- **Fragments**: Reusable prompt snippets.
- **Vary Blocks**: A/B testing and variety in prompts.
- **Conditional Logic**: `if` and `case` blocks.
- **Dynamic Fragments**: Resolving fragments at runtime.
- **Response Contracts**: Declare expected response formats.