chatgpt-cli icon indicating copy to clipboard operation
chatgpt-cli copied to clipboard

Add support for Cohere as model provider

Open daulet opened this issue 10 months ago • 3 comments

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 of http.Caller - that way other providers don't have to duplicate behavior embedded into http.Caller, which is currently used for making OpenAI calls;
  • Add CohereProvider that could be plugged in based on new provider 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.

daulet avatar Apr 27 '24 03:04 daulet