thmsmlr / instructor_ex

Structured outputs for LLMs in Elixir
https://hexdocs.pm/instructor
430 stars 48 forks source link

Make instructor usable with current `mix phx.new` install #59

Closed thbar closed 1 week ago

thbar commented 1 month ago

Today while starting a brand new Phoenix app using instructor, I got this error message:

❯ mix deps.get
Resolving Hex dependencies...
Resolution completed in 0.687s
Because the lock depends on swoosh 1.16.9 which depends on req ~> 0.5 or ~> 1.0, the lock requires req ~> 0.5 or ~> 1.0.
And because every version of instructor depends on req ~> 0.4.0, the lock is incompatible with instructor.
And because your app depends on the lock, no version of instructor is allowed.
So, because your app depends on instructor ~> 0.0.5, version solving failed.
** (Mix) Hex dependency resolution failed

Swoosh is the default in Phoenix at the moment, and brings req via ~> 0.5 or ~> 1.0 (optional).

In this PR, I propose we follow the same pattern.

Feel free to adapt, my main goal is to make sure we can use instructor by default with new Phoenix installs.

If someone needs a quick fix until this gets merged

defp deps do
  [
    {:phoenix, "~> 1.7.12"},
    {:instructor, "~> 0.0.5", github: "thbar/instructor_ex", branch: "bump-req"},
    {:phoenix_ecto, "~> 4.4"},
thmsmlr commented 1 week ago

ty