rstructor 0.5.0

Get structured, validated data out of LLMs as native Rust structs and enums. Derive a type and rstructor generates the JSON Schema, prompts the model, parses the reply, and retries on validation errors — across OpenAI, Anthropic Claude, Google Gemini, and xAI Grok. The Rust answer to Python's Pydantic + Instructor.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "portfolio_id": "HF-ALPHA-001",
  "as_of": "2026-07-24",
  "positions": {
    "AAPL": {
      "asset_class": "equity",
      "quantity": 125000,
      "mark_price": 213.76
    },
    "ESU6": {
      "asset_class": "future",
      "quantity": -240,
      "mark_price": 6378.25
    }
  }
}