Live data from Hacker News

Show HN: Python package for interfacing with ChatGPT with minimized complexity

github.com

1–10 of 36 posts

Re: Show HN: Python package for interfacing with ChatGPT with minimized complexity

#2
Didn't find this in the README: does it handle network/OpenAI errors via retries? In particular the very common "model is overloaded at the moment".

It's fine if not, I can imagine you want to keep it as simple as possible and outsource it to the library user.

Re: Show HN: Python package for interfacing with ChatGPT with minimized complexity

#3
post #2

Didn't find this in the README: does it handle network/OpenAI errors via retries? In particular the very common "model is overloaded at the moment". It's fine if not, I can imagine you want to keep it as simple as possible and outsource it to the library user.

I was mixed about putting it in the base package but you can get the same behavior with the tenacity package.

Re: Show HN: Python package for interfacing with ChatGPT with minimized complexity

#6

I hope you keep investing in this project- it’s a crowded field but I do think existing projects like Langchain and LLamaindex feel very bloated and beyond a refactor - sometimes we need fresh takes like this and start over.

I am: the reason I made simpleaichat is because I have a need for more controllable work with AI generation, and it was easier to create a package from scratch than to figure out how to hack LangChain.

Re: Show HN: Python package for interfacing with ChatGPT with minimized complexity

#7
post #2

Didn't find this in the README: does it handle network/OpenAI errors via retries? In particular the very common "model is overloaded at the moment". It's fine if not, I can imagine you want to keep it as simple as possible and outsource it to the library user.

I was mixed about putting it in the base package but you can get the same behavior with the tenacity package.

Yeah, I understand. Maybe it would be good to add a comment on it in the README, since most people will hit this problem.

Re: Show HN: Python package for interfacing with ChatGPT with minimized complexity

#8
post #2

Didn't find this in the README: does it handle network/OpenAI errors via retries? In particular the very common "model is overloaded at the moment". It's fine if not, I can imagine you want to keep it as simple as possible and outsource it to the library user.

I was mixed about putting it in the base package but you can get the same behavior with the tenacity package.

Errors are so common with these endpoints, not having retry out of the box just makes it harder to hack on which I think is against the spirit?

Re: Show HN: Python package for interfacing with ChatGPT with minimized complexity

#9
Nice!

Totally agree with the project goals, it seems too many other packages are created by people who are researchers (or enthusiasts) first and software developers second, and it shows.

I see you're using Pydantic. I've recently been playing with using pydantic to implement chatgpt functions, making it a bit easier to define functions (tools) with more control over the attributes, like this:

    class SearchWeb(pydantic.BaseModel):
        """
        Docstring description to help GPT figure out what this does, like functions in your library.
        """
        query: str = pydantic.Field(description="More info so GPT understands how to use this param")

    def handle(self):
        # my wrapper will call this to implement the tool after the arguments are parsed
        # at this point you can be sure self.query is correct and has passed any validation you might have

It's definitely more verbose than the function definitions you have now, but you get schema definition for free, and is more strict about option parsing. It also makes it easy to throw errors back at GPT if it hallucinated some parameters incorrectly.

...aaaanyways, great work there, I'll be following the progress!

Post reply on HN