# `LeXtract.ExampleData`
[🔗](https://github.com/YgorCastor/lextract.git/blob/main/lib/lextract/example_data.ex#L1)

Represents a training example for extraction with input text and expected output.

Used to provide few-shot examples to LLMs and for schema generation from examples.

## Fields

* `:input` - The input text to extract from
* `:output` - The expected output structure with extractions

## Examples

    iex> example = %LeXtract.ExampleData{
    ...>   input: "Patient takes aspirin 100mg daily",
    ...>   output: %{
    ...>     "extractions" => [
    ...>       %{
    ...>         "class" => "Medication",
    ...>         "medication_attributes" => %{
    ...>           "name" => "aspirin",
    ...>           "dosage" => "100mg"
    ...>         }
    ...>       }
    ...>     ]
    ...>   }
    ...> }
    iex> example.input
    "Patient takes aspirin 100mg daily"

# `t`

```elixir
@type t() :: %LeXtract.ExampleData{input: String.t(), output: map()}
```

# `new`

```elixir
@spec new(String.t(), map()) :: t()
```

Creates a new example data struct.

## Examples

    iex> example = LeXtract.ExampleData.new("text", %{"extractions" => []})
    iex> example.input
    "text"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
