finds.dev← search

// the find

minimaxir/simpleaichat

★ 3,500 · Python · MIT · updated Jul 2024

Python package for easily interfacing with chat apps, with robust features and minimal code complexity.

simpleaichat is a thin Python wrapper around the OpenAI chat completions API, aimed at reducing the boilerplate that LangChain forces on you. It handles session management, streaming, pydantic-based structured output, and a basic tool-calling pattern in a small, readable codebase. The target is developers who want to script against GPT-3.5/4 without inheriting a framework.

The session manager is genuinely useful — multiple independent conversations tracked by UUID, with save/load to CSV or JSON, without you writing that plumbing yourself. Structured output via pydantic schemas is clean: pass a BaseModel as output_schema and get back a typed dict, no regex parsing. The tool implementation sidesteps the usual prompt-parsing mess with a documented trick that's fast and predictable. Codebase is small enough to read in an afternoon, which is the whole point.

Last commit was July 2024 and the roadmap items (Claude, PaLM, Textual CLI) were never delivered — this project is effectively abandoned at a point when the OpenAI API it wraps has moved substantially. It only supports OpenAI; the promised multi-provider support never shipped, so you're locked in by design. No retry logic or rate-limit handling, which means any production use requires you to add your own wrapper around the wrapper. The async token counting gap is a known bug with no fix, documented as a known issue and left there.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →