Description
Description
Hello wonderful OpenCommit family! 🌈 Before diving in, I must express my admiration for the code owners and contributors of OpenCommit. You folks rock! 🎸 Now, I have another proposal aimed at amplifying OpenCommit's flexibility and interoperability. 📈
OpenCommit is currently restricted to using OpenAI as the backend. Allowing configuration for alternative backends would greatly increase the project's scope and applicability. 🌐
Suggested Solution
Implement a configuration mechanism that allows users to connect to any backend.
- Define a configuration schema with fields like
backend_url
,api_key
, andrequest_format
. - Store this configuration in a file (e.g.,
backend-config.json
) in~/.opencommit/
. - Read the configuration at startup to determine the backend.
- Create an abstract
BackendInterface
in TypeScript for backend integrations. - Develop specific backend classes that implement this interface.
- Use dependency injection to use the correct backend based on the configuration (?).
Alternatives
- Hardcoding multiple backend options, but this lacks scalability.
- Providing only a few select backends as options, but this limits the choice for users. (Self-hosted LLMs...)
Additional Context
This proposal opens up OpenCommit to a wider audience by supporting a variety of backend services. Users can connect to the backend that best fits their needs or preferences.
💡 I am excited to know what you think! Your feedback and ideas are invaluable. 💌
Thank you, OpenCommit family! 🎉