-
Notifications
You must be signed in to change notification settings - Fork 2k
feature:add Wenxin model client #795
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
Conversation
|
@markpollack Thank you for your time and support! Best regards, lvchzh |
hi, it seems we share an interest in the same area of contribution. I'd be happy to collaborate together, as I'm currently using the snapshot version locally |
|
@tzolov |
|
@maxjiang153 |
|
@tzolov Conflict has been resolved. |
|
Hey @lvchzh how can I test this client? |
If needed, I can provide AK/SK. |
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 your contribution @lvchzh
It looks good so far but there are still some important gaps to be filled in.
Please consider addressing the following issues:
- rename the
ACCESS_KEYandSECRET_KEYenvironment variables used for ITs toWENXIN_ACCESS_KEYandWENXIN_SECRET_KEYinstead. - add the
<artifactId>spring-ai-wenxin-spring-boot-starter</artifactId>dependency to the BOM's pom - Add missing
WenxinChatModelintegration Tests. You can mimic the OpenAI or MistralAI ITs for example. - Remove all empty classes like:
WenxinAudioSpeechModel,WenxinAudioSpeechOptions,WenxinAudioTranscriptionModel,WenxinAudioTranscriptionOptions,WenxinImageModel,WenxinImageOptions,WenxinImageProperties,WenxinAudioSpeechProperties,WenxinAudioTranscriptionProperties, . - Replace the following javadoc snippet
* @date 2024年05月14日 下午5:29
* @description:
with @since 1.0.0.
- Add Integration tests for the
WenxinAutoConfigurationand - Add Wenxin documentation to the https://github.com/spring-projects/spring-ai/tree/main/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat . Use the structure applied in the other chat api docs. For example the openai-chat.adoc.
@tzolov Environment Variable Naming: I have renamed the ACCESS_KEY and SECRET_KEY environment variables to WENXIN_ACCESS_KEY and WENXIN_SECRET_KEY to better reflect their purpose and avoid potential naming conflicts. Dependency Addition: I have added the spring-ai-wenxin-spring-boot-starter dependency to the BOM's pom file to ensure the Wenxin module can be correctly integrated into the project. Integration Tests: Referring to the integration tests (ITs) of OpenAI and MistralAI, I have added the missing WenxinChatModel integration tests to ensure the module's functionality and stability. Removing Empty Classes: All mentioned empty classes such as WenxinAudioSpeechModel, WenxinAudioSpeechOptions, etc., have been removed from the project to clean up the codebase and reduce maintenance burdens. Javadoc Annotation: I have changed the Javadoc date description in all files to @SInCE 1.0.0 to indicate that this feature has been introduced since version 1.0.0. Additional Integration Tests: Integration tests have been added for the WenxinAutoConfiguration to ensure the accuracy of its auto-configuration. Documentation Addition: I have added documentation about the Wenxin module in the official Spring AI documentation, including usage methods, configuration options, and sample codes, following the structure used in other API documents in the spring-ai project. The above adjustments have been pushed to the main branch, and I look forward to your further review and feedback. If there are any other areas that need adjustment, please let me know anytime! |
merge is necessary
@tzolov Can you help me review the code? If everything looks good, could you assist in merging it? |
|
@lvchzh Thanks for your contributions. If I understood correctly, the Wenxin/ERNIE models are available through the Baidu Qianfan platform. Is a dedicated If I look at the LangChain project, they have a single Baidu Qianfan module for the different supported models: https://python.langchain.com/v0.1/docs/integrations/llms/baidu_qianfan_endpoint/ |
As a developer, I was very excited when I first encountered this open-source project. It was inspiring to see a Java framework based on LLMs, and I approached the entire framework with great enthusiasm, conducting an in-depth study of its implementation. Based on the models I intended to use, I constructed an integration module by referring to the implementations of models supported by the framework. Regarding your mention of a potential duplication issue between submission #795 and this submission, I believe the connection is minimal, as there are fundamental differences in the model integration methods. There is no essential conflict between this submission and #795. Personally, I still hope to be accepted; if not, I will be very disappointed. Lastly, I want to thank you and the other developers for the feedback on the issues encountered during the submission process. |
|
@lvchzh thanks for your answer! I'm working on instrumenting Spring AI for observability, so I was trying to understand better the common traits among the different ChatModel implementations, both existing and under development, and make sure to surface the right information through the observation APIs. |
Okay, I understand your concerns. I will also continue to submit the relevant code. |
|
@lvchzh It is very difficult for us to accept and maintain models that aren't easily available for testing/development and tend to have docs in chinese only. We did create the Spring AI Community github organization for just such a purpose. You can read more about it here - https://github.com/spring-ai-community sorry for letting this PR hand out so long. If you are interested in developing and maintaining this model client, please submit an issue in https://github.com/spring-ai-community/community/issues/ |
Hi, this PR is add Wenxin model client and has passed unit testing.
I can provide my api_key if needed for testing
the PR content:
chat client
embedding client
spring starter
unit test
embedding client documents
For some reasons, products from OpenAI and others can't be directly used in Chinese Mainland.
QianFan is a big model platform, A variety of models are offered, among which ERNIE Speed and ERNIE Lite are fully free. Although their API design is quite strange.
the link: QianFan
If they can supported, it will further aid spring-ai to promotion in Chinese Mainland.
If necessary, I can take care of subsequent maintenance since I'm currently using them.