thmsmlr / instructor_ex

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

Could not compile instructor in livebook #25

Open Munksgaard opened 7 months ago

Munksgaard commented 7 months ago

When trying to run the quickstart example in my local livebook, I get this error:

Could not compile :instructor, no "mix.exs", "rebar.config" or "Makefile" (pass :compile as an option to customize compilation, set it to "false" to do nothing)
Unchecked dependencies for environment dev:
* instructor (/home)
  could not find an app file at "_build/dev/lib/instructor/ebin/instructor.app". This may happen if the dependency was not yet compiled or the dependency indeed has no app file (then you can pass app: false as option)
Munksgaard commented 7 months ago

Looks like the problem is the path specification.

TwistingTwists commented 7 months ago

Please change

{:instructor, path: Path.expand("../", __DIR__)}

To {:instructor, " ~> 0.0.5 "} in your livebook.

Munksgaard commented 7 months ago

Thank you, that works. I realize that changing this in the repo would mean having to update every time there's a new release, but having it like it currently is kind of defeats the purpose, imho. How do other libraries handle this?

TwistingTwists commented 7 months ago

You can use git source.

{:foobar, git: "https://github.com/elixir-lang/foobar.git"}

Munksgaard commented 7 months ago

I guess that could work. Explorer does it like this it seems, but I don't know how they make sure the tag is up to date.

TwistingTwists commented 7 months ago

You can put branch name. {:foobar, git: "https://github.com/elixir-lang/foobar.git", branch: "master"}

Munksgaard commented 7 months ago

Yeah, either could work. I leave it up to you to choose whether to change anything or just close this issue :-)

thmsmlr commented 6 months ago

Yeah.. no solution is great. Using :path like i am currently breaks when you try to import the livebook. Version pegging is tedious when you're developing new examples pre-release. Git suffers from the same issue, but may be the best option since at least you can develop docs against unreleased code, pre-release?