Skip to content
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

add spring boot starter of xinference #38

Merged
merged 13 commits into from
Dec 31, 2024

Conversation

alvinlee518
Copy link
Contributor

Issue

Closes #

Change

General checklist

  • There are no breaking changes
  • I have added unit and integration tests for my change
  • I have manually run all the unit tests in all modules, and they are all green
  • I have manually run all integration tests in the module I have added/changed, and they are all green

Checklist for adding new maven module

  • I have added my new module in the root pom.xml and langchain4j-community-bom/pom.xml

Checklist for adding new embedding store integration

  • I have added a {NameOfIntegration}EmbeddingStoreIT that extends from either EmbeddingStoreIT or EmbeddingStoreWithFilteringIT
  • I have added a {NameOfIntegration}EmbeddingStoreRemovalIT that extends from EmbeddingStoreWithRemovalIT

Checklist for changing existing embedding store integration

  • I have manually verified that the {NameOfIntegration}EmbeddingStore works correctly with the data persisted using the latest released version of LangChain4j

@Martin7-1 Martin7-1 added enhancement New feature or request P3 Medium priority theme: spring boot starter Issues/PRs related to Spring Boot starter labels Dec 25, 2024
Copy link
Collaborator

@Martin7-1 Martin7-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alvinlee518 Thank you! I'm wondering if we could still use Testcontainers to do IT.

No hurry, will try to review it next week :)

@Martin7-1 Martin7-1 added this to the 1.0.0-alpha2 milestone Dec 26, 2024
Copy link
Collaborator

@Martin7-1 Martin7-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alvinlee518 Thank you!

There are three opinions:

  1. The Spring Boot starter lacks resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports file.
  2. Please add new module to langchainj4-community-bom.
  3. I'm thinking about whether we should add @ConditionalOnMissingBean in every bea n definition, as users may want to register their custom bean. WDYT?

@alvinlee518
Copy link
Contributor Author

alvinlee518 commented Dec 27, 2024

@alvinlee518 Thank you!

There are three opinions:

  1. The Spring Boot starter lacks resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports file.
  2. Please add new module to langchainj4-community-bom.
  3. I'm thinking about whether we should add @ConditionalOnMissingBean in every bea n definition, as users may want to register their custom bean. WDYT?

@Martin7-1

use @ConditionalOnMissingBean to ensure only one Bean is loaded.
Additionally, adding anenabled field inProperties can provide better control over Bean loading.
eg:

    @Bean
    @ConditionalOnMissingBean
    @ConditionalOnProperty(prefix = PREFIX + ".chat-model", name = "enabled", havingValue = "true", matchIfMissing = true)
    public XinferenceChatModel xinferenceChatModel(Properties properties) 

alvinlee518 and others added 10 commits December 27, 2024 18:44
…oot-starter/src/main/java/dev/langchain4j/community/xinference/spring/AutoConfig.java

Co-authored-by: Martin7-1 <[email protected]>
…oot-starter/src/main/java/dev/langchain4j/community/xinference/spring/AutoConfig.java

Co-authored-by: Martin7-1 <[email protected]>
…oot-starter/src/main/java/dev/langchain4j/community/xinference/spring/AutoConfig.java

Co-authored-by: Martin7-1 <[email protected]>
…oot-starter/src/main/java/dev/langchain4j/community/xinference/spring/AutoConfig.java

Co-authored-by: Martin7-1 <[email protected]>
…oot-starter/src/main/java/dev/langchain4j/community/xinference/spring/AutoConfig.java

Co-authored-by: Martin7-1 <[email protected]>
…oot-starter/src/main/java/dev/langchain4j/community/xinference/spring/AutoConfig.java

Co-authored-by: Martin7-1 <[email protected]>
…oot-starter/src/main/java/dev/langchain4j/community/xinference/spring/AutoConfig.java

Co-authored-by: Martin7-1 <[email protected]>
…oot-starter/src/main/java/dev/langchain4j/community/xinference/spring/AutoConfig.java

Co-authored-by: Martin7-1 <[email protected]>
…oot-starter/src/main/java/dev/langchain4j/community/xinference/spring/AutoConfig.java

Co-authored-by: Martin7-1 <[email protected]>
Copy link
Collaborator

@Martin7-1 Martin7-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alvinlee518 Great job! Thank you!

@Martin7-1 Martin7-1 merged commit da54df5 into langchain4j:main Dec 31, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 Medium priority theme: spring boot starter Issues/PRs related to Spring Boot starter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants