support claude
Hey,
I've been thinking about supporting Claude. I'll raise a PR once I am done. @thmsmlr If you have suggestions around this, please let me know.
i just read about claude being better at summarization, which is the task i'm playing with. Exciting to see if it performs better
Yep +1 from me. If there's anything I can do to help, e.g. try out the PR, let me know.
Yes, i'm in support. I don't think it should be too difficult, just a new adapter.
I have heard Claude really like XML style prompting. And while instructor_ex doesn't have much of an opinion on prompting style since it's mostly in control of the user, there are still a few prompts the instructor_ex does create and are hard coded.
As you play with it, let me know if this is a big issue. If so, we can create a separate PR to make internal prompt templating user configurable (like in the validation/re-asking code paths)
I am in middle of some experiments with claude. Will revert back later this week to gather review and more opinions.
Warning: you may see some bad code. Please bear with me. :)
@TwistingTwists paraphrasing Jacob Collier on musical creativity:
There is no such thing as "good code" or "bad code", it's just the code that feels right for you
Your contribution will be very appreciated no matter what (I will definitely enjoy using Claude), and someone can always improve it right after :smile:
i'd happily put some "bad code" through its paces :D
i'm rather excited to play with claude
@TwistingTwists if you feel comfortable with that, I would love to see where you are on this (either with a draft PR or a fork of yours?).
Claude was in theory blocked in my country, but not if you go through their console/API mode, so happy to test things out!
(no pressure of course, but happy to try things out & report stuff)
I'd push a branch out hopefully before next week starts. :) Got distracted a little this week :)
No problem really! Thanks!
https://github.com/PrefectHQ/marvin/pull/865/files
This PR feels nice for injecting prompts etc stuff
https://github.com/thmsmlr/instructor_ex/pull/38 is wip.
@thbar : need a little help on json parsing in this PR.
Would be nice to also be able to pass in the adapter with each call, since you might want to use the instructor across adapters in your code base, instead of being stuck with one. I could try to create a PR for that, if that's ok?
Nevermind, just realized that you can pass it inside config (naming was a bit misleading for me).
https://twitter.com/AnthropicAI/status/1775979799644934281
Anthropic going to support tool calling soon.
Do you still need to parse XML stuff ?
We can just rely on tool calls. :)
tool calls - turns out that might not be the best at the moment. see: https://twitter.com/jxnlco/status/1777350940502249532 for some practical experience on this.
Hey! This is looking great -- anything I can do to help get it over the line? I'd love to use it.
Will push it over this weekend. Will ping ya.
Solved in the latest release, {:instructor, "~> 0.1.0"}