dspy
dspy copied to clipboard
Add CohereVectorizer for Embed 3
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.
LGTM
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