Live data from Hacker News

Show HN: GPT-JSON – Structured and typehinted GPT responses in Python

github.com

11–20 of 76 posts

Re: Show HN: GPT-JSON – Structured and typehinted GPT responses in Python

#12

I like the idea, but I think a library that focuses on producing requests and parsing responses according to schema is better. Sending requests to the server is orthogonal to the purpose. What we've found useful in practice in dealing with similar problems: - Use json5 instead of json when parsing. It allows trailing commas. - Don't let it respond in true/false. Instead, ask it for a short sentence explaining whether…

Is it possible to give an example what a small embedded model would look like? Curious how to make something like this!

Re: Show HN: GPT-JSON – Structured and typehinted GPT responses in Python

#16

Idiot question, I'd like to register and pay for the ChatGPT API but can't find the link to get an API token :-)

You can get API keys from the page https://platform.openai.com/account/api-keys (which you can find open by clicking on your avatar and selecting "View API keys").

Re: Show HN: GPT-JSON – Structured and typehinted GPT responses in Python

#17
post #16

Idiot question, I'd like to register and pay for the ChatGPT API but can't find the link to get an API token :-)

You can get API keys from the page https://platform.openai.com/account/api-keys (which you can find open by clicking on your avatar and selecting "View API keys").

Thanks!

Re: Show HN: GPT-JSON – Structured and typehinted GPT responses in Python

#18

Idiot question, I'd like to register and pay for the ChatGPT API but can't find the link to get an API token :-)

If you already have an account with them: https://platform.openai.com/account/api-keys .

Thanks!

Re: Show HN: GPT-JSON – Structured and typehinted GPT responses in Python

#19

I like the idea, but I think a library that focuses on producing requests and parsing responses according to schema is better. Sending requests to the server is orthogonal to the purpose. What we've found useful in practice in dealing with similar problems: - Use json5 instead of json when parsing. It allows trailing commas. - Don't let it respond in true/false. Instead, ask it for a short sentence explaining whether…

Is it possible to give an example what a small embedded model would look like? Curious how to make something like this!

We just use https://www.sbert.net/. Compare the embedding of the answer with the embeddings of YES versus NO.

Re: Show HN: GPT-JSON – Structured and typehinted GPT responses in Python

#20
Langchain also has a built in Pydantic output parser https://python.langchain.com/en/latest/modules/prompts/outpu...

However I've found it to be generally unreliable and adds a lot of text to each call.

I suspect this can be improved by: - Only writing the parts of the spec which are needed, rather than the full JSON schema spec - Including relevant examples rather than arbitrary JSON schema examples

Post reply on HN