pymike00 / tinychat

🔮 TinyChat is a lightweight Desktop client for modern Language Models designed for straightforward comprehension. Supports OpenAI, Anthropic, Meta, Mistral, Google and Cohere APIs.
MIT License
38 stars 7 forks source link

Refactor specialized Client classes into Client and Handler classes #1

Closed pymike00 closed 8 months ago

pymike00 commented 8 months ago

The initial design utilized custom wrappers around the official OpenAI, Cohere, and Mistral clients. These wrappers provided a common interface to get chat responses and stored the "messages" / "chat_history" list during a session.

We've then transitioned to a dependency-less approach by performing direct requests to the API endpoints using specialized Client classes.

With this update, we are now splitting the code into 'Client' and 'Handler' classes. This allows for better separation of concerns while still keeping the code simple to understand, and is also a step towards the soon to be implemented functionality to load / save conversations.