Open jxnl opened 1 year ago
I like this idea. It would be useful to have the ability to reference an existing pydantic model e.g. via package path, rather than making the user do a compilation step and copy the results into their templates
@simonw mentions the possibility of adding an extract
command in #66
I'm also very in a command like this, I was thinking of implementing in a lib that depends on llm, but even better if it can be incorporated into llm
.
I was thinking of implementing this in a way that can be made independent of openai/functions, and allow the user to choose between strategies:
the second is highly error prone, but has the advantage of working with llama2 etc
Perhaps the last would be best suited to a plugin?
I'm also interested in approaches to integrate in-context examples here. It's not clear how well these work for the functions approach, the library would allow the user some choice of strategy here.
@jxnl instructor seems great, and well supported. Have you had any further thoughts about how to leverage it in combination with llm? Currently using both together is a little awkward as both have different ways of abstracting over different LLMs.
Hey I wrote a small lib around using function calls and pydatnic for extraction and i think some ideas could be appleid via the CLI or API I really like the CLI interface so i'd love to brain some some ways of doing the extraction via CLI.
Heres an example from my docs
The simplest is defining a model and making the model use it
Suggestion:
In the template you could even support some pattern like:
But a more interesting use case could be configuring it to extract Multiple UserDetails
If this was implemented well you could imagine having some cli tool out as jsonlines vs a single json object. It could even be streamed!
returns