chatgpt-cli
chatgpt-cli copied to clipboard
Add support for Cohere as model provider
Had to do some refactoring to plug in another provider, reviewing individual commits might be easier than the whole thing, but at high level:
- Factor out OpenAI specific logic to
OpenAIProvider
type; - Factor out
stdout
writes out ofhttp.Caller
- that way other providers don't have to duplicate behavior embedded intohttp.Caller
, which is currently used for making OpenAI calls; - Add
CohereProvider
that could be plugged in based on newprovider
field in configuration;
I don't know if you are open to supporting other providers at all, so publishing bigger PR than ideal to get initial buy in, can break it down into more consumable chunks if necessary.
If accepted it would probably require adding defaults per provider, such as default model, to make switching easier on user.