How to use
- Paste a JSON sample, such as an API response or the structured output you expect from an LLM.
- Choose the target: Pydantic (Python), Go or Rust, and set the root type name.
- Nested objects become separate types. Missing or
nullfields becomeOptional/ pointers /Option<T>, and keys likeclassoruser-idare renamed with an alias.
FAQ
Does the Pydantic output work with LLM structured outputs?
Yes. The OpenAI Python SDK, Instructor and many agent frameworks accept a Pydantic BaseModel as the output schema. Add Field(description=...) to guide the model further.
How are numbers typed?
If every value seen at a position is a whole number, it becomes int / int64 / i64; otherwise float / float64 / f64. Use a sample with realistic values for best results.