logancyang / obsidian-copilot

THE Copilot in Obsidian
https://www.obsidiancopilot.com/
GNU Affero General Public License v3.0
2.95k stars 204 forks source link

Cohere's Command-R and Command-R+ support #597

Closed o-mikhailovskii closed 1 month ago

o-mikhailovskii commented 1 month ago

Is your feature request related to a problem? Please describe. Although Cohere's API is used for embeddings and I found a request #471 for such a support closed, I was unable to use Cohere's LLMs.

Describe the solution you'd like Here is my proposed patch below from version 2.6.2. I am a newbie in TypeScript and did it how I could, so I am not shure that everything is correct. To ensure the extension is properly built I needed to update the Cohere library as well as change the target build from "es2018" to "es2020". I have not included the lock-file so that the changes more easily understandable.

cohere_no_lock.patch

logancyang commented 1 month ago

Looks like cohere doesn't conform to openai api format. If you open a PR I can take a look.