Add support for Cohere as model provider #42
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Had to do some refactoring to plug in another provider, reviewing individual commits might be easier than the whole thing, but at high level:
OpenAIProvider
type;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;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.