TIL: Sum Types With `instructor_ex`
2024-11-09
![]()
The article explores the use of the Instructor Elixir library to extract structured data from language models like OpenAI's GPT. It highlights the challenge of working with sum types, particularly in generating survey questions where responses involve multiple choice or sliding scales. The author illustrates how Ecto schemas and JSON schemas can be used to handle these types, allowing developers to generate and validate different question types, even though Ecto does not natively support sum types.
Was this useful?