Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jackmpcollins
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
jackmpcollins
3y ago
1) The OpenAI API will be queried each time a "prompt-function" is called in python code. If you provide the `functions` argument in order to use function-calling then magentic will not execute the function the LLM has chosen, ins
32.
▲
by
jackmpcollins
3y ago
I found this was the most compact way to represent what I wanted to define, and makes it easy to keep the type hints for parameters. If you look inside `@prompt` it's creating a `PromptFunction` instance which I think would be a simila
33.
▲
by
jackmpcollins
3y ago
Oh, and some companies offer APIs that match the OpenAI API and there are some open-source projects that do this for llama running locally. Since those would be compatible with the openai python package they will work with magentic too - th
34.
▲
by
jackmpcollins
3y ago
Right now it just works with OpenAI chat models (gpt-3.5-turbo, gpt-4) but if there's interest I plan to extend it to have several backends. These would probably each be an existing library that implements generating structured output
35.
▲
by
jackmpcollins
3y ago
Yes, similar ideas. Marvin [asks the LLM to mimic the python function]( https://github.com/PrefectHQ/marvin/blob/f37ad5b15e2e77dd998... ), whereas in magentic the function signature just represents the inputs&#
36.
▲
Show HN: Magentic – Use LLMs as simple Python functions
(github.com)
283 points
by
jackmpcollins
3y ago
|
63 comments