-
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
community[minor]: feat: BaiduQianfan embeddings #4926
community[minor]: feat: BaiduQianfan embeddings #4926
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -0,0 +1,215 @@ | |||
import { Embeddings, type EmbeddingsParams } from '@langchain/core/embeddings'; |
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 new external HTTP request using the fetch
function in the code. This is for your review to ensure it aligns with our project's requirements and best practices. Let me know if you have any questions or need further clarification.
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.
Thanks for the update. I understand the importance of adhering to our project's requirements and best practices, especially when it involves integrating third-party services. The use of this external HTTP request is essential for incorporating BaiduQianFanEmbeddings support, which is crucial for our project's ability to process and analyze Chinese text effectively.
I've ensured that the implementation complies with our security standards and performance expectations. However, I'm open to feedback and willing to make any necessary adjustments to align with our project guidelines fully. Please let me know if there are any concerns or further clarifications needed.
Appreciate your support and looking forward to your feedback.
@@ -0,0 +1,215 @@ | |||
import { Embeddings, type EmbeddingsParams } from '@langchain/core/embeddings'; |
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 changes, and it looks like the addition of getEnvironmentVariable
is explicitly accessing environment variables. I've flagged this for your review to ensure it aligns with our environment variable handling practices. Let me know if you need further assistance with this.
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.
Thanks for the update. I understand the importance of adhering to our project's requirements and best practices, especially when it involves integrating third-party services. The use of this external HTTP request is essential for incorporating BaiduQianFanEmbeddings support, which is crucial for our project's ability to process and analyze Chinese text effectively.
I've ensured that the implementation complies with our security standards and performance expectations. However, I'm open to feedback and willing to make any necessary adjustments to align with our project guidelines fully. Please let me know if there are any concerns or further clarifications needed.
Appreciate your support and looking forward to your feedback.
…/zandko/langchainjs into feature/baidu_qianfan_embeddings
Thank you! |
Can you please run |
@@ -0,0 +1,7 @@ | |||
import { BaiduQianFanEmbeddings } from "@langchain/community/embeddings/baidu_qianfan"; | |||
|
|||
const embeddings = new BaiduQianFanEmbeddings(); |
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.
In Python QianFan
doesn't have a capital F
:
https://python.langchain.com/docs/integrations/text_embedding/baidu_qianfan_endpoint
Worth keeping this the same?
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.
The consistency of BaiduQianfanEmbeddings has been maintained.
|
||
this.modelName = fieldsWithDefaults?.modelName ?? this.modelName; | ||
|
||
if (this.modelName === 'tao-8k' && !!fieldsWithDefaults?.batchSize) { |
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.
Better to throw an error here instead of potentially misleading the user?
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.
You're right. I've made changes.
… naming consistency
…/zandko/langchainjs into feature/baidu_qianfan_embeddings
Executed |
Thanks! |
BaiduQianFanEmbeddings support, enhancing Chinese text analysis and processing capabilities for diverse applications.