---
title: "TIL: Sum Types With `instructor_ex`"
url: https://daily.dev/posts/til-sum-types-with-instructor-ex--7xuwfof6b
source_url: https://samrat.me/blog/til-sum-types-instructor-elixir
type: article
source: "Awesome Elixir"
published: 2024-02-15T21:50:05.794Z
updated: 2024-05-09T09:28:18.744Z
tags: ["elixir", "ecto"]
reading_time: 3
upvotes: 3
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TIL: Sum Types With `instructor_ex`

**[Awesome Elixir](https://daily.dev/sources/awelix)** · 3 min read · 3 upvotes · 0 comments

## Summary

The post discusses using the Instructor Elixir library to retrieve structured output from LLMs like OpenAI GPT models. It also covers defining Ecto schemas for survey questions and implementing sum types in Elixir using Ecto.Type behavior.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://samrat.me/blog/til-sum-types-instructor-elixir>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#elixir](https://daily.dev/tags/elixir), [#ecto](https://daily.dev/tags/ecto)

[View this post on daily.dev](https://daily.dev/posts/til-sum-types-with-instructor-ex--7xuwfof6b)
