dspy icon indicating copy to clipboard operation
dspy copied to clipboard

Add CohereVectorizer for Embed 3

Open aidangomez opened this issue 1 year ago • 1 comments

Adds a new vectorizer for Cohere's Embed models analogous to OpenAIVectorizer. Details on the performance of the Embed 3 model can be found here

Of note, the Vectorizer interface doesn't specify whether a query versus a document is being embedded, but Cohere's embedding models produce different embeddings depending on the content you want to embed. The different options are in the docs, but taking this into account can product a fairly dramatic boost to performance.

aidangomez avatar Feb 19 '24 14:02 aidangomez

LGTM

insop avatar Feb 19 '24 20:02 insop

Hey @aidangomez , thanks so much for this PR! Looks great. I just moved import cohere inside the constructor to avoid breaking when it's not installed

okhat avatar Feb 21 '24 15:02 okhat