-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cohere[patch]: update embeddings and rerank #5928
cohere[patch]: update embeddings and rerank #5928
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -27,7 +27,7 @@ const docs = [ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey team, I've flagged a change in the cohereRerank
instantiation that accesses an environment variable via process.env
. Please review this change to ensure it aligns with our environment variable handling practices.
@@ -28,7 +28,7 @@ const docs = [ | |||
const cohereRerank = new CohereRerank({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey team, just a heads up that I've flagged a change in the cohereRerank
instantiation that sets the apiKey
property using an environment variable. This is for your review to ensure it aligns with our best practices for handling environment variables.
@@ -20,6 +20,7 @@ const documents = [ | |||
test("CohereRerank can indeed rerank documents with compressDocuments method", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there! I've reviewed the code and noticed that the addition in this PR references an environment variable via process.env
. I've flagged this for your review to ensure it aligns with the project's requirements. Let me know if you have any questions!
@@ -70,8 +75,16 @@ export class CohereEmbeddings | |||
token: apiKey, | |||
}); | |||
this.model = fieldsWithDefaults?.model ?? this.model; | |||
|
|||
if (!this.model) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer to just make this a required param and ship a new minor version release along with your tool calling stuff
this.batchSize = fieldsWithDefaults?.batchSize ?? this.batchSize; | ||
this.inputType = fieldsWithDefaults?.inputType; | ||
this.embeddingTypes = | ||
fieldsWithDefaults?.embeddingTypes ?? this.embeddingTypes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to remove inputType
from CohereEmbeddingsParams
as well?
Thanks, see comments! Let's gear up for a minor version release along with your other PR. |
This PR makes the model parameter mandatory for CohereEmbeddings class and the CohereRerank class.
Along with that, adds a embed method for the CohereEmbeddings class, and some minor improvements and docs updates.