Earlier quoted context omitted.
Wait, someone made a similar comment as this elsewhere in the thread. So why don't you just upvote that? If you have your own thoughts, surely you could just think them to yourself while upvoting.
yikes. I was responding to them sidestepping the first commenter’s question.
Show HN: Fructose – LLM calls as strongly typed functions
91–100 of 105 posts
Re: Show HN: Fructose – LLM calls as strongly typed functions
#92Big proponent of guaranteed outputs for LLMs. I wrote a library awhile back (gpt-json) that did something similar by querying the OpenAI API. At the end of the day though while their responses are _highly likely_ to be valid JSON they're not guaranteed. There's only so much that can be done with remote calls to their model's black box. The future here really lies in compiling down context free grammars. They let you…
https://platform.openai.com/docs/guides/text-generation/json...
Re: Show HN: Fructose – LLM calls as strongly typed functions
#93Just put together a small project that uses GPT to find good job matches[1]
One of the most challenging things in making it useful for more users, is managing the prompt that include several pieces of user input, and need to return a specific format, with a structure that depends on what the user wants to include in the prompt
What’s the typical use case for this? Who needs it the most right now?
Thank you!
Re: Show HN: Fructose – LLM calls as strongly typed functions
#94Big proponent of guaranteed outputs for LLMs. I wrote a library awhile back (gpt-json) that did something similar by querying the OpenAI API. At the end of the day though while their responses are _highly likely_ to be valid JSON they're not guaranteed. There's only so much that can be done with remote calls to their model's black box. The future here really lies in compiling down context free grammars. They let you…
OpenAI lets you force valid JSON now https://platform.openai.com/docs/guides/text-generation/json...
Re: Show HN: Fructose – LLM calls as strongly typed functions
#95Earlier quoted context omitted.
Yeah the pyright doesn't like the annotated return type not being honored by the empty stub function. I wonder if there's a way to trick it. For your suggestion, the decorator would still be required to overload the function execution with the remote call, otherwise you'd just be calling the function body, but we have considered special wrapper return types to help play better with pyright (and also give programmatic…
> Yeah the pyright doesn't like the annotated return type not being honored by the empty stub function. I wonder if there's a way to trick it. Python has an existing convention for this (so its not a "trick"), the use of the special value Ellipsis (literal: ...) https://mypy.readthedocs.io/en/stable/stubs.html
Re: Show HN: Fructose – LLM calls as strongly typed functions
#96Earlier quoted context omitted.
Yeah the pyright doesn't like the annotated return type not being honored by the empty stub function. I wonder if there's a way to trick it. For your suggestion, the decorator would still be required to overload the function execution with the remote call, otherwise you'd just be calling the function body, but we have considered special wrapper return types to help play better with pyright (and also give programmatic…
> Yeah the pyright doesn't like the annotated return type not being honored by the empty stub function. I wonder if there's a way to trick it. Python has an existing convention for this (so its not a "trick"), the use of the special value Ellipsis (literal: ...) https://mypy.readthedocs.io/en/stable/stubs.html
@ai()
def stub() -> int:
"""docstring"""
...
# (use ... instead of "pass" in the function body)Re: Show HN: Fructose – LLM calls as strongly typed functions
#97I find it grating that all of these types of things say "LLMs" when in fact they literally only work with OpenAI. There are hundreds of variations of LLM models. When it works with only gpt-4-turbo or gpt-3.5-turbo, it's inaccurate to say it's a tool for LLMs in general.
Re: Show HN: Fructose – LLM calls as strongly typed functions
#98Lots of takeaways, blogs to read, things to implement, issues to address. On it!
Re: Show HN: Fructose – LLM calls as strongly typed functions
#99Big proponent of guaranteed outputs for LLMs. I wrote a library awhile back (gpt-json) that did something similar by querying the OpenAI API. At the end of the day though while their responses are _highly likely_ to be valid JSON they're not guaranteed. There's only so much that can be done with remote calls to their model's black box. The future here really lies in compiling down context free grammars. They let you…